	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_TH_FindTetrahedron2            ## -- Begin function TH_FindTetrahedron2
	.p2align	4, 0x90
_TH_FindTetrahedron2:                   ## @TH_FindTetrahedron2
	.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	%rsi, %r12
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %rax
	movl	(%rax), %edi
	movq	_thworld@GOTPCREL(%rip), %r15
	movq	32(%r15), %rbx
	testl	%edi, %edi
	js	LBB0_1
## %bb.2:
	movq	(%rbx,%rdi,8), %rcx
	jmp	LBB0_3
LBB0_1:
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_abs
	movq	(%rbx,%rax,8), %rcx
	addq	$4, %rcx
	movq	(%r13), %rax
LBB0_3:
	movl	(%rcx), %ebx
	movl	4(%rax), %edi
	movq	32(%r15), %r14
	testl	%edi, %edi
	js	LBB0_5
## %bb.4:
	movq	(%r14,%rdi,8), %rcx
	jmp	LBB0_6
LBB0_5:
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_abs
	movq	(%r14,%rax,8), %rcx
	addq	$4, %rcx
	movq	(%r13), %rax
LBB0_6:
	movl	(%rcx), %ecx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movl	8(%rax), %edi
	movq	32(%r15), %r14
	testl	%edi, %edi
	js	LBB0_8
## %bb.7:
	movq	(%r14,%rdi,8), %rax
	cmpl	$0, (%r15)
	jg	LBB0_10
	jmp	LBB0_33
LBB0_8:
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_abs
	movq	(%r14,%rax,8), %rax
	addq	$4, %rax
	cmpl	$0, (%r15)
	jle	LBB0_33
LBB0_10:
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	movl	(%rax), %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r13, -96(%rbp)                 ## 8-byte Spill
	movq	8(%r13), %r13
	movq	24(%r15), %r12
	xorl	%r14d, %r14d
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_32:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%r14
	movslq	(%r15), %rax
	cmpq	%rax, %r14
	jge	LBB0_33
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %rax
	cmpl	$0, 4(%rax,%r14,8)
	je	LBB0_32
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	(%rax,%r14,8), %edi
	movl	4(%r12,%r13,8), %esi
	callq	_DotProduct
	subss	(%r12,%r13,8), %xmm0
	callq	_fabs
	testl	%eax, %eax
	jle	LBB0_32
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpq	%r14, %rbx
	je	LBB0_32
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	%r14d, %edi
	movl	%ebx, %esi
	callq	_TH_TryEdge
	testl	%eax, %eax
	je	LBB0_32
## %bb.15:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpq	%r14, -80(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_32
## %bb.16:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	%r14d, %edi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_TH_TryEdge
	testl	%eax, %eax
	je	LBB0_32
## %bb.17:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpq	%r14, -72(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_32
## %bb.18:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	%r14d, %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_TH_TryEdge
	testl	%eax, %eax
	je	LBB0_32
## %bb.19:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	%r14d, -60(%rbp)
	movl	%ebx, -56(%rbp)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, -52(%rbp)
	leaq	-60(%rbp), %rdi
	callq	_TH_FindTriangle
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	testl	%eax, %eax
	jne	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_11 Depth=1
	leaq	-60(%rbp), %rdi
	callq	_TH_TryTriangle
	testl	%eax, %eax
	je	LBB0_32
LBB0_21:                                ##   in Loop: Header=BB0_11 Depth=1
	movl	%r14d, -60(%rbp)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, -56(%rbp)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, -52(%rbp)
	leaq	-60(%rbp), %rdi
	callq	_TH_FindTriangle
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, 4(%rcx)
	testl	%eax, %eax
	jne	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_11 Depth=1
	leaq	-60(%rbp), %rdi
	callq	_TH_TryTriangle
	testl	%eax, %eax
	je	LBB0_32
LBB0_23:                                ##   in Loop: Header=BB0_11 Depth=1
	movl	%r14d, -60(%rbp)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, -56(%rbp)
	movl	%ebx, -52(%rbp)
	leaq	-60(%rbp), %rdi
	callq	_TH_FindTriangle
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, 8(%rcx)
	testl	%eax, %eax
	jne	LBB0_25
## %bb.24:                              ##   in Loop: Header=BB0_11 Depth=1
	leaq	-60(%rbp), %rdi
	callq	_TH_TryTriangle
	testl	%eax, %eax
	je	LBB0_32
LBB0_25:
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	cmpl	$0, (%r12)
	jne	LBB0_27
## %bb.26:
	movl	%r14d, -60(%rbp)
	movl	%ebx, -56(%rbp)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, -52(%rbp)
	leaq	-60(%rbp), %rdi
	callq	_TH_CreateTriangle
	movl	%eax, (%r12)
LBB0_27:
	cmpl	$0, 4(%r12)
	movq	-96(%rbp), %r13                 ## 8-byte Reload
	jne	LBB0_29
## %bb.28:
	movl	%r14d, -60(%rbp)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, -56(%rbp)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, -52(%rbp)
	leaq	-60(%rbp), %rdi
	callq	_TH_CreateTriangle
	movl	%eax, 4(%r12)
LBB0_29:
	cmpl	$0, 8(%r12)
	jne	LBB0_31
## %bb.30:
	movl	%r14d, -60(%rbp)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, -56(%rbp)
	movl	%ebx, -52(%rbp)
	leaq	-60(%rbp), %rdi
	callq	_TH_CreateTriangle
	movl	%eax, 8(%r12)
LBB0_31:
	subq	8(%r15), %r13
	shrq	$4, %r13
	movl	%r13d, 12(%r12)
	movl	$1, %eax
	jmp	LBB0_34
LBB0_33:
	xorl	%eax, %eax
LBB0_34:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_36
## %bb.35:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_36:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_thworld,40,3                   ## @thworld
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_TH_FindTetrahedron2            ; -- Begin function TH_FindTetrahedron2
	.p2align	2
_TH_FindTetrahedron2:                   ; @TH_FindTetrahedron2
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	x8, [x0]
	ldr	w0, [x8]
Lloh3:
	adrp	x25, _thworld@GOTPAGE
Lloh4:
	ldr	x25, [x25, _thworld@GOTPAGEOFF]
	ldr	x21, [x25, #32]
	tbnz	w0, #31, LBB0_2
; %bb.1:
	ldr	x9, [x21, x0, lsl #3]
	b	LBB0_3
LBB0_2:
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_abs
	ldr	x8, [x21, x0, lsl #3]
	add	x9, x8, #4
	ldr	x8, [x20]
LBB0_3:
	ldr	w21, [x9]
	ldr	w0, [x8, #4]
	ldr	x22, [x25, #32]
	tbnz	w0, #31, LBB0_5
; %bb.4:
	ldr	x9, [x22, x0, lsl #3]
	b	LBB0_6
LBB0_5:
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_abs
	ldr	x8, [x22, x0, lsl #3]
	add	x9, x8, #4
	ldr	x8, [x20]
LBB0_6:
	ldr	w22, [x9]
	ldr	w0, [x8, #8]
	ldr	x23, [x25, #32]
	tbnz	w0, #31, LBB0_8
; %bb.7:
	ldr	x8, [x23, x0, lsl #3]
	b	LBB0_9
LBB0_8:
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_abs
	ldr	x8, [x23, x0, lsl #3]
	add	x8, x8, #4
LBB0_9:
	ldr	w9, [x25]
	cmp	w9, #1
	b.lt	LBB0_29
; %bb.10:
	mov	x26, #0
	mov	x23, #0
	ldr	w24, [x8]
	ldr	x8, [x20, #8]
	ldr	x9, [x25, #24]
	add	x27, x9, x8, lsl #3
	add	x28, x27, #4
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x25]
	add	x26, x26, #8
	cmp	x23, x8
	b.ge	LBB0_29
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25, #16]
	add	x9, x8, x26
	ldr	w9, [x9, #4]
	cbz	w9, LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w0, [x8, x26]
	ldr	w1, [x28]
	bl	_DotProduct
	ldr	s1, [x27]
	fsub	s0, s0, s1
	bl	_fabs
	cmp	w0, #1
	ccmp	x21, x23, #4, ge
	b.eq	LBB0_11
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x23
	mov	x1, x21
	bl	_TH_TryEdge
	cbz	w0, LBB0_11
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=1
	cmp	x22, x23
	b.eq	LBB0_11
; %bb.16:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x23
	mov	x1, x22
	bl	_TH_TryEdge
	cbz	w0, LBB0_11
; %bb.17:                               ;   in Loop: Header=BB0_12 Depth=1
	cmp	x24, x23
	b.eq	LBB0_11
; %bb.18:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x23
	mov	x1, x24
	bl	_TH_TryEdge
	cbz	w0, LBB0_11
; %bb.19:                               ;   in Loop: Header=BB0_12 Depth=1
	stp	w23, w21, [sp, #12]
	str	w22, [sp, #20]
	add	x0, sp, #12
	bl	_TH_FindTriangle
	str	w0, [x19]
	cbnz	w0, LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_12 Depth=1
	add	x0, sp, #12
	bl	_TH_TryTriangle
	cbz	w0, LBB0_11
LBB0_21:                                ;   in Loop: Header=BB0_12 Depth=1
	stp	w23, w22, [sp, #12]
	str	w24, [sp, #20]
	add	x0, sp, #12
	bl	_TH_FindTriangle
	str	w0, [x19, #4]
	cbnz	w0, LBB0_23
; %bb.22:                               ;   in Loop: Header=BB0_12 Depth=1
	add	x0, sp, #12
	bl	_TH_TryTriangle
	cbz	w0, LBB0_11
LBB0_23:                                ;   in Loop: Header=BB0_12 Depth=1
	stp	w23, w24, [sp, #12]
	str	w21, [sp, #20]
	add	x0, sp, #12
	bl	_TH_FindTriangle
	str	w0, [x19, #8]
	cbnz	w0, LBB0_25
; %bb.24:                               ;   in Loop: Header=BB0_12 Depth=1
	add	x0, sp, #12
	bl	_TH_TryTriangle
	cbz	w0, LBB0_11
LBB0_25:
	ldr	w8, [x19]
	cbz	w8, LBB0_32
; %bb.26:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_33
LBB0_27:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_34
LBB0_28:
	ldr	x8, [x25, #8]
	sub	x8, x20, x8
	lsr	x8, x8, #4
	str	w8, [x19, #12]
	mov	w0, #1
	b	LBB0_30
LBB0_29:
	mov	w0, #0
LBB0_30:
	ldr	x8, [sp, #24]
Lloh5:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh6:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_35
; %bb.31:
	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
LBB0_32:
	stp	w23, w21, [sp, #12]
	str	w22, [sp, #20]
	add	x0, sp, #12
	bl	_TH_CreateTriangle
	str	w0, [x19]
	ldr	w8, [x19, #4]
	cbnz	w8, LBB0_27
LBB0_33:
	stp	w23, w22, [sp, #12]
	str	w24, [sp, #20]
	add	x0, sp, #12
	bl	_TH_CreateTriangle
	str	w0, [x19, #4]
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_28
LBB0_34:
	stp	w23, w24, [sp, #12]
	str	w21, [sp, #20]
	add	x0, sp, #12
	bl	_TH_CreateTriangle
	str	w0, [x19, #8]
	b	LBB0_28
LBB0_35:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_thworld,40,3                   ; @thworld
.subsections_via_symbols
