	.file	"extr_m32r_sio.c_transmit_chars.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"THRE..."
	.text
	.p2align 4
	.type	transmit_chars, @function
transmit_chars:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rdx, QWORD PTR 8[rdi]
	test	rdx, rdx
	jne	.L22
	mov	r12, QWORD PTR 16[rdi]
	mov	rdi, r12
	call	uart_circ_empty@PLT
	test	rax, rax
	jne	.L20
	mov	rdi, rbp
	call	uart_tx_stopped@PLT
	test	rax, rax
	jne	.L20
	mov	ebx, DWORD PTR 0[rbp]
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rdx, QWORD PTR [r12]
	mov	rax, QWORD PTR 8[r12]
	mov	rdi, rbp
	mov	esi, DWORD PTR UART_TX[rip]
	mov	rdx, QWORD PTR [rax+rdx*8]
	call	serial_out@PLT
	mov	ecx, DWORD PTR UART_XMIT_SIZE[rip]
	mov	rax, QWORD PTR [r12]
	mov	rdi, r12
	lea	edx, -1[rcx]
	add	rax, 1
	movsx	rdx, edx
	and	rax, rdx
	mov	QWORD PTR [r12], rax
	add	DWORD PTR 4[rbp], 1
	call	uart_circ_empty@PLT
	test	rax, rax
	jne	.L10
	.p2align 4,,10
	.p2align 3
.L6:
	mov	esi, DWORD PTR UART_LSR[rip]
	mov	rdi, rbp
	call	serial_in@PLT
	test	DWORD PTR UART_LSR_THRE[rip], eax
	je	.L6
	sub	ebx, 1
	test	ebx, ebx
	jg	.L9
.L10:
	mov	rdi, r12
	call	uart_circ_chars_pending@PLT
	cmp	rax, QWORD PTR WAKEUP_CHARS[rip]
	jl	.L23
.L8:
	lea	rdi, .LC0[rip]
	call	DEBUG_INTR@PLT
	mov	rdi, r12
	call	uart_circ_empty@PLT
	test	rax, rax
	jne	.L20
	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
.L20:
	.cfi_restore_state
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	m32r_sio_stop_tx@PLT
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore_state
	mov	esi, DWORD PTR UART_TX[rip]
	call	serial_out@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	add	DWORD PTR 4[rbp], 1
	mov	QWORD PTR 8[rbp], 0
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
.L23:
	.cfi_restore_state
	mov	rdi, rbp
	call	uart_write_wakeup@PLT
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	transmit_chars, .-transmit_chars
	.comm	WAKEUP_CHARS,8,8
	.comm	UART_XMIT_SIZE,4,4
	.comm	UART_TX,4,4
	.comm	UART_LSR_THRE,4,4
	.comm	UART_LSR,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_m32r_sio.c_transmit_chars.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"THRE...\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	transmit_chars, %function
transmit_chars:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r2, [r0, #8]
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	cmp	r2, #0
	mov	r4, r0
	bne	.L21
	ldr	r7, [r0, #12]
	mov	r0, r7
	bl	uart_circ_empty
	cmp	r0, #0
	bne	.L19
	mov	r0, r4
	bl	uart_tx_stopped
	cmp	r0, #0
	bne	.L19
	ldr	r8, [r4]
	ldr	r10, .L23
	ldr	r9, .L23+4
	ldr	r6, .L23+8
	ldr	r5, .L23+12
.L9:
	ldm	r7, {r2, r3}
	ldr	r1, [r10]
	ldr	r2, [r3, r2, lsl #2]
	mov	r0, r4
	bl	serial_out
	ldr	r3, [r7]
	ldr	r1, [r9]
	ldr	r2, [r4, #4]
	sub	r1, r1, #1
	add	r3, r3, #1
	and	r3, r3, r1
	add	r2, r2, #1
	str	r3, [r7]
	mov	r0, r7
	str	r2, [r4, #4]
	bl	uart_circ_empty
	cmp	r0, #0
	bne	.L10
.L6:
	mov	r0, r4
	ldr	r1, [r6]
	bl	serial_in
	ldr	r3, [r5]
	tst	r0, r3
	beq	.L6
	sub	r8, r8, #1
	cmp	r8, #0
	bgt	.L9
.L10:
	mov	r0, r7
	bl	uart_circ_chars_pending
	ldr	r3, .L23+16
	ldr	r3, [r3]
	cmp	r0, r3
	blt	.L22
.L8:
	ldr	r0, .L23+20
	bl	DEBUG_INTR
	mov	r0, r7
	bl	uart_circ_empty
	cmp	r0, #0
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
.L19:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	m32r_sio_stop_tx
.L21:
	ldr	r3, .L23
	ldr	r1, [r3]
	bl	serial_out
	mov	r2, #0
	ldr	r3, [r4, #4]
	str	r2, [r4, #8]
	add	r3, r3, #1
	str	r3, [r4, #4]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L22:
	mov	r0, r4
	bl	uart_write_wakeup
	b	.L8
.L24:
	.align	2
.L23:
	.word	UART_TX
	.word	UART_XMIT_SIZE
	.word	UART_LSR
	.word	UART_LSR_THRE
	.word	WAKEUP_CHARS
	.word	.LC0
	.size	transmit_chars, .-transmit_chars
	.comm	WAKEUP_CHARS,4,4
	.comm	UART_XMIT_SIZE,4,4
	.comm	UART_TX,4,4
	.comm	UART_LSR_THRE,4,4
	.comm	UART_LSR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
