	.file	"extr_icm.c_icm_firmware_start.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"starting ICM firmware\n"
	.text
	.p2align 4
	.type	icm_firmware_start, @function
icm_firmware_start:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	rdi, QWORD PTR REG_FW_STS[rip]
	add	rdi, QWORD PTR [rsi]
	call	ioread32@PLT
	test	DWORD PTR REG_FW_STS_ICM_EN[rip], eax
	je	.L2
.L4:
	xor	eax, eax
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rdi, QWORD PTR 8[rbx]
	lea	rsi, .LC0[rip]
	call	dev_dbg@PLT
	mov	rsi, rbx
	mov	rdi, rbp
	call	icm_firmware_reset@PLT
	test	eax, eax
	jne	.L1
	mov	ebp, 10
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rdi, QWORD PTR REG_FW_STS[rip]
	add	rdi, QWORD PTR [rbx]
	call	ioread32@PLT
	test	DWORD PTR REG_FW_STS_NVM_AUTH_DONE[rip], eax
	jne	.L4
	mov	edi, 300
	call	msleep@PLT
	sub	ebp, 1
	jne	.L5
	mov	eax, DWORD PTR ETIMEDOUT[rip]
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.cfi_endproc
.LFE0:
	.size	icm_firmware_start, .-icm_firmware_start
	.comm	REG_FW_STS_NVM_AUTH_DONE,4,4
	.comm	REG_FW_STS_ICM_EN,4,4
	.comm	REG_FW_STS,8,8
	.comm	ETIMEDOUT,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_icm.c_icm_firmware_start.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"starting ICM firmware\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	icm_firmware_start, %function
icm_firmware_start:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r6, .L9
	ldr	r2, [r1]
	ldr	r3, [r6]
	mov	r5, r0
	add	r0, r2, r3
	mov	r4, r1
	bl	ioread32
	ldr	r3, .L9+4
	ldr	r3, [r3]
	tst	r0, r3
	beq	.L2
.L4:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	ldr	r1, .L9+8
	ldr	r0, [r4, #4]
	bl	dev_dbg
	mov	r1, r4
	mov	r0, r5
	bl	icm_firmware_reset
	cmp	r0, #0
	popne	{r4, r5, r6, r7, r8, pc}
	mov	r5, #10
	ldr	r7, .L9+12
.L5:
	ldr	r3, [r6]
	ldr	r0, [r4]
	add	r0, r0, r3
	bl	ioread32
	ldr	r3, [r7]
	tst	r0, r3
	bne	.L4
	mov	r0, #300
	bl	msleep
	subs	r5, r5, #1
	bne	.L5
	ldr	r3, .L9+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L10:
	.align	2
.L9:
	.word	REG_FW_STS
	.word	REG_FW_STS_ICM_EN
	.word	.LC0
	.word	REG_FW_STS_NVM_AUTH_DONE
	.word	ETIMEDOUT
	.size	icm_firmware_start, .-icm_firmware_start
	.comm	REG_FW_STS_NVM_AUTH_DONE,4,4
	.comm	REG_FW_STS_ICM_EN,4,4
	.comm	REG_FW_STS,4,4
	.comm	ETIMEDOUT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
