	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_WritePortals                   ## -- Begin function WritePortals
	.p2align	4, 0x90
_WritePortals:                          ## @WritePortals
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rsi
	callq	_fopen
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rsi
	callq	_Error
LBB0_2:
	movq	_numportals@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_3
## %bb.4:
	addl	%eax, %eax
	movq	_portals@GOTPCREL(%rip), %rcx
	cmpl	$2, %eax
	movl	$1, %edx
	cmovgel	%eax, %edx
	movq	(%rcx), %r8
	leaq	-1(%rdx), %rsi
	movl	%edx, %ecx
	andl	$3, %ecx
	cmpq	$3, %rsi
	jae	LBB0_6
## %bb.5:
	xorl	%esi, %esi
	xorl	%r14d, %r14d
	jmp	LBB0_8
LBB0_3:
	xorl	%r14d, %r14d
	jmp	LBB0_11
LBB0_6:
	andl	$2147483644, %edx               ## imm = 0x7FFFFFFC
	leaq	88(%r8), %rdi
	xorl	%esi, %esi
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	cmpq	$0, -72(%rdi)
	sete	%al
	cmpq	$1, -48(%rdi)
	adcl	%r14d, %eax
	xorl	%r14d, %r14d
	cmpq	$0, -24(%rdi)
	sete	%r14b
	cmpq	$1, (%rdi)
	adcl	%eax, %r14d
	addq	$4, %rsi
	addq	$96, %rdi
	cmpq	%rsi, %rdx
	jne	LBB0_7
LBB0_8:
	testq	%rcx, %rcx
	je	LBB0_11
## %bb.9:
	leaq	(%rsi,%rsi,2), %rax
	leaq	(%r8,%rax,8), %rax
	addq	$16, %rax
	shlq	$3, %rcx
	leaq	(%rcx,%rcx,2), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	cmpq	$1, (%rax,%rdx)
	adcl	$0, %r14d
	addq	$24, %rdx
	cmpq	%rdx, %rcx
	jne	LBB0_10
LBB0_11:
	movq	_PORTALFILE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_fprintf
	leaq	L_.str.3(%rip), %r15
	movq	%rbx, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	xorl	%eax, %eax
	callq	_fprintf
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_fprintf
	movq	%rbx, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	xorl	%eax, %eax
	callq	_fprintf
	movq	_numportals@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_19
## %bb.12:
	movq	_portals@GOTPCREL(%rip), %rdx
	xorl	%r14d, %r14d
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	$10, %edi
	movq	%rbx, %rsi
	callq	_fputc
	movq	_numportals@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_portals@GOTPCREL(%rip), %rdx
LBB0_18:                                ##   in Loop: Header=BB0_13 Depth=1
	incq	%r14
	leal	(%rax,%rax), %ecx
	movslq	%ecx, %rcx
	cmpq	%rcx, %r14
	jge	LBB0_19
LBB0_13:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_16 Depth 2
	movq	(%rdx), %r13
	leaq	(%r14,%r14,2), %r12
	cmpq	$0, 16(%r13,%r12,8)
	jne	LBB0_18
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	8(%r13,%r12,8), %r15
	movl	(%r15), %edx
	movq	%rbx, %rdi
	leaq	L_.str.4(%rip), %rsi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	callq	_fprintf
	movl	(%r13,%r12,8), %edx
	movq	%rbx, %rdi
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	cmpl	$0, (%r15)
	leaq	L_.str.7(%rip), %r12
	jle	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_16:                                ##   Parent Loop BB0_13 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	$40, %edi
	movq	%rbx, %rsi
	callq	_fputc
	movq	8(%r15), %rax
	movq	(%rax,%r13,8), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_WriteFloat
	movq	8(%r15), %rax
	movq	(%rax,%r13,8), %rax
	movl	4(%rax), %esi
	movq	%rbx, %rdi
	callq	_WriteFloat
	movq	8(%r15), %rax
	movq	(%rax,%r13,8), %rax
	movl	8(%rax), %esi
	movq	%rbx, %rdi
	callq	_WriteFloat
	movl	$2, %esi
	movl	$1, %edx
	movq	%r12, %rdi
	movq	%rbx, %rcx
	callq	_fwrite
	incq	%r13
	movslq	(%r15), %rax
	cmpq	%rax, %r13
	jl	LBB0_16
	jmp	LBB0_17
LBB0_19:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_fclose                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"w"

L_.str.1:                               ## @.str.1
	.asciz	"Error opening %s"

	.comm	_numportals,4,2                 ## @numportals
	.comm	_portals,8,3                    ## @portals
L_.str.2:                               ## @.str.2
	.asciz	"%s\n"

	.comm	_PORTALFILE,8,3                 ## @PORTALFILE
L_.str.3:                               ## @.str.3
	.asciz	"%i\n"

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

L_.str.5:                               ## @.str.5
	.asciz	"%d "

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

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_WritePortals                   ; -- Begin function WritePortals
	.p2align	2
_WritePortals:                          ; @WritePortals
	.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	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	mov	x19, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_Error
LBB0_2:
Lloh4:
	adrp	x8, _numportals@GOTPAGE
Lloh5:
	ldr	x8, [x8, _numportals@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x24, _portals@GOTPAGE
Lloh8:
	ldr	x24, [x24, _portals@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.3:
	lsl	w8, w8, #1
	ldr	x9, [x24]
	cmp	w8, #1
	csinc	w8, w8, wzr, gt
	cmp	w8, #9
	b.hs	LBB0_6
; %bb.4:
	mov	x10, #0
	mov	w21, #0
	b	LBB0_9
LBB0_5:
	mov	w21, #0
	b	LBB0_11
LBB0_6:
	ands	x10, x8, #0x7
	mov	w11, #8
	csel	x10, x11, x10, eq
	sub	x10, x8, x10
	add	x11, x9, #112
	movi.2d	v0, #0000000000000000
	mov	x12, x10
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	sub	x13, x11, #96
	sub	x14, x11, #48
	ld3.2d	{ v4, v5, v6 }, [x13]
	ld3.2d	{ v16, v17, v18 }, [x14]
	mov	x13, x11
	ld3.2d	{ v19, v20, v21 }, [x13], #48
	ld3.2d	{ v22, v23, v24 }, [x13]
	cmeq.2d	v4, v4, #0
	xtn.2s	v4, v4
	cmeq.2d	v5, v16, #0
	xtn.2s	v5, v5
	cmeq.2d	v6, v19, #0
	xtn.2s	v6, v6
	cmeq.2d	v7, v22, #0
	xtn.2s	v7, v7
	sub.2s	v0, v0, v4
	sub.2s	v1, v1, v5
	sub.2s	v2, v2, v6
	sub.2s	v3, v3, v7
	add	x11, x11, #192
	subs	x12, x12, #8
	b.ne	LBB0_7
; %bb.8:
	add.2s	v0, v1, v0
	add.2s	v0, v2, v0
	add.2s	v0, v3, v0
	addp.2s	v0, v0, v0
	fmov	w21, s0
LBB0_9:
	mov	w11, #24
	madd	x9, x10, x11, x9
	add	x9, x9, #16
	sub	x8, x8, x10
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9], #24
	cmp	x10, #0
	cinc	w21, w21, eq
	subs	x8, x8, #1
	b.ne	LBB0_10
LBB0_11:
Lloh9:
	adrp	x8, _PORTALFILE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PORTALFILE@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	str	x8, [sp]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_fprintf
	str	xzr, [sp]
Lloh14:
	adrp	x20, l_.str.3@PAGE
Lloh15:
	add	x20, x20, l_.str.3@PAGEOFF
	mov	x0, x19
	mov	x1, x20
	bl	_fprintf
	str	x21, [sp]
	mov	x0, x19
	mov	x1, x20
	bl	_fprintf
	str	xzr, [sp]
	mov	x0, x19
	mov	x1, x20
	bl	_fprintf
Lloh16:
	adrp	x8, _numportals@GOTPAGE
Lloh17:
	ldr	x8, [x8, _numportals@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.12:
	mov	x25, #0
	mov	w26, #24
Lloh19:
	adrp	x20, l_.str.4@PAGE
Lloh20:
	add	x20, x20, l_.str.4@PAGEOFF
Lloh21:
	adrp	x21, l_.str.5@PAGE
Lloh22:
	add	x21, x21, l_.str.5@PAGEOFF
Lloh23:
	adrp	x22, l_.str.7@PAGE
Lloh24:
	add	x22, x22, l_.str.7@PAGEOFF
	b	LBB0_15
LBB0_13:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	w0, #10
	mov	x1, x19
	bl	_fputc
Lloh25:
	adrp	x8, _numportals@GOTPAGE
Lloh26:
	ldr	x8, [x8, _numportals@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x25, x25, #1
	lsl	w9, w8, #1
	cmp	x25, w9, sxtw
	b.ge	LBB0_19
LBB0_15:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_18 Depth 2
	ldr	x9, [x24]
	madd	x10, x25, x26, x9
	ldr	x10, [x10, #16]
	cbnz	x10, LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	madd	x28, x25, x26, x9
	ldr	x27, [x28, #8]
	ldr	w8, [x27]
	stp	xzr, xzr, [sp, #8]
	str	x8, [sp]
	mov	x0, x19
	mov	x1, x20
	bl	_fprintf
	ldr	w8, [x28]
	str	x8, [sp]
	mov	x0, x19
	mov	x1, x21
	bl	_fprintf
	ldr	w8, [x27]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x28, #0
LBB0_18:                                ;   Parent Loop BB0_15 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	w0, #40
	mov	x1, x19
	bl	_fputc
	ldr	x8, [x27, #8]
	lsl	x23, x28, #3
	ldr	x8, [x8, x23]
	ldr	w1, [x8]
	mov	x0, x19
	bl	_WriteFloat
	ldr	x8, [x27, #8]
	ldr	x8, [x8, x23]
	ldr	w1, [x8, #4]
	mov	x0, x19
	bl	_WriteFloat
	ldr	x8, [x27, #8]
	ldr	x8, [x8, x23]
	ldr	w1, [x8, #8]
	mov	x0, x19
	bl	_WriteFloat
	mov	x0, x22
	mov	w1, #2
	mov	w2, #1
	mov	x3, x19
	bl	_fwrite
	add	x28, x28, #1
	ldrsw	x8, [x27]
	cmp	x28, x8
	b.lt	LBB0_18
	b	LBB0_13
LBB0_19:
	mov	x0, x19
	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	_fclose
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"w"

l_.str.1:                               ; @.str.1
	.asciz	"Error opening %s"

	.comm	_numportals,4,2                 ; @numportals
	.comm	_portals,8,3                    ; @portals
l_.str.2:                               ; @.str.2
	.asciz	"%s\n"

	.comm	_PORTALFILE,8,3                 ; @PORTALFILE
l_.str.3:                               ; @.str.3
	.asciz	"%i\n"

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

l_.str.5:                               ; @.str.5
	.asciz	"%d "

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

.subsections_via_symbols
