	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nand_prog_page_op              ## -- Begin function nand_prog_page_op
	.p2align	4, 0x90
_nand_prog_page_op:                     ## @nand_prog_page_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r14d
	movq	%rcx, %r15
	movl	%edx, %r12d
	movl	%esi, %r13d
	movq	%rdi, %rbx
	callq	_nand_to_mtd
	testq	%r15, %r15
	je	LBB0_2
## %bb.1:
	testl	%r14d, %r14d
	je	LBB0_2
## %bb.3:
	leal	(%r14,%r12), %ecx
	movl	4(%rax), %edx
	addl	(%rax), %edx
	cmpl	%edx, %ecx
	jbe	LBB0_4
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_10:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%rbx, %rdi
	callq	_nand_has_exec_op
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%r12d, %edx
	movq	%r15, %rcx
	movl	%r14d, %r8d
	movl	$1, %r9d
	callq	_nand_exec_prog_page_op
	jmp	LBB0_7
LBB0_6:
	movq	_NAND_CMD_SEQIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	movl	%r13d, %ecx
	callq	*8(%rbx)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	*16(%rbx)
	movq	_NAND_CMD_PAGEPROG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$-1, %edx
	movl	$-1, %ecx
	callq	*8(%rbx)
	movq	%rbx, %rdi
	callq	*(%rbx)
LBB0_7:
	movq	_NAND_STATUS_FAIL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.9:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NAND_CMD_SEQIN,4,2             ## @NAND_CMD_SEQIN
	.comm	_NAND_CMD_PAGEPROG,4,2          ## @NAND_CMD_PAGEPROG
	.comm	_NAND_STATUS_FAIL,4,2           ## @NAND_STATUS_FAIL
	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nand_prog_page_op              ; -- Begin function nand_prog_page_op
	.p2align	2
_nand_prog_page_op:                     ; @nand_prog_page_op
	.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	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
	bl	_nand_to_mtd
	cbz	x21, LBB0_3
; %bb.1:
	cbz	w20, LBB0_3
; %bb.2:
	add	w8, w20, w22
	ldp	w9, w10, [x0]
	add	w9, w10, w9
	cmp	w8, w9
	b.ls	LBB0_6
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
LBB0_6:
	mov	x0, x19
	bl	_nand_has_exec_op
	cbz	x0, LBB0_8
; %bb.7:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x22
	mov	x3, x21
	mov	x4, x20
	mov	w5, #1
	bl	_nand_exec_prog_page_op
	b	LBB0_9
LBB0_8:
	ldr	x8, [x19, #8]
Lloh2:
	adrp	x9, _NAND_CMD_SEQIN@GOTPAGE
Lloh3:
	ldr	x9, [x9, _NAND_CMD_SEQIN@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x9]
	mov	x0, x19
	mov	x2, x22
	mov	x3, x23
	blr	x8
	ldr	x8, [x19, #16]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	blr	x8
	ldr	x8, [x19, #8]
Lloh5:
	adrp	x9, _NAND_CMD_PAGEPROG@GOTPAGE
Lloh6:
	ldr	x9, [x9, _NAND_CMD_PAGEPROG@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x9]
	mov	x0, x19
	mov	w2, #-1
	mov	w3, #-1
	blr	x8
	ldr	x8, [x19]
	mov	x0, x19
	blr	x8
LBB0_9:
Lloh8:
	adrp	x8, _NAND_STATUS_FAIL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NAND_STATUS_FAIL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_11
; %bb.10:
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_4
LBB0_11:
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NAND_CMD_SEQIN,4,2             ; @NAND_CMD_SEQIN
	.comm	_NAND_CMD_PAGEPROG,4,2          ; @NAND_CMD_PAGEPROG
	.comm	_NAND_STATUS_FAIL,4,2           ; @NAND_STATUS_FAIL
	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
