	.file	"extr_vr41xx_siu.c_transmit_chars.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	transmit_chars, @function
transmit_chars:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rdx, QWORD PTR 8[rdi]
	test	rdx, rdx
	jne	.L13
	mov	rbp, QWORD PTR 16[rdi]
	mov	ebx, DWORD PTR TX_MAX_COUNT[rip]
	mov	rdi, rbp
	call	uart_circ_empty@PLT
	test	rax, rax
	jne	.L5
	mov	rdi, r12
	call	uart_tx_stopped@PLT
	test	rax, rax
	je	.L7
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L14:
	lea	eax, -1[rbx]
	test	ebx, ebx
	jle	.L8
	mov	ebx, eax
.L7:
	mov	rdx, QWORD PTR 0[rbp]
	mov	rax, QWORD PTR 8[rbp]
	mov	rdi, r12
	mov	esi, DWORD PTR UART_TX[rip]
	mov	rdx, QWORD PTR [rax+rdx*8]
	call	siu_write@PLT
	mov	ecx, DWORD PTR UART_XMIT_SIZE[rip]
	mov	rax, QWORD PTR 0[rbp]
	mov	rdi, rbp
	lea	edx, -1[rcx]
	add	rax, 1
	movsx	rdx, edx
	and	rax, rdx
	mov	QWORD PTR 0[rbp], rax
	add	DWORD PTR [r12], 1
	call	uart_circ_empty@PLT
	test	rax, rax
	je	.L14
.L8:
	mov	rdi, rbp
	call	uart_circ_chars_pending@PLT
	cmp	rax, QWORD PTR WAKEUP_CHARS[rip]
	jl	.L15
.L9:
	mov	rdi, rbp
	call	uart_circ_empty@PLT
	test	rax, rax
	jne	.L5
	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
.L5:
	.cfi_restore_state
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rdi, r12
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	siu_stop_tx@PLT
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	esi, DWORD PTR UART_TX[rip]
	call	siu_write@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	add	DWORD PTR [r12], 1
	mov	QWORD PTR 8[r12], 0
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	mov	rdi, r12
	call	uart_write_wakeup@PLT
	jmp	.L9
	.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	TX_MAX_COUNT,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_vr41xx_siu.c_transmit_chars.c"
	.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, #4]
	push	{r4, r5, r6, r7, r8, lr}
	cmp	r2, #0
	mov	r5, r0
	bne	.L13
	ldr	r4, [r0, #8]
	ldr	r3, .L16
	mov	r0, r4
	ldr	r6, [r3]
	bl	uart_circ_empty
	cmp	r0, #0
	bne	.L5
	mov	r0, r5
	bl	uart_tx_stopped
	cmp	r0, #0
	bne	.L5
	ldr	r8, .L16+4
	ldr	r7, .L16+8
	b	.L7
.L14:
	cmp	r6, #0
	sub	r6, r6, #1
	ble	.L8
.L7:
	ldm	r4, {r2, r3}
	ldr	r1, [r8]
	ldr	r2, [r3, r2, lsl #2]
	mov	r0, r5
	bl	siu_write
	ldr	r3, [r4]
	ldr	r1, [r7]
	ldr	r2, [r5]
	sub	r1, r1, #1
	add	r3, r3, #1
	and	r3, r3, r1
	add	r2, r2, #1
	str	r3, [r4]
	mov	r0, r4
	str	r2, [r5]
	bl	uart_circ_empty
	cmp	r0, #0
	beq	.L14
.L8:
	mov	r0, r4
	bl	uart_circ_chars_pending
	ldr	r3, .L16+12
	ldr	r3, [r3]
	cmp	r0, r3
	blt	.L15
.L9:
	mov	r0, r4
	bl	uart_circ_empty
	cmp	r0, #0
	popeq	{r4, r5, r6, r7, r8, pc}
.L5:
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, lr}
	b	siu_stop_tx
.L13:
	ldr	r3, .L16+4
	ldr	r1, [r3]
	bl	siu_write
	mov	r2, #0
	ldr	r3, [r5]
	str	r2, [r5, #4]
	add	r3, r3, #1
	str	r3, [r5]
	pop	{r4, r5, r6, r7, r8, pc}
.L15:
	mov	r0, r5
	bl	uart_write_wakeup
	b	.L9
.L17:
	.align	2
.L16:
	.word	TX_MAX_COUNT
	.word	UART_TX
	.word	UART_XMIT_SIZE
	.word	WAKEUP_CHARS
	.size	transmit_chars, .-transmit_chars
	.comm	WAKEUP_CHARS,4,4
	.comm	UART_XMIT_SIZE,4,4
	.comm	UART_TX,4,4
	.comm	TX_MAX_COUNT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
