	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function check_hook_thread
_check_hook_thread:                     ## @check_hook_thread
	.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
	movq	_dinput_hook_crit@GOTPCREL(%rip), %rdi
	callq	_EnterCriticalSection
	movq	_direct_input_list@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_list_count
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_TRACE
	movq	%rbx, %rdi
	callq	_list_empty
	testq	%rax, %rax
	jne	LBB0_3
## %bb.1:
	cmpq	$0, _check_hook_thread.hook_thread(%rip)
	jne	LBB0_3
## %bb.2:
	movq	_GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DINPUT_instance@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	-28(%rbp), %rdx
	callq	_GetModuleHandleExW
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%edi, %edi
	movl	%edx, %esi
	xorl	%ecx, %ecx
	callq	_CreateEventW
	movq	_hook_thread_event@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	_hook_thread_proc@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_hook_thread_id@GOTPCREL(%rip), %r9
	xorl	%edi, %edi
	xorl	%esi, %esi
	movq	%rax, %rcx
	xorl	%r8d, %r8d
	callq	_CreateThread
	movq	%rax, %rbx
	jmp	LBB0_8
LBB0_3:
	movq	_direct_input_list@GOTPCREL(%rip), %rdi
	callq	_list_empty
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:
	cmpq	$0, _check_hook_thread.hook_thread(%rip)
	je	LBB0_9
## %bb.5:
	movq	_hook_thread_id@GOTPCREL(%rip), %r15
	movq	(%r15), %r14
	movq	_hook_thread_event@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:
	movq	_INFINITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_WaitForSingleObject
	movq	(%rbx), %rdi
	callq	_CloseHandle
	movq	$0, (%rbx)
LBB0_7:
	movq	$0, (%r15)
	movq	_WM_USER@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	$16, %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_PostThreadMessageW
	movq	_check_hook_thread.hook_thread(%rip), %rdi
	callq	_CloseHandle
LBB0_8:
	movq	%rbx, _check_hook_thread.hook_thread(%rip)
LBB0_9:
	movq	_dinput_hook_crit@GOTPCREL(%rip), %rdi
	callq	_LeaveCriticalSection
	movq	_hook_thread_id@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpq	$0, (%rcx)
	setne	%al
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_check_hook_thread.hook_thread,8,3 ## @check_hook_thread.hook_thread
	.comm	_dinput_hook_crit,4,2           ## @dinput_hook_crit
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"IDirectInputs left: %d\n"

	.comm	_direct_input_list,4,2          ## @direct_input_list
	.comm	_GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,4,2 ## @GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
	.comm	_DINPUT_instance,8,3            ## @DINPUT_instance
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_hook_thread_event,8,3          ## @hook_thread_event
	.comm	_hook_thread_proc,4,2           ## @hook_thread_proc
	.comm	_hook_thread_id,8,3             ## @hook_thread_id
	.comm	_INFINITE,4,2                   ## @INFINITE
	.comm	_WM_USER,8,3                    ## @WM_USER
	.no_dead_strip	_check_hook_thread
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function check_hook_thread
_check_hook_thread:                     ; @check_hook_thread
	.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
Lloh0:
	adrp	x0, _dinput_hook_crit@GOTPAGE
Lloh1:
	ldr	x0, [x0, _dinput_hook_crit@GOTPAGEOFF]
	bl	_EnterCriticalSection
Lloh2:
	adrp	x19, _direct_input_list@GOTPAGE
Lloh3:
	ldr	x19, [x19, _direct_input_list@GOTPAGEOFF]
	mov	x0, x19
	bl	_list_count
	mov	x1, x0
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	mov	x0, x19
	bl	_list_empty
	adrp	x21, _check_hook_thread.hook_thread@PAGE
	ldr	x8, [x21, _check_hook_thread.hook_thread@PAGEOFF]
	cmp	x0, #0
	ccmp	x8, #0, #0, eq
Lloh6:
	adrp	x20, _hook_thread_id@GOTPAGE
Lloh7:
	ldr	x20, [x20, _hook_thread_id@GOTPAGEOFF]
	b.eq	LBB0_5
; %bb.1:
Lloh8:
	adrp	x0, _direct_input_list@GOTPAGE
Lloh9:
	ldr	x0, [x0, _direct_input_list@GOTPAGEOFF]
	bl	_list_empty
	ldr	x8, [x21, _check_hook_thread.hook_thread@PAGEOFF]
	cmp	x0, #0
	ccmp	x8, #0, #4, ne
	b.eq	LBB0_7
; %bb.2:
	ldr	x19, [x20]
Lloh10:
	adrp	x22, _hook_thread_event@GOTPAGE
Lloh11:
	ldr	x22, [x22, _hook_thread_event@GOTPAGEOFF]
	ldr	x0, [x22]
	cbz	x0, LBB0_4
; %bb.3:
Lloh12:
	adrp	x8, _INFINITE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _INFINITE@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_WaitForSingleObject
	ldr	x0, [x22]
	bl	_CloseHandle
	str	xzr, [x22]
LBB0_4:
	str	xzr, [x20]
Lloh15:
	adrp	x8, _WM_USER@GOTPAGE
Lloh16:
	ldr	x8, [x8, _WM_USER@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	add	x1, x8, #16
	mov	x0, x19
	mov	w2, #0
	mov	w3, #0
	bl	_PostThreadMessageW
	ldr	x0, [x21, _check_hook_thread.hook_thread@PAGEOFF]
	bl	_CloseHandle
	mov	x0, #0
	b	LBB0_6
LBB0_5:
Lloh18:
	adrp	x8, _GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
Lloh21:
	adrp	x8, _DINPUT_instance@GOTPAGE
Lloh22:
	ldr	x8, [x8, _DINPUT_instance@GOTPAGEOFF]
Lloh23:
	ldr	x1, [x8]
	add	x2, sp, #12
	bl	_GetModuleHandleExW
Lloh24:
	adrp	x8, _FALSE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, #0
	mov	x2, x1
	mov	x3, #0
	bl	_CreateEventW
	mov	x3, x0
Lloh27:
	adrp	x8, _hook_thread_event@GOTPAGE
Lloh28:
	ldr	x8, [x8, _hook_thread_event@GOTPAGEOFF]
Lloh29:
	str	x0, [x8]
Lloh30:
	adrp	x8, _hook_thread_proc@GOTPAGE
Lloh31:
	ldr	x8, [x8, _hook_thread_proc@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
Lloh33:
	adrp	x5, _hook_thread_id@GOTPAGE
Lloh34:
	ldr	x5, [x5, _hook_thread_id@GOTPAGEOFF]
	mov	x0, #0
	mov	w1, #0
	mov	w4, #0
	bl	_CreateThread
LBB0_6:
	str	x0, [x21, _check_hook_thread.hook_thread@PAGEOFF]
LBB0_7:
Lloh35:
	adrp	x0, _dinput_hook_crit@GOTPAGE
Lloh36:
	ldr	x0, [x0, _dinput_hook_crit@GOTPAGEOFF]
	bl	_LeaveCriticalSection
	ldr	x8, [x20]
	cmp	x8, #0
	cset	w0, ne
	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	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotStr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_check_hook_thread.hook_thread,8,3 ; @check_hook_thread.hook_thread
	.comm	_dinput_hook_crit,4,2           ; @dinput_hook_crit
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"IDirectInputs left: %d\n"

	.comm	_direct_input_list,4,2          ; @direct_input_list
	.comm	_GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,4,2 ; @GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
	.comm	_DINPUT_instance,8,3            ; @DINPUT_instance
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_hook_thread_event,8,3          ; @hook_thread_event
	.comm	_hook_thread_proc,4,2           ; @hook_thread_proc
	.comm	_hook_thread_id,8,3             ; @hook_thread_id
	.comm	_INFINITE,4,2                   ; @INFINITE
	.comm	_WM_USER,8,3                    ; @WM_USER
	.no_dead_strip	_check_hook_thread
.subsections_via_symbols
