	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_TH_FindTetrahedron1            ## -- Begin function TH_FindTetrahedron1
	.p2align	4, 0x90
_TH_FindTetrahedron1:                   ## @TH_FindTetrahedron1
	.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	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movq	16(%rdi), %r14
	testq	%r14, %r14
	je	LBB0_29
## %bb.1:
	movq	%rsi, %r13
	movq	%rsi, -96(%rbp)                 ## 8-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	16(%r14), %r14
	testq	%r14, %r14
	je	LBB0_29
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %eax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	xorl	(%rcx), %eax
	cmpl	$2, %eax
	jb	LBB0_2
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	(%rax), %edi
	callq	_abs
	movslq	%eax, %rbx
	movq	8(%r14), %rax
	movl	(%rax), %edi
	callq	_abs
	movl	$1, %r15d
	xorl	%r12d, %r12d
	cmpq	%rax, %rbx
	je	LBB0_13
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r14), %rax
	movl	4(%rax), %edi
	callq	_abs
	cmpq	%rax, %rbx
	jne	LBB0_7
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	$2, %r15d
	jmp	LBB0_13
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r14), %rax
	movl	8(%rax), %edi
	callq	_abs
	cmpq	%rax, %rbx
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%r12d, %r12d
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	xorl	%r15d, %r15d
	jmp	LBB0_13
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	4(%rax), %edi
	callq	_abs
	movslq	%eax, %rbx
	movq	8(%r14), %rax
	movl	(%rax), %edi
	callq	_abs
	movl	$1, %r12d
	cmpq	%rax, %rbx
	jne	LBB0_11
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	leal	1(%r12), %ecx
	movzbl	%cl, %ecx
	imull	$171, %ecx, %edx
	shrl	$9, %edx
	leal	(%rdx,%rdx,2), %edx
	subb	%dl, %cl
	movzbl	%cl, %ecx
	movl	(%rax,%rcx,4), %edi
	movq	_thworld@GOTPCREL(%rip), %rax
	movq	8(%rax), %rbx
	testl	%edi, %edi
	js	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rbx,%rdi,8), %rax
	addq	$4, %rax
	jmp	LBB0_16
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_abs
	movq	(%rbx,%rax,8), %rax
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rax), %eax
	movl	%eax, -84(%rbp)                 ## 4-byte Spill
	movq	8(%r14), %rax
	movl	(%rax,%r15,4), %edi
	movq	_thworld@GOTPCREL(%rip), %rax
	movq	8(%rax), %rbx
	testl	%edi, %edi
	js	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rbx,%rdi,8), %rax
	addq	$4, %rax
	jmp	LBB0_19
LBB0_18:                                ##   in Loop: Header=BB0_3 Depth=1
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_abs
	movq	(%rbx,%rax,8), %rax
LBB0_19:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rax), %r15d
	movl	-84(%rbp), %edi                 ## 4-byte Reload
	movl	%r15d, %esi
	callq	_TH_TryEdge
	testq	%rax, %rax
	je	LBB0_2
## %bb.20:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	%r12d, %ecx
	movl	(%rax,%rcx,4), %r12d
	movq	%r12, %rbx
	shrq	$29, %rbx
	andl	$4, %ebx
	movq	_thworld@GOTPCREL(%rip), %rax
	movq	8(%rax), %r13
	movl	%r12d, %edi
	callq	_abs
	movq	(%r13,%rax,8), %rax
	movl	(%rax,%rbx), %r13d
	movq	_thworld@GOTPCREL(%rip), %rax
	movq	8(%rax), %rbx
	movl	%r12d, %edi
	callq	_abs
	movq	(%rbx,%rax,8), %rax
	movl	-84(%rbp), %ebx                 ## 4-byte Reload
	notl	%r12d
	shrl	$31, %r12d
	movl	(%rax,%r12,4), %r12d
	movl	%ebx, -60(%rbp)
	movl	%r15d, -56(%rbp)
	movl	%r13d, -52(%rbp)
	movq	-96(%rbp), %r13                 ## 8-byte Reload
	leaq	-60(%rbp), %rdi
	callq	_TH_FindTriangle
	movl	%eax, 8(%r13)
	testl	%eax, %eax
	jne	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_3 Depth=1
	leaq	-60(%rbp), %rdi
	callq	_TH_TryTriangle
	testq	%rax, %rax
	je	LBB0_2
LBB0_22:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	%r15d, -72(%rbp)
	movl	%ebx, -68(%rbp)
	movl	%r12d, -64(%rbp)
	leaq	-72(%rbp), %rdi
	callq	_TH_FindTriangle
	movl	%eax, 12(%r13)
	testl	%eax, %eax
	jne	LBB0_32
## %bb.23:                              ##   in Loop: Header=BB0_3 Depth=1
	leaq	-72(%rbp), %rdi
	callq	_TH_TryTriangle
	testq	%rax, %rax
	je	LBB0_2
	jmp	LBB0_32
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r14), %rax
	movl	4(%rax), %edi
	callq	_abs
	cmpq	%rax, %rbx
	je	LBB0_12
## %bb.24:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r14), %rax
	movl	8(%rax), %edi
	callq	_abs
	cmpq	%rax, %rbx
	je	LBB0_9
## %bb.25:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	8(%rax), %edi
	callq	_abs
	movslq	%eax, %rbx
	movq	8(%r14), %rax
	movl	(%rax), %edi
	callq	_abs
	movl	$2, %r12d
	cmpq	%rax, %rbx
	je	LBB0_13
## %bb.26:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r14), %rax
	movl	4(%rax), %edi
	callq	_abs
	cmpq	%rax, %rbx
	je	LBB0_12
## %bb.28:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r14), %rax
	movl	8(%rax), %edi
	callq	_abs
	cmpq	%rax, %rbx
	jne	LBB0_2
	jmp	LBB0_9
LBB0_29:
	xorl	%ebx, %ebx
LBB0_30:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_36
## %bb.31:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_32:
	movq	_thworld@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	subq	%rax, %rcx
	shrq	$3, %rcx
	imull	$-1431655765, %ecx, %ecx        ## imm = 0xAAAAAAAB
	movl	%ecx, (%r13)
	subq	%rax, %r14
	shrq	$3, %r14
	imull	$-1431655765, %r14d, %eax       ## imm = 0xAAAAAAAB
	movl	%eax, 4(%r13)
	cmpl	$0, 8(%r13)
	jne	LBB0_34
## %bb.33:
	leaq	-60(%rbp), %rdi
	callq	_TH_CreateTriangle
	movl	%eax, 8(%r13)
LBB0_34:
	movl	$1, %ebx
	cmpl	$0, 12(%r13)
	jne	LBB0_30
## %bb.35:
	leaq	-72(%rbp), %rdi
	callq	_TH_CreateTriangle
	movl	%eax, 12(%r13)
	jmp	LBB0_30
LBB0_36:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_thworld,16,3                   ## @thworld
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_TH_FindTetrahedron1            ; -- Begin function TH_FindTetrahedron1
	.p2align	2
_TH_FindTetrahedron1:                   ; @TH_FindTetrahedron1
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	x24, [x0, #16]
	cbz	x24, LBB0_36
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	mov	w26, #171
Lloh3:
	adrp	x25, _thworld@GOTPAGE
Lloh4:
	ldr	x25, [x25, _thworld@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x24, [x24, #16]
	cbz	x24, LBB0_36
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20]
	ldr	w9, [x24]
	eor	w8, w9, w8
	cmp	w8, #2
	b.lo	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x20, #8]
	ldr	w0, [x8]
	bl	_abs
	sxtw	x21, w0
	ldr	x8, [x24, #8]
	ldr	w0, [x8]
	bl	_abs
	cmp	x21, x0
	b.ne	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w23, #0
	mov	w22, #1
	b	LBB0_22
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x24, #8]
	ldr	w0, [x8, #4]
	bl	_abs
	cmp	x21, x0
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w23, #0
	mov	w22, #2
	b	LBB0_22
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x24, #8]
	ldr	w0, [x8, #8]
	bl	_abs
	cmp	x21, x0
	b.ne	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w23, #0
	mov	x22, #0
	b	LBB0_22
LBB0_10:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x20, #8]
	ldr	w0, [x8, #4]
	bl	_abs
	sxtw	x21, w0
	ldr	x8, [x24, #8]
	ldr	w0, [x8]
	bl	_abs
	cmp	x21, x0
	b.ne	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	w23, #1
	mov	w22, #1
	b	LBB0_22
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x24, #8]
	ldr	w0, [x8, #4]
	bl	_abs
	cmp	x21, x0
	b.ne	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	w23, #1
	mov	w22, #2
	b	LBB0_22
LBB0_14:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x24, #8]
	ldr	w0, [x8, #8]
	bl	_abs
	cmp	x21, x0
	b.ne	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x22, #0
	mov	w23, #1
	b	LBB0_22
LBB0_16:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x20, #8]
	ldr	w0, [x8, #8]
	bl	_abs
	sxtw	x21, w0
	ldr	x8, [x24, #8]
	ldr	w0, [x8]
	bl	_abs
	cmp	x21, x0
	b.ne	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	w23, #2
	mov	w22, #1
	b	LBB0_22
LBB0_18:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x24, #8]
	ldr	w0, [x8, #4]
	bl	_abs
	cmp	x21, x0
	b.ne	LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	w22, #2
	mov	x23, x22
	b	LBB0_22
LBB0_20:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x24, #8]
	ldr	w0, [x8, #8]
	bl	_abs
	cmp	x21, x0
	b.ne	LBB0_2
; %bb.21:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x22, #0
	mov	w23, #2
LBB0_22:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x20, #8]
	add	w9, w23, #1
	mul	w10, w9, w26
	lsr	w10, w10, #9
	add	w10, w10, w10, lsl #1
	sub	w9, w9, w10
	and	x9, x9, #0xff
	ldr	w0, [x8, x9, lsl #2]
	ldr	x21, [x25, #8]
	tbnz	w0, #31, LBB0_24
; %bb.23:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x21, x0, lsl #3]
	add	x8, x8, #4
	b	LBB0_25
LBB0_24:                                ;   in Loop: Header=BB0_3 Depth=1
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_abs
	ldr	x8, [x21, x0, lsl #3]
LBB0_25:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w21, [x8]
	ldr	x8, [x24, #8]
	ldr	w0, [x8, x22, lsl #2]
	ldr	x22, [x25, #8]
	tbnz	w0, #31, LBB0_27
; %bb.26:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x22, x0, lsl #3]
	add	x8, x8, #4
	b	LBB0_28
LBB0_27:                                ;   in Loop: Header=BB0_3 Depth=1
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_abs
	ldr	x8, [x22, x0, lsl #3]
LBB0_28:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w22, [x8]
	mov	x0, x21
	mov	x1, x22
	bl	_TH_TryEdge
	cbz	x0, LBB0_2
; %bb.29:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x20, #8]
	ldr	w23, [x8, w23, uxtw #2]
	lsr	x8, x23, #29
	and	x27, x8, #0x4
	ldr	x28, [x25, #8]
	mov	x0, x23
	bl	_abs
	ldr	x8, [x28, x0, lsl #3]
	ldr	w27, [x8, x27]
	ldr	x28, [x25, #8]
	mov	x0, x23
	bl	_abs
	ldr	x8, [x28, x0, lsl #3]
	mvn	w9, w23
	lsr	w9, w9, #31
	ldr	w23, [x8, w9, uxtw #2]
	stp	w21, w22, [sp, #12]
	str	w27, [sp, #20]
	add	x0, sp, #12
	bl	_TH_FindTriangle
	str	w0, [x19, #8]
	cbnz	w0, LBB0_31
; %bb.30:                               ;   in Loop: Header=BB0_3 Depth=1
	add	x0, sp, #12
	bl	_TH_TryTriangle
	cbz	x0, LBB0_2
LBB0_31:                                ;   in Loop: Header=BB0_3 Depth=1
	stp	w22, w21, [sp]
	str	w23, [sp, #8]
	mov	x0, sp
	bl	_TH_FindTriangle
	str	w0, [x19, #12]
	cbnz	w0, LBB0_33
; %bb.32:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, sp
	bl	_TH_TryTriangle
	cbz	x0, LBB0_2
LBB0_33:
	ldr	x8, [x25]
	sub	x9, x20, x8
	lsr	x9, x9, #3
	mov	w10, #43691
	movk	w10, #43690, lsl #16
	mul	w9, w9, w10
	sub	x8, x24, x8
	lsr	x8, x8, #3
	mul	w8, w8, w10
	stp	w9, w8, [x19]
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_39
; %bb.34:
	ldr	w8, [x19, #12]
	cbz	w8, LBB0_40
LBB0_35:
	mov	w0, #1
	b	LBB0_37
LBB0_36:
	mov	w0, #0
LBB0_37:
	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_41
; %bb.38:
	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_39:
	add	x0, sp, #12
	bl	_TH_CreateTriangle
	str	w0, [x19, #8]
	ldr	w8, [x19, #12]
	cbnz	w8, LBB0_35
LBB0_40:
	mov	x0, sp
	bl	_TH_CreateTriangle
	str	w0, [x19, #12]
	mov	w0, #1
	b	LBB0_37
LBB0_41:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_thworld,16,3                   ; @thworld
.subsections_via_symbols
