	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function d3dx9_parse_sampler
_d3dx9_parse_sampler:                   ## @d3dx9_parse_sampler
	.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	%r8, %r15
	movq	%rcx, %rbx
	movq	%rdx, %r13
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	%rcx, %rdi
	callq	_read_dword
	movl	(%r12), %esi
	leaq	L_.str(%rip), %rdi
	callq	_TRACE
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%r12), %edx
	shll	$2, %edx
	movl	%eax, %edi
	callq	_HeapAlloc
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	cmpl	$0, (%r12)
	je	LBB0_9
## %bb.2:
	movq	%r14, %rdi
	movq	%rax, %rsi
	movq	%r13, %rdx
	movq	%rbx, %rcx
	movq	%r15, %r8
	callq	_d3dx9_parse_state
	movq	%r14, %rcx
	movq	%rax, %r14
	movq	_D3D_OK@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_3
## %bb.11:
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movl	$4, %r15d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	incq	%r13
	movslq	(%r12), %rax
	cmpq	%rax, %r13
	jae	LBB0_8
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	8(%r12), %rsi
	addq	%r15, %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rdx, %rbx
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	callq	_d3dx9_parse_state
	movq	%rbx, %rdx
	movq	%rax, %r14
	addq	$4, %r15
	cmpq	(%rbx), %rax
	je	LBB0_12
	jmp	LBB0_4
LBB0_10:
	leaq	L_.str.1(%rip), %rdi
	callq	_ERR
	movq	_E_OUTOFMEMORY@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	jmp	LBB0_8
LBB0_9:
	movq	_D3D_OK@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	jmp	LBB0_8
LBB0_3:
	xorl	%r13d, %r13d
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
	movq	%r13, %rsi
	callq	_WARN
	cmpl	$0, (%r12)
	je	LBB0_7
## %bb.5:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rdi
	addq	%r15, %rdi
	callq	_free_state
	incq	%rbx
	movslq	(%r12), %rax
	addq	$4, %r15
	cmpq	%rax, %rbx
	jb	LBB0_6
LBB0_7:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	8(%r12), %rdx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapFree
	movq	$0, 8(%r12)
LBB0_8:
	movq	%r14, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Count: %u\n"

	.comm	_HEAP_ZERO_MEMORY,4,2           ## @HEAP_ZERO_MEMORY
L_.str.1:                               ## @.str.1
	.asciz	"Out of memory\n"

	.comm	_E_OUTOFMEMORY,8,3              ## @E_OUTOFMEMORY
	.comm	_D3D_OK,8,3                     ## @D3D_OK
L_.str.2:                               ## @.str.2
	.asciz	"Failed to parse state %u\n"

	.no_dead_strip	_d3dx9_parse_sampler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d3dx9_parse_sampler
_d3dx9_parse_sampler:                   ; @d3dx9_parse_sampler
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x4
	mov	x22, x3
	mov	x23, x2
	mov	x19, x1
	mov	x24, x0
	mov	x0, x3
	bl	_read_dword
	ldr	w1, [x19]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	bl	_GetProcessHeap
Lloh2:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	ldr	w8, [x19]
	lsl	w2, w8, #2
	bl	_HeapAlloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_6
; %bb.1:
	ldr	w8, [x19]
	cbz	w8, LBB0_7
; %bb.2:
	mov	x1, x0
	mov	x0, x24
	mov	x2, x23
	mov	x3, x22
	mov	x4, x21
	bl	_d3dx9_parse_state
	mov	x20, x0
Lloh5:
	adrp	x26, _D3D_OK@GOTPAGE
Lloh6:
	ldr	x26, [x26, _D3D_OK@GOTPAGEOFF]
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.3:
	mov	x25, #0
	mov	w27, #4
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x25, x25, #1
	ldrsw	x8, [x19]
	cmp	x25, x8
	b.hs	LBB0_13
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #8]
	add	x1, x8, x27
	mov	x0, x24
	mov	x2, x23
	mov	x3, x22
	mov	x4, x21
	bl	_d3dx9_parse_state
	mov	x20, x0
	ldr	x8, [x26]
	add	x27, x27, #4
	cmp	x0, x8
	b.eq	LBB0_4
	b	LBB0_9
LBB0_6:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ERR
Lloh9:
	adrp	x8, _E_OUTOFMEMORY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _E_OUTOFMEMORY@GOTPAGEOFF]
Lloh11:
	ldr	x20, [x8]
	b	LBB0_13
LBB0_7:
Lloh12:
	adrp	x8, _D3D_OK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _D3D_OK@GOTPAGEOFF]
Lloh14:
	ldr	x20, [x8]
	b	LBB0_13
LBB0_8:
	mov	x25, #0
LBB0_9:
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x25
	bl	_WARN
	ldr	w8, [x19]
	cbz	w8, LBB0_12
; %bb.10:
	mov	x21, #0
	mov	x22, #0
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x0, x8, x21
	bl	_free_state
	add	x22, x22, #1
	ldrsw	x8, [x19]
	add	x21, x21, #4
	cmp	x22, x8
	b.lo	LBB0_11
LBB0_12:
	bl	_GetProcessHeap
	ldr	x2, [x19, #8]
	mov	w1, #0
	bl	_HeapFree
	str	xzr, [x19, #8]
LBB0_13:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Count: %u\n"

	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
l_.str.1:                               ; @.str.1
	.asciz	"Out of memory\n"

	.comm	_E_OUTOFMEMORY,8,3              ; @E_OUTOFMEMORY
	.comm	_D3D_OK,8,3                     ; @D3D_OK
l_.str.2:                               ; @.str.2
	.asciz	"Failed to parse state %u\n"

	.no_dead_strip	_d3dx9_parse_sampler
.subsections_via_symbols
