	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stmpe_chip_init
_stmpe_chip_init:                       ## @stmpe_chip_init
	.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
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	16(%rdi), %rax
	movq	32(%rdi), %r14
	movl	(%rax), %r13d
	movl	4(%rax), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	8(%rdi), %rax
	movq	_STMPE_IDX_CHIP_ID@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %ebx
	leaq	-56(%rbp), %r15
	movq	%r15, %rdi
	callq	_ARRAY_SIZE
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	movq	%r15, %rcx
	callq	_stmpe_block_read
	testl	%eax, %eax
	js	LBB0_19
## %bb.1:
	movl	-56(%rbp), %ebx
	shll	$8, %ebx
	orl	-52(%rbp), %ebx
	movl	(%r14), %eax
	andl	%ebx, %eax
	movl	24(%r12), %edi
	cmpl	4(%r14), %eax
	jne	LBB0_2
## %bb.3:
	movl	8(%r14), %edx
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %ecx
	callq	_dev_info
	movq	%r12, %rdi
	movl	$-1, %esi
	callq	_stmpe_disable
	testl	%eax, %eax
	jne	LBB0_19
## %bb.4:
	movq	%r12, %rdi
	callq	_stmpe_reset
	testl	%eax, %eax
	js	LBB0_19
## %bb.5:
	cmpq	$0, (%r12)
	js	LBB0_6
## %bb.7:
	movq	_STMPE801_ID@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	sete	%al
	movq	_STMPE1600_ID@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	sete	%cl
	orb	%al, %cl
	movq	_STMPE_SYS_CTRL_INT_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	%r15d, %eax
	testb	%cl, %cl
	jne	LBB0_9
## %bb.8:
	movq	_STMPE_ICR_LSB_GIM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_9:
	je	LBB0_10
## %bb.13:
	movq	_IRQF_TRIGGER_RISING@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r13d
	je	LBB0_15
## %bb.14:
	movq	_IRQF_TRIGGER_HIGH@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r13d
	jne	LBB0_16
LBB0_15:
	movq	_STMPE_SYS_CTRL_INT_HI@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, %r15d
	jmp	LBB0_16
LBB0_2:
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_19:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_21
## %bb.20:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%r15d, %r15d
	jmp	LBB0_16
LBB0_10:
	movq	_IRQF_TRIGGER_FALLING@GOTPCREL(%rip), %rcx
	movq	_IRQF_TRIGGER_RISING@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	xorl	%r15d, %r15d
	cmpl	%edx, %r13d
	movq	_STMPE_ICR_LSB_EDGE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	cmovel	%esi, %r15d
	cmpl	(%rcx), %r13d
	cmovel	%esi, %r15d
	orl	%eax, %r15d
	cmpl	%edx, %r13d
	je	LBB0_12
## %bb.11:
	movq	_IRQF_TRIGGER_HIGH@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_16
LBB0_12:
	movq	_STMPE_ICR_LSB_HIGH@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
LBB0_16:
	movq	16(%r12), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_18
## %bb.17:
	movq	%r12, %rdi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	callq	_stmpe_autosleep
	testl	%eax, %eax
	jne	LBB0_19
LBB0_18:
	movq	8(%r12), %rax
	movq	_STMPE_IDX_ICR_LSB@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %esi
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_stmpe_reg_write
	jmp	LBB0_19
LBB0_21:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_STMPE_IDX_CHIP_ID,8,3          ## @STMPE_IDX_CHIP_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown chip id: %#x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"%s detected, chip id: %#x\n"

	.comm	_STMPE801_ID,4,2                ## @STMPE801_ID
	.comm	_STMPE1600_ID,4,2               ## @STMPE1600_ID
	.comm	_STMPE_SYS_CTRL_INT_EN,4,2      ## @STMPE_SYS_CTRL_INT_EN
	.comm	_STMPE_ICR_LSB_GIM,4,2          ## @STMPE_ICR_LSB_GIM
	.comm	_IRQF_TRIGGER_FALLING,4,2       ## @IRQF_TRIGGER_FALLING
	.comm	_IRQF_TRIGGER_RISING,4,2        ## @IRQF_TRIGGER_RISING
	.comm	_STMPE_ICR_LSB_EDGE,4,2         ## @STMPE_ICR_LSB_EDGE
	.comm	_IRQF_TRIGGER_HIGH,4,2          ## @IRQF_TRIGGER_HIGH
	.comm	_STMPE_SYS_CTRL_INT_HI,4,2      ## @STMPE_SYS_CTRL_INT_HI
	.comm	_STMPE_ICR_LSB_HIGH,4,2         ## @STMPE_ICR_LSB_HIGH
	.comm	_STMPE_IDX_ICR_LSB,8,3          ## @STMPE_IDX_ICR_LSB
	.no_dead_strip	_stmpe_chip_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stmpe_chip_init
_stmpe_chip_init:                       ; @stmpe_chip_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	ldp	x9, x8, [x0, #8]
	ldp	w22, w20, [x8]
	ldr	x23, [x0, #32]
Lloh3:
	adrp	x8, _STMPE_IDX_CHIP_ID@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STMPE_IDX_CHIP_ID@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	w21, [x9, x8, lsl #2]
	mov	x0, sp
	bl	_ARRAY_SIZE
	mov	x2, x0
	mov	x3, sp
	mov	x0, x19
	mov	x1, x21
	bl	_stmpe_block_read
	tbnz	w0, #31, LBB0_10
; %bb.1:
	ldp	w8, w9, [sp]
	orr	w21, w9, w8, lsl #8
	ldp	w8, w9, [x23]
	and	w8, w21, w8
	ldr	w0, [x19, #24]
	cmp	w8, w9
	b.ne	LBB0_9
; %bb.2:
	ldr	w2, [x23, #8]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x3, x21
	bl	_dev_info
	mov	x0, x19
	mov	w1, #-1
	bl	_stmpe_disable
	cbnz	w0, LBB0_10
; %bb.3:
	mov	x0, x19
	bl	_stmpe_reset
	tbnz	w0, #31, LBB0_10
; %bb.4:
	ldr	x8, [x19]
	tbnz	x8, #63, LBB0_12
; %bb.5:
Lloh8:
	adrp	x8, _STMPE801_ID@GOTPAGE
Lloh9:
	ldr	x8, [x8, _STMPE801_ID@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w21, w8
Lloh11:
	adrp	x8, _STMPE1600_ID@GOTPAGE
Lloh12:
	ldr	x8, [x8, _STMPE1600_ID@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _STMPE_SYS_CTRL_INT_EN@GOTPAGE
Lloh15:
	ldr	x9, [x9, _STMPE_SYS_CTRL_INT_EN@GOTPAGEOFF]
	ccmp	w21, w8, #4, ne
Lloh16:
	ldr	w21, [x9]
Lloh17:
	adrp	x8, _STMPE_ICR_LSB_GIM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _STMPE_ICR_LSB_GIM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	csel	w8, w21, w8, eq
	b.ne	LBB0_13
; %bb.6:
Lloh20:
	adrp	x9, _IRQF_TRIGGER_RISING@GOTPAGE
Lloh21:
	ldr	x9, [x9, _IRQF_TRIGGER_RISING@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	cmp	w22, w9
	b.eq	LBB0_8
; %bb.7:
Lloh23:
	adrp	x9, _IRQF_TRIGGER_HIGH@GOTPAGE
Lloh24:
	ldr	x9, [x9, _IRQF_TRIGGER_HIGH@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	cmp	w22, w9
	b.ne	LBB0_16
LBB0_8:
Lloh26:
	adrp	x9, _STMPE_SYS_CTRL_INT_HI@GOTPAGE
Lloh27:
	ldr	x9, [x9, _STMPE_SYS_CTRL_INT_HI@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w21, w9, w8
	b	LBB0_16
LBB0_9:
Lloh29:
	adrp	x1, l_.str@PAGE
Lloh30:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_err
Lloh31:
	adrp	x8, _EINVAL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldr	x8, [sp, #8]
Lloh34:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh35:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.11:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_12:
	mov	w21, #0
	b	LBB0_16
LBB0_13:
Lloh37:
	adrp	x9, _IRQF_TRIGGER_FALLING@GOTPAGE
Lloh38:
	ldr	x9, [x9, _IRQF_TRIGGER_FALLING@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
Lloh40:
	adrp	x10, _IRQF_TRIGGER_RISING@GOTPAGE
Lloh41:
	ldr	x10, [x10, _IRQF_TRIGGER_RISING@GOTPAGEOFF]
Lloh42:
	ldr	w10, [x10]
	cmp	w22, w10
	ccmp	w22, w9, #4, ne
Lloh43:
	adrp	x9, _STMPE_ICR_LSB_EDGE@GOTPAGE
Lloh44:
	ldr	x9, [x9, _STMPE_ICR_LSB_EDGE@GOTPAGEOFF]
Lloh45:
	ldr	w9, [x9]
	csel	w9, w9, wzr, eq
	orr	w21, w9, w8
	cmp	w22, w10
	b.eq	LBB0_15
; %bb.14:
Lloh46:
	adrp	x8, _IRQF_TRIGGER_HIGH@GOTPAGE
Lloh47:
	ldr	x8, [x8, _IRQF_TRIGGER_HIGH@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_16
LBB0_15:
Lloh49:
	adrp	x8, _STMPE_ICR_LSB_HIGH@GOTPAGE
Lloh50:
	ldr	x8, [x8, _STMPE_ICR_LSB_HIGH@GOTPAGEOFF]
Lloh51:
	ldr	w8, [x8]
	orr	w21, w8, w21
LBB0_16:
	ldr	x8, [x19, #16]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_18
; %bb.17:
	mov	x0, x19
	mov	x1, x20
	bl	_stmpe_autosleep
	cbnz	w0, LBB0_10
LBB0_18:
	ldr	x8, [x19, #8]
Lloh52:
	adrp	x9, _STMPE_IDX_ICR_LSB@GOTPAGE
Lloh53:
	ldr	x9, [x9, _STMPE_IDX_ICR_LSB@GOTPAGEOFF]
Lloh54:
	ldr	x9, [x9]
	ldr	w1, [x8, x9, lsl #2]
	mov	x0, x19
	mov	x2, x21
	bl	_stmpe_reg_write
	b	LBB0_10
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.comm	_STMPE_IDX_CHIP_ID,8,3          ; @STMPE_IDX_CHIP_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown chip id: %#x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"%s detected, chip id: %#x\n"

	.comm	_STMPE801_ID,4,2                ; @STMPE801_ID
	.comm	_STMPE1600_ID,4,2               ; @STMPE1600_ID
	.comm	_STMPE_SYS_CTRL_INT_EN,4,2      ; @STMPE_SYS_CTRL_INT_EN
	.comm	_STMPE_ICR_LSB_GIM,4,2          ; @STMPE_ICR_LSB_GIM
	.comm	_IRQF_TRIGGER_FALLING,4,2       ; @IRQF_TRIGGER_FALLING
	.comm	_IRQF_TRIGGER_RISING,4,2        ; @IRQF_TRIGGER_RISING
	.comm	_STMPE_ICR_LSB_EDGE,4,2         ; @STMPE_ICR_LSB_EDGE
	.comm	_IRQF_TRIGGER_HIGH,4,2          ; @IRQF_TRIGGER_HIGH
	.comm	_STMPE_SYS_CTRL_INT_HI,4,2      ; @STMPE_SYS_CTRL_INT_HI
	.comm	_STMPE_ICR_LSB_HIGH,4,2         ; @STMPE_ICR_LSB_HIGH
	.comm	_STMPE_IDX_ICR_LSB,8,3          ; @STMPE_IDX_ICR_LSB
	.no_dead_strip	_stmpe_chip_init
.subsections_via_symbols
