	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function KeyboardCallback
_KeyboardCallback:                      ## @KeyboardCallback
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movl	%edi, %r13d
	callq	_impl_from_IDirectInputDevice8A
	movq	%rax, %r15
	movq	_DISCL_EXCLUSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	andl	8(%r15), %r14d
	movq	_WM_KEYDOWN@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	je	LBB0_4
## %bb.1:
	movq	_WM_KEYUP@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	je	LBB0_4
## %bb.2:
	movq	_WM_SYSKEYDOWN@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	je	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	movq	_WM_SYSKEYUP@GOTPCREL(%rip), %rcx
	cmpq	%rbx, (%rcx)
	jne	LBB0_15
LBB0_4:
	movl	(%r12), %r8d
	movl	4(%r12), %r9d
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	movl	%ebx, %edx
	movq	%r12, %rcx
	xorl	%eax, %eax
	callq	_TRACE
	movl	(%r12), %esi
	leal	-128(%rsi), %eax
	cmpl	$3, %eax
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	ja	LBB0_7
## %bb.5:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_6:
	movq	_DIK_SUBTRACT@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_7:
	movzbl	4(%r12), %edi
	movl	24(%r15), %edx
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_map_dik_code
	movq	_LLKHF_EXTENDED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %ecx
	orl	$128, %ecx
	testl	%edx, 8(%r12)
	cmovel	%eax, %ecx
	jmp	LBB0_12
LBB0_8:
	movq	_DIK_RSHIFT@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_9:
	movq	_DIK_PAUSE@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	movq	_DIK_NUMLOCK@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %ecx
LBB0_12:
	movq	_LLKHF_UP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ebx, %ebx
	testl	%eax, 8(%r12)
	sete	%bl
	shll	$7, %ebx
	movq	(%r15), %rax
	movslq	%ecx, %r13
	cmpl	(%rax,%r13,4), %ebx
	je	LBB0_14
## %bb.13:
	movl	%ebx, (%rax,%r13,4)
	leaq	L_.str.1(%rip), %rdi
	movl	%r13d, %esi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_TRACE
	movq	%r15, %r12
	addq	$12, %r12
	movq	%r12, %rdi
	callq	_EnterCriticalSection
	movl	%r13d, %edi
	callq	_DIDFT_MAKEINSTANCE
	movl	%eax, %r13d
	movq	_DIDFT_PSHBUTTON@GOTPCREL(%rip), %rax
	orl	(%rax), %r13d
	xorl	%eax, %eax
	callq	_GetCurrentTime
	movq	16(%r15), %rcx
	movl	(%rcx), %r8d
	leal	1(%r8), %edx
	movl	%edx, (%rcx)
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%r13d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
                                        ## kill: def $r8d killed $r8d killed $r8
	callq	_queue_event
	movq	%r12, %rdi
	callq	_LeaveCriticalSection
LBB0_14:
	movl	%r14d, %eax
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
LJTI0_0:
	.long	L0_0_set_6
	.long	L0_0_set_8
	.long	L0_0_set_9
	.long	L0_0_set_10
	.end_data_region
                                        ## -- End function
	.comm	_DISCL_EXCLUSIVE,4,2            ## @DISCL_EXCLUSIVE
	.comm	_WM_KEYDOWN,8,3                 ## @WM_KEYDOWN
	.comm	_WM_KEYUP,8,3                   ## @WM_KEYUP
	.comm	_WM_SYSKEYDOWN,8,3              ## @WM_SYSKEYDOWN
	.comm	_WM_SYSKEYUP,8,3                ## @WM_SYSKEYUP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%p) wp %08lx, lp %08lx, vk %02x, scan %02x\n"

	.comm	_DIK_RSHIFT,4,2                 ## @DIK_RSHIFT
	.comm	_DIK_PAUSE,4,2                  ## @DIK_PAUSE
	.comm	_DIK_NUMLOCK,4,2                ## @DIK_NUMLOCK
	.comm	_DIK_SUBTRACT,4,2               ## @DIK_SUBTRACT
	.comm	_LLKHF_EXTENDED,4,2             ## @LLKHF_EXTENDED
	.comm	_LLKHF_UP,4,2                   ## @LLKHF_UP
L_.str.1:                               ## @.str.1
	.asciz	" setting %02X to %02X\n"

	.comm	_DIDFT_PSHBUTTON,4,2            ## @DIDFT_PSHBUTTON
	.no_dead_strip	_KeyboardCallback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function KeyboardCallback
_KeyboardCallback:                      ; @KeyboardCallback
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
	bl	_impl_from_IDirectInputDevice8A
Lloh0:
	adrp	x8, _WM_KEYDOWN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WM_KEYDOWN@GOTPAGEOFF]
Lloh2:
	adrp	x9, _WM_KEYUP@GOTPAGE
Lloh3:
	ldr	x9, [x9, _WM_KEYUP@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x10, _WM_SYSKEYDOWN@GOTPAGE
Lloh7:
	ldr	x10, [x10, _WM_SYSKEYDOWN@GOTPAGEOFF]
Lloh8:
	adrp	x11, _WM_SYSKEYUP@GOTPAGE
Lloh9:
	ldr	x11, [x11, _WM_SYSKEYUP@GOTPAGEOFF]
Lloh10:
	ldr	x10, [x10]
Lloh11:
	ldr	x11, [x11]
	cmp	x8, x23
	ccmp	x9, x23, #4, ne
	ccmp	x10, x23, #4, ne
	ccmp	x11, x23, #4, ne
	b.ne	LBB0_4
; %bb.1:
	mov	x21, x0
	ldr	w8, [x0, #8]
Lloh12:
	adrp	x9, _DISCL_EXCLUSIVE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _DISCL_EXCLUSIVE@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	and	w20, w9, w8
	ldp	w8, w9, [x22]
	stp	x8, x9, [sp, #8]
	str	x22, [sp]
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	mov	x2, x23
	bl	_TRACE
	ldr	w1, [x22]
	sub	w8, w1, #128
	cmp	w8, #3
	b.hi	LBB0_5
; %bb.2:
Lloh17:
	adrp	x9, lJTI0_0@PAGE
Lloh18:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_3
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_3:
Lloh19:
	adrp	x8, _DIK_SUBTRACT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DIK_SUBTRACT@GOTPAGEOFF]
	b	LBB0_9
LBB0_4:
	mov	w20, #0
	b	LBB0_12
LBB0_5:
	ldrb	w0, [x22, #4]
	ldr	w2, [x21, #24]
	bl	_map_dik_code
	ldr	w8, [x22, #8]
Lloh21:
	adrp	x9, _LLKHF_EXTENDED@GOTPAGE
Lloh22:
	ldr	x9, [x9, _LLKHF_EXTENDED@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w10, w0, #0x80
	tst	w9, w8
	csel	w8, w0, w10, eq
	b	LBB0_10
LBB0_6:
Lloh24:
	adrp	x8, _DIK_RSHIFT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _DIK_RSHIFT@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
Lloh26:
	adrp	x8, _DIK_PAUSE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _DIK_PAUSE@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh28:
	adrp	x8, _DIK_NUMLOCK@GOTPAGE
Lloh29:
	ldr	x8, [x8, _DIK_NUMLOCK@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
LBB0_10:
	ldr	w9, [x22, #8]
Lloh30:
	adrp	x10, _LLKHF_UP@GOTPAGE
Lloh31:
	ldr	x10, [x10, _LLKHF_UP@GOTPAGEOFF]
Lloh32:
	ldr	w10, [x10]
	tst	w10, w9
	cset	w9, eq
	lsl	w22, w9, #7
	ldr	x9, [x21]
	ldr	w10, [x9, w8, sxtw #2]
	cmp	w22, w10
	b.eq	LBB0_12
; %bb.11:
	sxtw	x23, w8
	str	w22, [x9, x23, lsl #2]
Lloh33:
	adrp	x0, l_.str.1@PAGE
Lloh34:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x23
	mov	x2, x22
	bl	_TRACE
	add	x24, x21, #12
	mov	x0, x24
	bl	_EnterCriticalSection
	mov	x0, x23
	bl	_DIDFT_MAKEINSTANCE
Lloh35:
	adrp	x8, _DIDFT_PSHBUTTON@GOTPAGE
Lloh36:
	ldr	x8, [x8, _DIDFT_PSHBUTTON@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	orr	w23, w8, w0
	bl	_GetCurrentTime
	mov	x3, x0
	ldr	x8, [x21, #16]
	ldr	w4, [x8]
	add	w9, w4, #1
	str	w9, [x8]
	mov	x0, x19
	mov	x1, x23
	mov	x2, x22
	bl	_queue_event
	mov	x0, x24
	bl	_LeaveCriticalSection
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_3-LBB0_3)>>2
	.byte	(LBB0_6-LBB0_3)>>2
	.byte	(LBB0_7-LBB0_3)>>2
	.byte	(LBB0_8-LBB0_3)>>2
                                        ; -- End function
	.comm	_DISCL_EXCLUSIVE,4,2            ; @DISCL_EXCLUSIVE
	.comm	_WM_KEYDOWN,8,3                 ; @WM_KEYDOWN
	.comm	_WM_KEYUP,8,3                   ; @WM_KEYUP
	.comm	_WM_SYSKEYDOWN,8,3              ; @WM_SYSKEYDOWN
	.comm	_WM_SYSKEYUP,8,3                ; @WM_SYSKEYUP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%p) wp %08lx, lp %08lx, vk %02x, scan %02x\n"

	.comm	_DIK_RSHIFT,4,2                 ; @DIK_RSHIFT
	.comm	_DIK_PAUSE,4,2                  ; @DIK_PAUSE
	.comm	_DIK_NUMLOCK,4,2                ; @DIK_NUMLOCK
	.comm	_DIK_SUBTRACT,4,2               ; @DIK_SUBTRACT
	.comm	_LLKHF_EXTENDED,4,2             ; @LLKHF_EXTENDED
	.comm	_LLKHF_UP,4,2                   ; @LLKHF_UP
l_.str.1:                               ; @.str.1
	.asciz	" setting %02X to %02X\n"

	.comm	_DIDFT_PSHBUTTON,4,2            ; @DIDFT_PSHBUTTON
	.no_dead_strip	_KeyboardCallback
.subsections_via_symbols
