	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function d3dx9_apply_pass_states
_d3dx9_apply_pass_states:               ## @d3dx9_apply_pass_states
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %r13
	addq	$32, %rdi
	callq	_next_effect_update_version
	movl	%eax, %ebx
	movl	(%r14), %ecx
	leaq	L_.str(%rip), %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	callq	_TRACE
	movq	_D3D_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$0, (%r14)
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	je	LBB0_5
## %bb.1:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	movl	(%r14), %eax
	addq	$4, %r15
	cmpq	%rax, %rbx
	jae	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rdx
	addq	%r15, %rdx
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	$-1, %ecx
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	callq	_d3dx9_apply_state
	movl	%eax, %r12d
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %esi
	callq	_WARN
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	jmp	LBB0_4
LBB0_5:
	cmpl	$0, (%r13)
	je	LBB0_13
## %bb.6:
	movq	24(%r13), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	je	LBB0_12
## %bb.7:
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	incq	%r15
	movq	24(%r13), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	addq	$4, %r12
	cmpq	%rax, %r15
	jae	LBB0_12
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %eax
	btl	%r15d, %eax
	jae	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	_SetLight@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	24(%r13), %rcx
	addq	%r12, %rcx
	movq	%r13, %rdi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_SET_D3D_STATE
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	callq	_WARN
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_11
LBB0_12:
	movl	$0, (%r13)
LBB0_13:
	movl	-48(%rbp), %r12d                ## 4-byte Reload
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	cmpq	$0, 8(%r13)
	je	LBB0_16
## %bb.14:
	movq	_SetMaterial@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leal	16(%r13), %edx
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_SET_D3D_STATE
	movl	%eax, %r15d
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	leaq	L_.str.3(%rip), %rdi
	movl	%r15d, %esi
	callq	_WARN
	movl	%r15d, %ebx
LBB0_16:
	movq	_FALSE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r13)
	movl	%r12d, 4(%r14)
	movl	%ebx, %eax
	addq	$24, %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	"effect %p, pass %p, state_count %u.\n"

	.comm	_D3D_OK,4,2                     ## @D3D_OK
L_.str.1:                               ## @.str.1
	.asciz	"Error applying state, hr %#x.\n"

	.comm	_SetLight,4,2                   ## @SetLight
L_.str.2:                               ## @.str.2
	.asciz	"Error setting light, hr %#x.\n"

	.comm	_SetMaterial,4,2                ## @SetMaterial
L_.str.3:                               ## @.str.3
	.asciz	"Error setting material, hr %#x.\n"

	.comm	_FALSE,8,3                      ## @FALSE
	.no_dead_strip	_d3dx9_apply_pass_states
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d3dx9_apply_pass_states
_d3dx9_apply_pass_states:               ; @d3dx9_apply_pass_states
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x23, x2
	mov	x19, x1
	mov	x20, x0
	add	x0, x0, #32
	bl	_next_effect_update_version
	mov	x21, x0
	ldr	w3, [x19]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x19
	bl	_TRACE
Lloh2:
	adrp	x8, _D3D_OK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _D3D_OK@GOTPAGEOFF]
Lloh4:
	ldr	w22, [x8]
	ldr	w8, [x19]
	cbz	w8, LBB0_5
; %bb.1:
	mov	x26, #0
	mov	x27, #0
Lloh5:
	adrp	x24, l_.str.1@PAGE
Lloh6:
	add	x24, x24, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x27, x27, #1
	ldr	w8, [x19]
	add	x26, x26, #4
	cmp	x27, x8
	b.hs	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x2, x8, x26
	mov	x0, x20
	mov	x1, x19
	mov	w3, #-1
	mov	x4, x23
	bl	_d3dx9_apply_state
	mov	x25, x0
	bl	_FAILED
	cbz	x0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x24
	mov	x1, x25
	bl	_WARN
	mov	x22, x25
	b	LBB0_2
LBB0_5:
	ldr	w8, [x20]
	cbz	w8, LBB0_13
; %bb.6:
	ldr	x0, [x20, #24]
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_12
; %bb.7:
	mov	x26, #0
	mov	x23, #0
Lloh7:
	adrp	x27, _SetLight@GOTPAGE
Lloh8:
	ldr	x27, [x27, _SetLight@GOTPAGEOFF]
Lloh9:
	adrp	x24, l_.str.2@PAGE
Lloh10:
	add	x24, x24, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x23, x23, #1
	ldr	x0, [x20, #24]
	bl	_ARRAY_SIZE
	add	x26, x26, #4
	cmp	x23, w0, uxtw
	b.hs	LBB0_12
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20]
	lsr	w8, w8, w23
	tbz	w8, #0, LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w1, [x27]
	ldr	x8, [x20, #24]
	add	x8, x8, x26
	str	x8, [sp]
	mov	x0, x20
	mov	x2, x23
	bl	_SET_D3D_STATE
	mov	x25, x0
	bl	_FAILED
	cbz	x0, LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x24
	mov	x1, x25
	bl	_WARN
	mov	x22, x25
	b	LBB0_8
LBB0_12:
	str	wzr, [x20]
LBB0_13:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_16
; %bb.14:
Lloh11:
	adrp	x8, _SetMaterial@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SetMaterial@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	add	w2, w20, #16
	mov	x0, x20
	bl	_SET_D3D_STATE
	mov	x23, x0
	bl	_FAILED
	cbz	x0, LBB0_16
; %bb.15:
Lloh14:
	adrp	x0, l_.str.3@PAGE
Lloh15:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x23
	bl	_WARN
	mov	x22, x23
LBB0_16:
Lloh16:
	adrp	x8, _FALSE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	str	x8, [x20, #8]
	str	w21, [x19, #4]
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"effect %p, pass %p, state_count %u.\n"

	.comm	_D3D_OK,4,2                     ; @D3D_OK
l_.str.1:                               ; @.str.1
	.asciz	"Error applying state, hr %#x.\n"

	.comm	_SetLight,4,2                   ; @SetLight
l_.str.2:                               ; @.str.2
	.asciz	"Error setting light, hr %#x.\n"

	.comm	_SetMaterial,4,2                ; @SetMaterial
l_.str.3:                               ; @.str.3
	.asciz	"Error setting material, hr %#x.\n"

	.comm	_FALSE,8,3                      ; @FALSE
	.no_dead_strip	_d3dx9_apply_pass_states
.subsections_via_symbols
