	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LeafVectorFromPortalVector     ## -- Begin function LeafVectorFromPortalVector
	.p2align	4, 0x90
_LeafVectorFromPortalVector:            ## @LeafVectorFromPortalVector
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	%rsi, %r9
	movq	_numportals@GOTPCREL(%rip), %r8
	movl	(%r8), %esi
	testl	%esi, %esi
	jle	LBB0_5
## %bb.1:
	movq	_portals@GOTPCREL(%rip), %rax
	movq	(%rax), %r10
	xorl	%edx, %edx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rdx
	leal	(%rsi,%rsi), %eax
	cltq
	cmpq	%rax, %rdx
	jge	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rdx, %rax
	shrq	%rax
	andl	$2147483644, %eax               ## imm = 0x7FFFFFFC
	movl	(%rdi,%rax), %eax
	movl	%edx, %ecx
	andb	$7, %cl
	movzbl	%cl, %ecx
	btl	%ecx, %eax
	jae	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r10,%rdx,4), %eax
	movl	%eax, %ecx
	andb	$7, %cl
	movl	$1, %esi
	shll	%cl, %esi
	sarl	$3, %eax
	cltq
	orl	%esi, (%r9,%rax,4)
	movl	(%r8), %esi
	jmp	LBB0_4
LBB0_5:
	movq	_portalclusters@GOTPCREL(%rip), %r8
	movl	(%r8), %esi
	testl	%esi, %esi
	jle	LBB0_12
## %bb.6:
	movq	_leafs@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	xorl	%edx, %edx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	incl	%edx
	cmpl	%esi, %edx
	jge	LBB0_12
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movl	%edx, %ecx
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%ecx, %eax
	movslq	%ecx, %rcx
	movl	(%rdi,%rcx,4), %ecx
	testl	%ecx, %ecx
	jns	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	%eax, %ecx
	sarl	$3, %ecx
	movslq	%ecx, %rcx
	movl	(%r9,%rcx,4), %ecx
	andb	$7, %al
	movzbl	%al, %eax
	btl	%eax, %ecx
	jae	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	%edx, %ecx
	andb	$7, %cl
	movl	$1, %eax
	shll	%cl, %eax
	movl	%edx, %ecx
	shrl	$3, %ecx
	orl	%eax, (%r9,%rcx,4)
	movl	(%r8), %esi
	jmp	LBB0_11
LBB0_12:
	movq	%r9, %rdi
	popq	%rbp
	jmp	_CountBits                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_numportals,4,2                 ## @numportals
	.comm	_portals,8,3                    ## @portals
	.comm	_portalclusters,4,2             ## @portalclusters
	.comm	_leafs,8,3                      ## @leafs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LeafVectorFromPortalVector     ; -- Begin function LeafVectorFromPortalVector
	.p2align	2
_LeafVectorFromPortalVector:            ; @LeafVectorFromPortalVector
	.cfi_startproc
; %bb.0:
	mov	x8, x1
Lloh0:
	adrp	x9, _numportals@GOTPAGE
Lloh1:
	ldr	x9, [x9, _numportals@GOTPAGEOFF]
	ldr	w13, [x9]
	cmp	w13, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x10, #0
Lloh2:
	adrp	x11, _portals@GOTPAGE
Lloh3:
	ldr	x11, [x11, _portals@GOTPAGEOFF]
Lloh4:
	ldr	x11, [x11]
	mov	w12, #1
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x10, x10, #1
	lsl	w14, w13, #1
	cmp	x10, w14, sxtw
	b.ge	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ubfx	x14, x10, #3, #29
	ldr	w14, [x0, x14, lsl #2]
	and	w15, w10, #0x7
	lsr	w14, w14, w15
	tbz	w14, #0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w13, [x11, x10, lsl #2]
	and	x14, x13, #0x7
	lsl	w14, w12, w14
	asr	w13, w13, #3
	sbfiz	x13, x13, #2, #32
	ldr	w15, [x8, x13]
	orr	w14, w14, w15
	str	w14, [x8, x13]
	ldr	w13, [x9]
	b	LBB0_2
LBB0_5:
Lloh5:
	adrp	x9, _portalclusters@GOTPAGE
Lloh6:
	ldr	x9, [x9, _portalclusters@GOTPAGEOFF]
	ldr	w1, [x9]
	cmp	w1, #1
	b.lt	LBB0_12
; %bb.6:
	mov	w10, #0
Lloh7:
	adrp	x11, _leafs@GOTPAGE
Lloh8:
	ldr	x11, [x11, _leafs@GOTPAGEOFF]
Lloh9:
	ldr	x11, [x11]
	mov	w12, #1
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	w10, w10, #1
	cmp	w10, w1
	b.ge	LBB0_12
LBB0_8:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	mov	x14, x10
LBB0_9:                                 ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x13, x14
	ldr	w14, [x11, w14, sxtw #2]
	tbz	w14, #31, LBB0_9
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	asr	w14, w13, #3
	ldr	w14, [x8, w14, sxtw #2]
	and	w13, w13, #0x7
	lsr	w13, w14, w13
	tbz	w13, #0, LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	and	w13, w10, #0x7
	lsl	w13, w12, w13
	lsr	w14, w10, #3
	lsl	x14, x14, #2
	ldr	w15, [x8, x14]
	orr	w13, w15, w13
	str	w13, [x8, x14]
	ldr	w1, [x9]
	b	LBB0_7
LBB0_12:
	mov	x0, x8
	b	_CountBits
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_numportals,4,2                 ; @numportals
	.comm	_portals,8,3                    ; @portals
	.comm	_portalclusters,4,2             ; @portalclusters
	.comm	_leafs,8,3                      ; @leafs
.subsections_via_symbols
