	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function surface_load_drawable
_surface_load_drawable:                 ## @surface_load_drawable
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r13
	callq	_surface_get_sub_resource_idx
	movl	%eax, %r12d
	movq	(%r13), %rbx
	movq	_WINED3DUSAGE_DEPTHSTENCIL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_2
## %bb.1:
	movq	24(%rbx), %rax
	movl	%r12d, %ecx
	movl	(%rax,%rcx,4), %edi
	callq	_wined3d_debug_location
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_FIXME
	movq	_FALSE@GOTPCREL(%rip), %rbx
	jmp	LBB0_10
LBB0_2:
	movq	_wined3d_settings@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ORM_FBO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.3:
	leaq	8(%rbx), %rdi
	callq	_wined3d_resource_is_offscreen
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	callq	_ERR
	movq	_FALSE@GOTPCREL(%rip), %rbx
	jmp	LBB0_10
LBB0_5:
	movq	16(%rbx), %r15
	movq	%r14, %rdi
	callq	_context_get_rt_surface
	cmpq	%r13, %rax
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_6
## %bb.7:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	callq	_context_acquire
	movq	%rax, %r14
	jmp	LBB0_8
LBB0_6:
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
LBB0_8:
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	(%rbx)
	movl	%edx, %r15d
	movq	%rbx, %rdi
	movl	%edx, %esi
	callq	_wined3d_texture_get_level_width
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_wined3d_texture_get_level_height
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%eax, %r8d
	callq	_SetRect
	movq	_WINED3D_LOCATION_TEXTURE_RGB@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movq	%r14, %rdx
	callq	_wined3d_texture_load_location
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	movq	(%rdi), %r10
	movq	_WINED3D_BLIT_OP_COLOR_BLIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%r15), %r8d
	movq	_WINED3D_LOCATION_DRAWABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movq	_WINED3D_TEXF_POINT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	subq	$8, %rsp
	movq	%r14, %rdx
	movq	%r13, %rcx
	leaq	-48(%rbp), %r9
	pushq	%rax
	pushq	$0
	pushq	%r9
	pushq	%rbx
	pushq	%r13
	callq	*(%r10)
	addq	$48, %rsp
	movq	_TRUE@GOTPCREL(%rip), %rbx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	testq	%rsi, %rsi
	je	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	callq	_context_restore
LBB0_10:
	movl	(%rbx), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WINED3DUSAGE_DEPTHSTENCIL,4,2  ## @WINED3DUSAGE_DEPTHSTENCIL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unimplemented copy from %s for depth/stencil buffers.\n"

	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_wined3d_settings,8,3           ## @wined3d_settings
	.comm	_ORM_FBO,8,3                    ## @ORM_FBO
L_.str.1:                               ## @.str.1
	.asciz	"Trying to load offscreen surface into WINED3D_LOCATION_DRAWABLE.\n"

	.comm	_WINED3D_LOCATION_TEXTURE_RGB,4,2 ## @WINED3D_LOCATION_TEXTURE_RGB
	.comm	_WINED3D_BLIT_OP_COLOR_BLIT,4,2 ## @WINED3D_BLIT_OP_COLOR_BLIT
	.comm	_WINED3D_LOCATION_DRAWABLE,4,2  ## @WINED3D_LOCATION_DRAWABLE
	.comm	_WINED3D_TEXF_POINT,4,2         ## @WINED3D_TEXF_POINT
	.comm	_TRUE,4,2                       ## @TRUE
	.no_dead_strip	_surface_load_drawable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function surface_load_drawable
_surface_load_drawable:                 ; @surface_load_drawable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x20, x1
	mov	x19, x0
	bl	_surface_get_sub_resource_idx
	mov	x21, x0
	ldr	x22, [x19]
	mov	x0, x22
	ldr	w8, [x0, #8]!
Lloh0:
	adrp	x9, _WINED3DUSAGE_DEPTHSTENCIL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WINED3DUSAGE_DEPTHSTENCIL@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
	ldr	x8, [x22, #24]
	ldr	w0, [x8, w21, uxtw #2]
	bl	_wined3d_debug_location
	mov	x1, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_FIXME
LBB0_2:
Lloh5:
	adrp	x8, _FALSE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
	b	LBB0_12
LBB0_3:
Lloh7:
	adrp	x8, _wined3d_settings@GOTPAGE
Lloh8:
	ldr	x8, [x8, _wined3d_settings@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
Lloh10:
	adrp	x9, _ORM_FBO@GOTPAGE
Lloh11:
	ldr	x9, [x9, _ORM_FBO@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:
	bl	_wined3d_resource_is_offscreen
	cbz	x0, LBB0_6
; %bb.5:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ERR
	b	LBB0_2
LBB0_6:
	ldr	x24, [x22, #16]
	mov	x0, x20
	bl	_context_get_rt_surface
	cmp	x0, x19
	b.eq	LBB0_8
; %bb.7:
	mov	x23, x0
	mov	x0, x24
	mov	x1, x22
	mov	x2, x21
	bl	_context_acquire
	mov	x20, x0
	b	LBB0_9
LBB0_8:
	mov	x23, #0
LBB0_9:
	ldr	w8, [x22]
	udiv	w9, w21, w8
	msub	w25, w9, w8, w21
	mov	x0, x22
	mov	x1, x25
	bl	_wined3d_texture_get_level_width
	mov	x26, x0
	mov	x0, x22
	mov	x1, x25
	bl	_wined3d_texture_get_level_height
	mov	x4, x0
	add	x25, sp, #28
	add	x0, sp, #28
	mov	w1, #0
	mov	w2, #0
	mov	x3, x26
	bl	_SetRect
Lloh15:
	adrp	x26, _WINED3D_LOCATION_TEXTURE_RGB@GOTPAGE
Lloh16:
	ldr	x26, [x26, _WINED3D_LOCATION_TEXTURE_RGB@GOTPAGEOFF]
	ldr	w3, [x26]
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_wined3d_texture_load_location
	ldr	x0, [x24]
	ldr	x8, [x0]
	ldr	x8, [x8]
Lloh17:
	adrp	x9, _WINED3D_BLIT_OP_COLOR_BLIT@GOTPAGE
Lloh18:
	ldr	x9, [x9, _WINED3D_BLIT_OP_COLOR_BLIT@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x9]
	ldr	w4, [x26]
Lloh20:
	adrp	x9, _WINED3D_LOCATION_DRAWABLE@GOTPAGE
Lloh21:
	ldr	x9, [x9, _WINED3D_LOCATION_DRAWABLE@GOTPAGEOFF]
Lloh22:
	ldr	w7, [x9]
Lloh23:
	adrp	x9, _WINED3D_TEXF_POINT@GOTPAGE
Lloh24:
	ldr	x9, [x9, _WINED3D_TEXF_POINT@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	str	w9, [sp, #16]
	add	x5, sp, #28
	stp	x25, xzr, [sp]
	mov	x2, x20
	mov	x3, x19
	mov	x6, x19
	blr	x8
	cbz	x23, LBB0_11
; %bb.10:
	mov	x0, x20
	mov	x1, x23
	bl	_context_restore
LBB0_11:
Lloh26:
	adrp	x8, _TRUE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
LBB0_12:
	ldr	w0, [x8]
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_WINED3DUSAGE_DEPTHSTENCIL,4,2  ; @WINED3DUSAGE_DEPTHSTENCIL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unimplemented copy from %s for depth/stencil buffers.\n"

	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_wined3d_settings,8,3           ; @wined3d_settings
	.comm	_ORM_FBO,8,3                    ; @ORM_FBO
l_.str.1:                               ; @.str.1
	.asciz	"Trying to load offscreen surface into WINED3D_LOCATION_DRAWABLE.\n"

	.comm	_WINED3D_LOCATION_TEXTURE_RGB,4,2 ; @WINED3D_LOCATION_TEXTURE_RGB
	.comm	_WINED3D_BLIT_OP_COLOR_BLIT,4,2 ; @WINED3D_BLIT_OP_COLOR_BLIT
	.comm	_WINED3D_LOCATION_DRAWABLE,4,2  ; @WINED3D_LOCATION_DRAWABLE
	.comm	_WINED3D_TEXF_POINT,4,2         ; @WINED3D_TEXF_POINT
	.comm	_TRUE,4,2                       ; @TRUE
	.no_dead_strip	_surface_load_drawable
.subsections_via_symbols
