	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kbd_led_timeout_store
_kbd_led_timeout_store:                 ## @kbd_led_timeout_store
	.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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %rdi
	leaq	L_.str(%rip), %rsi
	leaq	-32(%rbp), %rdx
	leaq	-25(%rbp), %rcx
	callq	_sscanf
	testl	%eax, %eax
	jle	LBB0_45
## %bb.1:
	cmpl	$1, %eax
	jne	LBB0_3
## %bb.2:
	movb	$115, -25(%rbp)
LBB0_3:
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	js	LBB0_45
## %bb.4:
	movsbl	-25(%rbp), %esi
	addl	$-100, %esi
	cmpl	$15, %esi
	ja	LBB0_45
## %bb.5:
	movq	_kbd_info@GOTPCREL(%rip), %rdx
	leaq	4(%rdx), %rcx
	movl	$128, %r15d
	leaq	LJTI0_0(%rip), %rdi
	movslq	(%rdi,%rsi,4), %rsi
	addq	%rdi, %rsi
	jmpq	*%rsi
LBB0_6:
	movq	_kbd_info@GOTPCREL(%rip), %rcx
	addq	$12, %rcx
	movl	$130, %r15d
	jmp	LBB0_9
LBB0_7:
	movq	_kbd_info@GOTPCREL(%rip), %rcx
	addq	$8, %rcx
	movl	$129, %r15d
	jmp	LBB0_9
LBB0_8:
	movq	_KBD_TIMEOUT_SECONDS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	movq	%rdx, %rcx
LBB0_9:
	movl	(%rcx), %edx
	movq	_quirks@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	testq	%rcx, %rcx
	je	LBB0_11
## %bb.10:
	cmpq	$0, 8(%rcx)
	jne	LBB0_12
LBB0_11:
	cmpl	%edx, %eax
	jle	LBB0_41
LBB0_12:
	cmpl	$128, %r15d
	je	LBB0_17
## %bb.13:
	cmpl	$129, %r15d
	je	LBB0_16
## %bb.14:
	cmpl	$130, %r15d
	jne	LBB0_18
## %bb.15:
	shll	$3, %eax
	leal	(%rax,%rax,2), %eax
LBB0_16:
	imull	$60, %eax, %eax
LBB0_17:
	imull	$60, %eax, %eax
	movl	%eax, -32(%rbp)
LBB0_18:
	testq	%rcx, %rcx
	je	LBB0_25
## %bb.19:
	cmpq	$0, 8(%rcx)
	je	LBB0_25
## %bb.20:
	movq	(%rcx), %rdx
	movl	(%rdx), %ecx
	cmpl	$-1, %ecx
	je	LBB0_25
## %bb.21:
	addq	$4, %rdx
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	cmpl	%ecx, %eax
	jle	LBB0_28
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=1
	movl	(%rdx), %ecx
	addq	$4, %rdx
	cmpl	$-1, %ecx
	jne	LBB0_22
LBB0_25:
	movl	%eax, %ecx
LBB0_29:
	movq	_kbd_info@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	cmpl	%edx, %ecx
	jg	LBB0_32
## %bb.30:
	testl	%edx, %edx
	je	LBB0_32
## %bb.31:
	movq	_KBD_TIMEOUT_SECONDS@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_41
LBB0_32:
	movslq	%ecx, %rdx
	imulq	$-2004318071, %rdx, %rsi        ## imm = 0x88888889
	shrq	$32, %rsi
	addl	%ecx, %esi
	movl	%esi, %edi
	shrl	$31, %edi
	sarl	$5, %esi
	addl	%edi, %esi
	movl	4(%rax), %edi
	cmpl	%edi, %esi
	jg	LBB0_35
## %bb.33:
	testl	%edi, %edi
	je	LBB0_35
## %bb.34:
	movl	%esi, -32(%rbp)
	movl	$128, %r15d
	jmp	LBB0_41
LBB0_35:
	imulq	$-1851608123, %rdx, %rsi        ## imm = 0x91A2B3C5
	shrq	$32, %rsi
	addl	%ecx, %esi
	movl	%esi, %edi
	shrl	$31, %edi
	sarl	$11, %esi
	addl	%edi, %esi
	movl	8(%rax), %edi
	cmpl	%edi, %esi
	jg	LBB0_38
## %bb.36:
	testl	%edi, %edi
	je	LBB0_38
## %bb.37:
	movl	%esi, -32(%rbp)
	movl	$129, %r15d
	jmp	LBB0_41
LBB0_38:
	imulq	$-1037155065, %rdx, %rdx        ## imm = 0xC22E4507
	shrq	$32, %rdx
	addl	%ecx, %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	sarl	$16, %edx
	addl	%ecx, %edx
	movl	12(%rax), %eax
	cmpl	%eax, %edx
	jg	LBB0_45
## %bb.39:
	testl	%eax, %eax
	je	LBB0_45
## %bb.40:
	movl	%edx, -32(%rbp)
	movl	$130, %r15d
LBB0_41:
	movq	_kbd_led_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	leaq	-64(%rbp), %rdi
	callq	_kbd_get_state
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_48
## %bb.42:
	movups	-64(%rbp), %xmm0
	movaps	%xmm0, -48(%rbp)
	movq	_kbd_timeout_ac_supported@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_46
## %bb.43:
	xorl	%eax, %eax
	callq	_power_supply_is_system_supplied
	testq	%rax, %rax
	jle	LBB0_46
## %bb.44:
	movl	-32(%rbp), %eax
	movl	%eax, -48(%rbp)
	leaq	-44(%rbp), %rax
	jmp	LBB0_47
LBB0_45:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_49
LBB0_46:
	movl	-32(%rbp), %eax
	movl	%eax, -40(%rbp)
	leaq	-36(%rbp), %rax
LBB0_47:
	movl	%r15d, (%rax)
	leaq	-48(%rbp), %rdi
	leaq	-64(%rbp), %rsi
	callq	_kbd_set_state_safe
	testl	%eax, %eax
	cmovnel	%eax, %r14d
	movl	%r14d, %ebx
LBB0_48:
	movq	_kbd_led_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
LBB0_49:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_28:
	movl	%ecx, -32(%rbp)
	jmp	LBB0_29
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_45, LBB0_45-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
LJTI0_0:
	.long	L0_0_set_6
	.long	L0_0_set_45
	.long	L0_0_set_45
	.long	L0_0_set_45
	.long	L0_0_set_7
	.long	L0_0_set_45
	.long	L0_0_set_45
	.long	L0_0_set_45
	.long	L0_0_set_45
	.long	L0_0_set_9
	.long	L0_0_set_45
	.long	L0_0_set_45
	.long	L0_0_set_45
	.long	L0_0_set_45
	.long	L0_0_set_45
	.long	L0_0_set_8
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d %c"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_kbd_info,16,2                  ## @kbd_info
	.comm	_KBD_TIMEOUT_SECONDS,4,2        ## @KBD_TIMEOUT_SECONDS
	.comm	_quirks,8,3                     ## @quirks
	.comm	_kbd_led_mutex,4,2              ## @kbd_led_mutex
	.comm	_kbd_timeout_ac_supported,8,3   ## @kbd_timeout_ac_supported
	.no_dead_strip	_kbd_led_timeout_store
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kbd_led_timeout_store
_kbd_led_timeout_store:                 ; @kbd_led_timeout_store
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x3
	mov	x0, x2
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #12
	add	x3, sp, #11
	bl	_sscanf
	cmp	w0, #0
	b.le	LBB0_31
; %bb.1:
	cmp	w0, #1
	b.ne	LBB0_3
; %bb.2:
	mov	w8, #115
	strb	w8, [sp, #11]
LBB0_3:
	ldr	w9, [sp, #12]
	tbnz	w9, #31, LBB0_31
; %bb.4:
	ldrsb	w8, [sp, #11]
	sub	w11, w8, #100
	cmp	w11, #15
	b.hi	LBB0_31
; %bb.5:
Lloh2:
	adrp	x8, _kbd_info@GOTPAGE
Lloh3:
	ldr	x8, [x8, _kbd_info@GOTPAGEOFF]
	add	x10, x8, #4
	mov	w21, #128
Lloh4:
	adrp	x12, lJTI0_0@PAGE
Lloh5:
	add	x12, x12, lJTI0_0@PAGEOFF
	adr	x13, LBB0_6
	ldrb	w14, [x12, x11]
	add	x13, x13, x14, lsl #2
	br	x13
LBB0_6:
	add	x10, x8, #12
	mov	w21, #130
	b	LBB0_9
LBB0_7:
	add	x10, x8, #8
	mov	w21, #129
	b	LBB0_9
LBB0_8:
Lloh6:
	adrp	x10, _KBD_TIMEOUT_SECONDS@GOTPAGE
Lloh7:
	ldr	x10, [x10, _KBD_TIMEOUT_SECONDS@GOTPAGEOFF]
Lloh8:
	ldr	w21, [x10]
Lloh9:
	adrp	x10, _kbd_info@GOTPAGE
Lloh10:
	ldr	x10, [x10, _kbd_info@GOTPAGEOFF]
LBB0_9:
	ldr	w11, [x10]
Lloh11:
	adrp	x10, _quirks@GOTPAGE
Lloh12:
	ldr	x10, [x10, _quirks@GOTPAGEOFF]
Lloh13:
	ldr	x10, [x10]
	cbz	x10, LBB0_11
; %bb.10:
	ldr	x12, [x10, #8]
	cmp	x12, #0
	ccmp	w9, w11, #0, eq
	b.gt	LBB0_12
	b	LBB0_35
LBB0_11:
	cmp	w9, w11
	b.le	LBB0_35
LBB0_12:
	cmp	w21, #128
	b.eq	LBB0_17
; %bb.13:
	cmp	w21, #129
	b.eq	LBB0_16
; %bb.14:
	cmp	w21, #130
	b.ne	LBB0_18
; %bb.15:
	add	w9, w9, w9, lsl #1
	lsl	w9, w9, #3
LBB0_16:
	mov	w11, #60
	mul	w9, w9, w11
LBB0_17:
	mov	w11, #60
	mul	w9, w9, w11
	str	w9, [sp, #12]
LBB0_18:
	cbz	x10, LBB0_24
; %bb.19:
	ldr	x11, [x10, #8]
	cbz	x11, LBB0_24
; %bb.20:
	ldr	x11, [x10]
	ldr	w10, [x11]
	cmn	w10, #1
	b.eq	LBB0_24
; %bb.21:
	add	x11, x11, #4
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	cmp	w9, w10
	b.le	LBB0_43
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=1
	ldr	w10, [x11], #4
	cmn	w10, #1
	b.ne	LBB0_22
LBB0_24:
	mov	x10, x9
LBB0_25:
	ldr	w9, [x8]
	cmp	w10, w9
	ccmp	w9, #0, #4, le
	b.ne	LBB0_32
; %bb.26:
	mov	w9, #34953
	movk	w9, #34952, lsl #16
	smull	x9, w10, w9
	lsr	x9, x9, #32
	add	w9, w9, w10
	asr	w11, w9, #5
	add	w9, w11, w9, lsr #31
	ldr	w11, [x8, #4]
	cmp	w9, w11
	ccmp	w11, #0, #4, le
	b.ne	LBB0_33
; %bb.27:
	mov	w9, #46021
	movk	w9, #37282, lsl #16
	smull	x9, w10, w9
	lsr	x9, x9, #32
	add	w9, w9, w10
	asr	w11, w9, #11
	add	w9, w11, w9, lsr #31
	ldr	w11, [x8, #8]
	cmp	w9, w11
	ccmp	w11, #0, #4, le
	b.ne	LBB0_34
; %bb.28:
	mov	w9, #17671
	movk	w9, #49710, lsl #16
	smull	x9, w10, w9
	lsr	x9, x9, #32
	add	w9, w9, w10
	asr	w10, w9, #16
	add	w9, w10, w9, lsr #31
	ldr	w8, [x8, #12]
	cmp	w9, w8
	b.gt	LBB0_31
; %bb.29:
	cbz	w8, LBB0_31
; %bb.30:
	str	w9, [sp, #12]
	mov	w21, #130
	b	LBB0_35
LBB0_31:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_42
LBB0_32:
Lloh17:
	adrp	x8, _KBD_TIMEOUT_SECONDS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _KBD_TIMEOUT_SECONDS@GOTPAGEOFF]
Lloh19:
	ldr	w21, [x8]
	b	LBB0_35
LBB0_33:
	str	w9, [sp, #12]
	mov	w21, #128
	b	LBB0_35
LBB0_34:
	str	w9, [sp, #12]
	mov	w21, #129
LBB0_35:
Lloh20:
	adrp	x0, _kbd_led_mutex@GOTPAGE
Lloh21:
	ldr	x0, [x0, _kbd_led_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	add	x0, sp, #16
	bl	_kbd_get_state
	mov	x20, x0
	cbnz	w0, LBB0_41
; %bb.36:
	ldr	q0, [sp, #16]
	str	q0, [sp, #32]
Lloh22:
	adrp	x8, _kbd_timeout_ac_supported@GOTPAGE
Lloh23:
	ldr	x8, [x8, _kbd_timeout_ac_supported@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	cbz	x8, LBB0_39
; %bb.37:
	bl	_power_supply_is_system_supplied
	cmp	x0, #1
	b.lt	LBB0_39
; %bb.38:
	ldr	w8, [sp, #12]
	str	w8, [sp, #32]
	add	x8, sp, #32
	orr	x8, x8, #0x4
	b	LBB0_40
LBB0_39:
	ldr	w8, [sp, #12]
	str	w8, [sp, #40]
	add	x8, sp, #32
	orr	x8, x8, #0xc
LBB0_40:
	str	w21, [x8]
	add	x0, sp, #32
	add	x1, sp, #16
	bl	_kbd_set_state_safe
	cmp	w0, #0
	csel	w20, w19, w0, eq
LBB0_41:
Lloh25:
	adrp	x0, _kbd_led_mutex@GOTPAGE
Lloh26:
	ldr	x0, [x0, _kbd_led_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
LBB0_42:
	mov	x0, x20
	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
	add	sp, sp, #96
	ret
LBB0_43:
	str	w10, [sp, #12]
	b	LBB0_25
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_6-LBB0_6)>>2
	.byte	(LBB0_31-LBB0_6)>>2
	.byte	(LBB0_31-LBB0_6)>>2
	.byte	(LBB0_31-LBB0_6)>>2
	.byte	(LBB0_7-LBB0_6)>>2
	.byte	(LBB0_31-LBB0_6)>>2
	.byte	(LBB0_31-LBB0_6)>>2
	.byte	(LBB0_31-LBB0_6)>>2
	.byte	(LBB0_31-LBB0_6)>>2
	.byte	(LBB0_9-LBB0_6)>>2
	.byte	(LBB0_31-LBB0_6)>>2
	.byte	(LBB0_31-LBB0_6)>>2
	.byte	(LBB0_31-LBB0_6)>>2
	.byte	(LBB0_31-LBB0_6)>>2
	.byte	(LBB0_31-LBB0_6)>>2
	.byte	(LBB0_8-LBB0_6)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d %c"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_kbd_info,16,2                  ; @kbd_info
	.comm	_KBD_TIMEOUT_SECONDS,4,2        ; @KBD_TIMEOUT_SECONDS
	.comm	_quirks,8,3                     ; @quirks
	.comm	_kbd_led_mutex,4,2              ; @kbd_led_mutex
	.comm	_kbd_timeout_ac_supported,8,3   ; @kbd_timeout_ac_supported
	.no_dead_strip	_kbd_led_timeout_store
.subsections_via_symbols
