	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iqs5xx_bl_verify
_iqs5xx_bl_verify:                      ## @iqs5xx_bl_verify
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movq	%rdx, %r13
	movl	%esi, %r12d
	movq	%rdi, %r15
	movq	%rsp, -56(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_IQS5XX_BL_BLK_LEN_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leaq	(,%r14,4), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rsi
	movl	%ebx, %eax
	cltd
	movq	_IQS5XX_BL_BLK_LEN_MAX@GOTPCREL(%rip), %rcx
	idivl	(%rcx)
	testl	%edx, %edx
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
LBB0_12:
	subl	(%rax), %r12d
	jmp	LBB0_13
LBB0_2:
	movq	_IQS5XX_BL_ADDR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	(%r15), %eax
	movl	%eax, -112(%rbp)
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -96(%rbp)
	shll	$2, %r14d
	movl	%r14d, -108(%rbp)
	movq	%rsi, -104(%rbp)
	testl	%ebx, %ebx
	jle	LBB0_8
## %bb.3:
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_IQS5XX_BL_CMD_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leal	(%r14,%r12), %edx
	movq	%r15, %rdi
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	callq	_iqs5xx_bl_cmd
	testl	%eax, %eax
	jne	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	8(%r15), %edi
	leaq	-112(%rbp), %rsi
	movl	$1, %edx
	callq	_i2c_transfer
	cmpl	$1, %eax
	jne	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movslq	%r14d, %rax
	leaq	(,%rax,4), %rsi
	addq	%r13, %rsi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcmp
	testq	%rax, %rax
	jne	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_IQS5XX_BL_BLK_LEN_MAX@GOTPCREL(%rip), %rax
	addl	(%rax), %r14d
	cmpl	%ebx, %r14d
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	jl	LBB0_4
LBB0_8:
	xorl	%r12d, %r12d
	jmp	LBB0_13
LBB0_9:
	movl	%eax, %r12d
	jmp	LBB0_13
LBB0_10:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%r12d, %r12d
	subl	(%rcx), %r12d
	testl	%eax, %eax
	cmovsl	%eax, %r12d
	addq	$4, %r15
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_13:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	movl	%r12d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	addq	$4, %r15
	leaq	L_.str(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_IQS5XX_BL_BLK_LEN_MAX,4,2      ## @IQS5XX_BL_BLK_LEN_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IQS5XX_BL_ADDR_MASK,4,2        ## @IQS5XX_BL_ADDR_MASK
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_IQS5XX_BL_CMD_READ,4,2         ## @IQS5XX_BL_CMD_READ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to verify block at address 0x%04X\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"Failed to read block at address 0x%04X: %d\n"

	.no_dead_strip	_iqs5xx_bl_verify
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iqs5xx_bl_verify
_iqs5xx_bl_verify:                      ; @iqs5xx_bl_verify
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #48
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	mov	x13, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x28, _IQS5XX_BL_BLK_LEN_MAX@GOTPAGE
Lloh4:
	ldr	x28, [x28, _IQS5XX_BL_BLK_LEN_MAX@GOTPAGEOFF]
	ldr	w12, [x28]
	lsl	x8, x12, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x23, x9, x8
	mov	sp, x23
	ldr	w8, [x28]
	sdiv	w9, w3, w8
	msub	w8, w9, w8, w3
	cbz	w8, LBB0_2
; %bb.1:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w26, w8
	b	LBB0_14
LBB0_2:
Lloh10:
	adrp	x8, _IQS5XX_BL_ADDR_MASK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IQS5XX_BL_ADDR_MASK@GOTPAGEOFF]
	ldr	w9, [x19]
Lloh12:
	ldr	w8, [x8]
	eor	w8, w8, w9
Lloh13:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh14:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	stur	w9, [x29, #-96]
	lsl	w24, w12, #2
	stp	w8, w24, [x29, #-112]
	stur	x23, [x29, #-104]
	cmp	w20, #1
	b.lt	LBB0_9
; %bb.3:
	stur	x13, [x29, #-120]               ; 8-byte Folded Spill
	mov	w27, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
Lloh16:
	adrp	x8, _IQS5XX_BL_CMD_READ@GOTPAGE
Lloh17:
	ldr	x8, [x8, _IQS5XX_BL_CMD_READ@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	add	w25, w27, w22
	mov	x0, x19
	mov	x2, x25
	bl	_iqs5xx_bl_cmd
	cbnz	w0, LBB0_10
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x19, #8]
	sub	x1, x29, #112
	mov	w2, #1
	bl	_i2c_transfer
	cmp	w0, #1
	b.ne	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x1, x21, w27, sxtw #2
	mov	x0, x23
	mov	x2, x24
	bl	_memcmp
	cbnz	x0, LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x28]
	add	w27, w8, w27
	cmp	w27, w20
	b.lt	LBB0_4
; %bb.8:
	mov	w26, #0
	b	LBB0_13
LBB0_9:
	mov	w26, #0
	b	LBB0_14
LBB0_10:
	mov	x26, x0
	b	LBB0_13
LBB0_11:
Lloh19:
	adrp	x8, _EIO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	cmp	w0, #0
	csneg	w26, w0, w8, lt
	add	x0, x19, #4
	str	x26, [sp, #-16]!
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x25
	bl	_dev_err
	add	sp, sp, #16
	b	LBB0_13
LBB0_12:
	add	x0, x19, #4
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x25
	bl	_dev_err
Lloh26:
	adrp	x8, _EIO@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w26, w8
LBB0_13:
	ldur	x13, [x29, #-120]               ; 8-byte Folded Reload
LBB0_14:
	mov	sp, x13
	ldur	x8, [x29, #-88]
Lloh29:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh30:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.15:
	mov	x0, x26
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_IQS5XX_BL_BLK_LEN_MAX,4,2      ; @IQS5XX_BL_BLK_LEN_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IQS5XX_BL_ADDR_MASK,4,2        ; @IQS5XX_BL_ADDR_MASK
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_IQS5XX_BL_CMD_READ,4,2         ; @IQS5XX_BL_CMD_READ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to verify block at address 0x%04X\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"Failed to read block at address 0x%04X: %d\n"

	.no_dead_strip	_iqs5xx_bl_verify
.subsections_via_symbols
