	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_d3d_vertex_buffer_create       ## -- Begin function d3d_vertex_buffer_create
	.p2align	4, 0x90
_d3d_vertex_buffer_create:              ## @d3d_vertex_buffer_create
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	movl	(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	movl	4(%rbx), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	movl	8(%rbx), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	movl	12(%rbx), %esi
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	movl	$48, %edi
	callq	_heap_alloc_zero
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %r15
	movq	_d3d_vertex_buffer7_vtbl@GOTPCREL(%rip), %rax
	movq	%rax, 40(%r13)
	movl	$1, (%r13)
	movl	(%r12), %eax
	movl	%eax, 4(%r13)
	cmpl	$7, %eax
	jne	LBB0_4
## %bb.3:
	leaq	4(%r12), %rdi
	callq	_IDirectDraw7_AddRef
LBB0_4:
	movq	%r12, 32(%r15)
	movl	4(%rbx), %eax
	movl	%eax, 8(%r15)
	movl	8(%rbx), %edi
	movl	%edi, 12(%r15)
	callq	_get_flexible_vertex_size
	imull	12(%rbx), %eax
	movl	%eax, 16(%r15)
	xorl	%eax, %eax
	callq	_wined3d_mutex_lock
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addq	$24, %r13
	movq	%r15, %rdi
	movq	%r13, %rdx
	callq	_d3d_vertex_buffer_create_wined3d_buffer
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	leaq	L_.str.5(%rip), %rdi
	movq	%r14, %rsi
	callq	_WARN
	movq	_WINED3DERR_INVALIDCALL@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	je	LBB0_6
	jmp	LBB0_10
LBB0_1:
	movq	_DDERR_OUTOFMEMORY@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	jmp	LBB0_13
LBB0_7:
	movl	8(%rbx), %esi
	movq	%r12, %rdi
	callq	_ddraw_find_decl
	movl	%eax, 20(%r15)
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movl	%eax, %edi
	callq	_wined3d_vertex_declaration_incref
	jmp	LBB0_10
LBB0_8:
	movl	8(%rbx), %esi
	leaq	L_.str.6(%rip), %rdi
	callq	_ERR
	movl	(%r13), %edi
	callq	_wined3d_buffer_decref
LBB0_6:
	movq	_DDERR_INVALIDPARAMS@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
LBB0_10:
	xorl	%eax, %eax
	callq	_wined3d_mutex_unlock
	movq	_D3D_OK@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jne	LBB0_12
## %bb.11:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%r15, (%rax)
	jmp	LBB0_13
LBB0_12:
	movq	%r15, %rdi
	callq	_heap_free
LBB0_13:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_D3D_OK,8,3                     ## @D3D_OK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Vertex buffer description:\n"

L_.str.1:                               ## @.str.1
	.asciz	"    dwSize %u\n"

L_.str.2:                               ## @.str.2
	.asciz	"    dwCaps %#x\n"

L_.str.3:                               ## @.str.3
	.asciz	"    FVF %#x\n"

L_.str.4:                               ## @.str.4
	.asciz	"    dwNumVertices %u\n"

	.comm	_DDERR_OUTOFMEMORY,8,3          ## @DDERR_OUTOFMEMORY
	.comm	_d3d_vertex_buffer7_vtbl,4,2    ## @d3d_vertex_buffer7_vtbl
	.comm	_FALSE,4,2                      ## @FALSE
L_.str.5:                               ## @.str.5
	.asciz	"Failed to create wined3d vertex buffer, hr %#x.\n"

	.comm	_WINED3DERR_INVALIDCALL,8,3     ## @WINED3DERR_INVALIDCALL
	.comm	_DDERR_INVALIDPARAMS,8,3        ## @DDERR_INVALIDPARAMS
L_.str.6:                               ## @.str.6
	.asciz	"Failed to find vertex declaration for fvf %#x.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_d3d_vertex_buffer_create       ; -- Begin function d3d_vertex_buffer_create
	.p2align	2
_d3d_vertex_buffer_create:              ; @d3d_vertex_buffer_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x2
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	ldr	w8, [x21]
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
	ldr	w8, [x21, #4]
	str	x8, [sp]
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_TRACE
	ldr	w8, [x21, #8]
	str	x8, [sp]
Lloh6:
	adrp	x0, l_.str.3@PAGE
Lloh7:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_TRACE
	ldr	w8, [x21, #12]
	str	x8, [sp]
Lloh8:
	adrp	x0, l_.str.4@PAGE
Lloh9:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_TRACE
	mov	w0, #48
	bl	_heap_alloc_zero
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
Lloh10:
	adrp	x8, _d3d_vertex_buffer7_vtbl@GOTPAGE
Lloh11:
	ldr	x8, [x8, _d3d_vertex_buffer7_vtbl@GOTPAGEOFF]
	str	x8, [x0, #40]
	mov	w8, #1
	ldr	w9, [x22]
	stp	w8, w9, [x0]
	cmp	w9, #7
	b.ne	LBB0_3
; %bb.2:
	add	x0, x22, #4
	bl	_IDirectDraw7_AddRef
LBB0_3:
	str	x22, [x20, #32]
	ldp	w8, w0, [x21, #4]
	stp	w8, w0, [x20, #8]
	bl	_get_flexible_vertex_size
	ldr	w8, [x21, #12]
	mul	w8, w8, w0
	str	w8, [x20, #16]
	bl	_wined3d_mutex_lock
Lloh12:
	adrp	x8, _FALSE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	add	x24, x20, #24
	mov	x0, x20
	mov	x2, x24
	bl	_d3d_vertex_buffer_create_wined3d_buffer
	mov	x23, x0
	bl	_FAILED
	cbz	x0, LBB0_6
; %bb.4:
Lloh15:
	adrp	x0, l_.str.5@PAGE
Lloh16:
	add	x0, x0, l_.str.5@PAGEOFF
	mov	x1, x23
	bl	_WARN
Lloh17:
	adrp	x8, _WINED3DERR_INVALIDCALL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _WINED3DERR_INVALIDCALL@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
Lloh20:
	adrp	x9, _DDERR_INVALIDPARAMS@GOTPAGE
Lloh21:
	ldr	x9, [x9, _DDERR_INVALIDPARAMS@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x23, x8
	csel	x23, x9, x23, eq
	b	LBB0_9
LBB0_5:
Lloh23:
	adrp	x8, _DDERR_OUTOFMEMORY@GOTPAGE
Lloh24:
	ldr	x8, [x8, _DDERR_OUTOFMEMORY@GOTPAGEOFF]
Lloh25:
	ldr	x23, [x8]
	b	LBB0_12
LBB0_6:
	ldr	w1, [x21, #8]
	mov	x0, x22
	bl	_ddraw_find_decl
	str	w0, [x20, #20]
	cbz	w0, LBB0_8
; %bb.7:
	bl	_wined3d_vertex_declaration_incref
	b	LBB0_9
LBB0_8:
	ldr	w1, [x21, #8]
Lloh26:
	adrp	x0, l_.str.6@PAGE
Lloh27:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_ERR
	ldr	w0, [x24]
	bl	_wined3d_buffer_decref
Lloh28:
	adrp	x8, _DDERR_INVALIDPARAMS@GOTPAGE
Lloh29:
	ldr	x8, [x8, _DDERR_INVALIDPARAMS@GOTPAGEOFF]
Lloh30:
	ldr	x23, [x8]
LBB0_9:
	bl	_wined3d_mutex_unlock
Lloh31:
	adrp	x8, _D3D_OK@GOTPAGE
Lloh32:
	ldr	x8, [x8, _D3D_OK@GOTPAGEOFF]
Lloh33:
	ldr	x8, [x8]
	cmp	x23, x8
	b.ne	LBB0_11
; %bb.10:
	str	x20, [x19]
	b	LBB0_12
LBB0_11:
	mov	x0, x20
	bl	_heap_free
LBB0_12:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_D3D_OK,8,3                     ; @D3D_OK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Vertex buffer description:\n"

l_.str.1:                               ; @.str.1
	.asciz	"    dwSize %u\n"

l_.str.2:                               ; @.str.2
	.asciz	"    dwCaps %#x\n"

l_.str.3:                               ; @.str.3
	.asciz	"    FVF %#x\n"

l_.str.4:                               ; @.str.4
	.asciz	"    dwNumVertices %u\n"

	.comm	_DDERR_OUTOFMEMORY,8,3          ; @DDERR_OUTOFMEMORY
	.comm	_d3d_vertex_buffer7_vtbl,4,2    ; @d3d_vertex_buffer7_vtbl
	.comm	_FALSE,4,2                      ; @FALSE
l_.str.5:                               ; @.str.5
	.asciz	"Failed to create wined3d vertex buffer, hr %#x.\n"

	.comm	_WINED3DERR_INVALIDCALL,8,3     ; @WINED3DERR_INVALIDCALL
	.comm	_DDERR_INVALIDPARAMS,8,3        ; @DDERR_INVALIDPARAMS
l_.str.6:                               ; @.str.6
	.asciz	"Failed to find vertex declaration for fvf %#x.\n"

.subsections_via_symbols
