	.file	"extr_denali.c_denali_payload_xfer.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	denali_payload_xfer, @function
denali_payload_xfer:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rsi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, edx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	call	to_denali_controller@PLT
	mov	rdi, r13
	mov	rbx, rax
	call	nand_to_mtd@PLT
	mov	ebp, DWORD PTR [rax]
	mov	eax, DWORD PTR [rbx]
	mov	DWORD PTR 8[rsp], eax
	mov	eax, DWORD PTR 0[r13]
	test	eax, eax
	jle	.L2
	xor	r14d, r14d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L10:
	add	esi, DWORD PTR 8[rsp]
.L4:
	mov	r8d, r12d
	mov	ecx, ebx
	mov	rdx, r15
	mov	rdi, r13
	call	denali_change_column@PLT
	test	eax, eax
	jne	.L1
	movsx	rbx, ebx
	add	r14d, 1
	add	r15, rbx
	cmp	DWORD PTR 0[r13], r14d
	jle	.L2
.L6:
	mov	ebx, DWORD PTR 4[r13]
	mov	esi, DWORD PTR 8[r13]
	add	esi, ebx
	imul	esi, r14d
	cmp	ebp, esi
	jle	.L10
	lea	eax, [rbx+rsi]
	cmp	eax, ebp
	jle	.L4
	mov	ecx, ebp
	mov	r8d, r12d
	mov	rdx, r15
	mov	rdi, r13
	sub	ecx, esi
	mov	DWORD PTR 12[rsp], ecx
	call	denali_change_column@PLT
	test	eax, eax
	jne	.L1
	movsx	rax, DWORD PTR 12[rsp]
	add	r15, rax
	sub	ebx, eax
	mov	eax, DWORD PTR 8[rsp]
	lea	esi, 0[rbp+rax]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	xor	eax, eax
.L1:
	add	rsp, 24
	.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
	.cfi_endproc
.LFE0:
	.size	denali_payload_xfer, .-denali_payload_xfer
	.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_denali.c_denali_payload_xfer.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	denali_payload_xfer, %function
denali_payload_xfer:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #12
	mov	r5, r0
	mov	r10, r1
	mov	r8, r2
	bl	to_denali_controller
	mov	r4, r0
	mov	r0, r5
	bl	nand_to_mtd
	ldr	r3, [r5]
	ldr	r9, [r4]
	cmp	r3, #0
	ldr	r7, [r0]
	ble	.L2
	mov	r6, #0
	b	.L6
.L4:
	mov	r3, r4
	mov	r2, r10
	mov	r0, r5
	str	r8, [sp]
	bl	denali_change_column
	cmp	r0, #0
	add	r6, r6, #1
	bne	.L1
	ldr	r3, [r5]
	add	r10, r10, r4
	cmp	r3, r6
	ble	.L2
.L6:
	ldr	r4, [r5, #4]
	ldr	r1, [r5, #8]
	add	r1, r4, r1
	mul	r1, r6, r1
	cmp	r7, r1
	add	r3, r4, r1
	addle	r1, r1, r9
	ble	.L4
	cmp	r3, r7
	ble	.L4
	sub	fp, r7, r1
	mov	r3, fp
	mov	r2, r10
	mov	r0, r5
	str	r8, [sp]
	bl	denali_change_column
	cmp	r0, #0
	bne	.L1
	add	r10, r10, fp
	sub	r4, r4, fp
	add	r1, r7, r9
	b	.L4
.L2:
	mov	r0, #0
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
	.size	denali_payload_xfer, .-denali_payload_xfer
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
