	.file	"extr_kern_proc.c_pgdelete_dropref.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"pg_deleteref: manipulating refs of already terminating session"
	.align 8
.LC1:
	.string	"pg_deleteref: terminating already terminated session"
	.align 8
.LC2:
	.string	"pg_deleteref: freeing session in use"
	.text
	.p2align 4
	.type	pgdelete_dropref, @function
pgdelete_dropref:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	call	pgrp_lock@PLT
	cmp	QWORD PTR 0[rbp], 0
	mov	rdi, rbp
	je	.L23
	call	pgrp_unlock@PLT
	xor	eax, eax
	call	proc_list_lock@PLT
	sub	QWORD PTR 8[rbp], 1
.L3:
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	proc_list_unlock@PLT
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	call	pgrp_unlock@PLT
	xor	eax, eax
	call	proc_list_lock@PLT
	mov	rax, QWORD PTR 8[rbp]
	sub	rax, 1
	cmp	QWORD PTR 0[rbp], 0
	mov	QWORD PTR 8[rbp], rax
	jne	.L3
	mov	edx, DWORD PTR 52[rbp]
	or	edx, DWORD PTR PGRP_FLAG_TERMINATE[rip]
	mov	DWORD PTR 52[rbp], edx
	test	rax, rax
	jg	.L3
	or	edx, DWORD PTR PGRP_FLAG_DEAD[rip]
	mov	esi, DWORD PTR pg_hash[rip]
	mov	rdi, rbp
	mov	DWORD PTR 52[rbp], edx
	call	LIST_REMOVE@PLT
	xor	eax, eax
	call	proc_list_unlock@PLT
	mov	rdi, QWORD PTR 40[rbp]
	call	SESSION_TP@PLT
	cmp	QWORD PTR TTY_NULL[rip], rax
	mov	r12, rax
	je	.L5
	cmp	QWORD PTR 8[rax], rbp
	je	.L24
.L5:
	xor	eax, eax
	call	proc_list_lock@PLT
	mov	r12, QWORD PTR 40[rbp]
	mov	eax, DWORD PTR S_LIST_TERM[rip]
	or	eax, DWORD PTR S_LIST_DEAD[rip]
	test	DWORD PTR 16[r12], eax
	jne	.L25
.L7:
	sub	QWORD PTR 24[r12], 1
	jne	.L8
	mov	eax, DWORD PTR S_LIST_TERM[rip]
	mov	ecx, DWORD PTR S_LIST_DEAD[rip]
	mov	edx, DWORD PTR 16[r12]
	or	ecx, eax
	test	ecx, edx
	jne	.L26
.L9:
	or	eax, edx
	mov	rdi, r12
	mov	DWORD PTR 16[r12], eax
	call	SESSION_TP@PLT
	mov	esi, DWORD PTR s_hash[rip]
	mov	rdi, r12
	mov	r13, rax
	call	LIST_REMOVE@PLT
	xor	eax, eax
	call	proc_list_unlock@PLT
	cmp	QWORD PTR TTY_NULL[rip], r13
	je	.L10
	mov	rdi, r13
	call	tty_lock@PLT
	cmp	QWORD PTR 0[r13], r12
	je	.L27
.L11:
	mov	rdi, r13
	call	tty_unlock@PLT
.L10:
	xor	eax, eax
	call	proc_list_lock@PLT
	mov	eax, DWORD PTR S_LIST_DEAD[rip]
	or	DWORD PTR 16[r12], eax
	cmp	QWORD PTR 24[r12], 0
	jne	.L28
.L12:
	xor	eax, eax
	call	proc_list_unlock@PLT
	mov	esi, DWORD PTR proc_lck_grp[rip]
	lea	rdi, 36[r12]
	call	lck_mtx_destroy@PLT
	mov	edx, DWORD PTR M_SESSION[rip]
	mov	esi, 56
	mov	rdi, r12
	call	FREE_ZONE@PLT
.L13:
	mov	esi, DWORD PTR proc_lck_grp[rip]
	lea	rdi, 32[rbp]
	call	lck_mtx_destroy@PLT
	mov	edx, DWORD PTR M_PGRP[rip]
	mov	rdi, rbp
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	esi, 56
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	FREE_ZONE@PLT
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	lea	rdi, .LC1[rip]
	call	panic@PLT
	mov	edx, DWORD PTR 16[r12]
	mov	eax, DWORD PTR S_LIST_TERM[rip]
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L28:
	lea	rdi, .LC2[rip]
	call	panic@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L8:
	xor	eax, eax
	call	proc_list_unlock@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L25:
	lea	rdi, .LC0[rip]
	call	panic@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L24:
	mov	rdi, rax
	call	tty_lock@PLT
	cmp	QWORD PTR 8[r12], rbp
	je	.L29
.L6:
	mov	rdi, r12
	call	tty_unlock@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L27:
	mov	QWORD PTR 0[r13], 0
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L29:
	mov	rax, QWORD PTR 40[rbp]
	mov	edx, DWORD PTR NO_PID[rip]
	mov	QWORD PTR 8[r12], 0
	mov	DWORD PTR 48[rax], edx
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	pgdelete_dropref, .-pgdelete_dropref
	.comm	s_hash,4,4
	.comm	proc_mlock_grp,4,4
	.comm	proc_lck_grp,4,4
	.comm	pg_hash,4,4
	.comm	TTY_NULL,8,8
	.comm	S_LIST_TERM,4,4
	.comm	S_LIST_DEAD,4,4
	.comm	PGRP_FLAG_TERMINATE,4,4
	.comm	PGRP_FLAG_DEAD,4,4
	.comm	NO_PID,4,4
	.comm	M_SESSION,4,4
	.comm	M_PGRP,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_kern_proc.c_pgdelete_dropref.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"pg_deleteref: manipulating refs of already terminat"
	.ascii	"ing session\000"
	.align	2
.LC1:
	.ascii	"pg_deleteref: terminating already terminated sessio"
	.ascii	"n\000"
	.align	2
.LC2:
	.ascii	"pg_deleteref: freeing session in use\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	pgdelete_dropref, %function
pgdelete_dropref:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	bl	pgrp_lock
	ldr	r3, [r4]
	mov	r0, r4
	cmp	r3, #0
	beq	.L26
	bl	pgrp_unlock
	bl	proc_list_lock
	ldr	r3, [r4, #4]
	sub	r3, r3, #1
	str	r3, [r4, #4]
.L3:
	pop	{r4, r5, r6, r7, r8, lr}
	b	proc_list_unlock
.L26:
	bl	pgrp_unlock
	bl	proc_list_lock
	ldr	r3, [r4, #4]
	ldr	r5, [r4]
	sub	r3, r3, #1
	cmp	r5, #0
	str	r3, [r4, #4]
	bne	.L3
	ldr	r1, .L31
	ldr	r2, [r4, #32]
	ldr	r1, [r1]
	cmp	r3, #0
	orr	r3, r2, r1
	str	r3, [r4, #32]
	bgt	.L3
	ldr	r2, .L31+4
	ldr	r1, .L31+8
	ldr	r2, [r2]
	ldr	r1, [r1]
	orr	r3, r2, r3
	str	r3, [r4, #32]
	mov	r0, r4
	bl	LIST_REMOVE
	bl	proc_list_unlock
	ldr	r0, [r4, #24]
	bl	SESSION_TP
	ldr	r7, .L31+12
	mov	r6, r0
	ldr	r3, [r7]
	cmp	r3, r0
	beq	.L5
	ldr	r3, [r0, #4]
	cmp	r3, r4
	beq	.L27
.L5:
	ldr	r8, .L31+16
	ldr	r6, .L31+20
	bl	proc_list_lock
	ldr	r5, [r4, #24]
	ldr	r3, [r8]
	ldr	r1, [r6]
	ldr	r2, [r5, #8]
	orr	r3, r3, r1
	tst	r3, r2
	bne	.L28
.L7:
	ldr	r3, [r5, #12]
	sub	r3, r3, #1
	cmp	r3, #0
	str	r3, [r5, #12]
	bne	.L8
	ldr	r3, [r8]
	ldr	r2, [r6]
	ldr	r1, [r5, #8]
	orr	r2, r3, r2
	tst	r2, r1
	bne	.L29
.L9:
	orr	r3, r3, r1
	str	r3, [r5, #8]
	mov	r0, r5
	bl	SESSION_TP
	mov	r8, r0
	ldr	r3, .L31+24
	mov	r0, r5
	ldr	r1, [r3]
	bl	LIST_REMOVE
	bl	proc_list_unlock
	ldr	r3, [r7]
	cmp	r3, r8
	beq	.L10
	mov	r0, r8
	bl	tty_lock
	ldr	r3, [r8]
	mov	r0, r8
	cmp	r3, r5
	moveq	r3, #0
	streq	r3, [r8]
	bl	tty_unlock
.L10:
	bl	proc_list_lock
	ldr	r3, [r5, #8]
	ldr	r1, [r6]
	ldr	r2, [r5, #12]
	orr	r3, r3, r1
	cmp	r2, #0
	str	r3, [r5, #8]
	bne	.L30
.L12:
	ldr	r6, .L31+28
	bl	proc_list_unlock
	ldr	r1, [r6]
	add	r0, r5, #20
	bl	lck_mtx_destroy
	ldr	r3, .L31+32
	mov	r0, r5
	mov	r1, #36
	ldr	r2, [r3]
	bl	FREE_ZONE
.L13:
	ldr	r1, [r6]
	add	r0, r4, #16
	bl	lck_mtx_destroy
	ldr	r3, .L31+36
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	mov	r1, #36
	ldr	r2, [r3]
	b	FREE_ZONE
.L29:
	ldr	r0, .L31+40
	bl	panic
	ldr	r3, [r8]
	ldr	r1, [r5, #8]
	b	.L9
.L30:
	ldr	r0, .L31+44
	bl	panic
	b	.L12
.L8:
	bl	proc_list_unlock
	ldr	r6, .L31+28
	b	.L13
.L28:
	ldr	r0, .L31+48
	bl	panic
	b	.L7
.L27:
	bl	tty_lock
	ldr	r3, [r6, #4]
	mov	r0, r6
	cmp	r3, r4
	ldreq	r2, .L31+52
	ldreq	r3, [r4, #24]
	ldreq	r2, [r2]
	streq	r5, [r6, #4]
	streq	r2, [r3, #28]
	bl	tty_unlock
	b	.L5
.L32:
	.align	2
.L31:
	.word	PGRP_FLAG_TERMINATE
	.word	PGRP_FLAG_DEAD
	.word	pg_hash
	.word	TTY_NULL
	.word	S_LIST_TERM
	.word	S_LIST_DEAD
	.word	s_hash
	.word	proc_lck_grp
	.word	M_SESSION
	.word	M_PGRP
	.word	.LC1
	.word	.LC2
	.word	.LC0
	.word	NO_PID
	.size	pgdelete_dropref, .-pgdelete_dropref
	.comm	s_hash,4,4
	.comm	proc_mlock_grp,4,4
	.comm	proc_lck_grp,4,4
	.comm	pg_hash,4,4
	.comm	TTY_NULL,4,4
	.comm	S_LIST_TERM,4,4
	.comm	S_LIST_DEAD,4,4
	.comm	PGRP_FLAG_TERMINATE,4,4
	.comm	PGRP_FLAG_DEAD,4,4
	.comm	NO_PID,4,4
	.comm	M_SESSION,4,4
	.comm	M_PGRP,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
