	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_VS_FacetsForPatch              ## -- Begin function VS_FacetsForPatch
	.p2align	4, 0x90
_VS_FacetsForPatch:                     ## @VS_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	$152, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r14
	movq	%rdi, %r13
	movq	%rsp, -144(%rbp)                ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_LIGHTMAP_SIZE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leaq	(,%rax,4), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movl	(%rbx), %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	(,%rax,4), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movups	(%r13), %xmm0
	movaps	%xmm0, -192(%rbp)
	movq	_drawVerts@GOTPCREL(%rip), %rax
	movq	16(%r13), %rcx
	shlq	$2, %rcx
	addq	(%rax), %rcx
	movq	%rcx, -176(%rbp)
	subq	$32, %rsp
	movq	-176(%rbp), %rax
	movq	%rax, 16(%rsp)
	movaps	-192(%rbp), %xmm0
	movups	%xmm0, (%rsp)
	movl	$8, %edi
	movl	$999, %esi                      ## imm = 0x3E7
	callq	_SubdivideMesh
	addq	$32, %rsp
	movq	%rax, %rbx
	subq	$32, %rsp
	movq	16(%rax), %rax
	movq	%rax, 16(%rsp)
	movups	(%rbx), %xmm0
	movups	%xmm0, (%rsp)
	callq	_PutMeshOnCurve
	movq	16(%rbx), %rax
	movq	%rax, 16(%rsp)
	movups	(%rbx), %xmm0
	movups	%xmm0, (%rsp)
	callq	_MakeMeshNormals
	addq	$32, %rsp
	movq	%rbx, %rdi
	callq	_RemoveLinearMeshColumnsRows
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	callq	_FreeMesh
	cmpq	$0, 24(%r13)
	movq	%r14, -104(%rbp)                ## 8-byte Spill
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
	movq	%r15, -112(%rbp)                ## 8-byte Spill
	js	LBB0_6
## %bb.1:
	movl	(%r14), %esi
	testl	%esi, %esi
	jne	LBB0_3
## %bb.2:
	movq	_samplesize@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_3:
	movq	_LIGHTMAP_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, %r12
	movq	-112(%rbp), %r8                 ## 8-byte Reload
	callq	_SubdivideMeshQuads
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	%rax, 32(%r15)
	movq	(%rax), %rcx
	cmpq	32(%r13), %rcx
	jne	LBB0_5
## %bb.4:
	movq	8(%rax), %rax
	cmpq	40(%r13), %rax
	je	LBB0_7
LBB0_5:
	leaq	L_.str(%rip), %rdi
	callq	_Error
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_7
LBB0_6:
	movq	$0, 32(%rbx)
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	shll	$2, %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memset
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	shll	$2, %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memset
	movq	%rbx, %r15
	movq	-88(%rbp), %r14                 ## 8-byte Reload
LBB0_7:
	movq	%r13, -128(%rbp)                ## 8-byte Spill
	movq	_qtrue@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r15)
	movq	_qfalse@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r15)
	movl	$2147483647, %edi               ## imm = 0x7FFFFFFF
	movl	(%r14), %eax
	addl	%edi, %eax
	addl	8(%r14), %edi
	imull	%eax, %edi
	leal	(%rdi,%rdi), %eax
	movl	%eax, (%r15)
	shll	$5, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_malloc
	movq	%rax, 8(%r15)
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, 16(%r15)
	movq	(%r14), %rsi
	xorl	%r15d, %r15d
	cmpq	$2, %rsi
	jl	LBB0_23
## %bb.8:
	movq	%r12, %r8
	movq	8(%r14), %rcx
	xorl	%edi, %edi
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	xorl	%r15d, %r15d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	(%r14), %rsi
LBB0_22:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	addl	(%r8,%rdi,4), %edx
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	incq	%rdi
	leaq	-1(%rsi), %rdx
	cmpq	%rdi, %rdx
	jle	LBB0_23
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	cmpq	$2, %rcx
	jl	LBB0_22
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	xorl	%edx, %edx
	movl	$0, -64(%rbp)                   ## 4-byte Folded Spill
	movq	%rdi, -120(%rbp)                ## 8-byte Spill
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rcx
	imulq	%rdx, %rcx
	leaq	(,%rdi,4), %rdx
	addq	16(%r14), %rdx
	leaq	(%rdx,%rcx,4), %r13
	leaq	(%rdx,%rcx,4), %rax
	addq	$4, %rax
	leaq	(%r13,%rsi,4), %r8
	leaq	4(,%rsi,4), %r9
	addq	%r13, %r9
	movslq	%r15d, %r14
	movq	%r14, -152(%rbp)                ## 8-byte Spill
	shlq	$4, %r14
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	8(%r12), %rdx
	addq	%r14, %rdx
	subq	$8, %rsp
	movq	-128(%rbp), %rdi                ## 8-byte Reload
	movq	%rbx, %rsi
	movq	%r13, %rcx
	movq	%r8, -160(%rbp)                 ## 8-byte Spill
	movq	%r9, -168(%rbp)                 ## 8-byte Spill
	movq	%rax, -136(%rbp)                ## 8-byte Spill
	pushq	%rax
	callq	_VS_GenerateFacetFor4Points
	addq	$16, %rsp
	movq	8(%r12), %rdx
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=2
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rdx,%r14)
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	movl	%esi, 4(%rdx,%r14)
	movq	-96(%rbp), %r8                  ## 8-byte Reload
	movq	-120(%rbp), %rcx                ## 8-byte Reload
	movl	(%r8,%rcx,4), %eax
	movl	%eax, 8(%rdx,%r14)
	movq	-112(%rbp), %r12                ## 8-byte Reload
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movl	(%r12,%r13,4), %eax
	movl	%eax, 12(%rdx,%r14)
	incl	%r15d
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movq	%rcx, %rdi
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=2
	movl	%r15d, -56(%rbp)                ## 4-byte Spill
	addq	%r14, %rdx
	movq	-128(%rbp), %rdi                ## 8-byte Reload
	movq	%rbx, %rsi
	movq	%r13, %rcx
	movq	-160(%rbp), %r8                 ## 8-byte Reload
	movq	-168(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %r9
	callq	_VS_GenerateFacetFor3Points
	movq	8(%r12), %rdx
	testq	%rax, %rax
	movq	%rbx, %r8
	je	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_11 Depth=2
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rdx,%r14)
	movl	-64(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%rdx,%r14)
	movq	-120(%rbp), %rax                ## 8-byte Reload
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx,%rax,4), %eax
	movl	%eax, 8(%rdx,%r14)
	movq	-112(%rbp), %r12                ## 8-byte Reload
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	(%r12,%rax,4), %eax
	movl	%eax, 12(%rdx,%r14)
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	incl	%eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movslq	%eax, %rbx
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=2
	movq	-112(%rbp), %r12                ## 8-byte Reload
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movq	-152(%rbp), %rbx                ## 8-byte Reload
LBB0_16:                                ##   in Loop: Header=BB0_11 Depth=2
	movq	-136(%rbp), %r9                 ## 8-byte Reload
	shlq	$4, %rbx
	addq	%rbx, %rdx
	movq	-128(%rbp), %rdi                ## 8-byte Reload
	movq	-104(%rbp), %rsi                ## 8-byte Reload
	movq	%r13, %rcx
	callq	_VS_GenerateFacetFor3Points
	testq	%rax, %rax
	je	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, (%rax,%rbx)
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	movl	%esi, 4(%rax,%rbx)
	movq	-120(%rbp), %rdi                ## 8-byte Reload
	movq	-96(%rbp), %r8                  ## 8-byte Reload
	movl	(%r8,%rdi,4), %ecx
	movl	%ecx, 8(%rax,%rbx)
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movl	(%r12,%r13,4), %ecx
	movl	%ecx, 12(%rax,%rbx)
	movl	-56(%rbp), %r15d                ## 4-byte Reload
	incl	%r15d
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	jmp	LBB0_19
LBB0_17:                                ##   in Loop: Header=BB0_11 Depth=2
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movl	-56(%rbp), %r15d                ## 4-byte Reload
	movq	-120(%rbp), %rdi                ## 8-byte Reload
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	-96(%rbp), %r8                  ## 8-byte Reload
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_11 Depth=2
	leaq	1(%r13), %rdx
	movq	8(%r14), %rcx
	leaq	-1(%rcx), %rax
	cmpq	%rdx, %rax
	jle	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_11 Depth=2
	addl	(%r12,%r13,4), %esi
	movl	%esi, -64(%rbp)                 ## 4-byte Spill
	movq	(%r14), %rsi
	jmp	LBB0_11
LBB0_23:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%r15d, (%rax)
	movq	%r14, %rdi
	callq	_FreeMesh
	movq	-144(%rbp), %rsp                ## 8-byte Reload
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_25
## %bb.24:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_LIGHTMAP_SIZE,4,2              ## @LIGHTMAP_SIZE
	.comm	_drawVerts,8,3                  ## @drawVerts
	.comm	_samplesize,4,2                 ## @samplesize
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Mesh lightmap miscount"

	.comm	_qtrue,4,2                      ## @qtrue
	.comm	_qfalse,4,2                     ## @qfalse
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_VS_FacetsForPatch              ; -- Begin function VS_FacetsForPatch
	.p2align	2
_VS_FacetsForPatch:                     ; @VS_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
	sub	sp, sp, #112
	mov	x19, x3
	mov	x22, x2
	mov	x23, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x20, _LIGHTMAP_SIZE@GOTPAGE
Lloh4:
	ldr	x20, [x20, _LIGHTMAP_SIZE@GOTPAGEOFF]
	ldr	w21, [x20]
	lsl	x8, x21, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x10, x8, #15
	and	x12, x10, #0x7fffffff0
	sub	x24, x9, x12
	mov	sp, x24
	mov	x9, x8
Lloh7:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh8:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	sub	x28, x8, x12
	mov	sp, x28
	ldp	x8, x9, [x0]
Lloh9:
	adrp	x10, _drawVerts@GOTPAGE
Lloh10:
	ldr	x10, [x10, _drawVerts@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x10]
	ldr	x11, [x0, #16]
	add	x10, x10, x11, lsl #2
	stp	x8, x9, [x29, #-112]
	stur	x10, [x29, #-96]
	sub	x0, x29, #112
	mov	w1, #8
	mov	w2, #999
	bl	_SubdivideMesh
	mov	x25, x0
	ldr	q0, [x0]
	ldr	x8, [x0, #16]
	stur	x8, [x29, #-96]
	stur	q0, [x29, #-112]
	sub	x0, x29, #112
	bl	_PutMeshOnCurve
	ldr	q0, [x25]
	ldr	x8, [x25, #16]
	stur	x8, [x29, #-96]
	stur	q0, [x29, #-112]
	sub	x0, x29, #112
	bl	_MakeMeshNormals
	mov	x0, x25
	bl	_RemoveLinearMeshColumnsRows
	mov	x26, x0
	mov	x0, x25
	bl	_FreeMesh
	ldr	x8, [x23, #24]
	stur	x23, [x29, #-128]               ; 8-byte Folded Spill
	tbnz	x8, #63, LBB0_4
; %bb.1:
	ldr	w8, [x22]
Lloh12:
	adrp	x9, _samplesize@GOTPAGE
Lloh13:
	ldr	x9, [x9, _samplesize@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, #0
	csel	w1, w9, w8, eq
	ldr	w2, [x20]
	mov	x0, x26
	mov	x3, x24
	mov	x4, x28
	bl	_SubdivideMeshQuads
	str	x0, [x19, #32]
	ldr	x8, [x0]
	ldr	x9, [x23, #32]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	ldr	x8, [x0, #8]
	ldur	x9, [x29, #-128]                ; 8-byte Folded Reload
	ldr	x9, [x9, #40]
	cmp	x8, x9
	b.eq	LBB0_5
LBB0_3:
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Error
	b	LBB0_5
LBB0_4:
	str	xzr, [x19, #32]
	lsl	w25, w21, #2
	mov	x0, x24
	mov	w1, #0
	mov	x2, x25
	bl	_memset
	mov	x0, x28
	mov	w1, #0
	mov	x2, x25
	bl	_memset
LBB0_5:
Lloh17:
	adrp	x8, _qtrue@GOTPAGE
Lloh18:
	ldr	x8, [x8, _qtrue@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, _qfalse@GOTPAGE
Lloh21:
	ldr	x9, [x9, _qfalse@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #24]
	ldr	w8, [x26]
	mov	w9, #2147483647
	add	w8, w8, w9
	ldr	w10, [x26, #8]
	add	w9, w10, w9
	mul	w8, w9, w8
	lsl	w9, w8, #1
	str	w9, [x19]
	lsl	w0, w8, #5
	bl	_malloc
	stp	x0, x22, [x19, #8]
	stur	x19, [x29, #-144]               ; 8-byte Folded Spill
	ldr	x8, [x26]
	cmp	x8, #2
	b.lt	LBB0_22
; %bb.6:
	stur	x22, [x29, #-136]               ; 8-byte Folded Spill
	mov	x25, #0
	stur	wzr, [x29, #-148]               ; 4-byte Folded Spill
	mov	w21, #0
	ldr	x9, [x26, #8]
	ldur	x22, [x29, #-128]               ; 8-byte Folded Reload
	stp	x28, x24, [x29, #-176]          ; 16-byte Folded Spill
	stur	x26, [x29, #-184]               ; 8-byte Folded Spill
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x26]
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	w10, [x24, x25, lsl #2]
	ldur	w12, [x29, #-148]               ; 4-byte Folded Reload
	add	w12, w10, w12
	stur	w12, [x29, #-148]               ; 4-byte Folded Spill
	add	x25, x25, #1
	sub	x10, x8, #1
	cmp	x10, x25
	b.le	LBB0_23
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	cmp	x9, #2
	b.lt	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x19, #0
	stur	wzr, [x29, #-116]               ; 4-byte Folded Spill
	stur	x25, [x29, #-192]               ; 8-byte Folded Spill
LBB0_11:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x9, [x26, #16]
	mul	x10, x8, x19
	add	x9, x9, x25, lsl #2
	add	x26, x9, x10, lsl #2
	add	x27, x26, #4
	add	x28, x26, x8, lsl #2
	add	x20, x28, #4
	ldur	x24, [x29, #-144]               ; 8-byte Folded Reload
	ldr	x8, [x24, #8]
	sxtw	x23, w21
	add	x2, x8, w21, sxtw #4
	mov	x0, x22
	ldur	x22, [x29, #-136]               ; 8-byte Folded Reload
	mov	x1, x22
	mov	x3, x26
	mov	x4, x28
	mov	x5, x20
	mov	x6, x27
	bl	_VS_GenerateFacetFor4Points
	ldr	x8, [x24, #8]
	cbz	x0, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=2
	add	x8, x8, x23, lsl #4
	ldur	w9, [x29, #-148]                ; 4-byte Folded Reload
	ldur	w12, [x29, #-116]               ; 4-byte Folded Reload
	stp	w9, w12, [x8]
	ldp	x28, x24, [x29, #-176]          ; 16-byte Folded Reload
	ldr	w9, [x24, x25, lsl #2]
	str	w9, [x8, #8]
	ldr	w9, [x28, x19, lsl #2]
	str	w9, [x8, #12]
	add	w21, w21, #1
	ldur	x22, [x29, #-128]               ; 8-byte Folded Reload
	b	LBB0_18
LBB0_13:                                ;   in Loop: Header=BB0_11 Depth=2
	stur	x21, [x29, #-160]               ; 8-byte Folded Spill
	add	x2, x8, x23, lsl #4
	ldur	x0, [x29, #-128]                ; 8-byte Folded Reload
	mov	x1, x22
	mov	x3, x26
	mov	x4, x28
	mov	x5, x20
	bl	_VS_GenerateFacetFor3Points
	ldr	x8, [x24, #8]
	mov	x4, x20
	cbz	x0, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_11 Depth=2
	add	x9, x8, x23, lsl #4
	ldur	w11, [x29, #-148]               ; 4-byte Folded Reload
	ldur	w10, [x29, #-116]               ; 4-byte Folded Reload
	stp	w11, w10, [x9]
	ldp	x28, x24, [x29, #-176]          ; 16-byte Folded Reload
	ldur	x10, [x29, #-192]               ; 8-byte Folded Reload
	ldr	w10, [x24, x10, lsl #2]
	str	w10, [x9, #8]
	ldr	w10, [x28, x19, lsl #2]
	str	w10, [x9, #12]
	ldur	x9, [x29, #-160]                ; 8-byte Folded Reload
	add	w9, w9, #1
	sxtw	x23, w9
                                        ; kill: def $w9 killed $w9 killed $x9 def $x9
	stur	x9, [x29, #-160]                ; 8-byte Folded Spill
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_11 Depth=2
	ldp	x28, x24, [x29, #-176]          ; 16-byte Folded Reload
LBB0_16:                                ;   in Loop: Header=BB0_11 Depth=2
	mov	x5, x27
	add	x2, x8, x23, lsl #4
	ldp	x1, x22, [x29, #-136]           ; 16-byte Folded Reload
	mov	x0, x22
	mov	x3, x26
	bl	_VS_GenerateFacetFor3Points
	cbz	x0, LBB0_21
; %bb.17:                               ;   in Loop: Header=BB0_11 Depth=2
	ldur	x8, [x29, #-144]                ; 8-byte Folded Reload
	ldr	x8, [x8, #8]
	add	x8, x8, x23, lsl #4
	ldur	w9, [x29, #-148]                ; 4-byte Folded Reload
	ldur	w12, [x29, #-116]               ; 4-byte Folded Reload
	stp	w9, w12, [x8]
	ldur	x25, [x29, #-192]               ; 8-byte Folded Reload
	ldr	w9, [x24, x25, lsl #2]
	str	w9, [x8, #8]
	ldr	w9, [x28, x19, lsl #2]
	str	w9, [x8, #12]
	ldur	x21, [x29, #-160]               ; 8-byte Folded Reload
	add	w21, w21, #1
LBB0_18:                                ;   in Loop: Header=BB0_11 Depth=2
	ldur	x26, [x29, #-184]               ; 8-byte Folded Reload
LBB0_19:                                ;   in Loop: Header=BB0_11 Depth=2
	add	x10, x19, #1
	ldr	x9, [x26, #8]
	sub	x8, x9, #1
	cmp	x8, x10
	b.le	LBB0_7
; %bb.20:                               ;   in Loop: Header=BB0_11 Depth=2
	ldr	w8, [x28, x19, lsl #2]
	add	w12, w8, w12
	stur	w12, [x29, #-116]               ; 4-byte Folded Spill
	ldr	x8, [x26]
	mov	x19, x10
	b	LBB0_11
LBB0_21:                                ;   in Loop: Header=BB0_11 Depth=2
	ldp	x25, x26, [x29, #-192]          ; 16-byte Folded Reload
	ldur	x21, [x29, #-160]               ; 8-byte Folded Reload
	ldur	w12, [x29, #-116]               ; 4-byte Folded Reload
	b	LBB0_19
LBB0_22:
	mov	w21, #0
LBB0_23:
	ldur	x8, [x29, #-144]                ; 8-byte Folded Reload
	str	w21, [x8]
	mov	x0, x26
	bl	_FreeMesh
	ldur	x8, [x29, #-88]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_25
; %bb.24:
	sub	sp, x29, #80
	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
LBB0_25:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_LIGHTMAP_SIZE,4,2              ; @LIGHTMAP_SIZE
	.comm	_drawVerts,8,3                  ; @drawVerts
	.comm	_samplesize,4,2                 ; @samplesize
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Mesh lightmap miscount"

	.comm	_qtrue,4,2                      ; @qtrue
	.comm	_qfalse,4,2                     ; @qfalse
.subsections_via_symbols
