	.file	"extr_spi-synquacer.c_write_fifo.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	write_fifo, @function
write_fifo:
.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
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rdi
	mov	rdi, QWORD PTR SYNQUACER_HSSPI_REG_DMSTATUS[rip]
	add	rdi, QWORD PTR 16[rbx]
	call	readl@PLT
	mov	ecx, DWORD PTR SYNQUACER_HSSPI_DMSTATUS_TX_DATA_SHIFT[rip]
	mov	rdi, QWORD PTR SYNQUACER_HSSPI_FIFO_DEPTH[rip]
	mov	esi, DWORD PTR [rbx]
	sar	eax, cl
	and	eax, DWORD PTR SYNQUACER_HSSPI_DMSTATUS_TX_DATA_MASK[rip]
	cdqe
	sub	rdi, rax
	call	min@PLT
	mov	ebp, eax
	mov	eax, DWORD PTR 4[rbx]
	cmp	eax, 16
	je	.L2
	jg	.L3
	cmp	eax, 8
	jne	.L5
	mov	r12, QWORD PTR 8[rbx]
	mov	rdi, QWORD PTR SYNQUACER_HSSPI_REG_TX_FIFO[rip]
	mov	edx, ebp
	add	rdi, QWORD PTR 16[rbx]
	mov	rsi, r12
	call	iowrite8_rep@PLT
	movsx	rax, ebp
	lea	rax, [r12+rax*4]
	mov	QWORD PTR 8[rbx], rax
.L7:
	sub	DWORD PTR [rbx], ebp
	xor	eax, eax
	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
.L3:
	.cfi_restore_state
	sub	eax, 24
	and	eax, -9
	je	.L11
.L5:
	mov	eax, DWORD PTR EINVAL[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	r12, QWORD PTR 8[rbx]
	mov	rdi, QWORD PTR SYNQUACER_HSSPI_REG_TX_FIFO[rip]
	mov	edx, ebp
	add	rdi, QWORD PTR 16[rbx]
	mov	rsi, r12
	call	iowrite16_rep@PLT
	movsx	rax, ebp
	lea	rax, [r12+rax*4]
	mov	QWORD PTR 8[rbx], rax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L11:
	mov	r12, QWORD PTR 8[rbx]
	mov	rdi, QWORD PTR SYNQUACER_HSSPI_REG_TX_FIFO[rip]
	mov	edx, ebp
	add	rdi, QWORD PTR 16[rbx]
	mov	rsi, r12
	call	iowrite32_rep@PLT
	movsx	rax, ebp
	lea	rax, [r12+rax*4]
	mov	QWORD PTR 8[rbx], rax
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	write_fifo, .-write_fifo
	.comm	SYNQUACER_HSSPI_REG_TX_FIFO,8,8
	.comm	SYNQUACER_HSSPI_REG_DMSTATUS,8,8
	.comm	SYNQUACER_HSSPI_FIFO_DEPTH,8,8
	.comm	SYNQUACER_HSSPI_DMSTATUS_TX_DATA_SHIFT,4,4
	.comm	SYNQUACER_HSSPI_DMSTATUS_TX_DATA_MASK,4,4
	.comm	EINVAL,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_spi-synquacer.c_write_fifo.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_fifo, %function
write_fifo:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L11
	push	{r4, r5, r6, lr}
	ldr	r3, [r3]
	mov	r4, r0
	ldr	r0, [r0, #12]
	add	r0, r0, r3
	bl	readl
	ldr	r1, .L11+4
	ldr	r3, .L11+8
	ldr	r2, .L11+12
	ldr	r1, [r1]
	ldr	r3, [r3]
	ldr	r2, [r2]
	and	r0, r3, r0, asr r1
	sub	r0, r2, r0
	ldr	r1, [r4]
	bl	min
	ldr	r3, [r4, #4]
	mov	r5, r0
	sub	r3, r3, #8
	cmp	r3, #24
	ldrls	pc, [pc, r3, asl #2]
	b	.L2
.L4:
	.word	.L6
	.word	.L2
	.word	.L2
	.word	.L2
	.word	.L2
	.word	.L2
	.word	.L2
	.word	.L2
	.word	.L5
	.word	.L2
	.word	.L2
	.word	.L2
	.word	.L2
	.word	.L2
	.word	.L2
	.word	.L2
	.word	.L3
	.word	.L2
	.word	.L2
	.word	.L2
	.word	.L2
	.word	.L2
	.word	.L2
	.word	.L2
	.word	.L3
.L2:
	ldr	r3, .L11+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, pc}
.L3:
	ldr	r3, .L11+20
	ldr	r6, [r4, #8]
	ldr	r0, [r4, #12]
	ldr	r3, [r3]
	mov	r1, r6
	mov	r2, r5
	add	r0, r0, r3
	add	r6, r6, r5, lsl #2
	bl	iowrite32_rep
	str	r6, [r4, #8]
.L7:
	ldr	r2, [r4]
	mov	r0, #0
	sub	r2, r2, r5
	str	r2, [r4]
	pop	{r4, r5, r6, pc}
.L5:
	ldr	r3, .L11+20
	ldr	r6, [r4, #8]
	ldr	r0, [r4, #12]
	ldr	r3, [r3]
	mov	r1, r6
	mov	r2, r5
	add	r0, r0, r3
	add	r6, r6, r5, lsl #2
	bl	iowrite16_rep
	str	r6, [r4, #8]
	b	.L7
.L6:
	ldr	r3, .L11+20
	ldr	r6, [r4, #8]
	ldr	r0, [r4, #12]
	ldr	r3, [r3]
	mov	r1, r6
	mov	r2, r5
	add	r0, r0, r3
	add	r6, r6, r5, lsl #2
	bl	iowrite8_rep
	str	r6, [r4, #8]
	b	.L7
.L12:
	.align	2
.L11:
	.word	SYNQUACER_HSSPI_REG_DMSTATUS
	.word	SYNQUACER_HSSPI_DMSTATUS_TX_DATA_SHIFT
	.word	SYNQUACER_HSSPI_DMSTATUS_TX_DATA_MASK
	.word	SYNQUACER_HSSPI_FIFO_DEPTH
	.word	EINVAL
	.word	SYNQUACER_HSSPI_REG_TX_FIFO
	.size	write_fifo, .-write_fifo
	.comm	SYNQUACER_HSSPI_REG_TX_FIFO,4,4
	.comm	SYNQUACER_HSSPI_REG_DMSTATUS,4,4
	.comm	SYNQUACER_HSSPI_FIFO_DEPTH,4,4
	.comm	SYNQUACER_HSSPI_DMSTATUS_TX_DATA_SHIFT,4,4
	.comm	SYNQUACER_HSSPI_DMSTATUS_TX_DATA_MASK,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
