	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_render_chunks                  ## -- Begin function render_chunks
	.p2align	4, 0x90
_render_chunks:                         ## @render_chunks
	.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	$200, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rsi, %rdi
	callq	_ensure_chunks
	movl	8(%rbx), %edi
	callq	_chunked
	movl	%eax, -232(%rbp)                ## 4-byte Spill
	movl	(%rbx), %edi
	callq	_chunked
	movl	%eax, -228(%rbp)                ## 4-byte Spill
	movl	$0, -212(%rbp)                  ## 4-byte Folded Spill
	xorl	%eax, %eax
	callq	_get_daylight
	movss	%xmm0, -224(%rbp)               ## 4-byte Spill
	movq	_g@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movl	32(%rax), %esi
	movl	28(%rax), %edx
	movl	8(%rbx), %ecx
	movl	(%rbx), %r9d
	movl	4(%rbx), %r8d
	movl	16(%rbx), %r10d
	movl	12(%rbx), %r11d
	movl	24(%rax), %r15d
	movl	(%rax), %r12d
	movss	4(%rax), %xmm0                  ## xmm0 = mem[0],zero,zero,zero
	leaq	-112(%rbp), %rdi
	pushq	%r12
	pushq	%r15
	pushq	%r11
	pushq	%r10
	callq	_set_matrix_3d
	addq	$32, %rsp
	movq	(%r14), %rax
	movss	4(%rax), %xmm0                  ## xmm0 = mem[0],zero,zero,zero
	leaq	-208(%rbp), %rdi
	leaq	-112(%rbp), %rsi
	callq	_frustum_planes
	movl	32(%r13), %edi
	callq	_glUseProgram
	movl	28(%r13), %edi
	movq	_GL_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$1, %esi
	leaq	-112(%rbp), %rcx
	callq	_glUniformMatrix4fv
	movl	24(%r13), %edi
	movl	8(%rbx), %esi
	movl	(%rbx), %ecx
	movl	4(%rbx), %edx
	callq	_glUniform3f
	movl	20(%r13), %edi
	xorl	%esi, %esi
	callq	_glUniform1i
	movl	16(%r13), %edi
	movl	$2, %esi
	callq	_glUniform1i
	movl	12(%r13), %edi
	movss	-224(%rbp), %xmm0               ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	callq	_glUniform1f
	movl	8(%r13), %edi
	movq	(%r14), %rax
	movss	4(%rax), %xmm0                  ## xmm0 = mem[0],zero,zero,zero
	movq	_CHUNK_SIZE@GOTPCREL(%rip), %rax
	mulss	(%rax), %xmm0
	callq	_glUniform1f
	movl	4(%r13), %edi
	movq	(%r14), %rax
	movl	(%rax), %esi
	callq	_glUniform1i
	movq	%r13, -224(%rbp)                ## 8-byte Spill
	movl	(%r13), %ebx
	xorl	%eax, %eax
	callq	_time_of_day
	movl	%ebx, %edi
	callq	_glUniform1f
	movq	(%r14), %rax
	cmpl	$0, 8(%rax)
	jle	LBB0_6
## %bb.1:
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	movl	$0, -212(%rbp)                  ## 4-byte Folded Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r15
	movq	(%r14), %rax
	movslq	8(%rax), %rcx
	addq	$24, %r12
	cmpq	%rcx, %r15
	jge	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%rax), %r13
	leaq	(%r12,%r13), %rbx
	movq	%rbx, %rdi
	movl	-232(%rbp), %esi                ## 4-byte Reload
	movl	-228(%rbp), %edx                ## 4-byte Reload
	callq	_chunk_distance
	movq	(%r14), %rax
	ucomiss	4(%rax), %xmm0
	ja	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	20(%r13,%r12), %esi
	movl	16(%r13,%r12), %edx
	movl	8(%r13,%r12), %r8d
	movl	12(%r13,%r12), %ecx
	leaq	-208(%rbp), %rdi
	callq	_chunk_visible
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-224(%rbp), %rdi                ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_draw_chunk
	movl	-212(%rbp), %eax                ## 4-byte Reload
	addl	(%r13,%r12), %eax
	movl	%eax, -212(%rbp)                ## 4-byte Spill
	jmp	LBB0_5
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movl	-212(%rbp), %eax                ## 4-byte Reload
	addq	$200, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_g,8,3                          ## @g
	.comm	_GL_FALSE,4,2                   ## @GL_FALSE
	.comm	_CHUNK_SIZE,4,2                 ## @CHUNK_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_render_chunks                  ; -- Begin function render_chunks
	.p2align	2
_render_chunks:                         ; @render_chunks
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #288
	.cfi_def_cfa_offset 288
	stp	d9, d8, [sp, #176]              ; 16-byte Folded Spill
	stp	x28, x27, [sp, #192]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #208]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #224]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #240]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #256]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #272]            ; 16-byte Folded Spill
	add	x29, sp, #272
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-104]
	mov	x0, x1
	bl	_ensure_chunks
	ldr	w0, [x22, #8]
	bl	_chunked
	mov	x20, x0
	ldr	w0, [x22]
	bl	_chunked
	mov	x21, x0
	bl	_get_daylight
	fmov	s8, s0
Lloh3:
	adrp	x24, _g@GOTPAGE
Lloh4:
	ldr	x24, [x24, _g@GOTPAGEOFF]
	ldr	x8, [x24]
	ldp	w2, w1, [x8, #28]
	ldp	w5, w4, [x22]
	ldp	w7, w6, [x22, #12]
	ldr	w3, [x22, #8]
	ldr	w9, [x8, #24]
	ldr	w10, [x8]
	ldr	s0, [x8, #4]
	stp	w9, w10, [sp]
	add	x0, sp, #104
	bl	_set_matrix_3d
	ldr	x8, [x24]
	ldr	s0, [x8, #4]
	add	x0, sp, #8
	add	x1, sp, #104
	bl	_frustum_planes
	ldr	w0, [x19, #32]
	bl	_glUseProgram
	ldr	w0, [x19, #28]
Lloh5:
	adrp	x8, _GL_FALSE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GL_FALSE@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	add	x3, sp, #104
	mov	w1, #1
	bl	_glUniformMatrix4fv
	ldr	w0, [x19, #24]
	ldp	w2, w1, [x22, #4]
	ldr	w3, [x22]
	bl	_glUniform3f
	ldr	w0, [x19, #20]
	mov	w1, #0
	bl	_glUniform1i
	ldr	w0, [x19, #16]
	mov	w1, #2
	bl	_glUniform1i
	ldr	w0, [x19, #12]
	fmov	s0, s8
	bl	_glUniform1f
	ldr	w0, [x19, #8]
	ldr	x8, [x24]
	ldr	s0, [x8, #4]
Lloh8:
	adrp	x8, _CHUNK_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CHUNK_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	s1, [x8]
	fmul	s0, s0, s1
	bl	_glUniform1f
	ldr	w0, [x19, #4]
	ldr	x8, [x24]
	ldr	w1, [x8]
	bl	_glUniform1i
	ldr	w22, [x19]
	bl	_time_of_day
	mov	x0, x22
	bl	_glUniform1f
	ldr	x8, [x24]
	ldr	w9, [x8, #8]
	cmp	w9, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x25, #0
	mov	x26, #0
	mov	w22, #0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x26, x26, #1
	ldr	x8, [x24]
	ldrsw	x9, [x8, #8]
	add	x25, x25, #24
	cmp	x26, x9
	b.ge	LBB0_7
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x27, [x8, #16]
	add	x23, x27, x25
	mov	x0, x23
	mov	x1, x20
	mov	x2, x21
	bl	_chunk_distance
	ldr	x8, [x24]
	ldr	s1, [x8, #4]
	fcmp	s0, s1
	b.gt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldp	w2, w1, [x23, #16]
	ldp	w4, w3, [x23, #8]
	add	x0, sp, #8
	bl	_chunk_visible
	cbz	w0, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	x1, x23
	bl	_draw_chunk
	ldr	w8, [x27, x25]
	add	w22, w22, w8
	b	LBB0_2
LBB0_6:
	mov	w22, #0
LBB0_7:
	ldur	x8, [x29, #-104]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	mov	x0, x22
	ldp	x29, x30, [sp, #272]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #256]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #240]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #224]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #208]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #192]            ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #176]              ; 16-byte Folded Reload
	add	sp, sp, #288
	ret
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_g,8,3                          ; @g
	.comm	_GL_FALSE,4,2                   ; @GL_FALSE
	.comm	_CHUNK_SIZE,4,2                 ; @CHUNK_SIZE
.subsections_via_symbols
