	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AAS_SplitArea                  ## -- Begin function AAS_SplitArea
	.p2align	4, 0x90
_AAS_SplitArea:                         ## @AAS_SplitArea
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r13
	movl	%esi, %ebx
	movq	%rdi, %r14
	callq	_AAS_FlipAreaFaces
	movq	%r14, %rdi
	callq	_AAS_CheckArea
	movq	_mapplanes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	%r14, %rdi
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	%ebx, %esi
	callq	_AAS_SplitWinding
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movl	28(%r14), %esi
	leaq	L_.str(%rip), %rdi
	callq	_Error
LBB0_2:
	xorl	%eax, %eax
	callq	_AAS_AllocTmpFace
	movq	%rax, %r15
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r15)
	movq	%r12, 32(%r15)
	xorl	%eax, %eax
	callq	_AAS_AllocTmpArea
	movq	%rax, (%r13)
	movl	24(%r14), %ecx
	movl	%ecx, 24(%rax)
	movl	20(%r14), %ecx
	movl	%ecx, 20(%rax)
	movl	16(%r14), %ecx
	movl	%ecx, 16(%rax)
	movq	$0, 8(%rax)
	xorl	%eax, %eax
	callq	_AAS_AllocTmpArea
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rax, (%rbx)
	movl	24(%r14), %ecx
	movl	%ecx, 24(%rax)
	movl	20(%r14), %ecx
	movl	%ecx, 20(%rax)
	movl	16(%r14), %ecx
	movl	%ecx, 16(%rax)
	movq	$0, 8(%rax)
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	(%r13), %rdx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_AAS_AddFaceSideToArea
	movq	(%rbx), %rdx
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_AAS_AddFaceSideToArea
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	8(%r14), %r13
	testq	%r13, %r13
	je	LBB0_18
## %bb.3:
	movslq	-48(%rbp), %rax                 ## 4-byte Folded Reload
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_18
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %r15
	movq	16(%r13), %r12
	xorl	%r14d, %r14d
	cmpq	-64(%rbp), %r12                 ## 8-byte Folded Reload
	setne	%r14b
	movq	24(%r13), %rax
	movq	(%rax,%r14,8), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testq	%r12, %r12
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_AAS_RemoveFaceFromArea
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	testq	%r15, %r15
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_AAS_RemoveFaceFromArea
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rax,%rcx,8), %edx
	movl	4(%rax,%rcx,8), %esi
	movq	%r13, %rdi
	leaq	-88(%rbp), %rcx
	leaq	-80(%rbp), %r8
	callq	_AAS_SplitFace
	movq	%r13, %rdi
	callq	_AAS_FreeTmpFace
	cmpq	%rbx, %r12
	cmovneq	%r12, %r15
	testq	%r15, %r15
	je	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-88(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	xorl	%esi, %esi
	cmpq	%rbx, %r12
	sete	%sil
	movq	%r15, %rdx
	callq	_AAS_AddFaceSideToArea
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-80(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	xorl	%esi, %esi
	cmpq	%rbx, %r12
	sete	%sil
	movq	%r15, %rdx
	callq	_AAS_AddFaceSideToArea
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-88(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdx
	movl	%r14d, %esi
	callq	_AAS_AddFaceSideToArea
LBB0_15:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-80(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdx
	movl	%r14d, %esi
	callq	_AAS_AddFaceSideToArea
	jmp	LBB0_17
LBB0_18:
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	(%r14), %rax
	cmpq	$0, 8(%rax)
	jne	LBB0_20
## %bb.19:
	leaq	L_.str.1(%rip), %rdi
	callq	_Log_Print
LBB0_20:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rax
	cmpq	$0, 8(%rax)
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	jne	LBB0_22
## %bb.21:
	leaq	L_.str.2(%rip), %rdi
	callq	_Log_Print
LBB0_22:
	movl	$1, (%r15)
	movq	(%r14), %rdi
	callq	_AAS_FlipAreaFaces
	movq	(%rbx), %rdi
	callq	_AAS_FlipAreaFaces
	movq	(%r14), %rdi
	callq	_AAS_CheckArea
	movq	(%rbx), %rdi
	callq	_AAS_CheckArea
	addq	$72, %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	"AAS_SplitArea: no split winding when splitting area %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"AAS_SplitArea: front area without faces\n"

L_.str.2:                               ## @.str.2
	.asciz	"AAS_SplitArea: back area without faces\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AAS_SplitArea                  ; -- Begin function AAS_SplitArea
	.p2align	2
_AAS_SplitArea:                         ; @AAS_SplitArea
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x3
	mov	x20, x2
	mov	x22, x1
	mov	x21, x0
	bl	_AAS_FlipAreaFaces
	mov	x0, x21
	bl	_AAS_CheckArea
Lloh0:
	adrp	x8, _mapplanes@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mapplanes@GOTPAGEOFF]
Lloh2:
	ldr	x25, [x8]
	mov	x0, x21
	mov	x1, x22
	bl	_AAS_SplitWinding
	mov	x23, x0
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	w1, [x21, #28]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Error
LBB0_2:
	bl	_AAS_AllocTmpFace
	mov	x24, x0
	str	w22, [x0]
	str	x23, [x0, #32]
	bl	_AAS_AllocTmpArea
	str	x0, [x20]
	ldr	w8, [x21, #24]
	str	w8, [x0, #24]
	ldr	d0, [x21, #16]
	str	d0, [x0, #16]
	str	xzr, [x0, #8]
	bl	_AAS_AllocTmpArea
	str	x0, [x19]
	ldr	w8, [x21, #24]
	str	w8, [x0, #24]
	ldr	d0, [x21, #16]
	str	d0, [x0, #16]
	str	xzr, [x0, #8]
	ldr	x2, [x20]
	mov	x0, x24
	mov	w1, #0
	bl	_AAS_AddFaceSideToArea
	ldr	x2, [x19]
	mov	x0, x24
	mov	w1, #1
	bl	_AAS_AddFaceSideToArea
	ldr	x24, [x21, #8]
	cbz	x24, LBB0_18
; %bb.3:
	sxtw	x8, w22
	add	x26, x25, x8, lsl #3
	add	x27, x26, #4
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x24, x28
	cbz	x28, LBB0_18
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x25, x23, [x24, #8]
	cmp	x23, x21
	cset	w22, ne
	ldr	x8, [x24, #24]
	ldr	x28, [x8, w22, uxtw #3]
	cbz	x23, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	mov	x1, x23
	bl	_AAS_RemoveFaceFromArea
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	cbz	x25, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	mov	x1, x25
	bl	_AAS_RemoveFaceFromArea
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w1, [x27]
	ldr	w2, [x26]
	add	x3, sp, #8
	mov	x4, sp
	mov	x0, x24
	bl	_AAS_SplitFace
	mov	x0, x24
	bl	_AAS_FreeTmpFace
	cmp	x23, x21
	csel	x24, x23, x25, ne
	cbz	x24, LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	cmp	x23, x21
	cset	w1, eq
	mov	x2, x24
	bl	_AAS_AddFaceSideToArea
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [sp]
	cbz	x0, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	cmp	x23, x21
	cset	w1, eq
	mov	x2, x24
	bl	_AAS_AddFaceSideToArea
LBB0_14:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x2, [x20]
	mov	x1, x22
	bl	_AAS_AddFaceSideToArea
LBB0_16:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [sp]
	cbz	x0, LBB0_4
; %bb.17:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x2, [x19]
	mov	x1, x22
	bl	_AAS_AddFaceSideToArea
	b	LBB0_4
LBB0_18:
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	cbnz	x8, LBB0_20
; %bb.19:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_Log_Print
LBB0_20:
	ldr	x8, [x19]
	ldr	x8, [x8, #8]
	cbnz	x8, LBB0_22
; %bb.21:
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_Log_Print
LBB0_22:
	mov	w8, #1
	str	w8, [x21]
	ldr	x0, [x20]
	bl	_AAS_FlipAreaFaces
	ldr	x0, [x19]
	bl	_AAS_FlipAreaFaces
	ldr	x0, [x20]
	bl	_AAS_CheckArea
	ldr	x0, [x19]
	bl	_AAS_CheckArea
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_mapplanes,8,3                  ; @mapplanes
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AAS_SplitArea: no split winding when splitting area %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"AAS_SplitArea: front area without faces\n"

l_.str.2:                               ; @.str.2
	.asciz	"AAS_SplitArea: back area without faces\n"

.subsections_via_symbols
