	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stmpe_keypad_chip_init
_stmpe_keypad_chip_init:                ## @stmpe_keypad_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rdi), %eax
	movq	_STMPE_KEYPAD_MAX_DEBOUNCE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jg	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	movl	4(%rdi), %eax
	movq	_STMPE_KEYPAD_MAX_SCAN_COUNT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_3
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	24(%rbx), %r15
	movq	16(%rbx), %r14
	movq	_STMPE_BLOCK_KEYPAD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_stmpe_enable
	testl	%eax, %eax
	js	LBB0_10
## %bb.4:
	movq	%rbx, %rdi
	callq	_stmpe_keypad_altfunc_init
	testl	%eax, %eax
	js	LBB0_10
## %bb.5:
	movq	_STMPE_KPC_COL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%rbx), %edx
	movq	%r14, %rdi
	callq	_stmpe_reg_write
	testl	%eax, %eax
	js	LBB0_10
## %bb.6:
	movq	_STMPE_KPC_ROW_LSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	12(%rbx), %edx
	movq	%r14, %rdi
	callq	_stmpe_reg_write
	testl	%eax, %eax
	js	LBB0_10
## %bb.7:
	cmpl	$9, (%r15)
	jl	LBB0_9
## %bb.8:
	movq	_STMPE_KPC_ROW_MSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_STMPE_KPC_ROW_MSB_ROWS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	12(%rbx), %ecx
	sarl	$8, %ecx
	movq	%r14, %rdi
	callq	_stmpe_set_bits
	testl	%eax, %eax
	js	LBB0_10
LBB0_9:
	movq	_STMPE_KPC_CTRL_MSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_STMPE_KPC_CTRL_MSB_SCAN_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	4(%rbx), %ecx
	shll	$4, %ecx
	movq	%r14, %rdi
	callq	_stmpe_set_bits
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	movq	_STMPE_KPC_CTRL_LSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_STMPE_KPC_CTRL_LSB_SCAN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_STMPE_KPC_CTRL_LSB_DEBOUNCE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	%eax, %edx
	movl	(%rbx), %ecx
	addl	%ecx, %ecx
	orl	%eax, %ecx
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_stmpe_set_bits                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_STMPE_KEYPAD_MAX_DEBOUNCE,4,2  ## @STMPE_KEYPAD_MAX_DEBOUNCE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_STMPE_KEYPAD_MAX_SCAN_COUNT,4,2 ## @STMPE_KEYPAD_MAX_SCAN_COUNT
	.comm	_STMPE_BLOCK_KEYPAD,4,2         ## @STMPE_BLOCK_KEYPAD
	.comm	_STMPE_KPC_COL,4,2              ## @STMPE_KPC_COL
	.comm	_STMPE_KPC_ROW_LSB,4,2          ## @STMPE_KPC_ROW_LSB
	.comm	_STMPE_KPC_ROW_MSB,4,2          ## @STMPE_KPC_ROW_MSB
	.comm	_STMPE_KPC_ROW_MSB_ROWS,4,2     ## @STMPE_KPC_ROW_MSB_ROWS
	.comm	_STMPE_KPC_CTRL_MSB,4,2         ## @STMPE_KPC_CTRL_MSB
	.comm	_STMPE_KPC_CTRL_MSB_SCAN_COUNT,4,2 ## @STMPE_KPC_CTRL_MSB_SCAN_COUNT
	.comm	_STMPE_KPC_CTRL_LSB,4,2         ## @STMPE_KPC_CTRL_LSB
	.comm	_STMPE_KPC_CTRL_LSB_SCAN,4,2    ## @STMPE_KPC_CTRL_LSB_SCAN
	.comm	_STMPE_KPC_CTRL_LSB_DEBOUNCE,4,2 ## @STMPE_KPC_CTRL_LSB_DEBOUNCE
	.no_dead_strip	_stmpe_keypad_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_keypad_chip_init
_stmpe_keypad_chip_init:                ; @stmpe_keypad_chip_init
	.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
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _STMPE_KEYPAD_MAX_DEBOUNCE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _STMPE_KEYPAD_MAX_DEBOUNCE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.gt	LBB0_2
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0, #4]
Lloh3:
	adrp	x9, _STMPE_KEYPAD_MAX_SCAN_COUNT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _STMPE_KEYPAD_MAX_SCAN_COUNT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_4
LBB0_2:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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_4:
	ldp	x20, x21, [x19, #16]
Lloh9:
	adrp	x8, _STMPE_BLOCK_KEYPAD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _STMPE_BLOCK_KEYPAD@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_stmpe_enable
	tbnz	w0, #31, LBB0_3
; %bb.5:
	mov	x0, x19
	bl	_stmpe_keypad_altfunc_init
	tbnz	w0, #31, LBB0_3
; %bb.6:
Lloh12:
	adrp	x8, _STMPE_KPC_COL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _STMPE_KPC_COL@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	ldr	w2, [x19, #8]
	mov	x0, x20
	bl	_stmpe_reg_write
	tbnz	w0, #31, LBB0_3
; %bb.7:
Lloh15:
	adrp	x8, _STMPE_KPC_ROW_LSB@GOTPAGE
Lloh16:
	ldr	x8, [x8, _STMPE_KPC_ROW_LSB@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	ldr	w2, [x19, #12]
	mov	x0, x20
	bl	_stmpe_reg_write
	tbnz	w0, #31, LBB0_3
; %bb.8:
	ldr	w8, [x21]
	cmp	w8, #9
	b.lt	LBB0_10
; %bb.9:
Lloh18:
	adrp	x8, _STMPE_KPC_ROW_MSB@GOTPAGE
Lloh19:
	ldr	x8, [x8, _STMPE_KPC_ROW_MSB@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x8, _STMPE_KPC_ROW_MSB_ROWS@GOTPAGE
Lloh22:
	ldr	x8, [x8, _STMPE_KPC_ROW_MSB_ROWS@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	ldr	w8, [x19, #12]
	asr	w3, w8, #8
	mov	x0, x20
	bl	_stmpe_set_bits
	tbnz	w0, #31, LBB0_3
LBB0_10:
Lloh24:
	adrp	x8, _STMPE_KPC_CTRL_MSB@GOTPAGE
Lloh25:
	ldr	x8, [x8, _STMPE_KPC_CTRL_MSB@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
Lloh27:
	adrp	x8, _STMPE_KPC_CTRL_MSB_SCAN_COUNT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _STMPE_KPC_CTRL_MSB_SCAN_COUNT@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
	ldr	w8, [x19, #4]
	lsl	w3, w8, #4
	mov	x0, x20
	bl	_stmpe_set_bits
	tbnz	w0, #31, LBB0_3
; %bb.11:
Lloh30:
	adrp	x8, _STMPE_KPC_CTRL_LSB@GOTPAGE
Lloh31:
	ldr	x8, [x8, _STMPE_KPC_CTRL_LSB@GOTPAGEOFF]
Lloh32:
	adrp	x9, _STMPE_KPC_CTRL_LSB_SCAN@GOTPAGE
Lloh33:
	ldr	x9, [x9, _STMPE_KPC_CTRL_LSB_SCAN@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
Lloh35:
	ldr	w8, [x9]
Lloh36:
	adrp	x9, _STMPE_KPC_CTRL_LSB_DEBOUNCE@GOTPAGE
Lloh37:
	ldr	x9, [x9, _STMPE_KPC_CTRL_LSB_DEBOUNCE@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w2, w9, w8
	ldr	w9, [x19]
	orr	w3, w8, w9, lsl #1
	mov	x0, x20
	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
	b	_stmpe_set_bits
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_STMPE_KEYPAD_MAX_DEBOUNCE,4,2  ; @STMPE_KEYPAD_MAX_DEBOUNCE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_STMPE_KEYPAD_MAX_SCAN_COUNT,4,2 ; @STMPE_KEYPAD_MAX_SCAN_COUNT
	.comm	_STMPE_BLOCK_KEYPAD,4,2         ; @STMPE_BLOCK_KEYPAD
	.comm	_STMPE_KPC_COL,4,2              ; @STMPE_KPC_COL
	.comm	_STMPE_KPC_ROW_LSB,4,2          ; @STMPE_KPC_ROW_LSB
	.comm	_STMPE_KPC_ROW_MSB,4,2          ; @STMPE_KPC_ROW_MSB
	.comm	_STMPE_KPC_ROW_MSB_ROWS,4,2     ; @STMPE_KPC_ROW_MSB_ROWS
	.comm	_STMPE_KPC_CTRL_MSB,4,2         ; @STMPE_KPC_CTRL_MSB
	.comm	_STMPE_KPC_CTRL_MSB_SCAN_COUNT,4,2 ; @STMPE_KPC_CTRL_MSB_SCAN_COUNT
	.comm	_STMPE_KPC_CTRL_LSB,4,2         ; @STMPE_KPC_CTRL_LSB
	.comm	_STMPE_KPC_CTRL_LSB_SCAN,4,2    ; @STMPE_KPC_CTRL_LSB_SCAN
	.comm	_STMPE_KPC_CTRL_LSB_DEBOUNCE,4,2 ; @STMPE_KPC_CTRL_LSB_DEBOUNCE
	.no_dead_strip	_stmpe_keypad_chip_init
.subsections_via_symbols
