	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function meson_nfc_write_buf
_meson_nfc_write_buf:                   ## @meson_nfc_write_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
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movq	%rdi, %r12
	callq	_nand_get_controller_data
	movq	%rax, %r15
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_meson_nfc_dma_buffer_setup
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	_NFC_CMD_M2N@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	$5, %edi
	xorl	%esi, %esi
	callq	_GENMASK
	andl	%r14d, %eax
	orl	%eax, %r13d
	movq	_NFC_REG_CMD@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	movl	%r13d, %edi
	callq	_writel
	movq	%r15, %rdi
	callq	_meson_nfc_drain_cmd
	movq	%r15, %rdi
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_meson_nfc_wait_cmd_finish
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	movl	%r14d, %esi
	xorl	%edx, %edx
	callq	_meson_nfc_dma_buffer_release
LBB0_2:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_NFC_CMD_M2N,4,2                ## @NFC_CMD_M2N
	.comm	_NFC_REG_CMD,8,3                ## @NFC_REG_CMD
	.no_dead_strip	_meson_nfc_write_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function meson_nfc_write_buf
_meson_nfc_write_buf:                   ; @meson_nfc_write_buf
	.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, x2
	mov	x22, x1
	mov	x20, x0
	bl	_nand_get_controller_data
	mov	x21, x0
Lloh0:
	adrp	x23, _DMA_TO_DEVICE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _DMA_TO_DEVICE@GOTPAGEOFF]
	ldr	w5, [x23]
	mov	x0, x20
	mov	x1, x22
	mov	x2, x19
	mov	x3, #0
	mov	w4, #0
	bl	_meson_nfc_dma_buffer_setup
	mov	x22, x0
	cbnz	w0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _NFC_CMD_M2N@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NFC_CMD_M2N@GOTPAGEOFF]
Lloh4:
	ldr	w24, [x8]
	mov	w0, #5
	mov	w1, #0
	bl	_GENMASK
	and	w8, w0, w19
	orr	w0, w8, w24
	ldr	x8, [x21]
Lloh5:
	adrp	x9, _NFC_REG_CMD@GOTPAGE
Lloh6:
	ldr	x9, [x9, _NFC_REG_CMD@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x21
	bl	_meson_nfc_drain_cmd
	mov	x0, x21
	mov	w1, #1000
	bl	_meson_nfc_wait_cmd_finish
	ldr	w3, [x23]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	bl	_meson_nfc_dma_buffer_release
LBB0_2:
	mov	x0, x22
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_NFC_CMD_M2N,4,2                ; @NFC_CMD_M2N
	.comm	_NFC_REG_CMD,8,3                ; @NFC_REG_CMD
	.no_dead_strip	_meson_nfc_write_buf
.subsections_via_symbols
