	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxt_probe_bootloader
_mxt_probe_bootloader:                  ## @mxt_probe_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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	(%rdi), %r14
	callq	_mxt_lookup_bootloader_address
	testl	%eax, %eax
	jne	LBB0_3
## %bb.1:
	leaq	-20(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_mxt_bootloader_read
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movl	-20(%rbp), %edx
	movq	_MXT_BOOT_STATUS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%edx, %eax
	movq	_MXT_APP_CRC_FAIL@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rcx
	cmoveq	%rax, %rcx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	xorl	%eax, %eax
LBB0_3:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MXT_BOOT_STATUS_MASK,4,2       ## @MXT_BOOT_STATUS_MASK
	.comm	_MXT_APP_CRC_FAIL,4,2           ## @MXT_APP_CRC_FAIL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Detected bootloader, status:%02X%s\n"

L_.str.1:                               ## @.str.1
	.asciz	", APP_CRC_FAIL"

L_.str.2:                               ## @.str.2
	.space	1

	.no_dead_strip	_mxt_probe_bootloader
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxt_probe_bootloader
_mxt_probe_bootloader:                  ; @mxt_probe_bootloader
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	ldr	x19, [x0]
	bl	_mxt_lookup_bootloader_address
	cbnz	w0, LBB0_3
; %bb.1:
	add	x1, sp, #12
	mov	x0, x20
	mov	w2, #1
	bl	_mxt_bootloader_read
	cbnz	w0, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _MXT_BOOT_STATUS_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MXT_BOOT_STATUS_MASK@GOTPAGEOFF]
	ldr	w2, [sp, #12]
Lloh2:
	ldr	w8, [x8]
	bic	w8, w2, w8
Lloh3:
	adrp	x9, _MXT_APP_CRC_FAIL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MXT_APP_CRC_FAIL@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, l_.str.2@PAGE
Lloh7:
	add	x10, x10, l_.str.2@PAGEOFF
Lloh8:
	adrp	x11, l_.str.1@PAGE
Lloh9:
	add	x11, x11, l_.str.1@PAGEOFF
	cmp	w8, w9
	csel	x3, x11, x10, eq
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	mov	w0, #0
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MXT_BOOT_STATUS_MASK,4,2       ; @MXT_BOOT_STATUS_MASK
	.comm	_MXT_APP_CRC_FAIL,4,2           ; @MXT_APP_CRC_FAIL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Detected bootloader, status:%02X%s\n"

l_.str.1:                               ; @.str.1
	.asciz	", APP_CRC_FAIL"

l_.str.2:                               ; @.str.2
	.space	1

	.no_dead_strip	_mxt_probe_bootloader
.subsections_via_symbols
