	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FindPortalSide                 ## -- Begin function FindPortalSide
	.p2align	4, 0x90
_FindPortalSide:                        ## @FindPortalSide
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	24(%rdi), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rax
	movl	(%rax), %edi
	xorl	(%rcx), %edi
	callq	_VisibleContents
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	je	LBB0_31
## %bb.1:
	movq	16(%r14), %rcx
	movq	24(%r14), %rax
	movslq	(%rcx), %rdx
	movq	(%rax), %rcx
	movq	8(%rcx), %rsi
	testq	%rsi, %rsi
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.3:
	movq	_mapplanes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	xorps	%xmm0, %xmm0
	movss	%xmm0, -44(%rbp)                ## 4-byte Spill
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_SFL_BEVEL@GOTPCREL(%rip), %rcx
	movq	_TEXINFO_NODE@GOTPCREL(%rip), %rbx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	8(%rsi), %rsi
	testq	%rsi, %rsi
	je	LBB0_14
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movq	(%rsi), %r14
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, (%r14)
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_13
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$0, 4(%r14)
	jle	LBB0_13
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%r13d, %r13d
	xorl	%r15d, %r15d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=2
	incq	%r15
	movslq	4(%r14), %rax
	addq	$24, %r13
	cmpq	%rax, %r15
	jge	LBB0_13
LBB0_7:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%r14), %r12
	movl	(%rcx), %eax
	testl	%eax, (%r12,%r13)
	jne	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
	movq	8(%r12,%r13), %rax
	cmpq	(%rbx), %rax
	je	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=2
	movslq	16(%r12,%r13), %rax
	addq	%r13, %r12
	andq	$-2, %rax
	cmpl	%edx, %eax
	je	LBB0_29
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=2
	movq	_mapplanes@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movl	(%rsi,%rdx,4), %edi
	movl	(%rcx,%rax,4), %esi
	callq	_DotProduct
	movq	_SFL_BEVEL@GOTPCREL(%rip), %rcx
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	ucomiss	-44(%rbp), %xmm0                ## 4-byte Folded Reload
	jbe	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=2
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movss	%xmm0, -44(%rbp)                ## 4-byte Spill
	jmp	LBB0_12
LBB0_2:
	xorps	%xmm0, %xmm0
	movss	%xmm0, -44(%rbp)                ## 4-byte Spill
	xorl	%ecx, %ecx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_15
LBB0_14:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	24(%r14), %rax
LBB0_15:
	movq	8(%rax), %rax
	movq	8(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_27
## %bb.16:
	movq	16(%r14), %rax
	movslq	(%rax), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_mapplanes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_SFL_BEVEL@GOTPCREL(%rip), %rcx
	movq	_TEXINFO_NODE@GOTPCREL(%rip), %r13
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_17 Depth=1
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	movq	8(%rsi), %rsi
	testq	%rsi, %rsi
	je	LBB0_27
LBB0_17:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_20 Depth 2
	movq	(%rsi), %r14
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, (%r14)
	movq	%rsi, -96(%rbp)                 ## 8-byte Spill
	je	LBB0_26
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	cmpl	$0, 4(%r14)
	jle	LBB0_26
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=1
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_20 Depth=2
	incq	%r15
	movslq	4(%r14), %rax
	addq	$24, %rbx
	cmpq	%rax, %r15
	jge	LBB0_26
LBB0_20:                                ##   Parent Loop BB0_17 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%r14), %r12
	movl	(%rcx), %eax
	testl	%eax, (%r12,%rbx)
	jne	LBB0_25
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=2
	movq	8(%r12,%rbx), %rax
	cmpq	(%r13), %rax
	je	LBB0_25
## %bb.22:                              ##   in Loop: Header=BB0_20 Depth=2
	movslq	16(%r12,%rbx), %rax
	addq	%rbx, %r12
	andq	$-2, %rax
	cmpl	%edx, %eax
	je	LBB0_29
## %bb.23:                              ##   in Loop: Header=BB0_20 Depth=2
	movq	_mapplanes@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	(%rsi,%rdx,4), %edi
	movl	(%rcx,%rax,4), %esi
	callq	_DotProduct
	movq	_SFL_BEVEL@GOTPCREL(%rip), %rcx
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	ucomiss	-44(%rbp), %xmm0                ## 4-byte Folded Reload
	jbe	LBB0_25
## %bb.24:                              ##   in Loop: Header=BB0_20 Depth=2
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movss	%xmm0, -44(%rbp)                ## 4-byte Spill
	jmp	LBB0_25
LBB0_29:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_30
LBB0_27:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, %r12
	testq	%rax, %rax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_30
## %bb.28:
	leaq	L_.str(%rip), %rdi
	callq	_Log_Print
	xorl	%r12d, %r12d
LBB0_30:
	movl	$1, (%rbx)
	movq	%r12, 8(%rbx)
LBB0_31:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mapplanes,8,3                  ## @mapplanes
	.comm	_SFL_BEVEL,4,2                  ## @SFL_BEVEL
	.comm	_TEXINFO_NODE,8,3               ## @TEXINFO_NODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"WARNING: side not found for portal\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FindPortalSide                 ; -- Begin function FindPortalSide
	.p2align	2
_FindPortalSide:                        ; @FindPortalSide
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	d9, d8, [sp, #32]               ; 16-byte Folded Spill
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	mov	x19, x0
	ldr	x8, [x0, #24]
	ldp	x9, x8, [x8]
	ldr	w9, [x9]
	ldr	w8, [x8]
	eor	w0, w8, w9
	bl	_VisibleContents
	str	w0, [sp, #28]                   ; 4-byte Folded Spill
	cbz	w0, LBB0_31
; %bb.1:
	ldp	x9, x8, [x19, #16]
	ldrsw	x22, [x9]
	ldr	x9, [x8]
	ldr	x23, [x9, #8]
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	cbz	x23, LBB0_13
; %bb.2:
	str	xzr, [sp, #16]                  ; 8-byte Folded Spill
Lloh0:
	adrp	x24, _mapplanes@GOTPAGE
Lloh1:
	ldr	x24, [x24, _mapplanes@GOTPAGEOFF]
	ldr	x25, [x24]
	movi	d8, #0000000000000000
Lloh2:
	adrp	x26, _SFL_BEVEL@GOTPAGE
Lloh3:
	ldr	x26, [x26, _SFL_BEVEL@GOTPAGEOFF]
Lloh4:
	adrp	x27, _TEXINFO_NODE@GOTPAGE
Lloh5:
	ldr	x27, [x27, _TEXINFO_NODE@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x23, [x23, #8]
	cbz	x23, LBB0_14
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	ldr	x28, [x23]
	ldr	w8, [x28]
	ldr	w9, [sp, #28]                   ; 4-byte Folded Reload
	tst	w8, w9
	b.eq	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x28, #4]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x19, #0
	mov	x21, #0
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=2
	add	x21, x21, #1
	ldrsw	x8, [x28, #4]
	add	x19, x19, #24
	cmp	x21, x8
	b.ge	LBB0_3
LBB0_8:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x28, #8]
	add	x20, x8, x19
	ldr	w9, [x20]
	ldr	w10, [x26]
	tst	w10, w9
	b.ne	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	ldr	x9, [x20, #8]
	ldr	x10, [x27]
	cmp	x9, x10
	b.eq	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=2
	add	x9, x8, x19
	ldrsw	x8, [x9, #16]
	and	x8, x8, #0xfffffffffffffffe
	cmp	w8, w22
	b.eq	LBB0_27
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=2
	ldr	x9, [x24]
	ldr	w0, [x25, x22, lsl #2]
	ldr	w1, [x9, x8, lsl #2]
	bl	_DotProduct
	fcmp	s0, s8
	b.le	LBB0_7
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=2
	str	x20, [sp, #16]                  ; 8-byte Folded Spill
	fmov	s8, s0
	b	LBB0_7
LBB0_13:
	str	xzr, [sp, #16]                  ; 8-byte Folded Spill
	movi	d8, #0000000000000000
	b	LBB0_15
LBB0_14:
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	ldr	x8, [x19, #24]
LBB0_15:
	ldr	x8, [x8, #8]
	ldr	x23, [x8, #8]
	cbz	x23, LBB0_28
; %bb.16:
	ldr	x8, [x19, #16]
Lloh6:
	adrp	x9, _mapplanes@GOTPAGE
Lloh7:
	ldr	x9, [x9, _mapplanes@GOTPAGEOFF]
	ldrsw	x25, [x8]
Lloh8:
	ldr	x26, [x9]
Lloh9:
	adrp	x27, _SFL_BEVEL@GOTPAGE
Lloh10:
	ldr	x27, [x27, _SFL_BEVEL@GOTPAGEOFF]
Lloh11:
	adrp	x28, _TEXINFO_NODE@GOTPAGE
Lloh12:
	ldr	x28, [x28, _TEXINFO_NODE@GOTPAGEOFF]
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=1
	ldr	x23, [x23, #8]
	cbz	x23, LBB0_28
LBB0_18:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_22 Depth 2
	ldr	x19, [x23]
	ldr	w8, [x19]
	ldr	w9, [sp, #28]                   ; 4-byte Folded Reload
	tst	w8, w9
	b.eq	LBB0_17
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.20:                               ;   in Loop: Header=BB0_18 Depth=1
	mov	x24, #0
	mov	x21, #0
	b	LBB0_22
LBB0_21:                                ;   in Loop: Header=BB0_22 Depth=2
	add	x21, x21, #1
	ldrsw	x8, [x19, #4]
	add	x24, x24, #24
	cmp	x21, x8
	b.ge	LBB0_17
LBB0_22:                                ;   Parent Loop BB0_18 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x19, #8]
	add	x20, x8, x24
	ldr	w9, [x20]
	ldr	w10, [x27]
	tst	w10, w9
	b.ne	LBB0_21
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=2
	ldr	x9, [x20, #8]
	ldr	x10, [x28]
	cmp	x9, x10
	b.eq	LBB0_21
; %bb.24:                               ;   in Loop: Header=BB0_22 Depth=2
	add	x9, x8, x24
	ldrsw	x8, [x9, #16]
	and	x8, x8, #0xfffffffffffffffe
	cmp	w8, w22
	b.eq	LBB0_27
; %bb.25:                               ;   in Loop: Header=BB0_22 Depth=2
Lloh13:
	adrp	x9, _mapplanes@GOTPAGE
Lloh14:
	ldr	x9, [x9, _mapplanes@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	ldr	w0, [x26, x25, lsl #2]
	ldr	w1, [x9, x8, lsl #2]
	bl	_DotProduct
	fcmp	s0, s8
	b.le	LBB0_21
; %bb.26:                               ;   in Loop: Header=BB0_22 Depth=2
	str	x20, [sp, #16]                  ; 8-byte Folded Spill
	fmov	s8, s0
	b	LBB0_21
LBB0_27:
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	b	LBB0_30
LBB0_28:
	ldp	x19, x9, [sp, #8]               ; 16-byte Folded Reload
	cbnz	x9, LBB0_30
; %bb.29:
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Log_Print
	mov	x9, #0
LBB0_30:
	mov	w8, #1
	str	w8, [x19]
	str	x9, [x19, #8]
LBB0_31:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #32]               ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_mapplanes,8,3                  ; @mapplanes
	.comm	_SFL_BEVEL,4,2                  ; @SFL_BEVEL
	.comm	_TEXINFO_NODE,8,3               ; @TEXINFO_NODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WARNING: side not found for portal\n"

.subsections_via_symbols
