	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FacetsForTriangleSurface       ## -- Begin function FacetsForTriangleSurface
	.p2align	4, 0x90
_FacetsForTriangleSurface:              ## @FacetsForTriangleSurface
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	_qfalse@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rdx)
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movslq	(%rdi), %rax
	imulq	$1431655766, %rax, %rdi         ## imm = 0x55555556
	movq	%rdi, %rax
	shrq	$63, %rax
	shrq	$32, %rdi
	addl	%eax, %edi
	movl	%edi, (%rdx)
	shll	$2, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_malloc
	movq	%rax, 8(%rbx)
	movq	%r14, 16(%rbx)
	movl	(%rbx), %eax
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_drawIndexes@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movslq	4(%rdi), %rdx
	movslq	%r15d, %r10
	leaq	(%r10,%r10,2), %rsi
	addq	%rdx, %rsi
	movq	%rbx, %r11
	movslq	(%rcx,%rsi,4), %rbx
	movslq	%esi, %rsi
	movl	4(%rcx,%rsi,4), %r8d
	movl	8(%rcx,%rsi,4), %r9d
	movq	_drawVerts@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movslq	8(%rdi), %rdi
	addq	%rdi, %rbx
	leaq	(%rdx,%rbx,4), %rbx
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	leal	(%rdi,%r8), %ebx
	movslq	%ebx, %rbx
	leaq	(%rdx,%rbx,4), %r13
	leal	(%rdi,%r9), %ebx
	movslq	%ebx, %rbx
	leaq	(%rdx,%rbx,4), %r12
	movq	%r11, %rbx
	decl	%eax
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movslq	%r14d, %r14
	cmpl	%eax, %r10d
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%r9d, 12(%rcx,%rsi,4)
	jne	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%r8d, 16(%rcx,%rsi,4)
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movslq	20(%rcx,%rsi,4), %rax
	addq	%rdi, %rax
	leaq	(%rdx,%rax,4), %rcx
	leaq	(,%r14,4), %rdi
	addq	8(%rbx), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r13, %rdx
	movq	%r12, %r8
	callq	_CM_GenerateFacetFor4Points
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	incl	%r14d
	incl	%r15d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	shlq	$2, %r14
	addq	8(%rbx), %r14
	movq	%r14, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r13, %rdx
	movq	%r12, %rcx
	callq	_CM_GenerateFacetFor3Points
	cmpq	$1, %rax
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	sbbl	$-1, %r14d
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	incl	%r15d
	movl	(%rbx), %eax
	cmpl	%eax, %r15d
	jl	LBB0_3
	jmp	LBB0_10
LBB0_1:
	xorl	%r14d, %r14d
LBB0_10:
	movl	%r14d, (%rbx)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_qfalse,4,2                     ## @qfalse
	.comm	_drawIndexes,8,3                ## @drawIndexes
	.comm	_drawVerts,8,3                  ## @drawVerts
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FacetsForTriangleSurface       ; -- Begin function FacetsForTriangleSurface
	.p2align	2
_FacetsForTriangleSurface:              ; @FacetsForTriangleSurface
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x2
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _qfalse@GOTPAGE
Lloh1:
	ldr	x8, [x8, _qfalse@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x2, #24]
	ldrsw	x8, [x0]
	mov	w9, #21846
	movk	w9, #21845, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	lsr	x8, x8, #32
	add	w8, w8, w9
	str	w8, [x2]
	lsl	w0, w8, #2
	bl	_malloc
	stp	x0, x21, [x19, #8]
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.1:
	mov	w25, #0
	mov	w24, #0
Lloh3:
	adrp	x26, _drawIndexes@GOTPAGE
Lloh4:
	ldr	x26, [x26, _drawIndexes@GOTPAGEOFF]
Lloh5:
	adrp	x27, _drawVerts@GOTPAGE
Lloh6:
	ldr	x27, [x27, _drawVerts@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x26]
	sxtw	x10, w25
	add	x11, x10, w25, sxtw #1
	ldp	w12, w10, [x20, #4]
                                        ; kill: def $w12 killed $w12 def $x12
	sxtw	x12, w12
	add	x14, x12, x11
	add	x11, x9, x14, lsl #2
	ldp	w16, w13, [x11]
	ldr	w15, [x11, #8]
	ldr	x12, [x27]
	add	w16, w10, w16
	add	x21, x12, w16, sxtw #2
	add	w16, w10, w13
	add	x22, x12, w16, sxtw #2
	add	w16, w10, w15
	add	x23, x12, w16, sxtw #2
	sub	w8, w8, #1
	cmp	w25, w8
	b.eq	LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x11, #12]
	cmp	w8, w15
	b.ne	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x8, x9, x14, lsl #2
	ldr	w8, [x8, #16]
	cmp	w8, w13
	b.ne	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x11, #20]
	add	w8, w8, w10
	add	x3, x12, w8, sxtw #2
	ldr	x8, [x19, #8]
	add	x0, x8, w24, sxtw #2
	mov	x1, x21
	mov	x2, x22
	mov	x4, x23
	bl	_CM_GenerateFacetFor4Points
	cbz	x0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w24, w24, #1
	add	w25, w25, #1
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x19, #8]
	add	x0, x8, w24, sxtw #2
	mov	x1, x21
	mov	x2, x22
	mov	x3, x23
	bl	_CM_GenerateFacetFor3Points
	cmp	x0, #0
	cinc	w24, w24, ne
LBB0_8:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	w25, w25, #1
	ldr	w8, [x19]
	cmp	w25, w8
	b.lt	LBB0_2
	b	LBB0_10
LBB0_9:
	mov	w24, #0
LBB0_10:
	str	w24, [x19]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_qfalse,4,2                     ; @qfalse
	.comm	_drawIndexes,8,3                ; @drawIndexes
	.comm	_drawVerts,8,3                  ; @drawVerts
.subsections_via_symbols
