	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function FinishShader
_FinishShader:                          ## @FinishShader
	.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
	movq	_shader@GOTPCREL(%rip), %r15
	cmpq	$0, 40(%r15)
	je	LBB0_1
## %bb.2:
	movq	_SS_ENVIRONMENT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%r15)
	cmpq	$0, 32(%r15)
	jne	LBB0_4
	jmp	LBB0_6
LBB0_1:
	movq	16(%r15), %rax
	cmpq	$0, 32(%r15)
	je	LBB0_6
LBB0_4:
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movq	_SS_DECAL@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%r15)
LBB0_6:
	movq	_qfalse@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rbx
	movq	_MAX_SHADER_STAGES@GOTPCREL(%rip), %r9
	movl	(%r9), %edx
	testl	%edx, %edx
	jle	LBB0_7
## %bb.8:
	movl	$-1, %r12d
	xorl	%r14d, %r14d
	movq	_stages@GOTPCREL(%rip), %r10
	xorl	%r13d, %r13d
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	_PRINT_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	24(%r15), %edx
	leaq	L_.str(%rip), %rsi
	movq	_ri@GOTPCREL(%rip), %rax
	callq	*(%rax)
	movq	_stages@GOTPCREL(%rip), %r10
	movq	_MAX_SHADER_STAGES@GOTPCREL(%rip), %r9
	movq	_qfalse@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 24(%rbx,%r14)
LBB0_38:                                ##   in Loop: Header=BB0_9 Depth=1
	incq	%r13
	movl	(%r9), %edx
	addq	$32, %r14
	decl	%r12d
	cmpl	%r13d, %edx
	jle	LBB0_39
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r10), %rbx
	cmpq	$0, 24(%rbx,%r14)
	je	LBB0_39
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	8(%rbx,%r14), %rax
	movq	16(%rax), %rcx
	cmpl	$0, (%rcx)
	je	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpq	$0, 16(%rbx,%r14)
	je	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_r_detailTextures@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpl	$0, (%rcx)
	je	LBB0_14
LBB0_16:                                ##   in Loop: Header=BB0_9 Depth=1
	cmpq	$0, 8(%rax)
	movq	(%rax), %rcx
	movq	_TCGEN_BAD@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	je	LBB0_20
## %bb.17:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpq	%rdx, %rcx
	jne	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_TCGEN_LIGHTMAP@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%rax)
LBB0_19:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	_qtrue@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_22
LBB0_20:                                ##   in Loop: Header=BB0_9 Depth=1
	cmpq	%rdx, %rcx
	jne	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_TCGEN_TEXTURE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%rax)
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	(%rbx,%r14), %eax
	movq	_GLS_SRCBLEND_BITS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_GLS_DSTBLEND_BITS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %esi
	orl	%edx, %esi
	testl	%eax, %esi
	je	LBB0_38
## %bb.23:                              ##   in Loop: Header=BB0_9 Depth=1
	testl	%esi, (%rbx)
	je	LBB0_38
## %bb.24:                              ##   in Loop: Header=BB0_9 Depth=1
	andl	%eax, %edx
	andl	%eax, %ecx
	movq	_GLS_SRCBLEND_ONE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r11d
	cmpl	%r11d, %edx
	jne	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_ACFF_MODULATE_RGB@GOTPCREL(%rip), %rdi
	movq	_GLS_DSTBLEND_ONE@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %ecx
	je	LBB0_32
LBB0_26:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	_GLS_SRCBLEND_ZERO@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %edx
	jne	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_ACFF_MODULATE_RGB@GOTPCREL(%rip), %rdi
	movq	_GLS_DSTBLEND_ONE_MINUS_SRC_COLOR@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %ecx
	je	LBB0_32
LBB0_28:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	_GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r8d
	movq	_GLS_SRCBLEND_SRC_ALPHA@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %edx
	jne	LBB0_30
## %bb.29:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_ACFF_MODULATE_ALPHA@GOTPCREL(%rip), %rdi
	cmpl	%r8d, %ecx
	je	LBB0_32
LBB0_30:                                ##   in Loop: Header=BB0_9 Depth=1
	cmpl	%r11d, %edx
	jne	LBB0_33
## %bb.31:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_ACFF_MODULATE_RGBA@GOTPCREL(%rip), %rdi
	cmpl	%r8d, %ecx
	jne	LBB0_33
LBB0_32:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	(%rdi), %ecx
	movl	%ecx, 4(%rbx,%r14)
LBB0_33:                                ##   in Loop: Header=BB0_9 Depth=1
	cmpq	$0, 16(%r15)
	jne	LBB0_38
## %bb.34:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_GLS_DEPTHMASK_TRUE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_36
## %bb.35:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_SS_SEE_THROUGH@GOTPCREL(%rip), %rax
	jmp	LBB0_37
LBB0_14:                                ##   in Loop: Header=BB0_9 Depth=1
	leal	-1(%rdx), %eax
	cltq
	cmpq	%rax, %r13
	jge	LBB0_38
## %bb.15:                              ##   in Loop: Header=BB0_9 Depth=1
	leaq	(%rbx,%r14), %r15
	addq	$32, %r15
	addq	%r14, %rbx
	addl	%r12d, %edx
	shll	$5, %edx
	movq	%rbx, %rdi
	movq	%r15, %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memmove
	movq	%r15, %rdi
	movq	_shader@GOTPCREL(%rip), %r15
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_Com_Memset
	movq	_stages@GOTPCREL(%rip), %r10
	movq	_MAX_SHADER_STAGES@GOTPCREL(%rip), %r9
	jmp	LBB0_38
LBB0_36:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	_SS_BLEND0@GOTPCREL(%rip), %rax
LBB0_37:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	(%rax), %rax
	movq	%rax, 16(%r15)
	jmp	LBB0_38
LBB0_39:
	movq	16(%r15), %rax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	testq	%rax, %rax
	jne	LBB0_42
LBB0_41:
	movq	_SS_OPAQUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%r15)
LBB0_42:
	cmpl	$2, %r13d
	jae	LBB0_43
## %bb.48:
	cmpq	$0, (%r15)
	jns	LBB0_49
	jmp	LBB0_53
LBB0_43:
	movq	_r_vertexLight@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	$0, (%rax)
	je	LBB0_45
## %bb.44:
	movq	_r_uiFullScreen@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpl	$0, (%rax)
	je	LBB0_46
LBB0_45:
	movq	_glConfig@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_GLHW_PERMEDIA2@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_47
LBB0_46:
	xorl	%eax, %eax
	callq	_VertexLightingCollapse
	movq	_qfalse@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movl	$1, %r13d
	cmpq	$0, (%r15)
	jns	LBB0_49
	jmp	LBB0_53
LBB0_7:
	xorl	%r13d, %r13d
	movq	%rbx, %r14
	testq	%rax, %rax
	jne	LBB0_42
	jmp	LBB0_41
LBB0_47:
	xorl	%eax, %eax
	callq	_CollapseMultitexture
	cmpq	$1, %rax
	adcl	$-1, %r13d
	cmpq	$0, (%r15)
	js	LBB0_53
LBB0_49:
	testq	%r14, %r14
	jne	LBB0_53
## %bb.50:
	movq	_ri@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_PRINT_DEVELOPER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	24(%r15), %edx
	testq	%rbx, %rbx
	je	LBB0_52
## %bb.51:
	leaq	L_.str.1(%rip), %rsi
	callq	*%rax
	jmp	LBB0_53
LBB0_52:
	leaq	L_.str.2(%rip), %rsi
	callq	*%rax
	movq	_LIGHTMAP_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
LBB0_53:
	movl	%r13d, 8(%r15)
	testl	%r13d, %r13d
	jne	LBB0_55
## %bb.54:
	movq	_SS_FOG@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%r15)
LBB0_55:
	xorl	%eax, %eax
	callq	_ComputeStageIteratorFunc
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_GeneratePermanentShader        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_qfalse,8,3                     ## @qfalse
	.comm	_shader,48,3                    ## @shader
	.comm	_SS_ENVIRONMENT,8,3             ## @SS_ENVIRONMENT
	.comm	_SS_DECAL,8,3                   ## @SS_DECAL
	.comm	_MAX_SHADER_STAGES,4,2          ## @MAX_SHADER_STAGES
	.comm	_stages,8,3                     ## @stages
	.comm	_ri,8,3                         ## @ri
	.comm	_PRINT_WARNING,4,2              ## @PRINT_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Shader %s has a stage with no image\n"

	.comm	_r_detailTextures,8,3           ## @r_detailTextures
	.comm	_TCGEN_BAD,8,3                  ## @TCGEN_BAD
	.comm	_TCGEN_LIGHTMAP,8,3             ## @TCGEN_LIGHTMAP
	.comm	_qtrue,8,3                      ## @qtrue
	.comm	_TCGEN_TEXTURE,8,3              ## @TCGEN_TEXTURE
	.comm	_GLS_SRCBLEND_BITS,4,2          ## @GLS_SRCBLEND_BITS
	.comm	_GLS_DSTBLEND_BITS,4,2          ## @GLS_DSTBLEND_BITS
	.comm	_GLS_SRCBLEND_ONE,4,2           ## @GLS_SRCBLEND_ONE
	.comm	_GLS_DSTBLEND_ONE,4,2           ## @GLS_DSTBLEND_ONE
	.comm	_GLS_SRCBLEND_ZERO,4,2          ## @GLS_SRCBLEND_ZERO
	.comm	_GLS_DSTBLEND_ONE_MINUS_SRC_COLOR,4,2 ## @GLS_DSTBLEND_ONE_MINUS_SRC_COLOR
	.comm	_ACFF_MODULATE_RGB,4,2          ## @ACFF_MODULATE_RGB
	.comm	_GLS_SRCBLEND_SRC_ALPHA,4,2     ## @GLS_SRCBLEND_SRC_ALPHA
	.comm	_GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA,4,2 ## @GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA
	.comm	_ACFF_MODULATE_ALPHA,4,2        ## @ACFF_MODULATE_ALPHA
	.comm	_ACFF_MODULATE_RGBA,4,2         ## @ACFF_MODULATE_RGBA
	.comm	_GLS_DEPTHMASK_TRUE,4,2         ## @GLS_DEPTHMASK_TRUE
	.comm	_SS_SEE_THROUGH,8,3             ## @SS_SEE_THROUGH
	.comm	_SS_BLEND0,8,3                  ## @SS_BLEND0
	.comm	_SS_OPAQUE,8,3                  ## @SS_OPAQUE
	.comm	_r_vertexLight,8,3              ## @r_vertexLight
	.comm	_r_uiFullScreen,8,3             ## @r_uiFullScreen
	.comm	_glConfig,8,3                   ## @glConfig
	.comm	_GLHW_PERMEDIA2,8,3             ## @GLHW_PERMEDIA2
	.comm	_PRINT_DEVELOPER,4,2            ## @PRINT_DEVELOPER
L_.str.1:                               ## @.str.1
	.asciz	"WARNING: shader '%s' has VERTEX forced lightmap!\n"

L_.str.2:                               ## @.str.2
	.asciz	"WARNING: shader '%s' has lightmap but no lightmap stage!\n"

	.comm	_LIGHTMAP_NONE,8,3              ## @LIGHTMAP_NONE
	.comm	_SS_FOG,8,3                     ## @SS_FOG
	.no_dead_strip	_FinishShader
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function FinishShader
_FinishShader:                          ; @FinishShader
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x22, _shader@GOTPAGE
Lloh1:
	ldr	x22, [x22, _shader@GOTPAGEOFF]
	ldr	x8, [x22, #40]
	cbz	x8, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _SS_ENVIRONMENT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SS_ENVIRONMENT@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	str	x8, [x22, #16]
	b	LBB0_3
LBB0_2:
	ldr	x8, [x22, #16]
LBB0_3:
Lloh5:
	adrp	x27, _qfalse@GOTPAGE
Lloh6:
	ldr	x27, [x27, _qfalse@GOTPAGEOFF]
	ldr	x9, [x22, #32]
	cmp	x9, #0
	ccmp	x8, #0, #0, ne
	b.ne	LBB0_5
; %bb.4:
Lloh7:
	adrp	x8, _SS_DECAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SS_DECAL@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	str	x8, [x22, #16]
LBB0_5:
	ldr	x21, [x27]
Lloh10:
	adrp	x28, _MAX_SHADER_STAGES@GOTPAGE
Lloh11:
	ldr	x28, [x28, _MAX_SHADER_STAGES@GOTPAGEOFF]
	ldr	w9, [x28]
Lloh12:
	adrp	x19, _ri@GOTPAGE
Lloh13:
	ldr	x19, [x19, _ri@GOTPAGEOFF]
	cmp	w9, #1
	b.lt	LBB0_42
; %bb.6:
	mov	x24, #0
	mov	x23, #0
Lloh14:
	adrp	x15, _stages@GOTPAGE
Lloh15:
	ldr	x15, [x15, _stages@GOTPAGEOFF]
	mov	w26, #-1
	mov	x25, x21
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x19]
Lloh16:
	adrp	x9, _PRINT_WARNING@GOTPAGE
Lloh17:
	ldr	x9, [x9, _PRINT_WARNING@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x9]
	ldr	w2, [x22, #24]
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	blr	x8
Lloh21:
	adrp	x15, _stages@GOTPAGE
Lloh22:
	ldr	x15, [x15, _stages@GOTPAGEOFF]
	ldr	x8, [x27]
	str	x8, [x20, #24]
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x23, x23, #1
	ldr	w9, [x28]
	add	x24, x24, #32
	sub	w26, w26, #1
	cmp	w9, w23
	b.le	LBB0_34
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x15]
	add	x20, x8, x24
	ldr	x10, [x20, #24]
	cbz	x10, LBB0_34
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x10, [x20, #8]
	ldr	x11, [x10, #16]
	ldr	w11, [x11]
	cbz	w11, LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x11, x8, x24
	ldr	x11, [x11, #16]
	cbz	x11, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
Lloh23:
	adrp	x11, _r_detailTextures@GOTPAGE
Lloh24:
	ldr	x11, [x11, _r_detailTextures@GOTPAGEOFF]
Lloh25:
	ldr	x11, [x11]
	ldr	w11, [x11]
	cbz	w11, LBB0_30
LBB0_13:                                ;   in Loop: Header=BB0_9 Depth=1
	ldp	x9, x12, [x10]
Lloh26:
	adrp	x11, _TCGEN_BAD@GOTPAGE
Lloh27:
	ldr	x11, [x11, _TCGEN_BAD@GOTPAGEOFF]
Lloh28:
	ldr	x11, [x11]
	cmp	x9, x11
	cbz	x12, LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_9 Depth=1
	b.ne	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_9 Depth=1
Lloh29:
	adrp	x9, _TCGEN_LIGHTMAP@GOTPAGE
Lloh30:
	ldr	x9, [x9, _TCGEN_LIGHTMAP@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	str	x9, [x10]
LBB0_16:                                ;   in Loop: Header=BB0_9 Depth=1
Lloh32:
	adrp	x9, _qtrue@GOTPAGE
Lloh33:
	ldr	x9, [x9, _qtrue@GOTPAGEOFF]
Lloh34:
	ldr	x25, [x9]
	b	LBB0_19
LBB0_17:                                ;   in Loop: Header=BB0_9 Depth=1
	b.ne	LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_9 Depth=1
Lloh35:
	adrp	x9, _TCGEN_TEXTURE@GOTPAGE
Lloh36:
	ldr	x9, [x9, _TCGEN_TEXTURE@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	str	x9, [x10]
LBB0_19:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	w9, [x8, x24]
Lloh38:
	adrp	x10, _GLS_SRCBLEND_BITS@GOTPAGE
Lloh39:
	ldr	x10, [x10, _GLS_SRCBLEND_BITS@GOTPAGEOFF]
Lloh40:
	ldr	w10, [x10]
Lloh41:
	adrp	x11, _GLS_DSTBLEND_BITS@GOTPAGE
Lloh42:
	ldr	x11, [x11, _GLS_DSTBLEND_BITS@GOTPAGEOFF]
Lloh43:
	ldr	w12, [x11]
	orr	w11, w12, w10
	tst	w11, w9
	b.eq	LBB0_8
; %bb.20:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w13, [x8]
	tst	w13, w11
	b.eq	LBB0_8
; %bb.21:                               ;   in Loop: Header=BB0_9 Depth=1
	and	w11, w10, w9
	and	w10, w12, w9
Lloh44:
	adrp	x12, _GLS_SRCBLEND_ONE@GOTPAGE
Lloh45:
	ldr	x12, [x12, _GLS_SRCBLEND_ONE@GOTPAGEOFF]
Lloh46:
	ldr	w12, [x12]
Lloh47:
	adrp	x13, _GLS_DSTBLEND_ONE@GOTPAGE
Lloh48:
	ldr	x13, [x13, _GLS_DSTBLEND_ONE@GOTPAGEOFF]
Lloh49:
	ldr	w13, [x13]
	cmp	w11, w12
	ccmp	w10, w13, #0, eq
Lloh50:
	adrp	x14, _ACFF_MODULATE_RGB@GOTPAGE
Lloh51:
	ldr	x14, [x14, _ACFF_MODULATE_RGB@GOTPAGEOFF]
	b.eq	LBB0_26
; %bb.22:                               ;   in Loop: Header=BB0_9 Depth=1
Lloh52:
	adrp	x13, _GLS_SRCBLEND_ZERO@GOTPAGE
Lloh53:
	ldr	x13, [x13, _GLS_SRCBLEND_ZERO@GOTPAGEOFF]
Lloh54:
	ldr	w13, [x13]
Lloh55:
	adrp	x14, _GLS_DSTBLEND_ONE_MINUS_SRC_COLOR@GOTPAGE
Lloh56:
	ldr	x14, [x14, _GLS_DSTBLEND_ONE_MINUS_SRC_COLOR@GOTPAGEOFF]
Lloh57:
	ldr	w14, [x14]
	cmp	w11, w13
	ccmp	w10, w14, #0, eq
Lloh58:
	adrp	x14, _ACFF_MODULATE_RGB@GOTPAGE
Lloh59:
	ldr	x14, [x14, _ACFF_MODULATE_RGB@GOTPAGEOFF]
	b.eq	LBB0_26
; %bb.23:                               ;   in Loop: Header=BB0_9 Depth=1
Lloh60:
	adrp	x13, _GLS_SRCBLEND_SRC_ALPHA@GOTPAGE
Lloh61:
	ldr	x13, [x13, _GLS_SRCBLEND_SRC_ALPHA@GOTPAGEOFF]
Lloh62:
	ldr	w14, [x13]
Lloh63:
	adrp	x13, _GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA@GOTPAGE
Lloh64:
	ldr	x13, [x13, _GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA@GOTPAGEOFF]
Lloh65:
	ldr	w13, [x13]
	cmp	w11, w14
	ccmp	w10, w13, #0, eq
Lloh66:
	adrp	x14, _ACFF_MODULATE_ALPHA@GOTPAGE
Lloh67:
	ldr	x14, [x14, _ACFF_MODULATE_ALPHA@GOTPAGEOFF]
	b.eq	LBB0_26
; %bb.24:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	w11, w12
	b.ne	LBB0_27
; %bb.25:                               ;   in Loop: Header=BB0_9 Depth=1
Lloh68:
	adrp	x14, _ACFF_MODULATE_RGBA@GOTPAGE
Lloh69:
	ldr	x14, [x14, _ACFF_MODULATE_RGBA@GOTPAGEOFF]
	cmp	w10, w13
	b.ne	LBB0_27
LBB0_26:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	w10, [x14]
	add	x8, x8, x24
	str	w10, [x8, #4]
LBB0_27:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x22, #16]
	cbnz	x8, LBB0_8
; %bb.28:                               ;   in Loop: Header=BB0_9 Depth=1
Lloh70:
	adrp	x8, _GLS_DEPTHMASK_TRUE@GOTPAGE
Lloh71:
	ldr	x8, [x8, _GLS_DEPTHMASK_TRUE@GOTPAGEOFF]
Lloh72:
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_32
; %bb.29:                               ;   in Loop: Header=BB0_9 Depth=1
Lloh73:
	adrp	x8, _SS_SEE_THROUGH@GOTPAGE
Lloh74:
	ldr	x8, [x8, _SS_SEE_THROUGH@GOTPAGEOFF]
	b	LBB0_33
LBB0_30:                                ;   in Loop: Header=BB0_9 Depth=1
	sub	w10, w9, #1
	cmp	x23, w10, sxtw
	b.ge	LBB0_8
; %bb.31:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x8, x8, x24
	mov	x28, x25
	mov	x25, x22
	mov	x22, x27
	mov	x27, x19
	mov	x19, x21
	add	x21, x8, #32
	add	w8, w9, w26
	lsl	w2, w8, #5
	mov	x0, x20
	mov	x1, x21
	bl	_memmove
	mov	x0, x21
	mov	x21, x19
	mov	x19, x27
	mov	x27, x22
	mov	x22, x25
	mov	x25, x28
Lloh75:
	adrp	x28, _MAX_SHADER_STAGES@GOTPAGE
Lloh76:
	ldr	x28, [x28, _MAX_SHADER_STAGES@GOTPAGEOFF]
	mov	w1, #0
	mov	w2, #32
	bl	_Com_Memset
Lloh77:
	adrp	x15, _stages@GOTPAGE
Lloh78:
	ldr	x15, [x15, _stages@GOTPAGEOFF]
	b	LBB0_8
LBB0_32:                                ;   in Loop: Header=BB0_9 Depth=1
Lloh79:
	adrp	x8, _SS_BLEND0@GOTPAGE
Lloh80:
	ldr	x8, [x8, _SS_BLEND0@GOTPAGEOFF]
LBB0_33:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x8]
	str	x8, [x22, #16]
	b	LBB0_8
LBB0_34:
	ldr	x8, [x22, #16]
	cbnz	x8, LBB0_36
LBB0_35:
Lloh81:
	adrp	x8, _SS_OPAQUE@GOTPAGE
Lloh82:
	ldr	x8, [x8, _SS_OPAQUE@GOTPAGEOFF]
Lloh83:
	ldr	x8, [x8]
	str	x8, [x22, #16]
LBB0_36:
	cmp	w23, #2
	b.hs	LBB0_38
; %bb.37:
	ldr	x8, [x22]
	tbz	x8, #63, LBB0_44
	b	LBB0_47
LBB0_38:
Lloh84:
	adrp	x8, _r_vertexLight@GOTPAGE
Lloh85:
	ldr	x8, [x8, _r_vertexLight@GOTPAGEOFF]
Lloh86:
	ldr	x8, [x8]
	ldr	x8, [x8]
	cbz	x8, LBB0_40
; %bb.39:
Lloh87:
	adrp	x8, _r_uiFullScreen@GOTPAGE
Lloh88:
	ldr	x8, [x8, _r_uiFullScreen@GOTPAGEOFF]
Lloh89:
	ldr	x8, [x8]
	ldr	w8, [x8]
	cbz	w8, LBB0_41
LBB0_40:
Lloh90:
	adrp	x8, _glConfig@GOTPAGE
Lloh91:
	ldr	x8, [x8, _glConfig@GOTPAGEOFF]
Lloh92:
	ldr	x8, [x8]
Lloh93:
	adrp	x9, _GLHW_PERMEDIA2@GOTPAGE
Lloh94:
	ldr	x9, [x9, _GLHW_PERMEDIA2@GOTPAGEOFF]
Lloh95:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_43
LBB0_41:
	bl	_VertexLightingCollapse
	ldr	x25, [x27]
	mov	w23, #1
	ldr	x8, [x22]
	tbz	x8, #63, LBB0_44
	b	LBB0_47
LBB0_42:
	mov	w23, #0
	mov	x25, x21
	cbnz	x8, LBB0_36
	b	LBB0_35
LBB0_43:
	bl	_CollapseMultitexture
	cmp	x0, #0
	cset	w8, ne
	sub	w23, w23, w8
	ldr	x8, [x22]
	tbnz	x8, #63, LBB0_47
LBB0_44:
	cbnz	x25, LBB0_47
; %bb.45:
	ldr	x8, [x19]
Lloh96:
	adrp	x9, _PRINT_DEVELOPER@GOTPAGE
Lloh97:
	ldr	x9, [x9, _PRINT_DEVELOPER@GOTPAGEOFF]
Lloh98:
	ldr	w0, [x9]
	ldr	w2, [x22, #24]
	cbz	x21, LBB0_50
; %bb.46:
Lloh99:
	adrp	x1, l_.str.1@PAGE
Lloh100:
	add	x1, x1, l_.str.1@PAGEOFF
	blr	x8
LBB0_47:
	str	w23, [x22, #8]
	cbnz	w23, LBB0_49
LBB0_48:
Lloh101:
	adrp	x8, _SS_FOG@GOTPAGE
Lloh102:
	ldr	x8, [x8, _SS_FOG@GOTPAGEOFF]
Lloh103:
	ldr	x8, [x8]
	str	x8, [x22, #16]
LBB0_49:
	bl	_ComputeStageIteratorFunc
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_GeneratePermanentShader
LBB0_50:
Lloh104:
	adrp	x1, l_.str.2@PAGE
Lloh105:
	add	x1, x1, l_.str.2@PAGEOFF
	blr	x8
Lloh106:
	adrp	x8, _LIGHTMAP_NONE@GOTPAGE
Lloh107:
	ldr	x8, [x8, _LIGHTMAP_NONE@GOTPAGEOFF]
Lloh108:
	ldr	x8, [x8]
	str	x8, [x22]
	str	w23, [x22, #8]
	cbnz	w23, LBB0_49
	b	LBB0_48
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGot	Lloh66, Lloh67
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.loh AdrpLdrGot	Lloh68, Lloh69
	.loh AdrpLdrGotLdr	Lloh70, Lloh71, Lloh72
	.loh AdrpLdrGot	Lloh73, Lloh74
	.loh AdrpLdrGot	Lloh77, Lloh78
	.loh AdrpLdrGot	Lloh75, Lloh76
	.loh AdrpLdrGot	Lloh79, Lloh80
	.loh AdrpLdrGotLdr	Lloh81, Lloh82, Lloh83
	.loh AdrpLdrGotLdr	Lloh84, Lloh85, Lloh86
	.loh AdrpLdrGotLdr	Lloh87, Lloh88, Lloh89
	.loh AdrpLdrGotLdr	Lloh93, Lloh94, Lloh95
	.loh AdrpLdrGotLdr	Lloh90, Lloh91, Lloh92
	.loh AdrpLdrGotLdr	Lloh96, Lloh97, Lloh98
	.loh AdrpAdd	Lloh99, Lloh100
	.loh AdrpLdrGotLdr	Lloh101, Lloh102, Lloh103
	.loh AdrpLdrGotLdr	Lloh106, Lloh107, Lloh108
	.loh AdrpAdd	Lloh104, Lloh105
	.cfi_endproc
                                        ; -- End function
	.comm	_qfalse,8,3                     ; @qfalse
	.comm	_shader,48,3                    ; @shader
	.comm	_SS_ENVIRONMENT,8,3             ; @SS_ENVIRONMENT
	.comm	_SS_DECAL,8,3                   ; @SS_DECAL
	.comm	_MAX_SHADER_STAGES,4,2          ; @MAX_SHADER_STAGES
	.comm	_stages,8,3                     ; @stages
	.comm	_ri,8,3                         ; @ri
	.comm	_PRINT_WARNING,4,2              ; @PRINT_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Shader %s has a stage with no image\n"

	.comm	_r_detailTextures,8,3           ; @r_detailTextures
	.comm	_TCGEN_BAD,8,3                  ; @TCGEN_BAD
	.comm	_TCGEN_LIGHTMAP,8,3             ; @TCGEN_LIGHTMAP
	.comm	_qtrue,8,3                      ; @qtrue
	.comm	_TCGEN_TEXTURE,8,3              ; @TCGEN_TEXTURE
	.comm	_GLS_SRCBLEND_BITS,4,2          ; @GLS_SRCBLEND_BITS
	.comm	_GLS_DSTBLEND_BITS,4,2          ; @GLS_DSTBLEND_BITS
	.comm	_GLS_SRCBLEND_ONE,4,2           ; @GLS_SRCBLEND_ONE
	.comm	_GLS_DSTBLEND_ONE,4,2           ; @GLS_DSTBLEND_ONE
	.comm	_GLS_SRCBLEND_ZERO,4,2          ; @GLS_SRCBLEND_ZERO
	.comm	_GLS_DSTBLEND_ONE_MINUS_SRC_COLOR,4,2 ; @GLS_DSTBLEND_ONE_MINUS_SRC_COLOR
	.comm	_ACFF_MODULATE_RGB,4,2          ; @ACFF_MODULATE_RGB
	.comm	_GLS_SRCBLEND_SRC_ALPHA,4,2     ; @GLS_SRCBLEND_SRC_ALPHA
	.comm	_GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA,4,2 ; @GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA
	.comm	_ACFF_MODULATE_ALPHA,4,2        ; @ACFF_MODULATE_ALPHA
	.comm	_ACFF_MODULATE_RGBA,4,2         ; @ACFF_MODULATE_RGBA
	.comm	_GLS_DEPTHMASK_TRUE,4,2         ; @GLS_DEPTHMASK_TRUE
	.comm	_SS_SEE_THROUGH,8,3             ; @SS_SEE_THROUGH
	.comm	_SS_BLEND0,8,3                  ; @SS_BLEND0
	.comm	_SS_OPAQUE,8,3                  ; @SS_OPAQUE
	.comm	_r_vertexLight,8,3              ; @r_vertexLight
	.comm	_r_uiFullScreen,8,3             ; @r_uiFullScreen
	.comm	_glConfig,8,3                   ; @glConfig
	.comm	_GLHW_PERMEDIA2,8,3             ; @GLHW_PERMEDIA2
	.comm	_PRINT_DEVELOPER,4,2            ; @PRINT_DEVELOPER
l_.str.1:                               ; @.str.1
	.asciz	"WARNING: shader '%s' has VERTEX forced lightmap!\n"

l_.str.2:                               ; @.str.2
	.asciz	"WARNING: shader '%s' has lightmap but no lightmap stage!\n"

	.comm	_LIGHTMAP_NONE,8,3              ; @LIGHTMAP_NONE
	.comm	_SS_FOG,8,3                     ; @SS_FOG
	.no_dead_strip	_FinishShader
.subsections_via_symbols
