	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_bumpmat_arbfp
_set_bumpmat_arbfp:                     ## @set_bumpmat_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	$32, %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
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	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	8(%r15), %rax
	movq	_WINED3D_SHADER_CONST_PS_BUMP_ENV@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, (%r15)
	movq	8(%rax), %rcx
	cmpq	_arb_program_shader_backend@GOTPCREL(%rip), %rcx
	je	LBB0_1
LBB0_3:
	movq	(%r14), %rax
	movslq	%r12d, %rcx
	movq	(%rax,%rcx,8), %rax
	movq	_WINED3D_TSS_BUMPENV_MAT00@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movss	(%rax,%rcx,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, -64(%rbp)
	movq	_WINED3D_TSS_BUMPENV_MAT01@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movss	(%rax,%rcx,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, -60(%rbp)
	movq	_WINED3D_TSS_BUMPENV_MAT10@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movss	(%rax,%rcx,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, -56(%rbp)
	movq	_WINED3D_TSS_BUMPENV_MAT11@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movss	(%rax,%rcx,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, -52(%rbp)
	movq	_GL_FRAGMENT_PROGRAM_ARB@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r12d, %edi
	callq	_ARB_FFP_CONST_BUMPMAT
	leaq	-64(%rbp), %rdx
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_glProgramEnvParameter4fvARB
	movl	%eax, %edi
	callq	_GL_EXTCALL
	leaq	L_.str(%rip), %rdi
	callq	_checkGLcall
	jmp	LBB0_4
LBB0_1:
	movq	(%rax), %rbx
	movq	%r14, %rdi
	callq	_use_ps
	testq	%rax, %rax
	je	LBB0_2
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_6
## %bb.5:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	(%rbx), %r15
	movl	%r12d, %edi
	callq	_ARB_FFP_CONST_BUMPMAT
	cltq
	movl	$1, (%r15,%rax,4)
	movl	8(%rbx), %r15d
	movl	%r12d, %edi
	callq	_ARB_FFP_CONST_BUMPMAT
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %esi
	movl	%r15d, %edi
	callq	_max
	movl	%eax, 8(%rbx)
	jmp	LBB0_3
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_WINED3D_HIGHEST_TEXTURE_STATE,4,2 ## @WINED3D_HIGHEST_TEXTURE_STATE
	.comm	_WINED3D_SHADER_CONST_PS_BUMP_ENV,4,2 ## @WINED3D_SHADER_CONST_PS_BUMP_ENV
	.comm	_arb_program_shader_backend,4,2 ## @arb_program_shader_backend
	.comm	_WINED3D_TSS_BUMPENV_MAT00,8,3  ## @WINED3D_TSS_BUMPENV_MAT00
	.comm	_WINED3D_TSS_BUMPENV_MAT01,8,3  ## @WINED3D_TSS_BUMPENV_MAT01
	.comm	_WINED3D_TSS_BUMPENV_MAT10,8,3  ## @WINED3D_TSS_BUMPENV_MAT10
	.comm	_WINED3D_TSS_BUMPENV_MAT11,8,3  ## @WINED3D_TSS_BUMPENV_MAT11
	.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_BUMPMAT(stage), &mat[0][0])"

	.no_dead_strip	_set_bumpmat_arbfp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_bumpmat_arbfp
_set_bumpmat_arbfp:                     ; @set_bumpmat_arbfp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	mov	w0, #0
	mov	w1, #0
	bl	_STATE_TEXTURESTAGE
	sub	w8, w19, w0
Lloh3:
	adrp	x9, _WINED3D_HIGHEST_TEXTURE_STATE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _WINED3D_HIGHEST_TEXTURE_STATE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	add	w9, w9, #1
	sdiv	w19, w8, w9
	ldr	x8, [x21, #8]
Lloh6:
	adrp	x9, _WINED3D_SHADER_CONST_PS_BUMP_ENV@GOTPAGE
Lloh7:
	ldr	x9, [x9, _WINED3D_SHADER_CONST_PS_BUMP_ENV@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	ldr	w10, [x21]
	orr	w9, w10, w9
	str	w9, [x21]
	ldr	x9, [x8, #8]
Lloh9:
	adrp	x10, _arb_program_shader_backend@GOTPAGE
Lloh10:
	ldr	x10, [x10, _arb_program_shader_backend@GOTPAGEOFF]
	cmp	x9, x10
	b.eq	LBB0_2
LBB0_1:
	ldr	x8, [x20]
	ldr	x8, [x8, w19, sxtw #3]
Lloh11:
	adrp	x9, _WINED3D_TSS_BUMPENV_MAT00@GOTPAGE
Lloh12:
	ldr	x9, [x9, _WINED3D_TSS_BUMPENV_MAT00@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	ldr	s0, [x8, x9, lsl #2]
	str	s0, [sp, #8]
Lloh14:
	adrp	x9, _WINED3D_TSS_BUMPENV_MAT01@GOTPAGE
Lloh15:
	ldr	x9, [x9, _WINED3D_TSS_BUMPENV_MAT01@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	ldr	s0, [x8, x9, lsl #2]
	str	s0, [sp, #12]
Lloh17:
	adrp	x9, _WINED3D_TSS_BUMPENV_MAT10@GOTPAGE
Lloh18:
	ldr	x9, [x9, _WINED3D_TSS_BUMPENV_MAT10@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	ldr	s0, [x8, x9, lsl #2]
	str	s0, [sp, #16]
Lloh20:
	adrp	x9, _WINED3D_TSS_BUMPENV_MAT11@GOTPAGE
Lloh21:
	ldr	x9, [x9, _WINED3D_TSS_BUMPENV_MAT11@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	ldr	s0, [x8, x9, lsl #2]
	str	s0, [sp, #20]
Lloh23:
	adrp	x8, _GL_FRAGMENT_PROGRAM_ARB@GOTPAGE
Lloh24:
	ldr	x8, [x8, _GL_FRAGMENT_PROGRAM_ARB@GOTPAGEOFF]
Lloh25:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_ARB_FFP_CONST_BUMPMAT
	mov	x1, x0
	add	x2, sp, #8
	mov	x0, x20
	bl	_glProgramEnvParameter4fvARB
	bl	_GL_EXTCALL
Lloh26:
	adrp	x0, l_.str@PAGE
Lloh27:
	add	x0, x0, l_.str@PAGEOFF
	bl	_checkGLcall
	b	LBB0_3
LBB0_2:
	ldr	x22, [x8]
	mov	x0, x20
	bl	_use_ps
	cbz	x0, LBB0_5
LBB0_3:
	ldr	x8, [sp, #24]
Lloh28:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh29:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.4:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_5:
	ldr	x21, [x22]
	mov	x0, x19
	bl	_ARB_FFP_CONST_BUMPMAT
	mov	w8, #1
	str	w8, [x21, w0, sxtw #2]
	ldr	w21, [x22, #8]
	mov	x0, x19
	bl	_ARB_FFP_CONST_BUMPMAT
	add	w1, w0, #1
	mov	x0, x21
	bl	_max
	str	w0, [x22, #8]
	b	LBB0_1
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_WINED3D_HIGHEST_TEXTURE_STATE,4,2 ; @WINED3D_HIGHEST_TEXTURE_STATE
	.comm	_WINED3D_SHADER_CONST_PS_BUMP_ENV,4,2 ; @WINED3D_SHADER_CONST_PS_BUMP_ENV
	.comm	_arb_program_shader_backend,4,2 ; @arb_program_shader_backend
	.comm	_WINED3D_TSS_BUMPENV_MAT00,8,3  ; @WINED3D_TSS_BUMPENV_MAT00
	.comm	_WINED3D_TSS_BUMPENV_MAT01,8,3  ; @WINED3D_TSS_BUMPENV_MAT01
	.comm	_WINED3D_TSS_BUMPENV_MAT10,8,3  ; @WINED3D_TSS_BUMPENV_MAT10
	.comm	_WINED3D_TSS_BUMPENV_MAT11,8,3  ; @WINED3D_TSS_BUMPENV_MAT11
	.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_BUMPMAT(stage), &mat[0][0])"

	.no_dead_strip	_set_bumpmat_arbfp
.subsections_via_symbols
