	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_AddSprites                   ## -- Begin function R_AddSprites
	.p2align	4, 0x90
_R_AddSprites:                          ## @R_AddSprites
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_validcount@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, (%rdi)
	jne	LBB0_1
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_1:
	movq	%rax, (%rdi)
	movl	8(%rdi), %eax
	movq	_LIGHTSEGSHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movq	_extralight@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	js	LBB0_2
## %bb.3:
	movq	_LIGHTLEVELS@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movq	_scalelight@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	cmpl	%ecx, %eax
	jge	LBB0_4
## %bb.5:
	movl	%eax, %eax
	leaq	(%rdx,%rax,4), %rax
	jmp	LBB0_6
LBB0_2:
	movq	_scalelight@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_6
LBB0_4:
	leaq	(%rdx,%rcx,4), %rax
	addq	$-4, %rax
LBB0_6:
	movl	(%rax), %eax
	movq	_spritelights@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	16(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_9
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_R_ProjectSprite
	movq	(%rbx), %rbx
	testq	%rbx, %rbx
	jne	LBB0_7
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_validcount,8,3                 ## @validcount
	.comm	_LIGHTSEGSHIFT,4,2              ## @LIGHTSEGSHIFT
	.comm	_extralight,4,2                 ## @extralight
	.comm	_scalelight,8,3                 ## @scalelight
	.comm	_spritelights,4,2               ## @spritelights
	.comm	_LIGHTLEVELS,4,2                ## @LIGHTLEVELS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_AddSprites                   ; -- Begin function R_AddSprites
	.p2align	2
_R_AddSprites:                          ; @R_AddSprites
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x9, [x0]
Lloh0:
	adrp	x8, _validcount@GOTPAGE
Lloh1:
	ldr	x8, [x8, _validcount@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x9, x8
	b.eq	LBB0_6
; %bb.1:
	str	x8, [x0]
	ldr	w8, [x0, #8]
Lloh3:
	adrp	x9, _LIGHTSEGSHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _LIGHTSEGSHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	asr	w8, w8, w9
Lloh6:
	adrp	x9, _extralight@GOTPAGE
Lloh7:
	ldr	x9, [x9, _extralight@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	adds	w8, w8, w9
	b.mi	LBB0_3
; %bb.2:
Lloh9:
	adrp	x9, _LIGHTLEVELS@GOTPAGE
Lloh10:
	ldr	x9, [x9, _LIGHTLEVELS@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x10, _scalelight@GOTPAGE
Lloh13:
	ldr	x10, [x10, _scalelight@GOTPAGEOFF]
Lloh14:
	ldr	x10, [x10]
	add	x11, x10, w8, uxtw #2
	sub	w12, w9, #1
	add	x10, x10, w12, sxtw #2
	cmp	w8, w9
	csel	x8, x11, x10, lt
	b	LBB0_4
LBB0_3:
Lloh15:
	adrp	x8, _scalelight@GOTPAGE
Lloh16:
	ldr	x8, [x8, _scalelight@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
LBB0_4:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _spritelights@GOTPAGE
Lloh19:
	ldr	x9, [x9, _spritelights@GOTPAGEOFF]
Lloh20:
	str	w8, [x9]
	ldr	x19, [x0, #16]
	cbz	x19, LBB0_6
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_R_ProjectSprite
	ldr	x19, [x19]
	cbnz	x19, LBB0_5
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotStr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_validcount,8,3                 ; @validcount
	.comm	_LIGHTSEGSHIFT,4,2              ; @LIGHTSEGSHIFT
	.comm	_extralight,4,2                 ; @extralight
	.comm	_scalelight,8,3                 ; @scalelight
	.comm	_spritelights,4,2               ; @spritelights
	.comm	_LIGHTLEVELS,4,2                ; @LIGHTLEVELS
.subsections_via_symbols
