	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pmic8xxx_kp_scan_matrix
_pmic8xxx_kp_scan_matrix:               ## @pmic8xxx_kp_scan_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	%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
	movl	%esi, %r13d
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_PM8XXX_MAX_ROWS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	shlq	$2, %rbx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	cmpl	$3, %r13d
	je	LBB0_7
## %bb.1:
	cmpl	$2, %r13d
	je	LBB0_6
## %bb.2:
	cmpl	$1, %r13d
	jne	LBB0_9
## %bb.3:
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_pmic8xxx_kp_read_matrix
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_10
## %bb.4:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_pmic8xxx_detect_ghost_keys
	testl	%eax, %eax
	jne	LBB0_11
## %bb.5:
	movq	(%r15), %rdx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	___pmic8xxx_kp_scan_matrix
	movq	(%r15), %rdi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	(,%rax,4), %edx
	movq	%r14, %rsi
	callq	_memcpy
LBB0_10:
	movl	%r12d, %ebx
	jmp	LBB0_11
LBB0_6:
	movl	8(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
LBB0_7:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_pmic8xxx_kp_read_matrix
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_11
## %bb.8:
	movq	(%r15), %rdx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	___pmic8xxx_kp_scan_matrix
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	___pmic8xxx_kp_scan_matrix
	movq	(%r15), %rdi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	(,%rax,4), %edx
	movq	%r14, %rsi
	callq	_memcpy
	jmp	LBB0_11
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PM8XXX_MAX_ROWS,4,2            ## @PM8XXX_MAX_ROWS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Some key events were lost\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_pmic8xxx_kp_scan_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_scan_matrix
_pmic8xxx_kp_scan_matrix:               ; @pmic8xxx_kp_scan_matrix
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, _PM8XXX_MAX_ROWS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PM8XXX_MAX_ROWS@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
	lsl	x8, x23, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x10, x8, #15
	and	x12, x10, #0x7fffffff0
	sub	x20, x9, x12
	mov	sp, x20
	mov	x9, x8
Lloh8:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh9:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	sub	x22, x8, x12
	mov	sp, x22
	cmp	w1, #3
	b.eq	LBB0_7
; %bb.1:
	cmp	w1, #2
	b.eq	LBB0_6
; %bb.2:
	cmp	w1, #1
	b.ne	LBB0_10
; %bb.3:
	mov	x0, x19
	mov	x1, x20
	mov	x2, #0
	bl	_pmic8xxx_kp_read_matrix
	mov	x21, x0
	tbnz	w0, #31, LBB0_11
; %bb.4:
	mov	x0, x19
	mov	x1, x20
	bl	_pmic8xxx_detect_ghost_keys
	cbz	w0, LBB0_13
; %bb.5:
	mov	w21, #0
	b	LBB0_11
LBB0_6:
	ldr	w0, [x19, #8]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
LBB0_7:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_pmic8xxx_kp_read_matrix
	mov	x21, x0
	tbnz	w0, #31, LBB0_11
; %bb.8:
	ldr	x2, [x19]
	mov	x0, x19
	mov	x1, x22
	bl	___pmic8xxx_kp_scan_matrix
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
LBB0_9:
	bl	___pmic8xxx_kp_scan_matrix
	ldr	x0, [x19]
	lsl	w2, w23, #2
	mov	x1, x20
	bl	_memcpy
	b	LBB0_11
LBB0_10:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_11:
	ldur	x8, [x29, #-56]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.12:
	mov	x0, x21
	sub	sp, x29, #48
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_13:
	ldr	x2, [x19]
	mov	x0, x19
	mov	x1, x20
	b	LBB0_9
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_PM8XXX_MAX_ROWS,4,2            ; @PM8XXX_MAX_ROWS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Some key events were lost\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_pmic8xxx_kp_scan_matrix
.subsections_via_symbols
