	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function keyboard_callback
_keyboard_callback:                     ## @keyboard_callback
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edi, %ebx
	movl	$96, %edi
	callq	_port_byte_in
	movq	_SC_MAX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jg	LBB0_7
## %bb.1:
	movq	_BACKSPACE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	_key_buffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_backspace
	xorl	%eax, %eax
	callq	_kprint_backspace
	jmp	LBB0_6
LBB0_3:
	movq	_ENTER@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_kprint
	movq	_key_buffer@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_user_input
	movq	(%r14), %rax
	movb	$0, (%rax)
	jmp	LBB0_6
LBB0_5:
	movq	_sc_ascii@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cltq
	movsbl	(%rcx,%rax), %esi
	movb	%sil, -18(%rbp)
	movb	$0, -17(%rbp)
	movq	_key_buffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_append
	leaq	-18(%rbp), %rdi
	callq	_kprint
LBB0_6:
	movl	%ebx, %edi
	callq	_UNUSED
LBB0_7:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SC_MAX,8,3                     ## @SC_MAX
	.comm	_BACKSPACE,8,3                  ## @BACKSPACE
	.comm	_key_buffer,8,3                 ## @key_buffer
	.comm	_ENTER,8,3                      ## @ENTER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n"

	.comm	_sc_ascii,8,3                   ## @sc_ascii
	.no_dead_strip	_keyboard_callback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function keyboard_callback
_keyboard_callback:                     ; @keyboard_callback
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	mov	w0, #96
	bl	_port_byte_in
Lloh0:
	adrp	x8, _SC_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SC_MAX@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.gt	LBB0_7
; %bb.1:
Lloh3:
	adrp	x8, _BACKSPACE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BACKSPACE@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_3
; %bb.2:
Lloh6:
	adrp	x8, _key_buffer@GOTPAGE
Lloh7:
	ldr	x8, [x8, _key_buffer@GOTPAGEOFF]
Lloh8:
	ldr	x0, [x8]
	bl	_backspace
	bl	_kprint_backspace
	b	LBB0_6
LBB0_3:
Lloh9:
	adrp	x8, _ENTER@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENTER@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_5
; %bb.4:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_kprint
Lloh14:
	adrp	x20, _key_buffer@GOTPAGE
Lloh15:
	ldr	x20, [x20, _key_buffer@GOTPAGEOFF]
	ldr	x0, [x20]
	bl	_user_input
	ldr	x8, [x20]
	strb	wzr, [x8]
	b	LBB0_6
LBB0_5:
Lloh16:
	adrp	x8, _sc_ascii@GOTPAGE
Lloh17:
	ldr	x8, [x8, _sc_ascii@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	ldrsb	w1, [x8, w0, sxtw]
	strb	w1, [sp, #14]
	strb	wzr, [sp, #15]
Lloh19:
	adrp	x8, _key_buffer@GOTPAGE
Lloh20:
	ldr	x8, [x8, _key_buffer@GOTPAGEOFF]
Lloh21:
	ldr	x0, [x8]
	bl	_append
	add	x0, sp, #14
	bl	_kprint
LBB0_6:
	mov	x0, x19
	bl	_UNUSED
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_SC_MAX,8,3                     ; @SC_MAX
	.comm	_BACKSPACE,8,3                  ; @BACKSPACE
	.comm	_key_buffer,8,3                 ; @key_buffer
	.comm	_ENTER,8,3                      ; @ENTER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

	.comm	_sc_ascii,8,3                   ; @sc_ascii
	.no_dead_strip	_keyboard_callback
.subsections_via_symbols
