	.file	"extr_esp.c_receive_chars_dma_done.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	receive_chars_dma_done, @function
receive_chars_dma_done:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xor	eax, eax
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12d, esi
	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
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	r14, QWORD PTR 32[rdi]
	call	claim_dma_lock@PLT
	mov	edi, DWORD PTR dma[rip]
	mov	r13, rax
	call	disable_dma@PLT
	mov	edi, DWORD PTR dma[rip]
	call	clear_dma_ff@PLT
	mov	eax, DWORD PTR ESP_STAT_DMA_RX[rip]
	mov	edi, DWORD PTR dma[rip]
	mov	ebx, DWORD PTR dma_bytes[rip]
	not	eax
	and	DWORD PTR 40[rbp], eax
	call	get_dma_residue@PLT
	mov	rdi, r13
	sub	ebx, eax
	call	release_dma_lock@PLT
	add	DWORD PTR 8[rbp], ebx
	test	ebx, ebx
	jg	.L16
.L2:
	mov	esi, DWORD PTR dma_bytes[rip]
	mov	DWORD PTR dma_bytes[rip], 0
	cmp	esi, ebx
	jne	.L17
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	pop	rbx
	.cfi_def_cfa_offset 40
	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
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	sub	esi, ebx
	mov	rdi, rbp
	pop	rbx
	.cfi_def_cfa_offset 40
	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	receive_chars_dma@PLT
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	mov	rsi, QWORD PTR dma_buffer[rip]
	lea	edx, -1[rbx]
	mov	rdi, r14
	call	tty_insert_flip_string@PLT
	mov	eax, DWORD PTR 4[rbp]
	and	r12d, DWORD PTR 0[rbp]
	and	eax, r12d
	test	al, 28
	jne	.L3
	test	r12b, 16
	jne	.L18
	test	r12b, 8
	je	.L6
	add	DWORD PTR 16[rbp], 1
	mov	edx, DWORD PTR TTY_FRAME[rip]
.L5:
	mov	rcx, QWORD PTR dma_buffer[rip]
	movsx	rax, ebx
	mov	rdi, r14
	mov	esi, DWORD PTR -4[rcx+rax*4]
	call	tty_insert_flip_char@PLT
.L3:
	mov	rdi, r14
	call	tty_schedule_flip@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L18:
	add	DWORD PTR 20[rbp], 1
	mov	edx, DWORD PTR TTY_BREAK[rip]
	mov	eax, DWORD PTR 24[rbp]
	test	DWORD PTR ASYNC_SAK[rip], eax
	je	.L5
	mov	rdi, r14
	mov	DWORD PTR 12[rsp], edx
	call	do_SAK@PLT
	mov	edx, DWORD PTR 12[rsp]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	mov	edx, r12d
	and	edx, 4
	je	.L5
	add	DWORD PTR 12[rbp], 1
	mov	edx, DWORD PTR TTY_PARITY[rip]
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	receive_chars_dma_done, .-receive_chars_dma_done
	.comm	dma_bytes,4,4
	.comm	dma_buffer,8,8
	.comm	dma,4,4
	.comm	TTY_PARITY,4,4
	.comm	TTY_FRAME,4,4
	.comm	TTY_BREAK,4,4
	.comm	ESP_STAT_DMA_RX,4,4
	.comm	ASYNC_SAK,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_esp.c_receive_chars_dma_done.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	receive_chars_dma_done, %function
receive_chars_dma_done:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	sub	sp, sp, #12
	mov	r4, r0
	mov	r6, r1
	ldr	r9, [r0, #28]
	bl	claim_dma_lock
	ldr	r5, .L19
	mov	r7, r0
	ldr	r0, [r5]
	bl	disable_dma
	ldr	r0, [r5]
	bl	clear_dma_ff
	ldr	r2, .L19+4
	ldr	r3, [r4, #32]
	ldr	r2, [r2]
	ldr	r8, .L19+8
	bic	r3, r3, r2
	ldr	r0, [r5]
	str	r3, [r4, #32]
	ldr	r5, [r8]
	bl	get_dma_residue
	mov	r3, r0
	mov	r0, r7
	sub	r5, r5, r3
	bl	release_dma_lock
	ldr	r3, [r4, #8]
	cmp	r5, #0
	add	r3, r3, r5
	str	r3, [r4, #8]
	bgt	.L16
.L2:
	ldr	r1, [r8]
	mov	r3, #0
	cmp	r1, r5
	bne	.L17
	str	r3, [r8]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L17:
	mov	r0, r4
	sub	r1, r1, r5
	str	r3, [r8]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, lr}
	b	receive_chars_dma
.L16:
	ldr	r7, .L19+12
	sub	r2, r5, #1
	mov	r0, r9
	ldr	r1, [r7]
	bl	tty_insert_flip_string
	ldm	r4, {r2, r3}
	and	r6, r6, r2
	and	r3, r3, r6
	tst	r3, #28
	bne	.L3
	tst	r6, #16
	bne	.L18
	tst	r6, #8
	beq	.L6
	ldr	r3, [r4, #16]
	ldr	r2, .L19+16
	add	r3, r3, #1
	ldr	r2, [r2]
	str	r3, [r4, #16]
.L5:
	ldr	r1, [r7]
	sub	r3, r5, #-1073741823
	mov	r0, r9
	ldr	r1, [r1, r3, lsl #2]
	bl	tty_insert_flip_char
.L3:
	mov	r0, r9
	bl	tty_schedule_flip
	b	.L2
.L18:
	ldr	r3, .L19+20
	ldr	r1, [r4, #24]
	ldr	r2, [r3]
	ldr	r3, [r4, #20]
	tst	r1, r2
	ldr	r2, .L19+24
	add	r3, r3, #1
	ldr	r2, [r2]
	str	r3, [r4, #20]
	beq	.L5
	mov	r0, r9
	str	r2, [sp, #4]
	bl	do_SAK
	ldr	r2, [sp, #4]
	b	.L5
.L6:
	ands	r2, r6, #4
	ldrne	r3, [r4, #12]
	ldrne	r2, .L19+28
	addne	r3, r3, #1
	ldrne	r2, [r2]
	strne	r3, [r4, #12]
	b	.L5
.L20:
	.align	2
.L19:
	.word	dma
	.word	ESP_STAT_DMA_RX
	.word	dma_bytes
	.word	dma_buffer
	.word	TTY_FRAME
	.word	ASYNC_SAK
	.word	TTY_BREAK
	.word	TTY_PARITY
	.size	receive_chars_dma_done, .-receive_chars_dma_done
	.comm	dma_bytes,4,4
	.comm	dma_buffer,4,4
	.comm	dma,4,4
	.comm	TTY_PARITY,4,4
	.comm	TTY_FRAME,4,4
	.comm	TTY_BREAK,4,4
	.comm	ESP_STAT_DMA_RX,4,4
	.comm	ASYNC_SAK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
