	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function texture3d_upload_data
_texture3d_upload_data:                 ## @texture3d_upload_data
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $r9d killed $r9d def $r9
	movq	%r9, -96(%rbp)                  ## 8-byte Spill
	movq	%r8, %r12
	movq	%rcx, %r13
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	16(%rdi), %rax
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	(%rdi)
	movl	%edx, %r14d
	movq	(%r8), %rax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movq	%rcx, %rdi
	callq	_debug_box
	movq	8(%r12), %r9
	subq	$8, %rsp
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, %r8d
	movl	16(%rbp), %eax
	pushq	%rax
	pushq	-96(%rbp)                       ## 8-byte Folded Reload
	movq	%r12, -120(%rbp)                ## 8-byte Spill
	pushq	(%r12)
	callq	_TRACE
	addq	$32, %rsp
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_wined3d_texture_get_level_width
	movl	%eax, %ebx
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_wined3d_texture_get_level_height
	movl	%eax, %r12d
	movq	%r15, %rdi
	movl	%r14d, -100(%rbp)               ## 4-byte Spill
	movl	%r14d, %esi
	callq	_wined3d_texture_get_level_depth
                                        ## kill: def $eax killed $eax def $rax
	testq	%r13, %r13
	je	LBB0_1
## %bb.2:
	movl	(%r13), %edx
	movl	4(%r13), %r14d
	movl	8(%r13), %eax
	movl	12(%r13), %ecx
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	subl	%edx, %ecx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movl	16(%r13), %r12d
	subl	%r14d, %r12d
	movl	20(%r13), %ecx
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	subl	%eax, %ecx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_3
LBB0_1:
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
LBB0_3:
	movq	-128(%rbp), %rbx                ## 8-byte Reload
	cmpl	$0, (%rbx)
	movq	-120(%rbp), %r13                ## 8-byte Reload
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_9
## %bb.4:
	cmpq	$0, 8(%r13)
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	callq	_ERR
LBB0_6:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	_WINED3DFMT_FLAG_BLOCKS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r15)
	je	LBB0_8
## %bb.7:
	leaq	L_.str.2(%rip), %rdi
	callq	_ERR
LBB0_8:
	movl	(%rbx), %r15d
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	imull	%r12d, %r15d
	movl	%r15d, -60(%rbp)
	movl	%r15d, %ebx
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	imull	%r13d, %ebx
	movl	%ebx, -56(%rbp)
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movl	%r14d, %edi
	movl	%ebx, %esi
	callq	_heap_calloc
	movq	-120(%rbp), %r10                ## 8-byte Reload
	movq	(%r10), %rdi
	subq	$8, %rsp
	movq	%rax, %rsi
	movq	-96(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movl	16(%rbp), %ecx
                                        ## kill: def $ecx killed $ecx killed $rcx
	movl	%r15d, %r8d
	movl	%ebx, %r9d
	movq	-128(%rbp), %rbx                ## 8-byte Reload
	pushq	%r14
	pushq	%r13
	movq	%r10, %r13
	pushq	%r12
	movq	%rax, %r12
	callq	*16(%rbx)
	addq	$32, %rsp
	movq	%r12, %r15
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_13
LBB0_9:
	leaq	-60(%rbp), %rdx
	leaq	-56(%rbp), %rcx
	movq	%r15, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_wined3d_texture_get_pitch
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	cmpl	%esi, -60(%rbp)
	movl	16(%rbp), %edx
	jne	LBB0_11
## %bb.10:
	cmpl	%edx, -56(%rbp)
	je	LBB0_12
LBB0_11:
	leaq	L_.str.3(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_FIXME
LBB0_12:
	xorl	%r15d, %r15d
	movq	-112(%rbp), %r12                ## 8-byte Reload
LBB0_13:
	movq	8(%r13), %rsi
	testq	%rsi, %rsi
	je	LBB0_15
## %bb.14:
	movq	_GL_PIXEL_UNPACK_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_glBindBuffer
	movl	%eax, %edi
	callq	_GL_EXTCALL
	leaq	L_.str.4(%rip), %rdi
	callq	_checkGLcall
LBB0_15:
	movq	_GL_TEXTURE_3D@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	4(%rbx), %eax
	movl	8(%rbx), %ebx
	subq	$8, %rsp
	movl	-100(%rbp), %esi                ## 4-byte Reload
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movl	%r14d, %ecx
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	movq	-88(%rbp), %r9                  ## 8-byte Reload
                                        ## kill: def $r9d killed $r9d killed $r9
	pushq	%r12
	pushq	%rax
	pushq	%rbx
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	pushq	-72(%rbp)                       ## 8-byte Folded Reload
	callq	_glTexSubImage3D
	addq	$48, %rsp
	movl	%eax, %edi
	callq	_GL_EXTCALL
	leaq	L_.str.5(%rip), %rdi
	callq	_checkGLcall
	cmpq	$0, 8(%r13)
	je	LBB0_17
## %bb.16:
	movq	_GL_PIXEL_UNPACK_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_glBindBuffer
	movl	%eax, %edi
	callq	_GL_EXTCALL
	leaq	L_.str.4(%rip), %rdi
	callq	_checkGLcall
LBB0_17:
	movq	%r15, %rdi
	callq	_heap_free
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"texture %p, sub_resource_idx %u, context %p, box %s, data {%#x:%p}, row_pitch %#x, slice_pitch %#x.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Loading a converted texture from a PBO.\n"

	.comm	_WINED3DFMT_FLAG_BLOCKS,4,2     ## @WINED3DFMT_FLAG_BLOCKS
L_.str.2:                               ## @.str.2
	.asciz	"Converting a block-based format.\n"

L_.str.3:                               ## @.str.3
	.asciz	"Ignoring row/slice pitch (%u/%u).\n"

	.comm	_GL_PIXEL_UNPACK_BUFFER,4,2     ## @GL_PIXEL_UNPACK_BUFFER
L_.str.4:                               ## @.str.4
	.asciz	"glBindBuffer"

	.comm	_GL_TEXTURE_3D,4,2              ## @GL_TEXTURE_3D
L_.str.5:                               ## @.str.5
	.asciz	"glTexSubImage3D"

	.no_dead_strip	_texture3d_upload_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function texture3d_upload_data
_texture3d_upload_data:                 ; @texture3d_upload_data
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x6
	mov	x24, x5
	mov	x19, x4
	mov	x25, x3
	mov	x21, x2
	mov	x28, x1
	mov	x27, x0
	ldr	x26, [x0, #16]
	ldr	w8, [x0]
	udiv	w9, w1, w8
	msub	w20, w9, w8, w1
	ldr	x22, [x4]
	mov	x0, x3
	bl	_debug_box
	mov	x4, x0
	ldp	x6, x5, [x19]
	stp	w24, w23, [sp, #32]             ; 8-byte Folded Spill
	str	w23, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x27
	mov	x2, x28
	mov	x3, x21
	mov	x7, x24
	bl	_TRACE
	mov	x0, x27
	mov	x1, x20
	bl	_wined3d_texture_get_level_width
	mov	x21, x0
	mov	x0, x27
	mov	x1, x20
	bl	_wined3d_texture_get_level_height
	mov	x23, x0
	mov	x0, x27
	mov	x1, x20
	bl	_wined3d_texture_get_level_depth
	cbz	x25, LBB0_7
; %bb.1:
	ldp	w9, w11, [x25]
	ldp	w10, w8, [x25, #8]
	stp	w9, w11, [sp, #24]              ; 8-byte Folded Spill
	sub	w21, w8, w9
	ldp	w8, w9, [x25, #16]
	sub	w23, w8, w11
	mov	x25, x10
	sub	w24, w9, w10
	ldr	w8, [x26]
	cbz	w8, LBB0_8
LBB0_2:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_4
; %bb.3:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ERR
LBB0_4:
	ldr	w8, [x27, #8]
Lloh4:
	adrp	x9, _WINED3DFMT_FLAG_BLOCKS@GOTPAGE
Lloh5:
	ldr	x9, [x9, _WINED3DFMT_FLAG_BLOCKS@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	tst	w9, w8
	mov	x28, x25
	b.eq	LBB0_6
; %bb.5:
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_ERR
LBB0_6:
	ldr	w8, [x26]
	mul	w25, w8, w21
	mul	w27, w25, w23
	stp	w27, w25, [sp, #40]
	mov	x0, x24
	mov	x1, x27
	bl	_heap_calloc
	mov	x22, x0
	ldr	x8, [x26, #16]
	ldr	x0, [x19]
	str	w24, [sp]
	mov	x1, x22
	ldp	w2, w3, [sp, #32]               ; 8-byte Folded Reload
	mov	x4, x25
	mov	x5, x27
	mov	x6, x21
	mov	x7, x23
	blr	x8
	mov	x27, x22
	b	LBB0_12
LBB0_7:
	mov	x24, x0
	str	xzr, [sp, #24]                  ; 8-byte Folded Spill
	ldr	w8, [x26]
	cbnz	w8, LBB0_2
LBB0_8:
	add	x2, sp, #44
	add	x3, sp, #40
	mov	x0, x27
	mov	x1, x28
	bl	_wined3d_texture_get_pitch
	ldr	w8, [sp, #44]
	ldp	w1, w2, [sp, #32]               ; 8-byte Folded Reload
	cmp	w8, w1
	b.ne	LBB0_10
; %bb.9:
	ldr	w8, [sp, #40]
	cmp	w8, w2
	b.eq	LBB0_11
LBB0_10:
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_FIXME
LBB0_11:
	mov	x27, #0
	mov	x28, x25
LBB0_12:
	ldr	x1, [x19, #8]
Lloh11:
	adrp	x25, _GL_PIXEL_UNPACK_BUFFER@GOTPAGE
Lloh12:
	ldr	x25, [x25, _GL_PIXEL_UNPACK_BUFFER@GOTPAGEOFF]
	cbz	x1, LBB0_14
; %bb.13:
	ldr	w0, [x25]
	bl	_glBindBuffer
	bl	_GL_EXTCALL
Lloh13:
	adrp	x0, l_.str.4@PAGE
Lloh14:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_checkGLcall
LBB0_14:
Lloh15:
	adrp	x8, _GL_TEXTURE_3D@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GL_TEXTURE_3D@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	ldp	w9, w8, [x26, #4]
	str	x22, [sp, #8]
	stp	w8, w9, [sp]
	mov	x1, x20
	ldp	w2, w3, [sp, #24]               ; 8-byte Folded Reload
	mov	x4, x28
	mov	x5, x21
	mov	x6, x23
	mov	x7, x24
	bl	_glTexSubImage3D
	bl	_GL_EXTCALL
Lloh18:
	adrp	x0, l_.str.5@PAGE
Lloh19:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_checkGLcall
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_16
; %bb.15:
	ldr	w0, [x25]
	mov	x1, #0
	bl	_glBindBuffer
	bl	_GL_EXTCALL
Lloh20:
	adrp	x0, l_.str.4@PAGE
Lloh21:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_checkGLcall
LBB0_16:
	mov	x0, x27
	bl	_heap_free
	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
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"texture %p, sub_resource_idx %u, context %p, box %s, data {%#x:%p}, row_pitch %#x, slice_pitch %#x.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Loading a converted texture from a PBO.\n"

	.comm	_WINED3DFMT_FLAG_BLOCKS,4,2     ; @WINED3DFMT_FLAG_BLOCKS
l_.str.2:                               ; @.str.2
	.asciz	"Converting a block-based format.\n"

l_.str.3:                               ; @.str.3
	.asciz	"Ignoring row/slice pitch (%u/%u).\n"

	.comm	_GL_PIXEL_UNPACK_BUFFER,4,2     ; @GL_PIXEL_UNPACK_BUFFER
l_.str.4:                               ; @.str.4
	.asciz	"glBindBuffer"

	.comm	_GL_TEXTURE_3D,4,2              ; @GL_TEXTURE_3D
l_.str.5:                               ; @.str.5
	.asciz	"glTexSubImage3D"

	.no_dead_strip	_texture3d_upload_data
.subsections_via_symbols
