	.file	"extr_ip22zilog.c_ip22zilog_transmit_chars.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ip22zilog_transmit_chars, @function
ip22zilog_transmit_chars:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	ZS_IS_CONS@PLT
	test	rax, rax
	je	.L5
	mov	rdi, r12
	call	readb@PLT
	mov	ebx, eax
	xor	eax, eax
	call	ZSDELAY@PLT
	test	BYTE PTR Tx_BUF_EMP[rip], bl
	je	.L1
.L5:
	mov	eax, DWORD PTR IP22ZILOG_FLAG_TX_ACTIVE[rip]
	mov	rdi, rbp
	not	eax
	and	DWORD PTR 24[rbp], eax
	call	ZS_REGS_HELD@PLT
	test	rax, rax
	jne	.L17
.L4:
	mov	rdi, rbp
	call	ZS_TX_STOPPED@PLT
	test	rax, rax
	jne	.L18
	mov	rdi, QWORD PTR 16[rbp]
	test	rdi, rdi
	jne	.L19
	mov	r13, QWORD PTR 8[rbp]
	test	r13, r13
	je	.L8
	mov	rdi, r13
	call	uart_circ_empty@PLT
	test	rax, rax
	je	.L20
.L8:
	mov	rdi, QWORD PTR RES_Tx_P[rip]
	mov	rsi, r12
	call	writeb@PLT
	xor	eax, eax
	call	ZSDELAY@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rdi, r12
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	ZS_WSYNC@PLT
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	mov	eax, DWORD PTR IP22ZILOG_FLAG_TX_ACTIVE[rip]
	or	DWORD PTR 24[rbp], eax
	lea	rsi, 4[r12]
	call	writeb@PLT
	xor	eax, eax
	call	ZSDELAY@PLT
	mov	rdi, r12
	call	ZS_WSYNC@PLT
	add	DWORD PTR 0[rbp], 1
	mov	QWORD PTR 16[rbp], 0
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	mov	eax, DWORD PTR IP22ZILOG_FLAG_TX_STOPPED[rip]
	not	eax
	and	DWORD PTR 24[rbp], eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L17:
	mov	esi, DWORD PTR 28[rbp]
	mov	rdi, r12
	call	__load_zsregs@PLT
	mov	eax, DWORD PTR IP22ZILOG_FLAG_REGS_HELD[rip]
	not	eax
	and	DWORD PTR 24[rbp], eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L20:
	mov	rdi, rbp
	call	uart_tx_stopped@PLT
	test	rax, rax
	jne	.L8
	mov	rdx, QWORD PTR 0[r13]
	mov	eax, DWORD PTR IP22ZILOG_FLAG_TX_ACTIVE[rip]
	lea	rsi, 4[r12]
	or	DWORD PTR 24[rbp], eax
	mov	rax, QWORD PTR 8[r13]
	mov	rdi, QWORD PTR [rax+rdx*8]
	call	writeb@PLT
	xor	eax, eax
	call	ZSDELAY@PLT
	mov	rdi, r12
	call	ZS_WSYNC@PLT
	mov	ecx, DWORD PTR UART_XMIT_SIZE[rip]
	mov	rax, QWORD PTR 0[r13]
	mov	rdi, r13
	lea	edx, -1[rcx]
	add	rax, 1
	movsx	rdx, edx
	and	rax, rdx
	mov	QWORD PTR 0[r13], rax
	add	DWORD PTR 0[rbp], 1
	call	uart_circ_chars_pending@PLT
	cmp	rax, QWORD PTR WAKEUP_CHARS[rip]
	jge	.L1
	add	rsp, 8
	.cfi_def_cfa_offset 40
	mov	rdi, rbp
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	uart_write_wakeup@PLT
	.cfi_endproc
.LFE0:
	.size	ip22zilog_transmit_chars, .-ip22zilog_transmit_chars
	.comm	WAKEUP_CHARS,8,8
	.comm	UART_XMIT_SIZE,4,4
	.comm	Tx_BUF_EMP,1,1
	.comm	RES_Tx_P,8,8
	.comm	IP22ZILOG_FLAG_TX_STOPPED,4,4
	.comm	IP22ZILOG_FLAG_TX_ACTIVE,4,4
	.comm	IP22ZILOG_FLAG_REGS_HELD,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_ip22zilog.c_ip22zilog_transmit_chars.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ip22zilog_transmit_chars, %function
ip22zilog_transmit_chars:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r1
	mov	r4, r0
	bl	ZS_IS_CONS
	cmp	r0, #0
	beq	.L5
	mov	r0, r5
	bl	readb
	mov	r6, r0
	bl	ZSDELAY
	ldr	r3, .L22
	ldrb	r3, [r3]	@ zero_extendqisi2
	tst	r6, r3
	popeq	{r4, r5, r6, r7, r8, pc}
.L5:
	ldr	r7, .L22+4
	ldr	r3, [r4, #12]
	ldr	r2, [r7]
	mov	r0, r4
	bic	r3, r3, r2
	str	r3, [r4, #12]
	bl	ZS_REGS_HELD
	cmp	r0, #0
	bne	.L18
.L4:
	mov	r0, r4
	bl	ZS_TX_STOPPED
	subs	r6, r0, #0
	bne	.L19
	ldr	r0, [r4, #8]
	cmp	r0, #0
	bne	.L20
	ldr	r6, [r4, #4]
	cmp	r6, #0
	beq	.L8
	mov	r0, r6
	bl	uart_circ_empty
	cmp	r0, #0
	beq	.L21
.L8:
	ldr	r3, .L22+8
	mov	r1, r5
	ldr	r0, [r3]
	bl	writeb
	bl	ZSDELAY
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, lr}
	b	ZS_WSYNC
.L19:
	ldr	r2, .L22+12
	ldr	r3, [r4, #12]
	ldr	r2, [r2]
	bic	r3, r3, r2
	str	r3, [r4, #12]
	b	.L8
.L18:
	mov	r0, r5
	ldr	r1, [r4, #16]
	bl	__load_zsregs
	ldr	r2, .L22+16
	ldr	r3, [r4, #12]
	ldr	r2, [r2]
	bic	r3, r3, r2
	str	r3, [r4, #12]
	b	.L4
.L21:
	mov	r0, r4
	bl	uart_tx_stopped
	cmp	r0, #0
	bne	.L8
	ldr	r2, [r7]
	ldr	r3, [r4, #12]
	ldr	r1, [r6]
	orr	r3, r3, r2
	ldr	r2, [r6, #4]
	str	r3, [r4, #12]
	ldr	r0, [r2, r1, lsl #2]
	add	r1, r5, #4
	bl	writeb
	bl	ZSDELAY
	mov	r0, r5
	bl	ZS_WSYNC
	ldr	r2, .L22+20
	ldr	r3, [r6]
	ldr	r1, [r2]
	ldr	r2, [r4]
	sub	r1, r1, #1
	add	r3, r3, #1
	and	r3, r3, r1
	add	r2, r2, #1
	str	r3, [r6]
	mov	r0, r6
	str	r2, [r4]
	bl	uart_circ_chars_pending
	ldr	r3, .L22+24
	ldr	r3, [r3]
	cmp	r0, r3
	popge	{r4, r5, r6, r7, r8, pc}
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	b	uart_write_wakeup
.L20:
	ldr	r2, [r7]
	ldr	r3, [r4, #12]
	add	r1, r5, #4
	orr	r3, r3, r2
	str	r3, [r4, #12]
	bl	writeb
	bl	ZSDELAY
	mov	r0, r5
	bl	ZS_WSYNC
	ldr	r3, [r4]
	str	r6, [r4, #8]
	add	r3, r3, #1
	str	r3, [r4]
	pop	{r4, r5, r6, r7, r8, pc}
.L23:
	.align	2
.L22:
	.word	Tx_BUF_EMP
	.word	IP22ZILOG_FLAG_TX_ACTIVE
	.word	RES_Tx_P
	.word	IP22ZILOG_FLAG_TX_STOPPED
	.word	IP22ZILOG_FLAG_REGS_HELD
	.word	UART_XMIT_SIZE
	.word	WAKEUP_CHARS
	.size	ip22zilog_transmit_chars, .-ip22zilog_transmit_chars
	.comm	WAKEUP_CHARS,4,4
	.comm	UART_XMIT_SIZE,4,4
	.comm	Tx_BUF_EMP,1,1
	.comm	RES_Tx_P,4,4
	.comm	IP22ZILOG_FLAG_TX_STOPPED,4,4
	.comm	IP22ZILOG_FLAG_TX_ACTIVE,4,4
	.comm	IP22ZILOG_FLAG_REGS_HELD,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
