	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pxa27x_keypad_scan_matrix
_pxa27x_keypad_scan_matrix:             ## @pxa27x_keypad_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	24(%rdi), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	32(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_MAX_MATRIX_KEY_COLS@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%r14, %rax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	movq	_KPAS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_keypad_readl
	movl	%eax, %r12d
	movl	%eax, %edi
	callq	_KPAS_MUKP
	movl	%eax, %ebx
	leal	(,%r14,4), %edx
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	%edx, -68(%rbp)                 ## 4-byte Spill
	callq	_memset
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.1:
	cmpl	$1, %ebx
	jne	LBB0_5
## %bb.2:
	movl	%r12d, %edi
	callq	_KPAS_CP
	movl	%eax, %r15d
	movl	%r12d, %edi
	callq	_KPAS_RP
	movl	%eax, %ecx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpl	(%rax), %r15d
	jge	LBB0_8
## %bb.3:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpl	4(%rax), %ecx
	jge	LBB0_8
## %bb.4:
	movl	$1, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movslq	%r15d, %rcx
	jmp	LBB0_7
LBB0_5:
	jle	LBB0_8
## %bb.6:
	movq	_KPASMKP0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_keypad_readl
	movl	%eax, %r15d
	movq	_KPASMKP1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_keypad_readl
	movl	%eax, %r12d
	movq	_KPASMKP2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_keypad_readl
	movl	%eax, %ebx
	movq	_KPASMKP3@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_keypad_readl
	movq	_KPASMKP_MKC_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movd	%ecx, %xmm0
	movd	%r15d, %xmm1
	sarl	$16, %r15d
	pinsrd	$1, %r15d, %xmm1
	pinsrd	$2, %r12d, %xmm1
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	sarl	$16, %r12d
	pinsrd	$3, %r12d, %xmm1
	pand	%xmm0, %xmm1
	movdqa	%xmm1, (%r13)
	movl	%ecx, %edx
	andl	%ebx, %edx
	movl	%edx, 16(%r13)
	sarl	$16, %ebx
	andl	%ecx, %ebx
	movl	%ebx, 20(%r13)
	movl	%ecx, %edx
	andl	%eax, %edx
	movl	%edx, 24(%r13)
	sarl	$16, %eax
	andl	%ecx, %eax
	movl	$7, %ecx
LBB0_7:
	movl	%eax, (%r13,%rcx,4)
LBB0_8:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_18
## %bb.9:
	xorl	%r14d, %r14d
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
LBB0_17:                                ##   in Loop: Header=BB0_10 Depth=1
	incq	%r14
	movslq	%eax, %rcx
	cmpq	%rcx, %r14
	jge	LBB0_18
LBB0_10:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_13 Depth 2
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movl	(%r13,%r14,4), %edx
	xorl	(%rcx,%r14,4), %edx
	movl	%edx, -72(%rbp)                 ## 4-byte Spill
	je	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	4(%rcx), %edx
	testl	%edx, %edx
	jle	LBB0_17
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	xorl	%r12d, %r12d
	movq	%r14, -96(%rbp)                 ## 8-byte Spill
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=2
	incl	%r12d
	cmpl	%edx, %r12d
	jge	LBB0_16
LBB0_13:                                ##   Parent Loop BB0_10 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	$1, %r15d
	movl	%r12d, %ecx
	shll	%cl, %r15d
	movl	-72(%rbp), %eax                 ## 4-byte Reload
	btl	%r12d, %eax
	jae	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=2
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movl	16(%r13), %edx
	movl	%r12d, %edi
	movl	%r14d, %esi
	callq	_MATRIX_SCAN_CODE
	movl	%eax, %r14d
	movq	_EV_MSC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MSC_SCAN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r14d, %ecx
	callq	_input_event
	movq	8(%r13), %rax
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	movslq	%r14d, %rcx
	movq	-96(%rbp), %r14                 ## 8-byte Reload
	movl	(%rax,%rcx,4), %esi
	andl	(%r13,%r14,4), %r15d
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_input_report_key
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %edx
	jmp	LBB0_15
LBB0_18:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_input_sync
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	movq	%r13, %rsi
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	callq	_memcpy
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_20
## %bb.19:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_MATRIX_KEY_COLS,4,2        ## @MAX_MATRIX_KEY_COLS
	.comm	_KPAS,4,2                       ## @KPAS
	.comm	_KPASMKP0,4,2                   ## @KPASMKP0
	.comm	_KPASMKP1,4,2                   ## @KPASMKP1
	.comm	_KPASMKP2,4,2                   ## @KPASMKP2
	.comm	_KPASMKP3,4,2                   ## @KPASMKP3
	.comm	_KPASMKP_MKC_MASK,4,2           ## @KPASMKP_MKC_MASK
	.comm	_EV_MSC,4,2                     ## @EV_MSC
	.comm	_MSC_SCAN,4,2                   ## @MSC_SCAN
	.no_dead_strip	_pxa27x_keypad_scan_matrix
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pxa27x_keypad_scan_matrix
_pxa27x_keypad_scan_matrix:             ; @pxa27x_keypad_scan_matrix
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	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, #-88]
	ldp	x20, x26, [x0, #24]
Lloh3:
	adrp	x8, _MAX_MATRIX_KEY_COLS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_MATRIX_KEY_COLS@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	lsl	x8, x22, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
Lloh8:
	adrp	x8, _KPAS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _KPAS@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_keypad_readl
	mov	x23, x0
	bl	_KPAS_MUKP
	mov	x24, x0
	lsl	w2, w22, #2
	mov	x0, x21
	mov	w1, #0
	stur	w2, [x29, #-92]                 ; 4-byte Folded Spill
	bl	_memset
	cbz	w24, LBB0_8
; %bb.1:
	cmp	w24, #1
	b.ne	LBB0_5
; %bb.2:
	mov	x0, x23
	bl	_KPAS_CP
	mov	x24, x0
	mov	x0, x23
	bl	_KPAS_RP
	ldr	w8, [x26]
	cmp	w24, w8
	b.ge	LBB0_8
; %bb.3:
	ldr	w8, [x26, #4]
	cmp	w0, w8
	b.ge	LBB0_8
; %bb.4:
	mov	w8, #1
	lsl	w8, w8, w0
	sxtw	x9, w24
	b	LBB0_7
LBB0_5:
	b.le	LBB0_8
; %bb.6:
Lloh11:
	adrp	x8, _KPASMKP0@GOTPAGE
Lloh12:
	ldr	x8, [x8, _KPASMKP0@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_keypad_readl
	mov	x23, x0
Lloh14:
	adrp	x8, _KPASMKP1@GOTPAGE
Lloh15:
	ldr	x8, [x8, _KPASMKP1@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_keypad_readl
	mov	x24, x0
Lloh17:
	adrp	x8, _KPASMKP2@GOTPAGE
Lloh18:
	ldr	x8, [x8, _KPASMKP2@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_keypad_readl
	mov	x25, x0
Lloh20:
	adrp	x8, _KPASMKP3@GOTPAGE
Lloh21:
	ldr	x8, [x8, _KPASMKP3@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	bl	_keypad_readl
Lloh23:
	adrp	x8, _KPASMKP_MKC_MASK@GOTPAGE
Lloh24:
	ldr	x8, [x8, _KPASMKP_MKC_MASK@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	and	w9, w8, w23
	and	w10, w8, w23, asr #16
	stp	w9, w10, [x21]
	and	w9, w8, w24
	and	w10, w8, w24, asr #16
	stp	w9, w10, [x21, #8]
	and	w9, w8, w25
	and	w10, w8, w25, asr #16
	stp	w9, w10, [x21, #16]
	and	w9, w8, w0
	str	w9, [x21, #24]
	and	w8, w8, w0, asr #16
	mov	w9, #7
LBB0_7:
	str	w8, [x21, x9, lsl #2]
LBB0_8:
	ldr	w8, [x26]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.9:
	mov	x23, #0
	mov	w27, #1
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x26]
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x23, x23, #1
	cmp	x23, w8, sxtw
	b.ge	LBB0_18
LBB0_12:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_16 Depth 2
	ldr	x9, [x19]
	lsl	x10, x23, #2
	ldr	w9, [x9, x10]
	ldr	w10, [x21, x10]
	eor	w28, w10, w9
	cbz	w28, LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w9, [x26, #4]
	cmp	w9, #1
	b.lt	LBB0_11
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	w24, #0
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=2
	add	w24, w24, #1
	cmp	w24, w9
	b.ge	LBB0_10
LBB0_16:                                ;   Parent Loop BB0_12 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	w22, w27, w24
	tst	w22, w28
	b.eq	LBB0_15
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=2
	ldr	w2, [x19, #16]
	mov	x0, x24
	mov	x1, x23
	bl	_MATRIX_SCAN_CODE
	mov	x25, x0
Lloh26:
	adrp	x8, _EV_MSC@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EV_MSC@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
Lloh29:
	adrp	x8, _MSC_SCAN@GOTPAGE
Lloh30:
	ldr	x8, [x8, _MSC_SCAN@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x3, x25
	bl	_input_event
	ldr	x8, [x19, #8]
	ldr	w1, [x8, w25, sxtw #2]
	ldr	w8, [x21, x23, lsl #2]
	and	w2, w8, w22
	mov	x0, x20
	bl	_input_report_key
	ldr	w9, [x26, #4]
	b	LBB0_15
LBB0_18:
	mov	x0, x20
	bl	_input_sync
	ldr	x0, [x19]
	mov	x1, x21
	ldur	w2, [x29, #-92]                 ; 4-byte Folded Reload
	bl	_memcpy
	ldur	x8, [x29, #-88]
Lloh32:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh33:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_20
; %bb.19:
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_20:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_MATRIX_KEY_COLS,4,2        ; @MAX_MATRIX_KEY_COLS
	.comm	_KPAS,4,2                       ; @KPAS
	.comm	_KPASMKP0,4,2                   ; @KPASMKP0
	.comm	_KPASMKP1,4,2                   ; @KPASMKP1
	.comm	_KPASMKP2,4,2                   ; @KPASMKP2
	.comm	_KPASMKP3,4,2                   ; @KPASMKP3
	.comm	_KPASMKP_MKC_MASK,4,2           ; @KPASMKP_MKC_MASK
	.comm	_EV_MSC,4,2                     ; @EV_MSC
	.comm	_MSC_SCAN,4,2                   ; @MSC_SCAN
	.no_dead_strip	_pxa27x_keypad_scan_matrix
.subsections_via_symbols
