	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxt_check_bootloader
_mxt_check_bootloader:                  ## @mxt_check_bootloader
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r13d
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	8(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	-44(%rbp), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	testl	%r13d, %r13d
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_MXT_FW_CHG_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movq	%r12, %rsi
	callq	_mxt_wait_for_completion
	testl	%eax, %eax
	jne	LBB0_3
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	$1, %edx
	callq	_mxt_bootloader_read
	testl	%eax, %eax
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$130, %r15d
	jne	LBB0_7
## %bb.16:                              ##   in Loop: Header=BB0_1 Depth=1
	movl	-44(%rbp), %edx
	movq	_MXT_FRAME_CRC_CHECK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	je	LBB0_1
## %bb.17:
	movq	_MXT_FRAME_CRC_FAIL@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_13
## %bb.18:
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_7:
	cmpl	$128, %r15d
	je	LBB0_11
## %bb.8:
	cmpl	$131, %r15d
	je	LBB0_11
## %bb.9:
	cmpl	$129, %r15d
	jne	LBB0_19
## %bb.10:
	movl	-44(%rbp), %esi
	movq	%r12, %rdi
	callq	_mxt_get_bootloader_version
	jmp	LBB0_12
LBB0_11:
	movl	-44(%rbp), %eax
LBB0_12:
	movq	_MXT_BOOT_STATUS_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movl	%edx, -44(%rbp)
LBB0_13:
	xorl	%ebx, %ebx
	cmpl	%r15d, %edx
	je	LBB0_21
## %bb.14:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_5:
	movl	%eax, %ebx
	jmp	LBB0_21
LBB0_19:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_20:
	subl	(%rax), %ebx
LBB0_21:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_MXT_FW_CHG_TIMEOUT,4,2         ## @MXT_FW_CHG_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Update wait error %d\n"

	.comm	_MXT_BOOT_STATUS_MASK,4,2       ## @MXT_BOOT_STATUS_MASK
	.comm	_MXT_FRAME_CRC_CHECK,4,2        ## @MXT_FRAME_CRC_CHECK
	.comm	_MXT_FRAME_CRC_FAIL,4,2         ## @MXT_FRAME_CRC_FAIL
L_.str.1:                               ## @.str.1
	.asciz	"Bootloader CRC fail\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"Invalid bootloader state %02X != %02X\n"

	.no_dead_strip	_mxt_check_bootloader
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxt_check_bootloader
_mxt_check_bootloader:                  ; @mxt_check_bootloader
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x22, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x19, [x0, #8]
Lloh0:
	adrp	x24, _MXT_FRAME_CRC_CHECK@GOTPAGE
Lloh1:
	ldr	x24, [x24, _MXT_FRAME_CRC_CHECK@GOTPAGEOFF]
Lloh2:
	adrp	x25, _MXT_FW_CHG_TIMEOUT@GOTPAGE
Lloh3:
	ldr	x25, [x25, _MXT_FW_CHG_TIMEOUT@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	cbz	w22, LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w2, [x25]
	mov	x0, x21
	mov	x1, x21
	bl	_mxt_wait_for_completion
	cbnz	w0, LBB0_20
LBB0_3:                                 ;   in Loop: Header=BB0_1 Depth=1
	add	x1, sp, #28
	mov	x0, x21
	mov	w2, #1
	bl	_mxt_bootloader_read
	cbnz	w0, LBB0_19
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	w20, #130
	b.ne	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [sp, #28]
	ldr	w9, [x24]
	cmp	w8, w9
	b.eq	LBB0_1
; %bb.6:
Lloh4:
	adrp	x9, _MXT_FRAME_CRC_FAIL@GOTPAGE
Lloh5:
	ldr	x9, [x9, _MXT_FRAME_CRC_FAIL@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_14
; %bb.7:
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_17
LBB0_8:
	cmp	w20, #128
	b.eq	LBB0_12
; %bb.9:
	cmp	w20, #131
	b.eq	LBB0_12
; %bb.10:
	cmp	w20, #129
	b.ne	LBB0_18
; %bb.11:
	ldr	w1, [sp, #28]
	mov	x0, x21
	bl	_mxt_get_bootloader_version
	b	LBB0_13
LBB0_12:
	ldr	w0, [sp, #28]
LBB0_13:
Lloh9:
	adrp	x8, _MXT_BOOT_STATUS_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MXT_BOOT_STATUS_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	bic	w8, w0, w8
	str	w8, [sp, #28]
LBB0_14:
	cmp	w8, w20
	b.ne	LBB0_16
; %bb.15:
	mov	w23, #0
	b	LBB0_21
LBB0_16:
	stp	x8, x20, [sp]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_17:
	mov	x0, x19
	bl	_dev_err
LBB0_18:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_21
LBB0_19:
	mov	x23, x0
	b	LBB0_21
LBB0_20:
	mov	x23, x0
	str	x23, [sp]
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_21:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_MXT_FW_CHG_TIMEOUT,4,2         ; @MXT_FW_CHG_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Update wait error %d\n"

	.comm	_MXT_BOOT_STATUS_MASK,4,2       ; @MXT_BOOT_STATUS_MASK
	.comm	_MXT_FRAME_CRC_CHECK,4,2        ; @MXT_FRAME_CRC_CHECK
	.comm	_MXT_FRAME_CRC_FAIL,4,2         ; @MXT_FRAME_CRC_FAIL
l_.str.1:                               ; @.str.1
	.asciz	"Bootloader CRC fail\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"Invalid bootloader state %02X != %02X\n"

	.no_dead_strip	_mxt_check_bootloader
.subsections_via_symbols
