	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function meson_nfc_exec_op
_meson_nfc_exec_op:                     ## @meson_nfc_exec_op
	.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
	movq	%rsi, %r13
	movq	%rdi, %r14
	callq	_to_meson_nand
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_nand_get_controller_data
	movq	%rax, %r15
	movl	16(%r13), %esi
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_meson_nfc_select_chip
	cmpq	$0, (%r13)
	je	LBB0_17
## %bb.1:
	xorl	%ebx, %ebx
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
LBB0_19:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_NFC_CMD_CLE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	orq	8(%r15), %rax
	movzbl	32(%r12,%r14,8), %edi
	orq	%rax, %rdi
	movq	_NFC_REG_CMD@GOTPCREL(%rip), %rax
	movq	%rdx, %r14
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	callq	_writel
	movq	%r15, %rdi
	movq	%r14, %rsi
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	callq	_meson_nfc_cmd_idle
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	cmpq	(%r13), %rbx
	jae	LBB0_17
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	8(%r13), %r12
	leaq	(%rbx,%rbx,4), %r14
	movl	4(%r12,%r14,8), %edi
	callq	_PSEC_TO_NSEC
	movq	_NFC_CLK_CYCLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	imull	(%rcx), %esi
	movl	%eax, %edi
	callq	_DIV_ROUND_UP
	movq	%rax, %rdx
	movl	(%r12,%r14,8), %eax
	addl	$-128, %eax
	cmpl	$4, %eax
	ja	LBB0_16
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%r12,%r14,8), %rdi
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%r12,%r14,8), %rax
	addq	$4, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r13
	movl	8(%r12,%r14,8), %esi
	movq	%r15, %rdi
	callq	_meson_nfc_queue_rb
	movq	%r13, %rsi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpl	$0, (%rax)
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	jmp	LBB0_15
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_meson_nand_op_get_dma_safe_input_buf
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r13
	movl	12(%r12,%r14,8), %edx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	callq	_meson_nfc_read_buf
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_meson_nand_op_put_dma_safe_input_buf
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	cmpl	$0, 16(%r12,%r14,8)
	movq	_NFC_REG_CMD@GOTPCREL(%rip), %rdx
	movq	_NFC_CMD_ALE@GOTPCREL(%rip), %r13
	jle	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%r12,%r14,8), %r14
	addq	$16, %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r13), %rax
	orq	8(%r15), %rax
	movq	8(%r14), %rcx
	movzbl	(%rcx,%rbx,4), %edi
	orq	%rax, %rdi
	movq	(%rdx), %rsi
	addq	(%r15), %rsi
	movq	%rdx, %r12
	callq	_writel
	movq	%r12, %rdx
	incq	%rbx
	movslq	(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_6
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_meson_nfc_cmd_idle
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_meson_nand_op_get_dma_safe_output_buf
	testq	%rax, %rax
	je	LBB0_9
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r13
	movl	12(%r12,%r14,8), %edx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	callq	_meson_nfc_write_buf
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_meson_nand_op_put_dma_safe_output_buf
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_17:
	movq	%r15, %rdi
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_meson_nfc_wait_cmd_finish
	xorl	%eax, %eax
LBB0_18:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_18
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_13, LBB0_13-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_19, LBB0_19-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
LJTI0_0:
	.long	L0_0_set_13
	.long	L0_0_set_11
	.long	L0_0_set_8
	.long	L0_0_set_19
	.long	L0_0_set_4
	.end_data_region
                                        ## -- End function
	.comm	_NFC_CLK_CYCLE,4,2              ## @NFC_CLK_CYCLE
	.comm	_NFC_CMD_CLE,8,3                ## @NFC_CMD_CLE
	.comm	_NFC_REG_CMD,8,3                ## @NFC_REG_CMD
	.comm	_NFC_CMD_ALE,8,3                ## @NFC_CMD_ALE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_meson_nfc_exec_op
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function meson_nfc_exec_op
_meson_nfc_exec_op:                     ; @meson_nfc_exec_op
	.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	x19, x1
	mov	x20, x0
	bl	_to_meson_nand
	mov	x21, x0
	mov	x0, x20
	bl	_nand_get_controller_data
	mov	x22, x0
	ldr	w1, [x19, #16]
	str	x20, [sp, #8]                   ; 8-byte Folded Spill
	mov	x0, x20
	bl	_meson_nfc_select_chip
	ldr	x8, [x19]
	cbz	x8, LBB0_15
; %bb.1:
	mov	x25, #0
Lloh0:
	adrp	x28, _NFC_REG_CMD@GOTPAGE
Lloh1:
	ldr	x28, [x28, _NFC_REG_CMD@GOTPAGEOFF]
Lloh2:
	adrp	x27, _NFC_CMD_ALE@GOTPAGE
Lloh3:
	ldr	x27, [x27, _NFC_CMD_ALE@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
Lloh4:
	adrp	x8, _NFC_CMD_CLE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _NFC_CMD_CLE@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	ldp	x10, x9, [x22]
	orr	x8, x8, x9
	mov	w9, #40
	madd	x9, x25, x9, x20
	ldrb	w9, [x9, #32]
	orr	x0, x8, x9
	ldr	x8, [x28]
	add	x1, x8, x10
	bl	_writel
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	mov	x1, x23
	bl	_meson_nfc_cmd_idle
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x25, x25, #1
	ldr	x8, [x19]
	cmp	x25, x8
	b.hs	LBB0_15
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_12 Depth 2
	ldr	x20, [x19, #8]
	mov	w8, #40
	madd	x26, x25, x8, x20
	mov	x24, x26
	ldr	w0, [x24, #4]!
	bl	_PSEC_TO_NSEC
	ldr	w8, [x21]
Lloh7:
	adrp	x9, _NFC_CLK_CYCLE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _NFC_CLK_CYCLE@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	mul	w1, w9, w8
	bl	_DIV_ROUND_UP
	ldr	w8, [x26]
	sub	w8, w8, #128
	cmp	w8, #4
	b.hi	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x23, x0
Lloh10:
	adrp	x11, lJTI0_0@PAGE
Lloh11:
	add	x11, x11, lJTI0_0@PAGEOFF
	adr	x9, LBB0_2
	ldrb	w10, [x11, x8]
	add	x9, x9, x10, lsl #2
	br	x9
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w8, #40
	madd	x8, x25, x8, x20
	ldr	w1, [x8, #8]
	mov	x0, x22
	bl	_meson_nfc_queue_rb
	ldr	w8, [x24]
	cbnz	w8, LBB0_3
	b	LBB0_4
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x26
	bl	_meson_nand_op_get_dma_safe_input_buf
	cbz	x0, LBB0_17
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x23, x0
	mov	w8, #40
	madd	x8, x25, x8, x20
	ldr	w2, [x8, #12]
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	x1, x23
	bl	_meson_nfc_read_buf
	mov	x0, x26
	mov	x1, x23
	bl	_meson_nand_op_put_dma_safe_input_buf
	b	LBB0_4
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w8, #40
	madd	x24, x25, x8, x20
	ldr	w8, [x24, #16]!
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x26, #0
	mov	w8, #40
	madd	x8, x25, x8, x20
	add	x20, x8, #24
LBB0_12:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x27]
	ldp	x10, x9, [x22]
	orr	x8, x8, x9
	ldr	x9, [x20]
	lsl	x11, x26, #2
	ldrb	w9, [x9, x11]
	orr	x0, x8, x9
	ldr	x8, [x28]
	add	x1, x8, x10
	bl	_writel
	add	x26, x26, #1
	ldrsw	x8, [x24]
	cmp	x26, x8
	b.lt	LBB0_12
	b	LBB0_3
LBB0_13:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x26
	bl	_meson_nand_op_get_dma_safe_output_buf
	cbz	x0, LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x23, x0
	mov	w8, #40
	madd	x8, x25, x8, x20
	ldr	w2, [x8, #12]
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	x1, x23
	bl	_meson_nfc_write_buf
	mov	x0, x26
	mov	x1, x23
	bl	_meson_nand_op_put_dma_safe_output_buf
	b	LBB0_4
LBB0_15:
	mov	x0, x22
	mov	w1, #1000
	bl	_meson_nfc_wait_cmd_finish
	mov	w0, #0
LBB0_16:
	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
LBB0_17:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_16
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_7-LBB0_2)>>2
	.byte	(LBB0_13-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
                                        ; -- End function
	.comm	_NFC_CLK_CYCLE,4,2              ; @NFC_CLK_CYCLE
	.comm	_NFC_CMD_CLE,8,3                ; @NFC_CMD_CLE
	.comm	_NFC_REG_CMD,8,3                ; @NFC_REG_CMD
	.comm	_NFC_CMD_ALE,8,3                ; @NFC_CMD_ALE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_meson_nfc_exec_op
.subsections_via_symbols
