	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_d3d8_vertex_declaration_init   ## -- Begin function d3d8_vertex_declaration_init
	.p2align	4, 0x90
_d3d8_vertex_declaration_init:          ## @d3d8_vertex_declaration_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	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	%ecx, 16(%rdi)
	leaq	12(%rdi), %rsi
	leaq	-40(%rbp), %rdx
	movq	%r12, %rdi
	callq	_convert_to_wined3d_declaration
	movl	%eax, %r15d
	movl	12(%rbx), %edi
	callq	_heap_alloc
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	12(%rbx), %edx
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_memcpy
	xorl	%eax, %eax
	callq	_wined3d_mutex_lock
	movl	(%r14), %edi
	movq	-40(%rbp), %rsi
	leaq	8(%rbx), %r9
	movq	_d3d8_vertexdeclaration_wined3d_parent_ops@GOTPCREL(%rip), %r8
	movl	%r15d, %edx
	movq	%rbx, %rcx
	callq	_wined3d_vertex_declaration_create
	movl	%eax, %r14d
	xorl	%eax, %eax
	callq	_wined3d_mutex_unlock
	movq	-40(%rbp), %rdi
	callq	_heap_free
	movl	%r14d, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %esi
	callq	_WARN
	movq	(%rbx), %rdi
	callq	_heap_free
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_ERR
	movq	-40(%rbp), %rdi
	callq	_heap_free
	movq	_E_OUTOFMEMORY@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_4:
	movq	_D3D_OK@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %r14d
LBB0_6:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate vertex declaration elements memory.\n"

	.comm	_E_OUTOFMEMORY,4,2              ## @E_OUTOFMEMORY
	.comm	_d3d8_vertexdeclaration_wined3d_parent_ops,4,2 ## @d3d8_vertexdeclaration_wined3d_parent_ops
L_.str.1:                               ## @.str.1
	.asciz	"Failed to create wined3d vertex declaration, 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	_d3d8_vertex_declaration_init   ; -- Begin function d3d8_vertex_declaration_init
	.p2align	2
_d3d8_vertex_declaration_init:          ; @d3d8_vertex_declaration_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	x22, x2
	mov	x20, x1
	mov	x19, x0
	str	w3, [x0, #16]
	add	x1, x0, #12
	add	x2, sp, #8
	mov	x0, x22
	bl	_convert_to_wined3d_declaration
	mov	x21, x0
	ldr	w0, [x19, #12]
	bl	_heap_alloc
	str	x0, [x19]
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w2, [x19, #12]
	mov	x1, x22
	bl	_memcpy
	bl	_wined3d_mutex_lock
	ldr	w0, [x20]
	ldr	x1, [sp, #8]
	add	x5, x19, #8
Lloh0:
	adrp	x4, _d3d8_vertexdeclaration_wined3d_parent_ops@GOTPAGE
Lloh1:
	ldr	x4, [x4, _d3d8_vertexdeclaration_wined3d_parent_ops@GOTPAGEOFF]
	mov	x2, x21
	mov	x3, x19
	bl	_wined3d_vertex_declaration_create
	mov	x20, x0
	bl	_wined3d_mutex_unlock
	ldr	x0, [sp, #8]
	bl	_heap_free
	mov	x0, x20
	bl	_FAILED
	cbz	x0, LBB0_4
; %bb.2:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_WARN
	ldr	x0, [x19]
	bl	_heap_free
	b	LBB0_6
LBB0_3:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ERR
	ldr	x0, [sp, #8]
	bl	_heap_free
Lloh6:
	adrp	x8, _E_OUTOFMEMORY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _E_OUTOFMEMORY@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh8:
	adrp	x8, _D3D_OK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _D3D_OK@GOTPAGEOFF]
LBB0_5:
	ldr	w20, [x8]
LBB0_6:
	mov	x0, x20
	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 AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate vertex declaration elements memory.\n"

	.comm	_E_OUTOFMEMORY,4,2              ; @E_OUTOFMEMORY
	.comm	_d3d8_vertexdeclaration_wined3d_parent_ops,4,2 ; @d3d8_vertexdeclaration_wined3d_parent_ops
l_.str.1:                               ; @.str.1
	.asciz	"Failed to create wined3d vertex declaration, hr %#x.\n"

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