	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_nand_init
_atmel_nand_init:                       ## @atmel_nand_init
	.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
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_nand_to_mtd
	movl	32(%r14), %ecx
	movl	%ecx, (%rax)
	leaq	28(%r14), %rax
	movq	%rax, 40(%rbx)
	movq	_atmel_nand_cmd_ctrl@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	_atmel_nand_read_byte@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	movq	_atmel_nand_write_byte@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	_atmel_nand_read_buf@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	_atmel_nand_write_buf@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	_atmel_nand_select_chip@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	cmpl	$0, 24(%r14)
	je	LBB0_2
## %bb.1:
	movq	16(%r14), %rax
	movq	(%rax), %rax
	cmpl	$0, (%rax)
	jne	LBB0_3
LBB0_2:
	movq	_NAND_KEEP_TIMINGS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%rbx)
LBB0_3:
	movl	$40, 8(%rbx)
	cmpq	$0, 8(%r14)
	je	LBB0_5
## %bb.4:
	movq	_NAND_USE_BOUNCE_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%rbx)
LBB0_5:
	cmpq	$0, (%r14)
	je	LBB0_7
## %bb.6:
	movq	_NAND_ECC_HW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
LBB0_7:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_atmel_nand_cmd_ctrl,4,2        ## @atmel_nand_cmd_ctrl
	.comm	_atmel_nand_read_byte,4,2       ## @atmel_nand_read_byte
	.comm	_atmel_nand_write_byte,4,2      ## @atmel_nand_write_byte
	.comm	_atmel_nand_read_buf,4,2        ## @atmel_nand_read_buf
	.comm	_atmel_nand_write_buf,4,2       ## @atmel_nand_write_buf
	.comm	_atmel_nand_select_chip,4,2     ## @atmel_nand_select_chip
	.comm	_NAND_KEEP_TIMINGS,4,2          ## @NAND_KEEP_TIMINGS
	.comm	_NAND_USE_BOUNCE_BUFFER,4,2     ## @NAND_USE_BOUNCE_BUFFER
	.comm	_NAND_ECC_HW,4,2                ## @NAND_ECC_HW
	.no_dead_strip	_atmel_nand_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmel_nand_init
_atmel_nand_init:                       ; @atmel_nand_init
	.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	x19, x1
	mov	x20, x0
	mov	x0, x1
	bl	_nand_to_mtd
	ldr	w8, [x20, #32]
	str	w8, [x0]
	add	x8, x20, #28
Lloh0:
	adrp	x9, _atmel_nand_cmd_ctrl@GOTPAGE
Lloh1:
	ldr	x9, [x9, _atmel_nand_cmd_ctrl@GOTPAGEOFF]
	str	x8, [x19, #40]
Lloh2:
	ldr	w8, [x9]
Lloh3:
	adrp	x9, _atmel_nand_read_byte@GOTPAGE
Lloh4:
	ldr	x9, [x9, _atmel_nand_read_byte@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #28]
Lloh6:
	adrp	x8, _atmel_nand_write_byte@GOTPAGE
Lloh7:
	ldr	x8, [x8, _atmel_nand_write_byte@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _atmel_nand_read_buf@GOTPAGE
Lloh10:
	ldr	x9, [x9, _atmel_nand_read_buf@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #20]
Lloh12:
	adrp	x8, _atmel_nand_write_buf@GOTPAGE
Lloh13:
	ldr	x8, [x8, _atmel_nand_write_buf@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _atmel_nand_select_chip@GOTPAGE
Lloh16:
	ldr	x9, [x9, _atmel_nand_select_chip@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #12]
	ldr	w8, [x20, #24]
	cbz	w8, LBB0_2
; %bb.1:
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
	ldr	w8, [x8]
	cbnz	w8, LBB0_3
LBB0_2:
Lloh18:
	adrp	x8, _NAND_KEEP_TIMINGS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _NAND_KEEP_TIMINGS@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	ldr	w9, [x19, #4]
	orr	w8, w9, w8
	str	w8, [x19, #4]
LBB0_3:
	mov	w8, #40
	str	w8, [x19, #8]
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_5
; %bb.4:
Lloh21:
	adrp	x8, _NAND_USE_BOUNCE_BUFFER@GOTPAGE
Lloh22:
	ldr	x8, [x8, _NAND_USE_BOUNCE_BUFFER@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	ldr	w9, [x19, #4]
	orr	w8, w9, w8
	str	w8, [x19, #4]
LBB0_5:
	ldr	x8, [x20]
	cbz	x8, LBB0_7
; %bb.6:
Lloh24:
	adrp	x8, _NAND_ECC_HW@GOTPAGE
Lloh25:
	ldr	x8, [x8, _NAND_ECC_HW@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_atmel_nand_cmd_ctrl,4,2        ; @atmel_nand_cmd_ctrl
	.comm	_atmel_nand_read_byte,4,2       ; @atmel_nand_read_byte
	.comm	_atmel_nand_write_byte,4,2      ; @atmel_nand_write_byte
	.comm	_atmel_nand_read_buf,4,2        ; @atmel_nand_read_buf
	.comm	_atmel_nand_write_buf,4,2       ; @atmel_nand_write_buf
	.comm	_atmel_nand_select_chip,4,2     ; @atmel_nand_select_chip
	.comm	_NAND_KEEP_TIMINGS,4,2          ; @NAND_KEEP_TIMINGS
	.comm	_NAND_USE_BOUNCE_BUFFER,4,2     ; @NAND_USE_BOUNCE_BUFFER
	.comm	_NAND_ECC_HW,4,2                ; @NAND_ECC_HW
	.no_dead_strip	_atmel_nand_init
.subsections_via_symbols
