	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PortalFlow                     ## -- Begin function PortalFlow
	.p2align	4, 0x90
_PortalFlow:                            ## @PortalFlow
	.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	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_sorted_portals@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%edi, %rcx
	movq	(%rax,%rcx,8), %rbx
	cmpq	$0, 40(%rbx)
	je	LBB0_2
## %bb.1:
	movq	_stat_done@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rbx)
	jmp	LBB0_10
LBB0_2:
	movq	_stat_working@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rbx)
	movq	24(%rbx), %rdi
	movq	_numportals@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	addl	%esi, %esi
	callq	_CountBits
	movl	%eax, %r14d
	leaq	-72(%rbp), %rdi
	xorl	%esi, %esi
	movl	$48, %edx
	callq	_memset
	movq	%rbx, -32(%rbp)
	leaq	-64(%rbp), %rdx
	movq	%rbx, -40(%rbp)
	movl	36(%rbx), %eax
	movl	%eax, -44(%rbp)
	movl	32(%rbx), %eax
	movl	%eax, -48(%rbp)
	movq	$0, -56(%rbp)
	movq	_portallongs@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	testl	%r8d, %r8d
	jle	LBB0_9
## %bb.3:
	leaq	-1(%r8), %rcx
	movl	%r8d, %eax
	andl	$3, %eax
	cmpq	$3, %rcx
	jae	LBB0_5
## %bb.4:
	xorl	%ecx, %ecx
	jmp	LBB0_7
LBB0_5:
	andl	$-4, %r8d
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%rbx), %rdi
	movq	(%rdi,%rcx,8), %rdi
	movq	-64(%rbp), %rsi
	movq	%rdi, (%rsi,%rcx,8)
	movq	24(%rbx), %rsi
	movq	8(%rsi,%rcx,8), %rsi
	movq	-64(%rbp), %rdi
	movq	%rsi, 8(%rdi,%rcx,8)
	movq	24(%rbx), %rsi
	movq	16(%rsi,%rcx,8), %rsi
	movq	-64(%rbp), %rdi
	movq	%rsi, 16(%rdi,%rcx,8)
	movq	24(%rbx), %rsi
	movq	24(%rsi,%rcx,8), %rsi
	movq	-64(%rbp), %rdi
	movq	%rsi, 24(%rdi,%rcx,8)
	addq	$4, %rcx
	cmpq	%rcx, %r8
	jne	LBB0_6
LBB0_7:
	testq	%rax, %rax
	je	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%rbx), %rsi
	movq	(%rsi,%rcx,8), %rsi
	movq	-64(%rbp), %rdi
	movq	%rsi, (%rdi,%rcx,8)
	incq	%rcx
	decq	%rax
	jne	LBB0_8
LBB0_9:
	movl	16(%rbx), %edi
	leaq	-72(%rbp), %rsi
	callq	_RecursiveLeafFlow
	movq	_stat_done@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rdi
	movl	(%r15), %esi
	addl	%esi, %esi
	callq	_CountBits
	movq	_portals@GOTPCREL(%rip), %rcx
	subq	(%rcx), %rbx
	shrq	$4, %rbx
	imull	$-1431655765, %ebx, %esi        ## imm = 0xAAAAAAAB
	movl	-72(%rbp), %r8d
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	_qprintf
LBB0_10:
	addq	$56, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_sorted_portals,8,3             ## @sorted_portals
	.comm	_stat_done,8,3                  ## @stat_done
	.comm	_stat_working,8,3               ## @stat_working
	.comm	_numportals,4,2                 ## @numportals
	.comm	_portallongs,4,2                ## @portallongs
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"portal:%4i  mightsee:%4i  cansee:%4i (%i chains)\n"

	.comm	_portals,8,3                    ## @portals
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PortalFlow                     ; -- Begin function PortalFlow
	.p2align	2
_PortalFlow:                            ; @PortalFlow
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x8, _sorted_portals@GOTPAGE
Lloh1:
	ldr	x8, [x8, _sorted_portals@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x20, [x8, w0, sxtw #3]
	ldr	x8, [x20, #40]
	cbz	x8, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _stat_done@GOTPAGE
Lloh4:
	ldr	x8, [x8, _stat_done@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	str	x8, [x20, #8]
	b	LBB0_6
LBB0_2:
Lloh6:
	adrp	x8, _stat_working@GOTPAGE
Lloh7:
	ldr	x8, [x8, _stat_working@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	str	x8, [x20, #8]
	ldr	x0, [x20, #24]
Lloh9:
	adrp	x21, _numportals@GOTPAGE
Lloh10:
	ldr	x21, [x21, _numportals@GOTPAGEOFF]
	ldr	w8, [x21]
	lsl	w1, w8, #1
	bl	_CountBits
	mov	x19, x0
	mov	x22, sp
	mov	x0, sp
	mov	w1, #0
	mov	w2, #48
	bl	_memset
	add	x2, x22, #8
	stp	x20, x20, [sp, #32]
	ldr	d0, [x20, #32]
	str	d0, [sp, #24]
	str	xzr, [sp, #16]
Lloh11:
	adrp	x8, _portallongs@GOTPAGE
Lloh12:
	ldr	x8, [x8, _portallongs@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x8, #0
	lsl	x9, x9, #3
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x20, #24]
	ldr	x10, [x10, x8]
	ldr	x11, [sp, #8]
	str	x10, [x11, x8]
	add	x8, x8, #8
	cmp	x9, x8
	b.ne	LBB0_4
LBB0_5:
	ldr	w0, [x20, #16]
	mov	x1, sp
	bl	_RecursiveLeafFlow
Lloh14:
	adrp	x8, _stat_done@GOTPAGE
Lloh15:
	ldr	x8, [x8, _stat_done@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	str	x8, [x20, #8]
	ldr	x0, [x20]
	ldr	w8, [x21]
	lsl	w1, w8, #1
	bl	_CountBits
	mov	x3, x0
Lloh17:
	adrp	x8, _portals@GOTPAGE
Lloh18:
	ldr	x8, [x8, _portals@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	sub	x8, x20, x8
	lsr	x8, x8, #4
	mov	w9, #43691
	movk	w9, #43690, lsl #16
	mul	w1, w8, w9
	ldr	w4, [sp]
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x19
	bl	_qprintf
LBB0_6:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_sorted_portals,8,3             ; @sorted_portals
	.comm	_stat_done,8,3                  ; @stat_done
	.comm	_stat_working,8,3               ; @stat_working
	.comm	_numportals,4,2                 ; @numportals
	.comm	_portallongs,4,2                ; @portallongs
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"portal:%4i  mightsee:%4i  cansee:%4i (%i chains)\n"

	.comm	_portals,8,3                    ; @portals
.subsections_via_symbols
