	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_indexbuffer_init               ## -- Begin function indexbuffer_init
	.p2align	4, 0x90
_indexbuffer_init:                      ## @indexbuffer_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	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r15d
	movq	%rsi, %r14
	movq	%rdi, %r12
	movl	%edx, -36(%rbp)
	movq	_WINED3DUSAGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%ecx, %eax
	movq	_WINED3DUSAGE_STATICDECL@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	movl	%eax, -64(%rbp)
	movq	_D3DPOOL_SCRATCH@GOTPCREL(%rip), %rdx
	cmpq	%r9, (%rdx)
	jne	LBB0_2
## %bb.1:
	movq	_WINED3DUSAGE_SCRATCH@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	movl	%eax, -64(%rbp)
LBB0_2:
	movq	_WINED3D_BIND_INDEX_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	%r9, %rdi
	movl	%ecx, %esi
	callq	_wined3daccess_from_d3dpool
	movq	_WINED3D_RESOURCE_ACCESS_MAP_R@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_WINED3D_RESOURCE_ACCESS_MAP_W@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, -60(%rbp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, -56(%rbp)
	movq	_d3d8_indexbuffer_vtbl@GOTPCREL(%rip), %rax
	movq	%rax, 24(%r12)
	leaq	16(%r12), %rdi
	callq	_d3d8_resource_init
	movl	%r15d, %edi
	callq	_wined3dformat_from_d3dformat
	movl	%eax, 12(%r12)
	xorl	%eax, %eax
	callq	_wined3d_mutex_lock
	movl	4(%r14), %edi
	leaq	8(%r12), %r9
	movq	_d3d8_indexbuffer_wined3d_parent_ops@GOTPCREL(%rip), %r8
	leaq	-64(%rbp), %rsi
	xorl	%edx, %edx
	movq	%r12, %rcx
	callq	_wined3d_buffer_create
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_wined3d_mutex_unlock
	movl	%ebx, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_WARN
	jmp	LBB0_5
LBB0_4:
	movq	%r14, (%r12)
	movq	%r14, %rdi
	callq	_IDirect3DDevice8_AddRef
	movq	_D3D_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WINED3DUSAGE_MASK,4,2          ## @WINED3DUSAGE_MASK
	.comm	_WINED3DUSAGE_STATICDECL,4,2    ## @WINED3DUSAGE_STATICDECL
	.comm	_D3DPOOL_SCRATCH,8,3            ## @D3DPOOL_SCRATCH
	.comm	_WINED3DUSAGE_SCRATCH,4,2       ## @WINED3DUSAGE_SCRATCH
	.comm	_WINED3D_BIND_INDEX_BUFFER,4,2  ## @WINED3D_BIND_INDEX_BUFFER
	.comm	_WINED3D_RESOURCE_ACCESS_MAP_R,4,2 ## @WINED3D_RESOURCE_ACCESS_MAP_R
	.comm	_WINED3D_RESOURCE_ACCESS_MAP_W,4,2 ## @WINED3D_RESOURCE_ACCESS_MAP_W
	.comm	_d3d8_indexbuffer_vtbl,4,2      ## @d3d8_indexbuffer_vtbl
	.comm	_d3d8_indexbuffer_wined3d_parent_ops,4,2 ## @d3d8_indexbuffer_wined3d_parent_ops
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to create wined3d buffer, 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	_indexbuffer_init               ; -- Begin function indexbuffer_init
	.p2align	2
_indexbuffer_init:                      ; @indexbuffer_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x21, x4
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _WINED3DUSAGE_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WINED3DUSAGE_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w8, w8, w3
Lloh3:
	adrp	x9, _WINED3DUSAGE_STATICDECL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _WINED3DUSAGE_STATICDECL@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w2, [sp, #28]
	str	w8, [sp]
Lloh6:
	adrp	x9, _D3DPOOL_SCRATCH@GOTPAGE
Lloh7:
	ldr	x9, [x9, _D3DPOOL_SCRATCH@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x5
	b.ne	LBB0_2
; %bb.1:
Lloh9:
	adrp	x9, _WINED3DUSAGE_SCRATCH@GOTPAGE
Lloh10:
	ldr	x9, [x9, _WINED3DUSAGE_SCRATCH@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [sp]
LBB0_2:
Lloh12:
	adrp	x8, _WINED3D_BIND_INDEX_BUFFER@GOTPAGE
Lloh13:
	ldr	x8, [x8, _WINED3D_BIND_INDEX_BUFFER@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [sp, #24]
	mov	x0, x5
	mov	x1, x3
	bl	_wined3daccess_from_d3dpool
Lloh15:
	adrp	x8, _WINED3D_RESOURCE_ACCESS_MAP_R@GOTPAGE
Lloh16:
	ldr	x8, [x8, _WINED3D_RESOURCE_ACCESS_MAP_R@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	orr	w8, w8, w0
Lloh18:
	adrp	x9, _WINED3D_RESOURCE_ACCESS_MAP_W@GOTPAGE
Lloh19:
	ldr	x9, [x9, _WINED3D_RESOURCE_ACCESS_MAP_W@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [sp, #4]
	stp	xzr, xzr, [sp, #8]
Lloh21:
	adrp	x8, _d3d8_indexbuffer_vtbl@GOTPAGE
Lloh22:
	ldr	x8, [x8, _d3d8_indexbuffer_vtbl@GOTPAGEOFF]
	str	x8, [x20, #24]
	add	x0, x20, #16
	bl	_d3d8_resource_init
	mov	x0, x21
	bl	_wined3dformat_from_d3dformat
	str	w0, [x20, #12]
	bl	_wined3d_mutex_lock
	ldr	w0, [x19, #4]
	add	x5, x20, #8
Lloh23:
	adrp	x4, _d3d8_indexbuffer_wined3d_parent_ops@GOTPAGE
Lloh24:
	ldr	x4, [x4, _d3d8_indexbuffer_wined3d_parent_ops@GOTPAGEOFF]
	mov	x1, sp
	mov	x2, #0
	mov	x3, x20
	bl	_wined3d_buffer_create
	mov	x21, x0
	bl	_wined3d_mutex_unlock
	mov	x0, x21
	bl	_FAILED
	cbz	x0, LBB0_4
; %bb.3:
Lloh25:
	adrp	x0, l_.str@PAGE
Lloh26:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_WARN
	b	LBB0_5
LBB0_4:
	str	x19, [x20]
	mov	x0, x19
	bl	_IDirect3DDevice8_AddRef
Lloh27:
	adrp	x8, _D3D_OK@GOTPAGE
Lloh28:
	ldr	x8, [x8, _D3D_OK@GOTPAGEOFF]
Lloh29:
	ldr	w21, [x8]
LBB0_5:
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_WINED3DUSAGE_MASK,4,2          ; @WINED3DUSAGE_MASK
	.comm	_WINED3DUSAGE_STATICDECL,4,2    ; @WINED3DUSAGE_STATICDECL
	.comm	_D3DPOOL_SCRATCH,8,3            ; @D3DPOOL_SCRATCH
	.comm	_WINED3DUSAGE_SCRATCH,4,2       ; @WINED3DUSAGE_SCRATCH
	.comm	_WINED3D_BIND_INDEX_BUFFER,4,2  ; @WINED3D_BIND_INDEX_BUFFER
	.comm	_WINED3D_RESOURCE_ACCESS_MAP_R,4,2 ; @WINED3D_RESOURCE_ACCESS_MAP_R
	.comm	_WINED3D_RESOURCE_ACCESS_MAP_W,4,2 ; @WINED3D_RESOURCE_ACCESS_MAP_W
	.comm	_d3d8_indexbuffer_vtbl,4,2      ; @d3d8_indexbuffer_vtbl
	.comm	_d3d8_indexbuffer_wined3d_parent_ops,4,2 ; @d3d8_indexbuffer_wined3d_parent_ops
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to create wined3d buffer, hr %#x.\n"

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