	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wined3d_texture_copy_sysmem_location
_wined3d_texture_copy_sysmem_location:  ## @wined3d_texture_copy_sysmem_location
	.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
	movl	%ecx, %r13d
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movl	%esi, %r14d
	movq	(%rdi), %rax
	movq	8(%rdi), %r15
	movl	(%rax,%r14,8), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	callq	_wined3d_texture_prepare_location
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	leaq	-80(%rbp), %rdx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movl	%r13d, %ecx
	callq	_wined3d_texture_get_memory
	movq	(%rbx), %rax
	movl	4(%rax,%r14,8), %ecx
	leaq	-64(%rbp), %rdx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_wined3d_texture_get_memory
	cmpq	$0, -72(%rbp)
	je	LBB0_5
## %bb.3:
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_context_acquire
	movq	%rax, %r14
	movq	_GL_PIXEL_UNPACK_BUFFER@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	-72(%rbp), %rsi
	callq	_glBindBuffer
	movl	%eax, %edi
	callq	_GL_EXTCALL
	movl	(%rbx), %edi
	movl	-64(%rbp), %ecx
	xorl	%esi, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_glBufferSubData
	movl	%eax, %edi
	callq	_GL_EXTCALL
	movl	(%rbx), %edi
	xorl	%esi, %esi
	callq	_glBindBuffer
	movl	%eax, %edi
	callq	_GL_EXTCALL
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_4
LBB0_1:
	movq	_FALSE@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_5:
	cmpq	$0, -56(%rbp)
	je	LBB0_7
## %bb.6:
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_context_acquire
	movq	%rax, %r14
	movq	_GL_PIXEL_PACK_BUFFER@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	-56(%rbp), %rsi
	callq	_glBindBuffer
	movl	%eax, %edi
	callq	_GL_EXTCALL
	movl	(%rbx), %edi
	movl	-80(%rbp), %ecx
	xorl	%esi, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_glGetBufferSubData
	movl	%eax, %edi
	callq	_GL_EXTCALL
	movl	(%rbx), %edi
	xorl	%esi, %esi
	callq	_glBindBuffer
	movl	%eax, %edi
	callq	_GL_EXTCALL
	leaq	L_.str.1(%rip), %rdi
LBB0_4:
	callq	_checkGLcall
	movq	%r14, %rdi
	callq	_context_release
LBB0_8:
	movq	_TRUE@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	-80(%rbp), %edi
	movl	-64(%rbp), %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_memcpy
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_GL_PIXEL_UNPACK_BUFFER,4,2     ## @GL_PIXEL_UNPACK_BUFFER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PBO upload"

	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_GL_PIXEL_PACK_BUFFER,4,2       ## @GL_PIXEL_PACK_BUFFER
L_.str.1:                               ## @.str.1
	.asciz	"PBO download"

	.no_dead_strip	_wined3d_texture_copy_sysmem_location
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wined3d_texture_copy_sysmem_location
_wined3d_texture_copy_sysmem_location:  ; @wined3d_texture_copy_sysmem_location
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x23, x3
	mov	x21, x1
	mov	x22, x0
	mov	w24, w1
	lsl	x8, x24, #3
	ldp	x9, x20, [x0]
	ldr	w19, [x9, x8]
	bl	_wined3d_texture_prepare_location
	cbz	w0, LBB0_3
; %bb.1:
	add	x2, sp, #16
	mov	x0, x22
	mov	x1, x21
	mov	x3, x23
	bl	_wined3d_texture_get_memory
	ldr	x8, [x22]
	add	x8, x8, x24, lsl #3
	ldr	w3, [x8, #4]
	mov	x2, sp
	mov	x0, x22
	mov	x1, x21
	bl	_wined3d_texture_get_memory
	ldr	x8, [sp, #24]
	cbz	x8, LBB0_4
; %bb.2:
	mov	x0, x20
	mov	x1, #0
	mov	w2, #0
	bl	_context_acquire
	mov	x20, x0
Lloh0:
	adrp	x21, _GL_PIXEL_UNPACK_BUFFER@GOTPAGE
Lloh1:
	ldr	x21, [x21, _GL_PIXEL_UNPACK_BUFFER@GOTPAGEOFF]
	ldr	w0, [x21]
	ldr	x1, [sp, #24]
	bl	_glBindBuffer
	bl	_GL_EXTCALL
	ldr	w0, [x21]
	ldr	w3, [sp]
	mov	w1, #0
	mov	x2, x19
	bl	_glBufferSubData
	bl	_GL_EXTCALL
	ldr	w0, [x21]
	mov	x1, #0
	bl	_glBindBuffer
	bl	_GL_EXTCALL
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_6
LBB0_3:
Lloh4:
	adrp	x8, _FALSE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
	b	LBB0_8
LBB0_4:
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_9
; %bb.5:
	mov	x0, x20
	mov	x1, #0
	mov	w2, #0
	bl	_context_acquire
	mov	x20, x0
Lloh6:
	adrp	x21, _GL_PIXEL_PACK_BUFFER@GOTPAGE
Lloh7:
	ldr	x21, [x21, _GL_PIXEL_PACK_BUFFER@GOTPAGEOFF]
	ldr	w0, [x21]
	ldr	x1, [sp, #8]
	bl	_glBindBuffer
	bl	_GL_EXTCALL
	ldr	w0, [x21]
	ldr	w3, [sp, #16]
	mov	w1, #0
	mov	x2, x19
	bl	_glGetBufferSubData
	bl	_GL_EXTCALL
	ldr	w0, [x21]
	mov	x1, #0
	bl	_glBindBuffer
	bl	_GL_EXTCALL
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_6:
	bl	_checkGLcall
	mov	x0, x20
	bl	_context_release
LBB0_7:
Lloh10:
	adrp	x8, _TRUE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
LBB0_8:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_9:
	ldr	w0, [sp, #16]
	ldr	w1, [sp]
	mov	x2, x19
	bl	_memcpy
	b	LBB0_7
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_GL_PIXEL_UNPACK_BUFFER,4,2     ; @GL_PIXEL_UNPACK_BUFFER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PBO upload"

	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_GL_PIXEL_PACK_BUFFER,4,2       ; @GL_PIXEL_PACK_BUFFER
l_.str.1:                               ; @.str.1
	.asciz	"PBO download"

	.no_dead_strip	_wined3d_texture_copy_sysmem_location
.subsections_via_symbols
