	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function clps711x_keypad_poll
_clps711x_keypad_poll:                  ## @clps711x_keypad_poll
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_CLPS711X_KEYPAD_COL_COUNT@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_15
## %bb.1:
	movq	(%rdi), %rax
	movq	(%rax), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %r14
	movq	_SYSCON_OFFSET@GOTPCREL(%rip), %rbx
	movq	_SYSCON1_KBDSCAN_MASK@GOTPCREL(%rip), %rcx
	xorl	%r13d, %r13d
	xorl	%edx, %edx
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%r14), %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movq	_SYSCON_OFFSET@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r12d
	movq	_SYSCON1_KBDSCAN_MASK@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	$1, %edi
	callq	_SYSCON1_KBDSCAN
	movl	-64(%rbp), %edi                 ## 4-byte Reload
	movl	%r12d, %esi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	movl	%eax, %ecx
	callq	_regmap_update_bits
	movq	%r15, %rcx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	incl	%edx
	movq	_CLPS711X_KEYPAD_COL_COUNT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	jge	LBB0_14
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
                                        ##       Child Loop BB0_5 Depth 3
	movl	4(%r14), %r15d
	movl	(%rbx), %r12d
	movl	(%rcx), %ebx
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	leal	8(%rdx), %edi
	callq	_SYSCON1_KBDSCAN
	movl	%r15d, %edi
	movl	%r12d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_regmap_update_bits
	cmpl	$0, (%r14)
	jle	LBB0_13
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r12d, %r12d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=2
	incq	%r12
	movslq	(%r14), %rax
	cmpq	%rax, %r12
	jge	LBB0_13
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_5 Depth 3
	movq	16(%r14), %r15
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_4 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movl	4(%r15,%r12,8), %edi
	callq	_gpiod_get_value_cansleep
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_cond_resched
	movl	4(%r15,%r12,8), %edi
	callq	_gpiod_get_value_cansleep
	cmpl	%eax, %ebx
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	(%r15,%r12,8), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_test_bit
	cmpl	%ebx, %eax
	je	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	8(%r14), %edx
	movl	%r12d, %edi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	%r14d, %esi
	callq	_MATRIX_SCAN_CODE
	movl	%eax, %r13d
	movl	(%r15,%r12,8), %esi
	movl	%r14d, %edi
	testl	%ebx, %ebx
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=2
	callq	_set_bit
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	(%r15), %rdi
	movq	_EV_MSC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MSC_SCAN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r13d, %ecx
	callq	_input_event
	jmp	LBB0_10
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=2
	callq	_clear_bit
	movq	-48(%rbp), %r15                 ## 8-byte Reload
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=2
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movslq	%r13d, %rax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movzwl	(%rcx,%rax,2), %eax
	movl	$1, %r13d
	testw	%ax, %ax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=2
	movq	(%r15), %rdi
	movzwl	%ax, %esi
	movl	%ebx, %edx
	callq	_input_report_key
	jmp	LBB0_12
LBB0_14:
	testl	%r13d, %r13d
	je	LBB0_15
## %bb.16:
	movq	(%rax), %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_input_sync                     ## TAILCALL
LBB0_15:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CLPS711X_KEYPAD_COL_COUNT,4,2  ## @CLPS711X_KEYPAD_COL_COUNT
	.comm	_SYSCON_OFFSET,4,2              ## @SYSCON_OFFSET
	.comm	_SYSCON1_KBDSCAN_MASK,4,2       ## @SYSCON1_KBDSCAN_MASK
	.comm	_EV_MSC,4,2                     ## @EV_MSC
	.comm	_MSC_SCAN,4,2                   ## @MSC_SCAN
	.no_dead_strip	_clps711x_keypad_poll
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function clps711x_keypad_poll
_clps711x_keypad_poll:                  ; @clps711x_keypad_poll
	.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
Lloh0:
	adrp	x8, _CLPS711X_KEYPAD_COL_COUNT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CLPS711X_KEYPAD_COL_COUNT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.1:
	mov	x19, x0
	mov	w28, #0
	mov	w20, #0
	ldp	x8, x25, [x0]
	ldr	x26, [x8]
Lloh3:
	adrp	x24, _SYSCON_OFFSET@GOTPAGE
Lloh4:
	ldr	x24, [x24, _SYSCON_OFFSET@GOTPAGEOFF]
Lloh5:
	adrp	x8, _SYSCON1_KBDSCAN_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SYSCON1_KBDSCAN_MASK@GOTPAGEOFF]
Lloh7:
	adrp	x27, _EV_MSC@GOTPAGE
Lloh8:
	ldr	x27, [x27, _EV_MSC@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w21, [x25, #4]
Lloh9:
	adrp	x24, _SYSCON_OFFSET@GOTPAGE
Lloh10:
	ldr	x24, [x24, _SYSCON_OFFSET@GOTPAGEOFF]
	ldr	w22, [x24]
Lloh11:
	adrp	x27, _SYSCON1_KBDSCAN_MASK@GOTPAGE
Lloh12:
	ldr	x27, [x27, _SYSCON1_KBDSCAN_MASK@GOTPAGEOFF]
	ldr	w23, [x27]
	mov	w0, #1
	bl	_SYSCON1_KBDSCAN
	mov	x3, x0
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	bl	_regmap_update_bits
	add	w20, w20, #1
Lloh13:
	adrp	x8, _CLPS711X_KEYPAD_COL_COUNT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CLPS711X_KEYPAD_COL_COUNT@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	w20, w8
	mov	x8, x27
Lloh16:
	adrp	x27, _EV_MSC@GOTPAGE
Lloh17:
	ldr	x27, [x27, _EV_MSC@GOTPAGEOFF]
	b.ge	LBB0_14
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;       Child Loop BB0_8 Depth 3
	ldr	w21, [x25, #4]
	ldr	w22, [x24]
	add	w0, w20, #8
	ldr	w23, [x8]
	bl	_SYSCON1_KBDSCAN
	mov	x3, x0
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	bl	_regmap_update_bits
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x21, #0
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=2
	mov	w28, #1
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	add	x21, x21, #1
	ldrsw	x8, [x25]
	cmp	x21, x8
	b.ge	LBB0_2
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_8 Depth 3
	ldr	x23, [x25, #16]
	add	x8, x23, x21, lsl #3
	add	x24, x8, #4
LBB0_8:                                 ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_7 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	w0, [x24]
	bl	_gpiod_get_value_cansleep
	mov	x22, x0
	bl	_cond_resched
	ldr	w0, [x24]
	bl	_gpiod_get_value_cansleep
	cmp	w22, w0
	b.ne	LBB0_8
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=2
	add	x24, x23, x21, lsl #3
	ldr	w1, [x24]
	mov	x0, x20
	bl	_test_bit
	cmp	w0, w22
	b.eq	LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=2
	ldr	w2, [x25, #8]
	mov	x0, x21
	mov	x1, x20
	bl	_MATRIX_SCAN_CODE
	mov	x23, x0
	ldr	w1, [x24]
	mov	x0, x20
	cbz	w22, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=2
	bl	_set_bit
	ldr	x0, [x19]
	ldr	w1, [x27]
Lloh18:
	adrp	x8, _MSC_SCAN@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MSC_SCAN@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	mov	x3, x23
	bl	_input_event
	ldrh	w1, [x26, w23, sxtw #1]
	cbnz	w1, LBB0_13
	b	LBB0_5
LBB0_12:                                ;   in Loop: Header=BB0_7 Depth=2
	bl	_clear_bit
	ldrh	w1, [x26, w23, sxtw #1]
	cbz	w1, LBB0_5
LBB0_13:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	x0, [x19]
	mov	x2, x22
	bl	_input_report_key
	b	LBB0_5
LBB0_14:
	cbz	w28, LBB0_16
; %bb.15:
	ldr	x0, [x19]
	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
	b	_input_sync
LBB0_16:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_CLPS711X_KEYPAD_COL_COUNT,4,2  ; @CLPS711X_KEYPAD_COL_COUNT
	.comm	_SYSCON_OFFSET,4,2              ; @SYSCON_OFFSET
	.comm	_SYSCON1_KBDSCAN_MASK,4,2       ; @SYSCON1_KBDSCAN_MASK
	.comm	_EV_MSC,4,2                     ; @EV_MSC
	.comm	_MSC_SCAN,4,2                   ; @MSC_SCAN
	.no_dead_strip	_clps711x_keypad_poll
.subsections_via_symbols
