	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wined3d_texture_allocate_gl_mutable_storage
_wined3d_texture_allocate_gl_mutable_storage: ## @wined3d_texture_allocate_gl_mutable_storage
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	movl	(%rdi), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	8(%rdi), %rax
	movq	_GL_TEXTURE_2D_ARRAY@GOTPCREL(%rip), %rcx
	movl	$1, -48(%rbp)                   ## 4-byte Folded Spill
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.1:
	movl	16(%rbx), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	je	LBB0_12
LBB0_2:
	xorl	%esi, %esi
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	incl	%esi
	cmpl	-48(%rbp), %esi                 ## 4-byte Folded Reload
	je	LBB0_12
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movl	-60(%rbp), %r14d                ## 4-byte Reload
	imull	%r14d, %esi
	movq	%rbx, %rdi
	callq	_wined3d_texture_get_sub_resource_target
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	testl	%r14d, %r14d
	je	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%r15d, %r15d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=2
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %eax
	movl	4(%rcx), %r10d
	subq	$8, %rsp
	movl	%r12d, %edi
	movl	%r15d, %esi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movl	%r13d, %ecx
	movl	%r14d, %r8d
	xorl	%r9d, %r9d
	pushq	$0
	pushq	%rax
	pushq	%r10
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	callq	*(%rax)
	addq	$32, %rsp
	leaq	L_.str.2(%rip), %rdi
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=2
	callq	_checkGLcall
	incl	%r15d
	cmpl	%r15d, -60(%rbp)                ## 4-byte Folded Reload
	je	LBB0_11
LBB0_5:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_wined3d_texture_get_level_pow2_width
	movl	%eax, %r13d
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_wined3d_texture_get_level_pow2_height
	movl	%eax, %r14d
	movq	_WINED3DFMT_FLAG_HEIGHT_SCALE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 20(%rbx)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	imull	12(%rcx), %r14d
	movl	%r14d, %eax
	cltd
	idivl	8(%rcx)
	movl	%eax, %r14d
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=2
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	-56(%rbp), %r12d                ## 4-byte Reload
	subq	$8, %rsp
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	movl	%r15d, %ecx
	movl	%r12d, %r8d
	movl	%r13d, %r9d
	pushq	%r14
	callq	_TRACE
	addq	$16, %rsp
	movq	8(%rbx), %rax
	movq	_GL_TEXTURE_2D_ARRAY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=2
	movl	16(%rbx), %r9d
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %eax
	movl	4(%rcx), %r10d
	movl	%r12d, %edi
	movl	%r15d, %esi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movl	%r13d, %ecx
	movl	%r14d, %r8d
	pushq	$0
	pushq	%rax
	pushq	%r10
	pushq	$0
	callq	_glTexImage3D
	addq	$32, %rsp
	movl	%eax, %edi
	callq	_GL_EXTCALL
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_10
LBB0_12:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GL_TEXTURE_2D_ARRAY,8,3        ## @GL_TEXTURE_2D_ARRAY
	.comm	_WINED3DFMT_FLAG_HEIGHT_SCALE,4,2 ## @WINED3DFMT_FLAG_HEIGHT_SCALE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"texture %p, layer %u, level %u, target %#x, width %u, height %u.\n"

L_.str.1:                               ## @.str.1
	.asciz	"glTexImage3D"

L_.str.2:                               ## @.str.2
	.asciz	"glTexImage2D"

	.no_dead_strip	_wined3d_texture_allocate_gl_mutable_storage
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wined3d_texture_allocate_gl_mutable_storage
_wined3d_texture_allocate_gl_mutable_storage: ; @wined3d_texture_allocate_gl_mutable_storage
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	x3, [sp, #24]                   ; 8-byte Folded Spill
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	ldr	w19, [x0]
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _GL_TEXTURE_2D_ARRAY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _GL_TEXTURE_2D_ARRAY@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	w8, #1
	str	w8, [sp, #20]                   ; 4-byte Folded Spill
	b	LBB0_3
LBB0_2:
	ldr	w8, [x22, #16]
	str	w8, [sp, #20]                   ; 4-byte Folded Spill
	cbz	w8, LBB0_13
LBB0_3:
	mov	w23, #0
Lloh3:
	adrp	x24, l_.str@PAGE
Lloh4:
	add	x24, x24, l_.str@PAGEOFF
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w23, w23, #1
	ldr	w8, [sp, #20]                   ; 4-byte Folded Reload
	cmp	w23, w8
	b.eq	LBB0_13
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	mul	w1, w23, w19
	mov	x0, x22
	bl	_wined3d_texture_get_sub_resource_target
	cbz	w19, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x25, x0
	mov	w26, #0
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=2
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	ldr	x8, [x8]
	ldp	w7, w6, [x20]
	str	xzr, [sp]
	mov	x0, x25
	mov	x1, x26
	mov	x2, x21
	mov	x3, x27
	mov	x4, x28
	mov	w5, #0
	blr	x8
Lloh5:
	adrp	x0, l_.str.2@PAGE
Lloh6:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	bl	_checkGLcall
	add	w26, w26, #1
	cmp	w19, w26
	b.eq	LBB0_4
LBB0_9:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x22
	mov	x1, x26
	bl	_wined3d_texture_get_level_pow2_width
	mov	x27, x0
	mov	x0, x22
	mov	x1, x26
	bl	_wined3d_texture_get_level_pow2_height
	mov	x28, x0
	ldr	w8, [x22, #20]
Lloh7:
	adrp	x9, _WINED3DFMT_FLAG_HEIGHT_SCALE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _WINED3DFMT_FLAG_HEIGHT_SCALE@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	ldp	w9, w8, [x20, #8]
	mul	w8, w8, w28
	sdiv	w28, w8, w9
LBB0_11:                                ;   in Loop: Header=BB0_9 Depth=2
	mov	x0, x24
	mov	x1, x22
	mov	x2, x23
	mov	x3, x26
	mov	x4, x25
	mov	x5, x27
	mov	x6, x28
	bl	_TRACE
	ldr	x8, [x22, #8]
Lloh10:
	adrp	x9, _GL_TEXTURE_2D_ARRAY@GOTPAGE
Lloh11:
	ldr	x9, [x9, _GL_TEXTURE_2D_ARRAY@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	w5, [x22, #16]
	ldp	w8, w7, [x20]
	str	xzr, [sp, #8]
	str	w8, [sp]
	mov	x0, x25
	mov	x1, x26
	mov	x2, x21
	mov	x3, x27
	mov	x4, x28
	mov	w6, #0
	bl	_glTexImage3D
	bl	_GL_EXTCALL
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_13:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_GL_TEXTURE_2D_ARRAY,8,3        ; @GL_TEXTURE_2D_ARRAY
	.comm	_WINED3DFMT_FLAG_HEIGHT_SCALE,4,2 ; @WINED3DFMT_FLAG_HEIGHT_SCALE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"texture %p, layer %u, level %u, target %#x, width %u, height %u.\n"

l_.str.1:                               ; @.str.1
	.asciz	"glTexImage3D"

l_.str.2:                               ; @.str.2
	.asciz	"glTexImage2D"

	.no_dead_strip	_wined3d_texture_allocate_gl_mutable_storage
.subsections_via_symbols
