	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dds_pixel_format_to_d3dformat
_dds_pixel_format_to_d3dformat:         ## @dds_pixel_format_to_d3dformat
	.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
	movq	%rdi, %rbx
	movl	28(%rdi), %esi
	movl	24(%rdi), %ecx
	movl	(%rdi), %edx
	movl	20(%rdi), %r8d
	leaq	L_.str(%rip), %rdi
	callq	_TRACE
	movl	16(%rbx), %esi
	movl	12(%rbx), %ecx
	movl	4(%rbx), %edx
	movl	8(%rbx), %r8d
	leaq	L_.str.1(%rip), %rdi
	callq	_TRACE
	movl	(%rbx), %esi
	movq	_DDS_PF_FOURCC@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_1
## %bb.7:
	movl	24(%rbx), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_dds_fourcc_to_d3dformat        ## TAILCALL
LBB0_1:
	movq	_DDS_PF_RGB@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_2
## %bb.8:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_dds_rgb_to_d3dformat           ## TAILCALL
LBB0_2:
	movq	_DDS_PF_LUMINANCE@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_3
## %bb.9:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_dds_luminance_to_d3dformat     ## TAILCALL
LBB0_3:
	movq	_DDS_PF_ALPHA_ONLY@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_4
## %bb.10:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_dds_alpha_to_d3dformat         ## TAILCALL
LBB0_4:
	movq	_DDS_PF_BUMPDUDV@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_5
## %bb.11:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_dds_bump_to_d3dformat          ## TAILCALL
LBB0_5:
	movq	_DDS_PF_BUMPLUMINANCE@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_6
## %bb.12:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_dds_bump_luminance_to_d3dformat ## TAILCALL
LBB0_6:
	movl	24(%rbx), %edx
	movl	20(%rbx), %ecx
	movl	16(%rbx), %r8d
	movl	12(%rbx), %eax
	movl	4(%rbx), %r9d
	movl	8(%rbx), %ebx
	leaq	L_.str.2(%rip), %rdi
	pushq	%rbx
	pushq	%rax
	callq	_WARN
	addq	$16, %rsp
	movq	_D3DFMT_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pixel_format: size %u, flags %#x, fourcc %#x, bpp %u.\n"

L_.str.1:                               ## @.str.1
	.asciz	"rmask %#x, gmask %#x, bmask %#x, amask %#x.\n"

	.comm	_DDS_PF_FOURCC,4,2              ## @DDS_PF_FOURCC
	.comm	_DDS_PF_RGB,4,2                 ## @DDS_PF_RGB
	.comm	_DDS_PF_LUMINANCE,4,2           ## @DDS_PF_LUMINANCE
	.comm	_DDS_PF_ALPHA_ONLY,4,2          ## @DDS_PF_ALPHA_ONLY
	.comm	_DDS_PF_BUMPDUDV,4,2            ## @DDS_PF_BUMPDUDV
	.comm	_DDS_PF_BUMPLUMINANCE,4,2       ## @DDS_PF_BUMPLUMINANCE
L_.str.2:                               ## @.str.2
	.asciz	"Unknown pixel format (flags %#x, fourcc %#x, bpp %u, r %#x, g %#x, b %#x, a %#x)\n"

	.comm	_D3DFMT_UNKNOWN,4,2             ## @D3DFMT_UNKNOWN
	.no_dead_strip	_dds_pixel_format_to_d3dformat
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dds_pixel_format_to_d3dformat
_dds_pixel_format_to_d3dformat:         ; @dds_pixel_format_to_d3dformat
	.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
	mov	x19, x0
	ldp	w3, w1, [x0, #24]
	ldr	w2, [x0]
	ldr	w4, [x0, #20]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	ldp	w3, w1, [x19, #12]
	ldp	w2, w4, [x19, #4]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
	ldr	w1, [x19]
Lloh4:
	adrp	x8, _DDS_PF_FOURCC@GOTPAGE
Lloh5:
	ldr	x8, [x8, _DDS_PF_FOURCC@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	tst	w8, w1
	b.eq	LBB0_2
; %bb.1:
	ldr	w0, [x19, #24]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_dds_fourcc_to_d3dformat
LBB0_2:
Lloh7:
	adrp	x8, _DDS_PF_RGB@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DDS_PF_RGB@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	tst	w8, w1
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_dds_rgb_to_d3dformat
LBB0_4:
Lloh10:
	adrp	x8, _DDS_PF_LUMINANCE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DDS_PF_LUMINANCE@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	tst	w8, w1
	b.eq	LBB0_6
; %bb.5:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_dds_luminance_to_d3dformat
LBB0_6:
Lloh13:
	adrp	x8, _DDS_PF_ALPHA_ONLY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DDS_PF_ALPHA_ONLY@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	tst	w8, w1
	b.eq	LBB0_8
; %bb.7:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_dds_alpha_to_d3dformat
LBB0_8:
Lloh16:
	adrp	x8, _DDS_PF_BUMPDUDV@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DDS_PF_BUMPDUDV@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	tst	w8, w1
	b.eq	LBB0_10
; %bb.9:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_dds_bump_to_d3dformat
LBB0_10:
Lloh19:
	adrp	x8, _DDS_PF_BUMPLUMINANCE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DDS_PF_BUMPLUMINANCE@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	tst	w8, w1
	b.eq	LBB0_12
; %bb.11:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_dds_bump_luminance_to_d3dformat
LBB0_12:
	ldp	w3, w2, [x19, #20]
	ldp	w6, w4, [x19, #12]
	ldp	w5, w7, [x19, #4]
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_WARN
Lloh24:
	adrp	x8, _D3DFMT_UNKNOWN@GOTPAGE
Lloh25:
	ldr	x8, [x8, _D3DFMT_UNKNOWN@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pixel_format: size %u, flags %#x, fourcc %#x, bpp %u.\n"

l_.str.1:                               ; @.str.1
	.asciz	"rmask %#x, gmask %#x, bmask %#x, amask %#x.\n"

	.comm	_DDS_PF_FOURCC,4,2              ; @DDS_PF_FOURCC
	.comm	_DDS_PF_RGB,4,2                 ; @DDS_PF_RGB
	.comm	_DDS_PF_LUMINANCE,4,2           ; @DDS_PF_LUMINANCE
	.comm	_DDS_PF_ALPHA_ONLY,4,2          ; @DDS_PF_ALPHA_ONLY
	.comm	_DDS_PF_BUMPDUDV,4,2            ; @DDS_PF_BUMPDUDV
	.comm	_DDS_PF_BUMPLUMINANCE,4,2       ; @DDS_PF_BUMPLUMINANCE
l_.str.2:                               ; @.str.2
	.asciz	"Unknown pixel format (flags %#x, fourcc %#x, bpp %u, r %#x, g %#x, b %#x, a %#x)\n"

	.comm	_D3DFMT_UNKNOWN,4,2             ; @D3DFMT_UNKNOWN
	.no_dead_strip	_dds_pixel_format_to_d3dformat
.subsections_via_symbols
