	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function corgikbd_hinge_timer
_corgikbd_hinge_timer:                  ## @corgikbd_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, %r13
	movq	_SCOOP_GPRR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_corgiscoop_device@GOTPCREL(%rip), %rdi
	callq	_read_scoop_reg
	movq	_CORGI_SCP_SWA@GOTPCREL(%rip), %r12
	movq	_CORGI_SCP_SWB@GOTPCREL(%rip), %r15
	movq	(%r15), %rbx
	orq	(%r12), %rbx
	andq	%rax, %rbx
	movq	_CORGI_GPIO_AK_INT@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_READ_GPIO_BIT
	xorl	%ecx, %ecx
	testq	%rax, %rax
	setne	%cl
	orq	%rbx, %rcx
	movq	_sharpsl_hinge_state@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rcx
	jne	LBB0_1
## %bb.2:
	movq	_hinge_count@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	_HINGE_STABLE_COUNT@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	cmpq	%rdx, %rcx
	jge	LBB0_5
## %bb.3:
	incq	%rcx
	movq	%rcx, (%rax)
	cmpq	%rdx, %rcx
	jl	LBB0_5
## %bb.4:
	leaq	4(%r13), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irqsave
	movl	8(%r13), %edi
	movq	_SW_LID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r12), %rax
	xorl	%edx, %edx
	andq	(%rbx), %rax
	setne	%dl
	callq	_input_report_switch
	movl	8(%r13), %edi
	movq	_SW_TABLET_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r15), %rax
	xorl	%edx, %edx
	andq	(%rbx), %rax
	setne	%dl
	callq	_input_report_switch
	movl	8(%r13), %r15d
	movq	_SW_HEADPHONE_INSERT@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	(%r14), %edi
	callq	_READ_GPIO_BIT
	xorl	%edx, %edx
	testq	%rax, %rax
	setne	%dl
	movl	%r15d, %edi
	movl	%r12d, %esi
	callq	_input_report_switch
	movl	8(%r13), %edi
	callq	_input_sync
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	jmp	LBB0_5
LBB0_1:
	movq	_hinge_count@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	%rcx, (%rbx)
LBB0_5:
	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	%r13, %rdi
	movq	%rbx, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mod_timer                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_corgiscoop_device,4,2          ## @corgiscoop_device
	.comm	_SCOOP_GPRR,4,2                 ## @SCOOP_GPRR
	.comm	_CORGI_SCP_SWA,8,3              ## @CORGI_SCP_SWA
	.comm	_CORGI_SCP_SWB,8,3              ## @CORGI_SCP_SWB
	.comm	_CORGI_GPIO_AK_INT,4,2          ## @CORGI_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	_corgikbd_hinge_timer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function corgikbd_hinge_timer
_corgikbd_hinge_timer:                  ; @corgikbd_hinge_timer
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _SCOOP_GPRR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SCOOP_GPRR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x0, _corgiscoop_device@GOTPAGE
Lloh4:
	ldr	x0, [x0, _corgiscoop_device@GOTPAGEOFF]
	bl	_read_scoop_reg
Lloh5:
	adrp	x24, _CORGI_SCP_SWA@GOTPAGE
Lloh6:
	ldr	x24, [x24, _CORGI_SCP_SWA@GOTPAGEOFF]
	ldr	x8, [x24]
Lloh7:
	adrp	x21, _CORGI_SCP_SWB@GOTPAGE
Lloh8:
	ldr	x21, [x21, _CORGI_SCP_SWB@GOTPAGEOFF]
	ldr	x9, [x21]
	orr	x8, x9, x8
	and	x20, x8, x0
Lloh9:
	adrp	x23, _CORGI_GPIO_AK_INT@GOTPAGE
Lloh10:
	ldr	x23, [x23, _CORGI_GPIO_AK_INT@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_READ_GPIO_BIT
	cmp	x0, #0
	cset	w8, ne
	orr	x8, x20, x8
Lloh11:
	adrp	x22, _sharpsl_hinge_state@GOTPAGE
Lloh12:
	ldr	x22, [x22, _sharpsl_hinge_state@GOTPAGEOFF]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.1:
Lloh13:
	adrp	x8, _hinge_count@GOTPAGE
Lloh14:
	ldr	x8, [x8, _hinge_count@GOTPAGEOFF]
	ldr	x9, [x8]
Lloh15:
	adrp	x10, _HINGE_STABLE_COUNT@GOTPAGE
Lloh16:
	ldr	x10, [x10, _HINGE_STABLE_COUNT@GOTPAGEOFF]
Lloh17:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ge	LBB0_5
; %bb.2:
	add	x9, x9, #1
	str	x9, [x8]
	cmp	x9, x10
	b.lt	LBB0_5
; %bb.3:
	add	x20, x19, #4
	mov	x0, x20
	bl	_spin_lock_irqsave
Lloh18:
	adrp	x8, _SW_LID@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SW_LID@GOTPAGEOFF]
	ldr	w0, [x19, #8]
Lloh20:
	ldr	w1, [x8]
	ldr	x8, [x22]
	ldr	x9, [x24]
	tst	x9, x8
	cset	w2, ne
	bl	_input_report_switch
Lloh21:
	adrp	x8, _SW_TABLET_MODE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SW_TABLET_MODE@GOTPAGEOFF]
	ldr	w0, [x19, #8]
Lloh23:
	ldr	w1, [x8]
	ldr	x8, [x22]
	ldr	x9, [x21]
	tst	x9, x8
	cset	w2, ne
	bl	_input_report_switch
	ldr	w21, [x19, #8]
Lloh24:
	adrp	x8, _SW_HEADPHONE_INSERT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SW_HEADPHONE_INSERT@GOTPAGEOFF]
Lloh26:
	ldr	w22, [x8]
	ldr	w0, [x23]
	bl	_READ_GPIO_BIT
	cmp	x0, #0
	cset	w2, ne
	mov	x0, x21
	mov	x1, x22
	bl	_input_report_switch
	ldr	w0, [x19, #8]
	bl	_input_sync
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	b	LBB0_5
LBB0_4:
Lloh27:
	adrp	x9, _hinge_count@GOTPAGE
Lloh28:
	ldr	x9, [x9, _hinge_count@GOTPAGEOFF]
Lloh29:
	str	xzr, [x9]
	str	x8, [x22]
LBB0_5:
Lloh30:
	adrp	x8, _jiffies@GOTPAGE
Lloh31:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh32:
	ldr	x20, [x8]
Lloh33:
	adrp	x8, _HINGE_SCAN_INTERVAL@GOTPAGE
Lloh34:
	ldr	x8, [x8, _HINGE_SCAN_INTERVAL@GOTPAGEOFF]
Lloh35:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	add	x1, x0, x20
	mov	x0, x19
	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
	b	_mod_timer
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotStr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_corgiscoop_device,4,2          ; @corgiscoop_device
	.comm	_SCOOP_GPRR,4,2                 ; @SCOOP_GPRR
	.comm	_CORGI_SCP_SWA,8,3              ; @CORGI_SCP_SWA
	.comm	_CORGI_SCP_SWB,8,3              ; @CORGI_SCP_SWB
	.comm	_CORGI_GPIO_AK_INT,4,2          ; @CORGI_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	_corgikbd_hinge_timer
.subsections_via_symbols
