	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_image_info_from_dds
_get_image_info_from_dds:               ## @get_image_info_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_D3DXERR_INVALIDDATA@GOTPCREL(%rip), %r12
	cmpl	$24, %esi
	jb	LBB0_14
## %bb.1:
	movq	%rdx, %r15
	testq	%rdx, %rdx
	je	LBB0_14
## %bb.2:
	movq	%rdi, %rbx
	cmpl	$4, 12(%rdi)
	jne	LBB0_14
## %bb.3:
	movl	%esi, %r14d
	leaq	12(%rbx), %rdi
	movl	20(%rbx), %eax
	movl	%eax, 16(%r15)
	movl	16(%rbx), %eax
	movl	%eax, 12(%r15)
	movl	$1, (%r15)
	movl	(%rbx), %eax
	testl	%eax, %eax
	movl	$1, %ecx
	cmovnel	%eax, %ecx
	movl	%ecx, 4(%r15)
	callq	_dds_pixel_format_to_d3dformat
	movl	%eax, 20(%r15)
	movq	_D3DFMT_UNKNOWN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_14
## %bb.4:
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_TRACE
	movl	4(%rbx), %ecx
	movq	_DDS_CAPS2_VOLUME@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_6
## %bb.5:
	movl	8(%rbx), %eax
	movl	%eax, (%r15)
	movl	$1, %r9d
	movq	_D3DRTYPE_VOLUMETEXTURE@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %eax
	movl	%eax, 24(%r15)
	movl	20(%r15), %edi
	movl	16(%r15), %esi
	movl	12(%r15), %edx
	movl	(%r15), %ecx
	movl	4(%r15), %r8d
	callq	_calculate_dds_file_size
	cmpl	%r14d, %eax
	jle	LBB0_13
## %bb.12:
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_WARN
	jmp	LBB0_14
LBB0_13:
	movq	_D3DXIFF_DDS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movq	_D3D_OK@GOTPCREL(%rip), %r12
LBB0_14:
	movl	(%r12), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_DDS_CAPS2_CUBEMAP@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_7
## %bb.8:
	movq	_DDS_CAPS2_CUBEMAP_POSITIVEX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_DDS_CAPS2_CUBEMAP_NEGATIVEZ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r9d, %r9d
	movq	_D3DRTYPE_CUBETEXTURE@GOTPCREL(%rip), %rax
	cmpl	%esi, %edx
	jg	LBB0_11
## %bb.9:
	xorl	%r9d, %r9d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	%edx, %edi
	andl	%ecx, %edi
	cmpl	$1, %edi
	sbbl	$-1, %r9d
	addl	%edx, %edx
	cmpl	%esi, %edx
	jle	LBB0_10
	jmp	LBB0_11
LBB0_7:
	movl	$1, %r9d
	movq	_D3DRTYPE_TEXTURE@GOTPCREL(%rip), %rax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_D3DXERR_INVALIDDATA,4,2        ## @D3DXERR_INVALIDDATA
	.comm	_D3DFMT_UNKNOWN,4,2             ## @D3DFMT_UNKNOWN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Pixel format is %#x\n"

	.comm	_DDS_CAPS2_VOLUME,4,2           ## @DDS_CAPS2_VOLUME
	.comm	_D3DRTYPE_VOLUMETEXTURE,4,2     ## @D3DRTYPE_VOLUMETEXTURE
	.comm	_DDS_CAPS2_CUBEMAP,4,2          ## @DDS_CAPS2_CUBEMAP
	.comm	_DDS_CAPS2_CUBEMAP_POSITIVEX,4,2 ## @DDS_CAPS2_CUBEMAP_POSITIVEX
	.comm	_DDS_CAPS2_CUBEMAP_NEGATIVEZ,4,2 ## @DDS_CAPS2_CUBEMAP_NEGATIVEZ
	.comm	_D3DRTYPE_CUBETEXTURE,4,2       ## @D3DRTYPE_CUBETEXTURE
	.comm	_D3DRTYPE_TEXTURE,4,2           ## @D3DRTYPE_TEXTURE
L_.str.1:                               ## @.str.1
	.asciz	"File is too short %u, expected at least %u bytes\n"

	.comm	_D3DXIFF_DDS,4,2                ## @D3DXIFF_DDS
	.comm	_D3D_OK,4,2                     ## @D3D_OK
	.no_dead_strip	_get_image_info_from_dds
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_image_info_from_dds
_get_image_info_from_dds:               ; @get_image_info_from_dds
	.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
Lloh0:
	adrp	x8, _D3DXERR_INVALIDDATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _D3DXERR_INVALIDDATA@GOTPAGEOFF]
	cmp	w1, #24
	b.lo	LBB0_9
; %bb.1:
	mov	x20, x2
	cbz	x2, LBB0_9
; %bb.2:
	mov	x21, x0
	ldr	w8, [x0, #12]!
	cmp	w8, #4
	b.ne	LBB0_8
; %bb.3:
	mov	x19, x1
	ldr	d0, [x21, #16]
	stur	d0, [x20, #12]
	mov	w8, #1
	ldr	w9, [x21]
	cmp	w9, #0
	csinc	w9, w9, wzr, ne
	stp	w8, w9, [x20]
	bl	_dds_pixel_format_to_d3dformat
	str	w0, [x20, #20]
Lloh2:
	adrp	x8, _D3DFMT_UNKNOWN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _D3DFMT_UNKNOWN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w0, w8
	b.eq	LBB0_8
; %bb.4:
	mov	x1, x0
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	ldr	w8, [x21, #4]
Lloh7:
	adrp	x9, _DDS_CAPS2_VOLUME@GOTPAGE
Lloh8:
	ldr	x9, [x9, _DDS_CAPS2_VOLUME@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.5:
	ldr	w8, [x21, #8]
	str	w8, [x20]
	mov	w5, #1
Lloh10:
	adrp	x9, _D3DRTYPE_VOLUMETEXTURE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _D3DRTYPE_VOLUMETEXTURE@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x9]
	str	w8, [x20, #24]
	ldp	w1, w0, [x20, #16]
	ldr	w2, [x20, #12]
	ldp	w3, w4, [x20]
	bl	_calculate_dds_file_size
	cmp	w0, w19
	b.le	LBB0_10
; %bb.7:
	mov	x2, x0
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_WARN
LBB0_8:
Lloh14:
	adrp	x8, _D3DXERR_INVALIDDATA@GOTPAGE
Lloh15:
	ldr	x8, [x8, _D3DXERR_INVALIDDATA@GOTPAGEOFF]
LBB0_9:
	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_10:
Lloh16:
	adrp	x8, _D3DXIFF_DDS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _D3DXIFF_DDS@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	str	w8, [x20, #8]
Lloh19:
	adrp	x8, _D3D_OK@GOTPAGE
Lloh20:
	ldr	x8, [x8, _D3D_OK@GOTPAGEOFF]
	b	LBB0_9
LBB0_11:
Lloh21:
	adrp	x9, _DDS_CAPS2_CUBEMAP@GOTPAGE
Lloh22:
	ldr	x9, [x9, _DDS_CAPS2_CUBEMAP@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.12:
Lloh24:
	adrp	x9, _DDS_CAPS2_CUBEMAP_POSITIVEX@GOTPAGE
Lloh25:
	ldr	x9, [x9, _DDS_CAPS2_CUBEMAP_POSITIVEX@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x9]
Lloh27:
	adrp	x9, _DDS_CAPS2_CUBEMAP_NEGATIVEZ@GOTPAGE
Lloh28:
	ldr	x9, [x9, _DDS_CAPS2_CUBEMAP_NEGATIVEZ@GOTPAGEOFF]
Lloh29:
	ldr	w11, [x9]
	cmp	w10, w11
	b.le	LBB0_15
; %bb.13:
	mov	w5, #0
Lloh30:
	adrp	x9, _D3DRTYPE_CUBETEXTURE@GOTPAGE
Lloh31:
	ldr	x9, [x9, _D3DRTYPE_CUBETEXTURE@GOTPAGEOFF]
	b	LBB0_6
LBB0_14:
	mov	w5, #1
Lloh32:
	adrp	x9, _D3DRTYPE_TEXTURE@GOTPAGE
Lloh33:
	ldr	x9, [x9, _D3DRTYPE_TEXTURE@GOTPAGEOFF]
	b	LBB0_6
LBB0_15:
	mov	w5, #0
Lloh34:
	adrp	x9, _D3DRTYPE_CUBETEXTURE@GOTPAGE
Lloh35:
	ldr	x9, [x9, _D3DRTYPE_CUBETEXTURE@GOTPAGEOFF]
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	tst	w10, w8
	cinc	w5, w5, ne
	lsl	w10, w10, #1
	cmp	w10, w11
	b.le	LBB0_16
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_D3DXERR_INVALIDDATA,4,2        ; @D3DXERR_INVALIDDATA
	.comm	_D3DFMT_UNKNOWN,4,2             ; @D3DFMT_UNKNOWN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Pixel format is %#x\n"

	.comm	_DDS_CAPS2_VOLUME,4,2           ; @DDS_CAPS2_VOLUME
	.comm	_D3DRTYPE_VOLUMETEXTURE,4,2     ; @D3DRTYPE_VOLUMETEXTURE
	.comm	_DDS_CAPS2_CUBEMAP,4,2          ; @DDS_CAPS2_CUBEMAP
	.comm	_DDS_CAPS2_CUBEMAP_POSITIVEX,4,2 ; @DDS_CAPS2_CUBEMAP_POSITIVEX
	.comm	_DDS_CAPS2_CUBEMAP_NEGATIVEZ,4,2 ; @DDS_CAPS2_CUBEMAP_NEGATIVEZ
	.comm	_D3DRTYPE_CUBETEXTURE,4,2       ; @D3DRTYPE_CUBETEXTURE
	.comm	_D3DRTYPE_TEXTURE,4,2           ; @D3DRTYPE_TEXTURE
l_.str.1:                               ; @.str.1
	.asciz	"File is too short %u, expected at least %u bytes\n"

	.comm	_D3DXIFF_DDS,4,2                ; @D3DXIFF_DDS
	.comm	_D3D_OK,4,2                     ; @D3D_OK
	.no_dead_strip	_get_image_info_from_dds
.subsections_via_symbols
