	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AAS_SetViewPortalsAsClusterPortals ## -- Begin function AAS_SetViewPortalsAsClusterPortals
	.p2align	4, 0x90
_AAS_SetViewPortalsAsClusterPortals:    ## @AAS_SetViewPortalsAsClusterPortals
	.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
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_aasworld@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r10d
	cmpl	$2, %r10d
	jl	LBB0_34
## %bb.1:
	movq	8(%rcx), %rcx
	leaq	-1(%r10), %r8
	movl	$1, %edx
	cmpq	$8, %r8
	jb	LBB0_23
## %bb.2:
	leaq	4(%rcx), %rax
	leaq	(%rcx,%r10,4), %rsi
	movq	_AREACONTENTS_VIEWPORTAL@GOTPCREL(%rip), %r11
	leaq	4(%r11), %rdi
	cmpq	%rdi, %rax
	setb	%r14b
	cmpq	%r11, %rsi
	seta	%bl
	movq	_AREACONTENTS_CLUSTERPORTAL@GOTPCREL(%rip), %r15
	leaq	4(%r15), %rdi
	cmpq	%rdi, %rax
	setb	%r9b
	cmpq	%r15, %rsi
	seta	%al
	testb	%bl, %r14b
	jne	LBB0_23
## %bb.3:
	andb	%al, %r9b
	jne	LBB0_23
## %bb.4:
	movq	%r8, %r9
	andq	$-8, %r9
	leaq	1(%r9), %rdx
	movd	(%r11), %xmm0                   ## xmm0 = mem[0],zero,zero,zero
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	movl	(%r15), %esi
	xorl	%edi, %edi
	pxor	%xmm1, %xmm1
	pcmpeqd	%xmm2, %xmm2
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_5 Depth=1
	addq	$8, %rdi
	cmpq	%rdi, %r9
	je	LBB0_22
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	4(%rcx,%rdi,4), %xmm3
	movdqa	%xmm0, %xmm4
	pand	%xmm3, %xmm4
	pcmpeqd	%xmm1, %xmm4
	movd	%xmm4, %eax
	notl	%eax
	testb	$1, %al
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movd	%xmm3, %eax
	orl	%esi, %eax
	movl	%eax, 4(%rcx,%rdi,4)
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	pxor	%xmm2, %xmm4
	pextrb	$4, %xmm4, %eax
	testb	$1, %al
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	pextrd	$1, %xmm3, %eax
	orl	%esi, %eax
	movl	%eax, 8(%rcx,%rdi,4)
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	pextrb	$8, %xmm4, %eax
	testb	$1, %al
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	pextrd	$2, %xmm3, %eax
	orl	%esi, %eax
	movl	%eax, 12(%rcx,%rdi,4)
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	pextrb	$12, %xmm4, %eax
	testb	$1, %al
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=1
	pextrd	$3, %xmm3, %eax
	orl	%esi, %eax
	movl	%eax, 16(%rcx,%rdi,4)
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	movdqu	20(%rcx,%rdi,4), %xmm3
	movdqa	%xmm0, %xmm4
	pand	%xmm3, %xmm4
	pcmpeqd	%xmm1, %xmm4
	movd	%xmm4, %eax
	notl	%eax
	testb	$1, %al
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=1
	movd	%xmm3, %eax
	orl	%esi, %eax
	movl	%eax, 20(%rcx,%rdi,4)
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	pxor	%xmm2, %xmm4
	pextrb	$4, %xmm4, %eax
	testb	$1, %al
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_5 Depth=1
	pextrd	$1, %xmm3, %eax
	orl	%esi, %eax
	movl	%eax, 24(%rcx,%rdi,4)
LBB0_17:                                ##   in Loop: Header=BB0_5 Depth=1
	pextrb	$8, %xmm4, %eax
	testb	$1, %al
	je	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_5 Depth=1
	pextrd	$2, %xmm3, %eax
	orl	%esi, %eax
	movl	%eax, 28(%rcx,%rdi,4)
LBB0_19:                                ##   in Loop: Header=BB0_5 Depth=1
	pextrb	$12, %xmm4, %eax
	testb	$1, %al
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_5 Depth=1
	pextrd	$3, %xmm3, %eax
	orl	%esi, %eax
	movl	%eax, 32(%rcx,%rdi,4)
	jmp	LBB0_21
LBB0_22:
	cmpq	%r9, %r8
	je	LBB0_34
LBB0_23:
	movq	%rdx, %rsi
	notq	%rsi
	testb	$1, %r10b
	jne	LBB0_27
## %bb.24:
	movl	(%rcx,%rdx,4), %edi
	movq	_AREACONTENTS_VIEWPORTAL@GOTPCREL(%rip), %rax
	testl	%edi, (%rax)
	je	LBB0_26
## %bb.25:
	movq	_AREACONTENTS_CLUSTERPORTAL@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movl	%edi, (%rcx,%rdx,4)
LBB0_26:
	incq	%rdx
LBB0_27:
	addq	%r10, %rsi
	jne	LBB0_28
LBB0_34:
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_28:
	movq	_AREACONTENTS_VIEWPORTAL@GOTPCREL(%rip), %rsi
	movq	_AREACONTENTS_CLUSTERPORTAL@GOTPCREL(%rip), %rdi
	jmp	LBB0_29
	.p2align	4, 0x90
LBB0_33:                                ##   in Loop: Header=BB0_29 Depth=1
	addq	$2, %rdx
	cmpq	%rdx, %r10
	je	LBB0_34
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rdx,4), %eax
	testl	%eax, (%rsi)
	je	LBB0_31
## %bb.30:                              ##   in Loop: Header=BB0_29 Depth=1
	orl	(%rdi), %eax
	movl	%eax, (%rcx,%rdx,4)
LBB0_31:                                ##   in Loop: Header=BB0_29 Depth=1
	movl	4(%rcx,%rdx,4), %eax
	testl	%eax, (%rsi)
	je	LBB0_33
## %bb.32:                              ##   in Loop: Header=BB0_29 Depth=1
	orl	(%rdi), %eax
	movl	%eax, 4(%rcx,%rdx,4)
	jmp	LBB0_33
	.cfi_endproc
                                        ## -- End function
	.comm	_aasworld,16,3                  ## @aasworld
	.comm	_AREACONTENTS_VIEWPORTAL,4,2    ## @AREACONTENTS_VIEWPORTAL
	.comm	_AREACONTENTS_CLUSTERPORTAL,4,2 ## @AREACONTENTS_CLUSTERPORTAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AAS_SetViewPortalsAsClusterPortals ; -- Begin function AAS_SetViewPortalsAsClusterPortals
	.p2align	2
_AAS_SetViewPortalsAsClusterPortals:    ; @AAS_SetViewPortalsAsClusterPortals
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, _aasworld@GOTPAGE
Lloh1:
	ldr	x8, [x8, _aasworld@GOTPAGEOFF]
	ldr	w10, [x8]
	cmp	w10, #2
	b.lt	LBB0_16
; %bb.1:
	ldr	x11, [x8, #8]
	sub	x12, x10, #1
Lloh2:
	adrp	x8, _AREACONTENTS_VIEWPORTAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AREACONTENTS_VIEWPORTAL@GOTPAGEOFF]
Lloh4:
	adrp	x9, _AREACONTENTS_CLUSTERPORTAL@GOTPAGE
Lloh5:
	ldr	x9, [x9, _AREACONTENTS_CLUSTERPORTAL@GOTPAGEOFF]
	cmp	x12, #4
	b.hs	LBB0_3
; %bb.2:
	mov	w13, #1
	b	LBB0_17
LBB0_3:
	add	x13, x11, #4
	add	x15, x11, x10, lsl #2
	add	x16, x8, #4
	add	x14, x9, #4
	cmp	x13, x14
	ccmp	x15, x9, #0, lo
	cset	w14, hi
	cmp	x15, x8
	ccmp	x13, x16, #2, hi
	mov	w13, #1
	b.lo	LBB0_17
; %bb.4:
	tbnz	w14, #0, LBB0_17
; %bb.5:
	and	x14, x12, #0xfffffffffffffffc
	orr	x13, x14, #0x1
	ld1r.4s	{ v0 }, [x8]
	ldr	w15, [x9]
	add	x16, x11, #8
	mov	x17, x14
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x16, x16, #16
	subs	x17, x17, #4
	b.eq	LBB0_15
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldur	q1, [x16, #-4]
	cmtst.4s	v2, v0, v1
	xtn.4h	v2, v2
	umov.h	w0, v2[0]
	tbz	w0, #0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	fmov	w0, s1
	orr	w0, w15, w0
	stur	w0, [x16, #-4]
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	and.16b	v2, v0, v1
	cmtst.4s	v2, v2, v2
	xtn.4h	v2, v2
	umov.h	w0, v2[1]
	tbnz	w0, #0, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	umov.h	w0, v2[2]
	tbnz	w0, #0, LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_7 Depth=1
	umov.h	w0, v2[3]
	tbz	w0, #0, LBB0_6
	b	LBB0_14
LBB0_12:                                ;   in Loop: Header=BB0_7 Depth=1
	mov.s	w0, v1[1]
	orr	w0, w15, w0
	str	w0, [x16]
	umov.h	w0, v2[2]
	tbz	w0, #0, LBB0_11
LBB0_13:                                ;   in Loop: Header=BB0_7 Depth=1
	mov.s	w0, v1[2]
	orr	w0, w15, w0
	str	w0, [x16, #4]
	umov.h	w0, v2[3]
	tbz	w0, #0, LBB0_6
LBB0_14:                                ;   in Loop: Header=BB0_7 Depth=1
	mov.s	w0, v1[3]
	orr	w0, w15, w0
	str	w0, [x16, #8]
	b	LBB0_6
LBB0_15:
	cmp	x12, x14
	b.ne	LBB0_17
LBB0_16:
	ret
LBB0_17:
	add	x11, x11, x13, lsl #2
	sub	x10, x10, x13
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_19 Depth=1
	add	x11, x11, #4
	subs	x10, x10, #1
	b.eq	LBB0_16
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11]
	ldr	w13, [x8]
	tst	w13, w12
	b.eq	LBB0_18
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
	ldr	w13, [x9]
	orr	w12, w13, w12
	str	w12, [x11]
	b	LBB0_18
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_aasworld,16,3                  ; @aasworld
	.comm	_AREACONTENTS_VIEWPORTAL,4,2    ; @AREACONTENTS_VIEWPORTAL
	.comm	_AREACONTENTS_CLUSTERPORTAL,4,2 ; @AREACONTENTS_CLUSTERPORTAL
.subsections_via_symbols
