	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function load_volume_texture_from_dds
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_load_volume_texture_from_dds
	.p2align	4, 0x90
_load_volume_texture_from_dds:          ## @load_volume_texture_from_dds
	.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
	subq	$136, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $r8d killed $r8d def $r8
	movq	%r8, -112(%rbp)                 ## 8-byte Spill
                                        ## kill: def $ecx killed $ecx def $rcx
	movq	%rcx, -104(%rbp)                ## 8-byte Spill
	movq	%rdx, -96(%rbp)                 ## 8-byte Spill
	movq	(%r9), %rax
	movq	_D3DRTYPE_VOLUMETEXTURE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	8(%r9), %r15
	movq	16(%r9), %r12
	movq	24(%r9), %r14
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movl	36(%r9), %ebx
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	callq	_IDirect3DVolumeTexture9_GetLevelCount
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_min
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	jle	LBB0_8
## %bb.3:
	addq	$4, -48(%rbp)                   ## 8-byte Folded Spill
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	32(%rax), %edi
	movq	%r15, %rsi
	movq	%r12, %rdx
	leaq	-128(%rbp), %rcx
	leaq	-72(%rbp), %r8
	callq	_calculate_dds_surface_size
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	leaq	-64(%rbp), %rdx
	callq	_IDirect3DVolumeTexture9_GetVolumeLevel
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, -120(%rbp)                ## 8-byte Spill
	leaq	-144(%rbp), %rax
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rax)
	movq	%r15, -152(%rbp)
	movq	%r12, -160(%rbp)
	movq	$0, -168(%rbp)
	movq	%r12, %r13
	movq	%r15, %r12
	movq	%r14, %r15
	movq	%r14, -176(%rbp)
	movq	-64(%rbp), %rdi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	32(%rax), %r8d
	movq	-128(%rbp), %r9
	subq	$8, %rsp
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	xorl	%edx, %edx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rcx
	pushq	-112(%rbp)                      ## 8-byte Folded Reload
	pushq	-104(%rbp)                      ## 8-byte Folded Reload
	leaq	-176(%rbp), %rax
	pushq	%rax
	pushq	$0
	pushq	-72(%rbp)
	callq	_D3DXLoadVolumeFromMemory
	addq	$48, %rsp
	movl	%eax, %ebx
	movq	-64(%rbp), %rdi
	callq	_IDirect3DVolume9_Release
	movl	%ebx, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-72(%rbp), %rax
	imulq	%r15, %rax
	leaq	(%r14,%rax,4), %r14
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, %rsi
	shrq	$63, %rsi
	addq	%r12, %rsi
	sarq	%rsi
	movl	$1, %edi
	callq	_max
	movq	%rax, %rbx
	movq	%r13, %rsi
	shrq	$63, %rsi
	addq	%r13, %rsi
	sarq	%rsi
	movl	$1, %edi
	callq	_max
	movq	%rax, %r12
	movq	%r15, %rsi
	shrq	$63, %rsi
	addq	%r15, %rsi
	movq	%rbx, %r15
	sarq	%rsi
	movl	$1, %edi
	callq	_max
	movq	%rax, %r14
	movq	-120(%rbp), %r13                ## 8-byte Reload
	incq	%r13
	cmpq	%r13, -80(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_4
LBB0_8:
	movq	_D3D_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_1:
	movq	_D3DXERR_INVALIDDATA@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$136, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_D3DRTYPE_VOLUMETEXTURE,8,3     ## @D3DRTYPE_VOLUMETEXTURE
	.comm	_D3DXERR_INVALIDDATA,4,2        ## @D3DXERR_INVALIDDATA
	.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	_load_volume_texture_from_dds   ; -- Begin function load_volume_texture_from_dds
	.p2align	2
_load_volume_texture_from_dds:          ; @load_volume_texture_from_dds
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	x28, x27, [sp, #112]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #128]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #144]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	stp	w3, w4, [sp, #32]               ; 8-byte Folded Spill
	str	x2, [sp, #24]                   ; 8-byte Folded Spill
	ldr	x8, [x5]
Lloh0:
	adrp	x9, _D3DRTYPE_VOLUMETEXTURE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _D3DRTYPE_VOLUMETEXTURE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.1:
	mov	x19, x5
	mov	x20, x1
	mov	x23, x0
	ldp	x24, x25, [x5, #8]
	ldr	x26, [x5, #24]
	ldr	w21, [x5, #36]
	bl	_IDirect3DVolumeTexture9_GetLevelCount
	mov	x1, x0
	mov	x0, x21
	bl	_min
	cmp	x0, #1
	b.lt	LBB0_7
; %bb.2:
	mov	x27, x0
	mov	x28, #0
	add	x20, x20, #4
	add	x8, sp, #48
	add	x22, x8, #32
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #32]
	add	x3, sp, #96
	sub	x4, x29, #88
	mov	x1, x24
	mov	x2, x25
	bl	_calculate_dds_surface_size
	mov	x21, x0
	bl	_FAILED
	cbnz	x0, LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x2, sp, #40
	mov	x0, x23
	mov	x1, x28
	bl	_IDirect3DVolumeTexture9_GetVolumeLevel
	mov	x21, x0
	bl	_FAILED
	cbnz	x0, LBB0_10
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	stp	xzr, xzr, [x22]
	stp	x25, x24, [sp, #64]
	stp	x26, xzr, [sp, #48]
	ldr	x0, [sp, #40]
	ldr	w4, [x19, #32]
	ldr	x5, [sp, #96]
	ldur	x6, [x29, #-88]
	ldr	w9, [sp, #36]                   ; 4-byte Folded Reload
	ldr	w8, [sp, #32]                   ; 4-byte Folded Reload
	stp	w8, w9, [sp, #8]
	add	x8, sp, #48
	str	x8, [sp]
	ldr	x1, [sp, #24]                   ; 8-byte Folded Reload
	mov	x2, #0
	mov	x3, x20
	mov	x7, #0
	bl	_D3DXLoadVolumeFromMemory
	mov	x21, x0
	ldr	x0, [sp, #40]
	bl	_IDirect3DVolume9_Release
	mov	x0, x21
	bl	_FAILED
	cbnz	x0, LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldur	x8, [x29, #-88]
	mul	x8, x8, x26
	add	x20, x20, x8, lsl #2
	cmp	x24, #0
	cinc	x8, x24, lt
	asr	x1, x8, #1
	mov	w0, #1
	bl	_max
	mov	x24, x0
	cmp	x25, #0
	cinc	x8, x25, lt
	asr	x1, x8, #1
	mov	w0, #1
	bl	_max
	mov	x25, x0
	cmp	x26, #0
	cinc	x8, x26, lt
	asr	x1, x8, #1
	mov	w0, #1
	bl	_max
	mov	x26, x0
	add	x28, x28, #1
	cmp	x27, x28
	b.ne	LBB0_3
LBB0_7:
Lloh3:
	adrp	x8, _D3D_OK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _D3D_OK@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh5:
	adrp	x8, _D3DXERR_INVALIDDATA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _D3DXERR_INVALIDDATA@GOTPAGEOFF]
LBB0_9:
	ldr	w21, [x8]
LBB0_10:
	mov	x0, x21
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #144]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #128]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_D3DRTYPE_VOLUMETEXTURE,8,3     ; @D3DRTYPE_VOLUMETEXTURE
	.comm	_D3DXERR_INVALIDDATA,4,2        ; @D3DXERR_INVALIDDATA
	.comm	_D3D_OK,4,2                     ; @D3D_OK
.subsections_via_symbols
