	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_stateblock_init                ## -- Begin function stateblock_init
	.p2align	4, 0x90
_stateblock_init:                       ## @stateblock_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	_d3d9_stateblock_vtbl@GOTPCREL(%rip), %rax
	movq	%rax, 24(%rdi)
	movl	$1, (%rdi)
	testq	%rcx, %rcx
	je	LBB0_3
## %bb.1:
	movq	%rcx, 16(%rbx)
LBB0_2:
	movq	%r14, 8(%rbx)
	movq	%r14, %rdi
	callq	_IDirect3DDevice9Ex_AddRef
	movq	_D3D_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_5
LBB0_3:
	movq	%rdx, %r15
	xorl	%eax, %eax
	callq	_wined3d_mutex_lock
	movl	4(%r14), %edi
	leaq	16(%rbx), %rdx
	movl	%r15d, %esi
	callq	_wined3d_stateblock_create
	movl	%eax, %r15d
	xorl	%eax, %eax
	callq	_wined3d_mutex_unlock
	movl	%r15d, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	callq	_WARN
LBB0_5:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_d3d9_stateblock_vtbl,4,2       ## @d3d9_stateblock_vtbl
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to create wined3d stateblock, hr %#x.\n"

	.comm	_D3D_OK,4,2                     ## @D3D_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_stateblock_init                ; -- Begin function stateblock_init
	.p2align	2
_stateblock_init:                       ; @stateblock_init
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _d3d9_stateblock_vtbl@GOTPAGE
Lloh1:
	ldr	x8, [x8, _d3d9_stateblock_vtbl@GOTPAGEOFF]
	str	x8, [x0, #24]
	mov	w8, #1
	str	w8, [x0]
	cbz	x3, LBB0_3
; %bb.1:
	str	x3, [x20, #16]
LBB0_2:
	str	x19, [x20, #8]
	mov	x0, x19
	bl	_IDirect3DDevice9Ex_AddRef
Lloh2:
	adrp	x8, _D3D_OK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _D3D_OK@GOTPAGEOFF]
Lloh4:
	ldr	w21, [x8]
	b	LBB0_5
LBB0_3:
	mov	x21, x2
	bl	_wined3d_mutex_lock
	ldr	w0, [x19, #4]
	add	x2, x20, #16
	mov	x1, x21
	bl	_wined3d_stateblock_create
	mov	x21, x0
	bl	_wined3d_mutex_unlock
	mov	x0, x21
	bl	_FAILED
	cbz	x0, LBB0_2
; %bb.4:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_WARN
LBB0_5:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_d3d9_stateblock_vtbl,4,2       ; @d3d9_stateblock_vtbl
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to create wined3d stateblock, hr %#x.\n"

	.comm	_D3D_OK,4,2                     ; @D3D_OK
.subsections_via_symbols
