	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_VS_FloodDirectedLight          ## -- Begin function VS_FloodDirectedLight
	.p2align	4, 0x90
_VS_FloodDirectedLight:                 ## @VS_FloodDirectedLight
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	(%rdi), %rax
	movq	_LDAT_NOSCALE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_MAX_WORLD_COORD@GOTPCREL(%rip), %rax
	movss	(%rax), %xmm0                   ## xmm0 = mem[0],zero,zero,zero
	jmp	LBB0_7
LBB0_2:
	movq	_LDAT_LINEAR@GOTPCREL(%rip), %rcx
	movss	8(%r15), %xmm0                  ## xmm0 = mem[0],zero,zero,zero
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movq	_lightLinearScale@GOTPCREL(%rip), %rax
	mulss	(%rax), %xmm0
	jmp	LBB0_7
LBB0_4:
	xorps	%xmm1, %xmm1
	ucomiss	%xmm1, %xmm0
	jb	LBB0_6
## %bb.5:
	sqrtss	%xmm0, %xmm0
	jmp	LBB0_7
LBB0_6:
	callq	_sqrt
LBB0_7:
	movss	%xmm0, -44(%rbp)                ## 4-byte Spill
	leaq	-112(%rbp), %rdi
	xorl	%esi, %esi
	movl	$64, %edx
	callq	_memset
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_10
## %bb.8:
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movl	(%rax,%rbx), %edi
	movl	12(%r15), %esi
	movq	-64(%rbp), %rax
	movl	(%rax,%rbx), %edx
	movss	-44(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	callq	_VectorMA
	movq	8(%r12), %rcx
	incq	%r13
	movl	%r13d, %eax
	cltd
	idivl	(%r12)
                                        ## kill: def $edx killed $edx def $rdx
	movl	(%rcx,%rdx,4), %edi
	movl	(%rcx,%rbx), %esi
	callq	_VectorSubtract
	movl	12(%r15), %edi
	movq	-56(%rbp), %rax
	movl	(%rax,%rbx,4), %edx
	callq	_CrossProduct
	movq	-56(%rbp), %rax
	movl	(%rax,%rbx,4), %edi
	movl	%edi, %esi
	callq	_VectorNormalize
	movq	-56(%rbp), %rax
	movl	(%rax,%rbx,4), %edi
	movq	8(%r12), %rax
	movl	(%rax,%rbx), %esi
	callq	_DotProduct
	movq	-56(%rbp), %rcx
	movq	%rax, 8(%rcx,%rbx,4)
	movslq	(%r12), %rax
	addq	$4, %rbx
	cmpq	%rax, %r13
	jl	LBB0_9
LBB0_10:
	movl	%eax, -112(%rbp)
	movl	12(%r15), %edi
	movl	-96(%rbp), %esi
	callq	_VectorCopy
	movl	-96(%rbp), %edi
	callq	_VectorInverse
	movl	-96(%rbp), %edi
	movq	-64(%rbp), %rax
	movl	(%rax), %esi
	callq	_DotProduct
	movq	%rax, -88(%rbp)
	movq	-96(%rbp), %rax
	movq	%rax, -80(%rbp)
	movq	-88(%rbp), %rax
	movq	%rax, -72(%rbp)
	movl	$-1, -108(%rbp)
	movq	_VOLUME_DIRECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -100(%rbp)
	movq	_dleafs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%r14d, %rcx
	movl	(%rax,%rcx,4), %edx
	movl	%edx, -104(%rbp)
	leaq	-112(%rbp), %rsi
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	callq	_VS_R_FloodLight
	cmpl	$0, -108(%rbp)
	js	LBB0_12
## %bb.11:
	leaq	-112(%rbp), %rsi
	movq	%r15, %rdi
	callq	_VS_R_CastLightAtSurface
LBB0_12:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LDAT_NOSCALE,8,3               ## @LDAT_NOSCALE
	.comm	_MAX_WORLD_COORD,4,2            ## @MAX_WORLD_COORD
	.comm	_LDAT_LINEAR,8,3                ## @LDAT_LINEAR
	.comm	_lightLinearScale,4,2           ## @lightLinearScale
	.comm	_VOLUME_DIRECTED,4,2            ## @VOLUME_DIRECTED
	.comm	_dleafs,8,3                     ## @dleafs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_VS_FloodDirectedLight          ; -- Begin function VS_FloodDirectedLight
	.p2align	2
_VS_FloodDirectedLight:                 ; @VS_FloodDirectedLight
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	d9, d8, [sp, #64]               ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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 b8, -72
	.cfi_offset b9, -80
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _LDAT_NOSCALE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LDAT_NOSCALE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _MAX_WORLD_COORD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_WORLD_COORD@GOTPAGEOFF]
Lloh5:
	ldr	s8, [x8]
	b	LBB0_5
LBB0_2:
Lloh6:
	adrp	x9, _LDAT_LINEAR@GOTPAGE
Lloh7:
	ldr	x9, [x9, _LDAT_LINEAR@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	ldr	s0, [x19, #8]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
Lloh9:
	adrp	x8, _lightLinearScale@GOTPAGE
Lloh10:
	ldr	x8, [x8, _lightLinearScale@GOTPAGEOFF]
Lloh11:
	ldr	s1, [x8]
	fmul	s8, s0, s1
	b	LBB0_5
LBB0_4:
	fsqrt	s8, s0
	fcmp	s8, s8
	b.vs	LBB0_11
LBB0_5:
	mov	x0, sp
	mov	w1, #0
	mov	w2, #64
	bl	_memset
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.6:
	mov	x22, #0
	mov	x23, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #8]
	lsl	x24, x23, #2
	ldr	w0, [x8, x24]
	ldr	w1, [x19, #12]
	ldr	x8, [sp, #48]
	ldr	w2, [x8, x24]
	fmov	s0, s8
	bl	_VectorMA
	ldr	x8, [x21, #8]
	add	x23, x23, #1
	ldr	w9, [x21]
	sdiv	w10, w23, w9
	msub	w9, w10, w9, w23
	ldr	w0, [x8, w9, uxtw #2]
	ldr	w1, [x8, x24]
	bl	_VectorSubtract
	ldr	w0, [x19, #12]
	ldr	x8, [sp, #56]
	ldr	w2, [x8, x22]
	bl	_CrossProduct
	ldr	x8, [sp, #56]
	ldr	w0, [x8, x22]
	mov	x1, x0
	bl	_VectorNormalize
	ldr	x8, [sp, #56]
	ldr	w0, [x8, x22]
	ldr	x8, [x21, #8]
	ldr	w1, [x8, x24]
	bl	_DotProduct
	ldr	x8, [sp, #56]
	add	x8, x8, x22
	str	x0, [x8, #8]
	ldrsw	x8, [x21]
	add	x22, x22, #16
	cmp	x23, x8
	b.lt	LBB0_7
LBB0_8:
	str	w8, [sp]
	ldr	w0, [x19, #12]
	ldr	w1, [sp, #16]
	bl	_VectorCopy
	ldr	w0, [sp, #16]
	bl	_VectorInverse
	ldr	w0, [sp, #16]
	ldr	x8, [sp, #48]
	ldr	w1, [x8]
	bl	_DotProduct
	str	x0, [sp, #24]
	ldr	q0, [sp, #16]
	str	q0, [sp, #32]
	mov	w8, #-1
Lloh12:
	adrp	x9, _VOLUME_DIRECTED@GOTPAGE
Lloh13:
	ldr	x9, [x9, _VOLUME_DIRECTED@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	str	w8, [sp, #4]
	str	w9, [sp, #12]
Lloh15:
	adrp	x8, _dleafs@GOTPAGE
Lloh16:
	ldr	x8, [x8, _dleafs@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	ldr	w2, [x8, w20, sxtw #2]
	str	w2, [sp, #8]
	mov	x1, sp
	mov	x0, x19
	mov	w3, #0
	bl	_VS_R_FloodLight
	ldr	w8, [sp, #4]
	tbnz	w8, #31, LBB0_10
; %bb.9:
	mov	x1, sp
	mov	x0, x19
	bl	_VS_R_CastLightAtSurface
LBB0_10:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #64]               ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_11:
	bl	_sqrt
	fmov	s8, s0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_LDAT_NOSCALE,8,3               ; @LDAT_NOSCALE
	.comm	_MAX_WORLD_COORD,4,2            ; @MAX_WORLD_COORD
	.comm	_LDAT_LINEAR,8,3                ; @LDAT_LINEAR
	.comm	_lightLinearScale,4,2           ; @lightLinearScale
	.comm	_VOLUME_DIRECTED,4,2            ; @VOLUME_DIRECTED
	.comm	_dleafs,8,3                     ; @dleafs
.subsections_via_symbols
