	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_InitLightTables              ## -- Begin function R_InitLightTables
	.p2align	4, 0x90
_R_InitLightTables:                     ## @R_InitLightTables
	.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
	movq	_LIGHTLEVELS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testl	%esi, %esi
	jle	LBB0_11
## %bb.1:
	movq	_NUMCOLORMAPS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_MAXLIGHTZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%r13d, %r13d
	movq	_zlight@GOTPCREL(%rip), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_LIGHTLEVELS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r13
	movslq	%esi, %rax
	cmpq	%rax, %r13
	jge	LBB0_11
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movl	%r13d, %eax
	notl	%eax
	addl	%esi, %eax
	imull	%ecx, %eax
	addl	%eax, %eax
	cltd
	idivl	%esi
	testl	%edi, %edi
	jle	LBB0_10
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %ebx
	xorl	%r15d, %r15d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=2
	shll	$8, %edx
	movslq	%edx, %rax
	movq	_colormaps@GOTPCREL(%rip), %rdx
	addq	(%rdx), %rax
	movq	(%r14), %rdx
	movq	(%rdx,%r13,8), %rdx
	movq	%rax, (%rdx,%r15,8)
	movq	_MAXLIGHTZ@GOTPCREL(%rip), %rax
	movslq	(%rax), %rdi
	movq	%r12, %r15
	cmpq	%rdi, %r12
	jge	LBB0_9
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_SCREENWIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %edi
	shrl	$31, %edi
	addl	%eax, %edi
	sarl	%edi
	movq	_FRACUNIT@GOTPCREL(%rip), %rax
	imull	(%rax), %edi
	leaq	1(%r15), %r12
	movq	_LIGHTZSHIFT@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	movl	%r12d, %esi
	shll	%cl, %esi
	callq	_FixedDiv
	movq	_LIGHTSCALESHIFT@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	sarl	%cl, %eax
	cltd
	movq	_DISTMAP@GOTPCREL(%rip), %rcx
	idivl	(%rcx)
	movl	%ebx, %edx
	subl	%eax, %edx
	testl	%edx, %edx
	jg	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	xorl	%edx, %edx
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=2
	movq	_NUMCOLORMAPS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	cmpl	%ecx, %edx
	jl	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	leal	-1(%rcx), %edx
	jmp	LBB0_8
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LIGHTLEVELS,4,2                ## @LIGHTLEVELS
	.comm	_NUMCOLORMAPS,4,2               ## @NUMCOLORMAPS
	.comm	_MAXLIGHTZ,4,2                  ## @MAXLIGHTZ
	.comm	_SCREENWIDTH,4,2                ## @SCREENWIDTH
	.comm	_FRACUNIT,4,2                   ## @FRACUNIT
	.comm	_LIGHTZSHIFT,4,2                ## @LIGHTZSHIFT
	.comm	_LIGHTSCALESHIFT,4,2            ## @LIGHTSCALESHIFT
	.comm	_DISTMAP,4,2                    ## @DISTMAP
	.comm	_colormaps,8,3                  ## @colormaps
	.comm	_zlight,8,3                     ## @zlight
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_InitLightTables              ; -- Begin function R_InitLightTables
	.p2align	2
_R_InitLightTables:                     ; @R_InitLightTables
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x8, _LIGHTLEVELS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LIGHTLEVELS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x0, #0
Lloh3:
	adrp	x24, _NUMCOLORMAPS@GOTPAGE
Lloh4:
	ldr	x24, [x24, _NUMCOLORMAPS@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh5:
	adrp	x10, _MAXLIGHTZ@GOTPAGE
Lloh6:
	ldr	x10, [x10, _MAXLIGHTZ@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
Lloh8:
	adrp	x26, _SCREENWIDTH@GOTPAGE
Lloh9:
	ldr	x26, [x26, _SCREENWIDTH@GOTPAGEOFF]
Lloh10:
	adrp	x27, _FRACUNIT@GOTPAGE
Lloh11:
	ldr	x27, [x27, _FRACUNIT@GOTPAGEOFF]
Lloh12:
	adrp	x28, _LIGHTZSHIFT@GOTPAGE
Lloh13:
	ldr	x28, [x28, _LIGHTZSHIFT@GOTPAGEOFF]
Lloh14:
	adrp	x19, _LIGHTSCALESHIFT@GOTPAGE
Lloh15:
	ldr	x19, [x19, _LIGHTSCALESHIFT@GOTPAGEOFF]
Lloh16:
	adrp	x20, _DISTMAP@GOTPAGE
Lloh17:
	ldr	x20, [x20, _DISTMAP@GOTPAGEOFF]
Lloh18:
	adrp	x25, _colormaps@GOTPAGE
Lloh19:
	ldr	x25, [x25, _colormaps@GOTPAGEOFF]
Lloh20:
	adrp	x22, _zlight@GOTPAGE
Lloh21:
	ldr	x22, [x22, _zlight@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x0, x0, #1
	cmp	x0, w9, sxtw
	b.ge	LBB0_7
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	cmp	w10, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x23, #0
	mvn	w10, w0
	add	w10, w9, w10
	mul	w8, w10, w8
	lsl	w8, w8, #1
	sdiv	w8, w8, w9
	str	w8, [sp, #4]                    ; 4-byte Folded Spill
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x26]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	ldr	w9, [x27]
	mul	w0, w8, w9
	add	x21, x23, #1
	ldr	w8, [x28]
	lsl	w1, w21, w8
	bl	_FixedDiv
	ldr	w8, [x19]
	asr	w8, w0, w8
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	ldr	w9, [x20]
	sdiv	w8, w8, w9
	ldr	w9, [sp, #4]                    ; 4-byte Folded Reload
	sub	w8, w9, w8
	cmp	w8, #0
	csel	w9, w8, wzr, gt
	ldr	w8, [x24]
	sub	w10, w8, #1
	cmp	w9, w8
	csel	w9, w9, w10, lt
	ldr	x10, [x25]
	lsl	w9, w9, #8
	ldr	x11, [x22]
	ldr	x11, [x11, x0, lsl #3]
	add	x9, x10, w9, sxtw
	str	x9, [x11, x23, lsl #3]
Lloh22:
	adrp	x9, _MAXLIGHTZ@GOTPAGE
Lloh23:
	ldr	x9, [x9, _MAXLIGHTZ@GOTPAGEOFF]
Lloh24:
	ldrsw	x10, [x9]
	mov	x23, x21
	cmp	x21, x10
	b.lt	LBB0_5
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh25:
	adrp	x9, _LIGHTLEVELS@GOTPAGE
Lloh26:
	ldr	x9, [x9, _LIGHTLEVELS@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	b	LBB0_2
LBB0_7:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_LIGHTLEVELS,4,2                ; @LIGHTLEVELS
	.comm	_NUMCOLORMAPS,4,2               ; @NUMCOLORMAPS
	.comm	_MAXLIGHTZ,4,2                  ; @MAXLIGHTZ
	.comm	_SCREENWIDTH,4,2                ; @SCREENWIDTH
	.comm	_FRACUNIT,4,2                   ; @FRACUNIT
	.comm	_LIGHTZSHIFT,4,2                ; @LIGHTZSHIFT
	.comm	_LIGHTSCALESHIFT,4,2            ; @LIGHTSCALESHIFT
	.comm	_DISTMAP,4,2                    ; @DISTMAP
	.comm	_colormaps,8,3                  ; @colormaps
	.comm	_zlight,8,3                     ; @zlight
.subsections_via_symbols
