	.file	"extr_nand-controller.c_atmel_nfc_copy_to_sram.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	atmel_nfc_copy_to_sram, @function
atmel_nfc_copy_to_sram:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rsi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, edx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	call	nand_to_mtd@PLT
	mov	edi, DWORD PTR 8[rbx]
	mov	r15d, DWORD PTR EIO[rip]
	mov	r12, rax
	call	to_hsmc_nand_controller@PLT
	cmp	QWORD PTR 16[rax], 0
	mov	rbp, rax
	jne	.L2
	mov	eax, r15d
	neg	eax
	test	eax, eax
	jne	.L11
.L4:
	test	r13d, r13d
	jne	.L12
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rcx, QWORD PTR 8[r12]
	mov	edx, DWORD PTR 8[rax]
	lea	rdi, 16[rax]
	mov	rsi, r14
	mov	r8d, DWORD PTR DMA_TO_DEVICE[rip]
	call	atmel_nand_dma_transfer@PLT
	test	eax, eax
	je	.L4
.L11:
	mov	rdx, QWORD PTR 8[r12]
	mov	rdi, QWORD PTR 0[rbp]
	mov	rsi, r14
	call	memcpy_toio@PLT
	test	r13d, r13d
	je	.L1
.L12:
	mov	rdi, QWORD PTR 8[r12]
	mov	rdx, QWORD PTR [r12]
	mov	rsi, QWORD PTR [rbx]
	add	rdi, QWORD PTR 0[rbp]
	add	rsp, 8
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	jmp	memcpy_toio@PLT
	.cfi_endproc
.LFE0:
	.size	atmel_nfc_copy_to_sram, .-atmel_nfc_copy_to_sram
	.comm	EIO,4,4
	.comm	DMA_TO_DEVICE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_nand-controller.c_atmel_nfc_copy_to_sram.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	atmel_nfc_copy_to_sram, %function
atmel_nfc_copy_to_sram:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	sub	sp, sp, #12
	mov	r5, r0
	mov	r9, r1
	mov	r8, r2
	bl	nand_to_mtd
	ldr	r3, .L14
	mov	r7, r0
	ldr	r0, [r5, #4]
	ldr	r6, [r3]
	bl	to_hsmc_nand_controller
	ldr	r3, [r0, #8]
	mov	r4, r0
	cmp	r3, #0
	rsbeq	r3, r6, #0
	bne	.L11
	cmp	r3, #0
	bne	.L12
.L4:
	cmp	r8, #0
	bne	.L13
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L11:
	ldr	r2, .L14+4
	ldr	r3, [r7, #4]
	ldr	r1, [r2]
	add	r0, r0, #8
	ldr	r2, [r0, #-4]
	str	r1, [sp]
	mov	r1, r9
	bl	atmel_nand_dma_transfer
	mov	r3, r0
	cmp	r3, #0
	beq	.L4
.L12:
	mov	r1, r9
	ldr	r2, [r7, #4]
	ldr	r0, [r4]
	bl	memcpy_toio
	cmp	r8, #0
	beq	.L1
.L13:
	ldr	r0, [r4]
	ldr	r3, [r7, #4]
	ldr	r1, [r5]
	ldr	r2, [r7]
	add	r0, r0, r3
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, lr}
	b	memcpy_toio
.L15:
	.align	2
.L14:
	.word	EIO
	.word	DMA_TO_DEVICE
	.size	atmel_nfc_copy_to_sram, .-atmel_nfc_copy_to_sram
	.comm	EIO,4,4
	.comm	DMA_TO_DEVICE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
