	.file	"extr_cs46xx_lib.c_load_firmware.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"cs46xx/ba1"
	.text
	.p2align 4
	.type	load_firmware, @function
load_firmware:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	lea	rsi, .LC0[rip]
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 48
	mov	rdx, QWORD PTR 8[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	rdi, rsp
	call	request_firmware@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L1
	mov	rdi, QWORD PTR [rsp]
	cmp	DWORD PTR [rdi], 8
	je	.L3
.L12:
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
.L4:
	call	release_firmware@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L14
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	edi, 8
	call	vmalloc@PLT
	mov	QWORD PTR [rbx], rax
	mov	rdi, rax
	test	rax, rax
	je	.L15
	mov	rax, QWORD PTR [rsp]
	mov	edx, 8
	mov	esi, DWORD PTR 4[rax]
	call	memcpy_le32@PLT
	mov	edx, DWORD PTR BA1_MEMORY_COUNT[rip]
	test	edx, edx
	jle	.L9
	mov	rax, QWORD PTR [rbx]
	sub	edx, 1
	mov	rax, QWORD PTR [rax]
	lea	rcx, 8[rax+rdx*8]
	xor	edx, edx
	.p2align 4,,10
	.p2align 3
.L7:
	add	edx, DWORD PTR [rax]
	add	rax, 8
	cmp	rax, rcx
	jne	.L7
.L6:
	mov	eax, DWORD PTR BA1_DWORD_SIZE[rip]
	mov	rdi, QWORD PTR [rsp]
	sal	eax, 2
	cmp	eax, edx
	jge	.L4
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L15:
	mov	r12d, DWORD PTR ENOMEM[rip]
	mov	rdi, QWORD PTR [rsp]
	neg	r12d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L9:
	xor	edx, edx
	jmp	.L6
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	load_firmware, .-load_firmware
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.comm	BA1_MEMORY_COUNT,4,4
	.comm	BA1_DWORD_SIZE,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_cs46xx_lib.c_load_firmware.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"cs46xx/ba1\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	load_firmware, %function
load_firmware:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r3, .L16
	sub	sp, sp, #8
	ldr	r2, [r0, #4]
	mov	r4, r0
	ldr	r1, .L16+4
	mov	r0, sp
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	bl	request_firmware
	subs	r5, r0, #0
	blt	.L1
	ldr	r0, [sp]
	ldr	r6, [r0]
	cmp	r6, #4
	beq	.L3
.L12:
	ldr	r3, .L16+8
	ldr	r5, [r3]
	rsb	r5, r5, #0
.L4:
	bl	release_firmware
.L1:
	ldr	r3, .L16
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L14
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L3:
	mov	r0, r6
	bl	vmalloc
	cmp	r0, #0
	str	r0, [r4]
	beq	.L15
	ldr	r3, [sp]
	mov	r2, r6
	ldr	r1, [r3, #4]
	bl	memcpy_le32
	ldr	r3, .L16+12
	mov	r2, #0
	ldr	r0, [r3]
	cmp	r0, #0
	ble	.L6
	ldr	r3, [r4]
	ldr	r3, [r3]
	add	r0, r3, r0, lsl #2
	sub	r0, r0, #4
	sub	r3, r3, #4
.L7:
	ldr	r1, [r3, #4]!
	cmp	r3, r0
	add	r2, r2, r1
	bne	.L7
.L6:
	ldr	r3, .L16+16
	ldr	r0, [sp]
	ldr	r3, [r3]
	cmp	r2, r3, lsl #2
	ble	.L4
	b	.L12
.L15:
	ldr	r3, .L16+20
	ldr	r0, [sp]
	ldr	r5, [r3]
	rsb	r5, r5, #0
	b	.L4
.L14:
	bl	__stack_chk_fail
.L17:
	.align	2
.L16:
	.word	.LC1
	.word	.LC0
	.word	EINVAL
	.word	BA1_MEMORY_COUNT
	.word	BA1_DWORD_SIZE
	.word	ENOMEM
	.size	load_firmware, .-load_firmware
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.comm	BA1_MEMORY_COUNT,4,4
	.comm	BA1_DWORD_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
