	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function k_shift
_k_shift:                               ## @k_shift
	.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	_rep@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_1
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	%edx, %r15d
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_shift_state@GOTPCREL(%rip), %r12
	movl	(%r12), %r13d
	movq	_K_CAPSSHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_KVAL
	cmpb	%bl, %al
	jne	LBB0_6
## %bb.2:
	movq	_K_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_KVAL
	movl	%eax, %ebx
	testb	%r15b, %r15b
	jne	LBB0_7
## %bb.3:
	movq	_kbd@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_VC_CAPSLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_clr_vc_kbd_led
	jmp	LBB0_4
LBB0_6:
	testb	%r15b, %r15b
	je	LBB0_4
LBB0_7:
	movq	_shift_down@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movzbl	%bl, %eax
	movq	(%rcx,%rax,8), %rdx
	testq	%rdx, %rdx
	je	LBB0_11
## %bb.8:
	decq	%rdx
	movq	%rdx, (%rcx,%rax,8)
	je	LBB0_11
## %bb.9:
	movl	(%r12), %ecx
	btsl	%eax, %ecx
	jmp	LBB0_12
LBB0_4:
	movq	_shift_down@GOTPCREL(%rip), %rdx
	movzbl	%bl, %ecx
	movl	$1, %eax
	shll	%cl, %eax
	movq	(%rdx), %rdx
	incq	(%rdx,%rcx,8)
	jne	LBB0_10
## %bb.5:
	notl	%eax
	andl	%eax, (%r12)
	jmp	LBB0_18
LBB0_11:
	movl	(%r12), %ecx
	btrl	%eax, %ecx
LBB0_12:
	movl	%ecx, (%r12)
	cmpl	%r13d, %ecx
	je	LBB0_18
## %bb.13:
	movq	_npadch@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	cmpl	$-1, %esi
	je	LBB0_18
## %bb.14:
	movq	_kbd@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	_VC_UNICODE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.15:
	movq	%r14, %rdi
	callq	_to_utf8
	jmp	LBB0_17
LBB0_10:
	orl	%eax, (%r12)
	jmp	LBB0_18
LBB0_16:
	movzbl	%sil, %esi
	movq	%r14, %rdi
	callq	_put_queue
LBB0_17:
	movl	$-1, (%rbx)
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_shift_state,4,2                ## @shift_state
	.comm	_rep,8,3                        ## @rep
	.comm	_K_CAPSSHIFT,4,2                ## @K_CAPSSHIFT
	.comm	_K_SHIFT,4,2                    ## @K_SHIFT
	.comm	_kbd,8,3                        ## @kbd
	.comm	_VC_CAPSLOCK,4,2                ## @VC_CAPSLOCK
	.comm	_shift_down,8,3                 ## @shift_down
	.comm	_npadch,4,2                     ## @npadch
	.comm	_VC_UNICODE,8,3                 ## @VC_UNICODE
	.no_dead_strip	_k_shift
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function k_shift
_k_shift:                               ; @k_shift
	.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
Lloh0:
	adrp	x8, _rep@GOTPAGE
Lloh1:
	ldr	x8, [x8, _rep@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
LBB0_1:
	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
	ret
LBB0_2:
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
Lloh3:
	adrp	x22, _shift_state@GOTPAGE
Lloh4:
	ldr	x22, [x22, _shift_state@GOTPAGEOFF]
	ldr	w23, [x22]
Lloh5:
	adrp	x8, _K_CAPSSHIFT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _K_CAPSSHIFT@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_KVAL
	cmp	w0, w20
	b.ne	LBB0_5
; %bb.3:
Lloh8:
	adrp	x8, _K_SHIFT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _K_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_KVAL
	mov	x20, x0
	cbnz	w21, LBB0_6
; %bb.4:
Lloh11:
	adrp	x8, _kbd@GOTPAGE
Lloh12:
	ldr	x8, [x8, _kbd@GOTPAGEOFF]
Lloh13:
	ldr	x0, [x8]
Lloh14:
	adrp	x8, _VC_CAPSLOCK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VC_CAPSLOCK@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_clr_vc_kbd_led
	b	LBB0_9
LBB0_5:
	cbz	w21, LBB0_9
LBB0_6:
Lloh17:
	adrp	x8, _shift_down@GOTPAGE
Lloh18:
	ldr	x8, [x8, _shift_down@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x8]
	mov	w8, w20
	ldr	x10, [x9, w20, uxtw #3]
	cbz	x10, LBB0_11
; %bb.7:
	subs	x10, x10, #1
	str	x10, [x9, x8, lsl #3]
	b.eq	LBB0_11
; %bb.8:
	mov	w9, #1
	lsl	w8, w9, w8
	ldr	w9, [x22]
	orr	w8, w9, w8
	b	LBB0_12
LBB0_9:
Lloh20:
	adrp	x8, _shift_down@GOTPAGE
Lloh21:
	ldr	x8, [x8, _shift_down@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x8]
	mov	w8, w20
	lsl	x10, x8, #3
	ldr	x11, [x9, x10]
	mov	w8, #1
	lsl	w8, w8, w20
	adds	x11, x11, #1
	str	x11, [x9, x10]
	b.lo	LBB0_15
; %bb.10:
	ldr	w9, [x22]
	bic	w8, w9, w8
	str	w8, [x22]
	b	LBB0_1
LBB0_11:
	mov	w9, #1
	lsl	w8, w9, w8
	ldr	w9, [x22]
	bic	w8, w9, w8
LBB0_12:
	str	w8, [x22]
Lloh23:
	adrp	x20, _npadch@GOTPAGE
Lloh24:
	ldr	x20, [x20, _npadch@GOTPAGEOFF]
	ldr	w1, [x20]
	cmp	w8, w23
	ccmn	w1, #1, #4, ne
	b.eq	LBB0_1
; %bb.13:
Lloh25:
	adrp	x8, _kbd@GOTPAGE
Lloh26:
	ldr	x8, [x8, _kbd@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	ldr	x8, [x8]
Lloh28:
	adrp	x9, _VC_UNICODE@GOTPAGE
Lloh29:
	ldr	x9, [x9, _VC_UNICODE@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.14:
	mov	x0, x19
	bl	_to_utf8
	b	LBB0_17
LBB0_15:
	ldr	w9, [x22]
	orr	w8, w9, w8
	str	w8, [x22]
	b	LBB0_1
LBB0_16:
	and	w1, w1, #0xff
	mov	x0, x19
	bl	_put_queue
LBB0_17:
	mov	w8, #-1
	str	w8, [x20]
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_shift_state,4,2                ; @shift_state
	.comm	_rep,8,3                        ; @rep
	.comm	_K_CAPSSHIFT,4,2                ; @K_CAPSSHIFT
	.comm	_K_SHIFT,4,2                    ; @K_SHIFT
	.comm	_kbd,8,3                        ; @kbd
	.comm	_VC_CAPSLOCK,4,2                ; @VC_CAPSLOCK
	.comm	_shift_down,8,3                 ; @shift_down
	.comm	_npadch,4,2                     ; @npadch
	.comm	_VC_UNICODE,8,3                 ; @VC_UNICODE
	.no_dead_strip	_k_shift
.subsections_via_symbols
