	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CalcVis                        ## -- Begin function CalcVis
	.p2align	4, 0x90
_CalcVis:                               ## @CalcVis
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_numportals@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addl	%edi, %edi
	movq	_qtrue@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BasePortalVis@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_RunThreadsOnIndividual
	xorl	%eax, %eax
	callq	_SortPortals
	movq	_fastvis@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_CalcFastVis
	jmp	LBB0_7
LBB0_2:
	movq	_noPassageVis@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_CalcPortalVis
	jmp	LBB0_7
LBB0_4:
	movq	_passageVisOnly@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.5:
	xorl	%eax, %eax
	callq	_CalcPassageVis
	jmp	LBB0_7
LBB0_6:
	xorl	%eax, %eax
	callq	_CalcPassagePortalVis
LBB0_7:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	__printf
	movq	_portalclusters@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	jle	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_ClusterMerge
	incl	%ebx
	cmpl	(%r14), %ebx
	jl	LBB0_8
LBB0_9:
	movq	_totalvis@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	__printf
	movl	(%rbx), %eax
	cltd
	idivl	(%r14)
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	__printf                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_numportals,4,2                 ## @numportals
	.comm	_qtrue,4,2                      ## @qtrue
	.comm	_BasePortalVis,4,2              ## @BasePortalVis
	.comm	_fastvis,8,3                    ## @fastvis
	.comm	_noPassageVis,8,3               ## @noPassageVis
	.comm	_passageVisOnly,8,3             ## @passageVisOnly
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"creating leaf vis...\n"

	.comm	_portalclusters,4,2             ## @portalclusters
L_.str.1:                               ## @.str.1
	.asciz	"Total visible clusters: %i\n"

	.comm	_totalvis,4,2                   ## @totalvis
L_.str.2:                               ## @.str.2
	.asciz	"Average clusters visible: %i\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CalcVis                        ; -- Begin function CalcVis
	.p2align	2
_CalcVis:                               ; @CalcVis
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _numportals@GOTPAGE
Lloh1:
	ldr	x8, [x8, _numportals@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	lsl	w0, w8, #1
Lloh3:
	adrp	x8, _qtrue@GOTPAGE
Lloh4:
	ldr	x8, [x8, _qtrue@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _BasePortalVis@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BasePortalVis@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	bl	_RunThreadsOnIndividual
	bl	_SortPortals
Lloh9:
	adrp	x8, _fastvis@GOTPAGE
Lloh10:
	ldr	x8, [x8, _fastvis@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	bl	_CalcFastVis
	b	LBB0_7
LBB0_2:
Lloh12:
	adrp	x8, _noPassageVis@GOTPAGE
Lloh13:
	ldr	x8, [x8, _noPassageVis@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.3:
	bl	_CalcPortalVis
	b	LBB0_7
LBB0_4:
Lloh15:
	adrp	x8, _passageVisOnly@GOTPAGE
Lloh16:
	ldr	x8, [x8, _passageVisOnly@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.5:
	bl	_CalcPassageVis
	b	LBB0_7
LBB0_6:
	bl	_CalcPassagePortalVis
LBB0_7:
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	bl	__printf
Lloh20:
	adrp	x20, _portalclusters@GOTPAGE
Lloh21:
	ldr	x20, [x20, _portalclusters@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.8:
	mov	w19, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_ClusterMerge
	add	w19, w19, #1
	ldr	w8, [x20]
	cmp	w19, w8
	b.lt	LBB0_9
LBB0_10:
Lloh22:
	adrp	x19, _totalvis@GOTPAGE
Lloh23:
	ldr	x19, [x19, _totalvis@GOTPAGEOFF]
	ldr	w8, [x19]
	str	x8, [sp]
Lloh24:
	adrp	x0, l_.str.1@PAGE
Lloh25:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	__printf
	ldr	w8, [x19]
	ldr	w9, [x20]
	sdiv	w8, w8, w9
	str	x8, [sp]
Lloh26:
	adrp	x0, l_.str.2@PAGE
Lloh27:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	__printf
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_numportals,4,2                 ; @numportals
	.comm	_qtrue,4,2                      ; @qtrue
	.comm	_BasePortalVis,4,2              ; @BasePortalVis
	.comm	_fastvis,8,3                    ; @fastvis
	.comm	_noPassageVis,8,3               ; @noPassageVis
	.comm	_passageVisOnly,8,3             ; @passageVisOnly
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"creating leaf vis...\n"

	.comm	_portalclusters,4,2             ; @portalclusters
l_.str.1:                               ; @.str.1
	.asciz	"Total visible clusters: %i\n"

	.comm	_totalvis,4,2                   ; @totalvis
l_.str.2:                               ; @.str.2
	.asciz	"Average clusters visible: %i\n"

.subsections_via_symbols
