	.file	"extr_kaweth.c_kaweth_download_firmware.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Firmware request failed\n"
.LC1:
	.string	"Firmware too big: %zu\n"
.LC2:
	.string	"High: %i, Low:%i\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC3:
	.string	"Downloading firmware at %p to kaweth device at %p\n"
	.section	.rodata.str1.1
.LC4:
	.string	"Firmware length: %d\n"
	.text
	.p2align 4
	.type	kaweth_download_firmware, @function
kaweth_download_firmware:
.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
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rcx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdx
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	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
	test	eax, eax
	jne	.L8
	mov	rax, QWORD PTR [rsp]
	mov	r12d, DWORD PTR [rax]
	cmp	r12d, DWORD PTR KAWETH_FIRMWARE_BUF_SIZE[rip]
	jg	.L9
	mov	esi, DWORD PTR 4[rax]
	mov	rdi, QWORD PTR 0[rbp]
	mov	edx, r12d
	call	memcpy@PLT
	mov	rdi, QWORD PTR [rsp]
	call	release_firmware@PLT
	mov	rax, QWORD PTR 0[rbp]
	movzx	ecx, r12b
	mov	edx, r12d
	sub	ecx, 7
	sar	edx, 8
	lea	rsi, .LC2[rip]
	mov	DWORD PTR 8[rax], ecx
	mov	DWORD PTR 12[rax], edx
	mov	DWORD PTR 16[rax], r13d
	mov	DWORD PTR 20[rax], ebx
	mov	edi, DWORD PTR 16[rbp]
	xor	eax, eax
	call	netdev_dbg@PLT
	mov	edi, DWORD PTR 16[rbp]
	mov	rdx, QWORD PTR 0[rbp]
	mov	rcx, rbp
	lea	rsi, .LC3[rip]
	xor	eax, eax
	call	netdev_dbg@PLT
	mov	edi, DWORD PTR 16[rbp]
	mov	edx, r12d
	xor	eax, eax
	lea	rsi, .LC4[rip]
	call	netdev_dbg@PLT
	mov	rdi, QWORD PTR 8[rbp]
	mov	rbx, QWORD PTR 0[rbp]
	xor	esi, esi
	mov	r15d, DWORD PTR KAWETH_CONTROL_TIMEOUT[rip]
	mov	r13d, DWORD PTR USB_TYPE_VENDOR[rip]
	mov	r14d, DWORD PTR KAWETH_COMMAND_SCAN[rip]
	or	r13d, DWORD PTR USB_DIR_OUT[rip]
	or	r13d, DWORD PTR USB_RECIP_DEVICE[rip]
	call	usb_sndctrlpipe@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 88
	xor	r9d, r9d
	xor	r8d, r8d
	push	r15
	.cfi_def_cfa_offset 96
	mov	esi, eax
	mov	ecx, r13d
	mov	edx, r14d
	push	r12
	.cfi_def_cfa_offset 104
	mov	rdi, rbp
	push	rbx
	.cfi_def_cfa_offset 112
	call	kaweth_control@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 80
	mov	r12d, eax
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L10
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L9:
	.cfi_restore_state
	mov	rdi, QWORD PTR 24[rbp]
	mov	edx, r12d
	lea	rsi, .LC1[rip]
	xor	eax, eax
	call	dev_err@PLT
	mov	rdi, QWORD PTR [rsp]
	call	release_firmware@PLT
	mov	r12d, DWORD PTR ENOSPC[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdi, QWORD PTR 24[rbp]
	mov	r12d, eax
	lea	rsi, .LC0[rip]
	xor	eax, eax
	call	dev_err@PLT
	jmp	.L1
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	kaweth_download_firmware, .-kaweth_download_firmware
	.comm	USB_TYPE_VENDOR,4,4
	.comm	USB_RECIP_DEVICE,4,4
	.comm	USB_DIR_OUT,4,4
	.comm	KAWETH_FIRMWARE_BUF_SIZE,4,4
	.comm	KAWETH_CONTROL_TIMEOUT,4,4
	.comm	KAWETH_COMMAND_SCAN,4,4
	.comm	ENOSPC,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_kaweth.c_kaweth_download_firmware.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Firmware request failed\012\000"
	.align	2
.LC1:
	.ascii	"Firmware too big: %zu\012\000"
	.align	2
.LC2:
	.ascii	"High: %i, Low:%i\012\000"
	.align	2
.LC3:
	.ascii	"Downloading firmware at %p to kaweth device at %p\012"
	.ascii	"\000"
	.align	2
.LC4:
	.ascii	"Firmware length: %d\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	kaweth_download_firmware, %function
kaweth_download_firmware:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r8, r3
	sub	sp, sp, #32
	ldr	r3, .L11
	mov	r4, r0
	mov	r7, r2
	ldr	r2, [r0, #4]
	add	r0, sp, #24
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	bl	request_firmware
	subs	r5, r0, #0
	bne	.L8
	ldr	r3, [sp, #24]
	ldr	r2, .L11+4
	ldr	r6, [r3]
	ldr	r2, [r2]
	cmp	r6, r2
	bgt	.L9
	ldr	r1, [r3, #4]
	mov	r2, r6
	ldr	r0, [r4]
	bl	memcpy
	ldr	r0, [sp, #24]
	bl	release_firmware
	ldr	r1, [r4]
	and	r3, r6, #255
	sub	r3, r3, #7
	asr	r2, r6, #8
	str	r3, [r1, #8]
	str	r8, [r1, #16]
	str	r7, [r1, #20]
	str	r2, [r1, #12]
	ldr	r0, [r4, #8]
	ldr	r1, .L11+8
	bl	netdev_dbg
	mov	r3, r4
	ldr	r2, [r4]
	ldr	r1, .L11+12
	ldr	r0, [r4, #8]
	bl	netdev_dbg
	mov	r2, r6
	ldr	r1, .L11+16
	ldr	r0, [r4, #8]
	bl	netdev_dbg
	mov	r1, r5
	ldr	r0, [r4, #4]
	bl	usb_sndctrlpipe
	ldr	r2, .L11+20
	mov	r1, r0
	ldr	r3, .L11+24
	ldr	r0, .L11+28
	ldr	ip, .L11+32
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r7, [r0]
	ldr	r8, [ip]
	ldr	lr, .L11+36
	ldr	ip, [r4]
	orr	r3, r2, r3
	str	r5, [sp, #4]
	str	r5, [sp]
	str	r6, [sp, #12]
	str	r7, [sp, #16]
	ldr	r2, [lr]
	mov	r0, r4
	orr	r3, r3, r8
	str	ip, [sp, #8]
	bl	kaweth_control
	mov	r5, r0
.L1:
	ldr	r3, .L11
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L10
	mov	r0, r5
	add	sp, sp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L9:
	mov	r2, r6
	ldr	r1, .L11+40
	ldr	r0, [r4, #12]
	bl	dev_err
	ldr	r0, [sp, #24]
	bl	release_firmware
	ldr	r3, .L11+44
	ldr	r5, [r3]
	rsb	r5, r5, #0
	b	.L1
.L8:
	ldr	r0, [r4, #12]
	ldr	r1, .L11+48
	bl	dev_err
	b	.L1
.L10:
	bl	__stack_chk_fail
.L12:
	.align	2
.L11:
	.word	.LC5
	.word	KAWETH_FIRMWARE_BUF_SIZE
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	USB_TYPE_VENDOR
	.word	USB_DIR_OUT
	.word	KAWETH_CONTROL_TIMEOUT
	.word	USB_RECIP_DEVICE
	.word	KAWETH_COMMAND_SCAN
	.word	.LC1
	.word	ENOSPC
	.word	.LC0
	.size	kaweth_download_firmware, .-kaweth_download_firmware
	.comm	USB_TYPE_VENDOR,4,4
	.comm	USB_RECIP_DEVICE,4,4
	.comm	USB_DIR_OUT,4,4
	.comm	KAWETH_FIRMWARE_BUF_SIZE,4,4
	.comm	KAWETH_CONTROL_TIMEOUT,4,4
	.comm	KAWETH_COMMAND_SCAN,4,4
	.comm	ENOSPC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
