	.file	"extr_msm_serial.c_handle_rx.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	handle_rx, @function
handle_rx:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	esi, DWORD PTR UART_SR[rip]
	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
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rax, QWORD PTR 24[rdi]
	mov	r13, QWORD PTR [rax]
	call	msm_read@PLT
	test	DWORD PTR UART_SR_OVERRUN[rip], eax
	jne	.L21
	.p2align 4,,10
	.p2align 3
.L3:
	mov	esi, DWORD PTR UART_SR[rip]
	mov	rdi, rbp
	call	msm_read@PLT
	mov	ebx, eax
	test	DWORD PTR UART_SR_RX_READY[rip], eax
	je	.L22
	mov	esi, DWORD PTR UART_RF[rip]
	mov	rdi, rbp
	movzx	r14d, BYTE PTR TTY_NORMAL[rip]
	call	msm_read@PLT
	mov	r12d, eax
	mov	eax, DWORD PTR UART_SR_RX_BREAK[rip]
	test	eax, ebx
	jne	.L23
	test	DWORD PTR UART_SR_PAR_FRAME_ERR[rip], ebx
	je	.L8
	add	DWORD PTR 8[rbp], 1
.L7:
	and	ebx, DWORD PTR 0[rbp]
	test	ebx, eax
	je	.L9
	movzx	r14d, BYTE PTR TTY_BREAK[rip]
.L10:
	mov	esi, r12d
	mov	rdi, rbp
	call	uart_handle_sysrq_char@PLT
	test	eax, eax
	jne	.L3
	movsx	edx, r14b
	mov	esi, r12d
	mov	rdi, r13
	call	tty_insert_flip_char@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L9:
	movzx	eax, BYTE PTR TTY_FRAME[rip]
	test	DWORD PTR UART_SR_PAR_FRAME_ERR[rip], ebx
	cmovne	r14d, eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	add	DWORD PTR 4[rbp], 1
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L23:
	add	DWORD PTR 12[rbp], 1
	mov	rdi, rbp
	call	uart_handle_break@PLT
	mov	r8, rax
	mov	eax, DWORD PTR UART_SR_RX_BREAK[rip]
	test	r8, r8
	je	.L7
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L22:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rdi, r13
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	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
.L21:
	.cfi_restore_state
	add	DWORD PTR 16[rbp], 1
	movsx	edx, BYTE PTR TTY_OVERRUN[rip]
	xor	esi, esi
	mov	rdi, r13
	call	tty_insert_flip_char@PLT
	mov	edx, DWORD PTR UART_CR[rip]
	mov	esi, DWORD PTR UART_CR_CMD_RESET_ERR[rip]
	mov	rdi, rbp
	call	msm_write@PLT
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	handle_rx, .-handle_rx
	.comm	UART_SR_RX_READY,4,4
	.comm	UART_SR_RX_BREAK,4,4
	.comm	UART_SR_PAR_FRAME_ERR,4,4
	.comm	UART_SR_OVERRUN,4,4
	.comm	UART_SR,4,4
	.comm	UART_RF,4,4
	.comm	UART_CR_CMD_RESET_ERR,4,4
	.comm	UART_CR,4,4
	.comm	TTY_OVERRUN,1,1
	.comm	TTY_NORMAL,1,1
	.comm	TTY_FRAME,1,1
	.comm	TTY_BREAK,1,1
	.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_msm_serial.c_handle_rx.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	handle_rx, %function
handle_rx:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r2, [r0, #20]
	ldr	r5, .L24
	ldr	r3, [r2]
	sub	sp, sp, #12
	ldr	r1, [r5]
	mov	fp, r0
	str	r3, [sp, #4]
	bl	msm_read
	ldr	r2, .L24+4
	ldr	r2, [r2]
	tst	r0, r2
	bne	.L21
.L2:
	ldr	r7, .L24+8
	ldr	r6, .L24+12
	ldr	r8, .L24+16
.L3:
	mov	r0, fp
	ldr	r1, [r5]
	bl	msm_read
	ldr	r3, [r7]
	mov	r4, r0
	tst	r0, r3
	beq	.L22
	ldr	r3, .L24+20
	mov	r0, fp
	ldr	r1, [r3]
	ldr	r3, .L24+24
	ldrb	r10, [r3]	@ zero_extendqisi2
	bl	msm_read
	ldr	r3, [r6]
	mov	r9, r0
	tst	r3, r4
	bne	.L23
	ldr	r2, [r8]
	tst	r4, r2
	ldrne	r2, [fp, #8]
	ldreq	r2, [fp, #4]
	addne	r2, r2, #1
	addeq	r2, r2, #1
	strne	r2, [fp, #8]
	streq	r2, [fp, #4]
.L7:
	ldr	r0, [fp]
	and	r4, r4, r0
	tst	r4, r3
	beq	.L9
	ldr	r3, .L24+28
	ldrb	r10, [r3]	@ zero_extendqisi2
.L10:
	mov	r1, r9
	mov	r0, fp
	bl	uart_handle_sysrq_char
	cmp	r0, #0
	bne	.L3
	mov	r2, r10
	mov	r1, r9
	ldr	r0, [sp, #4]
	bl	tty_insert_flip_char
	b	.L3
.L9:
	ldr	r3, [r8]
	tst	r4, r3
	ldrne	r3, .L24+32
	ldrbne	r10, [r3]	@ zero_extendqisi2
	b	.L10
.L23:
	ldr	r3, [fp, #12]
	mov	r0, fp
	add	r3, r3, #1
	str	r3, [fp, #12]
	bl	uart_handle_break
	cmp	r0, #0
	bne	.L3
	ldr	r3, [r6]
	b	.L7
.L22:
	ldr	r0, [sp, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	tty_flip_buffer_push
.L21:
	ldr	r2, [fp, #16]
	ldr	r1, .L24+36
	add	r2, r2, #1
	str	r2, [fp, #16]
	ldr	r0, [sp, #4]
	ldrb	r2, [r1]	@ zero_extendqisi2
	mov	r1, #0
	bl	tty_insert_flip_char
	ldr	r2, .L24+40
	ldr	r1, .L24+44
	mov	r0, fp
	ldr	r2, [r2]
	ldr	r1, [r1]
	bl	msm_write
	b	.L2
.L25:
	.align	2
.L24:
	.word	UART_SR
	.word	UART_SR_OVERRUN
	.word	UART_SR_RX_READY
	.word	UART_SR_RX_BREAK
	.word	UART_SR_PAR_FRAME_ERR
	.word	UART_RF
	.word	TTY_NORMAL
	.word	TTY_BREAK
	.word	TTY_FRAME
	.word	TTY_OVERRUN
	.word	UART_CR
	.word	UART_CR_CMD_RESET_ERR
	.size	handle_rx, .-handle_rx
	.comm	UART_SR_RX_READY,4,4
	.comm	UART_SR_RX_BREAK,4,4
	.comm	UART_SR_PAR_FRAME_ERR,4,4
	.comm	UART_SR_OVERRUN,4,4
	.comm	UART_SR,4,4
	.comm	UART_RF,4,4
	.comm	UART_CR_CMD_RESET_ERR,4,4
	.comm	UART_CR,4,4
	.comm	TTY_OVERRUN,1,1
	.comm	TTY_NORMAL,1,1
	.comm	TTY_FRAME,1,1
	.comm	TTY_BREAK,1,1
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
