	.file	"extr_uart_dev_ar933x.c_ar933x_bus_transmit.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ar933x_bus_transmit, @function
ar933x_bus_transmit:
.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
	lea	rbp, 24[rdi]
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	edi, DWORD PTR 20[rdi]
	call	uart_lock@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	mov	esi, DWORD PTR AR933X_UART_CS_REG[rip]
	mov	rdi, rbp
	call	ar933x_getreg@PLT
	test	DWORD PTR AR933X_UART_CS_TX_BUSY[rip], eax
	jne	.L2
	mov	edx, DWORD PTR [r12]
	test	edx, edx
	jle	.L3
	xor	ebx, ebx
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rax, QWORD PTR 8[r12]
	mov	esi, DWORD PTR AR933X_UART_DATA_REG[rip]
	mov	rdi, rbp
	movzx	edx, BYTE PTR [rax+rbx*4]
	or	edx, DWORD PTR AR933X_UART_DATA_TX_CSR[rip]
	add	rbx, 1
	call	ar933x_setreg@PLT
	mov	rdi, rbp
	call	uart_barrier@PLT
	mov	edx, DWORD PTR [r12]
	cmp	edx, ebx
	jg	.L4
.L3:
	or	edx, DWORD PTR AR933X_UART_INT_TX_EMPTY[rip]
	mov	rdi, rbp
	mov	DWORD PTR [r12], edx
	mov	esi, DWORD PTR AR933X_UART_INT_EN_REG[rip]
	call	ar933x_setreg@PLT
	mov	rdi, rbp
	call	uart_barrier@PLT
	mov	edi, DWORD PTR 20[r12]
	mov	DWORD PTR 16[r12], 1
	call	uart_unlock@PLT
	pop	rbx
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	ar933x_bus_transmit, .-ar933x_bus_transmit
	.comm	AR933X_UART_INT_TX_EMPTY,4,4
	.comm	AR933X_UART_INT_EN_REG,4,4
	.comm	AR933X_UART_DATA_TX_CSR,4,4
	.comm	AR933X_UART_DATA_REG,4,4
	.comm	AR933X_UART_CS_TX_BUSY,4,4
	.comm	AR933X_UART_CS_REG,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_uart_dev_ar933x.c_ar933x_bus_transmit.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ar933x_bus_transmit, %function
ar933x_bus_transmit:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r6, r0
	ldr	r0, [r0, #12]
	bl	uart_lock
	ldr	r8, .L9
	ldr	r7, .L9+4
	add	r5, r6, #16
.L2:
	mov	r0, r5
	ldr	r1, [r8]
	bl	ar933x_getreg
	ldr	r3, [r7]
	ands	r4, r0, r3
	bne	.L2
	ldr	r2, [r6]
	cmp	r2, #0
	ble	.L3
	ldr	r8, .L9+8
	ldr	r7, .L9+12
.L4:
	ldr	r2, [r6, #4]
	ldr	r3, [r8]
	ldrb	r2, [r2, r4, lsl #2]	@ zero_extendqisi2
	ldr	r1, [r7]
	orr	r2, r2, r3
	mov	r0, r5
	bl	ar933x_setreg
	mov	r0, r5
	bl	uart_barrier
	ldr	r2, [r6]
	add	r4, r4, #1
	cmp	r2, r4
	bgt	.L4
.L3:
	ldr	r1, .L9+16
	ldr	r3, .L9+20
	ldr	r1, [r1]
	mov	r0, r5
	orr	r2, r2, r1
	str	r2, [r6]
	ldr	r1, [r3]
	bl	ar933x_setreg
	mov	r0, r5
	bl	uart_barrier
	mov	r3, #1
	ldr	r0, [r6, #12]
	str	r3, [r6, #8]
	bl	uart_unlock
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L10:
	.align	2
.L9:
	.word	AR933X_UART_CS_REG
	.word	AR933X_UART_CS_TX_BUSY
	.word	AR933X_UART_DATA_TX_CSR
	.word	AR933X_UART_DATA_REG
	.word	AR933X_UART_INT_TX_EMPTY
	.word	AR933X_UART_INT_EN_REG
	.size	ar933x_bus_transmit, .-ar933x_bus_transmit
	.comm	AR933X_UART_INT_TX_EMPTY,4,4
	.comm	AR933X_UART_INT_EN_REG,4,4
	.comm	AR933X_UART_DATA_TX_CSR,4,4
	.comm	AR933X_UART_DATA_REG,4,4
	.comm	AR933X_UART_CS_TX_BUSY,4,4
	.comm	AR933X_UART_CS_REG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
