	.file	"extr_qlcnic_sysfs.c_qlcnic_83xx_sysfs_flash_bulk_write.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	qlcnic_83xx_sysfs_flash_bulk_write, @function
qlcnic_83xx_sysfs_flash_bulk_write:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdi
	mov	rdi, rcx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rcx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rsi
	mov	esi, 1
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, edx
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	edx, DWORD PTR GFP_KERNEL[rip]
	call	kcalloc@PLT
	test	rax, rax
	je	.L23
	mov	rsi, r12
	mov	r14, rax
	mov	rdi, rbp
	shr	rsi, 2
	mov	r13d, esi
	call	qlcnic_swap32_buffer@PLT
	mov	rdi, r14
	mov	rdx, r12
	mov	rsi, rbp
	call	memcpy@PLT
	mov	rdi, r15
	call	qlcnic_83xx_lock_flash@PLT
	test	rax, rax
	jne	.L24
	mov	rax, QWORD PTR 8[r15]
	mov	rdi, QWORD PTR [r15]
	cmp	QWORD PTR [rax], rdi
	je	.L25
	mov	eax, r13d
	mov	ecx, DWORD PTR QLC_83XX_FLASH_WRITE_MAX[rip]
	cdq
	idiv	ecx
	test	eax, eax
	jle	.L12
.L7:
	mov	rbp, r14
	xor	r12d, r12d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	movsx	rax, DWORD PTR QLC_83XX_FLASH_WRITE_MAX[rip]
	add	r12d, 1
	mov	rcx, rax
	lea	rbp, 0[rbp+rax*4]
	lea	ebx, [rbx+rax*4]
	mov	eax, r13d
	cdq
	idiv	ecx
	cmp	eax, r12d
	jle	.L8
.L11:
	mov	rdx, rbp
	mov	esi, ebx
	mov	rdi, r15
	call	qlcnic_83xx_flash_bulk_write@PLT
	test	eax, eax
	je	.L9
	mov	rax, QWORD PTR 8[r15]
	mov	rbx, QWORD PTR [r15]
	cmp	QWORD PTR [rax], rbx
	je	.L26
.L21:
	mov	rdi, r14
	call	kfree@PLT
	mov	rdi, r15
	call	qlcnic_83xx_unlock_flash@PLT
	mov	eax, DWORD PTR EIO[rip]
	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
	neg	eax
	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
.L23:
	.cfi_restore_state
	mov	eax, DWORD PTR ENOMEM[rip]
	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
	neg	eax
	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
.L25:
	.cfi_restore_state
	mov	rdi, r15
	call	qlcnic_83xx_enable_flash_write@PLT
	test	eax, eax
	jne	.L21
	mov	eax, r13d
	mov	ecx, DWORD PTR QLC_83XX_FLASH_WRITE_MAX[rip]
	cdq
	idiv	ecx
	test	eax, eax
	jg	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rax, QWORD PTR 8[r15]
	mov	rbx, QWORD PTR [r15]
	cmp	QWORD PTR [rax], rbx
	jne	.L12
	mov	rdi, r15
	call	qlcnic_83xx_disable_flash_write@PLT
	test	eax, eax
	jne	.L21
.L12:
	mov	rdi, r14
	call	kfree@PLT
	mov	rdi, r15
	call	qlcnic_83xx_unlock_flash@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	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
.L26:
	.cfi_restore_state
	mov	rdi, r15
	call	qlcnic_83xx_disable_flash_write@PLT
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L24:
	mov	rdi, r14
	call	kfree@PLT
	mov	eax, DWORD PTR EIO[rip]
	add	rsp, 8
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	neg	eax
	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	qlcnic_83xx_sysfs_flash_bulk_write, .-qlcnic_83xx_sysfs_flash_bulk_write
	.comm	QLC_83XX_FLASH_WRITE_MAX,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EIO,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_qlcnic_sysfs.c_qlcnic_83xx_sysfs_flash_bulk_write.c"
	.text
	.global	__aeabi_idiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	qlcnic_83xx_sysfs_flash_bulk_write, %function
qlcnic_83xx_sysfs_flash_bulk_write:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r3
	ldr	r3, .L27
	mov	r7, r0
	mov	r6, r1
	mov	r5, r2
	mov	r0, r4
	mov	r1, #1
	ldr	r2, [r3]
	sub	sp, sp, #12
	bl	kcalloc
	subs	r10, r0, #0
	beq	.L23
	lsr	r8, r4, #2
	mov	r1, r8
	mov	r0, r6
	bl	qlcnic_swap32_buffer
	mov	r2, r4
	mov	r1, r6
	mov	r0, r10
	bl	memcpy
	mov	r0, r7
	bl	qlcnic_83xx_lock_flash
	subs	r3, r0, #0
	str	r3, [sp, #4]
	bne	.L24
	ldr	r2, [r7, #4]
	ldr	r3, [r7]
	ldr	r2, [r2]
	cmp	r2, r3
	beq	.L25
	ldr	fp, .L27+4
	mov	r0, r8
	ldr	r4, [fp]
	mov	r1, r4
	bl	__aeabi_idiv
	cmp	r0, #0
	ble	.L12
.L7:
	mov	r9, r10
	mov	r6, #0
	b	.L11
.L9:
	ldr	r4, [fp]
	mov	r0, r8
	mov	r1, r4
	bl	__aeabi_idiv
	cmp	r0, r6
	add	r9, r9, r4, lsl #2
	add	r5, r5, r4, lsl #2
	ble	.L8
.L11:
	mov	r3, r4
	mov	r2, r9
	mov	r1, r5
	mov	r0, r7
	bl	qlcnic_83xx_flash_bulk_write
	cmp	r0, #0
	add	r6, r6, #1
	beq	.L9
	ldr	r2, [r7, #4]
	ldr	r3, [r7]
	ldr	r2, [r2]
	cmp	r2, r3
	beq	.L26
.L21:
	mov	r0, r10
	bl	kfree
	mov	r0, r7
	bl	qlcnic_83xx_unlock_flash
	ldr	r3, .L27+8
	ldr	r9, [r3]
	rsb	r3, r9, #0
	str	r3, [sp, #4]
	ldr	r0, [sp, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L23:
	ldr	r3, .L27+12
	ldr	r9, [r3]
	rsb	r3, r9, #0
	str	r3, [sp, #4]
	ldr	r0, [sp, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L25:
	mov	r0, r7
	bl	qlcnic_83xx_enable_flash_write
	cmp	r0, #0
	bne	.L21
	ldr	fp, .L27+4
	mov	r0, r8
	ldr	r4, [fp]
	mov	r1, r4
	bl	__aeabi_idiv
	cmp	r0, #0
	bgt	.L7
.L8:
	ldr	r2, [r7, #4]
	ldr	r3, [r7]
	ldr	r2, [r2]
	cmp	r2, r3
	bne	.L12
	mov	r0, r7
	bl	qlcnic_83xx_disable_flash_write
	cmp	r0, #0
	bne	.L21
.L12:
	mov	r0, r10
	bl	kfree
	mov	r0, r7
	bl	qlcnic_83xx_unlock_flash
	ldr	r0, [sp, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L26:
	mov	r0, r7
	bl	qlcnic_83xx_disable_flash_write
	b	.L21
.L24:
	mov	r0, r10
	bl	kfree
	ldr	r3, .L27+8
	ldr	r9, [r3]
	rsb	r3, r9, #0
	str	r3, [sp, #4]
	ldr	r0, [sp, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L28:
	.align	2
.L27:
	.word	GFP_KERNEL
	.word	QLC_83XX_FLASH_WRITE_MAX
	.word	EIO
	.word	ENOMEM
	.size	qlcnic_83xx_sysfs_flash_bulk_write, .-qlcnic_83xx_sysfs_flash_bulk_write
	.comm	QLC_83XX_FLASH_WRITE_MAX,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
