	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function state_tss_constant_arbfp
_state_tss_constant_arbfp:              ## @state_tss_constant_arbfp
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r14
	movq	%rdi, %r15
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_STATE_TEXTURESTAGE
	subl	%eax, %ebx
	movq	_WINED3D_HIGHEST_TEXTURE_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	incl	%ecx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	movl	%eax, %r12d
	movq	(%r15), %rbx
	movq	8(%rbx), %rax
	cmpq	_arb_program_shader_backend@GOTPCREL(%rip), %rax
	je	LBB0_1
LBB0_3:
	movq	(%r14), %rax
	movslq	%r12d, %rcx
	movq	(%rax,%rcx,8), %rax
	movq	_WINED3D_TSS_CONSTANT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %esi
	leaq	-40(%rbp), %r14
	movq	%r14, %rdi
	callq	_wined3d_color_from_d3dcolor
	movq	_GL_FRAGMENT_PROGRAM_ARB@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r12d, %edi
	callq	_ARB_FFP_CONST_CONSTANT
	movl	%ebx, %edi
	movl	%eax, %esi
	movq	%r14, %rdx
	callq	_glProgramEnvParameter4fvARB
	movl	%eax, %edi
	callq	_GL_EXTCALL
	leaq	L_.str(%rip), %rdi
	callq	_checkGLcall
	jmp	LBB0_4
LBB0_1:
	movq	%r14, %rdi
	callq	_use_ps
	testq	%rax, %rax
	je	LBB0_2
LBB0_4:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	(%rbx), %rbx
	movq	(%rbx), %r15
	movl	%r12d, %edi
	callq	_ARB_FFP_CONST_CONSTANT
	cltq
	movl	$1, (%r15,%rax,4)
	movl	8(%rbx), %r15d
	movl	%r12d, %edi
	callq	_ARB_FFP_CONST_CONSTANT
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %esi
	movl	%r15d, %edi
	callq	_max
	movl	%eax, 8(%rbx)
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_WINED3D_HIGHEST_TEXTURE_STATE,4,2 ## @WINED3D_HIGHEST_TEXTURE_STATE
	.comm	_arb_program_shader_backend,4,2 ## @arb_program_shader_backend
	.comm	_WINED3D_TSS_CONSTANT,8,3       ## @WINED3D_TSS_CONSTANT
	.comm	_GL_FRAGMENT_PROGRAM_ARB,4,2    ## @GL_FRAGMENT_PROGRAM_ARB
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_CONSTANT(stage), &color.r)"

	.no_dead_strip	_state_tss_constant_arbfp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function state_tss_constant_arbfp
_state_tss_constant_arbfp:              ; @state_tss_constant_arbfp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x21, x0
	mov	w0, #0
	mov	w1, #0
	bl	_STATE_TEXTURESTAGE
	sub	w8, w19, w0
Lloh0:
	adrp	x9, _WINED3D_HIGHEST_TEXTURE_STATE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WINED3D_HIGHEST_TEXTURE_STATE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	add	w9, w9, #1
	sdiv	w19, w8, w9
	ldr	x21, [x21]
	ldr	x8, [x21, #8]
Lloh3:
	adrp	x9, _arb_program_shader_backend@GOTPAGE
Lloh4:
	ldr	x9, [x9, _arb_program_shader_backend@GOTPAGEOFF]
	cmp	x8, x9
	b.eq	LBB0_2
LBB0_1:
	ldr	x8, [x20]
	ldr	x8, [x8, w19, sxtw #3]
Lloh5:
	adrp	x9, _WINED3D_TSS_CONSTANT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _WINED3D_TSS_CONSTANT@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	ldr	w1, [x8, x9, lsl #2]
	add	x0, sp, #8
	bl	_wined3d_color_from_d3dcolor
Lloh8:
	adrp	x8, _GL_FRAGMENT_PROGRAM_ARB@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GL_FRAGMENT_PROGRAM_ARB@GOTPAGEOFF]
Lloh10:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_ARB_FFP_CONST_CONSTANT
	mov	x1, x0
	add	x2, sp, #8
	mov	x0, x20
	bl	_glProgramEnvParameter4fvARB
	bl	_GL_EXTCALL
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_checkGLcall
	b	LBB0_3
LBB0_2:
	mov	x0, x20
	bl	_use_ps
	cbz	x0, LBB0_4
LBB0_3:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_4:
	ldr	x22, [x21]
	ldr	x21, [x22]
	mov	x0, x19
	bl	_ARB_FFP_CONST_CONSTANT
	mov	w8, #1
	str	w8, [x21, w0, sxtw #2]
	ldr	w21, [x22, #8]
	mov	x0, x19
	bl	_ARB_FFP_CONST_CONSTANT
	add	w1, w0, #1
	mov	x0, x21
	bl	_max
	str	w0, [x22, #8]
	b	LBB0_1
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_WINED3D_HIGHEST_TEXTURE_STATE,4,2 ; @WINED3D_HIGHEST_TEXTURE_STATE
	.comm	_arb_program_shader_backend,4,2 ; @arb_program_shader_backend
	.comm	_WINED3D_TSS_CONSTANT,8,3       ; @WINED3D_TSS_CONSTANT
	.comm	_GL_FRAGMENT_PROGRAM_ARB,4,2    ; @GL_FRAGMENT_PROGRAM_ARB
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_CONSTANT(stage), &color.r)"

	.no_dead_strip	_state_tss_constant_arbfp
.subsections_via_symbols
