	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function p54spi_spi_write_dma
_p54spi_spi_write_dma:                  ## @p54spi_spi_write_dma
	.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, %r15
	movq	%rdx, %r14
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movq	_SPI_ADRS_DMA_WRITE_CTRL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_HOST_ALLOWED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_p54spi_wait_bit
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	(%r13), %r13d
	movq	_SPI_DMA_WRITE_CTRL_ENABLE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_cpu_to_le16
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_p54spi_write16
	movq	_SPI_ADRS_DMA_WRITE_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%r15, %rdi
	callq	_cpu_to_le16
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_p54spi_write16
	movq	_SPI_ADRS_DMA_WRITE_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	callq	_p54spi_write32
	movq	_SPI_ADRS_DMA_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movq	%r14, %rdx
	movq	%r15, %rcx
	callq	_p54spi_spi_write
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_1:
	movq	(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SPI_ADRS_DMA_WRITE_CTRL,4,2    ## @SPI_ADRS_DMA_WRITE_CTRL
	.comm	_HOST_ALLOWED,4,2               ## @HOST_ALLOWED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"spi_write_dma not allowed to DMA write.\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_SPI_DMA_WRITE_CTRL_ENABLE,8,3  ## @SPI_DMA_WRITE_CTRL_ENABLE
	.comm	_SPI_ADRS_DMA_WRITE_LEN,4,2     ## @SPI_ADRS_DMA_WRITE_LEN
	.comm	_SPI_ADRS_DMA_WRITE_BASE,4,2    ## @SPI_ADRS_DMA_WRITE_BASE
	.comm	_SPI_ADRS_DMA_DATA,4,2          ## @SPI_ADRS_DMA_DATA
	.no_dead_strip	_p54spi_spi_write_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function p54spi_spi_write_dma
_p54spi_spi_write_dma:                  ; @p54spi_spi_write_dma
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x3
	mov	x20, x2
	mov	x22, x1
	mov	x21, x0
Lloh0:
	adrp	x23, _SPI_ADRS_DMA_WRITE_CTRL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SPI_ADRS_DMA_WRITE_CTRL@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh2:
	adrp	x8, _HOST_ALLOWED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HOST_ALLOWED@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	bl	_p54spi_wait_bit
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w23, [x23]
Lloh5:
	adrp	x8, _SPI_DMA_WRITE_CTRL_ENABLE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SPI_DMA_WRITE_CTRL_ENABLE@GOTPAGEOFF]
Lloh7:
	ldr	x0, [x8]
	bl	_cpu_to_le16
	mov	x2, x0
	mov	x0, x21
	mov	x1, x23
	bl	_p54spi_write16
Lloh8:
	adrp	x8, _SPI_ADRS_DMA_WRITE_LEN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SPI_ADRS_DMA_WRITE_LEN@GOTPAGEOFF]
Lloh10:
	ldr	w23, [x8]
	mov	x0, x19
	bl	_cpu_to_le16
	mov	x2, x0
	mov	x0, x21
	mov	x1, x23
	bl	_p54spi_write16
Lloh11:
	adrp	x8, _SPI_ADRS_DMA_WRITE_BASE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SPI_ADRS_DMA_WRITE_BASE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x22
	bl	_p54spi_write32
Lloh14:
	adrp	x8, _SPI_ADRS_DMA_DATA@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SPI_ADRS_DMA_DATA@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x20
	mov	x3, x19
	bl	_p54spi_spi_write
	mov	w0, #0
	b	LBB0_3
LBB0_2:
	ldr	x0, [x21]
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh19:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_SPI_ADRS_DMA_WRITE_CTRL,4,2    ; @SPI_ADRS_DMA_WRITE_CTRL
	.comm	_HOST_ALLOWED,4,2               ; @HOST_ALLOWED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"spi_write_dma not allowed to DMA write.\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_SPI_DMA_WRITE_CTRL_ENABLE,8,3  ; @SPI_DMA_WRITE_CTRL_ENABLE
	.comm	_SPI_ADRS_DMA_WRITE_LEN,4,2     ; @SPI_ADRS_DMA_WRITE_LEN
	.comm	_SPI_ADRS_DMA_WRITE_BASE,4,2    ; @SPI_ADRS_DMA_WRITE_BASE
	.comm	_SPI_ADRS_DMA_DATA,4,2          ; @SPI_ADRS_DMA_DATA
	.no_dead_strip	_p54spi_spi_write_dma
.subsections_via_symbols
