	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cyttsp_irq
_cyttsp_irq:                            ## @cyttsp_irq
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	(%rsi), %rax
	movq	_CY_BL_STATE@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	addq	$16, %rbx
	movq	%rbx, %rdi
	callq	_complete
	jmp	LBB0_9
LBB0_2:
	movq	_CY_REG_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	12(%rbx), %r14
	movq	%rbx, %rdi
	movl	$4, %edx
	movq	%r14, %rcx
	callq	_ttsp_read_block_data
	testl	%eax, %eax
	jne	LBB0_9
## %bb.3:
	movq	%rbx, %rdi
	callq	_cyttsp_handshake
	testl	%eax, %eax
	jne	LBB0_9
## %bb.4:
	movq	(%rbx), %rax
	movq	_CY_IDLE_STATE@GOTPCREL(%rip), %r15
	xorl	%edi, %edi
	cmpq	(%r15), %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_5
LBB0_9:
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	(%r14), %edi
	callq	_GET_BOOTLOADERMODE
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	movq	%rbx, %rdi
	callq	_cyttsp_exit_bl_mode
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	movl	8(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	movq	(%r15), %rax
	movq	%rax, (%rbx)
	jmp	LBB0_9
LBB0_8:
	movq	%rbx, %rdi
	callq	_cyttsp_report_tchdata
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_CY_BL_STATE,8,3                ## @CY_BL_STATE
	.comm	_CY_REG_BASE,4,2                ## @CY_REG_BASE
	.comm	_CY_IDLE_STATE,8,3              ## @CY_IDLE_STATE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not return to operational mode, err: %d\n"

	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_cyttsp_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cyttsp_irq
_cyttsp_irq:                            ; @cyttsp_irq
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x1
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _CY_BL_STATE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CY_BL_STATE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
	add	x0, x19, #16
	bl	_complete
	b	LBB0_5
LBB0_2:
Lloh3:
	adrp	x8, _CY_REG_BASE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CY_REG_BASE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x20, x19, #12
	mov	x0, x19
	mov	w2, #4
	mov	x3, x20
	bl	_ttsp_read_block_data
	cbnz	w0, LBB0_5
; %bb.3:
	mov	x0, x19
	bl	_cyttsp_handshake
	cbnz	w0, LBB0_5
; %bb.4:
	ldr	x8, [x19]
Lloh6:
	adrp	x21, _CY_IDLE_STATE@GOTPAGE
Lloh7:
	ldr	x21, [x21, _CY_IDLE_STATE@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x8, x9
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_6
LBB0_5:
Lloh8:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
	ldr	w0, [x20]
	bl	_GET_BOOTLOADERMODE
	cbz	x0, LBB0_9
; %bb.7:
	mov	x0, x19
	bl	_cyttsp_exit_bl_mode
	cbz	w0, LBB0_5
; %bb.8:
	mov	x2, x0
	ldr	w0, [x19, #8]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	ldr	x8, [x21]
	str	x8, [x19]
	b	LBB0_5
LBB0_9:
	mov	x0, x19
	bl	_cyttsp_report_tchdata
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_CY_BL_STATE,8,3                ; @CY_BL_STATE
	.comm	_CY_REG_BASE,4,2                ; @CY_REG_BASE
	.comm	_CY_IDLE_STATE,8,3              ; @CY_IDLE_STATE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not return to operational mode, err: %d\n"

	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_cyttsp_irq
.subsections_via_symbols
