	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pmic8xxx_kp_read_matrix
_pmic8xxx_kp_read_matrix:               ## @pmic8xxx_kp_read_matrix
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	(%rdi), %eax
	movq	_PM8XXX_MIN_ROWS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	cmpl	%ebx, %eax
	cmovgl	%eax, %ebx
	callq	_pmic8xxx_chk_sync_read
	testq	%r12, %r12
	je	LBB0_3
## %bb.1:
	movq	_KEYP_OLD_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	%ebx, %ecx
	callq	_pmic8xxx_kp_read_data
	testl	%eax, %eax
	js	LBB0_2
LBB0_3:
	movq	_KEYP_RECENT_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%ebx, %ecx
	callq	_pmic8xxx_kp_read_data
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	_USEC_PER_SEC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_KEYP_CLOCK_FREQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_DIV_ROUND_UP
                                        ## kill: def $eax killed $eax def $rax
	leal	1(,%rax,4), %edi
	callq	_udelay
	movl	8(%r14), %edi
	movq	_KEYP_SCAN@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movl	$254, %edx
	andl	-36(%rbp), %edx
	movl	%edx, -36(%rbp)
	movl	8(%r14), %edi
	movl	(%rbx), %esi
	callq	_regmap_write
	movl	%eax, %r12d
	testl	%eax, %eax
	jns	LBB0_10
## %bb.8:
	movl	4(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_9
LBB0_4:
	movl	%eax, %r12d
	movl	4(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_9
LBB0_2:
	movl	%eax, %r12d
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_9
LBB0_6:
	movl	%eax, %r12d
	movl	4(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_9:
	movl	%r12d, %edx
	callq	_dev_err
LBB0_10:
	movl	%r12d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PM8XXX_MIN_ROWS,4,2            ## @PM8XXX_MIN_ROWS
	.comm	_KEYP_OLD_DATA,4,2              ## @KEYP_OLD_DATA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error reading KEYP_OLD_DATA, rc=%d\n"

	.comm	_KEYP_RECENT_DATA,4,2           ## @KEYP_RECENT_DATA
L_.str.1:                               ## @.str.1
	.asciz	"Error reading KEYP_RECENT_DATA, rc=%d\n"

	.comm	_USEC_PER_SEC,4,2               ## @USEC_PER_SEC
	.comm	_KEYP_CLOCK_FREQ,4,2            ## @KEYP_CLOCK_FREQ
	.comm	_KEYP_SCAN,4,2                  ## @KEYP_SCAN
L_.str.2:                               ## @.str.2
	.asciz	"Error reading KEYP_SCAN reg, rc=%d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Error writing KEYP_SCAN reg, rc=%d\n"

	.no_dead_strip	_pmic8xxx_kp_read_matrix
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pmic8xxx_kp_read_matrix
_pmic8xxx_kp_read_matrix:               ; @pmic8xxx_kp_read_matrix
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _PM8XXX_MIN_ROWS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PM8XXX_MIN_ROWS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	csel	w22, w8, w9, gt
	bl	_pmic8xxx_chk_sync_read
	cbz	x20, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _KEYP_OLD_DATA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _KEYP_OLD_DATA@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	x3, x22
	bl	_pmic8xxx_kp_read_data
	tbnz	w0, #31, LBB0_7
LBB0_2:
Lloh6:
	adrp	x8, _KEYP_RECENT_DATA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _KEYP_RECENT_DATA@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x21
	mov	x3, x22
	bl	_pmic8xxx_kp_read_data
	tbnz	w0, #31, LBB0_6
; %bb.3:
Lloh9:
	adrp	x8, _USEC_PER_SEC@GOTPAGE
Lloh10:
	ldr	x8, [x8, _USEC_PER_SEC@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x8, _KEYP_CLOCK_FREQ@GOTPAGE
Lloh13:
	ldr	x8, [x8, _KEYP_CLOCK_FREQ@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_DIV_ROUND_UP
	mov	w8, #1
	bfi	w8, w0, #2, #30
	mov	x0, x8
	bl	_udelay
	ldr	w0, [x19, #8]
Lloh15:
	adrp	x21, _KEYP_SCAN@GOTPAGE
Lloh16:
	ldr	x21, [x21, _KEYP_SCAN@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	bl	_regmap_read
	tbnz	w0, #31, LBB0_8
; %bb.4:
	ldr	w8, [sp, #12]
	and	w2, w8, #0xfe
	str	w2, [sp, #12]
	ldr	w0, [x19, #8]
	ldr	w1, [x21]
	bl	_regmap_write
	mov	x20, x0
	tbz	w0, #31, LBB0_10
; %bb.5:
	ldr	w0, [x19, #4]
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_9
LBB0_6:
	mov	x20, x0
	ldr	w0, [x19, #4]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_7:
	mov	x20, x0
	ldr	w0, [x19, #4]
Lloh21:
	adrp	x1, l_.str@PAGE
Lloh22:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_9
LBB0_8:
	mov	x20, x0
	ldr	w0, [x19, #4]
Lloh23:
	adrp	x1, l_.str.2@PAGE
Lloh24:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_9:
	mov	x2, x20
	bl	_dev_err
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_PM8XXX_MIN_ROWS,4,2            ; @PM8XXX_MIN_ROWS
	.comm	_KEYP_OLD_DATA,4,2              ; @KEYP_OLD_DATA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error reading KEYP_OLD_DATA, rc=%d\n"

	.comm	_KEYP_RECENT_DATA,4,2           ; @KEYP_RECENT_DATA
l_.str.1:                               ; @.str.1
	.asciz	"Error reading KEYP_RECENT_DATA, rc=%d\n"

	.comm	_USEC_PER_SEC,4,2               ; @USEC_PER_SEC
	.comm	_KEYP_CLOCK_FREQ,4,2            ; @KEYP_CLOCK_FREQ
	.comm	_KEYP_SCAN,4,2                  ; @KEYP_SCAN
l_.str.2:                               ; @.str.2
	.asciz	"Error reading KEYP_SCAN reg, rc=%d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Error writing KEYP_SCAN reg, rc=%d\n"

	.no_dead_strip	_pmic8xxx_kp_read_matrix
.subsections_via_symbols
