	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function meson_nfc_read_buf
_meson_nfc_read_buf:                    ## @meson_nfc_read_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
	subq	$24, %rsp
	.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, %r15
	callq	_nand_get_controller_data
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_PER_INFO_BYTE@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	movl	(%r12), %r8d
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%r14d, %edx
	movq	%r13, %rcx
	callq	_meson_nfc_dma_buffer_setup
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	_NFC_CMD_N2M@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	$5, %edi
	xorl	%esi, %esi
	callq	_GENMASK
	andl	%r14d, %eax
	orl	%eax, %r12d
	movq	_NFC_REG_CMD@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	addq	(%r14), %rsi
	movl	%r12d, %edi
	callq	_writel
	movq	%r14, %rdi
	callq	_meson_nfc_drain_cmd
	movq	%r14, %rdi
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_meson_nfc_wait_cmd_finish
	movq	_PER_INFO_BYTE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_meson_nfc_dma_buffer_release
LBB0_4:
	movq	%r13, %rdi
	callq	_kfree
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PER_INFO_BYTE,4,2              ## @PER_INFO_BYTE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_NFC_CMD_N2M,4,2                ## @NFC_CMD_N2M
	.comm	_NFC_REG_CMD,8,3                ## @NFC_REG_CMD
	.no_dead_strip	_meson_nfc_read_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_read_buf
_meson_nfc_read_buf:                    ; @meson_nfc_read_buf
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x23, x1
	mov	x20, x0
	bl	_nand_get_controller_data
	mov	x22, x0
Lloh0:
	adrp	x24, _PER_INFO_BYTE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _PER_INFO_BYTE@GOTPAGEOFF]
	ldr	w0, [x24]
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_kzalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x0
	ldr	w4, [x24]
Lloh5:
	adrp	x25, _DMA_FROM_DEVICE@GOTPAGE
Lloh6:
	ldr	x25, [x25, _DMA_FROM_DEVICE@GOTPAGEOFF]
	ldr	w5, [x25]
	mov	x0, x20
	mov	x1, x23
	mov	x2, x19
	mov	x3, x21
	bl	_meson_nfc_dma_buffer_setup
	mov	x23, x0
	cbnz	w0, LBB0_3
; %bb.2:
Lloh7:
	adrp	x8, _NFC_CMD_N2M@GOTPAGE
Lloh8:
	ldr	x8, [x8, _NFC_CMD_N2M@GOTPAGEOFF]
Lloh9:
	ldr	w26, [x8]
	mov	w0, #5
	mov	w1, #0
	bl	_GENMASK
	and	w8, w0, w19
	orr	w0, w8, w26
	ldr	x8, [x22]
Lloh10:
	adrp	x9, _NFC_REG_CMD@GOTPAGE
Lloh11:
	ldr	x9, [x9, _NFC_REG_CMD@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x22
	bl	_meson_nfc_drain_cmd
	mov	x0, x22
	mov	w1, #1000
	bl	_meson_nfc_wait_cmd_finish
	ldr	w2, [x24]
	ldr	w3, [x25]
	mov	x0, x20
	mov	x1, x19
	bl	_meson_nfc_dma_buffer_release
LBB0_3:
	mov	x0, x21
	bl	_kfree
	b	LBB0_5
LBB0_4:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_5:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_PER_INFO_BYTE,4,2              ; @PER_INFO_BYTE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_NFC_CMD_N2M,4,2                ; @NFC_CMD_N2M
	.comm	_NFC_REG_CMD,8,3                ; @NFC_REG_CMD
	.no_dead_strip	_meson_nfc_read_buf
.subsections_via_symbols
