	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function BasePortalVis
LCPI0_0:
	.long	0x80000000                      ## float -0
	.long	0x80000000                      ## float -0
	.long	0x80000000                      ## float -0
	.long	0x80000000                      ## float -0
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_BasePortalVis
	.p2align	4, 0x90
_BasePortalVis:                         ## @BasePortalVis
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_portals@GOTPCREL(%rip), %r14
	movq	(%r14), %rbx
	movslq	%edi, %r13
	shlq	$6, %r13
	cmpq	$0, 56(%rbx,%r13)
	jne	LBB0_20
## %bb.1:
	leaq	(%rbx,%r13), %r12
	movq	_portalbytes@GOTPCREL(%rip), %r15
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movl	(%r15), %edi
	callq	_malloc
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, (%r12)
	movl	(%r15), %edx
	xorl	%r12d, %r12d
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	movl	(%r15), %edi
	callq	_malloc
	leaq	(%rbx,%r13), %rcx
	addq	$8, %rcx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	%rax, 8(%rbx,%r13)
	movl	(%r15), %edx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	movl	(%r15), %edi
	callq	_malloc
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, 16(%rbx,%r13)
	movl	(%r15), %edx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	_numportals@GOTPCREL(%rip), %rdi
	cmpl	$0, (%rdi)
	jle	LBB0_19
## %bb.2:
	movq	(%r14), %r15
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx), %r14
	addq	$40, %r14
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_3 Depth=1
	incl	%r12d
	addq	$64, %r15
	movl	(%rdi), %eax
	addl	%eax, %eax
	cmpl	%eax, %r12d
	jge	LBB0_19
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
                                        ##     Child Loop BB0_12 Depth 2
	cmpl	%esi, %r12d
	je	LBB0_18
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$0, 56(%r15)
	jne	LBB0_18
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	48(%r15), %r13
	movl	(%r13), %eax
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jle	LBB0_10
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%r13), %rax
	movl	(%rax,%rbx,4), %edi
	movl	(%r14), %esi
	callq	_DotProduct
	subss	-4(%r14), %xmm0
	movq	_ON_EPSILON@GOTPCREL(%rip), %rax
	ucomiss	(%rax), %xmm0
	ja	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=2
	incq	%rbx
	movslq	(%r13), %rax
	cmpq	%rax, %rbx
	jl	LBB0_6
	jmp	LBB0_9
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r13), %eax
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	_numportals@GOTPCREL(%rip), %rdi
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%eax, %ebx
	je	LBB0_18
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r14), %rbx
	movl	(%rbx), %eax
	xorl	%r13d, %r13d
	testl	%eax, %eax
	jle	LBB0_16
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%rbx), %rax
	movl	(%rax,%r13,4), %edi
	movl	40(%r15), %esi
	callq	_DotProduct
	subss	36(%r15), %xmm0
	movq	_ON_EPSILON@GOTPCREL(%rip), %rax
	movss	(%rax), %xmm1                   ## xmm1 = mem[0],zero,zero,zero
	xorps	LCPI0_0(%rip), %xmm1
	ucomiss	%xmm0, %xmm1
	ja	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=2
	incq	%r13
	movslq	(%rbx), %rax
	cmpq	%rax, %r13
	jl	LBB0_12
	jmp	LBB0_15
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rbx), %eax
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	_numportals@GOTPCREL(%rip), %rdi
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%eax, %r13d
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	%r12d, %ecx
	andb	$7, %cl
	movl	$1, %eax
	shll	%cl, %eax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movl	%r12d, %edx
	shrl	$3, %edx
	orl	%eax, (%rcx,%rdx,4)
	jmp	LBB0_18
LBB0_19:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	32(%r14,%rbx), %esi
	movq	%rdi, %r15
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_SimpleFlood
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	movl	(%r15), %esi
	addl	%esi, %esi
	callq	_CountBits
	movq	%rax, 24(%r14,%rbx)
	movq	_c_flood@GOTPCREL(%rip), %rcx
	addl	%eax, (%rcx)
LBB0_20:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_portals,8,3                    ## @portals
	.comm	_portalbytes,4,2                ## @portalbytes
	.comm	_numportals,4,2                 ## @numportals
	.comm	_ON_EPSILON,4,2                 ## @ON_EPSILON
	.comm	_c_flood,4,2                    ## @c_flood
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BasePortalVis                  ; -- Begin function BasePortalVis
	.p2align	2
_BasePortalVis:                         ; @BasePortalVis
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x19, x0
Lloh0:
	adrp	x23, _portals@GOTPAGE
Lloh1:
	ldr	x23, [x23, _portals@GOTPAGEOFF]
	ldr	x9, [x23]
	sxtw	x10, w19
	add	x20, x9, x10, lsl #6
	ldr	x8, [x20, #56]
	cbnz	x8, LBB0_22
; %bb.1:
	stp	x10, x9, [sp, #16]              ; 16-byte Folded Spill
Lloh2:
	adrp	x21, _portalbytes@GOTPAGE
Lloh3:
	ldr	x21, [x21, _portalbytes@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_malloc
	str	x0, [x20]
	ldr	w2, [x21]
	mov	w1, #0
	bl	_memset
	ldr	w0, [x21]
	bl	_malloc
	mov	x22, x20
	str	x0, [x22, #8]!
	ldr	w2, [x21]
	mov	w1, #0
	bl	_memset
	ldr	w0, [x21]
	bl	_malloc
	str	x22, [sp]                       ; 8-byte Folded Spill
	str	x0, [x22, #8]
	ldr	w2, [x21]
	mov	w1, #0
	bl	_memset
Lloh4:
	adrp	x24, _numportals@GOTPAGE
Lloh5:
	ldr	x24, [x24, _numportals@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_21
; %bb.2:
	mov	w25, #0
	ldr	x26, [x23]
	ldp	x9, x8, [sp, #16]               ; 16-byte Folded Reload
	add	x8, x8, x9, lsl #6
	add	x27, x8, #40
	add	x28, x8, #36
	add	x8, x8, #48
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
Lloh6:
	adrp	x23, _ON_EPSILON@GOTPAGE
Lloh7:
	ldr	x23, [x23, _ON_EPSILON@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w25, w25, #1
	add	x26, x26, #64
	ldr	w8, [x24]
	cmp	w25, w8, lsl #1
	b.ge	LBB0_21
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
                                        ;     Child Loop BB0_15 Depth 2
	cmp	w25, w19
	b.eq	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x26, #56]
	cbnz	x8, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x22, [x26, #48]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x21, #0
LBB0_8:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x22, #8]
	ldr	w0, [x8, x21, lsl #2]
	ldr	w1, [x27]
	bl	_DotProduct
	ldr	s1, [x28]
	fsub	s0, s0, s1
	ldr	s1, [x23]
	fcmp	s0, s1
	b.gt	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	add	x21, x21, #1
	ldrsw	x8, [x22]
	cmp	x21, x8
	b.lt	LBB0_8
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w21, #0
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w21, w8
	b.eq	LBB0_3
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x22]
	cmp	w21, w8
	b.eq	LBB0_3
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	ldr	x22, [x8]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x21, #0
LBB0_15:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x22, #8]
	ldr	w0, [x8, x21, lsl #2]
	ldr	w1, [x26, #40]
	bl	_DotProduct
	ldr	s1, [x26, #36]
	fsub	s0, s0, s1
	ldr	s1, [x23]
	fneg	s1, s1
	fcmp	s0, s1
	b.mi	LBB0_19
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=2
	add	x21, x21, #1
	ldrsw	x8, [x22]
	cmp	x21, x8
	b.lt	LBB0_15
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w21, #0
LBB0_18:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w21, w8
	b.eq	LBB0_3
	b	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x22]
	cmp	w21, w8
	b.eq	LBB0_3
LBB0_20:                                ;   in Loop: Header=BB0_4 Depth=1
	and	w8, w25, #0x7
	mov	w9, #1
	lsl	w8, w9, w8
	ldr	x9, [x20]
	lsr	w10, w25, #3
	lsl	x10, x10, #2
	ldr	w11, [x9, x10]
	orr	w8, w11, w8
	str	w8, [x9, x10]
	b	LBB0_3
LBB0_21:
	ldp	x9, x8, [sp, #16]               ; 16-byte Folded Reload
	add	x19, x8, x9, lsl #6
	ldr	w1, [x19, #32]
	mov	x0, x20
	bl	_SimpleFlood
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	ldr	x0, [x8]
	ldr	w8, [x24]
	lsl	w1, w8, #1
	bl	_CountBits
	str	x0, [x19, #24]
Lloh8:
	adrp	x8, _c_flood@GOTPAGE
Lloh9:
	ldr	x8, [x8, _c_flood@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, w0
	str	w9, [x8]
LBB0_22:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_portals,8,3                    ; @portals
	.comm	_portalbytes,4,2                ; @portalbytes
	.comm	_numportals,4,2                 ; @numportals
	.comm	_ON_EPSILON,4,2                 ; @ON_EPSILON
	.comm	_c_flood,4,2                    ; @c_flood
.subsections_via_symbols
