	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SplitNodePortals               ## -- Begin function SplitNodePortals
	.p2align	4, 0x90
_SplitNodePortals:                      ## @SplitNodePortals
	.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, %r12
	movq	8(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_29
## %bb.1:
	movq	16(%r12), %rax
	movq	(%rax), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	8(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	(%r12), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	_mapplanes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
                                        ## implicit-def: $r13d
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
LBB0_26:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_AddPortalToNodes
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
LBB0_27:                                ##   in Loop: Header=BB0_2 Depth=1
	callq	_AddPortalToNodes
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_28:                                ##   in Loop: Header=BB0_2 Depth=1
	testq	%rbx, %rbx
	je	LBB0_29
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %r14
	movq	8(%rbx), %rax
	movq	(%rax), %rsi
	cmpq	%r12, %rsi
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	%r12, 8(%rax)
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str(%rip), %rdi
	callq	_Error
	movq	8(%r14), %rax
	movq	(%rax), %rsi
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rsi
	xorl	%r13d, %r13d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %r13d
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%r14), %rcx
	movslq	%r13d, %rdx
	movq	(%rcx,%rdx,8), %rbx
	xorl	%ecx, %ecx
	testl	%edx, %edx
	sete	%cl
	movq	(%rax,%rcx,8), %r15
	movq	%r14, %rdi
	callq	_RemovePortalFromNode
	movq	8(%r14), %rax
	movq	8(%rax), %rsi
	movq	%r14, %rdi
	callq	_RemovePortalFromNode
	movq	(%r14), %rdi
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx,%rax,8), %edx
	movl	4(%rcx,%rax,8), %esi
	movq	_SPLIT_WINDING_EPSILON@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-48(%rbp), %r8
	leaq	-72(%rbp), %r9
	callq	_ClipWindingEpsilon
	movq	-48(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	callq	_WindingIsTiny
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdi
	callq	_FreeWinding
	movq	$0, -48(%rbp)
	movq	_c_tinyportals@GOTPCREL(%rip), %rax
	incl	(%rax)
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-72(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	callq	_WindingIsTiny
	movq	-72(%rbp), %rdi
	testq	%rax, %rax
	je	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	callq	_FreeWinding
	movq	$0, -72(%rbp)
	movq	_c_tinyportals@GOTPCREL(%rip), %rax
	incl	(%rax)
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edi, %edi
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rax
	movq	%rax, %rcx
	orq	%rdi, %rcx
	je	LBB0_28
## %bb.15:                              ##   in Loop: Header=BB0_2 Depth=1
	testq	%rax, %rax
	je	LBB0_16
## %bb.20:                              ##   in Loop: Header=BB0_2 Depth=1
	testq	%rdi, %rdi
	je	LBB0_21
## %bb.24:                              ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_AllocPortal
	movq	%rax, %r12
	movups	(%r14), %xmm0
	movups	%xmm0, (%rax)
	movq	16(%r14), %rax
	movq	%rax, 16(%r12)
	movq	-72(%rbp), %rax
	movq	%rax, (%r12)
	movq	(%r14), %rdi
	callq	_FreeWinding
	movq	-48(%rbp), %rax
	movq	%rax, (%r14)
	movq	%r14, %rdi
	testl	%r13d, %r13d
	jne	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	callq	_AddPortalToNodes
	movq	%r12, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	jmp	LBB0_27
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	callq	_FreeWinding
	movq	%r14, %rdi
	testl	%r13d, %r13d
	je	LBB0_17
## %bb.19:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_AddPortalToNodes
	jmp	LBB0_28
LBB0_21:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %rdi
	callq	_FreeWinding
	movq	%r14, %rdi
	testl	%r13d, %r13d
	je	LBB0_22
## %bb.23:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_AddPortalToNodes
	jmp	LBB0_28
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_22:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdx
	callq	_AddPortalToNodes
	jmp	LBB0_28
LBB0_29:
	movq	$0, 8(%r12)
	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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SplitNodePortals: mislinked portal"

	.comm	_SPLIT_WINDING_EPSILON,4,2      ## @SPLIT_WINDING_EPSILON
	.comm	_c_tinyportals,4,2              ## @c_tinyportals
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SplitNodePortals               ; -- Begin function SplitNodePortals
	.p2align	2
_SplitNodePortals:                      ; @SplitNodePortals
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x19, x0
	ldr	x21, [x0, #8]
	cbz	x21, LBB0_28
; %bb.1:
	ldr	x8, [x19, #16]
	ldp	x9, x25, [x8]
	str	x9, [sp, #8]                    ; 8-byte Folded Spill
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _mapplanes@GOTPAGE
Lloh1:
	ldr	x9, [x9, _mapplanes@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x26, x9, x8, lsl #3
	add	x27, x26, #4
Lloh3:
	adrp	x28, _SPLIT_WINDING_EPSILON@GOTPAGE
Lloh4:
	ldr	x28, [x28, _SPLIT_WINDING_EPSILON@GOTPAGEOFF]
Lloh5:
	adrp	x22, _c_tinyportals@GOTPAGE
Lloh6:
	ldr	x22, [x22, _c_tinyportals@GOTPAGEOFF]
                                        ; implicit-def: $w20
	str	x26, [sp]                       ; 8-byte Folded Spill
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x1, x24
	ldr	x2, [sp, #8]                    ; 8-byte Folded Reload
	bl	_AddPortalToNodes
	mov	x0, x25
	mov	x1, x24
	mov	x25, x28
	mov	x2, x28
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	bl	_AddPortalToNodes
	mov	x28, x22
	mov	x22, x27
	mov	x27, x26
	ldr	x26, [sp]                       ; 8-byte Folded Reload
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	cbz	x21, LBB0_28
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x23, x21
	ldr	x8, [x21, #8]
	ldr	x1, [x8]
	cmp	x1, x19
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x9, [x8, #8]
	cmp	x9, x19
	b.eq	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Error
	ldr	x8, [x23, #8]
	ldr	x1, [x8]
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w20, #0
	mov	x1, x19
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w20, #1
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x9, [x23, #16]
	ldr	x21, [x9, w20, sxtw #3]
	cmp	w20, #0
	cset	w9, eq
	ldr	x24, [x8, w9, uxtw #3]
	mov	x0, x23
	bl	_RemovePortalFromNode
	ldr	x8, [x23, #8]
	ldr	x1, [x8, #8]
	mov	x0, x23
	bl	_RemovePortalFromNode
	ldr	x0, [x23]
	ldr	w1, [x27]
	ldr	w2, [x26]
	ldr	w3, [x28]
	add	x4, sp, #24
	add	x5, sp, #16
	bl	_ClipWindingEpsilon
	ldr	x0, [sp, #24]
	cbz	x0, LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	bl	_WindingIsTiny
	cbz	x0, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [sp, #24]
	bl	_FreeWinding
	str	xzr, [sp, #24]
	ldr	w8, [x22]
	add	w8, w8, #1
	str	w8, [x22]
LBB0_13:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [sp, #16]
	cbz	x0, LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_5 Depth=1
	bl	_WindingIsTiny
	mov	x8, x0
	ldr	x0, [sp, #16]
	cbz	x8, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_5 Depth=1
	bl	_FreeWinding
	mov	x0, #0
	str	xzr, [sp, #16]
	ldr	w8, [x22]
	add	w8, w8, #1
	str	w8, [x22]
LBB0_16:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [sp, #24]
	orr	x9, x8, x0
	cbz	x9, LBB0_4
; %bb.17:                               ;   in Loop: Header=BB0_5 Depth=1
	cbz	x8, LBB0_21
; %bb.18:                               ;   in Loop: Header=BB0_5 Depth=1
	cbz	x0, LBB0_23
; %bb.19:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x26, x27
	mov	x27, x22
	mov	x22, x28
	mov	x28, x25
	bl	_AllocPortal
	mov	x25, x0
	ldr	x8, [x23, #16]
	ldr	q0, [x23]
	str	q0, [x0]
	str	x8, [x0, #16]
	ldr	x8, [sp, #16]
	str	x8, [x0]
	ldr	x0, [x23]
	bl	_FreeWinding
	ldr	x8, [sp, #24]
	str	x8, [x23]
	mov	x0, x23
	cbnz	w20, LBB0_2
; %bb.20:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x1, [sp, #8]                    ; 8-byte Folded Reload
	mov	x2, x24
	bl	_AddPortalToNodes
	mov	x0, x25
	mov	x25, x28
	mov	x1, x28
	mov	x2, x24
	b	LBB0_3
LBB0_21:                                ;   in Loop: Header=BB0_5 Depth=1
	bl	_FreeWinding
	mov	x0, x23
	cbz	w20, LBB0_25
; %bb.22:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x1, x24
	mov	x2, x25
	bl	_AddPortalToNodes
	b	LBB0_4
LBB0_23:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x8
	bl	_FreeWinding
	mov	x0, x23
	cbz	w20, LBB0_26
; %bb.24:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x1, x24
	ldr	x2, [sp, #8]                    ; 8-byte Folded Reload
	bl	_AddPortalToNodes
	b	LBB0_4
LBB0_25:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x1, x25
	b	LBB0_27
LBB0_26:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x1, [sp, #8]                    ; 8-byte Folded Reload
LBB0_27:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x2, x24
	bl	_AddPortalToNodes
	b	LBB0_4
LBB0_28:
	str	xzr, [x19, #8]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_mapplanes,8,3                  ; @mapplanes
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SplitNodePortals: mislinked portal"

	.comm	_SPLIT_WINDING_EPSILON,4,2      ; @SPLIT_WINDING_EPSILON
	.comm	_c_tinyportals,4,2              ; @c_tinyportals
.subsections_via_symbols
