	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function SurfaceAsTriFan
_SurfaceAsTriFan:                       ## @SurfaceAsTriFan
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_numDrawVerts@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	_MAX_MAP_DRAW_VERTS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_Error
	movq	(%r14), %rax
LBB0_2:
	movq	_drawVerts@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r11
	leaq	(%rax,%rax,4), %r15
	leaq	(%r11,%r15,8), %r12
	incq	%rax
	movq	%rax, (%r14)
	movl	4(%rbx), %ecx
	testl	%ecx, %ecx
	jle	LBB0_3
## %bb.4:
	movslq	(%rbx), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	(%r11,%rax,8), %r13
	movq	%r11, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	leaq	(%r11,%r15,8), %r15
	addq	$8, %r15
	pxor	%xmm0, %xmm0
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movdqa	%xmm0, -64(%rbp)                ## 16-byte Spill
	movq	(%r12), %rdi
	movq	(%r13), %rsi
	movq	%rdi, %rdx
	callq	_VectorAdd
	movq	8(%r13), %rax
	movl	(%rax), %ecx
	movq	(%r15), %rsi
	addl	%ecx, (%rsi)
	movl	4(%rax), %eax
	addl	%eax, 4(%rsi)
	movq	16(%r13), %rax
	movl	(%rax), %ecx
	movq	8(%r15), %rdi
	addl	%ecx, (%rdi)
	movl	4(%rax), %eax
	addl	%eax, 4(%rdi)
	movq	24(%r13), %rax
	movdqu	(%rax), %xmm0
	movdqa	-64(%rbp), %xmm1                ## 16-byte Reload
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, -64(%rbp)                ## 16-byte Spill
	movdqa	-64(%rbp), %xmm0                ## 16-byte Reload
	incl	%r14d
	movl	4(%rbx), %ecx
	addq	$40, %r13
	cmpl	%ecx, %r14d
	jl	LBB0_5
## %bb.6:
	movq	_drawVerts@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	movq	-80(%rbp), %r11                 ## 8-byte Reload
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_7
LBB0_3:
	movq	8(%r11,%r15,8), %rsi
	movq	16(%r11,%r15,8), %rdi
	pxor	%xmm0, %xmm0
	movq	%r11, %r8
LBB0_7:
	movq	(%r12), %r10
	movl	(%r10), %eax
	movl	4(%r10), %r9d
	cltd
	idivl	%ecx
	movl	%eax, (%r10)
	movl	%r9d, %eax
	cltd
	idivl	4(%rbx)
	movl	%eax, 4(%r10)
	movl	8(%r10), %eax
	cltd
	idivl	4(%rbx)
	movl	%eax, 8(%r10)
	movl	(%rsi), %eax
	movl	4(%rsi), %ecx
	cltd
	idivl	4(%rbx)
	movl	%eax, (%rsi)
	movl	%ecx, %eax
	cltd
	idivl	4(%rbx)
	movl	%eax, 4(%rsi)
	movl	(%rdi), %eax
	movl	4(%rdi), %ecx
	cltd
	idivl	4(%rbx)
	movl	%eax, (%rdi)
	movl	%ecx, %eax
	cltd
	idivl	4(%rbx)
	movl	%eax, 4(%rdi)
	movd	%xmm0, %eax
	cltd
	idivl	4(%rbx)
	movq	24(%r11,%r15,8), %rsi
	movl	%eax, (%rsi)
	pextrd	$1, %xmm0, %eax
	cltd
	idivl	4(%rbx)
	pextrd	$2, %xmm0, %ecx
	movl	%eax, 4(%rsi)
	movl	%ecx, %eax
	cltd
	idivl	4(%rbx)
	movl	%eax, 8(%rsi)
	pextrd	$3, %xmm0, %eax
	cltd
	idivl	4(%rbx)
	movl	%eax, 12(%rsi)
	movslq	(%rbx), %rax
	leaq	(%rax,%rax,4), %rax
	movl	32(%r8,%rax,8), %edi
	movl	32(%r11,%r15,8), %esi
	callq	_VectorCopy
	movq	_numDrawIndexes@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	movslq	4(%rbx), %rax
	leaq	(%rax,%rax,2), %rcx
	leaq	(%rsi,%rcx), %rdx
	movq	_MAX_MAP_DRAW_INDEXES@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rdx
	jle	LBB0_9
## %bb.8:
	leaq	L_.str.1(%rip), %rdi
	callq	_Error
	movq	(%r14), %rsi
	movl	4(%rbx), %eax
	leal	(%rax,%rax,2), %ecx
LBB0_9:
	movq	%rsi, 16(%rbx)
	movl	%ecx, 8(%rbx)
	testl	%eax, %eax
	jle	LBB0_13
## %bb.10:
	movq	_drawIndexes@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	%eax, (%rdi,%rsi,4)
	movl	%ecx, 4(%rdi,%rsi,4)
	incl	%ecx
	movl	%ecx, %eax
	cltd
	idivl	4(%rbx)
	movl	%edx, 8(%rdi,%rsi,4)
	addq	$3, %rsi
	movl	4(%rbx), %eax
	cmpl	%eax, %ecx
	jl	LBB0_11
## %bb.12:
	movq	%rsi, (%r14)
LBB0_13:
	incl	%eax
	movl	%eax, 4(%rbx)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_numDrawVerts,8,3               ## @numDrawVerts
	.comm	_MAX_MAP_DRAW_VERTS,8,3         ## @MAX_MAP_DRAW_VERTS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MAX_MAP_DRAW_VERTS"

	.comm	_drawVerts,8,3                  ## @drawVerts
	.comm	_numDrawIndexes,8,3             ## @numDrawIndexes
	.comm	_MAX_MAP_DRAW_INDEXES,8,3       ## @MAX_MAP_DRAW_INDEXES
L_.str.1:                               ## @.str.1
	.asciz	"MAX_MAP_DRAWINDEXES"

	.comm	_drawIndexes,8,3                ## @drawIndexes
	.no_dead_strip	_SurfaceAsTriFan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function SurfaceAsTriFan
_SurfaceAsTriFan:                       ; @SurfaceAsTriFan
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x0
Lloh0:
	adrp	x20, _numDrawVerts@GOTPAGE
Lloh1:
	ldr	x20, [x20, _numDrawVerts@GOTPAGEOFF]
	ldr	x15, [x20]
Lloh2:
	adrp	x8, _MAX_MAP_DRAW_VERTS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAX_MAP_DRAW_VERTS@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x15, x8
	b.ne	LBB0_2
; %bb.1:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Error
	ldr	x15, [x20]
LBB0_2:
Lloh7:
	adrp	x8, _drawVerts@GOTPAGE
Lloh8:
	ldr	x8, [x8, _drawVerts@GOTPAGEOFF]
Lloh9:
	ldr	x16, [x8]
	mov	w8, #40
	madd	x26, x15, x8, x16
	add	x8, x15, #1
	str	x8, [x20]
	ldr	w11, [x19, #4]
	cmp	w11, #0
	b.le	LBB0_6
; %bb.3:
	mov	w28, #0
	mov	w25, #0
	mov	w24, #0
	mov	w23, #0
	mov	w22, #0
	ldrsw	x8, [x19]
	mov	w9, #40
	madd	x27, x8, x9, x16
	stp	x16, x15, [sp]                  ; 16-byte Folded Spill
	madd	x8, x15, x9, x16
	add	x21, x8, #8
	add	x20, x8, #16
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x26]
	ldr	x1, [x27]
	mov	x2, x0
	bl	_VectorAdd
	ldp	x8, x10, [x27, #8]
	ldr	w11, [x8]
	ldr	x9, [x21]
	ldp	w12, w13, [x9]
	add	w11, w12, w11
	str	w11, [x9]
	ldr	w8, [x8, #4]
	add	w8, w13, w8
	str	w8, [x9, #4]
	ldr	w11, [x10]
	ldr	x8, [x20]
	ldp	w12, w13, [x8]
	add	w11, w12, w11
	str	w11, [x8]
	ldr	w10, [x10, #4]
	add	w10, w13, w10
	str	w10, [x8, #4]
	ldr	x10, [x27, #24]
	ldp	w11, w12, [x10]
	add	w25, w11, w25
	add	w24, w12, w24
	ldp	w11, w10, [x10, #8]
	add	w23, w11, w23
	add	w22, w10, w22
	add	w28, w28, #1
	ldr	w11, [x19, #4]
	add	x27, x27, #40
	cmp	w28, w11
	b.lt	LBB0_4
; %bb.5:
Lloh10:
	adrp	x10, _drawVerts@GOTPAGE
Lloh11:
	ldr	x10, [x10, _drawVerts@GOTPAGEOFF]
Lloh12:
	ldr	x10, [x10]
	ldp	x16, x15, [sp]                  ; 16-byte Folded Reload
	b	LBB0_7
LBB0_6:
	mov	w22, #0
	mov	w23, #0
	mov	w24, #0
	mov	w25, #0
	mov	w8, #40
	madd	x8, x15, x8, x16
	ldp	x9, x8, [x8, #8]
	mov	x10, x16
LBB0_7:
	ldr	x12, [x26]
	ldp	w13, w14, [x12]
	sdiv	w11, w13, w11
	str	w11, [x12]
	ldr	w11, [x19, #4]
	sdiv	w11, w14, w11
	str	w11, [x12, #4]
	ldr	w11, [x19, #4]
	ldr	w13, [x12, #8]
	sdiv	w11, w13, w11
	str	w11, [x12, #8]
	ldr	w11, [x19, #4]
	ldp	w12, w13, [x9]
	sdiv	w11, w12, w11
	str	w11, [x9]
	ldr	w11, [x19, #4]
	sdiv	w11, w13, w11
	str	w11, [x9, #4]
	ldr	w9, [x19, #4]
	ldp	w11, w12, [x8]
	sdiv	w9, w11, w9
	str	w9, [x8]
	ldr	w9, [x19, #4]
	sdiv	w9, w12, w9
	str	w9, [x8, #4]
	ldr	w8, [x19, #4]
	sdiv	w8, w25, w8
	mov	w9, #40
	madd	x11, x15, x9, x16
	ldr	x12, [x11, #24]
	str	w8, [x12]
	ldr	w8, [x19, #4]
	sdiv	w8, w24, w8
	str	w8, [x12, #4]
	ldr	w8, [x19, #4]
	sdiv	w8, w23, w8
	str	w8, [x12, #8]
	ldr	w8, [x19, #4]
	sdiv	w8, w22, w8
	str	w8, [x12, #12]
	ldrsw	x8, [x19]
	madd	x8, x8, x9, x10
	ldr	w0, [x8, #32]
	ldr	w1, [x11, #32]
	bl	_VectorCopy
Lloh13:
	adrp	x20, _numDrawIndexes@GOTPAGE
Lloh14:
	ldr	x20, [x20, _numDrawIndexes@GOTPAGEOFF]
	ldr	x8, [x20]
	ldrsw	x9, [x19, #4]
	add	x10, x9, x9, lsl #1
Lloh15:
	adrp	x11, _MAX_MAP_DRAW_INDEXES@GOTPAGE
Lloh16:
	ldr	x11, [x11, _MAX_MAP_DRAW_INDEXES@GOTPAGEOFF]
Lloh17:
	ldr	x11, [x11]
	add	x12, x8, x10
	cmp	x12, x11
	b.le	LBB0_9
; %bb.8:
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_Error
	ldr	x8, [x20]
	ldr	w9, [x19, #4]
	add	w10, w9, w9, lsl #1
LBB0_9:
	str	x8, [x19, #16]
	str	w10, [x19, #8]
	cmp	w9, #1
	b.lt	LBB0_13
; %bb.10:
	mov	w10, #0
Lloh20:
	adrp	x11, _drawIndexes@GOTPAGE
Lloh21:
	ldr	x11, [x11, _drawIndexes@GOTPAGEOFF]
Lloh22:
	ldr	x11, [x11]
	add	x11, x11, x8, lsl #2
	add	x11, x11, #4
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	stp	w9, w10, [x11, #-4]
	add	w10, w10, #1
	ldr	w9, [x19, #4]
	sdiv	w12, w10, w9
	msub	w9, w12, w9, w10
	add	x8, x8, #3
	str	w9, [x11, #4]
	ldr	w9, [x19, #4]
	add	x11, x11, #12
	cmp	w10, w9
	b.lt	LBB0_11
; %bb.12:
	str	x8, [x20]
LBB0_13:
	add	w8, w9, #1
	str	w8, [x19, #4]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_numDrawVerts,8,3               ; @numDrawVerts
	.comm	_MAX_MAP_DRAW_VERTS,8,3         ; @MAX_MAP_DRAW_VERTS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MAX_MAP_DRAW_VERTS"

	.comm	_drawVerts,8,3                  ; @drawVerts
	.comm	_numDrawIndexes,8,3             ; @numDrawIndexes
	.comm	_MAX_MAP_DRAW_INDEXES,8,3       ; @MAX_MAP_DRAW_INDEXES
l_.str.1:                               ; @.str.1
	.asciz	"MAX_MAP_DRAWINDEXES"

	.comm	_drawIndexes,8,3                ; @drawIndexes
	.no_dead_strip	_SurfaceAsTriFan
.subsections_via_symbols
