	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Internal_CreatePalette         ## -- Begin function Internal_CreatePalette
	.p2align	4, 0x90
_Internal_CreatePalette:                ## @Internal_CreatePalette
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	testq	%r8, %r8
	je	LBB0_2
## %bb.1:
	movq	_CLASS_E_NOAGGREGATION@GOTPCREL(%rip), %rax
LBB0_7:
	movq	(%rax), %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_2:
	movq	(%rdi), %rax
	movq	_DDRAWILCL_SETCOOPCALLED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_3
## %bb.4:
	movq	8(%rax), %rbx
	xorl	%eax, %eax
	callq	_GetCurrentProcessId
	cmpq	%rax, %rbx
	jne	LBB0_5
## %bb.6:
	xorl	%edi, %edi
	movl	$4, %esi
	callq	_DxHeapMemAlloc
	movq	_DDERR_OUTOFMEMORY@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_3:
	movq	_DDERR_NOCOOPERATIVELEVELSET@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	_DDERR_INVALIDOBJECT@GOTPCREL(%rip), %rax
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_CLASS_E_NOAGGREGATION,8,3      ## @CLASS_E_NOAGGREGATION
	.comm	_DDRAWILCL_SETCOOPCALLED,4,2    ## @DDRAWILCL_SETCOOPCALLED
	.comm	_DDERR_NOCOOPERATIVELEVELSET,8,3 ## @DDERR_NOCOOPERATIVELEVELSET
	.comm	_DDERR_INVALIDOBJECT,8,3        ## @DDERR_INVALIDOBJECT
	.comm	_DDERR_OUTOFMEMORY,8,3          ## @DDERR_OUTOFMEMORY
	.comm	_DirectDrawPalette_Vtable,4,2   ## @DirectDrawPalette_Vtable
	.comm	_DDHAL_CB32_CREATEPALETTE,4,2   ## @DDHAL_CB32_CREATEPALETTE
	.comm	_DDERR_GENERIC,8,3              ## @DDERR_GENERIC
	.comm	_DDHAL_DRIVER_NOTHANDLED,8,3    ## @DDHAL_DRIVER_NOTHANDLED
	.comm	_DDERR_NOTINITIALIZED,8,3       ## @DDERR_NOTINITIALIZED
	.comm	_DD_OK,8,3                      ## @DD_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Internal_CreatePalette         ; -- Begin function Internal_CreatePalette
	.p2align	2
_Internal_CreatePalette:                ; @Internal_CreatePalette
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	cbz	x4, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _CLASS_E_NOAGGREGATION@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CLASS_E_NOAGGREGATION@GOTPAGEOFF]
LBB0_2:
	ldr	x0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_3:
	ldr	x8, [x0]
	ldr	w9, [x8]
Lloh2:
	adrp	x10, _DDRAWILCL_SETCOOPCALLED@GOTPAGE
Lloh3:
	ldr	x10, [x10, _DDRAWILCL_SETCOOPCALLED@GOTPAGEOFF]
Lloh4:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_6
; %bb.4:
	ldr	x19, [x8, #8]
	bl	_GetCurrentProcessId
	cmp	x19, x0
	b.ne	LBB0_7
; %bb.5:
	mov	x0, #0
	mov	w1, #4
	bl	_DxHeapMemAlloc
Lloh5:
	adrp	x8, _DDERR_OUTOFMEMORY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DDERR_OUTOFMEMORY@GOTPAGEOFF]
	b	LBB0_2
LBB0_6:
Lloh7:
	adrp	x8, _DDERR_NOCOOPERATIVELEVELSET@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DDERR_NOCOOPERATIVELEVELSET@GOTPAGEOFF]
	b	LBB0_2
LBB0_7:
Lloh9:
	adrp	x8, _DDERR_INVALIDOBJECT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DDERR_INVALIDOBJECT@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_CLASS_E_NOAGGREGATION,8,3      ; @CLASS_E_NOAGGREGATION
	.comm	_DDRAWILCL_SETCOOPCALLED,4,2    ; @DDRAWILCL_SETCOOPCALLED
	.comm	_DDERR_NOCOOPERATIVELEVELSET,8,3 ; @DDERR_NOCOOPERATIVELEVELSET
	.comm	_DDERR_INVALIDOBJECT,8,3        ; @DDERR_INVALIDOBJECT
	.comm	_DDERR_OUTOFMEMORY,8,3          ; @DDERR_OUTOFMEMORY
	.comm	_DirectDrawPalette_Vtable,4,2   ; @DirectDrawPalette_Vtable
	.comm	_DDHAL_CB32_CREATEPALETTE,4,2   ; @DDHAL_CB32_CREATEPALETTE
	.comm	_DDERR_GENERIC,8,3              ; @DDERR_GENERIC
	.comm	_DDHAL_DRIVER_NOTHANDLED,8,3    ; @DDHAL_DRIVER_NOTHANDLED
	.comm	_DDERR_NOTINITIALIZED,8,3       ; @DDERR_NOTINITIALIZED
	.comm	_DD_OK,8,3                      ; @DD_OK
.subsections_via_symbols
