	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function parse_material_list
_parse_material_list:                   ## @parse_material_list
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	$0, -48(%rbp)
	movq	%rsi, %rdi
	callq	_destroy_materials
	movq	(%r15), %rax
	leaq	-64(%rbp), %rsi
	leaq	-72(%rbp), %rdx
	movq	%r15, %rdi
	callq	*32(%rax)
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_33
## %bb.1:
	movq	_E_FAIL@GOTPCREL(%rip), %r13
	movl	(%r13), %ebx
	movslq	-64(%rbp), %rsi
	cmpq	$3, %rsi
	jbe	LBB0_2
## %bb.3:
	movq	-72(%rbp), %rcx
	movl	(%rcx), %r12d
	testl	%r12d, %r12d
	je	LBB0_4
## %bb.5:
	cmpl	$7, %esi
	ja	LBB0_6
LBB0_2:
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_WARN
	jmp	LBB0_30
LBB0_4:
	movq	_D3D_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_30
LBB0_6:
	movslq	4(%rcx), %rax
	movl	(%r14), %edx
	cmpl	%edx, %eax
	jne	LBB0_7
## %bb.8:
	leaq	8(,%rax,4), %rdx
	cmpq	%rsi, %rdx
	ja	LBB0_2
## %bb.9:
	testl	%eax, %eax
	jle	LBB0_14
## %bb.10:
	movl	%eax, %eax
	xorl	%esi, %esi
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	8(%rcx,%rsi,4), %edx
	cmpl	%r12d, %edx
	jge	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	incq	%rsi
	cmpl	%esi, %eax
	jne	LBB0_11
LBB0_14:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	leal	(,%r12,4), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	%rax, 8(%r14)
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	(%r14), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	%rax, 16(%r14)
	cmpq	$0, 8(%r14)
	je	LBB0_16
## %bb.15:
	testq	%rax, %rax
	je	LBB0_16
## %bb.17:
	movq	-72(%rbp), %rsi
	addq	$8, %rsi
	movl	(%r14), %edx
	shll	$2, %edx
	movq	%rax, %rdi
	callq	_memcpy
	movq	(%r15), %rax
	leaq	-52(%rbp), %rsi
	movq	%r15, %rdi
	callq	*24(%rax)
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_30
## %bb.18:
	cmpl	$0, -52(%rbp)
	jle	LBB0_27
## %bb.19:
	xorl	%esi, %esi
	jmp	LBB0_20
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_WARN
LBB0_30:
	movq	-48(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_32
## %bb.31:
	callq	_IUnknown_Release
LBB0_32:
	movq	(%r15), %rax
	movq	%r15, %rdi
	callq	*(%rax)
LBB0_33:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_26:                                ##   in Loop: Header=BB0_20 Depth=1
	movq	-48(%rbp), %rdi
	callq	_IUnknown_Release
	movq	$0, -48(%rbp)
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	incl	%esi
	cmpl	-52(%rbp), %esi
	jge	LBB0_27
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movq	%r15, %rdi
	movl	%esi, -56(%rbp)                 ## 4-byte Spill
	leaq	-48(%rbp), %rdx
	callq	*16(%rax)
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_30
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=1
	movq	-48(%rbp), %rdi
	movq	(%rdi), %rax
	leaq	-60(%rbp), %rsi
	callq	*8(%rax)
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_30
## %bb.22:                              ##   in Loop: Header=BB0_20 Depth=1
	leaq	-60(%rbp), %rdi
	movq	_TID_D3DRMMaterial@GOTPCREL(%rip), %rsi
	callq	_IsEqualGUID
	testq	%rax, %rax
	je	LBB0_26
## %bb.23:                              ##   in Loop: Header=BB0_20 Depth=1
	movslq	4(%r14), %rsi
	cmpl	%r12d, %esi
	jge	LBB0_24
## %bb.25:                              ##   in Loop: Header=BB0_20 Depth=1
	movq	-48(%rbp), %rdi
	leal	1(%rsi), %eax
	movl	%eax, 4(%r14)
	shlq	$2, %rsi
	addq	8(%r14), %rsi
	callq	_parse_material
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_26
	jmp	LBB0_30
LBB0_16:
	movq	_E_OUTOFMEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_30
LBB0_12:
	leaq	L_.str.2(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_WARN
	jmp	LBB0_30
LBB0_27:
	movl	4(%r14), %edx
	cmpl	%edx, %r12d
	je	LBB0_30
## %bb.28:
	leaq	L_.str.4(%rip), %rdi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_WARN
	jmp	LBB0_29
LBB0_24:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_WARN
LBB0_29:
	movl	(%r13), %ebx
	jmp	LBB0_30
	.cfi_endproc
                                        ## -- End function
	.comm	_E_FAIL,4,2                     ## @E_FAIL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"truncated data (%ld bytes)\n"

	.comm	_D3D_OK,4,2                     ## @D3D_OK
L_.str.1:                               ## @.str.1
	.asciz	"number of material face indices (%u) doesn't match number of faces (%u)\n"

L_.str.2:                               ## @.str.2
	.asciz	"face %u: reference to undefined material %u (only %u materials)\n"

	.comm	_E_OUTOFMEMORY,4,2              ## @E_OUTOFMEMORY
	.comm	_TID_D3DRMMaterial,4,2          ## @TID_D3DRMMaterial
L_.str.3:                               ## @.str.3
	.asciz	"more materials defined than declared\n"

L_.str.4:                               ## @.str.4
	.asciz	"only %u of %u materials defined\n"

	.no_dead_strip	_parse_material_list
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function parse_material_list
_parse_material_list:                   ; @parse_material_list
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	mov	x19, x0
	str	xzr, [sp, #32]
	mov	x0, x1
	bl	_destroy_materials
	ldr	x8, [x19]
	ldr	x8, [x8, #32]
	add	x1, sp, #60
	add	x2, sp, #48
	mov	x0, x19
	blr	x8
	mov	x21, x0
	bl	_FAILED
	cbnz	x0, LBB0_9
; %bb.1:
Lloh0:
	adrp	x24, _E_FAIL@GOTPAGE
Lloh1:
	ldr	x24, [x24, _E_FAIL@GOTPAGEOFF]
	ldr	w21, [x24]
	ldrsw	x8, [sp, #60]
	cmp	w8, #3
	b.ls	LBB0_4
; %bb.2:
	ldr	x9, [sp, #48]
	ldr	w25, [x9]
	cbz	w25, LBB0_10
; %bb.3:
	cmp	w8, #7
	b.hi	LBB0_11
LBB0_4:
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
LBB0_5:
	bl	_WARN
LBB0_6:
	ldr	x0, [sp, #32]
	cbz	x0, LBB0_8
; %bb.7:
	bl	_IUnknown_Release
LBB0_8:
	ldr	x8, [x19]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
LBB0_9:
	mov	x0, x21
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_10:
Lloh4:
	adrp	x8, _D3D_OK@GOTPAGE
Lloh5:
	ldr	x8, [x8, _D3D_OK@GOTPAGEOFF]
Lloh6:
	ldr	w21, [x8]
	b	LBB0_6
LBB0_11:
	ldrsw	x10, [x9, #4]
	ldr	w11, [x20]
	cmp	w10, w11
	b.ne	LBB0_22
; %bb.12:
	lsl	x11, x10, #2
	add	x11, x11, #8
	cmp	x11, x8
	b.hi	LBB0_4
; %bb.13:
	cmp	w10, #1
	b.lt	LBB0_17
; %bb.14:
	mov	x8, #0
	add	x9, x9, #8
	and	x10, x10, #0xffffffff
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x9, x8, lsl #2]
	cmp	w11, w25
	b.ge	LBB0_30
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	add	x8, x8, #1
	cmp	w10, w8
	b.ne	LBB0_15
LBB0_17:
	bl	_GetProcessHeap
	lsl	w2, w25, #2
	mov	w1, #0
	bl	_HeapAlloc
	str	x0, [x20, #8]
	bl	_GetProcessHeap
	ldr	w2, [x20]
	mov	w1, #0
	bl	_HeapAlloc
	str	x0, [x20, #16]
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_29
; %bb.18:
	cbz	x0, LBB0_29
; %bb.19:
	ldr	x8, [sp, #48]
	add	x1, x8, #8
	ldr	w8, [x20]
	lsl	w2, w8, #2
	bl	_memcpy
	ldr	x8, [x19]
	ldr	x8, [x8, #24]
	add	x1, sp, #28
	mov	x0, x19
	blr	x8
	mov	x21, x0
	bl	_FAILED
	cbnz	x0, LBB0_6
; %bb.20:
	ldr	w8, [sp, #28]
	cmp	w8, #1
	b.lt	LBB0_31
; %bb.21:
	mov	w22, #0
Lloh7:
	adrp	x23, _TID_D3DRMMaterial@GOTPAGE
Lloh8:
	ldr	x23, [x23, _TID_D3DRMMaterial@GOTPAGEOFF]
	b	LBB0_24
LBB0_22:
	stp	x10, x11, [sp]
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_5
LBB0_23:                                ;   in Loop: Header=BB0_24 Depth=1
	ldr	x0, [sp, #32]
	bl	_IUnknown_Release
	str	xzr, [sp, #32]
	add	w22, w22, #1
	ldr	w8, [sp, #28]
	cmp	w22, w8
	b.ge	LBB0_31
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	x8, [x8, #16]
	add	x2, sp, #32
	mov	x0, x19
	mov	x1, x22
	blr	x8
	mov	x21, x0
	bl	_FAILED
	cbnz	x0, LBB0_6
; %bb.25:                               ;   in Loop: Header=BB0_24 Depth=1
	ldr	x0, [sp, #32]
	ldr	x8, [x0]
	ldr	x8, [x8, #8]
	add	x1, sp, #44
	blr	x8
	mov	x21, x0
	bl	_FAILED
	cbnz	x0, LBB0_6
; %bb.26:                               ;   in Loop: Header=BB0_24 Depth=1
	add	x0, sp, #44
	mov	x1, x23
	bl	_IsEqualGUID
	cbz	x0, LBB0_23
; %bb.27:                               ;   in Loop: Header=BB0_24 Depth=1
	ldrsw	x8, [x20, #4]
	cmp	w8, w25
	b.ge	LBB0_33
; %bb.28:                               ;   in Loop: Header=BB0_24 Depth=1
	ldr	x0, [sp, #32]
	ldr	x9, [x20, #8]
	add	w10, w8, #1
	str	w10, [x20, #4]
	add	x1, x9, x8, lsl #2
	bl	_parse_material
	mov	x21, x0
	bl	_FAILED
	cbz	x0, LBB0_23
	b	LBB0_6
LBB0_29:
Lloh11:
	adrp	x8, _E_OUTOFMEMORY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _E_OUTOFMEMORY@GOTPAGEOFF]
Lloh13:
	ldr	w21, [x8]
	b	LBB0_6
LBB0_30:
	stp	x11, x25, [sp, #8]
	str	x8, [sp]
Lloh14:
	adrp	x0, l_.str.2@PAGE
Lloh15:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_31:
	ldr	w8, [x20, #4]
	cmp	w25, w8
	b.eq	LBB0_6
; %bb.32:
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	stp	x25, x8, [sp]
Lloh16:
	adrp	x0, l_.str.4@PAGE
Lloh17:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_34
LBB0_33:
Lloh18:
	adrp	x0, l_.str.3@PAGE
Lloh19:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_34:
	bl	_WARN
	ldr	w21, [x24]
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_E_FAIL,4,2                     ; @E_FAIL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"truncated data (%ld bytes)\n"

	.comm	_D3D_OK,4,2                     ; @D3D_OK
l_.str.1:                               ; @.str.1
	.asciz	"number of material face indices (%u) doesn't match number of faces (%u)\n"

l_.str.2:                               ; @.str.2
	.asciz	"face %u: reference to undefined material %u (only %u materials)\n"

	.comm	_E_OUTOFMEMORY,4,2              ; @E_OUTOFMEMORY
	.comm	_TID_D3DRMMaterial,4,2          ; @TID_D3DRMMaterial
l_.str.3:                               ; @.str.3
	.asciz	"more materials defined than declared\n"

l_.str.4:                               ; @.str.4
	.asciz	"only %u of %u materials defined\n"

	.no_dead_strip	_parse_material_list
.subsections_via_symbols
