	.file	"extr_sb1250-duart.c_sbd_receive_chars.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	sbd_receive_chars, @function
sbd_receive_chars:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	ebx, 16
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L31:
	mov	ebp, DWORD PTR TTY_BREAK[rip]
.L3:
	mov	esi, r12d
	mov	rdi, r14
	call	uart_handle_sysrq_char@PLT
	test	rax, rax
	jne	.L6
	mov	edx, DWORD PTR M_DUART_OVRUN_ERR[rip]
	mov	r8d, ebp
	mov	ecx, r12d
	mov	esi, r13d
	mov	rdi, r14
	call	uart_insert_char@PLT
.L6:
	sub	ebx, 1
	je	.L14
.L13:
	mov	esi, DWORD PTR R_DUART_STATUS[rip]
	mov	rdi, r14
	call	read_sbdchn@PLT
	mov	r13d, eax
	test	DWORD PTR M_DUART_RX_RDY[rip], eax
	je	.L14
	mov	esi, DWORD PTR R_DUART_RX_HOLD[rip]
	mov	rdi, r14
	call	read_sbdchn@PLT
	add	DWORD PTR 32[r14], 1
	mov	edi, DWORD PTR M_DUART_RCVD_BRK[rip]
	or	edi, DWORD PTR M_DUART_FRM_ERR[rip]
	or	edi, DWORD PTR M_DUART_PARITY_ERR[rip]
	mov	r12d, eax
	or	edi, DWORD PTR M_DUART_OVRUN_ERR[rip]
	mov	ebp, DWORD PTR TTY_NORMAL[rip]
	and	edi, r13d
	call	unlikely@PLT
	test	rax, rax
	je	.L3
	mov	eax, DWORD PTR M_DUART_RCVD_BRK[rip]
	test	eax, r13d
	jne	.L30
	test	DWORD PTR M_DUART_FRM_ERR[rip], r13d
	je	.L8
	add	DWORD PTR 24[r14], 1
.L7:
	test	DWORD PTR M_DUART_OVRUN_ERR[rip], r13d
	je	.L9
	add	DWORD PTR 16[r14], 1
.L9:
	and	r13d, DWORD PTR [r14]
	test	r13d, eax
	jne	.L31
	test	DWORD PTR M_DUART_FRM_ERR[rip], r13d
	je	.L11
	mov	ebp, DWORD PTR TTY_FRAME[rip]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L8:
	test	DWORD PTR M_DUART_PARITY_ERR[rip], r13d
	je	.L7
	add	DWORD PTR 20[r14], 1
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L30:
	add	DWORD PTR 28[r14], 1
	mov	rdi, r14
	call	uart_handle_break@PLT
	mov	r8, rax
	mov	eax, DWORD PTR M_DUART_RCVD_BRK[rip]
	test	r8, r8
	je	.L7
	sub	ebx, 1
	jne	.L13
.L14:
	mov	rax, QWORD PTR 8[r14]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	mov	edi, DWORD PTR [rax]
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	jmp	tty_flip_buffer_push@PLT
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	test	DWORD PTR M_DUART_PARITY_ERR[rip], r13d
	cmovne	ebp, DWORD PTR TTY_PARITY[rip]
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	sbd_receive_chars, .-sbd_receive_chars
	.comm	TTY_PARITY,4,4
	.comm	TTY_NORMAL,4,4
	.comm	TTY_FRAME,4,4
	.comm	TTY_BREAK,4,4
	.comm	R_DUART_STATUS,4,4
	.comm	R_DUART_RX_HOLD,4,4
	.comm	M_DUART_RX_RDY,4,4
	.comm	M_DUART_RCVD_BRK,4,4
	.comm	M_DUART_PARITY_ERR,4,4
	.comm	M_DUART_OVRUN_ERR,4,4
	.comm	M_DUART_FRM_ERR,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_sb1250-duart.c_sbd_receive_chars.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sbd_receive_chars, %function
sbd_receive_chars:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r3, #16
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #20
	mov	r4, r0
	ldr	fp, .L32
	ldr	r8, .L32+4
	ldr	r9, .L32+8
	ldr	r10, .L32+12
	ldr	r6, .L32+16
	str	r3, [sp, #8]
	b	.L13
.L31:
	ldr	r3, .L32+20
	ldr	r3, [r3]
	str	r3, [sp, #12]
.L3:
	mov	r1, r5
	mov	r0, r4
	bl	uart_handle_sysrq_char
	cmp	r0, #0
	bne	.L6
	ldr	r3, [sp, #12]
	mov	r1, r7
	str	r3, [sp]
	mov	r0, r4
	mov	r3, r5
	ldr	r2, [r6]
	bl	uart_insert_char
.L6:
	ldr	r3, [sp, #8]
	subs	r3, r3, #1
	str	r3, [sp, #8]
	beq	.L14
.L13:
	ldr	r3, .L32+24
	mov	r0, r4
	ldr	r1, [r3]
	bl	read_sbdchn
	ldr	r3, [fp]
	mov	r7, r0
	tst	r0, r3
	beq	.L14
	ldr	r3, .L32+28
	mov	r0, r4
	ldr	r1, [r3]
	bl	read_sbdchn
	ldr	r1, [r9]
	mov	r5, r0
	ldr	r0, [r8]
	ldr	r3, [r10]
	orr	r0, r0, r1
	orr	r0, r0, r3
	ldr	r3, [r4, #24]
	ldr	r1, [r6]
	add	r3, r3, #1
	str	r3, [r4, #24]
	ldr	r3, .L32+32
	orr	r0, r0, r1
	ldr	r3, [r3]
	and	r0, r0, r7
	str	r3, [sp, #12]
	bl	unlikely
	cmp	r0, #0
	beq	.L3
	ldr	r3, [r8]
	tst	r3, r7
	bne	.L30
	ldr	r1, [r9]
	tst	r7, r1
	beq	.L8
	ldr	r1, [r4, #16]
	add	r1, r1, #1
	str	r1, [r4, #16]
.L7:
	ldr	r1, [r6]
	tst	r7, r1
	ldrne	r1, [r4, #8]
	addne	r1, r1, #1
	strne	r1, [r4, #8]
	ldr	r1, [r4]
	and	r7, r7, r1
	tst	r7, r3
	bne	.L31
	ldr	r3, [r9]
	tst	r7, r3
	beq	.L11
	ldr	r3, .L32+36
	ldr	r3, [r3]
	str	r3, [sp, #12]
	b	.L3
.L8:
	ldr	r1, [r10]
	tst	r7, r1
	ldrne	r1, [r4, #12]
	addne	r1, r1, #1
	strne	r1, [r4, #12]
	b	.L7
.L30:
	ldr	r3, [r4, #20]
	mov	r0, r4
	add	r3, r3, #1
	str	r3, [r4, #20]
	bl	uart_handle_break
	cmp	r0, #0
	bne	.L6
	ldr	r3, [r8]
	b	.L7
.L11:
	ldr	r3, [r10]
	tst	r7, r3
	ldrne	r3, .L32+40
	ldrne	r3, [r3]
	strne	r3, [sp, #12]
	b	.L3
.L14:
	ldr	r3, [r4, #4]
	ldr	r0, [r3]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	tty_flip_buffer_push
.L33:
	.align	2
.L32:
	.word	M_DUART_RX_RDY
	.word	M_DUART_RCVD_BRK
	.word	M_DUART_FRM_ERR
	.word	M_DUART_PARITY_ERR
	.word	M_DUART_OVRUN_ERR
	.word	TTY_BREAK
	.word	R_DUART_STATUS
	.word	R_DUART_RX_HOLD
	.word	TTY_NORMAL
	.word	TTY_FRAME
	.word	TTY_PARITY
	.size	sbd_receive_chars, .-sbd_receive_chars
	.comm	TTY_PARITY,4,4
	.comm	TTY_NORMAL,4,4
	.comm	TTY_FRAME,4,4
	.comm	TTY_BREAK,4,4
	.comm	R_DUART_STATUS,4,4
	.comm	R_DUART_RX_HOLD,4,4
	.comm	M_DUART_RX_RDY,4,4
	.comm	M_DUART_RCVD_BRK,4,4
	.comm	M_DUART_PARITY_ERR,4,4
	.comm	M_DUART_OVRUN_ERR,4,4
	.comm	M_DUART_FRM_ERR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
