	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function d3d10_init_texture
LCPI0_0:
	.long	0x3f800000                      ## float 1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_d3d10_init_texture
	.p2align	4, 0x90
_d3d10_init_texture:                    ## @d3d10_init_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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movl	%edi, %r14d
	movq	_D3D10_BIND_RENDER_TARGET@GOTPCREL(%rip), %r13
	movl	(%r13), %r12d
	andl	(%rsi), %r12d
	movq	_D3D10_FORMAT_SUPPORT_TEXTURE2D@GOTPCREL(%rip), %rax
	movq	_D3D10_FORMAT_SUPPORT_SHADER_SAMPLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	orl	(%rax), %r15d
	movq	%rsi, %rdi
	callq	_d3d10_release_texture
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 4(%rbx)
	movl	$1, 56(%rbx)
	movq	$0, 64(%rbx)
	movq	_D3D10_BIND_SHADER_RESOURCE@GOTPCREL(%rip), %rcx
	movl	(%rbx), %eax
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
	movq	16(%rbx), %rcx
	movq	_D3D10_USAGE_DYNAMIC@GOTPCREL(%rip), %rdx
	movq	_D3D10_CPU_ACCESS_WRITE@GOTPCREL(%rip), %rsi
	cmpq	(%rdx), %rcx
	jne	LBB0_1
## %bb.2:
	movq	(%rsi), %rcx
	jmp	LBB0_3
LBB0_1:
	xorl	%ecx, %ecx
LBB0_3:
	movq	%rcx, 40(%rbx)
	movq	_D3D10_RESOURCE_MISC_GENERATE_MIPS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 24(%rbx)
	je	LBB0_10
## %bb.4:
	orl	(%r13), %eax
	movl	%eax, (%rbx)
	movl	28(%rbx), %ecx
	cmpl	$32, %ecx
	jb	LBB0_10
## %bb.5:
	movl	32(%rbx), %edx
	cmpl	$32, %edx
	jb	LBB0_10
## %bb.6:
	sarl	$5, %edx
	sarl	$5, %ecx
	movl	$1, %esi
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	incl	%esi
	cmpl	$2, %ecx
	jb	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	shrl	%ecx
	movl	%edx, %edi
	shrl	%edi
	cmpl	$1, %edx
	movl	%edi, %edx
	ja	LBB0_7
LBB0_9:
	movl	%esi, 4(%rbx)
LBB0_10:
	andl	(%r13), %eax
	je	LBB0_12
## %bb.11:
	movq	_D3D10_FORMAT_SUPPORT_RENDER_TARGET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_12:
	orl	%eax, %r15d
	movl	48(%rbx), %esi
	movl	%r14d, %edi
	movl	%r15d, %edx
	callq	_d3d10_get_closest_match
	movl	%eax, 48(%rbx)
	leaq	96(%rbx), %rcx
	movl	%r14d, %edi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_D3D10CreateTexture2D
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -96(%rbp)
	movaps	%xmm0, -112(%rbp)
	movl	48(%rbx), %eax
	movl	%eax, -92(%rbp)
	movq	_D3D_SRV_DIMENSION_TEXTURE2D@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -96(%rbp)
	movl	$-1, -112(%rbp)
	movl	96(%rbx), %esi
	leaq	100(%rbx), %rcx
	leaq	-112(%rbp), %rdx
	movl	%r14d, %edi
	callq	_D3D10CreateTexture2DShaderResourceView
	testl	%r12d, %r12d
	je	LBB0_14
## %bb.13:
	movl	96(%rbx), %esi
	leaq	92(%rbx), %rcx
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_D3D10CreateTexture2DRenderTargetView
	jmp	LBB0_15
LBB0_14:
	movups	(%rbx), %xmm0
	movups	16(%rbx), %xmm1
	movups	32(%rbx), %xmm2
	movups	48(%rbx), %xmm3
	movaps	%xmm0, -112(%rbp)
	movaps	%xmm1, -96(%rbp)
	movaps	%xmm2, -80(%rbp)
	movq	64(%rbx), %rax
	movq	%rax, -48(%rbp)
	movaps	%xmm3, -64(%rbp)
	movabsq	$4294967296, %rax               ## imm = 0x100000000
	movq	%rax, -112(%rbp)
	movl	$0, -88(%rbp)
	movq	_D3D10_USAGE_STAGING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -96(%rbp)
	movq	_D3D10_CPU_ACCESS_WRITE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)
	leaq	88(%rbx), %rcx
	leaq	-112(%rbp), %rsi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_D3D10CreateTexture2D
LBB0_15:
	movl	28(%rbx), %eax
	movl	32(%rbx), %ecx
	movl	%eax, 72(%rbx)
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	movaps	%xmm1, %xmm2
	divss	%xmm0, %xmm2
	xorps	%xmm0, %xmm0
	cvtsi2ss	%ecx, %xmm0
	movl	%ecx, 76(%rbx)
	movss	%xmm2, 80(%rbx)
	divss	%xmm0, %xmm1
	movss	%xmm1, 84(%rbx)
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_D3D10_BIND_RENDER_TARGET,4,2   ## @D3D10_BIND_RENDER_TARGET
	.comm	_D3D10_FORMAT_SUPPORT_TEXTURE2D,4,2 ## @D3D10_FORMAT_SUPPORT_TEXTURE2D
	.comm	_D3D10_FORMAT_SUPPORT_SHADER_SAMPLE,4,2 ## @D3D10_FORMAT_SUPPORT_SHADER_SAMPLE
	.comm	_D3D10_BIND_SHADER_RESOURCE,4,2 ## @D3D10_BIND_SHADER_RESOURCE
	.comm	_D3D10_USAGE_DYNAMIC,8,3        ## @D3D10_USAGE_DYNAMIC
	.comm	_D3D10_CPU_ACCESS_WRITE,8,3     ## @D3D10_CPU_ACCESS_WRITE
	.comm	_D3D10_RESOURCE_MISC_GENERATE_MIPS,4,2 ## @D3D10_RESOURCE_MISC_GENERATE_MIPS
	.comm	_D3D10_FORMAT_SUPPORT_RENDER_TARGET,4,2 ## @D3D10_FORMAT_SUPPORT_RENDER_TARGET
	.comm	_DXGI_FORMAT_UNKNOWN,4,2        ## @DXGI_FORMAT_UNKNOWN
	.comm	_D3D_SRV_DIMENSION_TEXTURE2D,4,2 ## @D3D_SRV_DIMENSION_TEXTURE2D
	.comm	_D3D10_USAGE_STAGING,8,3        ## @D3D10_USAGE_STAGING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function d3d10_init_texture
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_d3d10_init_texture
	.p2align	2
_d3d10_init_texture:                    ; @d3d10_init_texture
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x19, x1
	mov	x20, x0
	ldr	w8, [x1]
Lloh0:
	adrp	x23, _D3D10_BIND_RENDER_TARGET@GOTPAGE
Lloh1:
	ldr	x23, [x23, _D3D10_BIND_RENDER_TARGET@GOTPAGEOFF]
	ldr	w9, [x23]
Lloh2:
	adrp	x10, _D3D10_FORMAT_SUPPORT_TEXTURE2D@GOTPAGE
Lloh3:
	ldr	x10, [x10, _D3D10_FORMAT_SUPPORT_TEXTURE2D@GOTPAGEOFF]
	and	w21, w9, w8
Lloh4:
	ldr	w8, [x10]
Lloh5:
	adrp	x9, _D3D10_FORMAT_SUPPORT_SHADER_SAMPLE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _D3D10_FORMAT_SUPPORT_SHADER_SAMPLE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w24, w9, w8
	mov	x0, x1
	bl	_d3d10_release_texture
	movi.2s	v0, #1
	stur	d0, [x19, #4]
	mov	w8, #1
	str	w8, [x19, #56]
	str	xzr, [x19, #64]
Lloh8:
	adrp	x8, _D3D10_BIND_SHADER_RESOURCE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _D3D10_BIND_SHADER_RESOURCE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	ldr	x9, [x19, #16]
Lloh11:
	adrp	x10, _D3D10_USAGE_DYNAMIC@GOTPAGE
Lloh12:
	ldr	x10, [x10, _D3D10_USAGE_DYNAMIC@GOTPAGEOFF]
Lloh13:
	ldr	x10, [x10]
Lloh14:
	adrp	x22, _D3D10_CPU_ACCESS_WRITE@GOTPAGE
Lloh15:
	ldr	x22, [x22, _D3D10_CPU_ACCESS_WRITE@GOTPAGEOFF]
	ldr	x11, [x22]
	cmp	x9, x10
	csel	x9, x11, xzr, eq
	str	x9, [x19, #40]
	ldr	w9, [x19, #24]
Lloh16:
	adrp	x10, _D3D10_RESOURCE_MISC_GENERATE_MIPS@GOTPAGE
Lloh17:
	ldr	x10, [x10, _D3D10_RESOURCE_MISC_GENERATE_MIPS@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_7
; %bb.1:
	ldr	w9, [x23]
	orr	w8, w9, w8
	str	w8, [x19]
	ldr	w9, [x19, #28]
	cmp	w9, #32
	b.lo	LBB0_7
; %bb.2:
	ldr	w10, [x19, #32]
	cmp	w10, #32
	b.lo	LBB0_7
; %bb.3:
	asr	w10, w10, #5
	asr	w11, w9, #5
	mov	w9, #1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	w9, w9, #1
	cmp	w11, #2
	b.lo	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	lsr	w11, w11, #1
	lsr	w12, w10, #1
	cmp	w10, #1
	mov	x10, x12
	b.hi	LBB0_4
LBB0_6:
	str	w9, [x19, #4]
LBB0_7:
Lloh19:
	adrp	x9, _D3D10_FORMAT_SUPPORT_RENDER_TARGET@GOTPAGE
Lloh20:
	ldr	x9, [x9, _D3D10_FORMAT_SUPPORT_RENDER_TARGET@GOTPAGEOFF]
	ldr	w10, [x23]
Lloh21:
	ldr	w9, [x9]
	tst	w10, w8
	csel	w8, wzr, w9, eq
	orr	w2, w24, w8
	ldr	w1, [x19, #48]
	mov	x0, x20
	bl	_d3d10_get_closest_match
	str	w0, [x19, #48]
	add	x3, x19, #96
	mov	x0, x20
	mov	x1, x19
	mov	x2, #0
	bl	_D3D10CreateTexture2D
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp]
	ldr	w8, [x19, #48]
	str	w8, [sp, #20]
Lloh22:
	adrp	x8, _D3D_SRV_DIMENSION_TEXTURE2D@GOTPAGE
Lloh23:
	ldr	x8, [x8, _D3D_SRV_DIMENSION_TEXTURE2D@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	mov	w9, #-1
	str	w8, [sp, #16]
	str	w9, [sp]
	ldr	w1, [x19, #96]
	add	x3, x19, #100
	mov	x2, sp
	mov	x0, x20
	bl	_D3D10CreateTexture2DShaderResourceView
	cbz	w21, LBB0_9
; %bb.8:
	ldr	w1, [x19, #96]
	add	x3, x19, #92
	mov	x0, x20
	mov	x2, #0
	bl	_D3D10CreateTexture2DRenderTargetView
	b	LBB0_10
LBB0_9:
	ldp	q0, q1, [x19]
	stp	q0, q1, [sp]
	ldp	q0, q1, [x19, #32]
	stp	q0, q1, [sp, #32]
Lloh25:
	adrp	x8, lCPI0_0@PAGE
Lloh26:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
Lloh27:
	adrp	x8, _D3D10_USAGE_STAGING@GOTPAGE
Lloh28:
	ldr	x8, [x8, _D3D10_USAGE_STAGING@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	str	x8, [sp, #16]
	ldr	x8, [x19, #64]
	str	d0, [sp]
	str	wzr, [sp, #24]
	ldr	x9, [x22]
	str	x8, [sp, #64]
	str	x9, [sp, #40]
	add	x3, x19, #88
	mov	x1, sp
	mov	x0, x20
	mov	x2, #0
	bl	_D3D10CreateTexture2D
LBB0_10:
	ldur	d0, [x19, #28]
	str	d0, [x19, #72]
	scvtf.2s	v0, v0
	fmov.2s	v1, #1.00000000
	fdiv.2s	v0, v1, v0
	str	d0, [x19, #80]
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdrp	Lloh25, Lloh27
	.loh AdrpLdr	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_D3D10_BIND_RENDER_TARGET,4,2   ; @D3D10_BIND_RENDER_TARGET
	.comm	_D3D10_FORMAT_SUPPORT_TEXTURE2D,4,2 ; @D3D10_FORMAT_SUPPORT_TEXTURE2D
	.comm	_D3D10_FORMAT_SUPPORT_SHADER_SAMPLE,4,2 ; @D3D10_FORMAT_SUPPORT_SHADER_SAMPLE
	.comm	_D3D10_BIND_SHADER_RESOURCE,4,2 ; @D3D10_BIND_SHADER_RESOURCE
	.comm	_D3D10_USAGE_DYNAMIC,8,3        ; @D3D10_USAGE_DYNAMIC
	.comm	_D3D10_CPU_ACCESS_WRITE,8,3     ; @D3D10_CPU_ACCESS_WRITE
	.comm	_D3D10_RESOURCE_MISC_GENERATE_MIPS,4,2 ; @D3D10_RESOURCE_MISC_GENERATE_MIPS
	.comm	_D3D10_FORMAT_SUPPORT_RENDER_TARGET,4,2 ; @D3D10_FORMAT_SUPPORT_RENDER_TARGET
	.comm	_DXGI_FORMAT_UNKNOWN,4,2        ; @DXGI_FORMAT_UNKNOWN
	.comm	_D3D_SRV_DIMENSION_TEXTURE2D,4,2 ; @D3D_SRV_DIMENSION_TEXTURE2D
	.comm	_D3D10_USAGE_STAGING,8,3        ; @D3D10_USAGE_STAGING
.subsections_via_symbols
