	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spitzkbd_scankeyboard
_spitzkbd_scankeyboard:                 ## @spitzkbd_scankeyboard
	.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
	movq	%rdi, %r15
	movq	_SPITZ_GPIO_ON_KEY@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_GPLR
	movl	%eax, %ebx
	movl	(%r14), %edi
	callq	_GPIO_bit
	xorl	%edx, %edx
	andl	%ebx, %eax
	setne	%cl
	cmpq	$0, 32(%r15)
	je	LBB0_1
## %bb.14:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%r15, %rbx
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movb	%cl, %dl
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	_KB_COLS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.3:
	movq	_KB_ROWS@GOTPCREL(%rip), %r14
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	%r13d, %edi
	callq	_spitzkbd_reset_col
	incl	%r13d
	movq	_KB_COLS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jae	LBB0_8
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	xorl	%eax, %eax
	callq	_spitzkbd_discharge_all
	movq	_KB_DISCHARGE_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_udelay
	movl	%r13d, %edi
	callq	_spitzkbd_activate_col
	movq	_KB_ACTIVATE_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_udelay
	movl	%r13d, %edi
	callq	_spitzkbd_get_row_status
	cmpl	$0, (%r14)
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%r15d, %r15d
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r12d, -64(%rbp)                ## 4-byte Spill
	movl	%r15d, %edi
	movl	%r13d, %esi
	callq	_SCANCODE
	movl	%r13d, %r12d
	movq	%r14, %r13
	movl	%eax, %r14d
	movl	%r15d, %edi
	callq	_KB_ROWMASK
	movl	8(%rbx), %edi
	movq	24(%rbx), %rcx
	movl	%r14d, %edx
	movq	%r13, %r14
	movl	%r12d, %r13d
	movl	-64(%rbp), %r12d                ## 4-byte Reload
	movl	(%rcx,%rdx,4), %esi
	xorl	%ebx, %ebx
	andl	-60(%rbp), %eax                 ## 4-byte Folded Reload
	setne	%bl
	movl	%eax, %edx
	callq	_input_report_key
	addl	%ebx, %r12d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	incl	%r15d
	cmpl	(%r14), %r15d
	jb	LBB0_6
	jmp	LBB0_7
LBB0_2:
	xorl	%r12d, %r12d
LBB0_8:
	xorl	%eax, %eax
	callq	_spitzkbd_activate_all
	movl	8(%rbx), %r14d
	movq	_SPITZ_KEY_SYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_SPITZ_GPIO_SYNC@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_GPLR
	movl	%eax, %ebx
	movl	(%r13), %edi
	callq	_GPIO_bit
	xorl	%edx, %edx
	testl	%ebx, %eax
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	setne	%dl
	movl	%r14d, %edi
	movl	%r15d, %esi
	callq	_input_report_key
	movl	8(%rbx), %edi
	movq	_KEY_SUSPEND@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_input_report_key
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_11
## %bb.9:
	movq	_jiffies@GOTPCREL(%rip), %r13
	movq	(%r13), %r14
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax), %rbx
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msecs_to_jiffies
	addq	%rax, %rbx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	callq	_time_after
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movl	8(%rbx), %edi
	movq	_EV_PWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	movl	$1, %ecx
	callq	_input_event
	movq	(%r13), %rax
	movq	%rax, 16(%rbx)
LBB0_11:
	movl	8(%rbx), %edi
	callq	_input_sync
	testl	%r12d, %r12d
	je	LBB0_13
## %bb.12:
	leaq	4(%rbx), %r14
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_SCAN_INTERVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	addq	%rax, %rbx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	callq	_mod_timer
LBB0_13:
	movq	%rbx, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SPITZ_GPIO_ON_KEY,4,2          ## @SPITZ_GPIO_ON_KEY
	.comm	_KB_COLS,4,2                    ## @KB_COLS
	.comm	_KB_DISCHARGE_DELAY,4,2         ## @KB_DISCHARGE_DELAY
	.comm	_KB_ACTIVATE_DELAY,4,2          ## @KB_ACTIVATE_DELAY
	.comm	_KB_ROWS,4,2                    ## @KB_ROWS
	.comm	_SPITZ_KEY_SYNC,4,2             ## @SPITZ_KEY_SYNC
	.comm	_SPITZ_GPIO_SYNC,4,2            ## @SPITZ_GPIO_SYNC
	.comm	_KEY_SUSPEND,4,2                ## @KEY_SUSPEND
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_EV_PWR,4,2                     ## @EV_PWR
	.comm	_SCAN_INTERVAL,4,2              ## @SCAN_INTERVAL
	.no_dead_strip	_spitzkbd_scankeyboard
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spitzkbd_scankeyboard
_spitzkbd_scankeyboard:                 ; @spitzkbd_scankeyboard
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x0
Lloh0:
	adrp	x21, _SPITZ_GPIO_ON_KEY@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SPITZ_GPIO_ON_KEY@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_GPLR
	mov	x20, x0
	ldr	w0, [x21]
	bl	_GPIO_bit
	ands	w9, w0, w20
	cset	w10, ne
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_2:
	stp	w10, w9, [sp, #8]               ; 8-byte Folded Spill
	mov	x0, x19
	bl	_spin_lock_irqsave
Lloh2:
	adrp	x27, _KB_COLS@GOTPAGE
Lloh3:
	ldr	x27, [x27, _KB_COLS@GOTPAGEOFF]
	ldr	w8, [x27]
	cbz	w8, LBB0_8
; %bb.3:
	mov	w21, #0
	mov	w25, #0
Lloh4:
	adrp	x28, _KB_DISCHARGE_DELAY@GOTPAGE
Lloh5:
	ldr	x28, [x28, _KB_DISCHARGE_DELAY@GOTPAGEOFF]
Lloh6:
	adrp	x26, _KB_ACTIVATE_DELAY@GOTPAGE
Lloh7:
	ldr	x26, [x26, _KB_ACTIVATE_DELAY@GOTPAGEOFF]
Lloh8:
	adrp	x20, _KB_ROWS@GOTPAGE
Lloh9:
	ldr	x20, [x20, _KB_ROWS@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	bl	_spitzkbd_reset_col
	add	w21, w21, #1
	ldr	w8, [x27]
	cmp	w21, w8
	b.hs	LBB0_9
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	bl	_spitzkbd_discharge_all
	ldr	w0, [x28]
	bl	_udelay
	mov	x0, x21
	bl	_spitzkbd_activate_col
	ldr	w0, [x26]
	bl	_udelay
	mov	x0, x21
	bl	_spitzkbd_get_row_status
	ldr	w8, [x20]
	cbz	w8, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x22, x0
	mov	w23, #0
LBB0_7:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x23
	mov	x1, x21
	bl	_SCANCODE
	mov	x24, x0
	mov	x0, x23
	bl	_KB_ROWMASK
	ldr	w8, [x19, #8]
	ldr	x9, [x19, #24]
	ldr	w1, [x9, w24, uxtw #2]
	ands	w2, w0, w22
	cinc	w25, w25, ne
	mov	x0, x8
	bl	_input_report_key
	add	w23, w23, #1
	ldr	w8, [x20]
	cmp	w23, w8
	b.lo	LBB0_7
	b	LBB0_4
LBB0_8:
	mov	w25, #0
LBB0_9:
	bl	_spitzkbd_activate_all
	ldr	w21, [x19, #8]
Lloh10:
	adrp	x8, _SPITZ_KEY_SYNC@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SPITZ_KEY_SYNC@GOTPAGEOFF]
Lloh12:
	ldr	w22, [x8]
Lloh13:
	adrp	x20, _SPITZ_GPIO_SYNC@GOTPAGE
Lloh14:
	ldr	x20, [x20, _SPITZ_GPIO_SYNC@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_GPLR
	mov	x23, x0
	ldr	w0, [x20]
	bl	_GPIO_bit
	tst	w0, w23
	cset	w2, ne
	mov	x0, x21
	mov	x1, x22
	bl	_input_report_key
	ldr	w0, [x19, #8]
Lloh15:
	adrp	x22, _KEY_SUSPEND@GOTPAGE
Lloh16:
	ldr	x22, [x22, _KEY_SUSPEND@GOTPAGEOFF]
	ldr	w1, [x22]
	ldr	w2, [sp, #8]                    ; 4-byte Folded Reload
	bl	_input_report_key
Lloh17:
	adrp	x21, _jiffies@GOTPAGE
Lloh18:
	ldr	x21, [x21, _jiffies@GOTPAGEOFF]
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_12
; %bb.10:
	ldr	x20, [x21]
	ldr	x23, [x19, #16]
	mov	w0, #1000
	bl	_msecs_to_jiffies
	add	x1, x0, x23
	mov	x0, x20
	bl	_time_after
	cbz	x0, LBB0_12
; %bb.11:
	ldr	w0, [x19, #8]
Lloh19:
	adrp	x8, _EV_PWR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EV_PWR@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	ldr	w2, [x22]
	mov	w3, #1
	bl	_input_event
	ldr	x8, [x21]
	str	x8, [x19, #16]
LBB0_12:
	ldr	w0, [x19, #8]
	bl	_input_sync
	cbz	w25, LBB0_14
; %bb.13:
	add	x20, x19, #4
	ldr	x21, [x21]
Lloh22:
	adrp	x8, _SCAN_INTERVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SCAN_INTERVAL@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	add	x1, x0, x21
	mov	x0, x20
	bl	_mod_timer
LBB0_14:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_SPITZ_GPIO_ON_KEY,4,2          ; @SPITZ_GPIO_ON_KEY
	.comm	_KB_COLS,4,2                    ; @KB_COLS
	.comm	_KB_DISCHARGE_DELAY,4,2         ; @KB_DISCHARGE_DELAY
	.comm	_KB_ACTIVATE_DELAY,4,2          ; @KB_ACTIVATE_DELAY
	.comm	_KB_ROWS,4,2                    ; @KB_ROWS
	.comm	_SPITZ_KEY_SYNC,4,2             ; @SPITZ_KEY_SYNC
	.comm	_SPITZ_GPIO_SYNC,4,2            ; @SPITZ_GPIO_SYNC
	.comm	_KEY_SUSPEND,4,2                ; @KEY_SUSPEND
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_EV_PWR,4,2                     ; @EV_PWR
	.comm	_SCAN_INTERVAL,4,2              ; @SCAN_INTERVAL
	.no_dead_strip	_spitzkbd_scankeyboard
.subsections_via_symbols
