	.file	"extr_tty_ptmx.c_ptmx_free_ioctl.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ptmx_free_ioctl, @function
ptmx_free_ioctl:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xor	eax, eax
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movsx	rbp, edi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	ebx, esi
	call	DEVFS_LOCK@PLT
	test	ebp, ebp
	js	.L2
	cmp	DWORD PTR _state[rip], ebp
	jle	.L2
	mov	rax, QWORD PTR _state[rip+8]
	not	ebx
	lea	rdx, [rax+rbp*8]
	mov	eax, DWORD PTR PF_OPEN_M[rip]
	or	eax, DWORD PTR PF_OPEN_S[rip]
	mov	rbp, QWORD PTR [rdx]
	mov	esi, DWORD PTR 0[rbp]
	and	esi, ebx
	and	eax, esi
	mov	DWORD PTR 0[rbp], esi
	mov	r12d, eax
	jne	.L12
	mov	QWORD PTR [rdx], 0
	xor	eax, eax
	add	DWORD PTR _state[rip+4], 1
	call	DEVFS_UNLOCK@PLT
	mov	rdi, QWORD PTR 8[rbp]
	test	rdi, rdi
	je	.L6
	call	devfs_remove@PLT
.L6:
	mov	edi, DWORD PTR 4[rbp]
	call	ttyfree@PLT
	mov	esi, DWORD PTR M_TTYS[rip]
	mov	rdi, rbp
	call	FREE@PLT
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	xor	eax, eax
	xor	r12d, r12d
	call	DEVFS_UNLOCK@PLT
.L1:
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	xor	eax, eax
	mov	r12d, -1
	call	DEVFS_UNLOCK@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	ptmx_free_ioctl, .-ptmx_free_ioctl
	.comm	_state,16,16
	.comm	PF_OPEN_S,4,4
	.comm	PF_OPEN_M,4,4
	.comm	M_TTYS,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_tty_ptmx.c_ptmx_free_ioctl.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ptmx_free_ioctl, %function
ptmx_free_ioctl:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r0
	mov	r7, r1
	bl	DEVFS_LOCK
	cmp	r5, #0
	blt	.L2
	ldr	r2, .L13
	ldr	r3, [r2]
	cmp	r3, r5
	ble	.L2
	ldr	r0, [r2, #8]
	ldr	ip, .L13+4
	ldr	r6, [r0, r5, lsl #2]
	ldr	r1, .L13+8
	ldr	r4, [ip]
	ldr	r3, [r6]
	ldr	ip, [r1]
	bic	r1, r3, r7
	orr	r4, r4, ip
	ands	r4, r4, r1
	str	r1, [r6]
	bne	.L12
	ldr	r3, [r2, #4]
	str	r4, [r0, r5, lsl #2]
	add	r3, r3, #1
	str	r3, [r2, #4]
	bl	DEVFS_UNLOCK
	ldr	r0, [r6, #8]
	cmp	r0, #0
	beq	.L6
	bl	devfs_remove
.L6:
	ldr	r0, [r6, #4]
	bl	ttyfree
	ldr	r3, .L13+12
	mov	r0, r6
	ldr	r1, [r3]
	bl	FREE
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L12:
	bl	DEVFS_UNLOCK
	mov	r4, #0
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	bl	DEVFS_UNLOCK
	mvn	r4, #0
	b	.L1
.L14:
	.align	2
.L13:
	.word	_state
	.word	PF_OPEN_M
	.word	PF_OPEN_S
	.word	M_TTYS
	.size	ptmx_free_ioctl, .-ptmx_free_ioctl
	.comm	_state,12,4
	.comm	PF_OPEN_S,4,4
	.comm	PF_OPEN_M,4,4
	.comm	M_TTYS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
