	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CheckWinding                   ## -- Begin function CheckWinding
	.p2align	4, 0x90
_CheckWinding:                          ## @CheckWinding
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movl	(%rdi), %esi
	cmpl	$2, %esi
	jg	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_Error
LBB0_2:
	movq	%r12, %rdi
	callq	_WindingArea
	testl	%eax, %eax
	jg	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_Error
LBB0_4:
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	callq	_WindingPlane
	cmpl	$0, (%r12)
	jle	LBB0_27
## %bb.5:
	movq	_MAX_WORLD_COORD@GOTPCREL(%rip), %rbx
	xorl	%r13d, %r13d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_7 Depth=1
	cltq
	cmpq	%rax, %r13
	movq	_MAX_WORLD_COORD@GOTPCREL(%rip), %rbx
	jge	LBB0_27
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_23 Depth 2
	movq	%r13, %r14
	movq	8(%r12), %rax
	movq	(%rax,%r13,8), %r15
	movl	(%r15), %esi
	movl	(%rbx), %eax
	cmpl	%eax, %esi
	jg	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	_MIN_WORLD_COORD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %esi
	jge	LBB0_10
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_Error
	movl	(%rbx), %eax
	movq	_MIN_WORLD_COORD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	4(%r15), %esi
	cmpl	%eax, %esi
	jg	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	cmpl	%ecx, %esi
	jge	LBB0_13
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_Error
	movl	(%rbx), %eax
	movq	_MIN_WORLD_COORD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	8(%r15), %esi
	cmpl	%eax, %esi
	jg	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=1
	cmpl	%ecx, %esi
	jge	LBB0_16
LBB0_15:                                ##   in Loop: Header=BB0_7 Depth=1
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_Error
LBB0_16:                                ##   in Loop: Header=BB0_7 Depth=1
	leaq	1(%r14), %r13
	movl	(%r12), %ebx
	movq	%r15, %rdi
	callq	_DotProduct
	subl	-44(%rbp), %eax
	movq	_ON_EPSILON@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	negl	%edx
	cmpl	%edx, %eax
	jl	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_7 Depth=1
	cmpl	%ecx, %eax
	jle	LBB0_19
LBB0_18:                                ##   in Loop: Header=BB0_7 Depth=1
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_Error
LBB0_19:                                ##   in Loop: Header=BB0_7 Depth=1
	cmpq	%rbx, %r13
	movq	8(%r12), %rax
	movl	%r13d, %ecx
	movl	$0, %edx
	cmovneq	%rcx, %rdx
	movq	(%rax,%rdx,8), %rdi
	movq	%r15, %rsi
	callq	_VectorSubtract
	callq	_VectorLength
	movq	_ON_EPSILON@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_7 Depth=1
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_Error
LBB0_21:                                ##   in Loop: Header=BB0_7 Depth=1
	callq	_CrossProduct
	callq	_VectorNormalize
	movq	%r15, %rdi
	callq	_DotProduct
	movl	%eax, %r15d
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_6
## %bb.22:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	_ON_EPSILON@GOTPCREL(%rip), %rax
	addl	(%rax), %r15d
	xorl	%ebx, %ebx
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_23 Depth=2
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jge	LBB0_6
LBB0_23:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%rbx, %r14
	je	LBB0_26
## %bb.24:                              ##   in Loop: Header=BB0_23 Depth=2
	movq	8(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_DotProduct
	cmpl	%r15d, %eax
	jle	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_23 Depth=2
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_Error
	jmp	LBB0_26
LBB0_27:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CheckWinding: %i points"

L_.str.1:                               ## @.str.1
	.asciz	"CheckWinding: %f area"

	.comm	_MAX_WORLD_COORD,4,2            ## @MAX_WORLD_COORD
	.comm	_MIN_WORLD_COORD,4,2            ## @MIN_WORLD_COORD
L_.str.2:                               ## @.str.2
	.asciz	"CheckFace: BUGUS_RANGE: %f"

	.comm	_ON_EPSILON,4,2                 ## @ON_EPSILON
L_.str.3:                               ## @.str.3
	.asciz	"CheckWinding: point off plane"

L_.str.4:                               ## @.str.4
	.asciz	"CheckWinding: degenerate edge"

L_.str.5:                               ## @.str.5
	.asciz	"CheckWinding: non-convex"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CheckWinding                   ; -- Begin function CheckWinding
	.p2align	2
_CheckWinding:                          ; @CheckWinding
	.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, x0
	ldr	w8, [x0]
	cmp	w8, #2
	b.gt	LBB0_2
; %bb.1:
	str	x8, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Error
LBB0_2:
	mov	x0, x19
	bl	_WindingArea
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, #0
	b.gt	LBB0_4
; %bb.3:
	str	x0, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_Error
LBB0_4:
	add	x2, sp, #12
	mov	x0, x19
	bl	_WindingPlane
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_23
; %bb.5:
	mov	x28, #0
Lloh4:
	adrp	x25, _MAX_WORLD_COORD@GOTPAGE
Lloh5:
	ldr	x25, [x25, _MAX_WORLD_COORD@GOTPAGEOFF]
Lloh6:
	adrp	x26, _MIN_WORLD_COORD@GOTPAGE
Lloh7:
	ldr	x26, [x26, _MIN_WORLD_COORD@GOTPAGEOFF]
Lloh8:
	adrp	x20, l_.str.2@PAGE
Lloh9:
	add	x20, x20, l_.str.2@PAGEOFF
Lloh10:
	adrp	x27, _ON_EPSILON@GOTPAGE
Lloh11:
	ldr	x27, [x27, _ON_EPSILON@GOTPAGEOFF]
Lloh12:
	adrp	x23, l_.str.5@PAGE
Lloh13:
	add	x23, x23, l_.str.5@PAGEOFF
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	cmp	x21, w8, sxtw
	mov	x28, x21
	b.ge	LBB0_23
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_20 Depth 2
	ldr	x8, [x19, #8]
	ldr	x24, [x8, x28, lsl #3]
	ldr	w10, [x24]
	ldr	w8, [x25]
	ldr	w9, [x26]
	cmp	w10, w8
	ccmp	w10, w9, #8, le
	b.ge	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	str	x10, [sp]
	mov	x0, x20
	bl	_Error
	ldr	w8, [x25]
	ldr	w9, [x26]
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w10, [x24, #4]
	cmp	w10, w8
	ccmp	w10, w9, #8, le
	b.ge	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	str	x10, [sp]
	mov	x0, x20
	bl	_Error
	ldr	w8, [x25]
	ldr	w9, [x26]
LBB0_11:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w10, [x24, #8]
	cmp	w10, w8
	ccmp	w10, w9, #8, le
	b.ge	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	str	x10, [sp]
	mov	x0, x20
	bl	_Error
LBB0_13:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w22, [x19]
	mov	x0, x24
	bl	_DotProduct
	ldr	w8, [sp, #12]
	sub	w8, w0, w8
	ldr	w9, [x27]
	neg	w10, w9
	cmp	w8, w10
	ccmp	w8, w9, #0, ge
	b.le	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_7 Depth=1
Lloh14:
	adrp	x0, l_.str.3@PAGE
Lloh15:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_Error
LBB0_15:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x21, x28, #1
	ldr	x8, [x19, #8]
	and	x9, x21, #0xffffffff
	cmp	x21, x22
	csel	x9, xzr, x9, eq
	ldr	x0, [x8, x9, lsl #3]
	mov	x1, x24
	bl	_VectorSubtract
	bl	_VectorLength
	ldr	w8, [x27]
	cmp	w0, w8
	b.ge	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_7 Depth=1
Lloh16:
	adrp	x0, l_.str.4@PAGE
Lloh17:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_Error
LBB0_17:                                ;   in Loop: Header=BB0_7 Depth=1
	bl	_CrossProduct
	bl	_VectorNormalize
	mov	x0, x24
	bl	_DotProduct
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.18:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x24, #0
	ldr	w8, [x27]
	add	w22, w8, w0
	b	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_20 Depth=2
	add	x24, x24, #1
	ldrsw	x8, [x19]
	cmp	x24, x8
	b.ge	LBB0_6
LBB0_20:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	x28, x24
	b.eq	LBB0_19
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=2
	ldr	x8, [x19, #8]
	ldr	x0, [x8, x24, lsl #3]
	bl	_DotProduct
	cmp	w0, w22
	b.le	LBB0_19
; %bb.22:                               ;   in Loop: Header=BB0_20 Depth=2
	mov	x0, x23
	bl	_Error
	b	LBB0_19
LBB0_23:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CheckWinding: %i points"

l_.str.1:                               ; @.str.1
	.asciz	"CheckWinding: %f area"

	.comm	_MAX_WORLD_COORD,4,2            ; @MAX_WORLD_COORD
	.comm	_MIN_WORLD_COORD,4,2            ; @MIN_WORLD_COORD
l_.str.2:                               ; @.str.2
	.asciz	"CheckFace: BUGUS_RANGE: %f"

	.comm	_ON_EPSILON,4,2                 ; @ON_EPSILON
l_.str.3:                               ; @.str.3
	.asciz	"CheckWinding: point off plane"

l_.str.4:                               ; @.str.4
	.asciz	"CheckWinding: degenerate edge"

l_.str.5:                               ; @.str.5
	.asciz	"CheckWinding: non-convex"

.subsections_via_symbols
