	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LoadPortals                    ## -- Begin function LoadPortals
	.p2align	4, 0x90
_LoadPortals:                           ## @LoadPortals
	.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	$168, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	L_.str(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_fopen
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_Error
	jmp	LBB0_4
LBB0_1:
	movq	_stdin@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_4:
	leaq	L_.str.3(%rip), %rsi
	movq	_portalclusters@GOTPCREL(%rip), %r15
	movq	_numportals@GOTPCREL(%rip), %r8
	movq	_numfaces@GOTPCREL(%rip), %r9
	leaq	-128(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r15, %rcx
	xorl	%eax, %eax
	callq	_fscanf
	cmpl	$4, %eax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_Error
LBB0_6:
	movq	%rbx, -200(%rbp)                ## 8-byte Spill
	movq	_PORTALFILE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	-128(%rbp), %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_Error
LBB0_8:
	movl	(%r15), %esi
	leaq	L_.str.6(%rip), %rdi
	callq	__printf
	movq	_numportals@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	L_.str.7(%rip), %rdi
	callq	__printf
	movq	_numfaces@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.8(%rip), %rdi
	callq	__printf
	movl	(%r15), %eax
	addl	$63, %eax
	movl	%eax, %ecx
	sarl	$3, %ecx
	andl	$-8, %ecx
	movq	_leafbytes@GOTPCREL(%rip), %r12
	movl	%ecx, (%r12)
	sarl	$6, %eax
	movq	_leaflongs@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	(%rbx), %eax
	leal	(%rax,%rax), %ecx
	addl	$63, %ecx
	movl	%ecx, %edx
	sarl	$3, %edx
	andl	$-8, %edx
	movq	_portalbytes@GOTPCREL(%rip), %rsi
	movl	%edx, (%rsi)
	sarl	$6, %ecx
	movq	_portallongs@GOTPCREL(%rip), %rdx
	movl	%ecx, (%rdx)
	imull	$112, %eax, %edi
	callq	_malloc
	movq	_portals@GOTPCREL(%rip), %r14
	movq	%rax, (%r14)
	imull	$112, (%rbx), %edx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	imull	$56, (%r15), %edi
	callq	_malloc
	movq	_leafs@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	imull	$56, (%r15), %edx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_11
## %bb.9:
	movq	_leafs@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	$-1, (%rcx)
	incq	%rdx
	movslq	(%r15), %rax
	addq	$56, %rcx
	cmpq	%rax, %rdx
	jl	LBB0_10
LBB0_11:
	movq	_VIS_HEADER_SIZE@GOTPCREL(%rip), %rcx
	movslq	(%r12), %rdx
	cltq
	imulq	%rax, %rdx
	addq	(%rcx), %rdx
	movq	_numVisBytes@GOTPCREL(%rip), %rcx
	movq	%rdx, (%rcx)
	movq	_visBytes@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, (%rcx)
	movl	(%r12), %eax
	movl	%eax, 4(%rcx)
	movq	_numportals@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_36
## %bb.12:
	movq	(%r14), %r14
	leaq	-152(%rbp), %r13
	movl	$0, -176(%rbp)                  ## 4-byte Folded Spill
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_35:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	-184(%rbp), %rax
	movq	%rax, 84(%r14)
	movl	-136(%rbp), %eax
	movl	%eax, 80(%r14)
	movq	%r13, %rdi
	callq	_SetPortalSphere
	addq	$112, %r14
	movq	_numportals@GOTPCREL(%rip), %rax
	movl	-176(%rbp), %ecx                ## 4-byte Reload
	cmpl	(%rax), %ecx
	movq	_portalclusters@GOTPCREL(%rip), %r15
	leaq	-152(%rbp), %r13
	jge	LBB0_36
LBB0_13:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_24 Depth 2
                                        ##     Child Loop BB0_34 Depth 2
	movq	-200(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rdi
	leaq	L_.str.9(%rip), %rsi
	leaq	-164(%rbp), %rdx
	leaq	-136(%rbp), %rcx
	leaq	-132(%rbp), %r8
	xorl	%eax, %eax
	callq	_fscanf
	cmpl	$3, %eax
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	leaq	L_.str.10(%rip), %rdi
	movl	-176(%rbp), %esi                ## 4-byte Reload
	xorl	%eax, %eax
	callq	_Error
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	-164(%rbp), %eax
	movq	_MAX_POINTS_ON_WINDING@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	leaq	L_.str.11(%rip), %rdi
	movl	-176(%rbp), %esi                ## 4-byte Reload
	xorl	%eax, %eax
	callq	_Error
LBB0_17:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	(%r15), %eax
	cmpl	%eax, -136(%rbp)
	ja	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_13 Depth=1
	cmpl	%eax, -132(%rbp)
	jbe	LBB0_20
LBB0_19:                                ##   in Loop: Header=BB0_13 Depth=1
	leaq	L_.str.10(%rip), %rdi
	movl	-176(%rbp), %esi                ## 4-byte Reload
	xorl	%eax, %eax
	callq	_Error
LBB0_20:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	%rbx, %rdi
	leaq	L_.str.12(%rip), %rsi
	leaq	-188(%rbp), %rdx
	xorl	%eax, %eax
	callq	_fscanf
	cmpl	$1, %eax
	je	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_13 Depth=1
	leaq	L_.str.13(%rip), %rdi
	xorl	%eax, %eax
	callq	_Error
LBB0_22:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	-164(%rbp), %edi
	callq	_NewWinding
	movq	%rax, %r15
	movq	%rax, 40(%r14)
	movl	-164(%rbp), %eax
	movl	%eax, (%r15)
	cmpl	$0, -164(%rbp)
	jle	LBB0_27
## %bb.23:                              ##   in Loop: Header=BB0_13 Depth=1
	xorl	%r12d, %r12d
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_24 Depth=2
	movq	8(%r15), %rax
	movq	(%rax,%r12,8), %rax
	movsd	-160(%rbp), %xmm0               ## xmm0 = mem[0],zero
	movsd	%xmm0, (%rax)
	movsd	-152(%rbp), %xmm0               ## xmm0 = mem[0],zero
	movsd	%xmm0, 8(%rax)
	movsd	-144(%rbp), %xmm0               ## xmm0 = mem[0],zero
	movsd	%xmm0, 16(%rax)
	incq	%r12
	movslq	-164(%rbp), %rax
	cmpq	%rax, %r12
	jge	LBB0_27
LBB0_24:                                ##   Parent Loop BB0_13 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	leaq	L_.str.14(%rip), %rsi
	leaq	-160(%rbp), %rdx
	movq	%r13, %rcx
	leaq	-144(%rbp), %r8
	xorl	%eax, %eax
	callq	_fscanf
	cmpl	$3, %eax
	je	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_24 Depth=2
	leaq	L_.str.10(%rip), %rdi
	movl	-176(%rbp), %esi                ## 4-byte Reload
	xorl	%eax, %eax
	callq	_Error
	jmp	LBB0_26
	.p2align	4, 0x90
LBB0_27:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	%rbx, %rdi
	leaq	L_.str.15(%rip), %rsi
	xorl	%eax, %eax
	callq	_fscanf
	movq	%r15, %rdi
	leaq	-184(%rbp), %rsi
	callq	_PlaneFromWinding
	movq	_leafs@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movslq	-136(%rbp), %rax
	imulq	$56, %rax, %rbx
	leaq	(%rbx,%r13), %r12
	addq	$8, %r12
	movq	8(%r13,%rbx), %rax
	movq	_MAX_PORTALS_ON_LEAF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_29
## %bb.28:                              ##   in Loop: Header=BB0_13 Depth=1
	leaq	L_.str.16(%rip), %rdi
	xorl	%eax, %eax
	callq	_Error
	movq	(%r12), %rax
LBB0_29:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	48(%r13,%rbx), %rcx
	movq	%r14, (%rcx,%rax,8)
	incq	%rax
	movq	%rax, (%r12)
	movl	-176(%rbp), %eax                ## 4-byte Reload
	incl	%eax
	movl	%eax, -176(%rbp)                ## 4-byte Spill
	movl	%eax, 16(%r14)
	movl	-188(%rbp), %eax
	movl	%eax, 20(%r14)
	movq	%r15, 40(%r14)
	movq	_vec3_origin@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-180(%rbp), %esi
	movl	32(%r14), %edx
	callq	_VectorSubtract
	xorl	%eax, %eax
	subl	-184(%rbp), %eax
	movl	%eax, 28(%r14)
	movl	-132(%rbp), %eax
	movl	%eax, 24(%r14)
	movq	%r14, %rdi
	callq	_SetPortalSphere
	leaq	56(%r14), %rax
	movq	%rax, -208(%rbp)                ## 8-byte Spill
	movq	_leafs@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movslq	-132(%rbp), %rax
	imulq	$56, %rax, %rbx
	leaq	(%rbx,%r13), %r12
	addq	$8, %r12
	movq	8(%r13,%rbx), %rax
	movq	_MAX_PORTALS_ON_LEAF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_31
## %bb.30:                              ##   in Loop: Header=BB0_13 Depth=1
	leaq	L_.str.16(%rip), %rdi
	xorl	%eax, %eax
	callq	_Error
	movq	(%r12), %rax
LBB0_31:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	48(%r13,%rbx), %rcx
	movq	-208(%rbp), %r13                ## 8-byte Reload
	movq	%r13, (%rcx,%rax,8)
	incq	%rax
	movq	%rax, (%r12)
	movl	-176(%rbp), %eax                ## 4-byte Reload
	movl	%eax, 72(%r14)
	movl	-188(%rbp), %eax
	movl	%eax, 76(%r14)
	movl	(%r15), %edi
	callq	_NewWinding
	movq	%rax, 96(%r14)
	movl	(%r15), %ecx
	movl	%ecx, (%rax)
	movl	(%r15), %ecx
	testl	%ecx, %ecx
	jle	LBB0_35
## %bb.32:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	8(%r15), %rdx
	decl	%ecx
	movslq	%ecx, %rcx
	movq	(%rdx,%rcx,8), %rdi
	movq	8(%rax), %rax
	movq	(%rax), %rsi
	callq	_VectorCopy
	movl	(%r15), %eax
	cmpl	$2, %eax
	jl	LBB0_35
## %bb.33:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	$1, %ebx
	movl	$-2, %r12d
	.p2align	4, 0x90
LBB0_34:                                ##   Parent Loop BB0_13 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	96(%r14), %rcx
	movq	8(%r15), %rdx
	addl	%r12d, %eax
	cltq
	movq	(%rdx,%rax,8), %rdi
	movq	8(%rcx), %rax
	movq	(%rax,%rbx,8), %rsi
	callq	_VectorCopy
	incq	%rbx
	movslq	(%r15), %rax
	decl	%r12d
	cmpq	%rax, %rbx
	jl	LBB0_34
	jmp	LBB0_35
LBB0_36:
	movq	_numfaces@GOTPCREL(%rip), %rbx
	imull	$112, (%rbx), %edi
	callq	_malloc
	movq	_faces@GOTPCREL(%rip), %r14
	movq	%rax, (%r14)
	imull	$112, (%rbx), %edx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	imull	$56, (%r15), %edi
	callq	_malloc
	movq	_faceleafs@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	imull	$56, (%r15), %edx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	cmpl	$0, (%rbx)
	jle	LBB0_48
## %bb.37:
	movq	(%r14), %r13
	xorl	%r15d, %r15d
	jmp	LBB0_38
	.p2align	4, 0x90
LBB0_47:                                ##   in Loop: Header=BB0_38 Depth=1
	movq	48(%rbx,%r14), %rcx
	movq	%r13, (%rcx,%rax,8)
	incq	%rax
	movq	%rax, (%rdx)
	incl	%r15d
	movl	%r15d, 16(%r13)
	movq	%r12, 40(%r13)
	movq	_vec3_origin@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-180(%rbp), %esi
	movl	32(%r13), %edx
	callq	_VectorSubtract
	xorl	%eax, %eax
	subl	-184(%rbp), %eax
	movl	%eax, 28(%r13)
	movl	$-1, 24(%r13)
	movq	%r13, %rdi
	callq	_SetPortalSphere
	addq	$56, %r13
	movq	_numfaces@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jge	LBB0_48
LBB0_38:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_42 Depth 2
	movq	-200(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rdi
	leaq	L_.str.17(%rip), %rsi
	leaq	-164(%rbp), %rdx
	leaq	-136(%rbp), %rcx
	xorl	%eax, %eax
	callq	_fscanf
	cmpl	$2, %eax
	je	LBB0_40
## %bb.39:                              ##   in Loop: Header=BB0_38 Depth=1
	leaq	L_.str.10(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_Error
LBB0_40:                                ##   in Loop: Header=BB0_38 Depth=1
	movl	-164(%rbp), %edi
	callq	_NewWinding
	movq	%rax, %r12
	movq	%rax, 40(%r13)
	movl	-164(%rbp), %eax
	movl	%eax, (%r12)
	cmpl	$0, -164(%rbp)
	jle	LBB0_45
## %bb.41:                              ##   in Loop: Header=BB0_38 Depth=1
	xorl	%r14d, %r14d
	jmp	LBB0_42
	.p2align	4, 0x90
LBB0_44:                                ##   in Loop: Header=BB0_42 Depth=2
	movq	8(%r12), %rax
	movq	(%rax,%r14,8), %rax
	movsd	-160(%rbp), %xmm0               ## xmm0 = mem[0],zero
	movsd	%xmm0, (%rax)
	movsd	-152(%rbp), %xmm0               ## xmm0 = mem[0],zero
	movsd	%xmm0, 8(%rax)
	movsd	-144(%rbp), %xmm0               ## xmm0 = mem[0],zero
	movsd	%xmm0, 16(%rax)
	incq	%r14
	movslq	-164(%rbp), %rax
	cmpq	%rax, %r14
	jge	LBB0_45
LBB0_42:                                ##   Parent Loop BB0_38 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	leaq	L_.str.14(%rip), %rsi
	leaq	-160(%rbp), %rdx
	leaq	-152(%rbp), %rcx
	leaq	-144(%rbp), %r8
	xorl	%eax, %eax
	callq	_fscanf
	cmpl	$3, %eax
	je	LBB0_44
## %bb.43:                              ##   in Loop: Header=BB0_42 Depth=2
	leaq	L_.str.10(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_Error
	jmp	LBB0_44
	.p2align	4, 0x90
LBB0_45:                                ##   in Loop: Header=BB0_38 Depth=1
	movq	%rbx, %rdi
	leaq	L_.str.15(%rip), %rsi
	xorl	%eax, %eax
	callq	_fscanf
	movq	%r12, %rdi
	leaq	-184(%rbp), %rsi
	callq	_PlaneFromWinding
	movq	_faceleafs@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movslq	-136(%rbp), %rax
	imulq	$56, %rax, %r14
	movl	$-1, (%rbx,%r14)
	leaq	(%rbx,%r14), %rdx
	addq	$8, %rdx
	movq	8(%rbx,%r14), %rax
	movq	_MAX_PORTALS_ON_LEAF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_47
## %bb.46:                              ##   in Loop: Header=BB0_38 Depth=1
	leaq	L_.str.18(%rip), %rdi
	xorl	%eax, %eax
	movq	%rdx, -176(%rbp)                ## 8-byte Spill
	callq	_Error
	movq	-176(%rbp), %rdx                ## 8-byte Reload
	movq	(%rdx), %rax
	jmp	LBB0_47
LBB0_48:
	movq	-200(%rbp), %rdi                ## 8-byte Reload
	callq	_fclose
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_50
## %bb.49:
	addq	$168, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_50:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"-"

	.comm	_stdin,8,3                      ## @stdin
L_.str.1:                               ## @.str.1
	.asciz	"r"

L_.str.2:                               ## @.str.2
	.asciz	"LoadPortals: couldn't read %s\n"

L_.str.3:                               ## @.str.3
	.asciz	"%79s\n%i\n%i\n%i\n"

	.comm	_portalclusters,4,2             ## @portalclusters
	.comm	_numportals,4,2                 ## @numportals
	.comm	_numfaces,4,2                   ## @numfaces
L_.str.4:                               ## @.str.4
	.asciz	"LoadPortals: failed to read header"

	.comm	_PORTALFILE,8,3                 ## @PORTALFILE
L_.str.5:                               ## @.str.5
	.asciz	"LoadPortals: not a portal file"

L_.str.6:                               ## @.str.6
	.asciz	"%6i portalclusters\n"

L_.str.7:                               ## @.str.7
	.asciz	"%6i numportals\n"

L_.str.8:                               ## @.str.8
	.asciz	"%6i numfaces\n"

	.comm	_leafbytes,4,2                  ## @leafbytes
	.comm	_leaflongs,4,2                  ## @leaflongs
	.comm	_portalbytes,4,2                ## @portalbytes
	.comm	_portallongs,4,2                ## @portallongs
	.comm	_portals,8,3                    ## @portals
	.comm	_leafs,8,3                      ## @leafs
	.comm	_VIS_HEADER_SIZE,8,3            ## @VIS_HEADER_SIZE
	.comm	_numVisBytes,8,3                ## @numVisBytes
	.comm	_visBytes,8,3                   ## @visBytes
L_.str.9:                               ## @.str.9
	.asciz	"%i %i %i "

L_.str.10:                              ## @.str.10
	.asciz	"LoadPortals: reading portal %i"

	.comm	_MAX_POINTS_ON_WINDING,4,2      ## @MAX_POINTS_ON_WINDING
L_.str.11:                              ## @.str.11
	.asciz	"LoadPortals: portal %i has too many points"

L_.str.12:                              ## @.str.12
	.asciz	"%i "

L_.str.13:                              ## @.str.13
	.asciz	"LoadPortals: reading hint state"

L_.str.14:                              ## @.str.14
	.asciz	"(%lf %lf %lf ) "

L_.str.15:                              ## @.str.15
	.asciz	"\n"

	.comm	_MAX_PORTALS_ON_LEAF,8,3        ## @MAX_PORTALS_ON_LEAF
L_.str.16:                              ## @.str.16
	.asciz	"Leaf with too many portals"

	.comm	_vec3_origin,4,2                ## @vec3_origin
	.comm	_faces,8,3                      ## @faces
	.comm	_faceleafs,8,3                  ## @faceleafs
L_.str.17:                              ## @.str.17
	.asciz	"%i %i "

L_.str.18:                              ## @.str.18
	.asciz	"Leaf with too many faces"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LoadPortals                    ; -- Begin function LoadPortals
	.p2align	2
_LoadPortals:                           ; @LoadPortals
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #288
	.cfi_def_cfa_offset 288
	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
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-96]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_3
; %bb.1:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_fopen
	mov	x19, x0
	cbnz	x0, LBB0_4
; %bb.2:
	str	x20, [sp]
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_Error
	b	LBB0_4
LBB0_3:
Lloh9:
	adrp	x8, _stdin@GOTPAGE
Lloh10:
	ldr	x8, [x8, _stdin@GOTPAGEOFF]
Lloh11:
	ldr	x19, [x8]
LBB0_4:
Lloh12:
	adrp	x8, _numfaces@GOTPAGE
Lloh13:
	ldr	x8, [x8, _numfaces@GOTPAGEOFF]
Lloh14:
	adrp	x9, _numportals@GOTPAGE
Lloh15:
	ldr	x9, [x9, _numportals@GOTPAGEOFF]
	stp	x9, x8, [sp, #16]
Lloh16:
	adrp	x23, _portalclusters@GOTPAGE
Lloh17:
	ldr	x23, [x23, _portalclusters@GOTPAGEOFF]
	add	x8, sp, #96
	stp	x8, x23, [sp]
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_fscanf
	cmp	w0, #4
	b.eq	LBB0_6
; %bb.5:
Lloh20:
	adrp	x0, l_.str.4@PAGE
Lloh21:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_Error
LBB0_6:
Lloh22:
	adrp	x8, _PORTALFILE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _PORTALFILE@GOTPAGEOFF]
Lloh24:
	ldr	x1, [x8]
	add	x0, sp, #96
	bl	_strcmp
	cbz	x0, LBB0_8
; %bb.7:
Lloh25:
	adrp	x0, l_.str.5@PAGE
Lloh26:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_Error
LBB0_8:
	ldr	w1, [x23]
Lloh27:
	adrp	x0, l_.str.6@PAGE
Lloh28:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	__printf
Lloh29:
	adrp	x24, _numportals@GOTPAGE
Lloh30:
	ldr	x24, [x24, _numportals@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh31:
	adrp	x0, l_.str.7@PAGE
Lloh32:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	__printf
Lloh33:
	adrp	x8, _numfaces@GOTPAGE
Lloh34:
	ldr	x8, [x8, _numfaces@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
Lloh36:
	adrp	x0, l_.str.8@PAGE
Lloh37:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	__printf
	ldr	w8, [x23]
	add	w8, w8, #63
	asr	w9, w8, #3
	and	w9, w9, #0xfffffff8
Lloh38:
	adrp	x20, _leafbytes@GOTPAGE
Lloh39:
	ldr	x20, [x20, _leafbytes@GOTPAGEOFF]
	str	w9, [x20]
	asr	w8, w8, #6
Lloh40:
	adrp	x9, _leaflongs@GOTPAGE
Lloh41:
	ldr	x9, [x9, _leaflongs@GOTPAGEOFF]
Lloh42:
	str	w8, [x9]
	ldr	w8, [x24]
	lsl	w9, w8, #1
	add	w9, w9, #63
	asr	w10, w9, #3
	and	w10, w10, #0xfffffff8
Lloh43:
	adrp	x11, _portalbytes@GOTPAGE
Lloh44:
	ldr	x11, [x11, _portalbytes@GOTPAGEOFF]
Lloh45:
	str	w10, [x11]
	asr	w9, w9, #6
Lloh46:
	adrp	x10, _portallongs@GOTPAGE
Lloh47:
	ldr	x10, [x10, _portallongs@GOTPAGEOFF]
Lloh48:
	str	w9, [x10]
	mov	w21, #112
	mul	w0, w8, w21
	bl	_malloc
Lloh49:
	adrp	x22, _portals@GOTPAGE
Lloh50:
	ldr	x22, [x22, _portals@GOTPAGEOFF]
	str	x0, [x22]
	ldr	w8, [x24]
	mul	w2, w8, w21
	mov	w1, #0
	bl	_memset
	ldr	w8, [x23]
	mov	w21, #56
	mul	w0, w8, w21
	bl	_malloc
Lloh51:
	adrp	x26, _leafs@GOTPAGE
Lloh52:
	ldr	x26, [x26, _leafs@GOTPAGEOFF]
	str	x0, [x26]
	ldr	w8, [x23]
	mul	w2, w8, w21
	mov	w1, #0
	bl	_memset
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.9:
	mov	x8, #0
	ldr	x9, [x26]
	mov	w10, #-1
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	str	w10, [x9], #56
	add	x8, x8, #1
	ldrsw	x11, [x23]
	cmp	x8, x11
	b.lt	LBB0_10
; %bb.11:
	mov	x8, x11
LBB0_12:
Lloh53:
	adrp	x9, _VIS_HEADER_SIZE@GOTPAGE
Lloh54:
	ldr	x9, [x9, _VIS_HEADER_SIZE@GOTPAGEOFF]
Lloh55:
	ldr	x9, [x9]
	ldrsw	x10, [x20]
	sxtw	x11, w8
	madd	x9, x10, x11, x9
Lloh56:
	adrp	x10, _numVisBytes@GOTPAGE
Lloh57:
	ldr	x10, [x10, _numVisBytes@GOTPAGEOFF]
Lloh58:
	str	x9, [x10]
Lloh59:
	adrp	x9, _visBytes@GOTPAGE
Lloh60:
	ldr	x9, [x9, _visBytes@GOTPAGEOFF]
Lloh61:
	ldr	x9, [x9]
	str	w8, [x9]
	ldr	w8, [x20]
	str	w8, [x9, #4]
Lloh62:
	adrp	x8, _numportals@GOTPAGE
Lloh63:
	ldr	x8, [x8, _numportals@GOTPAGEOFF]
Lloh64:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_36
; %bb.13:
	mov	w21, #0
	add	x8, sp, #88
	ldr	x20, [x22]
	add	x8, x8, #4
	str	x8, [sp, #40]                   ; 8-byte Folded Spill
	add	x8, sp, #64
	add	x27, x8, #8
	add	x24, x8, #16
Lloh65:
	adrp	x25, l_.str.14@PAGE
Lloh66:
	add	x25, x25, l_.str.14@PAGEOFF
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	ldr	x8, [sp, #48]
	stur	x8, [x20, #84]
	ldr	w8, [sp, #88]
	str	w8, [x20, #80]
	mov	x0, x28
	bl	_SetPortalSphere
	add	x20, x20, #112
Lloh67:
	adrp	x8, _numportals@GOTPAGE
Lloh68:
	ldr	x8, [x8, _numportals@GOTPAGEOFF]
Lloh69:
	ldr	w8, [x8]
	cmp	w21, w8
Lloh70:
	adrp	x23, _portalclusters@GOTPAGE
Lloh71:
	ldr	x23, [x23, _portalclusters@GOTPAGEOFF]
Lloh72:
	adrp	x26, _leafs@GOTPAGE
Lloh73:
	ldr	x26, [x26, _leafs@GOTPAGEOFF]
	b.ge	LBB0_36
LBB0_15:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_26 Depth 2
                                        ;     Child Loop BB0_35 Depth 2
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	add	x8, sp, #88
	stp	x8, x9, [sp, #8]
	add	x8, sp, #56
	str	x8, [sp]
	mov	x0, x19
Lloh74:
	adrp	x1, l_.str.9@PAGE
Lloh75:
	add	x1, x1, l_.str.9@PAGEOFF
	bl	_fscanf
	cmp	w0, #3
	b.eq	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x8, x21
	str	x8, [sp]
Lloh76:
	adrp	x0, l_.str.10@PAGE
Lloh77:
	add	x0, x0, l_.str.10@PAGEOFF
	bl	_Error
LBB0_17:                                ;   in Loop: Header=BB0_15 Depth=1
	ldr	w8, [sp, #56]
Lloh78:
	adrp	x9, _MAX_POINTS_ON_WINDING@GOTPAGE
Lloh79:
	ldr	x9, [x9, _MAX_POINTS_ON_WINDING@GOTPAGEOFF]
Lloh80:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x8, x21
	str	x8, [sp]
Lloh81:
	adrp	x0, l_.str.11@PAGE
Lloh82:
	add	x0, x0, l_.str.11@PAGEOFF
	bl	_Error
LBB0_19:                                ;   in Loop: Header=BB0_15 Depth=1
	ldr	w8, [x23]
	ldp	w9, w10, [sp, #88]
	cmp	w9, w8
	ccmp	w10, w8, #2, ls
	b.ls	LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x8, x21
	str	x8, [sp]
Lloh83:
	adrp	x0, l_.str.10@PAGE
Lloh84:
	add	x0, x0, l_.str.10@PAGEOFF
	bl	_Error
LBB0_21:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x8, sp, #60
	str	x8, [sp]
	mov	x0, x19
Lloh85:
	adrp	x1, l_.str.12@PAGE
Lloh86:
	add	x1, x1, l_.str.12@PAGEOFF
	bl	_fscanf
	cmp	w0, #1
	add	x23, sp, #64
	b.eq	LBB0_23
; %bb.22:                               ;   in Loop: Header=BB0_15 Depth=1
Lloh87:
	adrp	x0, l_.str.13@PAGE
Lloh88:
	add	x0, x0, l_.str.13@PAGEOFF
	bl	_Error
LBB0_23:                                ;   in Loop: Header=BB0_15 Depth=1
	ldr	w0, [sp, #56]
	bl	_NewWinding
	mov	x22, x0
	str	x0, [x20, #40]
	ldr	w8, [sp, #56]
	str	w8, [x0]
	ldr	w8, [sp, #56]
	cmp	w8, #1
	b.lt	LBB0_28
; %bb.24:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x28, #0
	b	LBB0_26
LBB0_25:                                ;   in Loop: Header=BB0_26 Depth=2
	ldr	x8, [x22, #8]
	ldr	x8, [x8, x28, lsl #3]
	ldr	d0, [sp, #64]
	str	d0, [x8]
	ldr	d0, [sp, #72]
	str	d0, [x8, #8]
	ldr	d0, [sp, #80]
	str	d0, [x8, #16]
	add	x28, x28, #1
	ldrsw	x8, [sp, #56]
	cmp	x28, x8
	b.ge	LBB0_28
LBB0_26:                                ;   Parent Loop BB0_15 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	stp	x27, x24, [sp, #8]
	str	x23, [sp]
	mov	x0, x19
	mov	x1, x25
	bl	_fscanf
	cmp	w0, #3
	b.eq	LBB0_25
; %bb.27:                               ;   in Loop: Header=BB0_26 Depth=2
	str	x21, [sp]
Lloh89:
	adrp	x0, l_.str.10@PAGE
Lloh90:
	add	x0, x0, l_.str.10@PAGEOFF
	bl	_Error
	b	LBB0_25
LBB0_28:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x19
Lloh91:
	adrp	x1, l_.str.15@PAGE
Lloh92:
	add	x1, x1, l_.str.15@PAGEOFF
	bl	_fscanf
	add	x1, sp, #48
	mov	x0, x22
	bl	_PlaneFromWinding
	ldr	x26, [x26]
	ldrsw	x28, [sp, #88]
	mov	w8, #56
	madd	x23, x28, x8, x26
	ldr	x8, [x23, #8]!
Lloh93:
	adrp	x9, _MAX_PORTALS_ON_LEAF@GOTPAGE
Lloh94:
	ldr	x9, [x9, _MAX_PORTALS_ON_LEAF@GOTPAGEOFF]
Lloh95:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_30
; %bb.29:                               ;   in Loop: Header=BB0_15 Depth=1
Lloh96:
	adrp	x0, l_.str.16@PAGE
Lloh97:
	add	x0, x0, l_.str.16@PAGEOFF
	bl	_Error
	ldr	x8, [x23]
LBB0_30:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	w9, #56
	madd	x9, x28, x9, x26
	ldr	x9, [x9, #48]
	str	x20, [x9, x8, lsl #3]
	add	x8, x8, #1
	str	x8, [x23]
	add	w21, w21, #1
	ldr	w8, [sp, #60]
	stp	w21, w8, [x20, #16]
	str	x22, [x20, #40]
Lloh98:
	adrp	x8, _vec3_origin@GOTPAGE
Lloh99:
	ldr	x8, [x8, _vec3_origin@GOTPAGEOFF]
Lloh100:
	ldr	w0, [x8]
	ldr	w1, [sp, #52]
	ldr	w2, [x20, #32]
	bl	_VectorSubtract
	ldr	w8, [sp, #48]
	neg	w8, w8
	ldr	w9, [sp, #92]
	stp	w9, w8, [x20, #24]
	mov	x0, x20
	bl	_SetPortalSphere
Lloh101:
	adrp	x8, _leafs@GOTPAGE
Lloh102:
	ldr	x8, [x8, _leafs@GOTPAGEOFF]
Lloh103:
	ldr	x26, [x8]
	ldrsw	x28, [sp, #92]
	mov	w8, #56
	madd	x23, x28, x8, x26
	ldr	x8, [x23, #8]!
Lloh104:
	adrp	x9, _MAX_PORTALS_ON_LEAF@GOTPAGE
Lloh105:
	ldr	x9, [x9, _MAX_PORTALS_ON_LEAF@GOTPAGEOFF]
Lloh106:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_32
; %bb.31:                               ;   in Loop: Header=BB0_15 Depth=1
Lloh107:
	adrp	x0, l_.str.16@PAGE
Lloh108:
	add	x0, x0, l_.str.16@PAGEOFF
	bl	_Error
	ldr	x8, [x23]
LBB0_32:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x10, x20, #56
	mov	w9, #56
	madd	x9, x28, x9, x26
	mov	x28, x10
	ldr	x9, [x9, #48]
	str	x10, [x9, x8, lsl #3]
	add	x8, x8, #1
	str	x8, [x23]
	ldr	w8, [sp, #60]
	stp	w21, w8, [x20, #72]
	ldr	w0, [x22]
	bl	_NewWinding
	str	x0, [x20, #96]
	ldr	w8, [x22]
	str	w8, [x0]
	ldr	w8, [x22]
	subs	w8, w8, #1
	b.lt	LBB0_14
; %bb.33:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	x9, [x22, #8]
	ldr	x8, [x9, w8, sxtw #3]
	ldr	x9, [x0, #8]
	ldr	x1, [x9]
	mov	x0, x8
	bl	_VectorCopy
	ldr	w8, [x22]
	cmp	w8, #2
	b.lt	LBB0_14
; %bb.34:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	w23, #-2
	mov	w26, #1
LBB0_35:                                ;   Parent Loop BB0_15 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x9, [x20, #96]
	ldr	x10, [x22, #8]
	add	w8, w8, w23
	ldr	x0, [x10, w8, sxtw #3]
	ldr	x8, [x9, #8]
	ldr	x1, [x8, x26, lsl #3]
	bl	_VectorCopy
	add	x26, x26, #1
	ldrsw	x8, [x22]
	sub	w23, w23, #1
	cmp	x26, x8
	b.lt	LBB0_35
	b	LBB0_14
LBB0_36:
Lloh109:
	adrp	x22, _numfaces@GOTPAGE
Lloh110:
	ldr	x22, [x22, _numfaces@GOTPAGEOFF]
	ldr	w8, [x22]
	mov	w21, #112
	mul	w0, w8, w21
	bl	_malloc
Lloh111:
	adrp	x20, _faces@GOTPAGE
Lloh112:
	ldr	x20, [x20, _faces@GOTPAGEOFF]
	str	x0, [x20]
	ldr	w8, [x22]
	mul	w2, w8, w21
	mov	w1, #0
	bl	_memset
	ldr	w8, [x23]
	mov	w21, #56
	mul	w0, w8, w21
	bl	_malloc
Lloh113:
	adrp	x8, _faceleafs@GOTPAGE
Lloh114:
	ldr	x8, [x8, _faceleafs@GOTPAGEOFF]
Lloh115:
	str	x0, [x8]
	ldr	w8, [x23]
	mul	w2, w8, w21
	mov	w1, #0
	bl	_memset
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_48
; %bb.37:
	mov	w28, #0
	add	x23, sp, #64
	ldr	x20, [x20]
	add	x27, x23, #8
	add	x21, x23, #16
Lloh116:
	adrp	x22, l_.str.14@PAGE
Lloh117:
	add	x22, x22, l_.str.14@PAGEOFF
Lloh118:
	adrp	x25, l_.str.10@PAGE
Lloh119:
	add	x25, x25, l_.str.10@PAGEOFF
	b	LBB0_39
LBB0_38:                                ;   in Loop: Header=BB0_39 Depth=1
	mov	w9, #56
	madd	x9, x25, x9, x23
	ldr	x9, [x9, #48]
	str	x20, [x9, x8, lsl #3]
	add	x8, x8, #1
	str	x8, [x24]
	add	w28, w28, #1
	str	w28, [x20, #16]
	str	x26, [x20, #40]
Lloh120:
	adrp	x8, _vec3_origin@GOTPAGE
Lloh121:
	ldr	x8, [x8, _vec3_origin@GOTPAGEOFF]
Lloh122:
	ldr	w0, [x8]
	ldr	w1, [sp, #52]
	ldr	w2, [x20, #32]
	bl	_VectorSubtract
	ldr	w8, [sp, #48]
	neg	w8, w8
	str	w8, [x20, #28]
	mov	w8, #-1
	str	w8, [x20, #24]
	mov	x0, x20
	bl	_SetPortalSphere
	add	x20, x20, #56
Lloh123:
	adrp	x8, _numfaces@GOTPAGE
Lloh124:
	ldr	x8, [x8, _numfaces@GOTPAGEOFF]
Lloh125:
	ldr	w8, [x8]
	cmp	w28, w8
	add	x23, sp, #64
Lloh126:
	adrp	x25, l_.str.10@PAGE
Lloh127:
	add	x25, x25, l_.str.10@PAGEOFF
	b.ge	LBB0_48
LBB0_39:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_44 Depth 2
	add	x8, sp, #88
	str	x8, [sp, #8]
	add	x8, sp, #56
	str	x8, [sp]
	mov	x0, x19
Lloh128:
	adrp	x1, l_.str.17@PAGE
Lloh129:
	add	x1, x1, l_.str.17@PAGEOFF
	bl	_fscanf
	cmp	w0, #2
	b.eq	LBB0_41
; %bb.40:                               ;   in Loop: Header=BB0_39 Depth=1
	mov	x8, x28
	str	x8, [sp]
	mov	x0, x25
	bl	_Error
LBB0_41:                                ;   in Loop: Header=BB0_39 Depth=1
	ldr	w0, [sp, #56]
	bl	_NewWinding
	mov	x26, x0
	str	x0, [x20, #40]
	ldr	w8, [sp, #56]
	str	w8, [x0]
	ldr	w8, [sp, #56]
	cmp	w8, #1
	b.lt	LBB0_46
; %bb.42:                               ;   in Loop: Header=BB0_39 Depth=1
	mov	x24, #0
	b	LBB0_44
LBB0_43:                                ;   in Loop: Header=BB0_44 Depth=2
	ldr	x8, [x26, #8]
	ldr	x8, [x8, x24, lsl #3]
	ldr	d0, [sp, #64]
	str	d0, [x8]
	ldr	d0, [sp, #72]
	str	d0, [x8, #8]
	ldr	d0, [sp, #80]
	str	d0, [x8, #16]
	add	x24, x24, #1
	ldrsw	x8, [sp, #56]
	cmp	x24, x8
	b.ge	LBB0_46
LBB0_44:                                ;   Parent Loop BB0_39 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	stp	x27, x21, [sp, #8]
	str	x23, [sp]
	mov	x0, x19
	mov	x1, x22
	bl	_fscanf
	cmp	w0, #3
	b.eq	LBB0_43
; %bb.45:                               ;   in Loop: Header=BB0_44 Depth=2
	str	x28, [sp]
	mov	x0, x25
	bl	_Error
	b	LBB0_43
LBB0_46:                                ;   in Loop: Header=BB0_39 Depth=1
	mov	x0, x19
Lloh130:
	adrp	x1, l_.str.15@PAGE
Lloh131:
	add	x1, x1, l_.str.15@PAGEOFF
	bl	_fscanf
	add	x1, sp, #48
	mov	x0, x26
	bl	_PlaneFromWinding
Lloh132:
	adrp	x8, _faceleafs@GOTPAGE
Lloh133:
	ldr	x8, [x8, _faceleafs@GOTPAGEOFF]
Lloh134:
	ldr	x23, [x8]
	ldrsw	x25, [sp, #88]
	mov	w8, #56
	mul	x8, x25, x8
	add	x24, x23, x8
	mov	w9, #-1
	str	w9, [x23, x8]
	ldr	x8, [x24, #8]!
Lloh135:
	adrp	x9, _MAX_PORTALS_ON_LEAF@GOTPAGE
Lloh136:
	ldr	x9, [x9, _MAX_PORTALS_ON_LEAF@GOTPAGEOFF]
Lloh137:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_38
; %bb.47:                               ;   in Loop: Header=BB0_39 Depth=1
Lloh138:
	adrp	x0, l_.str.18@PAGE
Lloh139:
	add	x0, x0, l_.str.18@PAGEOFF
	bl	_Error
	ldr	x8, [x24]
	b	LBB0_38
LBB0_48:
	mov	x0, x19
	bl	_fclose
	ldur	x8, [x29, #-96]
Lloh140:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh141:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh142:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_50
; %bb.49:
	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
	add	sp, sp, #288
	ret
LBB0_50:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh51, Lloh52
	.loh AdrpLdrGot	Lloh49, Lloh50
	.loh AdrpLdrGotStr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotStr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotStr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh62, Lloh63, Lloh64
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh61
	.loh AdrpLdrGotStr	Lloh56, Lloh57, Lloh58
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpAdd	Lloh65, Lloh66
	.loh AdrpLdrGot	Lloh72, Lloh73
	.loh AdrpLdrGot	Lloh70, Lloh71
	.loh AdrpLdrGotLdr	Lloh67, Lloh68, Lloh69
	.loh AdrpAdd	Lloh74, Lloh75
	.loh AdrpAdd	Lloh76, Lloh77
	.loh AdrpLdrGotLdr	Lloh78, Lloh79, Lloh80
	.loh AdrpAdd	Lloh81, Lloh82
	.loh AdrpAdd	Lloh83, Lloh84
	.loh AdrpAdd	Lloh85, Lloh86
	.loh AdrpAdd	Lloh87, Lloh88
	.loh AdrpAdd	Lloh89, Lloh90
	.loh AdrpLdrGotLdr	Lloh93, Lloh94, Lloh95
	.loh AdrpAdd	Lloh91, Lloh92
	.loh AdrpAdd	Lloh96, Lloh97
	.loh AdrpLdrGotLdr	Lloh104, Lloh105, Lloh106
	.loh AdrpLdrGotLdr	Lloh101, Lloh102, Lloh103
	.loh AdrpLdrGotLdr	Lloh98, Lloh99, Lloh100
	.loh AdrpAdd	Lloh107, Lloh108
	.loh AdrpLdrGotStr	Lloh113, Lloh114, Lloh115
	.loh AdrpLdrGot	Lloh111, Lloh112
	.loh AdrpLdrGot	Lloh109, Lloh110
	.loh AdrpAdd	Lloh118, Lloh119
	.loh AdrpAdd	Lloh116, Lloh117
	.loh AdrpAdd	Lloh126, Lloh127
	.loh AdrpLdrGotLdr	Lloh123, Lloh124, Lloh125
	.loh AdrpLdrGotLdr	Lloh120, Lloh121, Lloh122
	.loh AdrpAdd	Lloh128, Lloh129
	.loh AdrpLdrGotLdr	Lloh135, Lloh136, Lloh137
	.loh AdrpLdrGotLdr	Lloh132, Lloh133, Lloh134
	.loh AdrpAdd	Lloh130, Lloh131
	.loh AdrpAdd	Lloh138, Lloh139
	.loh AdrpLdrGotLdr	Lloh140, Lloh141, Lloh142
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"-"

	.comm	_stdin,8,3                      ; @stdin
l_.str.1:                               ; @.str.1
	.asciz	"r"

l_.str.2:                               ; @.str.2
	.asciz	"LoadPortals: couldn't read %s\n"

l_.str.3:                               ; @.str.3
	.asciz	"%79s\n%i\n%i\n%i\n"

	.comm	_portalclusters,4,2             ; @portalclusters
	.comm	_numportals,4,2                 ; @numportals
	.comm	_numfaces,4,2                   ; @numfaces
l_.str.4:                               ; @.str.4
	.asciz	"LoadPortals: failed to read header"

	.comm	_PORTALFILE,8,3                 ; @PORTALFILE
l_.str.5:                               ; @.str.5
	.asciz	"LoadPortals: not a portal file"

l_.str.6:                               ; @.str.6
	.asciz	"%6i portalclusters\n"

l_.str.7:                               ; @.str.7
	.asciz	"%6i numportals\n"

l_.str.8:                               ; @.str.8
	.asciz	"%6i numfaces\n"

	.comm	_leafbytes,4,2                  ; @leafbytes
	.comm	_leaflongs,4,2                  ; @leaflongs
	.comm	_portalbytes,4,2                ; @portalbytes
	.comm	_portallongs,4,2                ; @portallongs
	.comm	_portals,8,3                    ; @portals
	.comm	_leafs,8,3                      ; @leafs
	.comm	_VIS_HEADER_SIZE,8,3            ; @VIS_HEADER_SIZE
	.comm	_numVisBytes,8,3                ; @numVisBytes
	.comm	_visBytes,8,3                   ; @visBytes
l_.str.9:                               ; @.str.9
	.asciz	"%i %i %i "

l_.str.10:                              ; @.str.10
	.asciz	"LoadPortals: reading portal %i"

	.comm	_MAX_POINTS_ON_WINDING,4,2      ; @MAX_POINTS_ON_WINDING
l_.str.11:                              ; @.str.11
	.asciz	"LoadPortals: portal %i has too many points"

l_.str.12:                              ; @.str.12
	.asciz	"%i "

l_.str.13:                              ; @.str.13
	.asciz	"LoadPortals: reading hint state"

l_.str.14:                              ; @.str.14
	.asciz	"(%lf %lf %lf ) "

l_.str.15:                              ; @.str.15
	.asciz	"\n"

	.comm	_MAX_PORTALS_ON_LEAF,8,3        ; @MAX_PORTALS_ON_LEAF
l_.str.16:                              ; @.str.16
	.asciz	"Leaf with too many portals"

	.comm	_vec3_origin,4,2                ; @vec3_origin
	.comm	_faces,8,3                      ; @faces
	.comm	_faceleafs,8,3                  ; @faceleafs
l_.str.17:                              ; @.str.17
	.asciz	"%i %i "

l_.str.18:                              ; @.str.18
	.asciz	"Leaf with too many faces"

.subsections_via_symbols
