	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atifs_stage_constant
_atifs_stage_constant:                  ## @atifs_stage_constant
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -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
	movq	(%r15), %rcx
	movq	(%rcx), %rcx
	testq	%rcx, %rcx
	je	LBB0_3
## %bb.1:
	movq	(%rcx), %rcx
	movslq	%eax, %rbx
	movq	(%rcx,%rbx,8), %rax
	movq	_ATIFS_CONSTANT_STAGE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	(%r14), %rax
	movq	(%rax,%rbx,8), %rax
	movq	_WINED3D_TSS_CONSTANT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %esi
	leaq	-32(%rbp), %r14
	movq	%r14, %rdi
	callq	_wined3d_color_from_d3dcolor
	movl	%ebx, %edi
	callq	_ATIFS_CONST_STAGE
	movl	%eax, %edi
	movq	%r14, %rsi
	callq	_glSetFragmentShaderConstantATI
	movl	%eax, %edi
	callq	_GL_EXTCALL
	leaq	L_.str(%rip), %rdi
	callq	_checkGLcall
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WINED3D_HIGHEST_TEXTURE_STATE,4,2 ## @WINED3D_HIGHEST_TEXTURE_STATE
	.comm	_ATIFS_CONSTANT_STAGE,8,3       ## @ATIFS_CONSTANT_STAGE
	.comm	_WINED3D_TSS_CONSTANT,8,3       ## @WINED3D_TSS_CONSTANT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"glSetFragmentShaderConstantATI(ATIFS_CONST_STAGE(stage), &color.r)"

	.no_dead_strip	_atifs_stage_constant
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atifs_stage_constant
_atifs_stage_constant:                  ; @atifs_stage_constant
	.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	x20, x2
	mov	x19, x1
	mov	x21, x0
	mov	w0, #0
	mov	w1, #0
	bl	_STATE_TEXTURESTAGE
	ldr	x8, [x21]
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.1:
	sub	w9, w20, w0
Lloh0:
	adrp	x10, _WINED3D_HIGHEST_TEXTURE_STATE@GOTPAGE
Lloh1:
	ldr	x10, [x10, _WINED3D_HIGHEST_TEXTURE_STATE@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	add	w10, w10, #1
	sdiv	w20, w9, w10
	ldr	x8, [x8]
	ldr	x8, [x8, w20, sxtw #3]
Lloh3:
	adrp	x9, _ATIFS_CONSTANT_STAGE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ATIFS_CONSTANT_STAGE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	sxtw	x8, w20
	ldr	x9, [x19]
	ldr	x8, [x9, x8, lsl #3]
Lloh6:
	adrp	x9, _WINED3D_TSS_CONSTANT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _WINED3D_TSS_CONSTANT@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	ldr	w1, [x8, x9, lsl #2]
	add	x0, sp, #8
	bl	_wined3d_color_from_d3dcolor
	mov	x0, x20
	bl	_ATIFS_CONST_STAGE
	add	x1, sp, #8
	bl	_glSetFragmentShaderConstantATI
	bl	_GL_EXTCALL
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_checkGLcall
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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_WINED3D_HIGHEST_TEXTURE_STATE,4,2 ; @WINED3D_HIGHEST_TEXTURE_STATE
	.comm	_ATIFS_CONSTANT_STAGE,8,3       ; @ATIFS_CONSTANT_STAGE
	.comm	_WINED3D_TSS_CONSTANT,8,3       ; @WINED3D_TSS_CONSTANT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"glSetFragmentShaderConstantATI(ATIFS_CONST_STAGE(stage), &color.r)"

	.no_dead_strip	_atifs_stage_constant
.subsections_via_symbols
