	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function onenand_unlock_all
_onenand_unlock_all:                    ## @onenand_unlock_all
	.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
	movq	%rdi, %r15
	movq	8(%rdi), %rbx
	movl	(%rdi), %r14d
	movq	_ONENAND_HAS_UNLOCK_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_1
## %bb.2:
	movq	_ONENAND_REG_START_BLOCK_ADDRESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	24(%rbx), %rsi
	xorl	%edi, %edi
	callq	*48(%rbx)
	movq	_ONENAND_CMD_UNLOCK_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	*40(%rbx)
	movq	_FL_LOCKING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	*32(%rbx)
	movq	_ONENAND_REG_CTRL_STATUS@GOTPCREL(%rip), %r12
	movq	_ONENAND_CTRL_ONGO@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdi
	addq	24(%rbx), %rdi
	callq	*8(%rbx)
	testl	%eax, (%r13)
	jne	LBB0_3
## %bb.4:
	movq	_ONENAND_SKIP_UNLOCK_CHECK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	jne	LBB0_10
## %bb.5:
	movq	%rbx, %rdi
	callq	_onenand_check_lock_status
	testq	%rax, %rax
	je	LBB0_6
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	xorl	%r12d, %r12d
LBB0_9:
	movq	_ONENAND_CMD_UNLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%r14d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_onenand_do_lock_cmd            ## TAILCALL
LBB0_6:
	movq	%rbx, %rdi
	callq	_ONENAND_IS_DDP
	xorl	%r12d, %r12d
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movq	%rbx, %rdi
	callq	_FLEXONENAND
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	movl	16(%rbx), %r12d
	sarl	%r12d
	movl	%r12d, %r14d
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_ONENAND_HAS_UNLOCK_ALL,4,2     ## @ONENAND_HAS_UNLOCK_ALL
	.comm	_ONENAND_REG_START_BLOCK_ADDRESS,8,3 ## @ONENAND_REG_START_BLOCK_ADDRESS
	.comm	_ONENAND_CMD_UNLOCK_ALL,4,2     ## @ONENAND_CMD_UNLOCK_ALL
	.comm	_FL_LOCKING,4,2                 ## @FL_LOCKING
	.comm	_ONENAND_REG_CTRL_STATUS,8,3    ## @ONENAND_REG_CTRL_STATUS
	.comm	_ONENAND_CTRL_ONGO,4,2          ## @ONENAND_CTRL_ONGO
	.comm	_ONENAND_SKIP_UNLOCK_CHECK,4,2  ## @ONENAND_SKIP_UNLOCK_CHECK
	.comm	_ONENAND_CMD_UNLOCK,4,2         ## @ONENAND_CMD_UNLOCK
	.no_dead_strip	_onenand_unlock_all
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function onenand_unlock_all
_onenand_unlock_all:                    ; @onenand_unlock_all
	.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	x19, x0
	ldr	x21, [x0, #8]
	ldr	w20, [x0]
	ldr	w8, [x21]
Lloh0:
	adrp	x9, _ONENAND_HAS_UNLOCK_ALL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ONENAND_HAS_UNLOCK_ALL@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.1:
	ldr	x8, [x21, #48]
	ldr	x9, [x21, #24]
Lloh3:
	adrp	x10, _ONENAND_REG_START_BLOCK_ADDRESS@GOTPAGE
Lloh4:
	ldr	x10, [x10, _ONENAND_REG_START_BLOCK_ADDRESS@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	add	x1, x10, x9
	mov	w0, #0
	blr	x8
	ldr	x8, [x21, #40]
Lloh6:
	adrp	x9, _ONENAND_CMD_UNLOCK_ALL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ONENAND_CMD_UNLOCK_ALL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x9]
	mov	x0, x19
	mov	w2, #0
	mov	w3, #0
	blr	x8
	ldr	x8, [x21, #32]
Lloh9:
	adrp	x9, _FL_LOCKING@GOTPAGE
Lloh10:
	ldr	x9, [x9, _FL_LOCKING@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x9]
	mov	x0, x19
	blr	x8
Lloh12:
	adrp	x22, _ONENAND_REG_CTRL_STATUS@GOTPAGE
Lloh13:
	ldr	x22, [x22, _ONENAND_REG_CTRL_STATUS@GOTPAGEOFF]
Lloh14:
	adrp	x23, _ONENAND_CTRL_ONGO@GOTPAGE
Lloh15:
	ldr	x23, [x23, _ONENAND_CTRL_ONGO@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #8]
	ldr	x9, [x21, #24]
	ldr	x10, [x22]
	add	x0, x10, x9
	blr	x8
	ldr	w8, [x23]
	tst	w8, w0
	b.ne	LBB0_2
; %bb.3:
	ldr	w8, [x21]
Lloh16:
	adrp	x9, _ONENAND_SKIP_UNLOCK_CHECK@GOTPAGE
Lloh17:
	ldr	x9, [x9, _ONENAND_SKIP_UNLOCK_CHECK@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x21
	bl	_onenand_check_lock_status
	cbz	x0, LBB0_6
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, x21
	bl	_ONENAND_IS_DDP
	cbz	x0, LBB0_8
; %bb.7:
	mov	x0, x21
	bl	_FLEXONENAND
	cbz	w0, LBB0_10
LBB0_8:
	mov	w1, #0
LBB0_9:
Lloh19:
	adrp	x8, _ONENAND_CMD_UNLOCK@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ONENAND_CMD_UNLOCK@GOTPAGEOFF]
Lloh21:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x2, x20
	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
	b	_onenand_do_lock_cmd
LBB0_10:
	ldr	w8, [x21, #16]
	asr	w1, w8, #1
	mov	x20, x1
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_ONENAND_HAS_UNLOCK_ALL,4,2     ; @ONENAND_HAS_UNLOCK_ALL
	.comm	_ONENAND_REG_START_BLOCK_ADDRESS,8,3 ; @ONENAND_REG_START_BLOCK_ADDRESS
	.comm	_ONENAND_CMD_UNLOCK_ALL,4,2     ; @ONENAND_CMD_UNLOCK_ALL
	.comm	_FL_LOCKING,4,2                 ; @FL_LOCKING
	.comm	_ONENAND_REG_CTRL_STATUS,8,3    ; @ONENAND_REG_CTRL_STATUS
	.comm	_ONENAND_CTRL_ONGO,4,2          ; @ONENAND_CTRL_ONGO
	.comm	_ONENAND_SKIP_UNLOCK_CHECK,4,2  ; @ONENAND_SKIP_UNLOCK_CHECK
	.comm	_ONENAND_CMD_UNLOCK,4,2         ; @ONENAND_CMD_UNLOCK
	.no_dead_strip	_onenand_unlock_all
.subsections_via_symbols
