	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function texture2d_prepare_texture
_texture2d_prepare_texture:             ## @texture2d_prepare_texture
	.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	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	8(%rdi), %r15
	movq	(%rsi), %rbx
	movl	16(%r15), %edi
	callq	_debug_d3dformat
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	movq	%r13, %rdx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_TRACE
	cmpq	$0, 48(%r15)
	je	LBB0_2
## %bb.1:
	movq	_WINED3D_TEXTURE_CONVERTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%r14)
	jmp	LBB0_4
LBB0_2:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_wined3d_format_get_color_key_conversion
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_WINED3D_TEXTURE_CONVERTED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 16(%r14)
	movl	(%rax), %esi
	movl	(%r14), %edx
	movq	%rbx, %rdi
	callq	_wined3d_get_format
	movq	%rax, %r15
	movl	16(%rax), %edi
	callq	_debug_d3dformat
	movslq	%eax, %rsi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
LBB0_4:
	movq	%r14, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	_wined3d_texture_bind_and_dirtify
	testq	%r12, %r12
	je	LBB0_6
## %bb.5:
	leaq	40(%r15), %rax
	movq	%rbx, %r12
	jmp	LBB0_10
LBB0_6:
	movq	_WINED3DUSAGE_RENDERTARGET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	movq	%rbx, %r12
	je	LBB0_9
## %bb.7:
	movq	%r14, %rdi
	callq	_wined3d_resource_is_offscreen
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	leaq	32(%r15), %rax
	jmp	LBB0_10
LBB0_9:
	leaq	24(%r15), %rax
LBB0_10:
	movq	(%rax), %rbx
	testq	%rbx, %rbx
	jne	LBB0_12
## %bb.11:
	movl	16(%r15), %edi
	callq	_debug_d3dformat
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	callq	_FIXME
LBB0_12:
	movq	8(%r15), %rdx
	movl	(%r15), %ecx
	leaq	L_.str.3(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_TRACE
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_wined3d_texture_use_immutable_storage
	movq	%r14, %rdi
	movq	%rbx, %rsi
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	%r12, %rdx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wined3d_texture_allocate_gl_immutable_storage ## TAILCALL
LBB0_14:
	movq	%r15, %rdx
	movq	%r12, %rcx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wined3d_texture_allocate_gl_mutable_storage ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"texture %p, context %p, format %s.\n"

	.comm	_WINED3D_TEXTURE_CONVERTED,4,2  ## @WINED3D_TEXTURE_CONVERTED
	.comm	_TRUE,4,2                       ## @TRUE
L_.str.1:                               ## @.str.1
	.asciz	"Using format %s for color key conversion.\n"

	.comm	_WINED3DUSAGE_RENDERTARGET,4,2  ## @WINED3DUSAGE_RENDERTARGET
L_.str.2:                               ## @.str.2
	.asciz	"No GL internal format for format %s.\n"

L_.str.3:                               ## @.str.3
	.asciz	"internal %#x, format %#x, type %#x.\n"

	.no_dead_strip	_texture2d_prepare_texture
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function texture2d_prepare_texture
_texture2d_prepare_texture:             ; @texture2d_prepare_texture
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x22, x2
	mov	x23, x1
	mov	x20, x0
	ldr	x21, [x0, #8]
	ldr	x19, [x1]
	ldr	w0, [x21, #16]
	bl	_debug_d3dformat
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x23, x0, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_TRACE
	ldr	x8, [x21, #48]
	cbz	x8, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _WINED3D_TEXTURE_CONVERTED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _WINED3D_TEXTURE_CONVERTED@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [x20, #16]
	orr	w8, w9, w8
	str	w8, [x20, #16]
	b	LBB0_4
LBB0_2:
Lloh5:
	adrp	x8, _TRUE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_wined3d_format_get_color_key_conversion
	cbz	x0, LBB0_4
; %bb.3:
Lloh8:
	adrp	x8, _WINED3D_TEXTURE_CONVERTED@GOTPAGE
Lloh9:
	ldr	x8, [x8, _WINED3D_TEXTURE_CONVERTED@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	w9, [x20, #16]
	orr	w8, w9, w8
	str	w8, [x20, #16]
	ldr	w1, [x0]
	ldr	w2, [x20]
	mov	x0, x19
	bl	_wined3d_get_format
	mov	x21, x0
	ldr	w0, [x0, #16]
	bl	_debug_d3dformat
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x1, w0
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
LBB0_4:
	mov	x0, x20
	mov	x1, x23
	mov	x2, x22
	bl	_wined3d_texture_bind_and_dirtify
	cbz	x22, LBB0_6
; %bb.5:
	add	x8, x21, #40
	ldr	x22, [x8]
	cbnz	x22, LBB0_11
	b	LBB0_10
LBB0_6:
	ldr	w8, [x20]
Lloh13:
	adrp	x9, _WINED3DUSAGE_RENDERTARGET@GOTPAGE
Lloh14:
	ldr	x9, [x9, _WINED3DUSAGE_RENDERTARGET@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.7:
	mov	x0, x20
	bl	_wined3d_resource_is_offscreen
	cbz	x0, LBB0_9
; %bb.8:
	add	x8, x21, #32
	ldr	x22, [x8]
	cbnz	x22, LBB0_11
	b	LBB0_10
LBB0_9:
	add	x8, x21, #24
	ldr	x22, [x8]
	cbnz	x22, LBB0_11
LBB0_10:
	ldr	w0, [x21, #16]
	bl	_debug_d3dformat
	mov	x1, x0
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_FIXME
LBB0_11:
	ldr	x8, [x21, #8]
	ldr	w9, [x21]
	stp	x8, x9, [sp]
Lloh18:
	adrp	x0, l_.str.3@PAGE
Lloh19:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x22
	bl	_TRACE
	mov	x0, x20
	mov	x1, x19
	bl	_wined3d_texture_use_immutable_storage
	cbz	x0, LBB0_13
; %bb.12:
	mov	x0, x20
	mov	x1, x22
	mov	x2, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_wined3d_texture_allocate_gl_immutable_storage
LBB0_13:
	mov	x0, x20
	mov	x1, x22
	mov	x2, x21
	mov	x3, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_wined3d_texture_allocate_gl_mutable_storage
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"texture %p, context %p, format %s.\n"

	.comm	_WINED3D_TEXTURE_CONVERTED,4,2  ; @WINED3D_TEXTURE_CONVERTED
	.comm	_TRUE,4,2                       ; @TRUE
l_.str.1:                               ; @.str.1
	.asciz	"Using format %s for color key conversion.\n"

	.comm	_WINED3DUSAGE_RENDERTARGET,4,2  ; @WINED3DUSAGE_RENDERTARGET
l_.str.2:                               ; @.str.2
	.asciz	"No GL internal format for format %s.\n"

l_.str.3:                               ; @.str.3
	.asciz	"internal %#x, format %#x, type %#x.\n"

	.no_dead_strip	_texture2d_prepare_texture
.subsections_via_symbols
