	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_nand_cmd_ctrl
_atmel_nand_cmd_ctrl:                   ## @atmel_nand_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movl	%esi, %r14d
	movq	(%rdi), %rax
	movq	(%rax), %r15
	movq	_NAND_CTRL_CHANGE@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_4
## %bb.1:
	movq	_NAND_NCE@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_3
## %bb.2:
	movq	%r15, %rdi
	callq	_atmel_nand_enable
	jmp	LBB0_4
LBB0_3:
	movq	%r15, %rdi
	callq	_atmel_nand_disable
LBB0_4:
	movq	_NAND_CMD_NONE@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_6
## %bb.5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_NAND_CLE@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	andl	(%rax), %ebx
	sete	%cl
	movq	(%r15), %rax
	movb	(%rax,%rcx,4), %cl
	movl	$1, %eax
	shll	%cl, %eax
	movslq	%eax, %rsi
	addq	8(%r15), %rsi
	movl	%r14d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writeb                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_CTRL_CHANGE,4,2           ## @NAND_CTRL_CHANGE
	.comm	_NAND_NCE,4,2                   ## @NAND_NCE
	.comm	_NAND_CMD_NONE,4,2              ## @NAND_CMD_NONE
	.comm	_NAND_CLE,4,2                   ## @NAND_CLE
	.no_dead_strip	_atmel_nand_cmd_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmel_nand_cmd_ctrl
_atmel_nand_cmd_ctrl:                   ; @atmel_nand_cmd_ctrl
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x2
	mov	x19, x1
	ldr	x8, [x0]
	ldr	x20, [x8]
Lloh0:
	adrp	x8, _NAND_CTRL_CHANGE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_CTRL_CHANGE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w2
	b.eq	LBB0_4
; %bb.1:
Lloh3:
	adrp	x8, _NAND_NCE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NAND_NCE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	x0, x20
	tst	w8, w21
	b.eq	LBB0_3
; %bb.2:
	bl	_atmel_nand_enable
	b	LBB0_4
LBB0_3:
	bl	_atmel_nand_disable
LBB0_4:
Lloh6:
	adrp	x8, _NAND_CMD_NONE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NAND_CMD_NONE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_6
; %bb.5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
Lloh9:
	adrp	x8, _NAND_CLE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _NAND_CLE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w21
	cset	w8, eq
	ldr	x9, [x20]
	ldr	w8, [x9, w8, uxtw #2]
	ldr	x9, [x20, #8]
	mov	w10, #1
	lsl	w8, w10, w8
	add	x1, x9, w8, sxtw
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_writeb
	.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_CTRL_CHANGE,4,2           ; @NAND_CTRL_CHANGE
	.comm	_NAND_NCE,4,2                   ; @NAND_NCE
	.comm	_NAND_CMD_NONE,4,2              ; @NAND_CMD_NONE
	.comm	_NAND_CLE,4,2                   ; @NAND_CLE
	.no_dead_strip	_atmel_nand_cmd_ctrl
.subsections_via_symbols
