	.file	"extr_ar71xx_spi.c_spi_xfer.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"ar71xx_spi: spi_xfer: slave:%p bitlen:%08x dout:%p din:%p flags:%08x\n"
	.align 8
.LC1:
	.string	"ar71xx_spi: sending: data:%02x length:%d\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"ar71xx_spi: received:%02x\n"
.LC3:
	.string	" ---> out\n"
	.text
	.p2align 4
	.globl	spi_xfer
	.type	spi_xfer, @function
spi_xfer:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rcx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, r12d
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, r8
	shr	ebp, 3
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	QWORD PTR 16[rsp], rdi
	mov	QWORD PTR 24[rsp], r8
	call	to_ar71xx_spi@PLT
	xor	eax, eax
	mov	r9, rbx
	mov	r8, r14
	mov	rcx, r13
	mov	edx, r12d
	mov	rsi, r15
	mov	DWORD PTR 4[rsp], ebp
	lea	rdi, .LC0[rip]
	call	PRINTD@PLT
	test	QWORD PTR SPI_XFER_BEGIN[rip], rbx
	jne	.L33
.L2:
	mov	rax, QWORD PTR 16[rsp]
	mov	edi, DWORD PTR [rax]
	and	r12d, 7
	je	.L3
	call	SPI_IOC_CS@PLT
	mov	ebx, DWORD PTR SPI_IOC_CS_ALL[rip]
	not	eax
	and	ebx, eax
.L4:
	mov	eax, 8
	test	r12d, r12d
	mov	edx, eax
	cmovne	edx, r12d
	sub	eax, edx
	mov	DWORD PTR 12[rsp], edx
	mov	DWORD PTR 8[rsp], eax
	.p2align 4,,10
	.p2align 3
.L15:
	xor	r15d, r15d
	test	r13, r13
	je	.L8
	mov	r15d, DWORD PTR 0[r13]
	add	r13, 4
.L8:
	mov	ecx, 8
	mov	edx, r15d
	mov	eax, r15d
	mov	ebp, DWORD PTR 12[rsp]
	sub	ecx, r12d
	lea	rdi, .LC1[rip]
	sal	edx, cl
	test	r12d, r12d
	cmovne	eax, edx
	mov	edx, ebp
	mov	r15d, eax
	mov	esi, eax
	xor	eax, eax
	call	PRINTD@PLT
	movzx	ecx, BYTE PTR 8[rsp]
	sal	r15d, cl
	.p2align 4,,10
	.p2align 3
.L12:
	mov	eax, DWORD PTR SPI_IOC_DO[rip]
	mov	ecx, ebx
	mov	rdi, QWORD PTR SPI_REG_IOC[rip]
	or	ecx, eax
	not	eax
	and	ebx, eax
	test	r15b, -128
	cmovne	ebx, ecx
	add	rdi, QWORD PTR AR71XX_SPI_BASE[rip]
	add	r15d, r15d
	call	KSEG1ADDR@PLT
	mov	esi, eax
	mov	edi, ebx
	call	__raw_writel@PLT
	mov	rdi, QWORD PTR SPI_REG_IOC[rip]
	add	rdi, QWORD PTR AR71XX_SPI_BASE[rip]
	call	KSEG1ADDR@PLT
	mov	edi, DWORD PTR SPI_IOC_CLK[rip]
	mov	esi, eax
	or	edi, ebx
	call	__raw_writel@PLT
	sub	ebp, 1
	jne	.L12
	mov	rdi, QWORD PTR SPI_REG_RDS[rip]
	add	rdi, QWORD PTR AR71XX_SPI_BASE[rip]
	call	KSEG1ADDR@PLT
	mov	edi, eax
	call	__raw_readl@PLT
	lea	rdi, .LC2[rip]
	mov	ebp, eax
	mov	esi, eax
	xor	eax, eax
	call	PRINTD@PLT
	test	r14, r14
	je	.L13
	lea	rax, 4[r14]
	test	r12d, r12d
	je	.L31
	mov	ecx, 8
	sub	ecx, r12d
	sal	ebp, cl
.L31:
	mov	DWORD PTR [r14], ebp
	mov	r14, rax
.L13:
	sub	DWORD PTR 4[rsp], 1
	mov	eax, DWORD PTR 4[rsp]
	cmp	eax, -1
	jne	.L15
	mov	rax, QWORD PTR 24[rsp]
	test	QWORD PTR SPI_XFER_END[rip], rax
	jne	.L34
.L7:
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	PRINTD@PLT
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
.L3:
	.cfi_restore_state
	call	SPI_IOC_CS@PLT
	mov	ebx, DWORD PTR SPI_IOC_CS_ALL[rip]
	not	eax
	and	ebx, eax
	lea	eax, -1[rbp]
	mov	DWORD PTR 4[rsp], eax
	test	ebp, ebp
	jne	.L4
	mov	rax, QWORD PTR 24[rsp]
	test	QWORD PTR SPI_XFER_END[rip], rax
	je	.L7
.L34:
	mov	rdi, QWORD PTR SPI_REG_IOC[rip]
	add	rdi, QWORD PTR AR71XX_SPI_BASE[rip]
	call	KSEG1ADDR@PLT
	mov	ebp, eax
	mov	rax, QWORD PTR 16[rsp]
	mov	edi, DWORD PTR [rax]
	call	SPI_IOC_CS@PLT
	mov	esi, ebp
	mov	edi, eax
	call	__raw_writel@PLT
	mov	rdi, QWORD PTR SPI_REG_IOC[rip]
	add	rdi, QWORD PTR AR71XX_SPI_BASE[rip]
	call	KSEG1ADDR@PLT
	mov	edi, DWORD PTR SPI_IOC_CS_ALL[rip]
	mov	esi, eax
	call	__raw_writel@PLT
	mov	rdi, QWORD PTR SPI_REG_FS[rip]
	add	rdi, QWORD PTR AR71XX_SPI_BASE[rip]
	call	KSEG1ADDR@PLT
	xor	edi, edi
	mov	esi, eax
	call	__raw_writel@PLT
	jmp	.L7
.L33:
	mov	rdi, QWORD PTR SPI_REG_FS[rip]
	add	rdi, QWORD PTR AR71XX_SPI_BASE[rip]
	call	KSEG1ADDR@PLT
	mov	edi, DWORD PTR SPI_FS_GPIO[rip]
	mov	esi, eax
	call	__raw_writel@PLT
	mov	rdi, QWORD PTR SPI_REG_IOC[rip]
	add	rdi, QWORD PTR AR71XX_SPI_BASE[rip]
	call	KSEG1ADDR@PLT
	mov	edi, DWORD PTR SPI_IOC_CS_ALL[rip]
	mov	esi, eax
	call	__raw_writel@PLT
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	spi_xfer, .-spi_xfer
	.comm	SPI_XFER_END,8,8
	.comm	SPI_XFER_BEGIN,8,8
	.comm	SPI_REG_RDS,8,8
	.comm	SPI_REG_IOC,8,8
	.comm	SPI_REG_FS,8,8
	.comm	SPI_IOC_DO,4,4
	.comm	SPI_IOC_CS_ALL,4,4
	.comm	SPI_IOC_CLK,4,4
	.comm	SPI_FS_GPIO,4,4
	.comm	AR71XX_SPI_BASE,8,8
	.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_ar71xx_spi.c_spi_xfer.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"ar71xx_spi: spi_xfer: slave:%p bitlen:%08x dout:%p "
	.ascii	"din:%p flags:%08x\012\000"
	.align	2
.LC1:
	.ascii	"ar71xx_spi: sending: data:%02x length:%d\012\000"
	.align	2
.LC2:
	.ascii	"ar71xx_spi: received:%02x\012\000"
	.align	2
.LC3:
	.ascii	" ---> out\012\000"
	.text
	.align	2
	.global	spi_xfer
	.syntax unified
	.arm
	.fpu softvfp
	.type	spi_xfer, %function
spi_xfer:
	@ args = 4, pretend = 0, frame = 40
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r1
	mov	r5, r3
	mov	r7, r2
	mov	r6, r0
	sub	sp, sp, #52
	str	r2, [sp, #20]
	str	r3, [sp, #16]
	str	r0, [sp, #40]
	bl	to_ar71xx_spi
	ldr	r3, [sp, #88]
	mov	r2, r4
	str	r5, [sp]
	str	r3, [sp, #4]
	mov	r1, r6
	mov	r3, r7
	ldr	r0, .L33
	bl	PRINTD
	ldr	r3, .L33+4
	ldr	r2, [sp, #88]
	ldr	r3, [r3]
	lsr	r5, r4, #3
	tst	r2, r3
	str	r5, [sp, #12]
	bne	.L28
	ldr	r3, .L33+8
	str	r3, [sp, #44]
.L2:
	ands	r3, r4, #7
	str	r3, [sp, #24]
	ldr	r3, [sp, #40]
	ldr	r0, [r3]
	beq	.L3
	bl	SPI_IOC_CS
	ldr	r3, [sp, #44]
	ldr	r4, [r3]
	bic	r4, r4, r0
.L4:
	ldr	r3, [sp, #24]
	ldr	r6, .L33+12
	cmp	r3, #0
	movne	r2, r3
	moveq	r2, #8
	rsb	r3, r3, #8
	str	r2, [sp, #32]
	ldr	r7, .L33+16
	rsb	r2, r2, #8
	ldr	r9, .L33+20
	ldr	r8, .L33+24
	str	r2, [sp, #28]
	str	r3, [sp, #36]
.L15:
	ldr	r3, [sp, #20]
	ldr	r10, [sp, #32]
	cmp	r3, #0
	ldrne	fp, [r3], #4
	ldreq	fp, [sp, #20]
	strne	r3, [sp, #20]
	ldr	r3, [sp, #24]
	mov	r2, r10
	cmp	r3, #0
	ldrne	r3, [sp, #36]
	ldr	r0, .L33+28
	lslne	fp, fp, r3
	mov	r1, fp
	bl	PRINTD
	ldr	r3, [sp, #28]
	lsl	fp, fp, r3
.L12:
	ldr	r3, [r9]
	tst	fp, #128
	orrne	r4, r4, r3
	biceq	r4, r4, r3
	ldr	r0, [r6]
	ldr	r3, [r7]
	lsl	fp, fp, #1
	add	r0, r0, r3
	bl	KSEG1ADDR
	mov	r1, r0
	mov	r0, r4
	bl	__raw_writel
	ldr	r3, [r7]
	ldr	r0, [r6]
	ldr	r5, [r8]
	add	r0, r0, r3
	bl	KSEG1ADDR
	orr	r5, r4, r5
	mov	r1, r0
	mov	r0, r5
	bl	__raw_writel
	subs	r10, r10, #1
	bne	.L12
	ldr	r3, .L33+32
	ldr	r0, [r6]
	ldr	r3, [r3]
	add	r0, r0, r3
	bl	KSEG1ADDR
	bl	__raw_readl
	mov	r5, r0
	ldr	r0, .L33+36
	mov	r1, r5
	bl	PRINTD
	ldr	r2, [sp, #16]
	cmp	r2, #0
	beq	.L13
	ldr	r3, [sp, #24]
	cmp	r3, #0
	add	r3, r2, #4
	ldrne	r2, [sp, #36]
	lslne	r5, r5, r2
	ldrne	r2, [sp, #16]
	str	r3, [sp, #16]
	str	r5, [r2]
.L13:
	ldr	r3, [sp, #12]
	sub	r3, r3, #1
	cmn	r3, #1
	str	r3, [sp, #12]
	bne	.L15
.L16:
	ldr	r3, .L33+40
	ldr	r2, [sp, #88]
	ldr	r3, [r3]
	tst	r2, r3
	bne	.L32
.L7:
	ldr	r0, .L33+44
	bl	PRINTD
	mov	r0, #0
	add	sp, sp, #52
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L3:
	bl	SPI_IOC_CS
	ldr	r3, [sp, #44]
	cmp	r5, #0
	ldr	r4, [r3]
	subne	r3, r5, #1
	bic	r4, r4, r0
	strne	r3, [sp, #12]
	bne	.L4
	b	.L16
.L28:
	ldr	r6, .L33+12
	ldr	r3, .L33+48
	ldr	r0, [r6]
	ldr	r2, [r3]
	ldr	r3, .L33+52
	add	r0, r0, r2
	ldr	r8, [r3]
	bl	KSEG1ADDR
	ldr	r7, .L33+16
	mov	r1, r0
	mov	r0, r8
	bl	__raw_writel
	ldr	r0, [r6]
	ldr	r3, [r7]
	ldr	r2, .L33+8
	add	r0, r0, r3
	ldr	r6, [r2]
	str	r2, [sp, #44]
	bl	KSEG1ADDR
	mov	r1, r0
	mov	r0, r6
	bl	__raw_writel
	b	.L2
.L32:
	ldr	r3, [sp, #40]
	ldr	r4, .L33+12
	ldr	r0, [r3]
	bl	SPI_IOC_CS
	ldr	r6, .L33+16
	ldr	r2, [r4]
	ldr	r3, [r6]
	mov	r5, r0
	add	r0, r2, r3
	bl	KSEG1ADDR
	mov	r1, r0
	mov	r0, r5
	bl	__raw_writel
	ldr	r3, [r6]
	ldr	r0, [r4]
	ldr	r2, [sp, #44]
	add	r0, r0, r3
	ldr	r5, [r2]
	bl	KSEG1ADDR
	mov	r1, r0
	mov	r0, r5
	bl	__raw_writel
	ldr	r3, .L33+48
	ldr	r0, [r4]
	ldr	r3, [r3]
	add	r0, r0, r3
	bl	KSEG1ADDR
	mov	r1, r0
	mov	r0, #0
	bl	__raw_writel
	b	.L7
.L34:
	.align	2
.L33:
	.word	.LC0
	.word	SPI_XFER_BEGIN
	.word	SPI_IOC_CS_ALL
	.word	AR71XX_SPI_BASE
	.word	SPI_REG_IOC
	.word	SPI_IOC_DO
	.word	SPI_IOC_CLK
	.word	.LC1
	.word	SPI_REG_RDS
	.word	.LC2
	.word	SPI_XFER_END
	.word	.LC3
	.word	SPI_REG_FS
	.word	SPI_FS_GPIO
	.size	spi_xfer, .-spi_xfer
	.comm	SPI_XFER_END,4,4
	.comm	SPI_XFER_BEGIN,4,4
	.comm	SPI_REG_RDS,4,4
	.comm	SPI_REG_IOC,4,4
	.comm	SPI_REG_FS,4,4
	.comm	SPI_IOC_DO,4,4
	.comm	SPI_IOC_CS_ALL,4,4
	.comm	SPI_IOC_CLK,4,4
	.comm	SPI_FS_GPIO,4,4
	.comm	AR71XX_SPI_BASE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
