	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iqs5xx_bl_cmd
_iqs5xx_bl_cmd:                         ## @iqs5xx_bl_cmd
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	_IQS5XX_BL_ADDR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	(%rdi), %eax
	movl	%eax, -88(%rbp)
	movq	$0, -72(%rbp)
	movl	$4, -84(%rbp)
	leaq	-64(%rbp), %rax
	movq	%rax, -80(%rbp)
	movl	%esi, -64(%rbp)
	leal	-130(%rbx), %eax
	cmpl	$2, %eax
	jb	LBB0_4
## %bb.1:
	cmpl	$128, %ebx
	je	LBB0_4
## %bb.2:
	cmpl	$129, %ebx
	jne	LBB0_22
## %bb.3:
	movl	$8, -84(%rbp)
	leaq	-48(%rbp), %rsi
	movl	%edx, %edi
	callq	_put_unaligned_be16
LBB0_4:
	movl	8(%r14), %edi
	leaq	-88(%rbp), %rsi
	movl	$1, %edx
	callq	_i2c_transfer
	cmpl	$1, %eax
	jne	LBB0_18
## %bb.5:
	xorl	%r15d, %r15d
	cmpl	$131, %ebx
	je	LBB0_10
## %bb.6:
	cmpl	$130, %ebx
	je	LBB0_9
## %bb.7:
	cmpl	$128, %ebx
	jne	LBB0_20
## %bb.8:
	movl	$4, -84(%rbp)
	jmp	LBB0_11
LBB0_22:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_20
LBB0_10:
	movl	$4, -84(%rbp)
	movl	$50, %edi
	callq	_msleep
LBB0_11:
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)
	movl	8(%r14), %edi
	leaq	-88(%rbp), %rsi
	movl	$1, %edx
	callq	_i2c_transfer
	cmpl	$1, %eax
	jne	LBB0_18
## %bb.12:
	cmpl	$131, %ebx
	je	LBB0_16
## %bb.13:
	cmpl	$128, %ebx
	jne	LBB0_20
## %bb.14:
	leaq	-64(%rbp), %rdi
	callq	_get_unaligned_be16
	movq	_IQS5XX_BL_ID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_20
## %bb.15:
	addq	$4, %r14
	leaq	-64(%rbp), %rdi
	callq	_get_unaligned_be16
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_20
LBB0_18:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	subl	(%rcx), %r15d
	testl	%eax, %eax
	cmovsl	%eax, %r15d
	cmpl	$128, %ebx
	je	LBB0_20
## %bb.19:
	addq	$4, %r14
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_20
LBB0_9:
	movl	$10000, %edi                    ## imm = 0x2710
	movl	$10100, %esi                    ## imm = 0x2774
	callq	_usleep_range
LBB0_20:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_23
## %bb.21:
	movl	%r15d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movl	-64(%rbp), %eax
	movq	_IQS5XX_BL_CRC_PASS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_20
## %bb.17:
	addq	$4, %r14
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_20
LBB0_23:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_IQS5XX_BL_ADDR_MASK,4,2        ## @IQS5XX_BL_ADDR_MASK
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_I2C_M_RD,8,3                   ## @I2C_M_RD
	.comm	_IQS5XX_BL_ID,8,3               ## @IQS5XX_BL_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unrecognized bootloader ID: 0x%04X\n"

	.comm	_IQS5XX_BL_CRC_PASS,4,2         ## @IQS5XX_BL_CRC_PASS
L_.str.1:                               ## @.str.1
	.asciz	"Bootloader CRC failed\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.2:                               ## @.str.2
	.asciz	"Unsuccessful bootloader command 0x%02X: %d\n"

	.no_dead_strip	_iqs5xx_bl_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iqs5xx_bl_cmd
_iqs5xx_bl_cmd:                         ; @iqs5xx_bl_cmd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x8, _IQS5XX_BL_ADDR_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IQS5XX_BL_ADDR_MASK@GOTPAGEOFF]
	ldr	w9, [x0]
Lloh5:
	ldr	w8, [x8]
	eor	w8, w8, w9
	mov	w9, #4
	stp	w8, w9, [sp, #16]
	add	x8, sp, #40
	stp	x8, xzr, [sp, #24]
	str	w1, [sp, #40]
	sub	w8, w1, #130
	cmp	w8, #2
	b.lo	LBB0_4
; %bb.1:
	cmp	w20, #128
	b.eq	LBB0_4
; %bb.2:
	cmp	w20, #129
	b.ne	LBB0_15
; %bb.3:
	mov	w8, #8
	str	w8, [sp, #20]
	add	x8, sp, #40
	add	x1, x8, #16
	mov	x0, x2
	bl	_put_unaligned_be16
LBB0_4:
	ldr	w0, [x19, #8]
	add	x1, sp, #16
	mov	w2, #1
	bl	_i2c_transfer
	cmp	w0, #1
	b.ne	LBB0_17
; %bb.5:
	cmp	w20, #131
	b.eq	LBB0_9
; %bb.6:
	cmp	w20, #130
	b.eq	LBB0_19
; %bb.7:
	cmp	w20, #128
	b.ne	LBB0_20
; %bb.8:
	mov	w8, #4
	str	w8, [sp, #20]
	b	LBB0_10
LBB0_9:
	mov	w8, #4
	str	w8, [sp, #20]
	mov	w0, #50
	bl	_msleep
LBB0_10:
Lloh6:
	adrp	x8, _I2C_M_RD@GOTPAGE
Lloh7:
	ldr	x8, [x8, _I2C_M_RD@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	str	x8, [sp, #32]
	ldr	w0, [x19, #8]
	add	x1, sp, #16
	mov	w2, #1
	bl	_i2c_transfer
	cmp	w0, #1
	b.ne	LBB0_17
; %bb.11:
	cmp	w20, #131
	b.eq	LBB0_23
; %bb.12:
	cmp	w20, #128
	b.ne	LBB0_20
; %bb.13:
	add	x0, sp, #40
	bl	_get_unaligned_be16
Lloh9:
	adrp	x8, _IQS5XX_BL_ID@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IQS5XX_BL_ID@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_20
; %bb.14:
	add	x19, x19, #4
	add	x0, sp, #40
	bl	_get_unaligned_be16
	str	x0, [sp]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_15:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_16:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_21
LBB0_17:
Lloh16:
	adrp	x8, _EIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cmp	w0, #0
	csneg	w21, w0, w8, lt
	cmp	w20, #128
	b.eq	LBB0_21
; %bb.18:
	add	x0, x19, #4
	stp	x20, x21, [sp]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	b	LBB0_21
LBB0_19:
	mov	w0, #10000
	mov	w1, #10100
	bl	_usleep_range
LBB0_20:
	mov	w21, #0
LBB0_21:
	ldur	x8, [x29, #-40]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_25
; %bb.22:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_23:
	ldr	w8, [sp, #40]
Lloh24:
	adrp	x9, _IQS5XX_BL_CRC_PASS@GOTPAGE
Lloh25:
	ldr	x9, [x9, _IQS5XX_BL_CRC_PASS@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_20
; %bb.24:
	add	x0, x19, #4
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh29:
	adrp	x8, _EIO@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_16
LBB0_25:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_IQS5XX_BL_ADDR_MASK,4,2        ; @IQS5XX_BL_ADDR_MASK
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_I2C_M_RD,8,3                   ; @I2C_M_RD
	.comm	_IQS5XX_BL_ID,8,3               ; @IQS5XX_BL_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unrecognized bootloader ID: 0x%04X\n"

	.comm	_IQS5XX_BL_CRC_PASS,4,2         ; @IQS5XX_BL_CRC_PASS
l_.str.1:                               ; @.str.1
	.asciz	"Bootloader CRC failed\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.2:                               ; @.str.2
	.asciz	"Unsuccessful bootloader command 0x%02X: %d\n"

	.no_dead_strip	_iqs5xx_bl_cmd
.subsections_via_symbols
