	.file	"extr_iqs5xx.c_iqs5xx_bl_cmd.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Unrecognized bootloader ID: 0x%04X\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"Bootloader CRC failed\n"
	.section	.rodata.str1.8
	.align 8
.LC2:
	.string	"Unsuccessful bootloader command 0x%02X: %d\n"
	.text
	.p2align 4
	.type	iqs5xx_bl_cmd, @function
iqs5xx_bl_cmd:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rdi
	sub	rsp, 80
	.cfi_def_cfa_offset 128
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 72[rsp], rax
	xor	eax, eax
	lea	rbp, 32[rsp]
	mov	eax, DWORD PTR [rdi]
	xor	eax, DWORD PTR IQS5XX_BL_ADDR_MASK[rip]
	mov	DWORD PTR [rsp], eax
	mov	QWORD PTR 16[rsp], 0
	mov	DWORD PTR 4[rsp], 4
	mov	QWORD PTR 8[rsp], rbp
	mov	DWORD PTR 32[rsp], esi
	cmp	esi, 129
	je	.L2
	jle	.L33
	lea	eax, -130[rsi]
	cmp	eax, 1
	ja	.L31
	mov	edi, DWORD PTR 8[rdi]
	mov	rbp, rsp
	mov	edx, 1
	mov	rsi, rbp
	call	i2c_transfer@PLT
	mov	r13d, eax
	cmp	eax, 1
	jne	.L9
	cmp	r12d, 130
	jne	.L34
	mov	esi, 10100
	mov	edi, 10000
	call	usleep_range@PLT
.L30:
	xor	r13d, r13d
.L1:
	mov	rax, QWORD PTR 72[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L35
	add	rsp, 80
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L33:
	.cfi_restore_state
	cmp	esi, 128
	je	.L4
.L31:
	mov	r13d, DWORD PTR EINVAL[rip]
	neg	r13d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L2:
	mov	edi, edx
	lea	rsi, 48[rsp]
	mov	DWORD PTR 4[rsp], 8
	call	put_unaligned_be16@PLT
	mov	edi, DWORD PTR 8[rbx]
	mov	rsi, rsp
	mov	edx, 1
	call	i2c_transfer@PLT
	mov	r13d, eax
	cmp	eax, 1
	je	.L30
.L7:
	test	r13d, r13d
	js	.L18
.L17:
	mov	r13d, DWORD PTR EIO[rip]
	neg	r13d
.L16:
	cmp	r12d, 128
	je	.L1
.L18:
	lea	rdi, 4[rbx]
	mov	ecx, r13d
	mov	edx, r12d
	xor	eax, eax
	lea	rsi, .LC2[rip]
	call	dev_err@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edi, DWORD PTR 8[rdi]
	mov	r14, rsp
	mov	edx, 1
	mov	rsi, r14
	call	i2c_transfer@PLT
	mov	r13d, eax
	cmp	eax, 1
	je	.L36
.L9:
	test	r13d, r13d
	jns	.L17
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L36:
	mov	rax, QWORD PTR I2C_M_RD[rip]
	mov	edi, DWORD PTR 8[rbx]
	mov	edx, 1
	mov	rsi, r14
	mov	DWORD PTR 4[rsp], 4
	mov	QWORD PTR 16[rsp], rax
	call	i2c_transfer@PLT
	mov	r13d, eax
	cmp	eax, 1
	je	.L37
	test	eax, eax
	jns	.L17
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L34:
	mov	edi, 50
	mov	DWORD PTR 4[rsp], 4
	call	msleep@PLT
	mov	edi, DWORD PTR 8[rbx]
	mov	edx, 1
	mov	rsi, rbp
	mov	rax, QWORD PTR I2C_M_RD[rip]
	mov	QWORD PTR 16[rsp], rax
	call	i2c_transfer@PLT
	mov	r13d, eax
	cmp	eax, 1
	jne	.L7
	mov	eax, DWORD PTR IQS5XX_BL_CRC_PASS[rip]
	cmp	DWORD PTR 32[rsp], eax
	je	.L30
	lea	rdi, 4[rbx]
	lea	rsi, .LC1[rip]
	xor	eax, eax
	call	dev_err@PLT
	mov	r13d, DWORD PTR EIO[rip]
	neg	r13d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L37:
	mov	rdi, rbp
	call	get_unaligned_be16@PLT
	cmp	rax, QWORD PTR IQS5XX_BL_ID[rip]
	je	.L30
	mov	rdi, rbp
	call	get_unaligned_be16@PLT
	lea	rdi, 4[rbx]
	lea	rsi, .LC0[rip]
	mov	rdx, rax
	xor	eax, eax
	call	dev_err@PLT
	jmp	.L31
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	iqs5xx_bl_cmd, .-iqs5xx_bl_cmd
	.comm	IQS5XX_BL_ID,8,8
	.comm	IQS5XX_BL_CRC_PASS,4,4
	.comm	IQS5XX_BL_ADDR_MASK,4,4
	.comm	I2C_M_RD,8,8
	.comm	EIO,4,4
	.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_iqs5xx.c_iqs5xx_bl_cmd.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Unrecognized bootloader ID: 0x%04X\012\000"
	.align	2
.LC1:
	.ascii	"Bootloader CRC failed\012\000"
	.align	2
.LC2:
	.ascii	"Unsuccessful bootloader command 0x%02X: %d\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	iqs5xx_bl_cmd, %function
iqs5xx_bl_cmd:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r4, r1
	mov	r8, #0
	mov	r7, #4
	ldr	r1, .L36
	ldr	r3, [r0]
	ldr	r1, [r1]
	sub	sp, sp, #60
	eor	r3, r3, r1
	ldr	r1, .L36+4
	add	r9, sp, #20
	str	r4, [sp, #20]
	cmp	r4, #129
	ldr	r1, [r1]
	str	r1, [sp, #52]
	mov	r1,#0
	mov	r6, r0
	str	r3, [sp, #4]
	str	r8, [sp, #16]
	str	r7, [sp, #8]
	str	r9, [sp, #12]
	beq	.L2
	ble	.L31
	sub	r3, r4, #130
	cmp	r3, #1
	bhi	.L5
	mov	r2, #1
	ldr	r0, [r0, #8]
	add	r1, sp, #4
	bl	i2c_transfer
	cmp	r0, #1
	mov	r5, r0
	bne	.L9
	cmp	r4, #130
	bne	.L32
	ldr	r1, .L36+8
	ldr	r0, .L36+12
	mov	r5, r8
	bl	usleep_range
.L1:
	ldr	r3, .L36+4
	ldr	r2, [r3]
	ldr	r3, [sp, #52]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L33
	mov	r0, r5
	add	sp, sp, #60
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L31:
	cmp	r4, #128
	beq	.L4
.L5:
	ldr	r3, .L36+16
	ldr	r0, [r3]
	rsb	r5, r0, #0
	b	.L1
.L2:
	mov	r3, #8
	mov	r0, r2
	add	r1, sp, #36
	str	r3, [sp, #8]
	bl	put_unaligned_be16
	mov	r2, #1
	ldr	r0, [r6, #8]
	add	r1, sp, #4
	bl	i2c_transfer
	cmp	r0, #1
	mov	r5, r0
	beq	.L15
.L7:
	cmp	r5, #0
	blt	.L18
.L17:
	ldr	r3, .L36+20
	ldr	r5, [r3]
	rsb	r5, r5, #0
.L16:
	cmp	r4, #128
	beq	.L1
.L18:
	mov	r2, r4
	mov	r3, r5
	ldr	r1, .L36+24
	add	r0, r6, #4
	bl	dev_err
	b	.L1
.L4:
	mov	r2, #1
	ldr	r0, [r0, #8]
	add	r1, sp, #4
	bl	i2c_transfer
	cmp	r0, #1
	mov	r5, r0
	beq	.L34
.L9:
	cmp	r5, #0
	bge	.L17
	b	.L16
.L15:
	mov	r5, #0
	b	.L1
.L34:
	ldr	r3, .L36+28
	mov	r2, r5
	ldr	r3, [r3]
	ldr	r0, [r6, #8]
	add	r1, sp, #4
	str	r7, [sp, #8]
	str	r3, [sp, #16]
	bl	i2c_transfer
	cmp	r0, #1
	mov	r5, r0
	beq	.L35
	cmp	r0, #0
	bge	.L17
	b	.L1
.L32:
	mov	r0, #50
	str	r7, [sp, #8]
	bl	msleep
	ldr	r3, .L36+28
	mov	r2, r5
	ldr	r3, [r3]
	ldr	r0, [r6, #8]
	add	r1, sp, #4
	str	r3, [sp, #16]
	bl	i2c_transfer
	cmp	r0, #1
	mov	r5, r0
	bne	.L7
	ldr	r3, .L36+32
	ldr	r2, [sp, #20]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L15
	ldr	r1, .L36+36
	add	r0, r6, #4
	bl	dev_err
	ldr	r3, .L36+20
	ldr	r5, [r3]
	rsb	r5, r5, #0
	b	.L1
.L35:
	mov	r0, r9
	bl	get_unaligned_be16
	ldr	r3, .L36+40
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L15
	mov	r0, r9
	bl	get_unaligned_be16
	ldr	r1, .L36+44
	mov	r2, r0
	add	r0, r6, #4
	bl	dev_err
	ldr	r3, .L36+16
	ldr	r5, [r3]
	rsb	r5, r5, #0
	b	.L1
.L33:
	bl	__stack_chk_fail
.L37:
	.align	2
.L36:
	.word	IQS5XX_BL_ADDR_MASK
	.word	.LC3
	.word	10100
	.word	10000
	.word	EINVAL
	.word	EIO
	.word	.LC2
	.word	I2C_M_RD
	.word	IQS5XX_BL_CRC_PASS
	.word	.LC1
	.word	IQS5XX_BL_ID
	.word	.LC0
	.size	iqs5xx_bl_cmd, .-iqs5xx_bl_cmd
	.comm	IQS5XX_BL_ID,4,4
	.comm	IQS5XX_BL_CRC_PASS,4,4
	.comm	IQS5XX_BL_ADDR_MASK,4,4
	.comm	I2C_M_RD,4,4
	.comm	EIO,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
