	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function d3dformat_to_dds_pixel_format
_d3dformat_to_dds_pixel_format:         ## @d3dformat_to_dds_pixel_format
	.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
	movq	%rsi, %r12
	movq	%rdi, %r14
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	movl	$40, (%r14)
	movq	_rgb_pixel_formats@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	je	LBB0_6
## %bb.1:
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	cmpq	%r12, (%rdi,%r13)
	je	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	addq	$32, %r13
	cmpq	%rax, %rbx
	jb	LBB0_2
LBB0_6:
	movq	%r12, %rdi
	callq	_dds_fourcc_to_d3dformat
	movq	_D3DFMT_UNKNOWN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.8:
	leaq	L_.str(%rip), %rdi
	movq	%r12, %rsi
	callq	_WARN
	movq	_E_NOTIMPL@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_DDS_PF_FOURCC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%r14)
	movq	%r12, 8(%r14)
	movq	_D3D_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_3:
	movq	_DDS_PF_RGB@GOTPCREL(%rip), %rax
	movl	16(%r14), %ecx
	orl	(%rax), %ecx
	movl	%ecx, 16(%r14)
	movl	24(%rdi,%r13), %eax
	movl	%eax, 36(%r14)
	movups	8(%rdi,%r13), %xmm0
	cmpl	$0, 8(%rdi,%r13)
	movups	%xmm0, 20(%r14)
	movq	_D3D_OK@GOTPCREL(%rip), %rax
	je	LBB0_9
## %bb.4:
	movq	_DDS_PF_ALPHA@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	%ecx, 16(%r14)
LBB0_9:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_rgb_pixel_formats,8,3          ## @rgb_pixel_formats
	.comm	_DDS_PF_RGB,4,2                 ## @DDS_PF_RGB
	.comm	_DDS_PF_ALPHA,4,2               ## @DDS_PF_ALPHA
	.comm	_D3D_OK,4,2                     ## @D3D_OK
	.comm	_D3DFMT_UNKNOWN,8,3             ## @D3DFMT_UNKNOWN
	.comm	_DDS_PF_FOURCC,4,2              ## @DDS_PF_FOURCC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unknown pixel format %#x\n"

	.comm	_E_NOTIMPL,4,2                  ## @E_NOTIMPL
	.no_dead_strip	_d3dformat_to_dds_pixel_format
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d3dformat_to_dds_pixel_format
_d3dformat_to_dds_pixel_format:         ; @d3dformat_to_dds_pixel_format
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
	mov	w21, #40
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	str	w21, [x19]
Lloh0:
	adrp	x21, _rgb_pixel_formats@GOTPAGE
Lloh1:
	ldr	x21, [x21, _rgb_pixel_formats@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_4
; %bb.1:
	mov	x22, #0
	mov	x23, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21]
	ldr	x8, [x0, x22]
	cmp	x8, x20
	b.eq	LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x23, x23, #1
	bl	_ARRAY_SIZE
	add	x22, x22, #32
	cmp	x23, w0, uxtw
	b.lo	LBB0_2
LBB0_4:
	mov	x0, x20
	bl	_dds_fourcc_to_d3dformat
Lloh2:
	adrp	x8, _D3DFMT_UNKNOWN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _D3DFMT_UNKNOWN@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.5:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_WARN
Lloh7:
	adrp	x8, _E_NOTIMPL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _E_NOTIMPL@GOTPAGEOFF]
	b	LBB0_10
LBB0_6:
Lloh9:
	adrp	x8, _DDS_PF_FOURCC@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DDS_PF_FOURCC@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w9, [x19, #16]
	orr	w8, w9, w8
	str	w8, [x19, #16]
	str	x20, [x19, #8]
	b	LBB0_9
LBB0_7:
Lloh12:
	adrp	x8, _DDS_PF_RGB@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DDS_PF_RGB@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	ldr	w9, [x19, #16]
	orr	w8, w9, w8
	str	w8, [x19, #16]
	add	x9, x0, x22
	ldr	w10, [x9, #24]
	str	w10, [x19, #36]
	ldur	q0, [x9, #8]
	stur	q0, [x19, #20]
	fmov	w9, s0
	cbz	w9, LBB0_9
; %bb.8:
Lloh15:
	adrp	x9, _DDS_PF_ALPHA@GOTPAGE
Lloh16:
	ldr	x9, [x9, _DDS_PF_ALPHA@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19, #16]
LBB0_9:
Lloh18:
	adrp	x8, _D3D_OK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _D3D_OK@GOTPAGEOFF]
LBB0_10:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_rgb_pixel_formats,8,3          ; @rgb_pixel_formats
	.comm	_DDS_PF_RGB,4,2                 ; @DDS_PF_RGB
	.comm	_DDS_PF_ALPHA,4,2               ; @DDS_PF_ALPHA
	.comm	_D3D_OK,4,2                     ; @D3D_OK
	.comm	_D3DFMT_UNKNOWN,8,3             ; @D3DFMT_UNKNOWN
	.comm	_DDS_PF_FOURCC,4,2              ; @DDS_PF_FOURCC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unknown pixel format %#x\n"

	.comm	_E_NOTIMPL,4,2                  ; @E_NOTIMPL
	.no_dead_strip	_d3dformat_to_dds_pixel_format
.subsections_via_symbols
