	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spitzkbd_hinge_timer
_spitzkbd_hinge_timer:                  ## @spitzkbd_hinge_timer
	.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
	pushq	%rax
	.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_SWA@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_GPLR
	movq	%rax, %r14
	movl	(%rbx), %edi
	callq	_GPIO_bit
	movq	%rax, %r12
	movq	_SPITZ_GPIO_SWB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_GPIO_bit
	movq	%rax, %rbx
	orq	%r12, %rbx
	andq	%r14, %rbx
	movq	_SPITZ_GPIO_AK_INT@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_GPLR
	movq	%rax, %r14
	movl	(%r12), %edi
	callq	_GPIO_bit
	andq	%r14, %rax
	orq	%rbx, %rax
	movq	_sharpsl_hinge_state@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movq	_hinge_count@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rax
	movq	_HINGE_STABLE_COUNT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	jge	LBB0_4
## %bb.3:
	incq	%rax
	movq	%rax, (%rdx)
LBB0_4:
	cmpq	%rcx, %rax
	jge	LBB0_5
LBB0_6:
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_HINGE_SCAN_INTERVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	addq	%rax, %rbx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mod_timer                      ## TAILCALL
LBB0_1:
	movq	_hinge_count@GOTPCREL(%rip), %rdx
	movq	$0, (%rdx)
	movq	%rax, (%rcx)
	movq	_HINGE_STABLE_COUNT@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	xorl	%eax, %eax
	cmpq	%rcx, %rax
	jl	LBB0_6
LBB0_5:
	leaq	4(%r15), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irqsave
	movl	8(%r15), %r12d
	movq	_SW_LID@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_SPITZ_GPIO_SWA@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_GPLR
	movq	%rax, %rbx
	movl	(%r14), %edi
	callq	_GPIO_bit
	xorl	%edx, %edx
	testq	%rbx, %rax
	setne	%dl
	movl	%r12d, %edi
	movl	%r13d, %esi
	callq	_input_report_switch
	movl	8(%r15), %r12d
	movq	_SW_TABLET_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_SPITZ_GPIO_SWB@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_GPLR
	movq	%rax, %rbx
	movl	(%r14), %edi
	callq	_GPIO_bit
	xorl	%edx, %edx
	testq	%rbx, %rax
	setne	%dl
	movl	%r12d, %edi
	movl	%r13d, %esi
	callq	_input_report_switch
	movl	8(%r15), %r12d
	movq	_SW_HEADPHONE_INSERT@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_SPITZ_GPIO_AK_INT@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_GPLR
	movq	%rax, %rbx
	movl	(%r14), %edi
	callq	_GPIO_bit
	xorl	%edx, %edx
	testq	%rbx, %rax
	setne	%dl
	movl	%r12d, %edi
	movl	%r13d, %esi
	callq	_input_report_switch
	movl	8(%r15), %edi
	callq	_input_sync
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	addq	$8, %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_SWA,4,2             ## @SPITZ_GPIO_SWA
	.comm	_SPITZ_GPIO_SWB,4,2             ## @SPITZ_GPIO_SWB
	.comm	_SPITZ_GPIO_AK_INT,4,2          ## @SPITZ_GPIO_AK_INT
	.comm	_sharpsl_hinge_state,8,3        ## @sharpsl_hinge_state
	.comm	_hinge_count,8,3                ## @hinge_count
	.comm	_HINGE_STABLE_COUNT,8,3         ## @HINGE_STABLE_COUNT
	.comm	_SW_LID,4,2                     ## @SW_LID
	.comm	_SW_TABLET_MODE,4,2             ## @SW_TABLET_MODE
	.comm	_SW_HEADPHONE_INSERT,4,2        ## @SW_HEADPHONE_INSERT
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_HINGE_SCAN_INTERVAL,4,2        ## @HINGE_SCAN_INTERVAL
	.no_dead_strip	_spitzkbd_hinge_timer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spitzkbd_hinge_timer
_spitzkbd_hinge_timer:                  ; @spitzkbd_hinge_timer
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
Lloh0:
	adrp	x26, _SPITZ_GPIO_SWA@GOTPAGE
Lloh1:
	ldr	x26, [x26, _SPITZ_GPIO_SWA@GOTPAGEOFF]
	ldr	w0, [x26]
	bl	_GPLR
	mov	x20, x0
	ldr	w0, [x26]
	bl	_GPIO_bit
	mov	x21, x0
Lloh2:
	adrp	x25, _SPITZ_GPIO_SWB@GOTPAGE
Lloh3:
	ldr	x25, [x25, _SPITZ_GPIO_SWB@GOTPAGEOFF]
	ldr	w0, [x25]
	bl	_GPIO_bit
	orr	x8, x0, x21
	and	x21, x8, x20
Lloh4:
	adrp	x24, _SPITZ_GPIO_AK_INT@GOTPAGE
Lloh5:
	ldr	x24, [x24, _SPITZ_GPIO_AK_INT@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_GPLR
	mov	x20, x0
	ldr	w0, [x24]
	bl	_GPIO_bit
	and	x8, x0, x20
	orr	x9, x8, x21
Lloh6:
	adrp	x10, _sharpsl_hinge_state@GOTPAGE
Lloh7:
	ldr	x10, [x10, _sharpsl_hinge_state@GOTPAGEOFF]
	ldr	x8, [x10]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.1:
Lloh8:
	adrp	x10, _hinge_count@GOTPAGE
Lloh9:
	ldr	x10, [x10, _hinge_count@GOTPAGEOFF]
	ldr	x8, [x10]
Lloh10:
	adrp	x9, _HINGE_STABLE_COUNT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _HINGE_STABLE_COUNT@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_3
; %bb.2:
	add	x8, x8, #1
	str	x8, [x10]
LBB0_3:
	cmp	x8, x9
	b.ge	LBB0_6
LBB0_4:
Lloh13:
	adrp	x8, _jiffies@GOTPAGE
Lloh14:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh15:
	ldr	x20, [x8]
Lloh16:
	adrp	x8, _HINGE_SCAN_INTERVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _HINGE_SCAN_INTERVAL@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	add	x1, x0, x20
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_mod_timer
LBB0_5:
	mov	x8, #0
Lloh19:
	adrp	x11, _hinge_count@GOTPAGE
Lloh20:
	ldr	x11, [x11, _hinge_count@GOTPAGEOFF]
Lloh21:
	str	xzr, [x11]
	str	x9, [x10]
Lloh22:
	adrp	x9, _HINGE_STABLE_COUNT@GOTPAGE
Lloh23:
	ldr	x9, [x9, _HINGE_STABLE_COUNT@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_4
LBB0_6:
	add	x20, x19, #4
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	w21, [x19, #8]
Lloh25:
	adrp	x8, _SW_LID@GOTPAGE
Lloh26:
	ldr	x8, [x8, _SW_LID@GOTPAGEOFF]
Lloh27:
	ldr	w22, [x8]
	ldr	w0, [x26]
	bl	_GPLR
	mov	x23, x0
	ldr	w0, [x26]
	bl	_GPIO_bit
	tst	x0, x23
	cset	w2, ne
	mov	x0, x21
	mov	x1, x22
	bl	_input_report_switch
	ldr	w21, [x19, #8]
Lloh28:
	adrp	x8, _SW_TABLET_MODE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _SW_TABLET_MODE@GOTPAGEOFF]
Lloh30:
	ldr	w22, [x8]
	ldr	w0, [x25]
	bl	_GPLR
	mov	x23, x0
	ldr	w0, [x25]
	bl	_GPIO_bit
	tst	x0, x23
	cset	w2, ne
	mov	x0, x21
	mov	x1, x22
	bl	_input_report_switch
	ldr	w21, [x19, #8]
Lloh31:
	adrp	x8, _SW_HEADPHONE_INSERT@GOTPAGE
Lloh32:
	ldr	x8, [x8, _SW_HEADPHONE_INSERT@GOTPAGEOFF]
Lloh33:
	ldr	w22, [x8]
	ldr	w0, [x24]
	bl	_GPLR
	mov	x23, x0
	ldr	w0, [x24]
	bl	_GPIO_bit
	tst	x0, x23
	cset	w2, ne
	mov	x0, x21
	mov	x1, x22
	bl	_input_report_switch
	ldr	w0, [x19, #8]
	bl	_input_sync
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotStr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_SPITZ_GPIO_SWA,4,2             ; @SPITZ_GPIO_SWA
	.comm	_SPITZ_GPIO_SWB,4,2             ; @SPITZ_GPIO_SWB
	.comm	_SPITZ_GPIO_AK_INT,4,2          ; @SPITZ_GPIO_AK_INT
	.comm	_sharpsl_hinge_state,8,3        ; @sharpsl_hinge_state
	.comm	_hinge_count,8,3                ; @hinge_count
	.comm	_HINGE_STABLE_COUNT,8,3         ; @HINGE_STABLE_COUNT
	.comm	_SW_LID,4,2                     ; @SW_LID
	.comm	_SW_TABLET_MODE,4,2             ; @SW_TABLET_MODE
	.comm	_SW_HEADPHONE_INSERT,4,2        ; @SW_HEADPHONE_INSERT
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_HINGE_SCAN_INTERVAL,4,2        ; @HINGE_SCAN_INTERVAL
	.no_dead_strip	_spitzkbd_hinge_timer
.subsections_via_symbols
