	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function onenand_command_handle
_onenand_command_handle:                ## @onenand_command_handle
	.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	%esi, %ebx
	movq	%rdi, %r14
	leal	-128(%rbx), %eax
	cmpl	$4, %eax
	jae	LBB0_1
## %bb.14:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_onenand_lock_handle
	xorl	%r13d, %r13d
	xorl	%eax, %eax
LBB0_12:
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r13d, %edx
	movq	%rax, %rcx
	callq	_onenand_data_handle
	movq	%r14, %rdi
	movl	%ebx, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_onenand_update_interrupt       ## TAILCALL
LBB0_1:
	cmpl	$132, %ebx
	jne	LBB0_2
## %bb.13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_ONENAND_REG_START_ADDRESS1@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r14), %rdi
	callq	_readw
	movq	%rax, %r15
	movq	_ONENAND_DDP_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$1, %eax
	shll	%cl, %eax
	btq	%rcx, %r15
	jae	LBB0_4
## %bb.3:
	notl	%eax
	andl	%r15d, %eax
	movl	(%r14), %r15d
	movb	16(%r14), %cl
	incb	%cl
	sarl	%cl, %r15d
	addl	%eax, %r15d
LBB0_4:
	movq	_ONENAND_CMD_ERASE@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_6
## %bb.5:
	xorl	%r13d, %r13d
	movl	$-1, %r12d
	cmpl	$-1, %r15d
	je	LBB0_8
LBB0_9:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_onenand_addr
	cmpl	$-1, %r12d
	jne	LBB0_11
	jmp	LBB0_12
LBB0_6:
	movq	_ONENAND_REG_START_ADDRESS8@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r14), %rdi
	callq	_readw
	movq	%rax, %r12
	movq	_ONENAND_FPA_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r12d
	movq	_ONENAND_REG_START_BUFFER@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r14), %rdi
	callq	_readw
	movq	_ONENAND_BSA_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movq	_ONENAND_BSA_DATARAM1@GOTPCREL(%rip), %rcx
	notl	%eax
	xorl	%r13d, %r13d
	testl	%eax, (%rcx)
	sete	%r13b
	cmpl	$-1, %r15d
	jne	LBB0_9
LBB0_8:
	xorl	%eax, %eax
	cmpl	$-1, %r12d
	je	LBB0_12
LBB0_11:
	movb	4(%r14), %cl
	shll	%cl, %r12d
	movslq	%r12d, %rcx
	addq	%rcx, %rax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_ONENAND_REG_START_ADDRESS1,8,3 ## @ONENAND_REG_START_ADDRESS1
	.comm	_ONENAND_DDP_SHIFT,4,2          ## @ONENAND_DDP_SHIFT
	.comm	_ONENAND_CMD_ERASE,4,2          ## @ONENAND_CMD_ERASE
	.comm	_ONENAND_REG_START_ADDRESS8,8,3 ## @ONENAND_REG_START_ADDRESS8
	.comm	_ONENAND_FPA_SHIFT,4,2          ## @ONENAND_FPA_SHIFT
	.comm	_ONENAND_REG_START_BUFFER,8,3   ## @ONENAND_REG_START_BUFFER
	.comm	_ONENAND_BSA_SHIFT,4,2          ## @ONENAND_BSA_SHIFT
	.comm	_ONENAND_BSA_DATARAM1,4,2       ## @ONENAND_BSA_DATARAM1
	.no_dead_strip	_onenand_command_handle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function onenand_command_handle
_onenand_command_handle:                ; @onenand_command_handle
	.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, x1
	mov	x20, x0
	sub	w8, w1, #128
	cmp	w8, #4
	b.hs	LBB0_3
; %bb.1:
	mov	x0, x20
	mov	x1, x19
	bl	_onenand_lock_handle
	mov	w22, #0
	mov	x3, #0
LBB0_2:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x22
	bl	_onenand_data_handle
	mov	x0, x20
	mov	x1, x19
	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_update_interrupt
LBB0_3:
	cmp	w19, #132
	b.ne	LBB0_5
; %bb.4:
	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_5:
	ldr	x8, [x20, #8]
Lloh0:
	adrp	x9, _ONENAND_REG_START_ADDRESS1@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ONENAND_REG_START_ADDRESS1@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readw
	mov	x21, x0
Lloh3:
	adrp	x8, _ONENAND_DDP_SHIFT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ONENAND_DDP_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	w9, #1
	lsl	w8, w9, w8
	tst	w8, w21
	b.eq	LBB0_7
; %bb.6:
	bic	w8, w21, w8
	ldr	w9, [x20]
	ldr	w10, [x20, #16]
	add	w10, w10, #1
	asr	w9, w9, w10
	add	w21, w9, w8
LBB0_7:
Lloh6:
	adrp	x8, _ONENAND_CMD_ERASE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ONENAND_CMD_ERASE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_10
; %bb.8:
	mov	w22, #0
	mov	w23, #-1
	cmn	w21, #1
	b.eq	LBB0_11
LBB0_9:
	mov	x0, x20
	mov	x1, x21
	bl	_onenand_addr
	mov	x3, x0
	cmn	w23, #1
	b.ne	LBB0_12
	b	LBB0_2
LBB0_10:
	ldr	x8, [x20, #8]
Lloh9:
	adrp	x9, _ONENAND_REG_START_ADDRESS8@GOTPAGE
Lloh10:
	ldr	x9, [x9, _ONENAND_REG_START_ADDRESS8@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readw
Lloh12:
	adrp	x8, _ONENAND_FPA_SHIFT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ONENAND_FPA_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	asr	w23, w0, w8
	ldr	x8, [x20, #8]
Lloh15:
	adrp	x9, _ONENAND_REG_START_BUFFER@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ONENAND_REG_START_BUFFER@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readw
Lloh18:
	adrp	x8, _ONENAND_BSA_SHIFT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ONENAND_BSA_SHIFT@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	asr	w8, w0, w8
Lloh21:
	adrp	x9, _ONENAND_BSA_DATARAM1@GOTPAGE
Lloh22:
	ldr	x9, [x9, _ONENAND_BSA_DATARAM1@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	bics	wzr, w9, w8
	cset	w22, eq
	cmn	w21, #1
	b.ne	LBB0_9
LBB0_11:
	mov	x3, #0
	cmn	w23, #1
	b.eq	LBB0_2
LBB0_12:
	ldr	w8, [x20, #4]
	lsl	w8, w23, w8
	add	x3, x3, w8, sxtw
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_ONENAND_REG_START_ADDRESS1,8,3 ; @ONENAND_REG_START_ADDRESS1
	.comm	_ONENAND_DDP_SHIFT,4,2          ; @ONENAND_DDP_SHIFT
	.comm	_ONENAND_CMD_ERASE,4,2          ; @ONENAND_CMD_ERASE
	.comm	_ONENAND_REG_START_ADDRESS8,8,3 ; @ONENAND_REG_START_ADDRESS8
	.comm	_ONENAND_FPA_SHIFT,4,2          ; @ONENAND_FPA_SHIFT
	.comm	_ONENAND_REG_START_BUFFER,8,3   ; @ONENAND_REG_START_BUFFER
	.comm	_ONENAND_BSA_SHIFT,4,2          ; @ONENAND_BSA_SHIFT
	.comm	_ONENAND_BSA_DATARAM1,4,2       ; @ONENAND_BSA_DATARAM1
	.no_dead_strip	_onenand_command_handle
.subsections_via_symbols
