	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function surface_upload_from_surface
_surface_upload_from_surface:           ## @surface_upload_from_surface
	.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
	movq	%rcx, %r15
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	%rdx, %rdi
	callq	_surface_get_sub_resource_idx
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	callq	_surface_get_sub_resource_idx
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	(%r12), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	(%r13), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, -120(%rbp)                ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_wine_dbgstr_point
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_wine_dbgstr_rect
	leaq	L_.str(%rip), %rdi
	movq	%r13, -104(%rbp)                ## 8-byte Spill
	movq	%r13, %rsi
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movl	%r14d, %edx
	movq	%r12, %rcx
	movl	%eax, %r8d
	callq	_TRACE
	movl	8(%r13), %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_context_acquire
	movq	%rax, %r14
	movq	(%rax), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	(%r15), %r12
	movq	16(%r15), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	subq	8(%r15), %r12
	movq	%r15, -112(%rbp)                ## 8-byte Spill
	movq	24(%r15), %r15
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	xorl	%edx, %edx
	divl	(%r13)
	movl	%edx, %ebx
	movq	%r13, %rdi
	movl	%edx, %esi
	callq	_wined3d_texture_get_level_width
	cmpq	%rax, %r12
	jne	LBB0_3
## %bb.1:
	movq	%r15, %rax
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	subq	%rax, %r15
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_wined3d_texture_get_level_height
	cmpq	%rax, %r15
	jne	LBB0_3
## %bb.2:
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_wined3d_texture_prepare_texture
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	jmp	LBB0_4
LBB0_3:
	movq	_WINED3D_LOCATION_TEXTURE_RGB@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %esi
	movq	%r14, %rdx
	callq	_wined3d_texture_load_location
LBB0_4:
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_wined3d_texture_bind_and_dirtify
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	%esi, %eax
	xorl	%edx, %edx
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	divl	(%rbx)
	movl	%edx, %r14d
	movq	16(%rbx), %rax
	movl	%esi, %ecx
	movl	(%rax,%rcx,4), %ecx
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_wined3d_texture_get_memory
	leaq	-56(%rbp), %rdx
	leaq	-124(%rbp), %rcx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_wined3d_texture_get_pitch
	movl	4(%rbx), %ebx
	movl	-56(%rbp), %r15d
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leaq	-48(%rbp), %rdi
	callq	_wined3d_const_bo_address
                                        ## kill: def $eax killed $eax def $rax
	movq	-104(%rbp), %rdi                ## 8-byte Reload
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	movq	-112(%rbp), %rcx                ## 8-byte Reload
	movl	%r15d, %r8d
	movq	-120(%rbp), %r9                 ## 8-byte Reload
	pushq	%rax
	pushq	%r14
	callq	_wined3d_surface_upload_data
	addq	$16, %rsp
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_context_release
	movq	_WINED3D_LOCATION_TEXTURE_RGB@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_wined3d_texture_validate_location
	movl	(%rbx), %edx
	notl	%edx
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_wined3d_texture_invalidate_location
	movq	_WINED3D_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	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	"dst_surface %p, dst_point %s, src_surface %p, src_rect %s.\n"

	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_WINED3D_LOCATION_TEXTURE_RGB,4,2 ## @WINED3D_LOCATION_TEXTURE_RGB
	.comm	_WINED3D_OK,4,2                 ## @WINED3D_OK
	.no_dead_strip	_surface_upload_from_surface
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function surface_upload_from_surface
_surface_upload_from_surface:           ; @surface_upload_from_surface
	.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	x22, x3
	mov	x26, x2
	mov	x21, x1
	mov	x23, x0
	mov	x0, x2
	bl	_surface_get_sub_resource_idx
	mov	x25, x0
	mov	x0, x23
	bl	_surface_get_sub_resource_idx
	mov	x19, x0
	ldr	x24, [x26]
	ldr	x20, [x23]
	str	x21, [sp, #24]                  ; 8-byte Folded Spill
	mov	x0, x21
	bl	_wine_dbgstr_point
	mov	x27, x0
	mov	x0, x22
	bl	_wine_dbgstr_rect
	mov	x4, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	str	x23, [sp, #16]                  ; 8-byte Folded Spill
	mov	x1, x23
	mov	x2, x27
	mov	x3, x26
	bl	_TRACE
	ldr	w0, [x20, #8]
	mov	x1, #0
	mov	w2, #0
	bl	_context_acquire
	mov	x26, x0
	ldr	x8, [x0]
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
	ldp	x8, x9, [x22]
	sub	x23, x8, x9
	ldp	x21, x27, [x22, #16]
	ldr	w8, [x20]
	udiv	w9, w19, w8
	msub	w28, w9, w8, w19
	mov	x0, x20
	mov	x1, x28
	bl	_wined3d_texture_get_level_width
	cmp	x23, x0
	b.ne	LBB0_3
; %bb.1:
	sub	x21, x21, x27
	mov	x0, x20
	mov	x1, x28
	bl	_wined3d_texture_get_level_height
	cmp	x21, x0
	b.ne	LBB0_3
; %bb.2:
Lloh2:
	adrp	x23, _FALSE@GOTPAGE
Lloh3:
	ldr	x23, [x23, _FALSE@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x20
	mov	x1, x26
	bl	_wined3d_texture_prepare_texture
Lloh4:
	adrp	x21, _WINED3D_LOCATION_TEXTURE_RGB@GOTPAGE
Lloh5:
	ldr	x21, [x21, _WINED3D_LOCATION_TEXTURE_RGB@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh6:
	adrp	x21, _WINED3D_LOCATION_TEXTURE_RGB@GOTPAGE
Lloh7:
	ldr	x21, [x21, _WINED3D_LOCATION_TEXTURE_RGB@GOTPAGEOFF]
	ldr	w3, [x21]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x26
	bl	_wined3d_texture_load_location
Lloh8:
	adrp	x23, _FALSE@GOTPAGE
Lloh9:
	ldr	x23, [x23, _FALSE@GOTPAGEOFF]
LBB0_4:
	ldr	w2, [x23]
	mov	x0, x20
	mov	x1, x26
	bl	_wined3d_texture_bind_and_dirtify
	ldr	w8, [x24]
	udiv	w9, w25, w8
	msub	w28, w9, w8, w25
	ldr	x8, [x24, #16]
	ldr	w3, [x8, w25, uxtw #2]
	add	x2, sp, #32
	mov	x0, x24
	mov	x1, x25
	bl	_wined3d_texture_get_memory
	add	x2, sp, #44
	add	x3, sp, #40
	mov	x0, x24
	mov	x1, x28
	bl	_wined3d_texture_get_pitch
	ldr	w24, [x24, #4]
	ldr	w25, [sp, #44]
	ldr	w28, [x23]
	add	x0, sp, #32
	bl	_wined3d_const_bo_address
	mov	x7, x0
	ldp	x1, x0, [sp, #8]                ; 16-byte Folded Reload
	mov	x2, x24
	mov	x3, x22
	mov	x4, x25
	ldr	x5, [sp, #24]                   ; 8-byte Folded Reload
	mov	x6, x28
	bl	_wined3d_surface_upload_data
	mov	x0, x26
	bl	_context_release
	ldr	w2, [x21]
	mov	x0, x20
	mov	x1, x19
	bl	_wined3d_texture_validate_location
	ldr	w8, [x21]
	mvn	w2, w8
	mov	x0, x20
	mov	x1, x19
	bl	_wined3d_texture_invalidate_location
Lloh10:
	adrp	x8, _WINED3D_OK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _WINED3D_OK@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	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 AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dst_surface %p, dst_point %s, src_surface %p, src_rect %s.\n"

	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_WINED3D_LOCATION_TEXTURE_RGB,4,2 ; @WINED3D_LOCATION_TEXTURE_RGB
	.comm	_WINED3D_OK,4,2                 ; @WINED3D_OK
	.no_dead_strip	_surface_upload_from_surface
.subsections_via_symbols
