	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nand_reset_op                  ## -- Begin function nand_reset_op
	.p2align	4, 0x90
_nand_reset_op:                         ## @nand_reset_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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	callq	_nand_has_exec_op
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	12(%rbx), %rdi
	callq	_nand_get_sdr_timings
	movq	%rax, %r14
	movq	_NAND_CMD_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	4(%r14), %edi
	callq	_PSEC_TO_NSEC
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_NAND_OP_CMD
	movl	%eax, -40(%rbp)
	movl	(%r14), %edi
	callq	_PSEC_TO_MSEC
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_NAND_OP_WAIT_RDY
	movl	%eax, -36(%rbp)
	movl	8(%rbx), %edi
	leaq	-40(%rbp), %rsi
	callq	_NAND_OPERATION
	movl	%eax, -48(%rbp)
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_nand_exec_op
	jmp	LBB0_3
LBB0_2:
	movq	_NAND_CMD_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$-1, %edx
	movl	$-1, %ecx
	callq	*(%rbx)
	xorl	%eax, %eax
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-32(%rbp), %rcx
	jne	LBB0_5
## %bb.4:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_CMD_RESET,4,2             ## @NAND_CMD_RESET
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nand_reset_op                  ; -- Begin function nand_reset_op
	.p2align	2
_nand_reset_op:                         ; @nand_reset_op
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	bl	_nand_has_exec_op
	cbz	x0, LBB0_2
; %bb.1:
	add	x0, x19, #12
	bl	_nand_get_sdr_timings
	mov	x20, x0
Lloh3:
	adrp	x8, _NAND_CMD_RESET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NAND_CMD_RESET@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	ldr	w0, [x0, #4]
	bl	_PSEC_TO_NSEC
	mov	x1, x0
	mov	x0, x21
	bl	_NAND_OP_CMD
	str	w0, [sp, #16]
	ldr	w0, [x20]
	bl	_PSEC_TO_MSEC
	mov	w1, #0
	bl	_NAND_OP_WAIT_RDY
	str	w0, [sp, #20]
	ldr	w0, [x19, #8]
	add	x1, sp, #16
	bl	_NAND_OPERATION
	str	w0, [sp, #8]
	add	x1, sp, #8
	mov	x0, x19
	bl	_nand_exec_op
	b	LBB0_3
LBB0_2:
	ldr	x8, [x19]
Lloh6:
	adrp	x9, _NAND_CMD_RESET@GOTPAGE
Lloh7:
	ldr	x9, [x9, _NAND_CMD_RESET@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x9]
	mov	x0, x19
	mov	w2, #-1
	mov	w3, #-1
	blr	x8
	mov	w0, #0
LBB0_3:
	ldr	x8, [sp, #24]
Lloh9:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	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
	add	sp, sp, #80
	ret
LBB0_5:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_CMD_RESET,4,2             ; @NAND_CMD_RESET
.subsections_via_symbols
