	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function send_keyboard
_send_keyboard:                         ## @send_keyboard
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_kbuf_head@GOTPCREL(%rip), %r8
	movslq	(%r8), %rsi
	leal	1(%rsi), %eax
	movq	_KBUF_SIZE@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movq	_kbuf_tail@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_1
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_debug
	jmp	LBB0_3
LBB0_1:
	movl	(%rdi), %eax
	movq	_kbuf@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, (%rcx,%rsi,4)
	movl	%edx, (%r8)
LBB0_3:
	xorl	%eax, %eax
	callq	_usbPoll
	xorl	%eax, %eax
	popq	%rbp
	jmp	_vusb_transfer_keyboard         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_kbuf_head,4,2                  ## @kbuf_head
	.comm	_KBUF_SIZE,4,2                  ## @KBUF_SIZE
	.comm	_kbuf_tail,4,2                  ## @kbuf_tail
	.comm	_kbuf,8,3                       ## @kbuf
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"kbuf: full\n"

	.no_dead_strip	_send_keyboard
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function send_keyboard
_send_keyboard:                         ; @send_keyboard
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh0:
	adrp	x8, _kbuf_head@GOTPAGE
Lloh1:
	ldr	x8, [x8, _kbuf_head@GOTPAGEOFF]
	ldrsw	x9, [x8]
	add	w10, w9, #1
Lloh2:
	adrp	x11, _KBUF_SIZE@GOTPAGE
Lloh3:
	ldr	x11, [x11, _KBUF_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w11, [x11]
	sdiv	w12, w10, w11
	msub	w10, w12, w11, w10
Lloh5:
	adrp	x11, _kbuf_tail@GOTPAGE
Lloh6:
	ldr	x11, [x11, _kbuf_tail@GOTPAGEOFF]
Lloh7:
	ldr	w11, [x11]
	cmp	w10, w11
	b.ne	LBB0_2
; %bb.1:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_debug
	b	LBB0_3
LBB0_2:
	ldr	w11, [x0]
Lloh10:
	adrp	x12, _kbuf@GOTPAGE
Lloh11:
	ldr	x12, [x12, _kbuf@GOTPAGEOFF]
Lloh12:
	ldr	x12, [x12]
	str	w11, [x12, x9, lsl #2]
	str	w10, [x8]
LBB0_3:
	bl	_usbPoll
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	b	_vusb_transfer_keyboard
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_kbuf_head,4,2                  ; @kbuf_head
	.comm	_KBUF_SIZE,4,2                  ; @KBUF_SIZE
	.comm	_kbuf_tail,4,2                  ; @kbuf_tail
	.comm	_kbuf,8,3                       ; @kbuf
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"kbuf: full\n"

	.no_dead_strip	_send_keyboard
.subsections_via_symbols
