	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function create_directinput_instance
_create_directinput_instance:           ## @create_directinput_instance
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movl	%edi, %r12d
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	movl	$40, %edx
	callq	_HeapAlloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	_ddi7avt@GOTPCREL(%rip), %rax
	movq	%rax, (%rbx)
	movq	_ddi7wvt@GOTPCREL(%rip), %rax
	movq	%rax, 32(%rbx)
	movq	_ddi8avt@GOTPCREL(%rip), %rax
	movq	%rax, 24(%rbx)
	movq	_ddi8wvt@GOTPCREL(%rip), %rax
	movq	%rax, 16(%rbx)
	movq	_JoyConfig8vt@GOTPCREL(%rip), %rax
	movq	%rax, 8(%rbx)
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movq	%r15, %rdx
	callq	_IDirectInput_QueryInterface
	movl	%eax, %r15d
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_HeapFree
	jmp	LBB0_8
LBB0_1:
	movq	_E_OUTOFMEMORY@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_4:
	testq	%r14, %r14
	je	LBB0_6
## %bb.5:
	movq	%rbx, (%r14)
LBB0_6:
	movq	_DI_OK@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %r15d
LBB0_8:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HEAP_ZERO_MEMORY,4,2           ## @HEAP_ZERO_MEMORY
	.comm	_E_OUTOFMEMORY,4,2              ## @E_OUTOFMEMORY
	.comm	_ddi7avt,4,2                    ## @ddi7avt
	.comm	_ddi7wvt,4,2                    ## @ddi7wvt
	.comm	_ddi8avt,4,2                    ## @ddi8avt
	.comm	_ddi8wvt,4,2                    ## @ddi8wvt
	.comm	_JoyConfig8vt,4,2               ## @JoyConfig8vt
	.comm	_DI_OK,4,2                      ## @DI_OK
	.no_dead_strip	_create_directinput_instance
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function create_directinput_instance
_create_directinput_instance:           ; @create_directinput_instance
	.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	x19, x2
	mov	x21, x1
	mov	x22, x0
	bl	_GetProcessHeap
Lloh0:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #40
	bl	_HeapAlloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
Lloh3:
	adrp	x8, _ddi7avt@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ddi7avt@GOTPAGEOFF]
Lloh5:
	adrp	x9, _ddi7wvt@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ddi7wvt@GOTPAGEOFF]
	str	x9, [x0, #32]
Lloh7:
	adrp	x9, _ddi8avt@GOTPAGE
Lloh8:
	ldr	x9, [x9, _ddi8avt@GOTPAGEOFF]
Lloh9:
	adrp	x10, _ddi8wvt@GOTPAGE
Lloh10:
	ldr	x10, [x10, _ddi8wvt@GOTPAGEOFF]
	stp	x10, x9, [x0, #16]
Lloh11:
	adrp	x9, _JoyConfig8vt@GOTPAGE
Lloh12:
	ldr	x9, [x9, _JoyConfig8vt@GOTPAGEOFF]
	stp	x8, x9, [x0]
	mov	x1, x22
	mov	x2, x21
	bl	_IDirectInput_QueryInterface
	mov	x21, x0
	bl	_FAILED
	cbz	x0, LBB0_4
; %bb.2:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x20
	bl	_HeapFree
	b	LBB0_8
LBB0_3:
Lloh13:
	adrp	x8, _E_OUTOFMEMORY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _E_OUTOFMEMORY@GOTPAGEOFF]
	b	LBB0_7
LBB0_4:
	cbz	x19, LBB0_6
; %bb.5:
	str	x20, [x19]
LBB0_6:
Lloh15:
	adrp	x8, _DI_OK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DI_OK@GOTPAGEOFF]
LBB0_7:
	ldr	w21, [x8]
LBB0_8:
	mov	x0, x21
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
	.comm	_E_OUTOFMEMORY,4,2              ; @E_OUTOFMEMORY
	.comm	_ddi7avt,4,2                    ; @ddi7avt
	.comm	_ddi7wvt,4,2                    ; @ddi7wvt
	.comm	_ddi8avt,4,2                    ; @ddi8avt
	.comm	_ddi8wvt,4,2                    ; @ddi8wvt
	.comm	_JoyConfig8vt,4,2               ; @JoyConfig8vt
	.comm	_DI_OK,4,2                      ; @DI_OK
	.no_dead_strip	_create_directinput_instance
.subsections_via_symbols
