	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xway_cmd_ctrl
_xway_cmd_ctrl:                         ## @xway_cmd_ctrl
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edx, %r14d
	movl	%esi, %ebx
	callq	_nand_to_mtd
	movq	_NAND_CMD_NONE@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	je	LBB0_8
## %bb.1:
	movq	_NAND_CLE@GOTPCREL(%rip), %rcx
	testl	%r14d, (%rcx)
	je	LBB0_3
## %bb.2:
	movq	_NAND_WRITE_CMD@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_3:
	movq	_NAND_ALE@GOTPCREL(%rip), %rcx
	testl	%r14d, (%rcx)
	je	LBB0_6
## %bb.4:
	movq	_NAND_WRITE_ADDR@GOTPCREL(%rip), %rcx
LBB0_5:
	movl	(%rcx), %esi
	movq	%rax, %rdi
	movl	%ebx, %edx
	callq	_xway_writeb
LBB0_6:
	movq	_EBU_NAND_WAIT@GOTPCREL(%rip), %r14
	movq	_NAND_WAIT_WR_C@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	callq	_ltq_ebu_r32
	testl	%eax, (%rbx)
	je	LBB0_7
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_CMD_NONE,4,2              ## @NAND_CMD_NONE
	.comm	_NAND_CLE,4,2                   ## @NAND_CLE
	.comm	_NAND_WRITE_CMD,4,2             ## @NAND_WRITE_CMD
	.comm	_NAND_ALE,4,2                   ## @NAND_ALE
	.comm	_NAND_WRITE_ADDR,4,2            ## @NAND_WRITE_ADDR
	.comm	_EBU_NAND_WAIT,4,2              ## @EBU_NAND_WAIT
	.comm	_NAND_WAIT_WR_C,4,2             ## @NAND_WAIT_WR_C
	.no_dead_strip	_xway_cmd_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xway_cmd_ctrl
_xway_cmd_ctrl:                         ; @xway_cmd_ctrl
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x2
	mov	x19, x1
	bl	_nand_to_mtd
Lloh0:
	adrp	x8, _NAND_CMD_NONE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_CMD_NONE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w19
	b.eq	LBB0_8
; %bb.1:
Lloh3:
	adrp	x8, _NAND_CLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NAND_CLE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_3
; %bb.2:
Lloh6:
	adrp	x8, _NAND_WRITE_CMD@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NAND_WRITE_CMD@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
Lloh8:
	adrp	x8, _NAND_ALE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NAND_ALE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_6
; %bb.4:
Lloh11:
	adrp	x8, _NAND_WRITE_ADDR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NAND_WRITE_ADDR@GOTPAGEOFF]
LBB0_5:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_xway_writeb
LBB0_6:
Lloh13:
	adrp	x19, _EBU_NAND_WAIT@GOTPAGE
Lloh14:
	ldr	x19, [x19, _EBU_NAND_WAIT@GOTPAGEOFF]
Lloh15:
	adrp	x20, _NAND_WAIT_WR_C@GOTPAGE
Lloh16:
	ldr	x20, [x20, _NAND_WAIT_WR_C@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	bl	_ltq_ebu_r32
	ldr	w8, [x20]
	tst	w8, w0
	b.eq	LBB0_7
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_CMD_NONE,4,2              ; @NAND_CMD_NONE
	.comm	_NAND_CLE,4,2                   ; @NAND_CLE
	.comm	_NAND_WRITE_CMD,4,2             ; @NAND_WRITE_CMD
	.comm	_NAND_ALE,4,2                   ; @NAND_ALE
	.comm	_NAND_WRITE_ADDR,4,2            ; @NAND_WRITE_ADDR
	.comm	_EBU_NAND_WAIT,4,2              ; @EBU_NAND_WAIT
	.comm	_NAND_WAIT_WR_C,4,2             ; @NAND_WAIT_WR_C
	.no_dead_strip	_xway_cmd_ctrl
.subsections_via_symbols
