	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function d3drm_image_load_32
_d3drm_image_load_32:                   ## @d3drm_image_load_32
	.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
	movl	%r8d, %ebx
	movl	%ecx, %r15d
	movq	%rdi, %r14
	movl	%ecx, %edx
	movl	%r8d, %ecx
	movq	%r9, %r8
	callq	_d3drm_image_palettise
	movq	_D3DRM_OK@GOTPCREL(%rip), %r12
	testq	%rax, %rax
	jne	LBB0_6
## %bb.1:
	movq	_D3DRMERR_BADALLOC@GOTPCREL(%rip), %r13
	testl	%r15d, %r15d
	jle	LBB0_2
LBB0_5:
	movq	%r13, %r12
	jmp	LBB0_6
LBB0_2:
	shll	$2, %r15d
	imull	%r15d, %ebx
	movl	%ebx, %edi
	callq	_heap_alloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movabsq	$4294967328, %rcx               ## imm = 0x100000020
	movq	%rcx, (%r14)
	movl	%r15d, 8(%r14)
	movq	%rax, 16(%r14)
	movabsq	$280375481794560, %rax          ## imm = 0xFF0000FF0000
	movq	%rax, 24(%r14)
	movl	$255, 32(%r14)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%r14)
LBB0_6:
	movl	(%r12), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	leaq	L_.str(%rip), %rdi
	callq	_WARN
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_D3DRM_OK,4,2                   ## @D3DRM_OK
	.comm	_D3DRMERR_BADALLOC,4,2          ## @D3DRMERR_BADALLOC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate image buffer.\n"

	.no_dead_strip	_d3drm_image_load_32
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function d3drm_image_load_32
lCPI0_0:
	.long	32                              ; 0x20
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_d3drm_image_load_32:                   ; @d3drm_image_load_32
	.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	x20, x4
	mov	x21, x3
	mov	x19, x0
	mov	x2, x3
	mov	x3, x4
	mov	x4, x5
	bl	_d3drm_image_palettise
	cbz	x0, LBB0_2
LBB0_1:
Lloh0:
	adrp	x8, _D3DRM_OK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _D3DRM_OK@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
	cmp	w21, #0
	b.le	LBB0_5
LBB0_3:
Lloh2:
	adrp	x8, _D3DRMERR_BADALLOC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _D3DRMERR_BADALLOC@GOTPAGEOFF]
LBB0_4:
	ldr	w0, [x8]
	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
LBB0_5:
	lsl	w21, w21, #2
	mul	w0, w21, w20
	bl	_heap_alloc
	cbz	x0, LBB0_7
; %bb.6:
Lloh4:
	adrp	x8, lCPI0_0@PAGE
Lloh5:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19]
	str	w21, [x19, #8]
	str	x0, [x19, #16]
	movi	d0, #0x00ff0000ff0000
	str	d0, [x19, #24]
	mov	w8, #255
	str	w8, [x19, #32]
	stp	xzr, xzr, [x19, #40]
	b	LBB0_1
LBB0_7:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_WARN
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdr	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_D3DRM_OK,4,2                   ; @D3DRM_OK
	.comm	_D3DRMERR_BADALLOC,4,2          ; @D3DRMERR_BADALLOC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate image buffer.\n"

	.no_dead_strip	_d3drm_image_load_32
.subsections_via_symbols
