	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function R_SetupEntityLighting
LCPI0_0:
	.long	0x437f0000                      ## float 255
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_R_SetupEntityLighting
	.p2align	4, 0x90
_R_SetupEntityLighting:                 ## @R_SetupEntityLighting
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, 72(%rsi)
	je	LBB0_1
## %bb.15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	_qtrue@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 72(%rsi)
	movq	_RF_LIGHTING_ORIGIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	andl	24(%rsi), %eax
	sete	%cl
	movq	32(%rsi,%rcx,8), %rdi
	callq	_VectorCopy
	movq	_RDF_NOWORLDMODEL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_2
LBB0_4:
	movq	_tr@GOTPCREL(%rip), %rax
	imull	$150, (%rax), %ecx
	movq	(%r14), %rdx
	movl	%ecx, 8(%rdx)
	movl	%ecx, 4(%rdx)
	movl	%ecx, (%rdx)
	imull	$150, (%rax), %ecx
	movq	8(%r14), %rdx
	movl	%ecx, 8(%rdx)
	movl	%ecx, 4(%rdx)
	movl	%ecx, (%rdx)
	movq	8(%rax), %rdi
	movq	16(%r14), %rsi
	callq	_VectorCopy
	jmp	LBB0_5
LBB0_2:
	movq	_tr@GOTPCREL(%rip), %rax
	movq	16(%rax), %rsi
	cmpq	$0, (%rsi)
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_R_SetupEntityLightingGrid
LBB0_5:
	movq	_tr@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	shll	$5, %ecx
	movq	(%r14), %rdx
	addl	%ecx, (%rdx)
	movl	(%rax), %eax
	shll	$5, %eax
	addl	%eax, 4(%rdx)
	addl	%eax, 8(%rdx)
	movq	8(%r14), %rdi
	callq	_VectorLength
	movq	16(%r14), %rdi
	callq	_VectorScale
	cmpl	$0, 4(%r15)
	jle	LBB0_8
## %bb.6:
	movl	$16, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %r13
	movl	(%r13,%rbx), %edi
	callq	_VectorSubtract
	callq	_VectorNormalize
	movss	-16(%r13,%rbx), %xmm2           ## xmm2 = mem[0],zero,zero,zero
	mulss	%xmm2, %xmm2
	movq	_DLIGHT_AT_RADIUS@GOTPCREL(%rip), %rax
	mulss	(%rax), %xmm2
	movq	_DLIGHT_MINIMUM_RADIUS@GOTPCREL(%rip), %rax
	movss	(%rax), %xmm1                   ## xmm1 = mem[0],zero,zero,zero
	maxss	%xmm0, %xmm1
	mulss	%xmm1, %xmm1
	divss	%xmm1, %xmm2
	movss	%xmm2, -44(%rbp)                ## 4-byte Spill
	movq	8(%r14), %rdi
	movq	-8(%r13,%rbx), %rsi
	movaps	%xmm2, %xmm0
	movq	%rdi, %rdx
	callq	_VectorMA
	movss	-44(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	callq	_VectorMA
	incq	%r12
	movslq	4(%r15), %rax
	addq	$24, %rbx
	cmpq	%rax, %r12
	jl	LBB0_7
LBB0_8:
	movq	(%r14), %rax
	xorps	%xmm0, %xmm0
	cvtsi2ssl	(%rax), %xmm0
	xorps	%xmm1, %xmm1
	cvtsi2ssl	4(%rax), %xmm1
	xorps	%xmm2, %xmm2
	cvtsi2ssl	8(%rax), %xmm2
	movss	%xmm2, -44(%rbp)                ## 4-byte Spill
	callq	_MAX
	movss	-44(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	callq	_MAX
	ucomiss	LCPI0_0(%rip), %xmm0
	jbe	LBB0_10
## %bb.9:
	movss	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	movq	(%r14), %rax
	xorps	%xmm2, %xmm2
	cvtsi2ssl	(%rax), %xmm2
	divss	%xmm0, %xmm1
	mulss	%xmm1, %xmm2
	cvttss2si	%xmm2, %ecx
	movl	%ecx, (%rax)
	xorps	%xmm0, %xmm0
	cvtsi2ssl	4(%rax), %xmm0
	mulss	%xmm1, %xmm0
	cvttss2si	%xmm0, %ecx
	movl	%ecx, 4(%rax)
	xorps	%xmm0, %xmm0
	cvtsi2ssl	8(%rax), %xmm0
	mulss	%xmm1, %xmm0
	cvttss2si	%xmm0, %ecx
	movl	%ecx, 8(%rax)
LBB0_10:
	movq	8(%r14), %rax
	xorps	%xmm0, %xmm0
	cvtsi2ssl	(%rax), %xmm0
	xorps	%xmm1, %xmm1
	cvtsi2ssl	4(%rax), %xmm1
	xorps	%xmm2, %xmm2
	cvtsi2ssl	8(%rax), %xmm2
	movss	%xmm2, -44(%rbp)                ## 4-byte Spill
	callq	_MAX
	movss	-44(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	callq	_MAX
	ucomiss	LCPI0_0(%rip), %xmm0
	jbe	LBB0_12
## %bb.11:
	movss	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	movq	8(%r14), %rax
	xorps	%xmm2, %xmm2
	cvtsi2ssl	(%rax), %xmm2
	divss	%xmm0, %xmm1
	mulss	%xmm1, %xmm2
	cvttss2si	%xmm2, %ecx
	movl	%ecx, (%rax)
	xorps	%xmm0, %xmm0
	cvtsi2ssl	4(%rax), %xmm0
	mulss	%xmm1, %xmm0
	cvttss2si	%xmm0, %ecx
	movl	%ecx, 4(%rax)
	xorps	%xmm0, %xmm0
	cvtsi2ssl	8(%rax), %xmm0
	mulss	%xmm1, %xmm0
	cvttss2si	%xmm0, %ecx
	movl	%ecx, 8(%rax)
LBB0_12:
	movq	_r_debugLight@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	$0, (%rax)
	je	LBB0_14
## %bb.13:
	movq	%r14, %rdi
	callq	_LogLight
LBB0_14:
	movq	_ri@GOTPCREL(%rip), %rbx
	movq	(%r14), %rax
	xorps	%xmm0, %xmm0
	cvtsi2ssl	(%rax), %xmm0
	callq	*(%rbx)
	movl	%eax, 64(%r14)
	movq	(%r14), %rax
	xorps	%xmm0, %xmm0
	cvtsi2ssl	4(%rax), %xmm0
	callq	*(%rbx)
	movl	%eax, 68(%r14)
	movq	(%r14), %rax
	xorps	%xmm0, %xmm0
	cvtsi2ssl	8(%rax), %xmm0
	callq	*(%rbx)
	movl	%eax, 72(%r14)
	movl	$255, 76(%r14)
	callq	_VectorNormalize
	movq	48(%r14), %rax
	movl	(%rax), %esi
	callq	_DotProduct
	movq	56(%r14), %rcx
	movq	%rax, (%rcx)
	movq	48(%r14), %rax
	movl	4(%rax), %esi
	callq	_DotProduct
	movq	56(%r14), %rcx
	movq	%rax, 8(%rcx)
	movq	48(%r14), %rax
	movl	8(%rax), %esi
	callq	_DotProduct
	movq	56(%r14), %rcx
	movq	%rax, 16(%rcx)
	movq	16(%r14), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_VectorCopy                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_qtrue,8,3                      ## @qtrue
	.comm	_RF_LIGHTING_ORIGIN,4,2         ## @RF_LIGHTING_ORIGIN
	.comm	_RDF_NOWORLDMODEL,4,2           ## @RDF_NOWORLDMODEL
	.comm	_tr,24,3                        ## @tr
	.comm	_DLIGHT_AT_RADIUS,4,2           ## @DLIGHT_AT_RADIUS
	.comm	_DLIGHT_MINIMUM_RADIUS,4,2      ## @DLIGHT_MINIMUM_RADIUS
	.comm	_r_debugLight,8,3               ## @r_debugLight
	.comm	_ri,8,3                         ## @ri
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_SetupEntityLighting          ; -- Begin function R_SetupEntityLighting
	.p2align	2
_R_SetupEntityLighting:                 ; @R_SetupEntityLighting
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [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 b8, -88
	.cfi_offset b9, -96
	ldr	x8, [x1, #72]
	cbz	x8, LBB0_2
; %bb.1:
	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	d9, d8, [sp], #96               ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _qtrue@GOTPAGE
Lloh1:
	ldr	x8, [x8, _qtrue@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [x1, #72]
	ldr	w8, [x1, #24]
Lloh3:
	adrp	x9, _RF_LIGHTING_ORIGIN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _RF_LIGHTING_ORIGIN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	mov	w8, #32
	mov	w9, #40
	csel	x8, x9, x8, eq
	ldr	x0, [x1, x8]
	bl	_VectorCopy
	ldr	w8, [x20]
Lloh6:
	adrp	x9, _RDF_NOWORLDMODEL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _RDF_NOWORLDMODEL@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x21, _tr@GOTPAGE
Lloh10:
	ldr	x21, [x21, _tr@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_4
LBB0_3:
	ldr	w8, [x21]
	mov	w9, #150
	mul	w8, w8, w9
	ldp	x10, x11, [x19]
	stp	w8, w8, [x10, #4]
	str	w8, [x10]
	ldr	w8, [x21]
	mul	w8, w8, w9
	stp	w8, w8, [x11, #4]
	str	w8, [x11]
	ldr	x0, [x21, #8]
	ldr	x1, [x19, #16]
	bl	_VectorCopy
	b	LBB0_6
LBB0_4:
	ldr	x1, [x21, #16]
	ldr	x8, [x1]
	cbz	x8, LBB0_3
; %bb.5:
	mov	x0, x19
	bl	_R_SetupEntityLightingGrid
LBB0_6:
	ldr	w8, [x21]
	ldp	x9, x0, [x19]
	ldr	w10, [x9]
	add	w8, w10, w8, lsl #5
	str	w8, [x9]
	ldr	w8, [x21]
	lsl	w8, w8, #5
	ldur	d0, [x9, #4]
	dup.2s	v1, w8
	add.2s	v0, v0, v1
	stur	d0, [x9, #4]
	bl	_VectorLength
	ldr	x0, [x19, #16]
	bl	_VectorScale
	ldr	w8, [x20, #4]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.7:
	mov	x21, #0
	mov	x22, #0
Lloh11:
	adrp	x23, _DLIGHT_AT_RADIUS@GOTPAGE
Lloh12:
	ldr	x23, [x23, _DLIGHT_AT_RADIUS@GOTPAGEOFF]
Lloh13:
	adrp	x24, _DLIGHT_MINIMUM_RADIUS@GOTPAGE
Lloh14:
	ldr	x24, [x24, _DLIGHT_MINIMUM_RADIUS@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	add	x25, x8, x21
	ldr	w0, [x25, #16]
	bl	_VectorSubtract
	bl	_VectorNormalize
	ldr	s1, [x23]
	ldr	s2, [x25]
	fmul	s2, s2, s2
	fmul	s1, s1, s2
	ldr	s2, [x24]
	fcmp	s0, s2
	fcsel	s0, s2, s0, mi
	fmul	s0, s0, s0
	fdiv	s8, s1, s0
	ldr	x0, [x19, #8]
	ldr	x1, [x25, #8]
	fmov	s0, s8
	mov	x2, x0
	bl	_VectorMA
	fmov	s0, s8
	bl	_VectorMA
	add	x22, x22, #1
	ldrsw	x8, [x20, #4]
	add	x21, x21, #24
	cmp	x22, x8
	b.lt	LBB0_8
LBB0_9:
	ldr	x8, [x19]
	ldp	s0, s1, [x8]
	scvtf	s0, s0
	scvtf	s1, s1
	ldr	s2, [x8, #8]
	scvtf	s8, s2
	bl	_MAX
	fmov	s1, s8
	bl	_MAX
	mov	w8, #1132396544
	fmov	s1, w8
	fcmp	s0, s1
	b.le	LBB0_11
; %bb.10:
	mov	w8, #1132396544
	fmov	s1, w8
	fdiv	s0, s1, s0
	ldr	x8, [x19]
	ldr	d1, [x8]
	scvtf.2s	v1, v1
	fmul.2s	v1, v1, v0[0]
	fcvtzs.2s	v1, v1
	str	d1, [x8]
	ldr	s1, [x8, #8]
	scvtf	s1, s1
	fmul	s0, s0, s1
	fcvtzs	w9, s0
	str	w9, [x8, #8]
LBB0_11:
	ldr	x8, [x19, #8]
	ldp	s0, s1, [x8]
	scvtf	s0, s0
	scvtf	s1, s1
	ldr	s2, [x8, #8]
	scvtf	s8, s2
	bl	_MAX
	fmov	s1, s8
	bl	_MAX
	mov	w8, #1132396544
	fmov	s1, w8
	fcmp	s0, s1
	b.le	LBB0_13
; %bb.12:
	mov	w8, #1132396544
	fmov	s1, w8
	fdiv	s0, s1, s0
	ldr	x8, [x19, #8]
	ldr	d1, [x8]
	scvtf.2s	v1, v1
	fmul.2s	v1, v1, v0[0]
	fcvtzs.2s	v1, v1
	str	d1, [x8]
	ldr	s1, [x8, #8]
	scvtf	s1, s1
	fmul	s0, s0, s1
	fcvtzs	w9, s0
	str	w9, [x8, #8]
LBB0_13:
Lloh15:
	adrp	x8, _r_debugLight@GOTPAGE
Lloh16:
	ldr	x8, [x8, _r_debugLight@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	ldr	x8, [x8]
	cbz	x8, LBB0_15
; %bb.14:
	mov	x0, x19
	bl	_LogLight
LBB0_15:
Lloh18:
	adrp	x20, _ri@GOTPAGE
Lloh19:
	ldr	x20, [x20, _ri@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	x9, [x19]
	ldr	s0, [x9]
	scvtf	s0, s0
	blr	x8
	str	w0, [x19, #64]
	ldr	x8, [x20]
	ldr	x9, [x19]
	ldr	s0, [x9, #4]
	scvtf	s0, s0
	blr	x8
	str	w0, [x19, #68]
	ldr	x8, [x20]
	ldr	x9, [x19]
	ldr	s0, [x9, #8]
	scvtf	s0, s0
	blr	x8
	mov	w8, #255
	stp	w0, w8, [x19, #72]
	bl	_VectorNormalize
	ldr	x8, [x19, #48]
	ldr	w1, [x8]
	bl	_DotProduct
	ldr	x8, [x19, #56]
	str	x0, [x8]
	ldr	x8, [x19, #48]
	ldr	w1, [x8, #4]
	bl	_DotProduct
	ldr	x8, [x19, #56]
	str	x0, [x8, #8]
	ldr	x8, [x19, #48]
	ldr	w1, [x8, #8]
	bl	_DotProduct
	ldr	x8, [x19, #56]
	str	x0, [x8, #16]
	ldr	x1, [x19, #16]
	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	d9, d8, [sp], #96               ; 16-byte Folded Reload
	b	_VectorCopy
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_qtrue,8,3                      ; @qtrue
	.comm	_RF_LIGHTING_ORIGIN,4,2         ; @RF_LIGHTING_ORIGIN
	.comm	_RDF_NOWORLDMODEL,4,2           ; @RDF_NOWORLDMODEL
	.comm	_tr,24,3                        ; @tr
	.comm	_DLIGHT_AT_RADIUS,4,2           ; @DLIGHT_AT_RADIUS
	.comm	_DLIGHT_MINIMUM_RADIUS,4,2      ; @DLIGHT_MINIMUM_RADIUS
	.comm	_r_debugLight,8,3               ; @r_debugLight
	.comm	_ri,8,3                         ; @ri
.subsections_via_symbols
