	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function d3dx9_base_effect_set_texture
_d3dx9_base_effect_set_texture:         ## @d3dx9_base_effect_set_texture
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	callq	_get_valid_parameter
	testq	%rax, %rax
	je	LBB0_13
## %bb.1:
	movq	%rax, %rbx
	cmpl	$0, 16(%rax)
	jne	LBB0_13
## %bb.2:
	movq	(%rbx), %rax
	movq	_D3DXPT_TEXTURE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.3:
	movq	_D3DXPT_TEXTURE1D@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.4:
	movq	_D3DXPT_TEXTURE2D@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.5:
	movq	_D3DXPT_TEXTURE3D@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.6:
	movq	_D3DXPT_TEXTURECUBE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
LBB0_13:
	leaq	L_.str(%rip), %rdi
	callq	_WARN
	movq	_D3DERR_INVALIDCALL@GOTPCREL(%rip), %r12
LBB0_14:
	movl	(%r12), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	8(%rbx), %rax
	movq	(%rax), %r15
	movq	_D3D_OK@GOTPCREL(%rip), %r12
	cmpq	%r14, %r15
	je	LBB0_14
## %bb.8:
	testq	%r14, %r14
	je	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	callq	_IDirect3DBaseTexture9_AddRef
LBB0_10:
	testq	%r15, %r15
	je	LBB0_12
## %bb.11:
	movq	%r15, %rdi
	callq	_IDirect3DBaseTexture9_Release
LBB0_12:
	movq	8(%rbx), %rax
	movq	%r14, (%rax)
	movq	%rbx, %rdi
	callq	_set_dirty
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_D3DXPT_TEXTURE,8,3             ## @D3DXPT_TEXTURE
	.comm	_D3DXPT_TEXTURE1D,8,3           ## @D3DXPT_TEXTURE1D
	.comm	_D3DXPT_TEXTURE2D,8,3           ## @D3DXPT_TEXTURE2D
	.comm	_D3DXPT_TEXTURE3D,8,3           ## @D3DXPT_TEXTURE3D
	.comm	_D3DXPT_TEXTURECUBE,8,3         ## @D3DXPT_TEXTURECUBE
	.comm	_D3D_OK,4,2                     ## @D3D_OK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Parameter not found.\n"

	.comm	_D3DERR_INVALIDCALL,4,2         ## @D3DERR_INVALIDCALL
	.no_dead_strip	_d3dx9_base_effect_set_texture
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d3dx9_base_effect_set_texture
_d3dx9_base_effect_set_texture:         ; @d3dx9_base_effect_set_texture
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x2
	bl	_get_valid_parameter
	cbz	x0, LBB0_10
; %bb.1:
	mov	x20, x0
	ldr	w8, [x0, #16]
	cbnz	w8, LBB0_10
; %bb.2:
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _D3DXPT_TEXTURE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _D3DXPT_TEXTURE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _D3DXPT_TEXTURE1D@GOTPAGE
Lloh4:
	ldr	x10, [x10, _D3DXPT_TEXTURE1D@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
Lloh6:
	adrp	x11, _D3DXPT_TEXTURE2D@GOTPAGE
Lloh7:
	ldr	x11, [x11, _D3DXPT_TEXTURE2D@GOTPAGEOFF]
Lloh8:
	ldr	x11, [x11]
Lloh9:
	adrp	x12, _D3DXPT_TEXTURE3D@GOTPAGE
Lloh10:
	ldr	x12, [x12, _D3DXPT_TEXTURE3D@GOTPAGEOFF]
Lloh11:
	ldr	x12, [x12]
Lloh12:
	adrp	x13, _D3DXPT_TEXTURECUBE@GOTPAGE
Lloh13:
	ldr	x13, [x13, _D3DXPT_TEXTURECUBE@GOTPAGEOFF]
Lloh14:
	ldr	x13, [x13]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	ccmp	x8, x11, #4, ne
	ccmp	x8, x12, #4, ne
	ccmp	x8, x13, #4, ne
	b.ne	LBB0_10
; %bb.3:
	ldr	x8, [x20, #8]
	ldr	x21, [x8]
	cmp	x21, x19
	b.eq	LBB0_9
; %bb.4:
	cbz	x19, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_IDirect3DBaseTexture9_AddRef
LBB0_6:
	cbz	x21, LBB0_8
; %bb.7:
	mov	x0, x21
	bl	_IDirect3DBaseTexture9_Release
LBB0_8:
	ldr	x8, [x20, #8]
	str	x19, [x8]
	mov	x0, x20
	bl	_set_dirty
LBB0_9:
Lloh15:
	adrp	x8, _D3D_OK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _D3D_OK@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_WARN
Lloh19:
	adrp	x8, _D3DERR_INVALIDCALL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _D3DERR_INVALIDCALL@GOTPAGEOFF]
LBB0_11:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_D3DXPT_TEXTURE,8,3             ; @D3DXPT_TEXTURE
	.comm	_D3DXPT_TEXTURE1D,8,3           ; @D3DXPT_TEXTURE1D
	.comm	_D3DXPT_TEXTURE2D,8,3           ; @D3DXPT_TEXTURE2D
	.comm	_D3DXPT_TEXTURE3D,8,3           ; @D3DXPT_TEXTURE3D
	.comm	_D3DXPT_TEXTURECUBE,8,3         ; @D3DXPT_TEXTURECUBE
	.comm	_D3D_OK,4,2                     ; @D3D_OK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Parameter not found.\n"

	.comm	_D3DERR_INVALIDCALL,4,2         ; @D3DERR_INVALIDCALL
	.no_dead_strip	_d3dx9_base_effect_set_texture
.subsections_via_symbols
