	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DDSD2_to_DDSD                  ## -- Begin function DDSD2_to_DDSD
	.p2align	4, 0x90
_DDSD2_to_DDSD:                         ## @DDSD2_to_DDSD
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	xorl	%esi, %esi
	movl	$72, %edx
	callq	_memset
	movl	$72, (%r14)
	movl	(%rbx), %ecx
	movl	%ecx, 4(%r14)
	movq	_DDSD_WIDTH@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_2
## %bb.1:
	movl	60(%rbx), %eax
	movl	%eax, 68(%r14)
LBB0_2:
	movq	_DDSD_HEIGHT@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_4
## %bb.3:
	movl	56(%rbx), %eax
	movl	%eax, 64(%r14)
LBB0_4:
	movq	_DDSD_PIXELFORMAT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	testl	%ecx, %edx
	je	LBB0_5
## %bb.6:
	movl	52(%rbx), %eax
	movl	%eax, 60(%r14)
	movl	(%rbx), %eax
	movq	_DDSD_CAPS@GOTPCREL(%rip), %rsi
	testl	%eax, (%rsi)
	je	LBB0_9
## %bb.7:
	movq	_DDSCAPS_ZBUFFER@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	testl	%esi, 48(%rbx)
	je	LBB0_9
## %bb.8:
	notl	%edx
	andl	%edx, %ecx
	movq	_DDSD_ZBUFFERBITDEPTH@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	%ecx, 4(%r14)
	movl	52(%rbx), %ecx
	movl	%ecx, 24(%r14)
	jmp	LBB0_9
LBB0_5:
	movl	%ecx, %eax
LBB0_9:
	movl	48(%rbx), %ecx
	movl	%ecx, 56(%r14)
	movq	_DDSD_PITCH@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.10:
	movl	8(%rbx), %ecx
	movl	%ecx, 12(%r14)
LBB0_11:
	movq	_DDSD_BACKBUFFERCOUNT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_13
## %bb.12:
	movl	44(%rbx), %ecx
	movl	%ecx, 52(%r14)
LBB0_13:
	movq	_DDSD_ZBUFFERBITDEPTH@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_15
## %bb.14:
	movl	16(%rbx), %ecx
	movl	%ecx, 24(%r14)
LBB0_15:
	movq	_DDSD_ALPHABITDEPTH@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_17
## %bb.16:
	movl	40(%rbx), %ecx
	movl	%ecx, 48(%r14)
LBB0_17:
	movl	36(%rbx), %ecx
	movl	%ecx, 44(%r14)
	movq	_DDSD_CKDESTOVERLAY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_19
## %bb.18:
	movl	32(%rbx), %ecx
	movl	%ecx, 40(%r14)
LBB0_19:
	movq	_DDSD_CKDESTBLT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_21
## %bb.20:
	movl	28(%rbx), %ecx
	movl	%ecx, 36(%r14)
LBB0_21:
	movq	_DDSD_CKSRCOVERLAY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_23
## %bb.22:
	movl	24(%rbx), %ecx
	movl	%ecx, 32(%r14)
LBB0_23:
	movq	_DDSD_CKSRCBLT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_25
## %bb.24:
	movl	20(%rbx), %ecx
	movl	%ecx, 28(%r14)
LBB0_25:
	movq	_DDSD_MIPMAPCOUNT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_27
## %bb.26:
	movl	16(%rbx), %ecx
	movl	%ecx, 20(%r14)
LBB0_27:
	movq	_DDSD_REFRESHRATE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_29
## %bb.28:
	movl	12(%rbx), %ecx
	movl	%ecx, 16(%r14)
LBB0_29:
	movq	_DDSD_LINEARSIZE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_31
## %bb.30:
	movl	4(%rbx), %ecx
	movl	%ecx, 8(%r14)
LBB0_31:
	movq	_DDSD_TEXTURESTAGE@GOTPCREL(%rip), %r15
	testl	%eax, (%r15)
	je	LBB0_33
## %bb.32:
	leaq	L_.str(%rip), %rdi
	callq	_WARN
	movl	(%rbx), %eax
LBB0_33:
	movq	_DDSD_FVF@GOTPCREL(%rip), %r12
	testl	%eax, (%r12)
	je	LBB0_35
## %bb.34:
	leaq	L_.str.1(%rip), %rdi
	callq	_WARN
	movl	(%rbx), %eax
LBB0_35:
	movq	_DDSD_SRCVBHANDLE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	testl	%eax, %ecx
	je	LBB0_37
## %bb.36:
	leaq	L_.str.2(%rip), %rdi
	callq	_WARN
	movl	(%rbx), %ecx
LBB0_37:
	movl	(%r12), %eax
	orl	(%r15), %eax
	orl	%ecx, %eax
	notl	%eax
	andl	%eax, 4(%r14)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DDSD_WIDTH,4,2                 ## @DDSD_WIDTH
	.comm	_DDSD_HEIGHT,4,2                ## @DDSD_HEIGHT
	.comm	_DDSD_PIXELFORMAT,4,2           ## @DDSD_PIXELFORMAT
	.comm	_DDSD_CAPS,4,2                  ## @DDSD_CAPS
	.comm	_DDSCAPS_ZBUFFER,4,2            ## @DDSCAPS_ZBUFFER
	.comm	_DDSD_ZBUFFERBITDEPTH,4,2       ## @DDSD_ZBUFFERBITDEPTH
	.comm	_DDSD_PITCH,4,2                 ## @DDSD_PITCH
	.comm	_DDSD_BACKBUFFERCOUNT,4,2       ## @DDSD_BACKBUFFERCOUNT
	.comm	_DDSD_ALPHABITDEPTH,4,2         ## @DDSD_ALPHABITDEPTH
	.comm	_DDSD_CKDESTOVERLAY,4,2         ## @DDSD_CKDESTOVERLAY
	.comm	_DDSD_CKDESTBLT,4,2             ## @DDSD_CKDESTBLT
	.comm	_DDSD_CKSRCOVERLAY,4,2          ## @DDSD_CKSRCOVERLAY
	.comm	_DDSD_CKSRCBLT,4,2              ## @DDSD_CKSRCBLT
	.comm	_DDSD_MIPMAPCOUNT,4,2           ## @DDSD_MIPMAPCOUNT
	.comm	_DDSD_REFRESHRATE,4,2           ## @DDSD_REFRESHRATE
	.comm	_DDSD_LINEARSIZE,4,2            ## @DDSD_LINEARSIZE
	.comm	_DDSD_TEXTURESTAGE,4,2          ## @DDSD_TEXTURESTAGE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Does not exist in DDSURFACEDESC: DDSD_TEXTURESTAGE\n"

	.comm	_DDSD_FVF,4,2                   ## @DDSD_FVF
L_.str.1:                               ## @.str.1
	.asciz	"Does not exist in DDSURFACEDESC: DDSD_FVF\n"

	.comm	_DDSD_SRCVBHANDLE,4,2           ## @DDSD_SRCVBHANDLE
L_.str.2:                               ## @.str.2
	.asciz	"Does not exist in DDSURFACEDESC: DDSD_SRCVBHANDLE\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DDSD2_to_DDSD                  ; -- Begin function DDSD2_to_DDSD
	.p2align	2
_DDSD2_to_DDSD:                         ; @DDSD2_to_DDSD
	.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	x19, x1
	mov	x20, x0
	mov	w21, #72
	mov	x0, x1
	mov	w1, #0
	mov	w2, #72
	bl	_memset
	ldr	w10, [x20]
	stp	w21, w10, [x19]
Lloh0:
	adrp	x8, _DDSD_WIDTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DDSD_WIDTH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w10
	b.eq	LBB0_2
; %bb.1:
	ldr	w8, [x20, #60]
	str	w8, [x19, #68]
LBB0_2:
Lloh3:
	adrp	x8, _DDSD_HEIGHT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DDSD_HEIGHT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w10
	b.eq	LBB0_4
; %bb.3:
	ldr	w8, [x20, #56]
	str	w8, [x19, #64]
LBB0_4:
Lloh6:
	adrp	x8, _DDSD_PIXELFORMAT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DDSD_PIXELFORMAT@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x8]
Lloh9:
	adrp	x9, _DDSD_ZBUFFERBITDEPTH@GOTPAGE
Lloh10:
	ldr	x9, [x9, _DDSD_ZBUFFERBITDEPTH@GOTPAGEOFF]
	tst	w11, w10
	b.eq	LBB0_8
; %bb.5:
	ldr	w8, [x20, #52]
	str	w8, [x19, #60]
	ldr	w8, [x20]
Lloh11:
	adrp	x12, _DDSD_CAPS@GOTPAGE
Lloh12:
	ldr	x12, [x12, _DDSD_CAPS@GOTPAGEOFF]
Lloh13:
	ldr	w12, [x12]
	tst	w12, w8
	b.eq	LBB0_9
; %bb.6:
	ldr	w12, [x20, #48]
Lloh14:
	adrp	x13, _DDSCAPS_ZBUFFER@GOTPAGE
Lloh15:
	ldr	x13, [x13, _DDSCAPS_ZBUFFER@GOTPAGEOFF]
Lloh16:
	ldr	w13, [x13]
	tst	w13, w12
	b.eq	LBB0_9
; %bb.7:
	bic	w10, w10, w11
	ldr	w11, [x9]
	orr	w10, w11, w10
	str	w10, [x19, #4]
	ldr	w10, [x20, #52]
	str	w10, [x19, #24]
	b	LBB0_9
LBB0_8:
	mov	x8, x10
LBB0_9:
	ldr	w10, [x20, #48]
	str	w10, [x19, #56]
Lloh17:
	adrp	x10, _DDSD_PITCH@GOTPAGE
Lloh18:
	ldr	x10, [x10, _DDSD_PITCH@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_11
; %bb.10:
	ldr	w10, [x20, #8]
	str	w10, [x19, #12]
LBB0_11:
Lloh20:
	adrp	x10, _DDSD_BACKBUFFERCOUNT@GOTPAGE
Lloh21:
	ldr	x10, [x10, _DDSD_BACKBUFFERCOUNT@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_13
; %bb.12:
	ldr	w10, [x20, #44]
	str	w10, [x19, #52]
LBB0_13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.14:
	ldr	w9, [x20, #16]
	str	w9, [x19, #24]
LBB0_15:
Lloh23:
	adrp	x9, _DDSD_ALPHABITDEPTH@GOTPAGE
Lloh24:
	ldr	x9, [x9, _DDSD_ALPHABITDEPTH@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_17
; %bb.16:
	ldr	w9, [x20, #40]
	str	w9, [x19, #48]
LBB0_17:
	ldr	w9, [x20, #36]
	str	w9, [x19, #44]
Lloh26:
	adrp	x9, _DDSD_CKDESTOVERLAY@GOTPAGE
Lloh27:
	ldr	x9, [x9, _DDSD_CKDESTOVERLAY@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_19
; %bb.18:
	ldr	w9, [x20, #32]
	str	w9, [x19, #40]
LBB0_19:
Lloh29:
	adrp	x9, _DDSD_CKDESTBLT@GOTPAGE
Lloh30:
	ldr	x9, [x9, _DDSD_CKDESTBLT@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_21
; %bb.20:
	ldr	w9, [x20, #28]
	str	w9, [x19, #36]
LBB0_21:
Lloh32:
	adrp	x9, _DDSD_CKSRCOVERLAY@GOTPAGE
Lloh33:
	ldr	x9, [x9, _DDSD_CKSRCOVERLAY@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_23
; %bb.22:
	ldr	w9, [x20, #24]
	str	w9, [x19, #32]
LBB0_23:
Lloh35:
	adrp	x9, _DDSD_CKSRCBLT@GOTPAGE
Lloh36:
	ldr	x9, [x9, _DDSD_CKSRCBLT@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_25
; %bb.24:
	ldr	w9, [x20, #20]
	str	w9, [x19, #28]
LBB0_25:
Lloh38:
	adrp	x9, _DDSD_MIPMAPCOUNT@GOTPAGE
Lloh39:
	ldr	x9, [x9, _DDSD_MIPMAPCOUNT@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_27
; %bb.26:
	ldr	w9, [x20, #16]
	str	w9, [x19, #20]
LBB0_27:
Lloh41:
	adrp	x9, _DDSD_REFRESHRATE@GOTPAGE
Lloh42:
	ldr	x9, [x9, _DDSD_REFRESHRATE@GOTPAGEOFF]
Lloh43:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_29
; %bb.28:
	ldr	w9, [x20, #12]
	str	w9, [x19, #16]
LBB0_29:
Lloh44:
	adrp	x9, _DDSD_LINEARSIZE@GOTPAGE
Lloh45:
	ldr	x9, [x9, _DDSD_LINEARSIZE@GOTPAGEOFF]
Lloh46:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_31
; %bb.30:
	ldr	w9, [x20, #4]
	str	w9, [x19, #8]
LBB0_31:
Lloh47:
	adrp	x21, _DDSD_TEXTURESTAGE@GOTPAGE
Lloh48:
	ldr	x21, [x21, _DDSD_TEXTURESTAGE@GOTPAGEOFF]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_33
; %bb.32:
Lloh49:
	adrp	x0, l_.str@PAGE
Lloh50:
	add	x0, x0, l_.str@PAGEOFF
	bl	_WARN
	ldr	w8, [x20]
LBB0_33:
Lloh51:
	adrp	x22, _DDSD_FVF@GOTPAGE
Lloh52:
	ldr	x22, [x22, _DDSD_FVF@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_35
; %bb.34:
Lloh53:
	adrp	x0, l_.str.1@PAGE
Lloh54:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_WARN
	ldr	w8, [x20]
LBB0_35:
Lloh55:
	adrp	x20, _DDSD_SRCVBHANDLE@GOTPAGE
Lloh56:
	ldr	x20, [x20, _DDSD_SRCVBHANDLE@GOTPAGEOFF]
	ldr	w9, [x20]
	tst	w9, w8
	b.eq	LBB0_37
; %bb.36:
Lloh57:
	adrp	x0, l_.str.2@PAGE
Lloh58:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_WARN
	ldr	w9, [x20]
LBB0_37:
	ldr	w8, [x21]
	ldr	w10, [x22]
	orr	w8, w10, w8
	orr	w8, w8, w9
	ldr	w9, [x19, #4]
	bic	w8, w9, w8
	str	w8, [x19, #4]
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpAdd	Lloh49, Lloh50
	.loh AdrpLdrGot	Lloh51, Lloh52
	.loh AdrpAdd	Lloh53, Lloh54
	.loh AdrpLdrGot	Lloh55, Lloh56
	.loh AdrpAdd	Lloh57, Lloh58
	.cfi_endproc
                                        ; -- End function
	.comm	_DDSD_WIDTH,4,2                 ; @DDSD_WIDTH
	.comm	_DDSD_HEIGHT,4,2                ; @DDSD_HEIGHT
	.comm	_DDSD_PIXELFORMAT,4,2           ; @DDSD_PIXELFORMAT
	.comm	_DDSD_CAPS,4,2                  ; @DDSD_CAPS
	.comm	_DDSCAPS_ZBUFFER,4,2            ; @DDSCAPS_ZBUFFER
	.comm	_DDSD_ZBUFFERBITDEPTH,4,2       ; @DDSD_ZBUFFERBITDEPTH
	.comm	_DDSD_PITCH,4,2                 ; @DDSD_PITCH
	.comm	_DDSD_BACKBUFFERCOUNT,4,2       ; @DDSD_BACKBUFFERCOUNT
	.comm	_DDSD_ALPHABITDEPTH,4,2         ; @DDSD_ALPHABITDEPTH
	.comm	_DDSD_CKDESTOVERLAY,4,2         ; @DDSD_CKDESTOVERLAY
	.comm	_DDSD_CKDESTBLT,4,2             ; @DDSD_CKDESTBLT
	.comm	_DDSD_CKSRCOVERLAY,4,2          ; @DDSD_CKSRCOVERLAY
	.comm	_DDSD_CKSRCBLT,4,2              ; @DDSD_CKSRCBLT
	.comm	_DDSD_MIPMAPCOUNT,4,2           ; @DDSD_MIPMAPCOUNT
	.comm	_DDSD_REFRESHRATE,4,2           ; @DDSD_REFRESHRATE
	.comm	_DDSD_LINEARSIZE,4,2            ; @DDSD_LINEARSIZE
	.comm	_DDSD_TEXTURESTAGE,4,2          ; @DDSD_TEXTURESTAGE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Does not exist in DDSURFACEDESC: DDSD_TEXTURESTAGE\n"

	.comm	_DDSD_FVF,4,2                   ; @DDSD_FVF
l_.str.1:                               ; @.str.1
	.asciz	"Does not exist in DDSURFACEDESC: DDSD_FVF\n"

	.comm	_DDSD_SRCVBHANDLE,4,2           ; @DDSD_SRCVBHANDLE
l_.str.2:                               ; @.str.2
	.asciz	"Does not exist in DDSURFACEDESC: DDSD_SRCVBHANDLE\n"

.subsections_via_symbols
