	.file	"extr_t4_hw.c_t4_fw_upgrade.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	t4_fw_upgrade
	.type	t4_fw_upgrade, @function
t4_fw_upgrade:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15d, ecx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, r8d
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	edi, DWORD PTR [rdx]
	call	be32_to_cpu@PLT
	mov	rsi, rbp
	mov	rdi, r12
	mov	r14, rax
	mov	rax, QWORD PTR FW_HDR_MAGIC_BOOTSTRAP[rip]
	mov	QWORD PTR 8[rsp], rax
	call	t4_fw_matches_chip@PLT
	test	eax, eax
	je	.L9
	cmp	r14, QWORD PTR 8[rsp]
	je	.L4
	mov	edx, ebx
	mov	esi, r13d
	mov	rdi, r12
	call	t4_fw_halt@PLT
	test	eax, eax
	jns	.L6
	test	ebx, ebx
	jne	.L6
.L1:
	add	rsp, 24
	.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
.L4:
	.cfi_restore_state
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	edx, r15d
	mov	rsi, rbp
	mov	rdi, r12
	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	t4_load_fw@PLT
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	mov	edx, r15d
	mov	rsi, rbp
	mov	rdi, r12
	call	t4_load_fw@PLT
	test	eax, eax
	js	.L1
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	esi, r13d
	mov	rdi, r12
	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	t4_fw_restart@PLT
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	mov	eax, DWORD PTR EINVAL[rip]
	add	rsp, 24
	.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	t4_fw_upgrade, .-t4_fw_upgrade
	.comm	FW_HDR_MAGIC_BOOTSTRAP,8,8
	.comm	EINVAL,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_t4_hw.c_t4_fw_upgrade.c"
	.text
	.align	2
	.global	t4_fw_upgrade
	.syntax unified
	.arm
	.fpu softvfp
	.type	t4_fw_upgrade, %function
t4_fw_upgrade:
	@ args = 4, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r5, r0
	ldr	r0, [r2]
	mov	r4, r2
	mov	r6, r1
	mov	r8, r3
	ldr	r7, [sp, #32]
	bl	be32_to_cpu
	ldr	r3, .L8
	mov	r9, r0
	mov	r1, r4
	mov	r0, r5
	ldr	r10, [r3]
	bl	t4_fw_matches_chip
	cmp	r0, #0
	beq	.L7
	cmp	r9, r10
	beq	.L4
	mov	r2, r7
	mov	r1, r6
	mov	r0, r5
	clz	r7, r7
	bl	t4_fw_halt
	lsr	r7, r7, #5
	ands	r3, r7, r0, lsr #31
	popne	{r4, r5, r6, r7, r8, r9, r10, pc}
	mov	r2, r8
	mov	r1, r4
	mov	r0, r5
	bl	t4_load_fw
	cmp	r0, #0
	poplt	{r4, r5, r6, r7, r8, r9, r10, pc}
	mov	r1, r6
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	t4_fw_restart
.L4:
	mov	r2, r8
	mov	r1, r4
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	t4_load_fw
.L7:
	ldr	r3, .L8+4
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L9:
	.align	2
.L8:
	.word	FW_HDR_MAGIC_BOOTSTRAP
	.word	EINVAL
	.size	t4_fw_upgrade, .-t4_fw_upgrade
	.comm	FW_HDR_MAGIC_BOOTSTRAP,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
