	.file	"extr_tty_port.c_tty_port_block_til_ready.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	tty_port_block_til_ready
	.type	tty_port_block_til_ready, @function
tty_port_block_til_ready:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	edi, DWORD PTR wait[rip]
	call	DEFINE_WAIT@PLT
	mov	rdi, rbp
	call	tty_hung_up_p@PLT
	test	rax, rax
	jne	.L35
	mov	eax, DWORD PTR [rbx]
	mov	r14d, eax
	and	r14d, DWORD PTR ASYNC_CLOSING[rip]
	jne	.L3
	mov	ecx, DWORD PTR [r12]
	mov	edx, DWORD PTR TTY_IO_ERROR[rip]
	bt	ecx, edx
	jc	.L36
	mov	edx, DWORD PTR 0[rbp]
	test	DWORD PTR O_NONBLOCK[rip], edx
	je	.L8
	mov	rdx, QWORD PTR 8[r12]
	mov	edx, DWORD PTR [rdx]
	test	DWORD PTR CBAUD[rip], edx
	jne	.L37
.L9:
	or	eax, DWORD PTR ASYNC_NORMAL_ACTIVE[rip]
	xor	r14d, r14d
	mov	DWORD PTR [rbx], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L35:
	mov	r14d, DWORD PTR [rbx]
	and	r14d, DWORD PTR ASYNC_CLOSING[rip]
.L3:
	xor	esi, esi
	mov	edi, DWORD PTR 20[rbx]
	test	r14d, r14d
	sete	sil
	call	wait_event_interruptible@PLT
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR ASYNC_HUP_NOTIFY[rip], eax
	jne	.L38
	mov	r14d, DWORD PTR ERESTARTSYS[rip]
	neg	r14d
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r14d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L38:
	.cfi_restore_state
	mov	r14d, DWORD PTR EAGAIN[rip]
	neg	r14d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdi, r12
	lea	r15, 4[rbx]
	call	C_CLOCAL@PLT
	mov	rdi, r15
	test	rax, rax
	setne	al
	xor	esi, esi
	movzx	eax, al
	mov	DWORD PTR 12[rsp], eax
	call	spin_lock_irqsave@PLT
	mov	rdi, rbp
	call	tty_hung_up_p@PLT
	test	rax, rax
	jne	.L10
	sub	DWORD PTR 12[rbx], 1
.L10:
	add	DWORD PTR 8[rbx], 1
	xor	esi, esi
	lea	r13, 16[rbx]
	mov	rdi, r15
	lea	r14, wait[rip]
	call	spin_unlock_irqrestore@PLT
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L11:
	mov	edx, DWORD PTR TASK_INTERRUPTIBLE[rip]
	mov	rsi, r14
	mov	rdi, r13
	call	prepare_to_wait@PLT
	mov	rdi, rbp
	call	tty_hung_up_p@PLT
	test	rax, rax
	mov	eax, DWORD PTR [rbx]
	jne	.L13
	test	DWORD PTR ASYNC_INITIALIZED[rip], eax
	je	.L13
	mov	rdi, rbx
	call	tty_port_carrier_raised@PLT
	mov	edx, DWORD PTR [rbx]
	test	DWORD PTR ASYNC_CLOSING[rip], edx
	jne	.L17
	or	eax, DWORD PTR 12[rsp]
	jne	.L18
.L17:
	mov	edi, DWORD PTR current[rip]
	call	signal_pending@PLT
	test	rax, rax
	jne	.L32
	xor	eax, eax
	call	schedule@PLT
.L20:
	mov	rax, QWORD PTR 8[r12]
	mov	eax, DWORD PTR [rax]
	test	DWORD PTR CBAUD[rip], eax
	je	.L11
	mov	rdi, rbx
	call	tty_port_raise_dtr_rts@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L36:
	or	eax, DWORD PTR ASYNC_NORMAL_ACTIVE[rip]
	mov	DWORD PTR [rbx], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	test	DWORD PTR ASYNC_HUP_NOTIFY[rip], eax
	jne	.L39
.L32:
	mov	r14d, DWORD PTR ERESTARTSYS[rip]
	neg	r14d
.L16:
	lea	rsi, wait[rip]
	mov	rdi, r13
	call	finish_wait@PLT
	xor	esi, esi
	mov	rdi, r15
	call	spin_lock_irqsave@PLT
	mov	rdi, rbp
	call	tty_hung_up_p@PLT
	test	rax, rax
	je	.L40
.L21:
	sub	DWORD PTR 8[rbx], 1
	test	r14d, r14d
	je	.L23
.L22:
	xor	esi, esi
	mov	rdi, r15
	call	spin_unlock_irqrestore@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L18:
	lea	rsi, wait[rip]
	mov	rdi, r13
	call	finish_wait@PLT
	xor	esi, esi
	mov	rdi, r15
	call	spin_lock_irqsave@PLT
	mov	rdi, rbp
	call	tty_hung_up_p@PLT
	test	rax, rax
	jne	.L33
	add	DWORD PTR 12[rbx], 1
.L33:
	sub	DWORD PTR 8[rbx], 1
.L23:
	mov	eax, DWORD PTR ASYNC_NORMAL_ACTIVE[rip]
	xor	r14d, r14d
	or	DWORD PTR [rbx], eax
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L40:
	add	DWORD PTR 12[rbx], 1
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L39:
	mov	r14d, DWORD PTR EAGAIN[rip]
	neg	r14d
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L37:
	mov	rdi, rbx
	call	tty_port_raise_dtr_rts@PLT
	mov	eax, DWORD PTR [rbx]
	jmp	.L9
	.cfi_endproc
.LFE0:
	.size	tty_port_block_til_ready, .-tty_port_block_til_ready
	.comm	wait,4,4
	.comm	current,4,4
	.comm	TTY_IO_ERROR,4,4
	.comm	TASK_INTERRUPTIBLE,4,4
	.comm	O_NONBLOCK,4,4
	.comm	ERESTARTSYS,4,4
	.comm	EAGAIN,4,4
	.comm	CBAUD,4,4
	.comm	ASYNC_NORMAL_ACTIVE,4,4
	.comm	ASYNC_INITIALIZED,4,4
	.comm	ASYNC_HUP_NOTIFY,4,4
	.comm	ASYNC_CLOSING,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_port.c_tty_port_block_til_ready.c"
	.text
	.align	2
	.global	tty_port_block_til_ready
	.syntax unified
	.arm
	.fpu softvfp
	.type	tty_port_block_til_ready, %function
tty_port_block_til_ready:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r2
	ldr	r3, .L38
	sub	sp, sp, #12
	mov	r4, r0
	ldr	r0, [r3]
	mov	r6, r1
	bl	DEFINE_WAIT
	mov	r0, r5
	bl	tty_hung_up_p
	cmp	r0, #0
	bne	.L34
	ldr	r7, .L38+4
	ldr	r3, [r4]
	ldr	r9, [r7]
	ands	r9, r3, r9
	beq	.L4
.L3:
	clz	r1, r9
	ldr	r0, [r4, #20]
	lsr	r1, r1, #5
	bl	wait_event_interruptible
	ldr	r3, .L38+8
	ldr	r2, [r4]
	ldr	r3, [r3]
	tst	r2, r3
	ldrne	r3, .L38+12
	ldreq	r3, .L38+16
	ldr	r9, [r3]
	rsb	r9, r9, #0
	mov	r0, r9
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	ldr	r1, .L38+20
	ldr	r2, [r6]
	ldr	r1, [r1]
	asr	r2, r2, r1
	tst	r2, #1
	bne	.L35
	ldr	r2, .L38+24
	ldr	r1, [r5]
	ldr	r2, [r2]
	tst	r1, r2
	beq	.L8
	ldr	r1, [r6, #4]
	ldr	r2, .L38+28
	ldr	r1, [r1]
	ldr	r2, [r2]
	tst	r1, r2
	bne	.L36
.L9:
	mov	r9, #0
	mov	r0, r9
	ldr	r2, .L38+32
	ldr	r2, [r2]
	orr	r3, r2, r3
	str	r3, [r4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L34:
	ldr	r3, .L38+4
	ldr	r9, [r4]
	ldr	r3, [r3]
	and	r9, r9, r3
	b	.L3
.L8:
	mov	r0, r6
	bl	C_CLOCAL
	mov	r1, #0
	mov	r3, r0
	subs	r3, r3, r1
	movne	r3, #1
	add	r2, r4, #4
	mov	r0, r2
	str	r3, [sp]
	str	r2, [sp, #4]
	bl	spin_lock_irqsave
	mov	r0, r5
	bl	tty_hung_up_p
	cmp	r0, #0
	ldreq	r3, [r4, #12]
	mov	r1, #0
	subeq	r3, r3, #1
	streq	r3, [r4, #12]
	ldr	r3, [r4, #8]
	ldr	r0, [sp, #4]
	add	r3, r3, #1
	str	r3, [r4, #8]
	bl	spin_unlock_irqrestore
	ldr	r10, .L38+28
	ldr	r9, .L38
	ldr	fp, .L38+36
	add	r8, r4, #16
	b	.L20
.L11:
	ldr	r3, .L38+40
	mov	r1, r9
	ldr	r2, [r3]
	mov	r0, r8
	bl	prepare_to_wait
	mov	r0, r5
	bl	tty_hung_up_p
	cmp	r0, #0
	ldr	r3, [r4]
	bne	.L13
	ldr	r2, [fp]
	tst	r3, r2
	beq	.L13
	mov	r0, r4
	bl	tty_port_carrier_raised
	ldr	r2, [r4]
	ldr	r3, [r7]
	tst	r2, r3
	bne	.L17
	ldr	r3, [sp]
	orrs	r3, r0, r3
	bne	.L18
.L17:
	ldr	r3, .L38+44
	ldr	r0, [r3]
	bl	signal_pending
	cmp	r0, #0
	bne	.L32
	bl	schedule
.L20:
	ldr	r2, [r6, #4]
	ldr	r3, [r10]
	ldr	r2, [r2]
	tst	r2, r3
	beq	.L11
	mov	r0, r4
	bl	tty_port_raise_dtr_rts
	b	.L11
.L35:
	mov	r0, r9
	ldr	r2, .L38+32
	ldr	r2, [r2]
	orr	r3, r2, r3
	str	r3, [r4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L13:
	ldr	r2, .L38+8
	ldr	r2, [r2]
	tst	r3, r2
	bne	.L37
.L32:
	ldr	r3, .L38+16
	ldr	r9, [r3]
	rsb	r9, r9, #0
.L16:
	ldr	r1, .L38
	mov	r0, r8
	bl	finish_wait
	mov	r1, #0
	ldr	r0, [sp, #4]
	bl	spin_lock_irqsave
	mov	r0, r5
	bl	tty_hung_up_p
	cmp	r0, #0
	ldreq	r3, [r4, #12]
	addeq	r3, r3, #1
	streq	r3, [r4, #12]
	ldr	r3, [r4, #8]
	cmp	r9, #0
	sub	r3, r3, #1
	str	r3, [r4, #8]
	beq	.L23
.L22:
	mov	r1, #0
	ldr	r0, [sp, #4]
	bl	spin_unlock_irqrestore
	mov	r0, r9
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L18:
	ldr	r1, .L38
	mov	r0, r8
	bl	finish_wait
	mov	r1, #0
	ldr	r0, [sp, #4]
	bl	spin_lock_irqsave
	mov	r0, r5
	bl	tty_hung_up_p
	cmp	r0, #0
	bne	.L24
	ldr	r2, [r4, #12]
	ldr	r3, [r4, #8]
	add	r2, r2, #1
	sub	r3, r3, #1
	str	r2, [r4, #12]
	str	r3, [r4, #8]
.L23:
	ldr	r2, .L38+32
	ldr	r3, [r4]
	ldr	r2, [r2]
	mov	r9, #0
	orr	r3, r3, r2
	str	r3, [r4]
	b	.L22
.L37:
	ldr	r3, .L38+12
	ldr	r9, [r3]
	rsb	r9, r9, #0
	b	.L16
.L36:
	mov	r0, r4
	bl	tty_port_raise_dtr_rts
	ldr	r3, [r4]
	b	.L9
.L24:
	ldr	r3, [r4, #8]
	sub	r3, r3, #1
	str	r3, [r4, #8]
	b	.L23
.L39:
	.align	2
.L38:
	.word	wait
	.word	ASYNC_CLOSING
	.word	ASYNC_HUP_NOTIFY
	.word	EAGAIN
	.word	ERESTARTSYS
	.word	TTY_IO_ERROR
	.word	O_NONBLOCK
	.word	CBAUD
	.word	ASYNC_NORMAL_ACTIVE
	.word	ASYNC_INITIALIZED
	.word	TASK_INTERRUPTIBLE
	.word	current
	.size	tty_port_block_til_ready, .-tty_port_block_til_ready
	.comm	wait,4,4
	.comm	current,4,4
	.comm	TTY_IO_ERROR,4,4
	.comm	TASK_INTERRUPTIBLE,4,4
	.comm	O_NONBLOCK,4,4
	.comm	ERESTARTSYS,4,4
	.comm	EAGAIN,4,4
	.comm	CBAUD,4,4
	.comm	ASYNC_NORMAL_ACTIVE,4,4
	.comm	ASYNC_INITIALIZED,4,4
	.comm	ASYNC_HUP_NOTIFY,4,4
	.comm	ASYNC_CLOSING,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
