	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function twl4030_kp_program
_twl4030_kp_program:                    ## @twl4030_kp_program
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	_KEYP_CTRL_SOFT_NRST@GOTPCREL(%rip), %rax
	movq	_KEYP_CTRL_SOFTMODEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_KEYP_CTRL_TOE_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_KEYP_CTRL_KBD_ON@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_KEYP_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_twl4030_kpwrite_u8
	testq	%rax, %rax
	js	LBB0_8
## %bb.1:
	movq	_KEYP_EDR_KP_BOTH@GOTPCREL(%rip), %rax
	movq	_KEYP_EDR_TO_RISING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_KEYP_EDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_twl4030_kpwrite_u8
	testq	%rax, %rax
	js	LBB0_8
## %bb.2:
	movq	_PTV_PRESCALER@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_KEYP_LK_PTV_PTV_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %esi
	movq	_KEYP_LK_PTV@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_twl4030_kpwrite_u8
	testq	%rax, %rax
	js	LBB0_8
## %bb.3:
	movl	(%r14), %esi
	movl	$20000, %edi                    ## imm = 0x4E20
	callq	_KEYP_PERIOD_US
	movq	_KEYP_DEB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_twl4030_kpwrite_u8
	testq	%rax, %rax
	js	LBB0_8
## %bb.4:
	movl	(%r14), %esi
	movl	$200000, %edi                   ## imm = 0x30D40
	callq	_KEYP_PERIOD_US
	movl	%eax, %r14d
	movzbl	%r14b, %esi
	movq	_KEYP_TIMEOUT_L@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_twl4030_kpwrite_u8
	testq	%rax, %rax
	js	LBB0_8
## %bb.5:
	sarl	$8, %r14d
	movq	_KEYP_TIMEOUT_H@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_twl4030_kpwrite_u8
	testq	%rax, %rax
	js	LBB0_8
## %bb.6:
	movq	_TWL4030_SIH_CTRL_COR_MASK@GOTPCREL(%rip), %rax
	movq	_TWL4030_SIH_CTRL_PENDDIS_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_KEYP_SIH_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_twl4030_kpwrite_u8
	testq	%rax, %rax
	js	LBB0_8
## %bb.7:
	movl	(%rbx), %esi
	movq	%rbx, %rdi
	callq	_twl4030_read_kp_matrix_state
	movq	%rax, %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jns	LBB0_9
LBB0_8:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KEYP_CTRL_SOFT_NRST,4,2        ## @KEYP_CTRL_SOFT_NRST
	.comm	_KEYP_CTRL_SOFTMODEN,4,2        ## @KEYP_CTRL_SOFTMODEN
	.comm	_KEYP_CTRL_TOE_EN,4,2           ## @KEYP_CTRL_TOE_EN
	.comm	_KEYP_CTRL_KBD_ON,4,2           ## @KEYP_CTRL_KBD_ON
	.comm	_KEYP_CTRL,4,2                  ## @KEYP_CTRL
	.comm	_EIO,4,2                        ## @EIO
	.comm	_KEYP_EDR_KP_BOTH,4,2           ## @KEYP_EDR_KP_BOTH
	.comm	_KEYP_EDR_TO_RISING,4,2         ## @KEYP_EDR_TO_RISING
	.comm	_KEYP_EDR,4,2                   ## @KEYP_EDR
	.comm	_PTV_PRESCALER,4,2              ## @PTV_PRESCALER
	.comm	_KEYP_LK_PTV_PTV_SHIFT,4,2      ## @KEYP_LK_PTV_PTV_SHIFT
	.comm	_KEYP_LK_PTV,4,2                ## @KEYP_LK_PTV
	.comm	_KEYP_DEB,4,2                   ## @KEYP_DEB
	.comm	_KEYP_TIMEOUT_L,4,2             ## @KEYP_TIMEOUT_L
	.comm	_KEYP_TIMEOUT_H,4,2             ## @KEYP_TIMEOUT_H
	.comm	_TWL4030_SIH_CTRL_COR_MASK,4,2  ## @TWL4030_SIH_CTRL_COR_MASK
	.comm	_TWL4030_SIH_CTRL_PENDDIS_MASK,4,2 ## @TWL4030_SIH_CTRL_PENDDIS_MASK
	.comm	_KEYP_SIH_CTRL,4,2              ## @KEYP_SIH_CTRL
	.no_dead_strip	_twl4030_kp_program
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function twl4030_kp_program
_twl4030_kp_program:                    ; @twl4030_kp_program
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, _KEYP_CTRL_SOFT_NRST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KEYP_CTRL_SOFT_NRST@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _KEYP_CTRL_SOFTMODEN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _KEYP_CTRL_SOFTMODEN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _KEYP_CTRL_TOE_EN@GOTPAGE
Lloh7:
	ldr	x9, [x9, _KEYP_CTRL_TOE_EN@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _KEYP_CTRL_KBD_ON@GOTPAGE
Lloh10:
	ldr	x10, [x10, _KEYP_CTRL_KBD_ON@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh11:
	ldr	w9, [x10]
	orr	w1, w8, w9
Lloh12:
	adrp	x8, _KEYP_CTRL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _KEYP_CTRL@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	bl	_twl4030_kpwrite_u8
	tbnz	x0, #63, LBB0_9
; %bb.1:
Lloh15:
	adrp	x8, _KEYP_EDR_KP_BOTH@GOTPAGE
Lloh16:
	ldr	x8, [x8, _KEYP_EDR_KP_BOTH@GOTPAGEOFF]
Lloh17:
	adrp	x9, _KEYP_EDR_TO_RISING@GOTPAGE
Lloh18:
	ldr	x9, [x9, _KEYP_EDR_TO_RISING@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh21:
	adrp	x8, _KEYP_EDR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _KEYP_EDR@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_twl4030_kpwrite_u8
	tbnz	x0, #63, LBB0_9
; %bb.2:
Lloh24:
	adrp	x20, _PTV_PRESCALER@GOTPAGE
Lloh25:
	ldr	x20, [x20, _PTV_PRESCALER@GOTPAGEOFF]
Lloh26:
	adrp	x8, _KEYP_LK_PTV_PTV_SHIFT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _KEYP_LK_PTV_PTV_SHIFT@GOTPAGEOFF]
	ldr	w9, [x20]
Lloh28:
	ldr	w8, [x8]
	lsl	w1, w9, w8
Lloh29:
	adrp	x8, _KEYP_LK_PTV@GOTPAGE
Lloh30:
	ldr	x8, [x8, _KEYP_LK_PTV@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_twl4030_kpwrite_u8
	tbnz	x0, #63, LBB0_9
; %bb.3:
	ldr	w1, [x20]
	mov	w0, #20000
	bl	_KEYP_PERIOD_US
	mov	x1, x0
Lloh32:
	adrp	x8, _KEYP_DEB@GOTPAGE
Lloh33:
	ldr	x8, [x8, _KEYP_DEB@GOTPAGEOFF]
Lloh34:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_twl4030_kpwrite_u8
	tbnz	x0, #63, LBB0_9
; %bb.4:
	ldr	w1, [x20]
	mov	w0, #3392
	movk	w0, #3, lsl #16
	bl	_KEYP_PERIOD_US
	mov	x20, x0
	and	w1, w0, #0xff
Lloh35:
	adrp	x8, _KEYP_TIMEOUT_L@GOTPAGE
Lloh36:
	ldr	x8, [x8, _KEYP_TIMEOUT_L@GOTPAGEOFF]
Lloh37:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_twl4030_kpwrite_u8
	tbnz	x0, #63, LBB0_9
; %bb.5:
	asr	w1, w20, #8
Lloh38:
	adrp	x8, _KEYP_TIMEOUT_H@GOTPAGE
Lloh39:
	ldr	x8, [x8, _KEYP_TIMEOUT_H@GOTPAGEOFF]
Lloh40:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_twl4030_kpwrite_u8
	tbnz	x0, #63, LBB0_9
; %bb.6:
Lloh41:
	adrp	x8, _TWL4030_SIH_CTRL_COR_MASK@GOTPAGE
Lloh42:
	ldr	x8, [x8, _TWL4030_SIH_CTRL_COR_MASK@GOTPAGEOFF]
Lloh43:
	adrp	x9, _TWL4030_SIH_CTRL_PENDDIS_MASK@GOTPAGE
Lloh44:
	ldr	x9, [x9, _TWL4030_SIH_CTRL_PENDDIS_MASK@GOTPAGEOFF]
Lloh45:
	ldr	w8, [x8]
Lloh46:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh47:
	adrp	x8, _KEYP_SIH_CTRL@GOTPAGE
Lloh48:
	ldr	x8, [x8, _KEYP_SIH_CTRL@GOTPAGEOFF]
Lloh49:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_twl4030_kpwrite_u8
	tbnz	x0, #63, LBB0_9
; %bb.7:
	ldr	w1, [x19]
	mov	x0, x19
	bl	_twl4030_read_kp_matrix_state
	tbnz	x0, #63, LBB0_9
; %bb.8:
	mov	w0, #0
	b	LBB0_10
LBB0_9:
Lloh50:
	adrp	x8, _EIO@GOTPAGE
Lloh51:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh52:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh19
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh45
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.comm	_KEYP_CTRL_SOFT_NRST,4,2        ; @KEYP_CTRL_SOFT_NRST
	.comm	_KEYP_CTRL_SOFTMODEN,4,2        ; @KEYP_CTRL_SOFTMODEN
	.comm	_KEYP_CTRL_TOE_EN,4,2           ; @KEYP_CTRL_TOE_EN
	.comm	_KEYP_CTRL_KBD_ON,4,2           ; @KEYP_CTRL_KBD_ON
	.comm	_KEYP_CTRL,4,2                  ; @KEYP_CTRL
	.comm	_EIO,4,2                        ; @EIO
	.comm	_KEYP_EDR_KP_BOTH,4,2           ; @KEYP_EDR_KP_BOTH
	.comm	_KEYP_EDR_TO_RISING,4,2         ; @KEYP_EDR_TO_RISING
	.comm	_KEYP_EDR,4,2                   ; @KEYP_EDR
	.comm	_PTV_PRESCALER,4,2              ; @PTV_PRESCALER
	.comm	_KEYP_LK_PTV_PTV_SHIFT,4,2      ; @KEYP_LK_PTV_PTV_SHIFT
	.comm	_KEYP_LK_PTV,4,2                ; @KEYP_LK_PTV
	.comm	_KEYP_DEB,4,2                   ; @KEYP_DEB
	.comm	_KEYP_TIMEOUT_L,4,2             ; @KEYP_TIMEOUT_L
	.comm	_KEYP_TIMEOUT_H,4,2             ; @KEYP_TIMEOUT_H
	.comm	_TWL4030_SIH_CTRL_COR_MASK,4,2  ; @TWL4030_SIH_CTRL_COR_MASK
	.comm	_TWL4030_SIH_CTRL_PENDDIS_MASK,4,2 ; @TWL4030_SIH_CTRL_PENDDIS_MASK
	.comm	_KEYP_SIH_CTRL,4,2              ; @KEYP_SIH_CTRL
	.no_dead_strip	_twl4030_kp_program
.subsections_via_symbols
