	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function WritePortalFile_r
LCPI0_0:
	.quad	0x3fefae147ae147ae              ## double 0.98999999999999999
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_WritePortalFile_r
	.p2align	4, 0x90
_WritePortalFile_r:                     ## @WritePortalFile_r
	.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	$24, %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	(%rdi), %rax
	movq	_PLANENUM_LEAF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.1:
	cmpl	$0, 32(%r14)
	je	LBB0_14
LBB0_2:
	movq	_CONTENTS_SOLID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r14)
	je	LBB0_3
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	16(%r14), %rbx
	testq	%rbx, %rbx
	je	LBB0_13
## %bb.4:
	movq	_pf@GOTPCREL(%rip), %r13
	leaq	L_.str.2(%rip), %rdx
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r13), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	leaq	L_.str.2(%rip), %rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	cmpq	%r14, %rcx
	sete	%al
	movq	24(%rbx), %rcx
	movq	(%rcx,%rax,8), %rbx
	testq	%rbx, %rbx
	je	LBB0_13
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
	movq	(%rbx), %rax
	movq	16(%rbx), %r12
	movq	8(%rax), %rcx
	testq	%r12, %r12
	je	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpq	%r14, (%rax)
	jne	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	movq	%rdx, %r15
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	callq	_Portal_VisFlood
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%r15, %rdx
	leaq	L_.str.1(%rip), %r15
	testl	%eax, %eax
	je	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r12, %rdi
	leaq	-60(%rbp), %rdx
	callq	_WindingPlane
	movl	8(%rbx), %edi
	callq	_DotProduct
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	movsd	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	setbe	%al
	seta	%cl
	movl	(%r13), %edi
	movl	(%r12), %edx
	movq	(%rbx), %rsi
	movq	(%rsi,%rcx,8), %rcx
	movl	12(%rcx), %ecx
	movq	(%rsi,%rax,8), %rax
	movl	12(%rax), %r8d
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	cmpl	$0, (%r12)
	jle	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r13), %edi
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movl	(%r13), %edi
	movq	8(%r12), %rax
	movq	(%rax,%r14,8), %rax
	movl	(%rax), %esi
	callq	_WriteFloat2
	movl	(%r13), %edi
	movq	8(%r12), %rax
	movq	(%rax,%r14,8), %rax
	movl	4(%rax), %esi
	callq	_WriteFloat2
	movl	(%r13), %edi
	movq	8(%r12), %rax
	movq	(%rax,%r14,8), %rax
	movl	8(%rax), %esi
	callq	_WriteFloat2
	movl	(%r13), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	incq	%r14
	movslq	(%r12), %rax
	cmpq	%rax, %r14
	jl	LBB0_10
	jmp	LBB0_11
LBB0_14:
	movq	24(%r14), %rax
	movq	(%rax), %rdi
	callq	_WritePortalFile_r
	movq	24(%r14), %rax
	movq	8(%rax), %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_WritePortalFile_r              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PLANENUM_LEAF,8,3              ## @PLANENUM_LEAF
	.comm	_CONTENTS_SOLID,4,2             ## @CONTENTS_SOLID
	.comm	_pf,4,2                         ## @pf
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%i %i %i "

L_.str.1:                               ## @.str.1
	.asciz	"("

L_.str.2:                               ## @.str.2
	.asciz	") "

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

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_WritePortalFile_r              ; -- Begin function WritePortalFile_r
	.p2align	2
_WritePortalFile_r:                     ; @WritePortalFile_r
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _PLANENUM_LEAF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PLANENUM_LEAF@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_2
; %bb.1:
	ldr	w8, [x19, #32]
	cbz	w8, LBB0_14
LBB0_2:
	ldr	w8, [x19, #8]
Lloh3:
	adrp	x9, _CONTENTS_SOLID@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CONTENTS_SOLID@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
LBB0_3:
	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
LBB0_4:
	ldr	x20, [x19, #16]
	cbz	x20, LBB0_3
; %bb.5:
Lloh6:
	adrp	x27, _pf@GOTPAGE
Lloh7:
	ldr	x27, [x27, _pf@GOTPAGEOFF]
Lloh8:
	adrp	x22, l_.str.1@PAGE
Lloh9:
	add	x22, x22, l_.str.1@PAGEOFF
Lloh10:
	adrp	x23, l_.str.2@PAGE
Lloh11:
	add	x23, x23, l_.str.2@PAGEOFF
Lloh12:
	adrp	x24, l_.str.3@PAGE
Lloh13:
	add	x24, x24, l_.str.3@PAGEOFF
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	w0, [x27]
	mov	x1, x24
	bl	_fprintf
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	cmp	x28, x19
	cset	w8, eq
	ldr	x9, [x20, #24]
	ldr	x20, [x9, w8, uxtw #3]
	cbz	x20, LBB0_3
LBB0_8:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_13 Depth 2
	ldr	x25, [x20, #16]
	ldr	x8, [x20]
	ldr	x28, [x8, #8]
	cbz	x25, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x8]
	cmp	x8, x19
	b.ne	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x20
	bl	_Portal_VisFlood
	cbz	w0, LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	add	x2, sp, #28
	mov	x0, x25
	bl	_WindingPlane
	ldr	w0, [x20, #8]
	bl	_DotProduct
	mov	x8, #18350
	movk	x8, #31457, lsl #16
	movk	x8, #44564, lsl #32
	movk	x8, #16367, lsl #48
	fmov	d1, x8
	fcmp	d0, d1
	cset	w8, pl
	cset	w9, mi
	ldr	x10, [x20]
	ldr	x9, [x10, w9, uxtw #3]
	ldr	w0, [x27]
	ldr	x8, [x10, w8, uxtw #3]
	ldr	w9, [x9, #12]
	ldr	w8, [x8, #12]
	ldr	w10, [x25]
	stp	x9, x8, [sp, #8]
	str	x10, [sp]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x26, #0
LBB0_13:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x27]
	mov	x1, x22
	bl	_fprintf
	ldr	w0, [x27]
	ldr	x8, [x25, #8]
	lsl	x21, x26, #3
	ldr	x8, [x8, x21]
	ldr	w1, [x8]
	bl	_WriteFloat2
	ldr	w0, [x27]
	ldr	x8, [x25, #8]
	ldr	x8, [x8, x21]
	ldr	w1, [x8, #4]
	bl	_WriteFloat2
	ldr	w0, [x27]
	ldr	x8, [x25, #8]
	ldr	x8, [x8, x21]
	ldr	w1, [x8, #8]
	bl	_WriteFloat2
	ldr	w0, [x27]
	mov	x1, x23
	bl	_fprintf
	add	x26, x26, #1
	ldrsw	x8, [x25]
	cmp	x26, x8
	b.lt	LBB0_13
	b	LBB0_6
LBB0_14:
	ldr	x8, [x19, #24]
	ldr	x0, [x8]
	bl	_WritePortalFile_r
	ldr	x8, [x19, #24]
	ldr	x0, [x8, #8]
	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
	b	_WritePortalFile_r
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_PLANENUM_LEAF,8,3              ; @PLANENUM_LEAF
	.comm	_CONTENTS_SOLID,4,2             ; @CONTENTS_SOLID
	.comm	_pf,4,2                         ; @pf
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%i %i %i "

l_.str.1:                               ; @.str.1
	.asciz	"("

l_.str.2:                               ; @.str.2
	.asciz	") "

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

.subsections_via_symbols
