	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PassageMemory                  ## -- Begin function PassageMemory
	.p2align	4, 0x90
_PassageMemory:                         ## @PassageMemory
	.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	_numportals@GOTPCREL(%rip), %rax
	movl	(%rax), %r10d
	testl	%r10d, %r10d
	jle	LBB0_1
## %bb.2:
	movq	_sorted_portals@GOTPCREL(%rip), %rax
	movq	(%rax), %r9
	movq	_leafs@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	movq	_portalbytes@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	addl	$4, %r14d
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%r15
	cmpq	%r10, %r15
	je	LBB0_12
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movq	(%r9,%r15,8), %rcx
	cmpq	$0, 8(%rcx)
	jne	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rcx), %rcx
	shlq	$4, %rcx
	movl	(%r8,%rcx), %r11d
	testl	%r11d, %r11d
	jle	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r8,%rcx), %r13
	cmpl	$1, %r11d
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%edx, %edx
	jmp	LBB0_9
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	%r11d, %r12d
	andl	$-2, %r12d
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r13,%rdx,8), %rsi
	movq	8(%r13,%rdx,8), %rdi
	xorl	%ecx, %ecx
	cmpq	$0, 8(%rsi)
	sete	%cl
	movl	$0, %esi
	cmovel	%r14d, %esi
	addl	%eax, %ecx
	addl	%ebx, %esi
	xorl	%eax, %eax
	cmpq	$0, 8(%rdi)
	sete	%al
	movl	$0, %ebx
	cmovel	%r14d, %ebx
	addl	%ecx, %eax
	addl	%esi, %ebx
	addq	$2, %rdx
	cmpq	%rdx, %r12
	jne	LBB0_8
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	testb	$1, %r11b
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r13,%rdx,8), %rcx
	xorl	%edx, %edx
	cmpq	$0, 8(%rcx)
	sete	%dl
	movl	$0, %ecx
	cmovel	%r14d, %ecx
	addl	%edx, %eax
	addl	%ecx, %ebx
	jmp	LBB0_11
LBB0_1:
	xorl	%eax, %eax
	xorl	%ebx, %ebx
LBB0_12:
	cltd
	idivl	%r10d
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	__printf
	sarl	$20, %ebx
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	__printf                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_numportals,4,2                 ## @numportals
	.comm	_sorted_portals,8,3             ## @sorted_portals
	.comm	_leafs,8,3                      ## @leafs
	.comm	_portalbytes,8,3                ## @portalbytes
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%7i average number of passages per leaf\n"

L_.str.1:                               ## @.str.1
	.asciz	"%7i MB required passage memory\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PassageMemory                  ; -- Begin function PassageMemory
	.p2align	2
_PassageMemory:                         ; @PassageMemory
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _numportals@GOTPAGE
Lloh1:
	ldr	x8, [x8, _numportals@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.1:
	mov	x10, #0
	mov	w19, #0
	mov	w9, #0
Lloh3:
	adrp	x11, _sorted_portals@GOTPAGE
Lloh4:
	ldr	x11, [x11, _sorted_portals@GOTPAGEOFF]
Lloh5:
	adrp	x12, _leafs@GOTPAGE
Lloh6:
	ldr	x12, [x12, _leafs@GOTPAGEOFF]
Lloh7:
	ldr	x11, [x11]
Lloh8:
	ldr	x12, [x12]
Lloh9:
	adrp	x13, _portalbytes@GOTPAGE
Lloh10:
	ldr	x13, [x13, _portalbytes@GOTPAGEOFF]
Lloh11:
	ldr	w13, [x13]
	add	w13, w13, #4
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x10, x10, #1
	cmp	x10, x8
	b.eq	LBB0_13
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
                                        ;     Child Loop BB0_11 Depth 2
	ldr	x14, [x11, x10, lsl #3]
	ldr	x15, [x14, #8]
	cbnz	x15, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x15, [x14]
	lsl	x14, x15, #4
	ldr	w14, [x12, x14]
	cmp	w14, #1
	b.lt	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x15, x12, x15, lsl #4
	ldr	x15, [x15, #8]
	cmp	w14, #1
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x16, #0
	b	LBB0_10
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w17, #0
	mov	w0, #0
	and	x16, x14, #0xfffffffe
	add	x1, x15, #8
	mov	x2, x16
LBB0_8:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	x3, x4, [x1, #-8]
	ldr	x3, [x3, #8]
	ldr	x4, [x4, #8]
	cmp	x3, #0
	cinc	w9, w9, eq
	csel	w3, w13, wzr, eq
	cmp	x4, #0
	cinc	w0, w0, eq
	csel	w4, w13, wzr, eq
	add	w19, w3, w19
	add	w17, w4, w17
	add	x1, x1, #16
	subs	x2, x2, #2
	b.ne	LBB0_8
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w9, w0, w9
	add	w19, w17, w19
	cmp	x16, x14
	b.eq	LBB0_2
LBB0_10:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x15, x15, x16, lsl #3
	sub	x14, x14, x16
LBB0_11:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x16, [x15], #8
	ldr	x16, [x16, #8]
	cmp	x16, #0
	cinc	w9, w9, eq
	csel	w16, w13, wzr, eq
	add	w19, w16, w19
	subs	x14, x14, #1
	b.ne	LBB0_11
	b	LBB0_2
LBB0_12:
	mov	w9, #0
	mov	w19, #0
LBB0_13:
	sdiv	w1, w9, w8
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	__printf
	asr	w1, w19, #20
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	__printf
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_numportals,4,2                 ; @numportals
	.comm	_sorted_portals,8,3             ; @sorted_portals
	.comm	_leafs,8,3                      ; @leafs
	.comm	_portalbytes,8,3                ; @portalbytes
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%7i average number of passages per leaf\n"

l_.str.1:                               ; @.str.1
	.asciz	"%7i MB required passage memory\n"

.subsections_via_symbols
