	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _kbd_buf_thread_func
__kbd_buf_thread_func:                  ## @_kbd_buf_thread_func
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	__kbd_thread_quit@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	je	LBB0_1
LBB0_7:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	__keyBuffer@GOTPCREL(%rip), %rbx
	movq	_KBD_THREAD_UDELAY@GOTPCREL(%rip), %r12
	leaq	-56(%rbp), %r14
	movq	_KEYBOARD_PRESSED@GOTPCREL(%rip), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r12), %edi
	callq	_usleep
	cmpl	$0, (%r15)
	jne	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %eax
	incl	%eax
	movzbl	%al, %eax
	cmpl	4(%rbx), %eax
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	callq	_KEYBOARD_GetEvent
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rax
	cmpq	(%r13), %rax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-48(%rbp), %eax
	movq	8(%rbx), %rcx
	movslq	(%rbx), %rdx
	movl	%eax, (%rcx,%rdx,4)
	incl	(%rbx)
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	__kbd_thread_quit,4,2           ## @_kbd_thread_quit
	.comm	__keyBuffer,16,3                ## @_keyBuffer
	.comm	_KEYBOARD_PRESSED,8,3           ## @KEYBOARD_PRESSED
	.comm	_KBD_THREAD_UDELAY,4,2          ## @KBD_THREAD_UDELAY
	.no_dead_strip	__kbd_buf_thread_func
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _kbd_buf_thread_func
__kbd_buf_thread_func:                  ; @_kbd_buf_thread_func
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
Lloh0:
	adrp	x19, __kbd_thread_quit@GOTPAGE
Lloh1:
	ldr	x19, [x19, __kbd_thread_quit@GOTPAGEOFF]
	ldr	w8, [x19]
	cbz	w8, LBB0_2
LBB0_1:
	mov	x0, #0
	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
	add	sp, sp, #64
	ret
LBB0_2:
Lloh2:
	adrp	x20, __keyBuffer@GOTPAGE
Lloh3:
	ldr	x20, [x20, __keyBuffer@GOTPAGEOFF]
Lloh4:
	adrp	x21, _KBD_THREAD_UDELAY@GOTPAGE
Lloh5:
	ldr	x21, [x21, _KBD_THREAD_UDELAY@GOTPAGEOFF]
Lloh6:
	adrp	x22, _KEYBOARD_PRESSED@GOTPAGE
Lloh7:
	ldr	x22, [x22, _KEYBOARD_PRESSED@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x21]
	bl	_usleep
	ldr	w8, [x19]
	cbnz	w8, LBB0_1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w8, w9, [x20]
	add	w8, w8, #1
	cmp	w9, w8, uxtb
	b.eq	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, sp
	bl	_KEYBOARD_GetEvent
	cbz	x0, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [sp]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [sp, #8]
	ldr	x9, [x20, #8]
	ldrsw	x10, [x20]
	str	w8, [x9, x10, lsl #2]
	ldr	w8, [x20]
	add	w8, w8, #1
	str	w8, [x20]
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	__kbd_thread_quit,4,2           ; @_kbd_thread_quit
	.comm	__keyBuffer,16,3                ; @_keyBuffer
	.comm	_KEYBOARD_PRESSED,8,3           ; @KEYBOARD_PRESSED
	.comm	_KBD_THREAD_UDELAY,4,2          ; @KBD_THREAD_UDELAY
	.no_dead_strip	__kbd_buf_thread_func
.subsections_via_symbols
