	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kbd_set_level
_kbd_set_level:                         ## @kbd_set_level
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_kbd_info@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.1:
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.5:
	movq	_kbd_previous_level@GOTPCREL(%rip), %rax
	movq	%rsi, (%rax)
	xorl	%eax, %eax
	cmpq	%rsi, (%rdi)
	je	LBB0_14
## %bb.6:
	movq	%rsi, (%rdi)
	movq	8(%rdi), %rcx
	movq	_KBD_MODE_BIT_OFF@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_14
## %bb.7:
	movq	_kbd_previous_mode_bit@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 8(%rdi)
	popq	%rbp
	retq
LBB0_8:
	movq	_kbd_mode_levels_count@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jle	LBB0_13
## %bb.9:
	cmpq	%rsi, %rax
	jle	LBB0_13
## %bb.10:
	testq	%rsi, %rsi
	je	LBB0_12
## %bb.11:
	movq	_kbd_previous_level@GOTPCREL(%rip), %rax
	movq	%rsi, (%rax)
LBB0_12:
	movq	_kbd_mode_levels@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%rsi,8), %rax
	movq	%rax, 8(%rdi)
	xorl	%eax, %eax
	popq	%rbp
	retq
LBB0_2:
	xorl	%eax, %eax
	cmpq	$0, (%rdi)
	je	LBB0_14
## %bb.3:
	movq	$0, (%rdi)
	movq	8(%rdi), %rcx
	movq	_KBD_MODE_BIT_OFF@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	cmpq	%rdx, %rcx
	je	LBB0_14
## %bb.4:
	movq	_kbd_previous_mode_bit@GOTPCREL(%rip), %rsi
	movq	%rcx, (%rsi)
	movq	%rdx, 8(%rdi)
	popq	%rbp
	retq
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_14:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_kbd_info,8,3                   ## @kbd_info
	.comm	_kbd_previous_level,8,3         ## @kbd_previous_level
	.comm	_KBD_MODE_BIT_OFF,8,3           ## @KBD_MODE_BIT_OFF
	.comm	_kbd_previous_mode_bit,8,3      ## @kbd_previous_mode_bit
	.comm	_kbd_mode_levels_count,8,3      ## @kbd_mode_levels_count
	.comm	_kbd_mode_levels,8,3            ## @kbd_mode_levels
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_kbd_set_level
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kbd_set_level
_kbd_set_level:                         ; @kbd_set_level
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, _kbd_info@GOTPAGE
Lloh1:
	ldr	x8, [x8, _kbd_info@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.1:
	cbz	x1, LBB0_7
; %bb.2:
Lloh3:
	adrp	x8, _kbd_previous_level@GOTPAGE
Lloh4:
	ldr	x8, [x8, _kbd_previous_level@GOTPAGEOFF]
Lloh5:
	str	x1, [x8]
	ldr	x8, [x0]
	cmp	x8, x1
	b.eq	LBB0_9
; %bb.3:
	str	x1, [x0]
	ldr	x8, [x0, #8]
Lloh6:
	adrp	x9, _KBD_MODE_BIT_OFF@GOTPAGE
Lloh7:
	ldr	x9, [x9, _KBD_MODE_BIT_OFF@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.4:
Lloh9:
	adrp	x9, _kbd_previous_mode_bit@GOTPAGE
Lloh10:
	ldr	x9, [x9, _kbd_previous_mode_bit@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	b	LBB0_14
LBB0_5:
Lloh12:
	adrp	x8, _kbd_mode_levels_count@GOTPAGE
Lloh13:
	ldr	x8, [x8, _kbd_mode_levels_count@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cmp	x8, #1
	ccmp	x8, x1, #4, ge
	b.gt	LBB0_11
; %bb.6:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w8, w8
	b	LBB0_10
LBB0_7:
	ldr	x8, [x0]
	cbz	x8, LBB0_10
; %bb.8:
	str	xzr, [x0]
	ldr	x9, [x0, #8]
Lloh18:
	adrp	x8, _KBD_MODE_BIT_OFF@GOTPAGE
Lloh19:
	ldr	x8, [x8, _KBD_MODE_BIT_OFF@GOTPAGEOFF]
Lloh20:
	ldr	x10, [x8]
	cmp	x9, x10
	b.ne	LBB0_15
LBB0_9:
	mov	w0, #0
	ret
LBB0_10:
	mov	x0, x8
	ret
LBB0_11:
	cbz	x1, LBB0_13
; %bb.12:
Lloh21:
	adrp	x8, _kbd_previous_level@GOTPAGE
Lloh22:
	ldr	x8, [x8, _kbd_previous_level@GOTPAGEOFF]
Lloh23:
	str	x1, [x8]
LBB0_13:
Lloh24:
	adrp	x9, _kbd_mode_levels@GOTPAGE
Lloh25:
	ldr	x9, [x9, _kbd_mode_levels@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	ldr	x9, [x9, x1, lsl #3]
LBB0_14:
	str	x9, [x0, #8]
	mov	w0, #0
	ret
LBB0_15:
Lloh27:
	adrp	x11, _kbd_previous_mode_bit@GOTPAGE
Lloh28:
	ldr	x11, [x11, _kbd_previous_mode_bit@GOTPAGEOFF]
Lloh29:
	str	x9, [x11]
	str	x10, [x0, #8]
	mov	w0, #0
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotStr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_kbd_info,8,3                   ; @kbd_info
	.comm	_kbd_previous_level,8,3         ; @kbd_previous_level
	.comm	_KBD_MODE_BIT_OFF,8,3           ; @KBD_MODE_BIT_OFF
	.comm	_kbd_previous_mode_bit,8,3      ; @kbd_previous_mode_bit
	.comm	_kbd_mode_levels_count,8,3      ; @kbd_mode_levels_count
	.comm	_kbd_mode_levels,8,3            ; @kbd_mode_levels
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_kbd_set_level
.subsections_via_symbols
