	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FacetsForPatch                 ## -- Begin function FacetsForPatch
	.p2align	4, 0x90
_FacetsForPatch:                        ## @FacetsForPatch
	.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	%rdx, %r12
	movq	%rsi, %r15
	movq	_drawVerts@GOTPCREL(%rip), %rcx
	movq	(%rdi), %rax
	movq	8(%rdi), %rsi
	shlq	$2, %rsi
	addq	(%rcx), %rsi
	movq	%rax, %rdi
	movl	$8, %edx
	movl	$999, %ecx                      ## imm = 0x3E7
	callq	_SubdivideMesh
	movq	%rax, %r14
	movq	(%rax), %rdi
	movq	8(%rax), %rsi
	callq	_PutMeshOnCurve
	movq	(%r14), %rdi
	movq	8(%r14), %rsi
	callq	_MakeMeshNormals
	movq	%r14, %rdi
	callq	_RemoveLinearMeshColumnsRows
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_FreeMesh
	movq	_qtrue@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r12)
	movl	(%rbx), %eax
	movl	4(%rbx), %edi
	decl	%eax
	decl	%edi
	imull	%eax, %edi
	leal	(%rdi,%rdi), %eax
	movl	%eax, (%r12)
	shll	$3, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_malloc
	movq	%rax, 8(%r12)
	movq	%r15, 16(%r12)
	movl	(%rbx), %eax
	xorl	%r14d, %r14d
	cmpl	$2, %eax
	jl	LBB0_9
## %bb.1:
	movl	4(%rbx), %ecx
	xorl	%edx, %edx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	incq	%rsi
	leal	-1(%rax), %edx
	movslq	%edx, %rdx
	movq	%rsi, %rdi
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	cmpq	%rdx, %rsi
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	jge	LBB0_9
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	cmpl	$2, %ecx
	jl	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r15d, %r15d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=2
	addq	8(%r13), %r12
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rcx
	callq	_CM_GenerateFacetFor3Points
	cmpq	$1, %rax
	sbbl	$-1, %r14d
	movslq	%r14d, %r14
	leaq	(,%r14,4), %rdi
	addq	8(%r13), %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	callq	_CM_GenerateFacetFor3Points
	cmpq	$1, %rax
	sbbl	$-1, %r14d
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=2
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	incl	%r15d
	movl	(%rbx), %eax
	movl	4(%rbx), %ecx
	leal	-1(%rcx), %edx
	cmpl	%edx, %r15d
	jge	LBB0_8
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movslq	%eax, %rcx
	imull	%r15d, %eax
	cltq
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	leaq	(,%rdx,4), %rdx
	addq	8(%rbx), %rdx
	leaq	(%rdx,%rax,4), %rbx
	leaq	(%rdx,%rax,4), %r8
	addq	$4, %r8
	leaq	(%rbx,%rcx,4), %rdx
	leaq	(%rbx,%rcx,4), %rcx
	addq	$4, %rcx
	movslq	%r14d, %r12
	shlq	$2, %r12
	movq	8(%r13), %rdi
	addq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	%r8, -88(%rbp)                  ## 8-byte Spill
	callq	_CM_GenerateFacetFor4Points
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	incl	%r14d
	jmp	LBB0_7
LBB0_9:
	movl	%r14d, (%r12)
	movq	%rbx, %rdi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_FreeMesh                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_drawVerts,8,3                  ## @drawVerts
	.comm	_qtrue,4,2                      ## @qtrue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FacetsForPatch                 ; -- Begin function FacetsForPatch
	.p2align	2
_FacetsForPatch:                        ; @FacetsForPatch
	.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
Lloh0:
	adrp	x8, _drawVerts@GOTPAGE
Lloh1:
	ldr	x8, [x8, _drawVerts@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldp	x0, x9, [x0]
	add	x1, x8, x9, lsl #2
	mov	w2, #8
	mov	w3, #999
	bl	_SubdivideMesh
	mov	x22, x0
	ldr	x0, [x0]
	ldr	x1, [x22, #8]
	bl	_PutMeshOnCurve
	ldp	x0, x1, [x22]
	bl	_MakeMeshNormals
	mov	x0, x22
	bl	_RemoveLinearMeshColumnsRows
	mov	x20, x0
	mov	x0, x22
	bl	_FreeMesh
Lloh3:
	adrp	x8, _qtrue@GOTPAGE
Lloh4:
	ldr	x8, [x8, _qtrue@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x19, #24]
	ldp	w8, w9, [x20]
	sub	w8, w8, #1
	sub	w9, w9, #1
	mul	w8, w9, w8
	lsl	w9, w8, #1
	str	w9, [x19]
	lsl	w0, w8, #3
	bl	_malloc
	stp	x0, x21, [x19, #8]
	ldr	w9, [x20]
	cmp	w9, #2
	b.lt	LBB0_9
; %bb.1:
	mov	x25, #0
	mov	w8, #0
	ldr	w10, [x20, #4]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x25, x25, #1
	sub	w11, w9, #1
	cmp	x25, w11, sxtw
	b.ge	LBB0_10
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	cmp	w10, #2
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w26, #0
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=2
	ldr	x8, [x19, #8]
	add	x0, x8, x27, lsl #2
	mov	x1, x22
	mov	x2, x24
	mov	x3, x23
	bl	_CM_GenerateFacetFor3Points
	cmp	x0, #0
	cinc	w24, w27, ne
	ldr	x8, [x19, #8]
	add	x0, x8, w24, sxtw #2
	mov	x1, x22
	mov	x2, x23
	mov	x3, x21
	bl	_CM_GenerateFacetFor3Points
	cmp	x0, #0
	cinc	w8, w24, ne
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	add	w26, w26, #1
	ldp	w9, w10, [x20]
	sub	w11, w10, #1
	cmp	w26, w11
	b.ge	LBB0_2
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x10, [x20, #8]
	mul	w11, w9, w26
	add	x10, x10, x25, lsl #2
	add	x22, x10, w11, sxtw #2
	add	x21, x22, #4
	add	x24, x22, w9, sxtw #2
	add	x23, x24, #4
	ldr	x9, [x19, #8]
	sxtw	x27, w8
	add	x0, x9, w8, sxtw #2
	mov	x1, x22
	mov	x2, x24
	mov	x3, x23
	mov	x4, x21
	bl	_CM_GenerateFacetFor4Points
	cbz	x0, LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	add	w8, w27, #1
	b	LBB0_6
LBB0_9:
	mov	w8, #0
LBB0_10:
	str	w8, [x19]
	mov	x0, x20
	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
	b	_FreeMesh
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_drawVerts,8,3                  ; @drawVerts
	.comm	_qtrue,4,2                      ; @qtrue
.subsections_via_symbols
