	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atkbdc_dequeue_data
_atkbdc_dequeue_data:                   ## @atkbdc_dequeue_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	addq	$40, %rdi
	callq	_pthread_mutex_isowned_np
	movl	%eax, %edi
	callq	_assert
	movl	32(%rbx), %edi
	movq	%r14, %rsi
	callq	_ps2mouse_read
	testq	%rax, %rax
	je	LBB0_1
## %bb.6:
	movq	8(%rbx), %rcx
	testq	%rcx, %rcx
	jle	LBB0_13
## %bb.7:
	movq	16(%rbx), %rax
	movq	24(%rbx), %rdx
	movl	(%rdx,%rax,4), %edx
	movl	%edx, (%r14)
	incq	%rax
	movq	_FIFOSZ@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rsi
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_8
## %bb.9:
	xorl	%edx, %edx
	divq	%rsi
	jmp	LBB0_10
LBB0_1:
	movl	32(%rbx), %edi
	callq	_ps2mouse_fifocnt
	testq	%rax, %rax
	jne	LBB0_5
## %bb.2:
	xorl	%eax, %eax
	cmpq	$0, 8(%rbx)
	movq	_KBDS_AUX_BUFFER_FULL@GOTPCREL(%rip), %rcx
	jne	LBB0_4
## %bb.3:
	movq	_KBDS_KBD_BUFFER_FULL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_4:
	orl	(%rcx), %eax
	notl	%eax
	andl	%eax, (%rbx)
	movq	_KBDO_AUX_OUTFULL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 36(%rbx)
LBB0_5:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_atkbdc_poll                    ## TAILCALL
LBB0_8:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $edx killed $edx def $rdx
LBB0_10:
	movq	%rdx, 16(%rbx)
	decq	%rcx
	movq	%rcx, 8(%rbx)
	jne	LBB0_12
## %bb.11:
	movq	_KBDS_KBD_BUFFER_FULL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, (%rbx)
	movq	_KBDO_KBD_OUTFULL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 36(%rbx)
LBB0_12:
	movq	%rbx, %rdi
	callq	_atkbdc_poll
LBB0_13:
	movl	32(%rbx), %edi
	callq	_ps2mouse_fifocnt
	testq	%rax, %rax
	jne	LBB0_16
## %bb.14:
	cmpq	$0, 8(%rbx)
	jne	LBB0_16
## %bb.15:
	movq	_KBDS_AUX_BUFFER_FULL@GOTPCREL(%rip), %rax
	movq	_KBDS_KBD_BUFFER_FULL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	notl	%ecx
	andl	%ecx, (%rbx)
LBB0_16:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KBDS_AUX_BUFFER_FULL,4,2       ## @KBDS_AUX_BUFFER_FULL
	.comm	_KBDS_KBD_BUFFER_FULL,4,2       ## @KBDS_KBD_BUFFER_FULL
	.comm	_KBDO_AUX_OUTFULL,4,2           ## @KBDO_AUX_OUTFULL
	.comm	_FIFOSZ,4,2                     ## @FIFOSZ
	.comm	_KBDO_KBD_OUTFULL,4,2           ## @KBDO_KBD_OUTFULL
	.no_dead_strip	_atkbdc_dequeue_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atkbdc_dequeue_data
_atkbdc_dequeue_data:                   ; @atkbdc_dequeue_data
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	add	x0, x0, #40
	bl	_pthread_mutex_isowned_np
	bl	_assert
	ldr	w0, [x19, #32]
	mov	x1, x20
	bl	_ps2mouse_read
	cbz	x0, LBB0_9
; %bb.1:
	ldr	x8, [x19, #8]
	cmp	x8, #1
	b.lt	LBB0_5
; %bb.2:
	ldp	x10, x9, [x19, #16]
	ldr	w9, [x9, x10, lsl #2]
	str	w9, [x20]
	add	x9, x10, #1
Lloh0:
	adrp	x10, _FIFOSZ@GOTPAGE
Lloh1:
	ldr	x10, [x10, _FIFOSZ@GOTPAGEOFF]
Lloh2:
	ldrsw	x10, [x10]
	udiv	x11, x9, x10
	msub	x9, x11, x10, x9
	subs	x8, x8, #1
	stp	x8, x9, [x19, #8]
	b.ne	LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _KBDS_KBD_BUFFER_FULL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _KBDS_KBD_BUFFER_FULL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
Lloh6:
	adrp	x8, _KBDO_KBD_OUTFULL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _KBDO_KBD_OUTFULL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w9, [x19, #36]
	bic	w8, w9, w8
	str	w8, [x19, #36]
LBB0_4:
	mov	x0, x19
	bl	_atkbdc_poll
LBB0_5:
	ldr	w0, [x19, #32]
	bl	_ps2mouse_fifocnt
	cbnz	x0, LBB0_8
; %bb.6:
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_8
; %bb.7:
Lloh9:
	adrp	x8, _KBDS_AUX_BUFFER_FULL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _KBDS_AUX_BUFFER_FULL@GOTPAGEOFF]
Lloh11:
	adrp	x9, _KBDS_KBD_BUFFER_FULL@GOTPAGE
Lloh12:
	ldr	x9, [x9, _KBDS_KBD_BUFFER_FULL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_9:
	ldr	w0, [x19, #32]
	bl	_ps2mouse_fifocnt
	cbnz	x0, LBB0_11
; %bb.10:
	ldr	x8, [x19, #8]
Lloh15:
	adrp	x9, _KBDS_AUX_BUFFER_FULL@GOTPAGE
Lloh16:
	ldr	x9, [x9, _KBDS_AUX_BUFFER_FULL@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
Lloh18:
	adrp	x10, _KBDS_KBD_BUFFER_FULL@GOTPAGE
Lloh19:
	ldr	x10, [x10, _KBDS_KBD_BUFFER_FULL@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	cmp	x8, #0
	csel	w8, w10, wzr, eq
	orr	w8, w9, w8
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
Lloh21:
	adrp	x8, _KBDO_AUX_OUTFULL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _KBDO_AUX_OUTFULL@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	ldr	w9, [x19, #36]
	bic	w8, w9, w8
	str	w8, [x19, #36]
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_atkbdc_poll
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh13
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_KBDS_AUX_BUFFER_FULL,4,2       ; @KBDS_AUX_BUFFER_FULL
	.comm	_KBDS_KBD_BUFFER_FULL,4,2       ; @KBDS_KBD_BUFFER_FULL
	.comm	_KBDO_AUX_OUTFULL,4,2           ; @KBDO_AUX_OUTFULL
	.comm	_FIFOSZ,4,2                     ; @FIFOSZ
	.comm	_KBDO_KBD_OUTFULL,4,2           ; @KBDO_KBD_OUTFULL
	.no_dead_strip	_atkbdc_dequeue_data
.subsections_via_symbols
