	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atkbdc_data_handler
_atkbdc_data_handler:                   ## @atkbdc_data_handler
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$-1, %eax
	cmpl	$1, %r8d
	jne	LBB0_22
## %bb.1:
	movq	%r9, %r12
	movl	%edx, %ebx
	movq	16(%rbp), %r15
	leaq	28(%r15), %r14
	movq	%r14, %rdi
	callq	_pthread_mutex_lock
	testl	%ebx, %ebx
	je	LBB0_7
## %bb.2:
	movl	$0, (%r15)
	movl	4(%r15), %eax
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movzbl	%al, %eax
	movl	%eax, (%r12)
	movl	$0, 4(%r15)
	jmp	LBB0_5
LBB0_7:
	movq	_KBDS_CTRL_FLAG@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	testl	%eax, 8(%r15)
	je	LBB0_20
## %bb.8:
	movl	(%r15), %eax
	leal	-128(%rax), %ecx
	cmpl	$4, %ecx
	ja	LBB0_17
## %bb.9:
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rcx,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_14:
	movl	36(%r15), %edi
	movl	(%r12), %esi
	xorl	%edx, %edx
	callq	_ps2mouse_write
	movq	%r15, %rdi
	callq	_atkbdc_poll
	jmp	LBB0_19
LBB0_4:
	leaq	-36(%rbp), %rsi
	movq	%r15, %rdi
	callq	_atkbdc_dequeue_data
	movl	-36(%rbp), %eax
	movl	%eax, (%r12)
LBB0_5:
	movq	_KBDS_CTRL_FLAG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_6
LBB0_20:
	movl	32(%r15), %edi
	movl	(%r12), %esi
	callq	_ps2kbd_write
	movq	%r15, %rdi
	callq	_atkbdc_poll
	jmp	LBB0_21
LBB0_17:
	leal	-97(%rax), %ecx
	cmpl	$30, %ecx
	ja	LBB0_19
## %bb.18:
	andl	$31, %eax
	movzbl	(%r12), %ecx
	movq	16(%r15), %rdx
	movl	%ecx, (%rdx,%rax,4)
	jmp	LBB0_19
LBB0_13:
	movl	(%r12), %eax
	movl	%eax, 24(%r15)
	jmp	LBB0_19
LBB0_15:
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_atkbdc_kbd_queue_data
	jmp	LBB0_19
LBB0_16:
	movl	36(%r15), %edi
	movl	(%r12), %esi
	movl	$1, %edx
	callq	_ps2mouse_write
	movq	_KBDS_AUX_BUFFER_FULL@GOTPCREL(%rip), %rax
	movq	_KBDS_KBD_BUFFER_FULL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	orl	%ecx, 8(%r15)
	movq	%r15, %rdi
	callq	_atkbdc_aux_poll
	jmp	LBB0_19
LBB0_10:
	movl	(%r12), %ecx
	movq	16(%r15), %rax
	movl	%ecx, (%rax)
	movq	_KBD_SYS_FLAG_BIT@GOTPCREL(%rip), %rdx
	movq	_KBDS_SYS_FLAG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%ecx, (%rdx)
	je	LBB0_12
## %bb.11:
	orl	%eax, 8(%r15)
	jmp	LBB0_19
LBB0_12:
	notl	%eax
	andl	%eax, 8(%r15)
LBB0_19:
	movl	$0, (%r15)
	movl	(%rbx), %eax
LBB0_6:
	notl	%eax
	andl	%eax, 8(%r15)
LBB0_21:
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	xorl	%eax, %eax
LBB0_22:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
.set L0_0_set_15, LBB0_15-LJTI0_0
.set L0_0_set_16, LBB0_16-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
LJTI0_0:
	.long	L0_0_set_14
	.long	L0_0_set_13
	.long	L0_0_set_15
	.long	L0_0_set_16
	.long	L0_0_set_10
	.end_data_region
                                        ## -- End function
	.comm	_KBDS_CTRL_FLAG,4,2             ## @KBDS_CTRL_FLAG
	.comm	_KBD_SYS_FLAG_BIT,4,2           ## @KBD_SYS_FLAG_BIT
	.comm	_KBDS_SYS_FLAG,4,2              ## @KBDS_SYS_FLAG
	.comm	_KBDS_AUX_BUFFER_FULL,4,2       ## @KBDS_AUX_BUFFER_FULL
	.comm	_KBDS_KBD_BUFFER_FULL,4,2       ## @KBDS_KBD_BUFFER_FULL
	.no_dead_strip	_atkbdc_data_handler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atkbdc_data_handler
_atkbdc_data_handler:                   ; @atkbdc_data_handler
	.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
	cmp	w4, #1
	b.ne	LBB0_4
; %bb.1:
	mov	x20, x6
	mov	x21, x5
	mov	x22, x2
	add	x19, x6, #28
	mov	x0, x19
	bl	_pthread_mutex_lock
	cbz	w22, LBB0_5
; %bb.2:
	str	wzr, [x20]
	ldr	w8, [x20, #4]
	cbz	w8, LBB0_9
; %bb.3:
	and	w8, w8, #0xff
	str	w8, [x21]
	str	wzr, [x20, #4]
	b	LBB0_10
LBB0_4:
	mov	w0, #-1
	b	LBB0_24
LBB0_5:
	ldr	w8, [x20, #8]
Lloh0:
	adrp	x22, _KBDS_CTRL_FLAG@GOTPAGE
Lloh1:
	ldr	x22, [x22, _KBDS_CTRL_FLAG@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.6:
	ldr	w8, [x20]
	sub	w9, w8, #128
	cmp	w9, #4
	b.hi	LBB0_12
; %bb.7:
Lloh2:
	adrp	x8, lJTI0_0@PAGE
Lloh3:
	add	x8, x8, lJTI0_0@PAGEOFF
	adr	x10, LBB0_8
	ldrb	w11, [x8, x9]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_8:
	ldr	w0, [x20, #36]
	ldr	w1, [x21]
	mov	w2, #0
	bl	_ps2mouse_write
	mov	x0, x20
	bl	_atkbdc_poll
	b	LBB0_21
LBB0_9:
	add	x1, sp, #12
	mov	x0, x20
	bl	_atkbdc_dequeue_data
	ldr	w8, [sp, #12]
	str	w8, [x21]
LBB0_10:
Lloh4:
	adrp	x8, _KBDS_CTRL_FLAG@GOTPAGE
Lloh5:
	ldr	x8, [x8, _KBDS_CTRL_FLAG@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	b	LBB0_22
LBB0_11:
	ldr	w0, [x20, #32]
	ldr	w1, [x21]
	bl	_ps2kbd_write
	mov	x0, x20
	bl	_atkbdc_poll
	b	LBB0_23
LBB0_12:
	sub	w9, w8, #97
	cmp	w9, #30
	b.hi	LBB0_21
; %bb.13:
	and	x8, x8, #0x1f
	ldrb	w9, [x21]
	ldr	x10, [x20, #16]
	str	w9, [x10, x8, lsl #2]
	b	LBB0_21
LBB0_14:
	ldr	w8, [x21]
	str	w8, [x20, #24]
	b	LBB0_21
LBB0_15:
	ldr	w1, [x21]
	mov	x0, x20
	bl	_atkbdc_kbd_queue_data
	b	LBB0_21
LBB0_16:
	ldr	w0, [x20, #36]
	ldr	w1, [x21]
	mov	w2, #1
	bl	_ps2mouse_write
Lloh7:
	adrp	x8, _KBDS_AUX_BUFFER_FULL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _KBDS_AUX_BUFFER_FULL@GOTPAGEOFF]
Lloh9:
	adrp	x9, _KBDS_KBD_BUFFER_FULL@GOTPAGE
Lloh10:
	ldr	x9, [x9, _KBDS_KBD_BUFFER_FULL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x20, #8]
	orr	w8, w8, w9
	str	w8, [x20, #8]
	mov	x0, x20
	bl	_atkbdc_aux_poll
	b	LBB0_21
LBB0_17:
	ldr	w9, [x21]
	ldr	x8, [x20, #16]
Lloh13:
	adrp	x10, _KBD_SYS_FLAG_BIT@GOTPAGE
Lloh14:
	ldr	x10, [x10, _KBD_SYS_FLAG_BIT@GOTPAGEOFF]
	str	w9, [x8]
Lloh15:
	ldr	w10, [x10]
Lloh16:
	adrp	x8, _KBDS_SYS_FLAG@GOTPAGE
Lloh17:
	ldr	x8, [x8, _KBDS_SYS_FLAG@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	tst	w10, w9
	b.eq	LBB0_19
; %bb.18:
	ldr	w9, [x20, #8]
	orr	w8, w9, w8
	b	LBB0_20
LBB0_19:
	ldr	w9, [x20, #8]
	bic	w8, w9, w8
LBB0_20:
	str	w8, [x20, #8]
LBB0_21:
	str	wzr, [x20]
	ldr	w8, [x22]
LBB0_22:
	ldr	w9, [x20, #8]
	bic	w8, w9, w8
	str	w8, [x20, #8]
LBB0_23:
	mov	x0, x19
	bl	_pthread_mutex_unlock
	mov	w0, #0
LBB0_24:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh11
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_8-LBB0_8)>>2
	.byte	(LBB0_14-LBB0_8)>>2
	.byte	(LBB0_15-LBB0_8)>>2
	.byte	(LBB0_16-LBB0_8)>>2
	.byte	(LBB0_17-LBB0_8)>>2
                                        ; -- End function
	.comm	_KBDS_CTRL_FLAG,4,2             ; @KBDS_CTRL_FLAG
	.comm	_KBD_SYS_FLAG_BIT,4,2           ; @KBD_SYS_FLAG_BIT
	.comm	_KBDS_SYS_FLAG,4,2              ; @KBDS_SYS_FLAG
	.comm	_KBDS_AUX_BUFFER_FULL,4,2       ; @KBDS_AUX_BUFFER_FULL
	.comm	_KBDS_KBD_BUFFER_FULL,4,2       ; @KBDS_KBD_BUFFER_FULL
	.no_dead_strip	_atkbdc_data_handler
.subsections_via_symbols
