	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spi_xfer_buf
_spi_xfer_buf:                          ## @spi_xfer_buf
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	cmpl	$0, (%rdi)
	jle	LBB0_2
## %bb.1:
	movl	64(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdx
	movq	%r15, %rcx
	movq	%r14, %r8
	callq	_device_printf
LBB0_2:
	testq	%r14, %r14
	je	LBB0_3
## %bb.4:
	movq	%r12, 56(%rbx)
	movq	%r14, 8(%rbx)
	movq	$0, 16(%rbx)
	movq	%r15, 48(%rbx)
	movq	%r14, 24(%rbx)
	movq	$0, 32(%rbx)
	movq	_INTREG_RDREN@GOTPCREL(%rip), %rax
	movq	_INTREG_TDREN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, 40(%rbx)
	movq	%rbx, %rdi
	callq	_spi_fill_txfifo
	movq	_ECSPI_INTREG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	40(%rbx), %edx
	movq	%rbx, %rdi
	callq	_WR4
	leaq	44(%rbx), %r15
	movq	_hz@GOTPCREL(%rip), %r13
	leaq	L_.str.1(%rip), %r12
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, 40(%rbx)
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r13), %eax
	addl	%eax, %eax
	leal	(%rax,%rax,4), %r8d
	movq	%rbx, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	movq	%r12, %rcx
	callq	_msleep
	testl	%eax, %eax
	je	LBB0_5
## %bb.7:
	movl	%eax, %r14d
LBB0_8:
	movq	16(%rbx), %rax
	cmpq	8(%rbx), %rax
	jne	LBB0_10
## %bb.9:
	movq	32(%rbx), %rax
	cmpq	24(%rbx), %rax
	je	LBB0_11
LBB0_10:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_11
LBB0_3:
	xorl	%r14d, %r14d
LBB0_11:
	movl	%r14d, %eax
	addq	$8, %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	"spi_xfer_buf, rxbuf %p txbuf %p len %u\n"

	.comm	_INTREG_RDREN,4,2               ## @INTREG_RDREN
	.comm	_INTREG_TDREN,4,2               ## @INTREG_TDREN
	.comm	_ECSPI_INTREG,4,2               ## @ECSPI_INTREG
L_.str.1:                               ## @.str.1
	.asciz	"imxspi"

	.comm	_hz,4,2                         ## @hz
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_spi_xfer_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spi_xfer_buf
_spi_xfer_buf:                          ; @spi_xfer_buf
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_2
; %bb.1:
	ldr	w0, [x19, #64]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	mov	x3, x21
	mov	x4, x20
	bl	_device_printf
LBB0_2:
	cbz	x20, LBB0_6
; %bb.3:
	stp	x20, xzr, [x19, #8]
	stp	x21, x22, [x19, #48]
	stp	x20, xzr, [x19, #24]
Lloh2:
	adrp	x8, _INTREG_RDREN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _INTREG_RDREN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _INTREG_TDREN@GOTPAGE
Lloh6:
	ldr	x9, [x9, _INTREG_TDREN@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19, #40]
	mov	x0, x19
	bl	_spi_fill_txfifo
Lloh8:
	adrp	x8, _ECSPI_INTREG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ECSPI_INTREG@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	ldr	w2, [x19, #40]
	mov	x0, x19
	bl	_WR4
	add	x20, x19, #44
Lloh11:
	adrp	x22, _hz@GOTPAGE
Lloh12:
	ldr	x22, [x22, _hz@GOTPAGEOFF]
Lloh13:
	adrp	x21, l_.str.1@PAGE
Lloh14:
	add	x21, x21, l_.str.1@PAGEOFF
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19, #40]
	cbz	w8, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x22]
	add	w8, w8, w8, lsl #2
	lsl	w4, w8, #1
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	mov	x3, x21
	bl	_msleep
	cbz	w0, LBB0_4
	b	LBB0_8
LBB0_6:
	mov	w0, #0
	b	LBB0_11
LBB0_7:
	mov	w0, #0
LBB0_8:
	ldp	x9, x8, [x19, #8]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.9:
	ldp	x9, x8, [x19, #24]
	cmp	x8, x9
	b.eq	LBB0_11
LBB0_10:
Lloh15:
	adrp	x8, _EIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"spi_xfer_buf, rxbuf %p txbuf %p len %u\n"

	.comm	_INTREG_RDREN,4,2               ; @INTREG_RDREN
	.comm	_INTREG_TDREN,4,2               ; @INTREG_TDREN
	.comm	_ECSPI_INTREG,4,2               ; @ECSPI_INTREG
l_.str.1:                               ; @.str.1
	.asciz	"imxspi"

	.comm	_hz,4,2                         ; @hz
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_spi_xfer_buf
.subsections_via_symbols
