	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CreateD3D9HalDevice            ## -- Begin function CreateD3D9HalDevice
	.p2align	4, 0x90
_CreateD3D9HalDevice:                   ## @CreateD3D9HalDevice
	.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
                                        ## kill: def $r9d killed $r9d def $r9
	movq	%r9, -48(%rbp)                  ## 8-byte Spill
	movq	%r8, %r12
	movl	%ecx, %r13d
	movl	%edx, %ebx
	movl	%esi, %r14d
	movl	%edi, %r15d
	movq	16(%rbp), %rdi
	movl	$4, %esi
	callq	_AlignedAlloc
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_DPRINT1
	movq	_DDERR_OUTOFMEMORY@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %ebx
	jmp	LBB0_6
LBB0_2:
	movq	16(%rbp), %rax
	movl	(%rax), %edi
	movq	_D3DDEVTYPE_HAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r15d, %esi
	movl	%r14d, %edx
	movl	%ebx, %r8d
	movl	%r13d, %r9d
	pushq	-48(%rbp)                       ## 8-byte Folded Reload
	pushq	%r12
	callq	_InitD3D9BaseDevice
	addq	$16, %rsp
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	16(%rbp), %rax
	movl	(%rax), %edi
	callq	_AlignedFree
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_D3D_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Not enough memory to create HAL device"

	.comm	_DDERR_OUTOFMEMORY,4,2          ## @DDERR_OUTOFMEMORY
	.comm	_D3DDEVTYPE_HAL,4,2             ## @D3DDEVTYPE_HAL
	.comm	_D3D_OK,4,2                     ## @D3D_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CreateD3D9HalDevice            ; -- Begin function CreateD3D9HalDevice
	.p2align	2
_CreateD3D9HalDevice:                   ; @CreateD3D9HalDevice
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x6
	mov	x20, x5
	mov	x21, x4
	mov	x22, x3
	mov	x23, x2
	mov	x24, x1
	mov	x25, x0
	mov	x0, x6
	mov	w1, #4
	bl	_AlignedAlloc
	bl	_FAILED
	cbz	x0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPRINT1
Lloh2:
	adrp	x8, _DDERR_OUTOFMEMORY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DDERR_OUTOFMEMORY@GOTPAGEOFF]
LBB0_2:
	ldr	w20, [x8]
	b	LBB0_5
LBB0_3:
	ldr	w0, [x19]
Lloh4:
	adrp	x8, _D3DDEVTYPE_HAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _D3DDEVTYPE_HAL@GOTPAGEOFF]
Lloh6:
	ldr	w3, [x8]
	mov	x1, x25
	mov	x2, x24
	mov	x4, x23
	mov	x5, x22
	mov	x6, x21
	mov	x7, x20
	bl	_InitD3D9BaseDevice
	mov	x20, x0
	bl	_FAILED
	cbz	x0, LBB0_6
; %bb.4:
	ldr	w0, [x19]
	bl	_AlignedFree
LBB0_5:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_6:
Lloh7:
	adrp	x8, _D3D_OK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _D3D_OK@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Not enough memory to create HAL device"

	.comm	_DDERR_OUTOFMEMORY,4,2          ; @DDERR_OUTOFMEMORY
	.comm	_D3DDEVTYPE_HAL,4,2             ; @D3DDEVTYPE_HAL
	.comm	_D3D_OK,4,2                     ; @D3D_OK
.subsections_via_symbols
