	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_hsmc_nand_cmd_ctrl
_atmel_hsmc_nand_cmd_ctrl:              ## @atmel_hsmc_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	callq	_to_atmel_nand
	movq	%rax, %r14
	movl	(%rbx), %edi
	callq	_to_hsmc_nand_controller
	movq	_NAND_ALE@GOTPCREL(%rip), %rcx
	testl	%r12d, (%rcx)
	je	LBB0_3
## %bb.1:
	movq	(%rax), %rcx
	movq	_ATMEL_NFC_MAX_ADDR_CYCLES@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_8
## %bb.2:
	leaq	1(%rcx), %rdx
	movq	%rdx, (%rax)
	shlq	$2, %rcx
	addq	8(%rax), %rcx
	jmp	LBB0_6
LBB0_3:
	movq	_NAND_CLE@GOTPCREL(%rip), %rcx
	testl	%r12d, (%rcx)
	je	LBB0_7
## %bb.4:
	movslq	16(%rax), %rcx
	cmpq	$1, %rcx
	jg	LBB0_8
## %bb.5:
	leal	1(%rcx), %edx
	movl	%edx, 16(%rax)
	shlq	$2, %rcx
	addq	24(%rax), %rcx
LBB0_6:
	movl	%r15d, (%rcx)
LBB0_7:
	movq	_NAND_CMD_NONE@GOTPCREL(%rip), %rcx
	cmpl	%r15d, (%rcx)
	jne	LBB0_8
## %bb.9:
	movq	(%r14), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 32(%rax)
	movq	%rax, %rdi
	movl	$1, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_atmel_nfc_exec_op              ## TAILCALL
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_ALE,4,2                   ## @NAND_ALE
	.comm	_ATMEL_NFC_MAX_ADDR_CYCLES,8,3  ## @ATMEL_NFC_MAX_ADDR_CYCLES
	.comm	_NAND_CLE,4,2                   ## @NAND_CLE
	.comm	_NAND_CMD_NONE,4,2              ## @NAND_CMD_NONE
	.no_dead_strip	_atmel_hsmc_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_hsmc_nand_cmd_ctrl
_atmel_hsmc_nand_cmd_ctrl:              ; @atmel_hsmc_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
	mov	x22, x0
	bl	_to_atmel_nand
	mov	x20, x0
	ldr	w0, [x22]
	bl	_to_hsmc_nand_controller
Lloh0:
	adrp	x8, _NAND_ALE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_ALE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_3
; %bb.1:
	ldr	x8, [x0]
Lloh3:
	adrp	x9, _ATMEL_NFC_MAX_ADDR_CYCLES@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ATMEL_NFC_MAX_ADDR_CYCLES@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_9
; %bb.2:
	ldr	x9, [x0, #8]
	add	x10, x8, #1
	str	x10, [x0]
	b	LBB0_6
LBB0_3:
Lloh6:
	adrp	x8, _NAND_CLE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NAND_CLE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_7
; %bb.4:
	ldrsw	x8, [x0, #16]
	cmp	w8, #1
	b.gt	LBB0_9
; %bb.5:
	ldr	x9, [x0, #24]
	add	w10, w8, #1
	str	w10, [x0, #16]
LBB0_6:
	add	x8, x9, x8, lsl #2
	str	w19, [x8]
LBB0_7:
Lloh9:
	adrp	x8, _NAND_CMD_NONE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _NAND_CMD_NONE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_9
; %bb.8:
	ldr	x8, [x20]
	ldr	w8, [x8]
	str	w8, [x0, #32]
	mov	w1, #1
	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	_atmel_nfc_exec_op
LBB0_9:
	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
	.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_ALE,4,2                   ; @NAND_ALE
	.comm	_ATMEL_NFC_MAX_ADDR_CYCLES,8,3  ; @ATMEL_NFC_MAX_ADDR_CYCLES
	.comm	_NAND_CLE,4,2                   ; @NAND_CLE
	.comm	_NAND_CMD_NONE,4,2              ; @NAND_CMD_NONE
	.no_dead_strip	_atmel_hsmc_nand_cmd_ctrl
.subsections_via_symbols
