	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function DP_CreateDirectPlay2
_DP_CreateDirectPlay2:                  ## @DP_CreateDirectPlay2
	.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	%rdi, %rbx
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movl	%eax, %edi
	movl	$104, %edx
	callq	_HeapAlloc
	movq	%rax, (%rbx)
	movq	_FALSE@GOTPCREL(%rip), %r15
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	(%r15), %rcx
	movq	%rcx, 96(%rax)
	movq	_INVALID_HANDLE_VALUE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 88(%rax)
	movq	$0, 80(%rax)
	movq	%rcx, 72(%rax)
	movl	68(%rax), %edi
	callq	_DPQ_INIT
	movq	(%rbx), %rax
	movl	64(%rax), %edi
	callq	_DPQ_INIT
	movq	(%rbx), %rax
	movl	60(%rax), %edi
	callq	_DPQ_INIT
	movq	(%rbx), %rdi
	addq	$56, %rdi
	callq	_NS_InitializeSessionCache
	testl	%eax, %eax
	je	LBB0_7
## %bb.2:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	(%r14), %esi
	movl	%eax, %edi
	movl	$4, %edx
	callq	_HeapAlloc
	movq	(%rbx), %rcx
	movq	%rax, 48(%rcx)
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movl	$4, (%rax)
	movq	_DPSP_MAJORVERSION@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	%rax, 40(%rcx)
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	(%r14), %esi
	movl	%eax, %edi
	movl	$16, %edx
	callq	_HeapAlloc
	movq	(%rbx), %rsi
	movq	%rax, 32(%rsi)
	addq	$24, %rsi
	movl	$16, (%rax)
	movq	(%r12), %rcx
	movq	%rcx, 8(%rax)
	movq	_IID_IDirectPlaySP@GOTPCREL(%rip), %rdi
	movq	%rbx, %rdx
	callq	_dplaysp_create
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_7
## %bb.4:
	movq	(%r12), %rax
	movq	(%rbx), %rcx
	movq	%rax, 16(%rcx)
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	(%r14), %esi
	movl	%eax, %edi
	movl	$4, %edx
	callq	_HeapAlloc
	movq	(%rbx), %rsi
	movq	%rax, 8(%rsi)
	movl	$4, (%rax)
	movq	_IID_IDPLobbySP@GOTPCREL(%rip), %rdi
	movq	%rbx, %rdx
	callq	_dplobbysp_create
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_5
## %bb.6:
	movq	_TRUE@GOTPCREL(%rip), %r15
	jmp	LBB0_7
LBB0_5:
	movq	_FALSE@GOTPCREL(%rip), %r15
LBB0_7:
	movq	(%r15), %rax
	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	_FALSE,8,3                      ## @FALSE
	.comm	_INVALID_HANDLE_VALUE,4,2       ## @INVALID_HANDLE_VALUE
	.comm	_DPSP_MAJORVERSION,8,3          ## @DPSP_MAJORVERSION
	.comm	_IID_IDirectPlaySP,4,2          ## @IID_IDirectPlaySP
	.comm	_IID_IDPLobbySP,4,2             ## @IID_IDPLobbySP
	.comm	_TRUE,8,3                       ## @TRUE
	.no_dead_strip	_DP_CreateDirectPlay2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function DP_CreateDirectPlay2
_DP_CreateDirectPlay2:                  ; @DP_CreateDirectPlay2
	.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, x0
	bl	_GetProcessHeap
Lloh0:
	adrp	x20, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh1:
	ldr	x20, [x20, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	w2, #104
	bl	_HeapAlloc
	str	x0, [x19]
Lloh2:
	adrp	x21, _FALSE@GOTPAGE
Lloh3:
	ldr	x21, [x21, _FALSE@GOTPAGEOFF]
	cbz	x0, LBB0_6
; %bb.1:
	ldr	x8, [x21]
Lloh4:
	adrp	x9, _INVALID_HANDLE_VALUE@GOTPAGE
Lloh5:
	ldr	x9, [x9, _INVALID_HANDLE_VALUE@GOTPAGEOFF]
	str	x8, [x0, #96]
Lloh6:
	ldr	w9, [x9]
	str	w9, [x0, #88]
	stp	x8, xzr, [x0, #72]
	ldr	w0, [x0, #68]
	bl	_DPQ_INIT
	ldr	x8, [x19]
	ldr	w0, [x8, #64]
	bl	_DPQ_INIT
	ldr	x8, [x19]
	ldr	w0, [x8, #60]
	bl	_DPQ_INIT
	ldr	x8, [x19]
	add	x0, x8, #56
	bl	_NS_InitializeSessionCache
	cbz	w0, LBB0_6
; %bb.2:
	bl	_GetProcessHeap
	ldr	w1, [x20]
	mov	w21, #4
	mov	w2, #4
	bl	_HeapAlloc
	ldr	x8, [x19]
	str	x0, [x8, #48]
	cbz	x0, LBB0_5
; %bb.3:
	str	w21, [x0]
Lloh7:
	adrp	x22, _DPSP_MAJORVERSION@GOTPAGE
Lloh8:
	ldr	x22, [x22, _DPSP_MAJORVERSION@GOTPAGEOFF]
	ldr	x9, [x22]
	str	x9, [x8, #40]
	bl	_GetProcessHeap
	ldr	w1, [x20]
	mov	w21, #16
	mov	w2, #16
	bl	_HeapAlloc
	ldr	x8, [x19]
	add	x1, x8, #24
	str	x0, [x8, #32]
	str	w21, [x0]
	ldr	x8, [x22]
	str	x8, [x0, #8]
Lloh9:
	adrp	x0, _IID_IDirectPlaySP@GOTPAGE
Lloh10:
	ldr	x0, [x0, _IID_IDirectPlaySP@GOTPAGEOFF]
	mov	x2, x19
	bl	_dplaysp_create
	bl	_FAILED
Lloh11:
	adrp	x21, _FALSE@GOTPAGE
Lloh12:
	ldr	x21, [x21, _FALSE@GOTPAGEOFF]
	cbnz	x0, LBB0_6
; %bb.4:
	ldr	x8, [x22]
	ldr	x9, [x19]
	str	x8, [x9, #16]
	bl	_GetProcessHeap
	ldr	w1, [x20]
	mov	w20, #4
	mov	w2, #4
	bl	_HeapAlloc
	ldr	x1, [x19]
	str	x0, [x1, #8]
	str	w20, [x0]
Lloh13:
	adrp	x0, _IID_IDPLobbySP@GOTPAGE
Lloh14:
	ldr	x0, [x0, _IID_IDPLobbySP@GOTPAGEOFF]
	mov	x2, x19
	bl	_dplobbysp_create
	bl	_FAILED
Lloh15:
	adrp	x8, _TRUE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
	cmp	x0, #0
	csel	x21, x8, x21, eq
	b	LBB0_6
LBB0_5:
Lloh17:
	adrp	x21, _FALSE@GOTPAGE
Lloh18:
	ldr	x21, [x21, _FALSE@GOTPAGEOFF]
LBB0_6:
	ldr	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
	.comm	_FALSE,8,3                      ; @FALSE
	.comm	_INVALID_HANDLE_VALUE,4,2       ; @INVALID_HANDLE_VALUE
	.comm	_DPSP_MAJORVERSION,8,3          ; @DPSP_MAJORVERSION
	.comm	_IID_IDirectPlaySP,4,2          ; @IID_IDirectPlaySP
	.comm	_IID_IDPLobbySP,4,2             ; @IID_IDPLobbySP
	.comm	_TRUE,8,3                       ; @TRUE
	.no_dead_strip	_DP_CreateDirectPlay2
.subsections_via_symbols
