	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_VS_LoadPortals                 ## -- Begin function VS_LoadPortals
	.p2align	4, 0x90
_VS_LoadPortals:                        ## @VS_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), %rcx
	movq	_numportals@GOTPCREL(%rip), %r8
	movq	_numfaces@GOTPCREL(%rip), %r14
	leaq	-128(%rbp), %rdx
	movq	%rbx, -192(%rbp)                ## 8-byte Spill
	movq	%rbx, %rdi
	movq	%r14, %r9
	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	_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:
	movq	_portalclusters@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	L_.str.6(%rip), %rdi
	callq	__printf
	movq	_numportals@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.7(%rip), %rdi
	callq	__printf
	movl	(%r14), %esi
	leaq	L_.str.8(%rip), %rdi
	callq	__printf
	movq	_MAX_CLUSTERS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	cmpl	%esi, (%rbx)
	jl	LBB0_10
## %bb.9:
	leaq	L_.str.9(%rip), %rdi
	xorl	%eax, %eax
	callq	_Error
LBB0_10:
	movq	_numportals@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	shll	$4, %eax
	leal	(%rax,%rax,4), %edi
	callq	_malloc
	movq	_portals@GOTPCREL(%rip), %r14
	movq	%rax, (%r14)
	movl	(%r15), %ecx
	shll	$4, %ecx
	leal	(%rcx,%rcx,4), %edx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	movq	_portalclusters@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	shll	$3, %eax
	leal	(%rax,%rax,4), %edi
	callq	_malloc
	movq	_leafs@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movl	(%rbx), %ecx
	shll	$3, %ecx
	leal	(%rcx,%rcx,4), %edx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	cmpl	$0, (%r15)
	jle	LBB0_35
## %bb.11:
	movq	(%r14), %r12
	xorl	%r15d, %r15d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_34:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	-184(%rbp), %rax
	movq	%rax, 52(%r12)
	movl	-136(%rbp), %eax
	movl	%eax, 48(%r12)
	movq	-176(%rbp), %rdi                ## 8-byte Reload
	callq	_VS_SetPortalSphere
	addq	$80, %r12
	incl	%r15d
	movq	_numportals@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jge	LBB0_35
LBB0_12:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_23 Depth 2
                                        ##     Child Loop BB0_33 Depth 2
	movq	-192(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rdi
	leaq	L_.str.10(%rip), %rsi
	leaq	-164(%rbp), %rdx
	leaq	-136(%rbp), %rcx
	leaq	-132(%rbp), %r8
	xorl	%eax, %eax
	callq	_fscanf
	cmpl	$3, %eax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	leaq	L_.str.11(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_Error
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=1
	movl	-164(%rbp), %eax
	movq	_MAX_POINTS_ON_WINDING@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_12 Depth=1
	leaq	L_.str.12(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_Error
LBB0_16:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	_portalclusters@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, -136(%rbp)
	ja	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpl	%eax, -132(%rbp)
	jbe	LBB0_19
LBB0_18:                                ##   in Loop: Header=BB0_12 Depth=1
	leaq	L_.str.11(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_Error
LBB0_19:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	%rbx, %rdi
	leaq	L_.str.13(%rip), %rsi
	leaq	-204(%rbp), %rdx
	xorl	%eax, %eax
	callq	_fscanf
	cmpl	$1, %eax
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_12 Depth=1
	leaq	L_.str.14(%rip), %rdi
	xorl	%eax, %eax
	callq	_Error
LBB0_21:                                ##   in Loop: Header=BB0_12 Depth=1
	movl	-164(%rbp), %edi
	callq	_VS_AllocWinding
	movq	%rax, %r13
	movq	%rax, 24(%r12)
	movl	-164(%rbp), %eax
	movl	%eax, (%r13)
	cmpl	$0, -164(%rbp)
	jle	LBB0_26
## %bb.22:                              ##   in Loop: Header=BB0_12 Depth=1
	xorl	%r14d, %r14d
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_23 Depth=2
	movq	8(%r13), %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_26
LBB0_23:                                ##   Parent Loop BB0_12 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	leaq	L_.str.15(%rip), %rsi
	leaq	-160(%rbp), %rdx
	leaq	-152(%rbp), %rcx
	leaq	-144(%rbp), %r8
	xorl	%eax, %eax
	callq	_fscanf
	cmpl	$3, %eax
	je	LBB0_25
## %bb.24:                              ##   in Loop: Header=BB0_23 Depth=2
	leaq	L_.str.11(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_Error
	jmp	LBB0_25
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	%rbx, %rdi
	leaq	L_.str.16(%rip), %rsi
	xorl	%eax, %eax
	callq	_fscanf
	movq	%r13, %rdi
	leaq	-184(%rbp), %rsi
	callq	_VS_PlaneFromWinding
	movq	_leafs@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movslq	-136(%rbp), %rax
	leaq	(%rax,%rax,4), %r14
	leaq	(%rbx,%r14,8), %rdx
	movq	(%rbx,%r14,8), %rax
	movq	_MAX_PORTALS_ON_LEAF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_12 Depth=1
	leaq	L_.str.17(%rip), %rdi
	xorl	%eax, %eax
	movq	%rdx, -176(%rbp)                ## 8-byte Spill
	callq	_Error
	movq	-176(%rbp), %rdx                ## 8-byte Reload
	movq	(%rdx), %rax
LBB0_28:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	32(%rbx,%r14,8), %rcx
	movq	%r12, (%rcx,%rax,8)
	incq	%rax
	movq	%rax, (%rdx)
	movq	%r13, 24(%r12)
	movq	_vec3_origin@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-180(%rbp), %esi
	movl	16(%r12), %edx
	callq	_VectorSubtract
	xorl	%eax, %eax
	subl	-184(%rbp), %eax
	movl	%eax, 12(%r12)
	movl	-132(%rbp), %eax
	movl	%eax, 8(%r12)
	movq	%r12, %rdi
	callq	_VS_SetPortalSphere
	leaq	40(%r12), %rdx
	movq	_leafs@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movslq	-132(%rbp), %rax
	leaq	(%rax,%rax,4), %r14
	leaq	(%rbx,%r14,8), %rsi
	movq	(%rbx,%r14,8), %rax
	movq	_MAX_PORTALS_ON_LEAF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	%rdx, -176(%rbp)                ## 8-byte Spill
	jne	LBB0_30
## %bb.29:                              ##   in Loop: Header=BB0_12 Depth=1
	leaq	L_.str.17(%rip), %rdi
	xorl	%eax, %eax
	movq	%rsi, -200(%rbp)                ## 8-byte Spill
	callq	_Error
	movq	-200(%rbp), %rsi                ## 8-byte Reload
	movq	-176(%rbp), %rdx                ## 8-byte Reload
	movq	(%rsi), %rax
LBB0_30:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	32(%rbx,%r14,8), %rcx
	movq	%rdx, (%rcx,%rax,8)
	incq	%rax
	movq	%rax, (%rsi)
	movl	(%r13), %edi
	callq	_VS_AllocWinding
	movq	%rax, 64(%r12)
	movl	(%r13), %ecx
	movl	%ecx, (%rax)
	movl	(%r13), %ecx
	testl	%ecx, %ecx
	jle	LBB0_34
## %bb.31:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	8(%r13), %rdx
	decl	%ecx
	movslq	%ecx, %rcx
	movq	(%rdx,%rcx,8), %rdi
	movq	8(%rax), %rax
	movq	(%rax), %rsi
	callq	_VectorCopy
	movl	(%r13), %eax
	cmpl	$2, %eax
	jl	LBB0_34
## %bb.32:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	$1, %ebx
	movl	$-2, %r14d
	.p2align	4, 0x90
LBB0_33:                                ##   Parent Loop BB0_12 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	64(%r12), %rcx
	movq	8(%r13), %rdx
	addl	%r14d, %eax
	cltq
	movq	(%rdx,%rax,8), %rdi
	movq	8(%rcx), %rax
	movq	(%rax,%rbx,8), %rsi
	callq	_VectorCopy
	incq	%rbx
	movslq	(%r13), %rax
	decl	%r14d
	cmpq	%rax, %rbx
	jl	LBB0_33
	jmp	LBB0_34
LBB0_35:
	movq	-192(%rbp), %rdi                ## 8-byte Reload
	callq	_fclose
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_37
## %bb.36:
	addq	$168, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_37:
	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	_MAX_CLUSTERS,4,2               ## @MAX_CLUSTERS
L_.str.9:                               ## @.str.9
	.asciz	"more than %d clusters in portal file\n"

	.comm	_portals,8,3                    ## @portals
	.comm	_leafs,8,3                      ## @leafs
L_.str.10:                              ## @.str.10
	.asciz	"%i %i %i "

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

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

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

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

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

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

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

	.comm	_vec3_origin,4,2                ## @vec3_origin
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_VS_LoadPortals                 ; -- Begin function VS_LoadPortals
	.p2align	2
_VS_LoadPortals:                        ; @VS_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	x20, _numfaces@GOTPAGE
Lloh13:
	ldr	x20, [x20, _numfaces@GOTPAGEOFF]
Lloh14:
	adrp	x8, _numportals@GOTPAGE
Lloh15:
	ldr	x8, [x8, _numportals@GOTPAGEOFF]
	stp	x8, x20, [sp, #16]
Lloh16:
	adrp	x9, _portalclusters@GOTPAGE
Lloh17:
	ldr	x9, [x9, _portalclusters@GOTPAGEOFF]
	add	x8, sp, #96
	stp	x8, x9, [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:
Lloh27:
	adrp	x21, _portalclusters@GOTPAGE
Lloh28:
	ldr	x21, [x21, _portalclusters@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh29:
	adrp	x0, l_.str.6@PAGE
Lloh30:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	__printf
Lloh31:
	adrp	x8, _numportals@GOTPAGE
Lloh32:
	ldr	x8, [x8, _numportals@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
Lloh34:
	adrp	x0, l_.str.7@PAGE
Lloh35:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	__printf
	ldr	w1, [x20]
Lloh36:
	adrp	x0, l_.str.8@PAGE
Lloh37:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	__printf
	ldr	w9, [x21]
Lloh38:
	adrp	x8, _MAX_CLUSTERS@GOTPAGE
Lloh39:
	ldr	x8, [x8, _MAX_CLUSTERS@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	cmp	w9, w8
	b.lt	LBB0_10
; %bb.9:
	str	x8, [sp]
Lloh41:
	adrp	x0, l_.str.9@PAGE
Lloh42:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_Error
LBB0_10:
Lloh43:
	adrp	x21, _numportals@GOTPAGE
Lloh44:
	ldr	x21, [x21, _numportals@GOTPAGEOFF]
	ldr	w8, [x21]
	add	w8, w8, w8, lsl #2
	lsl	w0, w8, #4
	bl	_malloc
Lloh45:
	adrp	x20, _portals@GOTPAGE
Lloh46:
	ldr	x20, [x20, _portals@GOTPAGEOFF]
	str	x0, [x20]
	ldr	w8, [x21]
	add	w8, w8, w8, lsl #2
	lsl	w2, w8, #4
	mov	w1, #0
	bl	_memset
Lloh47:
	adrp	x22, _portalclusters@GOTPAGE
Lloh48:
	ldr	x22, [x22, _portalclusters@GOTPAGEOFF]
	ldr	w8, [x22]
	add	w8, w8, w8, lsl #2
	lsl	w0, w8, #3
	bl	_malloc
Lloh49:
	adrp	x8, _leafs@GOTPAGE
Lloh50:
	ldr	x8, [x8, _leafs@GOTPAGEOFF]
Lloh51:
	str	x0, [x8]
	ldr	w8, [x22]
	add	w8, w8, w8, lsl #2
	lsl	w2, w8, #3
	mov	w1, #0
	bl	_memset
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_34
; %bb.11:
	mov	w24, #0
	add	x8, sp, #88
	ldr	x20, [x20]
	add	x8, x8, #4
	str	x8, [sp, #40]                   ; 8-byte Folded Spill
	add	x23, sp, #64
	add	x21, x23, #8
	add	x26, x23, #16
Lloh52:
	adrp	x27, l_.str.11@PAGE
Lloh53:
	add	x27, x27, l_.str.11@PAGEOFF
Lloh54:
	adrp	x25, l_.str.15@PAGE
Lloh55:
	add	x25, x25, l_.str.15@PAGEOFF
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [sp, #48]
	stur	x8, [x20, #52]
	ldr	w8, [sp, #88]
	str	w8, [x20, #48]
	mov	x0, x28
	bl	_VS_SetPortalSphere
	add	x20, x20, #80
	add	w24, w24, #1
Lloh56:
	adrp	x8, _numportals@GOTPAGE
Lloh57:
	ldr	x8, [x8, _numportals@GOTPAGEOFF]
Lloh58:
	ldr	w8, [x8]
	cmp	w24, w8
	add	x23, sp, #64
Lloh59:
	adrp	x27, l_.str.11@PAGE
Lloh60:
	add	x27, x27, l_.str.11@PAGEOFF
	b.ge	LBB0_34
LBB0_13:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_24 Depth 2
                                        ;     Child Loop BB0_33 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
Lloh61:
	adrp	x1, l_.str.10@PAGE
Lloh62:
	add	x1, x1, l_.str.10@PAGEOFF
	bl	_fscanf
	cmp	w0, #3
	b.eq	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x8, x24
	str	x8, [sp]
	mov	x0, x27
	bl	_Error
LBB0_15:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [sp, #56]
Lloh63:
	adrp	x9, _MAX_POINTS_ON_WINDING@GOTPAGE
Lloh64:
	ldr	x9, [x9, _MAX_POINTS_ON_WINDING@GOTPAGEOFF]
Lloh65:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x8, x24
	str	x8, [sp]
Lloh66:
	adrp	x0, l_.str.12@PAGE
Lloh67:
	add	x0, x0, l_.str.12@PAGEOFF
	bl	_Error
LBB0_17:                                ;   in Loop: Header=BB0_13 Depth=1
Lloh68:
	adrp	x8, _portalclusters@GOTPAGE
Lloh69:
	ldr	x8, [x8, _portalclusters@GOTPAGEOFF]
Lloh70:
	ldr	w8, [x8]
	ldp	w9, w10, [sp, #88]
	cmp	w9, w8
	ccmp	w10, w8, #2, ls
	b.ls	LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x8, x24
	str	x8, [sp]
	mov	x0, x27
	bl	_Error
LBB0_19:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x8, sp, #60
	str	x8, [sp]
	mov	x0, x19
Lloh71:
	adrp	x1, l_.str.13@PAGE
Lloh72:
	add	x1, x1, l_.str.13@PAGEOFF
	bl	_fscanf
	cmp	w0, #1
	b.eq	LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_13 Depth=1
Lloh73:
	adrp	x0, l_.str.14@PAGE
Lloh74:
	add	x0, x0, l_.str.14@PAGEOFF
	bl	_Error
LBB0_21:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	w0, [sp, #56]
	bl	_VS_AllocWinding
	mov	x22, x0
	str	x0, [x20, #24]
	ldr	w8, [sp, #56]
	str	w8, [x0]
	ldr	w8, [sp, #56]
	cmp	w8, #1
	b.lt	LBB0_26
; %bb.22:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x28, #0
	b	LBB0_24
LBB0_23:                                ;   in Loop: Header=BB0_24 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_26
LBB0_24:                                ;   Parent Loop BB0_13 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	stp	x21, x26, [sp, #8]
	str	x23, [sp]
	mov	x0, x19
	mov	x1, x25
	bl	_fscanf
	cmp	w0, #3
	b.eq	LBB0_23
; %bb.25:                               ;   in Loop: Header=BB0_24 Depth=2
	str	x24, [sp]
	mov	x0, x27
	bl	_Error
	b	LBB0_23
LBB0_26:                                ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x19
Lloh75:
	adrp	x1, l_.str.16@PAGE
Lloh76:
	add	x1, x1, l_.str.16@PAGEOFF
	bl	_fscanf
	add	x1, sp, #48
	mov	x0, x22
	bl	_VS_PlaneFromWinding
Lloh77:
	adrp	x8, _leafs@GOTPAGE
Lloh78:
	ldr	x8, [x8, _leafs@GOTPAGEOFF]
Lloh79:
	ldr	x27, [x8]
	ldrsw	x28, [sp, #88]
	mov	w8, #40
	madd	x23, x28, x8, x27
	ldr	x8, [x23]
Lloh80:
	adrp	x9, _MAX_PORTALS_ON_LEAF@GOTPAGE
Lloh81:
	ldr	x9, [x9, _MAX_PORTALS_ON_LEAF@GOTPAGEOFF]
Lloh82:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_28
; %bb.27:                               ;   in Loop: Header=BB0_13 Depth=1
Lloh83:
	adrp	x0, l_.str.17@PAGE
Lloh84:
	add	x0, x0, l_.str.17@PAGEOFF
	bl	_Error
	ldr	x8, [x23]
LBB0_28:                                ;   in Loop: Header=BB0_13 Depth=1
	mov	w9, #40
	madd	x9, x28, x9, x27
	ldr	x9, [x9, #32]
	str	x20, [x9, x8, lsl #3]
	add	x8, x8, #1
	str	x8, [x23]
	str	x22, [x20, #24]
Lloh85:
	adrp	x8, _vec3_origin@GOTPAGE
Lloh86:
	ldr	x8, [x8, _vec3_origin@GOTPAGEOFF]
Lloh87:
	ldr	w0, [x8]
	ldr	w1, [sp, #52]
	ldr	w2, [x20, #16]
	bl	_VectorSubtract
	ldr	w8, [sp, #48]
	neg	w8, w8
	ldr	w9, [sp, #92]
	stp	w9, w8, [x20, #8]
	mov	x0, x20
	bl	_VS_SetPortalSphere
Lloh88:
	adrp	x8, _leafs@GOTPAGE
Lloh89:
	ldr	x8, [x8, _leafs@GOTPAGEOFF]
Lloh90:
	ldr	x27, [x8]
	ldrsw	x28, [sp, #92]
	mov	w8, #40
	madd	x23, x28, x8, x27
	ldr	x8, [x23]
Lloh91:
	adrp	x9, _MAX_PORTALS_ON_LEAF@GOTPAGE
Lloh92:
	ldr	x9, [x9, _MAX_PORTALS_ON_LEAF@GOTPAGEOFF]
Lloh93:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_30
; %bb.29:                               ;   in Loop: Header=BB0_13 Depth=1
Lloh94:
	adrp	x0, l_.str.17@PAGE
Lloh95:
	add	x0, x0, l_.str.17@PAGEOFF
	bl	_Error
	ldr	x8, [x23]
LBB0_30:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x10, x20, #40
	mov	w9, #40
	madd	x9, x28, x9, x27
	mov	x28, x10
	ldr	x9, [x9, #32]
	str	x10, [x9, x8, lsl #3]
	add	x8, x8, #1
	str	x8, [x23]
	ldr	w0, [x22]
	bl	_VS_AllocWinding
	str	x0, [x20, #64]
	ldr	w8, [x22]
	str	w8, [x0]
	ldr	w8, [x22]
	subs	w8, w8, #1
	b.lt	LBB0_12
; %bb.31:                               ;   in Loop: Header=BB0_13 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_12
; %bb.32:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	w23, #-2
	mov	w27, #1
LBB0_33:                                ;   Parent Loop BB0_13 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x9, [x20, #64]
	ldr	x10, [x22, #8]
	add	w8, w8, w23
	ldr	x0, [x10, w8, sxtw #3]
	ldr	x8, [x9, #8]
	ldr	x1, [x8, x27, lsl #3]
	bl	_VectorCopy
	add	x27, x27, #1
	ldrsw	x8, [x22]
	sub	w23, w23, #1
	cmp	x27, x8
	b.lt	LBB0_33
	b	LBB0_12
LBB0_34:
	mov	x0, x19
	bl	_fclose
	ldur	x8, [x29, #-96]
Lloh96:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh97:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh98:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_36
; %bb.35:
	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_36:
	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 AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGotStr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpAdd	Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.loh AdrpAdd	Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.loh AdrpAdd	Lloh66, Lloh67
	.loh AdrpLdrGotLdr	Lloh68, Lloh69, Lloh70
	.loh AdrpAdd	Lloh71, Lloh72
	.loh AdrpAdd	Lloh73, Lloh74
	.loh AdrpLdrGotLdr	Lloh80, Lloh81, Lloh82
	.loh AdrpLdrGotLdr	Lloh77, Lloh78, Lloh79
	.loh AdrpAdd	Lloh75, Lloh76
	.loh AdrpAdd	Lloh83, Lloh84
	.loh AdrpLdrGotLdr	Lloh91, Lloh92, Lloh93
	.loh AdrpLdrGotLdr	Lloh88, Lloh89, Lloh90
	.loh AdrpLdrGotLdr	Lloh85, Lloh86, Lloh87
	.loh AdrpAdd	Lloh94, Lloh95
	.loh AdrpLdrGotLdr	Lloh96, Lloh97, Lloh98
	.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	_MAX_CLUSTERS,4,2               ; @MAX_CLUSTERS
l_.str.9:                               ; @.str.9
	.asciz	"more than %d clusters in portal file\n"

	.comm	_portals,8,3                    ; @portals
	.comm	_leafs,8,3                      ; @leafs
l_.str.10:                              ; @.str.10
	.asciz	"%i %i %i "

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

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

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

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

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

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

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

	.comm	_vec3_origin,4,2                ; @vec3_origin
.subsections_via_symbols
