	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_spi_xfer                       ## -- Begin function spi_xfer
	.p2align	4, 0x90
_spi_xfer:                              ## @spi_xfer
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	movq	%rcx, %r13
	movq	%rdx, %r12
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_to_ar71xx_spi
	movl	%ebx, %eax
	shrl	$3, %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edx
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %rcx
	movq	%r13, %r8
	movq	%r14, %r9
	xorl	%eax, %eax
	callq	_PRINTD
	movq	_SPI_XFER_BEGIN@GOTPCREL(%rip), %rax
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	testq	%r14, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_SPI_FS_GPIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_AR71XX_SPI_BASE@GOTPCREL(%rip), %r14
	movq	_SPI_REG_FS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	callq	_KSEG1ADDR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	___raw_writel
	movq	_SPI_IOC_CS_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_SPI_REG_IOC@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	callq	_KSEG1ADDR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	___raw_writel
LBB0_2:
	xorl	%ebx, %ebx
	andl	$7, -44(%rbp)                   ## 4-byte Folded Spill
	setne	%bl
	movq	_SPI_IOC_CS_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movl	(%r15), %edi
	callq	_SPI_IOC_CS
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	addl	%ebx, %ecx
	je	LBB0_13
## %bb.3:
	notl	%eax
	andl	%eax, %r14d
	movl	$8, %eax
	movl	$8, %edx
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	subl	%r12d, %edx
	testl	%r12d, %r12d
	cmovel	%r12d, %edx
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	cmovel	%eax, %r12d
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	subl	%r12d, %eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %ebx
	movl	%ebx, (%r13)
	addq	$4, %r13
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	testl	%ecx, %ecx
	je	LBB0_13
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	movq	%r13, -96(%rbp)                 ## 8-byte Spill
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%rax), %r12d
	addq	$4, %rax
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	xorl	%r12d, %r12d
	xorl	%eax, %eax
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	decl	%ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r12d
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %esi
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_PRINTD
	movl	-68(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r12d
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_SPI_IOC_DO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	orl	%r14d, %ecx
	notl	%eax
	andl	%eax, %r14d
	testb	$-128, %r12b
	cmovnel	%ecx, %r14d
	movq	_SPI_REG_IOC@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_AR71XX_SPI_BASE@GOTPCREL(%rip), %r15
	addq	(%r15), %rdi
	callq	_KSEG1ADDR
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	___raw_writel
	movq	_SPI_IOC_CLK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	orl	%r14d, %ebx
	movq	_SPI_REG_IOC@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r15), %rdi
	callq	_KSEG1ADDR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	___raw_writel
	addl	%r12d, %r12d
	decl	%r13d
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_SPI_REG_RDS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_AR71XX_SPI_BASE@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	callq	_KSEG1ADDR
	movl	%eax, %edi
	callq	___raw_readl
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_PRINTD
	movq	-96(%rbp), %r13                 ## 8-byte Reload
	testq	%r13, %r13
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	xorl	%r13d, %r13d
	jmp	LBB0_12
LBB0_13:
	movq	_SPI_XFER_END@GOTPCREL(%rip), %rax
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, (%rax)
	je	LBB0_15
## %bb.14:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_SPI_IOC_CS
	movl	%eax, %ebx
	movq	_AR71XX_SPI_BASE@GOTPCREL(%rip), %r14
	movq	_SPI_REG_IOC@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	addq	(%r14), %rdi
	callq	_KSEG1ADDR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	___raw_writel
	movq	_SPI_IOC_CS_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	(%r15), %rdi
	addq	(%r14), %rdi
	callq	_KSEG1ADDR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	___raw_writel
	movq	_SPI_REG_FS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	callq	_KSEG1ADDR
	xorl	%edi, %edi
	movl	%eax, %esi
	callq	___raw_writel
LBB0_15:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_PRINTD
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ar71xx_spi: spi_xfer: slave:%p bitlen:%08x dout:%p din:%p flags:%08x\n"

	.comm	_SPI_XFER_BEGIN,8,3             ## @SPI_XFER_BEGIN
	.comm	_SPI_FS_GPIO,4,2                ## @SPI_FS_GPIO
	.comm	_AR71XX_SPI_BASE,8,3            ## @AR71XX_SPI_BASE
	.comm	_SPI_REG_FS,8,3                 ## @SPI_REG_FS
	.comm	_SPI_IOC_CS_ALL,4,2             ## @SPI_IOC_CS_ALL
	.comm	_SPI_REG_IOC,8,3                ## @SPI_REG_IOC
L_.str.1:                               ## @.str.1
	.asciz	"ar71xx_spi: sending: data:%02x length:%d\n"

	.comm	_SPI_IOC_DO,4,2                 ## @SPI_IOC_DO
	.comm	_SPI_IOC_CLK,4,2                ## @SPI_IOC_CLK
	.comm	_SPI_REG_RDS,8,3                ## @SPI_REG_RDS
L_.str.2:                               ## @.str.2
	.asciz	"ar71xx_spi: received:%02x\n"

	.comm	_SPI_XFER_END,8,3               ## @SPI_XFER_END
L_.str.3:                               ## @.str.3
	.asciz	" ---> out\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_spi_xfer                       ; -- Begin function spi_xfer
	.p2align	2
_spi_xfer:                              ; @spi_xfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x28, x27, [sp, #96]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #112]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x4
	mov	x22, x3
	mov	x26, x2
	mov	x23, x1
	mov	x20, x0
	bl	_to_ar71xx_spi
	lsr	w19, w23, #3
	stp	x22, x21, [sp, #24]
	str	x22, [sp, #88]                  ; 8-byte Folded Spill
	stp	x23, x26, [sp, #8]
	str	x20, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_PRINTD
Lloh2:
	adrp	x8, _SPI_XFER_BEGIN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SPI_XFER_BEGIN@GOTPAGEOFF]
Lloh4:
	adrp	x22, _SPI_IOC_CS_ALL@GOTPAGE
Lloh5:
	ldr	x22, [x22, _SPI_IOC_CS_ALL@GOTPAGEOFF]
Lloh6:
	adrp	x27, _AR71XX_SPI_BASE@GOTPAGE
Lloh7:
	ldr	x27, [x27, _AR71XX_SPI_BASE@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
Lloh9:
	adrp	x28, _SPI_REG_IOC@GOTPAGE
Lloh10:
	ldr	x28, [x28, _SPI_REG_IOC@GOTPAGEOFF]
Lloh11:
	adrp	x9, _SPI_REG_FS@GOTPAGE
Lloh12:
	ldr	x9, [x9, _SPI_REG_FS@GOTPAGEOFF]
	str	x21, [sp, #56]                  ; 8-byte Folded Spill
	tst	x8, x21
	b.eq	LBB0_2
; %bb.1:
Lloh13:
	adrp	x8, _SPI_FS_GPIO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SPI_FS_GPIO@GOTPAGEOFF]
Lloh15:
	ldr	w24, [x8]
	ldr	x8, [x27]
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_KSEG1ADDR
	mov	x1, x0
	mov	x0, x24
	bl	___raw_writel
	ldr	w24, [x22]
	ldr	x8, [x27]
	ldr	x9, [x28]
	add	x0, x9, x8
	bl	_KSEG1ADDR
	mov	x1, x0
	mov	x0, x24
	bl	___raw_writel
LBB0_2:
	ldr	w21, [x22]
	str	x20, [sp, #48]                  ; 8-byte Folded Spill
	ldr	w0, [x20]
	bl	_SPI_IOC_CS
	ands	w8, w23, #0x7
	cinc	w20, w19, ne
	cbz	w20, LBB0_12
; %bb.3:
	bic	w23, w21, w0
	mov	w9, #8
	sub	w10, w9, w8
	cmp	w8, #0
	csel	w10, wzr, w10, eq
	str	w10, [sp, #84]                  ; 4-byte Folded Spill
	csel	w8, w9, w8, eq
	str	x8, [sp, #72]                   ; 8-byte Folded Spill
	sub	w8, w9, w8
	str	w8, [sp, #68]                   ; 4-byte Folded Spill
Lloh16:
	adrp	x25, _SPI_IOC_DO@GOTPAGE
Lloh17:
	ldr	x25, [x25, _SPI_IOC_DO@GOTPAGEOFF]
Lloh18:
	adrp	x19, _SPI_IOC_CLK@GOTPAGE
Lloh19:
	ldr	x19, [x19, _SPI_IOC_CLK@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [sp, #84]                   ; 4-byte Folded Reload
	lsl	w8, w26, w8
	str	w8, [x9], #4
	str	x9, [sp, #88]                   ; 8-byte Folded Spill
	mov	x26, x24
	cbz	w20, LBB0_12
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	cbz	x26, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x26], #4
	mov	x24, x26
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w8, #0
	mov	x24, #0
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	sub	w20, w20, #1
	ldr	w9, [sp, #84]                   ; 4-byte Folded Reload
	lsl	w21, w8, w9
	ldr	x22, [sp, #72]                  ; 8-byte Folded Reload
	stp	x21, x22, [sp]
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_PRINTD
	ldr	w8, [sp, #68]                   ; 4-byte Folded Reload
	lsl	w21, w21, w8
                                        ; kill: def $w22 killed $w22 killed $x22
LBB0_9:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x25]
	orr	w9, w8, w23
	bic	w8, w23, w8
	tst	w21, #0x80
	csel	w23, w8, w9, eq
	ldr	x8, [x27]
	ldr	x9, [x28]
	add	x0, x9, x8
	bl	_KSEG1ADDR
	mov	x1, x0
	mov	x0, x23
	bl	___raw_writel
	ldr	w8, [x19]
	orr	w26, w8, w23
	ldr	x8, [x27]
	ldr	x9, [x28]
	add	x0, x9, x8
	bl	_KSEG1ADDR
	mov	x1, x0
	mov	x0, x26
	bl	___raw_writel
	lsl	w21, w21, #1
	subs	w22, w22, #1
	b.ne	LBB0_9
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x27]
Lloh22:
	adrp	x9, _SPI_REG_RDS@GOTPAGE
Lloh23:
	ldr	x9, [x9, _SPI_REG_RDS@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_KSEG1ADDR
	bl	___raw_readl
	mov	x26, x0
	str	x26, [sp]
Lloh25:
	adrp	x0, l_.str.2@PAGE
Lloh26:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_PRINTD
	ldr	x9, [sp, #88]                   ; 8-byte Folded Reload
	cbnz	x9, LBB0_4
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	str	xzr, [sp, #88]                  ; 8-byte Folded Spill
	mov	x26, x24
	cbnz	w20, LBB0_5
LBB0_12:
Lloh27:
	adrp	x8, _SPI_XFER_END@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SPI_XFER_END@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	ldr	x9, [sp, #56]                   ; 8-byte Folded Reload
	tst	x8, x9
	b.eq	LBB0_14
; %bb.13:
	ldr	x8, [sp, #48]                   ; 8-byte Folded Reload
	ldr	w0, [x8]
	bl	_SPI_IOC_CS
	mov	x19, x0
	ldr	x8, [x27]
	ldr	x9, [x28]
	add	x0, x9, x8
	bl	_KSEG1ADDR
	mov	x1, x0
	mov	x0, x19
	bl	___raw_writel
Lloh30:
	adrp	x8, _SPI_IOC_CS_ALL@GOTPAGE
Lloh31:
	ldr	x8, [x8, _SPI_IOC_CS_ALL@GOTPAGEOFF]
Lloh32:
	ldr	w19, [x8]
	ldr	x8, [x27]
	ldr	x9, [x28]
	add	x0, x9, x8
	bl	_KSEG1ADDR
	mov	x1, x0
	mov	x0, x19
	bl	___raw_writel
	ldr	x8, [x27]
Lloh33:
	adrp	x9, _SPI_REG_FS@GOTPAGE
Lloh34:
	ldr	x9, [x9, _SPI_REG_FS@GOTPAGEOFF]
Lloh35:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_KSEG1ADDR
	mov	x1, x0
	mov	w0, #0
	bl	___raw_writel
LBB0_14:
Lloh36:
	adrp	x0, l_.str.3@PAGE
Lloh37:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_PRINTD
	mov	w0, #0
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh8
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ar71xx_spi: spi_xfer: slave:%p bitlen:%08x dout:%p din:%p flags:%08x\n"

	.comm	_SPI_XFER_BEGIN,8,3             ; @SPI_XFER_BEGIN
	.comm	_SPI_FS_GPIO,4,2                ; @SPI_FS_GPIO
	.comm	_AR71XX_SPI_BASE,8,3            ; @AR71XX_SPI_BASE
	.comm	_SPI_REG_FS,8,3                 ; @SPI_REG_FS
	.comm	_SPI_IOC_CS_ALL,4,2             ; @SPI_IOC_CS_ALL
	.comm	_SPI_REG_IOC,8,3                ; @SPI_REG_IOC
l_.str.1:                               ; @.str.1
	.asciz	"ar71xx_spi: sending: data:%02x length:%d\n"

	.comm	_SPI_IOC_DO,4,2                 ; @SPI_IOC_DO
	.comm	_SPI_IOC_CLK,4,2                ; @SPI_IOC_CLK
	.comm	_SPI_REG_RDS,8,3                ; @SPI_REG_RDS
l_.str.2:                               ; @.str.2
	.asciz	"ar71xx_spi: received:%02x\n"

	.comm	_SPI_XFER_END,8,3               ; @SPI_XFER_END
l_.str.3:                               ; @.str.3
	.asciz	" ---> out\n"

.subsections_via_symbols
