	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_nfc_copy_to_sram
_atmel_nfc_copy_to_sram:                ## @atmel_nfc_copy_to_sram
	.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	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %r15
	callq	_nand_to_mtd
	movq	%rax, %r13
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	movl	8(%r15), %edi
	callq	_to_hsmc_nand_controller
	movq	%rax, %rbx
	cmpq	$0, 16(%rax)
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	addq	$16, %rdi
	movl	8(%rbx), %edx
	movq	8(%r13), %rcx
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r12, %rsi
	callq	_atmel_nand_dma_transfer
	movl	%eax, %r14d
LBB0_2:
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.3:
	movq	(%rbx), %rdi
	movq	8(%r13), %rdx
	movq	%r12, %rsi
	callq	_memcpy_toio
LBB0_4:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_5
## %bb.6:
	movq	(%r13), %rdx
	movq	8(%r13), %rdi
	addq	(%rbx), %rdi
	movq	(%r15), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memcpy_toio                    ## TAILCALL
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.no_dead_strip	_atmel_nfc_copy_to_sram
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmel_nfc_copy_to_sram
_atmel_nfc_copy_to_sram:                ; @atmel_nfc_copy_to_sram
	.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	x21, x2
	mov	x22, x1
	mov	x19, x0
	bl	_nand_to_mtd
	mov	x20, x0
Lloh0:
	adrp	x8, _EIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
	ldr	w0, [x19, #8]
	bl	_to_hsmc_nand_controller
	mov	x23, x0
	ldr	x8, [x0, #16]!
	cbz	x8, LBB0_5
; %bb.1:
	ldr	w2, [x23, #8]
	ldr	x3, [x20, #8]
Lloh3:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh5:
	ldr	w4, [x8]
	mov	x1, x22
	bl	_atmel_nand_dma_transfer
	cbz	w0, LBB0_3
LBB0_2:
	ldr	x0, [x23]
	ldr	x2, [x20, #8]
	mov	x1, x22
	bl	_memcpy_toio
LBB0_3:
	cbz	w21, LBB0_6
; %bb.4:
	ldr	x8, [x23]
	ldp	x2, x9, [x20]
	add	x0, x9, x8
	ldr	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	_memcpy_toio
LBB0_5:
	neg	w0, w24
	cbnz	w0, LBB0_2
	b	LBB0_3
LBB0_6:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.no_dead_strip	_atmel_nfc_copy_to_sram
.subsections_via_symbols
