	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atkbdc_kbd_queue_data
_atkbdc_kbd_queue_data:                 ## @atkbdc_kbd_queue_data
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	addq	$32, %rdi
	callq	_pthread_mutex_isowned_np
	movl	%eax, %edi
	callq	_assert
	movl	(%rbx), %eax
	movq	_FIFOSZ@GOTPCREL(%rip), %r15
	cmpl	(%r15), %eax
	jge	LBB0_5
## %bb.1:
	movq	8(%rbx), %rax
	movq	16(%rbx), %rcx
	movl	%r14d, (%rcx,%rax,4)
	incq	%rax
	movslq	(%r15), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_2
## %bb.3:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_4
LBB0_5:
	leaq	L_str(%rip), %rdi
	callq	_puts
	movl	(%rbx), %ecx
	jmp	LBB0_6
LBB0_2:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
LBB0_4:
	movq	%rdx, 8(%rbx)
	movl	(%rbx), %ecx
	incl	%ecx
	movl	%ecx, (%rbx)
	movq	_KBDS_KBD_BUFFER_FULL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 28(%rbx)
	movq	_KBDO_KBD_OUTFULL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 24(%rbx)
LBB0_6:
	xorl	%eax, %eax
	cmpl	(%r15), %ecx
	setl	%al
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FIFOSZ,4,2                     ## @FIFOSZ
	.comm	_KBDS_KBD_BUFFER_FULL,4,2       ## @KBDS_KBD_BUFFER_FULL
	.comm	_KBDO_KBD_OUTFULL,4,2           ## @KBDO_KBD_OUTFULL
	.section	__TEXT,__cstring,cstring_literals
L_str:                                  ## @str
	.asciz	"atkbd data buffer full"

	.no_dead_strip	_atkbdc_kbd_queue_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atkbdc_kbd_queue_data
_atkbdc_kbd_queue_data:                 ; @atkbdc_kbd_queue_data
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x1
	mov	x19, x0
	add	x0, x0, #32
	bl	_pthread_mutex_isowned_np
	bl	_assert
	ldr	w8, [x19]
Lloh0:
	adrp	x21, _FIFOSZ@GOTPAGE
Lloh1:
	ldr	x21, [x21, _FIFOSZ@GOTPAGEOFF]
	ldr	w9, [x21]
	cmp	w8, w9
	b.ge	LBB0_2
; %bb.1:
	ldp	x9, x8, [x19, #8]
	str	w20, [x8, x9, lsl #2]
	add	x8, x9, #1
	ldrsw	x9, [x21]
	udiv	x10, x8, x9
	msub	x8, x10, x9, x8
	str	x8, [x19, #8]
	ldr	w8, [x19]
	add	w8, w8, #1
	str	w8, [x19]
Lloh2:
	adrp	x9, _KBDS_KBD_BUFFER_FULL@GOTPAGE
Lloh3:
	ldr	x9, [x9, _KBDS_KBD_BUFFER_FULL@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	ldp	w11, w10, [x19, #24]
	orr	w9, w10, w9
Lloh5:
	adrp	x10, _KBDO_KBD_OUTFULL@GOTPAGE
Lloh6:
	ldr	x10, [x10, _KBDO_KBD_OUTFULL@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	orr	w10, w11, w10
	stp	w10, w9, [x19, #24]
	b	LBB0_3
LBB0_2:
Lloh8:
	adrp	x0, l_str@PAGE
Lloh9:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	ldr	w8, [x19]
LBB0_3:
	ldr	w9, [x21]
	cmp	w8, w9
	cset	w0, lt
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_FIFOSZ,4,2                     ; @FIFOSZ
	.comm	_KBDS_KBD_BUFFER_FULL,4,2       ; @KBDS_KBD_BUFFER_FULL
	.comm	_KBDO_KBD_OUTFULL,4,2           ; @KBDO_KBD_OUTFULL
	.section	__TEXT,__cstring,cstring_literals
l_str:                                  ; @str
	.asciz	"atkbd data buffer full"

	.no_dead_strip	_atkbdc_kbd_queue_data
.subsections_via_symbols
