	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_surface_init                   ## -- Begin function surface_init
	.p2align	4, 0x90
_surface_init:                          ## @surface_init
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movl	%edx, %r15d
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	_d3d9_surface_vtbl@GOTPCREL(%rip), %rax
	movq	%rax, 40(%rdi)
	addq	$32, %rdi
	callq	_d3d9_resource_init
	movq	$0, 32(%rbx)
	leaq	24(%rbx), %rdi
	callq	_list_init
	movq	%r12, %rdi
	callq	_wined3d_texture_get_parent
	movq	%rax, 8(%rbx)
	movq	%r12, 16(%rbx)
	movl	%r15d, (%rbx)
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_IID_IDirect3DBaseTexture9@GOTPCREL(%rip), %rsi
	leaq	-40(%rbp), %rdx
	movq	%rax, %rdi
	callq	_IUnknown_QueryInterface
	movl	%eax, %edi
	callq	_SUCCEEDED
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	-40(%rbp), %rdi
	callq	_unsafe_impl_from_IDirect3DBaseTexture9
	movl	%eax, 4(%rbx)
	movq	-40(%rbp), %rdi
	callq	_IDirect3DBaseTexture9_Release
LBB0_3:
	movq	_d3d9_surface_wined3d_parent_ops@GOTPCREL(%rip), %rax
	movq	%rax, (%r14)
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_d3d9_surface_vtbl,4,2          ## @d3d9_surface_vtbl
	.comm	_IID_IDirect3DBaseTexture9,4,2  ## @IID_IDirect3DBaseTexture9
	.comm	_d3d9_surface_wined3d_parent_ops,4,2 ## @d3d9_surface_wined3d_parent_ops
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_surface_init                   ; -- Begin function surface_init
	.p2align	2
_surface_init:                          ; @surface_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x3
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _d3d9_surface_vtbl@GOTPAGE
Lloh1:
	ldr	x8, [x8, _d3d9_surface_vtbl@GOTPAGEOFF]
	str	x8, [x0, #40]
	add	x0, x0, #32
	bl	_d3d9_resource_init
	str	xzr, [x20, #32]
	add	x0, x20, #24
	bl	_list_init
	mov	x0, x22
	bl	_wined3d_texture_get_parent
	stp	x0, x22, [x20, #8]
	str	w21, [x20]
	cbz	x0, LBB0_3
; %bb.1:
Lloh2:
	adrp	x1, _IID_IDirect3DBaseTexture9@GOTPAGE
Lloh3:
	ldr	x1, [x1, _IID_IDirect3DBaseTexture9@GOTPAGEOFF]
	add	x2, sp, #8
	bl	_IUnknown_QueryInterface
	bl	_SUCCEEDED
	cbz	x0, LBB0_3
; %bb.2:
	ldr	x0, [sp, #8]
	bl	_unsafe_impl_from_IDirect3DBaseTexture9
	str	w0, [x20, #4]
	ldr	x0, [sp, #8]
	bl	_IDirect3DBaseTexture9_Release
LBB0_3:
Lloh4:
	adrp	x8, _d3d9_surface_wined3d_parent_ops@GOTPAGE
Lloh5:
	ldr	x8, [x8, _d3d9_surface_wined3d_parent_ops@GOTPAGEOFF]
	str	x8, [x19]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_d3d9_surface_vtbl,4,2          ; @d3d9_surface_vtbl
	.comm	_IID_IDirect3DBaseTexture9,4,2  ; @IID_IDirect3DBaseTexture9
	.comm	_d3d9_surface_wined3d_parent_ops,4,2 ; @d3d9_surface_wined3d_parent_ops
.subsections_via_symbols
