	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function meson_nfc_rw_cmd_prepare_and_execute
_meson_nfc_rw_cmd_prepare_and_execute:  ## @meson_nfc_rw_cmd_prepare_and_execute
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %r13d
	movq	%rdi, %rbx
	callq	_nand_to_mtd
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_nand_get_controller_data
	movq	%rax, %r14
	leaq	4(%rbx), %rdi
	callq	_nand_get_sdr_timings
	movq	16(%r14), %rdx
	movq	48(%r14), %rsi
	testl	%r15d, %r15d
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movl	%r13d, %ebx
	jne	LBB0_1
## %bb.2:
	movq	_NAND_CMD_SEQIN@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_NAND_CMD_READ0@GOTPCREL(%rip), %rax
LBB0_3:
	movq	_NFC_CMD_CLE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	orq	%rsi, %rcx
	orq	(%rax), %rcx
	movq	%rcx, 24(%r14)
	movq	_NFC_CMD_ALE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rax
	orq	%rsi, %rax
	movq	%rax, (%rdx)
	movq	(%rcx), %r13
	orq	%rsi, %r13
	cmpl	$513, (%r12)                    ## imm = 0x201
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	%r15d, -64(%rbp)                ## 4-byte Spill
	jge	LBB0_5
## %bb.4:
	xorl	%r15d, %r15d
	movl	$1, %eax
	jmp	LBB0_6
LBB0_5:
	movq	%r13, 8(%rdx)
	movl	$1, %r15d
	movl	$2, %eax
LBB0_6:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r12
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_ROW_ADDER
	orq	%rax, %r13
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%r13, (%r12,%rax,8)
	movl	%ebx, %edi
	movq	_NFC_CMD_ALE@GOTPCREL(%rip), %r13
	movq	(%r13), %rbx
	orq	-56(%rbp), %rbx                 ## 8-byte Folded Reload
	movl	%edi, -60(%rbp)                 ## 4-byte Spill
	movl	$1, %esi
	callq	_ROW_ADDER
	orq	%rbx, %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 8(%r12,%rcx,8)
	movq	_NAND_ROW_ADDR_3@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.7:
	movq	(%r13), %rbx
	orq	-56(%rbp), %rbx                 ## 8-byte Folded Reload
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	movl	$2, %esi
	callq	_ROW_ADDER
	orq	%rbx, %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 16(%r12,%rcx,8)
	decq	%r15
	jne	LBB0_10
	jmp	LBB0_12
LBB0_8:
	decq	%r15
	decq	%r15
	je	LBB0_12
LBB0_10:
	xorl	%ebx, %ebx
	movq	_NFC_REG_CMD@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	40(%r14), %rax
	movl	(%rax,%rbx,4), %edi
	movq	(%r13), %rsi
	addq	8(%r14), %rsi
	callq	_writel_relaxed
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_11
LBB0_12:
	cmpl	$0, -64(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_14
## %bb.13:
	movq	_NFC_CMD_CLE@GOTPCREL(%rip), %rax
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	orq	(%rax), %rdi
	movq	_NAND_CMD_READSTART@GOTPCREL(%rip), %rax
	orq	(%rax), %rdi
	movq	%rdi, 32(%r14)
	movq	_NFC_REG_CMD@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	callq	_writel
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_PSEC_TO_MSEC
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_meson_nfc_queue_rb
	jmp	LBB0_15
LBB0_14:
	movl	(%r14), %esi
	movq	%r14, %rdi
	callq	_meson_nfc_cmd_idle
LBB0_15:
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_CMD_READ0,8,3             ## @NAND_CMD_READ0
	.comm	_NAND_CMD_SEQIN,8,3             ## @NAND_CMD_SEQIN
	.comm	_NFC_CMD_CLE,8,3                ## @NFC_CMD_CLE
	.comm	_NFC_CMD_ALE,8,3                ## @NFC_CMD_ALE
	.comm	_NAND_ROW_ADDR_3,4,2            ## @NAND_ROW_ADDR_3
	.comm	_NFC_REG_CMD,8,3                ## @NFC_REG_CMD
	.comm	_NAND_CMD_READSTART,8,3         ## @NAND_CMD_READSTART
	.no_dead_strip	_meson_nfc_rw_cmd_prepare_and_execute
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function meson_nfc_rw_cmd_prepare_and_execute
_meson_nfc_rw_cmd_prepare_and_execute:  ; @meson_nfc_rw_cmd_prepare_and_execute
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x2
	mov	x22, x1
	mov	x23, x0
	bl	_nand_to_mtd
	mov	x24, x0
	mov	x0, x23
	bl	_nand_get_controller_data
	mov	x19, x0
	add	x0, x23, #4
	bl	_nand_get_sdr_timings
	ldr	x28, [x19, #16]
	ldr	x25, [x19, #48]
Lloh0:
	adrp	x8, _NAND_CMD_READ0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_CMD_READ0@GOTPAGEOFF]
Lloh2:
	adrp	x9, _NAND_CMD_SEQIN@GOTPAGE
Lloh3:
	ldr	x9, [x9, _NAND_CMD_SEQIN@GOTPAGEOFF]
	cmp	w21, #0
	csel	x8, x9, x8, eq
	ldr	x8, [x8]
Lloh4:
	adrp	x9, _NFC_CMD_CLE@GOTPAGE
Lloh5:
	ldr	x9, [x9, _NFC_CMD_CLE@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	orr	x9, x9, x25
	orr	x8, x9, x8
	str	x8, [x19, #24]
Lloh7:
	adrp	x27, _NFC_CMD_ALE@GOTPAGE
Lloh8:
	ldr	x27, [x27, _NFC_CMD_ALE@GOTPAGEOFF]
	ldr	x8, [x27]
	orr	x8, x8, x25
	str	x8, [x28]
	ldr	w8, [x24]
	ldr	x9, [x27]
	orr	x26, x9, x25
	cmp	w8, #513
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	b.ge	LBB0_2
; %bb.1:
	mov	x24, #0
	mov	w20, #1
	b	LBB0_3
LBB0_2:
	str	x26, [x28, #8]
	mov	w24, #1
	mov	w20, #2
LBB0_3:
	mov	x0, x22
	mov	w1, #0
	bl	_ROW_ADDER
	orr	x8, x26, x0
	add	x26, x28, x20, lsl #3
	str	x8, [x26]
	ldr	x8, [x27]
	orr	x20, x8, x25
	mov	x0, x22
	mov	w1, #1
	bl	_ROW_ADDER
	orr	x8, x20, x0
	str	x8, [x26, #8]
	ldr	w8, [x23]
Lloh9:
	adrp	x9, _NAND_ROW_ADDR_3@GOTPAGE
Lloh10:
	ldr	x9, [x9, _NAND_ROW_ADDR_3@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	ldr	x8, [x27]
	orr	x20, x8, x25
	mov	x0, x22
	mov	w1, #2
	bl	_ROW_ADDER
	orr	x8, x20, x0
	str	x8, [x26, #16]
	b	LBB0_6
LBB0_5:
	sub	x24, x24, #1
LBB0_6:
Lloh12:
	adrp	x22, _NFC_REG_CMD@GOTPAGE
Lloh13:
	ldr	x22, [x22, _NFC_REG_CMD@GOTPAGEOFF]
	subs	x23, x24, #1
	b.eq	LBB0_9
; %bb.7:
	mov	x20, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #40]
	ldr	w0, [x8, x20, lsl #2]
	ldr	x8, [x19, #8]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel_relaxed
	add	x20, x20, #1
	cmp	x23, x20
	b.ne	LBB0_8
LBB0_9:
	cbz	w21, LBB0_11
; %bb.10:
Lloh14:
	adrp	x8, _NFC_CMD_CLE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NFC_CMD_CLE@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	orr	x8, x8, x25
Lloh17:
	adrp	x9, _NAND_CMD_READSTART@GOTPAGE
Lloh18:
	ldr	x9, [x9, _NAND_CMD_READSTART@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	orr	x0, x8, x9
	str	x0, [x19, #32]
	ldr	x8, [x19, #8]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	ldr	w0, [x8]
	bl	_PSEC_TO_MSEC
	mov	x1, x0
	mov	x0, x19
	bl	_meson_nfc_queue_rb
	b	LBB0_12
LBB0_11:
	ldr	w1, [x19]
	mov	x0, x19
	bl	_meson_nfc_cmd_idle
LBB0_12:
	mov	w0, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_CMD_READ0,8,3             ; @NAND_CMD_READ0
	.comm	_NAND_CMD_SEQIN,8,3             ; @NAND_CMD_SEQIN
	.comm	_NFC_CMD_CLE,8,3                ; @NFC_CMD_CLE
	.comm	_NFC_CMD_ALE,8,3                ; @NFC_CMD_ALE
	.comm	_NAND_ROW_ADDR_3,4,2            ; @NAND_ROW_ADDR_3
	.comm	_NFC_REG_CMD,8,3                ; @NFC_REG_CMD
	.comm	_NAND_CMD_READSTART,8,3         ; @NAND_CMD_READSTART
	.no_dead_strip	_meson_nfc_rw_cmd_prepare_and_execute
.subsections_via_symbols
