	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wined3d_cs_exec_update_sub_resource
_wined3d_cs_exec_update_sub_resource:   ## @wined3d_cs_exec_update_sub_resource
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	40(%rsi), %rbx
	leaq	16(%rsi), %r12
	movl	(%rdi), %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_context_acquire
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	_WINED3D_RTYPE_BUFFER@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.1:
	movq	%rbx, %rdi
	callq	_buffer_from_resource
	movq	%rax, %r13
	movq	_WINED3D_LOCATION_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_wined3d_buffer_load_location
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movl	12(%r15), %ecx
	movq	%r13, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_wined3d_buffer_upload_data
	movq	_WINED3D_LOCATION_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	notl	%esi
	movq	%r13, %rdi
	callq	_wined3d_buffer_invalidate_location
	jmp	LBB0_13
LBB0_4:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_wined3d_texture_from_resource
	movq	%rax, %r13
	movl	(%r15), %eax
	xorl	%edx, %edx
	divl	(%r13)
	movq	%r12, %r14
	movl	%edx, %r12d
	movq	%r13, %rdi
	movl	%edx, %esi
	callq	_wined3d_texture_get_level_width
	movl	%eax, %ebx
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_wined3d_texture_get_level_height
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	movl	%r12d, %esi
	movq	%r14, %r12
	callq	_wined3d_texture_get_level_depth
	movq	$0, -72(%rbp)
	movl	12(%r15), %ecx
	movl	%ecx, -80(%rbp)
	cmpl	$0, 36(%r15)
	jne	LBB0_11
## %bb.5:
	cmpl	$0, 32(%r15)
	jne	LBB0_11
## %bb.6:
	cmpl	$0, 28(%r15)
	jne	LBB0_11
## %bb.7:
	cmpl	%ebx, (%r12)
	jne	LBB0_11
## %bb.8:
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ecx, 20(%r15)
	jne	LBB0_11
## %bb.9:
	cmpl	%eax, 24(%r15)
	jne	LBB0_11
## %bb.10:
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_wined3d_texture_prepare_texture
	jmp	LBB0_12
LBB0_11:
	movl	(%r15), %esi
	movq	_WINED3D_LOCATION_TEXTURE_RGB@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	_wined3d_texture_load_location
LBB0_12:
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_wined3d_texture_bind_and_dirtify
	movl	8(%r15), %r9d
	movl	(%r15), %esi
	movl	4(%r15), %eax
	movl	%eax, (%rsp)
	leaq	-80(%rbp), %r8
	movq	%r13, %rdi
	movq	%r14, %rdx
	movq	%r12, %rcx
	callq	_wined3d_texture_upload_data
	movl	(%r15), %esi
	movq	_WINED3D_LOCATION_TEXTURE_RGB@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%r13, %rdi
	callq	_wined3d_texture_validate_location
	movl	(%r15), %esi
	movl	(%r12), %edx
	notl	%edx
	movq	%r13, %rdi
	callq	_wined3d_texture_invalidate_location
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_13
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_ERR
LBB0_13:
	movq	%r14, %rdi
	callq	_context_release
	movq	%rbx, %rdi
	callq	_wined3d_resource_release
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WINED3D_RTYPE_BUFFER,8,3       ## @WINED3D_RTYPE_BUFFER
	.comm	_WINED3D_LOCATION_BUFFER,4,2    ## @WINED3D_LOCATION_BUFFER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to load buffer location.\n"

	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_WINED3D_LOCATION_TEXTURE_RGB,4,2 ## @WINED3D_LOCATION_TEXTURE_RGB
	.no_dead_strip	_wined3d_cs_exec_update_sub_resource
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wined3d_cs_exec_update_sub_resource
_wined3d_cs_exec_update_sub_resource:   ; @wined3d_cs_exec_update_sub_resource
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x21, x1
	ldr	x19, [x1, #40]
	add	x22, x1, #16
	ldr	w0, [x0]
	mov	x1, #0
	mov	w2, #0
	bl	_context_acquire
	mov	x20, x0
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _WINED3D_RTYPE_BUFFER@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WINED3D_RTYPE_BUFFER@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	mov	x0, x19
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	bl	_buffer_from_resource
	mov	x23, x0
Lloh3:
	adrp	x24, _WINED3D_LOCATION_BUFFER@GOTPAGE
Lloh4:
	ldr	x24, [x24, _WINED3D_LOCATION_BUFFER@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	x1, x20
	bl	_wined3d_buffer_load_location
	cbz	w0, LBB0_12
; %bb.2:
	ldr	w3, [x21, #12]
	mov	x0, x23
	mov	x1, x20
	mov	x2, x22
	bl	_wined3d_buffer_upload_data
	ldr	w8, [x24]
	mvn	w1, w8
	mov	x0, x23
	bl	_wined3d_buffer_invalidate_location
	b	LBB0_13
LBB0_3:
	bl	_wined3d_texture_from_resource
	mov	x23, x0
	ldr	w8, [x21]
	ldr	w9, [x0]
	udiv	w10, w8, w9
	msub	w26, w10, w9, w8
	mov	x1, x26
	bl	_wined3d_texture_get_level_width
	mov	x24, x0
	mov	x0, x23
	mov	x1, x26
	bl	_wined3d_texture_get_level_height
	mov	x25, x0
	mov	x0, x23
	mov	x1, x26
	bl	_wined3d_texture_get_level_depth
	str	xzr, [sp, #8]
	ldr	w8, [x21, #12]
	str	w8, [sp]
	ldr	w8, [x21, #36]
Lloh5:
	adrp	x26, _WINED3D_LOCATION_TEXTURE_RGB@GOTPAGE
Lloh6:
	ldr	x26, [x26, _WINED3D_LOCATION_TEXTURE_RGB@GOTPAGEOFF]
Lloh7:
	adrp	x27, _FALSE@GOTPAGE
Lloh8:
	ldr	x27, [x27, _FALSE@GOTPAGEOFF]
	cbnz	w8, LBB0_10
; %bb.4:
	ldr	w8, [x21, #32]
	cbnz	w8, LBB0_10
; %bb.5:
	ldr	w8, [x21, #28]
	cbnz	w8, LBB0_10
; %bb.6:
	ldr	w8, [x22]
	cmp	w8, w24
	b.ne	LBB0_10
; %bb.7:
	ldr	w8, [x21, #20]
	cmp	w8, w25
	b.ne	LBB0_10
; %bb.8:
	ldr	w8, [x21, #24]
	cmp	w8, w0
	b.ne	LBB0_10
; %bb.9:
	ldr	w2, [x27]
	mov	x0, x23
	mov	x1, x20
	bl	_wined3d_texture_prepare_texture
	b	LBB0_11
LBB0_10:
	ldr	w1, [x21]
	ldr	w3, [x26]
	mov	x0, x23
	mov	x2, x20
	bl	_wined3d_texture_load_location
LBB0_11:
	ldr	w2, [x27]
	mov	x0, x23
	mov	x1, x20
	bl	_wined3d_texture_bind_and_dirtify
	ldp	w6, w5, [x21, #4]
	ldr	w1, [x21]
	mov	x4, sp
	mov	x0, x23
	mov	x2, x20
	mov	x3, x22
	bl	_wined3d_texture_upload_data
	ldr	w1, [x21]
	ldr	w2, [x26]
	mov	x0, x23
	bl	_wined3d_texture_validate_location
	ldr	w1, [x21]
	ldr	w8, [x26]
	mvn	w2, w8
	mov	x0, x23
	bl	_wined3d_texture_invalidate_location
	b	LBB0_13
LBB0_12:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ERR
LBB0_13:
	mov	x0, x20
	bl	_context_release
	mov	x0, x19
	bl	_wined3d_resource_release
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_WINED3D_RTYPE_BUFFER,8,3       ; @WINED3D_RTYPE_BUFFER
	.comm	_WINED3D_LOCATION_BUFFER,4,2    ; @WINED3D_LOCATION_BUFFER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to load buffer location.\n"

	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_WINED3D_LOCATION_TEXTURE_RGB,4,2 ; @WINED3D_LOCATION_TEXTURE_RGB
	.no_dead_strip	_wined3d_cs_exec_update_sub_resource
.subsections_via_symbols
