	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function RB_SurfaceGrid
LCPI0_0:
	.space	4
	.long	1                               ## 0x1
	.space	4
	.space	4
LCPI0_1:
	.long	0                               ## 0x0
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	3                               ## 0x3
LCPI0_2:
	.long	4                               ## 0x4
	.long	4                               ## 0x4
	.long	4                               ## 0x4
	.long	4                               ## 0x4
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_RB_SurfaceGrid:                        ## @RB_SurfaceGrid
	.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	$248, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAX_GRID_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	shlq	$2, %rbx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movl	64(%r14), %edi
	movq	40(%r14), %rsi
	movl	60(%r14), %edx
	movl	56(%r14), %ecx
	movl	(%r14), %r8d
	movl	4(%r14), %r9d
	callq	_RB_SurfaceVaoCached
	testq	%rax, %rax
	jne	LBB0_69
## %bb.1:
	movq	_tess@GOTPCREL(%rip), %rbx
	movl	96(%rbx), %edi
	callq	_RB_CheckVao
	movl	(%r14), %eax
	orl	%eax, (%rbx)
	movl	4(%r14), %eax
	orl	%eax, 4(%rbx)
	movl	48(%r14), %esi
	movl	52(%r14), %edi
	callq	_LodErrorForVolume
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%rax)
	movl	8(%r14), %ecx
	leal	-1(%rcx), %r9d
	movl	$1, %edi
	cmpl	$3, %ecx
	jl	LBB0_14
## %bb.2:
	movq	16(%r14), %rcx
	movl	%r9d, %r8d
	decq	%r8
	cmpl	$2, %r9d
	jne	LBB0_4
## %bb.3:
	movl	$1, %edx
	movl	$1, %esi
LBB0_10:
	testb	$1, %r8b
	movq	%rdx, %rdi
	je	LBB0_14
## %bb.11:
	ucomiss	(%rcx,%rsi,4), %xmm0
	jae	LBB0_13
## %bb.12:
	movq	%rdx, %rdi
	jmp	LBB0_14
LBB0_4:
	movq	%r8, %rdi
	andq	$-2, %rdi
	negq	%rdi
	movl	$1, %edx
	movl	$1, %esi
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	leaq	(%rdi,%rsi), %rbx
	addq	$2, %rbx
	addq	$2, %rsi
	cmpq	$1, %rbx
	je	LBB0_10
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	ucomiss	(%rcx,%rsi,4), %xmm0
	jb	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movslq	%edx, %rdx
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	%esi, (%rbx,%rdx,4)
	incl	%edx
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	ucomiss	4(%rcx,%rsi,4), %xmm0
	jb	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rdx, %rax
	cltq
	leal	1(%rsi), %ebx
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%ebx, (%rdx,%rax,4)
	incl	%eax
	movq	%rax, %rdx
	jmp	LBB0_9
LBB0_13:
	movq	%rdx, %rdi
	movslq	%edi, %rdi
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%esi, (%rcx,%rdi,4)
	incl	%edi
LBB0_14:
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movslq	%edi, %rcx
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%r9d, (%rdx,%rcx,4)
	movl	$0, (%r15)
	movl	24(%r14), %ecx
	leal	-1(%rcx), %eax
	cmpl	$2, %ecx
	jle	LBB0_15
## %bb.16:
	movq	32(%r14), %rcx
	movl	%eax, %edx
	decq	%rdx
	cmpl	$2, %eax
	jne	LBB0_18
## %bb.17:
	movl	$1, %r12d
	movl	$1, %esi
	movq	_tess@GOTPCREL(%rip), %r10
LBB0_24:
	testb	$1, %dl
	je	LBB0_27
## %bb.25:
	ucomiss	(%rcx,%rsi,4), %xmm0
	jb	LBB0_27
## %bb.26:
	movslq	%r12d, %r12
	movl	%esi, (%r15,%r12,4)
	incl	%r12d
LBB0_27:
	movslq	%r12d, %rcx
	movl	%eax, (%r15,%rcx,4)
	testl	%r12d, %r12d
	jle	LBB0_69
## %bb.28:
	leal	1(%r12), %eax
	movl	%eax, -76(%rbp)                 ## 4-byte Spill
	jmp	LBB0_29
LBB0_15:
	movl	%eax, 4(%r15)
	movl	$1, %r12d
	movl	$2, -76(%rbp)                   ## 4-byte Folded Spill
	movq	_tess@GOTPCREL(%rip), %r10
LBB0_29:
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	leal	1(%rdx), %ecx
	leal	(%rcx,%rcx), %eax
	leal	(%rax,%rax,2), %eax
	movl	%eax, -116(%rbp)                ## 4-byte Spill
	movl	%ecx, %eax
	movq	%rax, -224(%rbp)                ## 8-byte Spill
	leal	-1(%rdx), %eax
	movq	%rax, -192(%rbp)                ## 8-byte Spill
	leaq	1(%rax), %r11
	movq	%r11, %rax
	andq	$-4, %rax
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	addq	%rax, %rax
	leaq	(%rax,%rax,2), %rax
	movq	%rax, -184(%rbp)                ## 8-byte Spill
	movd	%ecx, %xmm0
	pshufd	$0, %xmm0, %xmm13               ## xmm13 = xmm0[0,0,0,0]
	movdqa	LCPI0_0(%rip), %xmm14           ## xmm14 = <u,1,u,u>
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	pinsrd	$0, %ecx, %xmm14
	xorl	%eax, %eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	%r14, -232(%rbp)                ## 8-byte Spill
	movq	%r15, -200(%rbp)                ## 8-byte Spill
	movq	%r12, -176(%rbp)                ## 8-byte Spill
	movq	%r11, -168(%rbp)                ## 8-byte Spill
	movdqa	%xmm13, -288(%rbp)              ## 16-byte Spill
	movdqa	%xmm14, -272(%rbp)              ## 16-byte Spill
	jmp	LBB0_30
	.p2align	4, 0x90
LBB0_32:                                ##   in Loop: Header=BB0_30 Depth=1
	xorl	%eax, %eax
	callq	_RB_EndSurface
	movq	_tess@GOTPCREL(%rip), %rax
	movq	48(%rax), %rdi
	movq	_tess@GOTPCREL(%rip), %rax
	movl	92(%rax), %esi
	movq	_tess@GOTPCREL(%rip), %rax
	movl	88(%rax), %edx
	callq	_RB_BeginSurface
	movq	_tess@GOTPCREL(%rip), %r10
LBB0_30:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_36 Depth 2
                                        ##       Child Loop BB0_38 Depth 3
                                        ##     Child Loop BB0_57 Depth 2
                                        ##       Child Loop BB0_61 Depth 3
                                        ##       Child Loop BB0_64 Depth 3
	movq	_SHADER_MAX_VERTEXES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	8(%r10), %edi
	movl	12(%r10), %esi
	subl	%edi, %eax
	cltd
	idivl	-88(%rbp)                       ## 4-byte Folded Reload
	movl	%eax, %ecx
	movq	_SHADER_MAX_INDEXES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	subl	%esi, %eax
	cltd
	idivl	-116(%rbp)                      ## 4-byte Folded Reload
	cmpl	$2, %ecx
	jl	LBB0_32
## %bb.31:                              ##   in Loop: Header=BB0_30 Depth=1
	testl	%eax, %eax
	jle	LBB0_32
## %bb.33:                              ##   in Loop: Header=BB0_30 Depth=1
	movl	%edi, -52(%rbp)                 ## 4-byte Spill
	leal	-1(%rcx), %edx
	cmpl	%eax, %ecx
	cmoval	%eax, %edx
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	leal	(%rdx,%rdi), %eax
	movl	-76(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, %ebx
	subl	%edi, %ebx
	cmpl	%ecx, %eax
	cmovlel	%edx, %ebx
	testl	%ebx, %ebx
	jle	LBB0_34
## %bb.35:                              ##   in Loop: Header=BB0_30 Depth=1
	movslq	-52(%rbp), %rax                 ## 4-byte Folded Reload
	movq	56(%r10), %rcx
	movq	(%rcx,%rax,8), %rcx
	movq	%rcx, -160(%rbp)                ## 8-byte Spill
	movq	64(%r10), %rcx
	movq	(%rcx,%rax,8), %rcx
	movq	%rcx, -136(%rbp)                ## 8-byte Spill
	movq	32(%r10), %rcx
	movq	(%rcx,%rax,8), %r15
	movq	16(%r10), %rcx
	movq	24(%r10), %rdx
	movq	(%rdx,%rax,8), %r12
	movq	72(%r10), %rdx
	movq	(%rdx,%rax,8), %r13
	movq	80(%r10), %rdx
	movq	(%rdx,%rax,8), %rdx
	movq	%rdx, -152(%rbp)                ## 8-byte Spill
	movq	(%rcx,%rax,8), %rax
	movq	%rax, -144(%rbp)                ## 8-byte Spill
	movslq	%edi, %rax
	movq	%rax, -208(%rbp)                ## 8-byte Spill
	movl	%ebx, %eax
	movq	%rax, -216(%rbp)                ## 8-byte Spill
	xorl	%eax, %eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	%rbx, -112(%rbp)                ## 8-byte Spill
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_36
	.p2align	4, 0x90
LBB0_54:                                ##   in Loop: Header=BB0_36 Depth=2
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	incq	%rcx
	movq	%rcx, %rax
	movq	%rcx, -104(%rbp)                ## 8-byte Spill
	cmpq	-216(%rbp), %rcx                ## 8-byte Folded Reload
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	jae	LBB0_55
LBB0_36:                                ##   Parent Loop BB0_30 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_38 Depth 3
	testl	%eax, %eax
	js	LBB0_54
## %bb.37:                              ##   in Loop: Header=BB0_36 Depth=2
	movq	-208(%rbp), %rax                ## 8-byte Reload
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	addq	%rcx, %rax
	movq	-200(%rbp), %rcx                ## 8-byte Reload
	movslq	(%rcx,%rax,4), %rax
	movq	%rax, -240(%rbp)                ## 8-byte Spill
	xorl	%esi, %esi
	jmp	LBB0_38
	.p2align	4, 0x90
LBB0_53:                                ##   in Loop: Header=BB0_38 Depth=3
	movq	-112(%rbp), %rbx                ## 8-byte Reload
	movq	-248(%rbp), %rsi                ## 8-byte Reload
	incq	%rsi
	cmpq	%rsi, -224(%rbp)                ## 8-byte Folded Reload
	je	LBB0_54
LBB0_38:                                ##   Parent Loop BB0_30 Depth=1
                                        ##     Parent Loop BB0_36 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	-232(%rbp), %rdx                ## 8-byte Reload
	movslq	8(%rdx), %rax
	imulq	-240(%rbp), %rax                ## 8-byte Folded Reload
	leaq	(%rax,%rax,8), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	addq	%rax, %rcx
	addq	40(%rdx), %rcx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rsi, -248(%rbp)                ## 8-byte Spill
	movslq	(%rax,%rsi,4), %rax
	leaq	(%rax,%rax,8), %rdx
	leaq	(%rdx,%rdx,2), %rdx
	addq	%rax, %rdx
	addq	%rcx, %rdx
	movq	48(%r10), %rax
	movl	(%rax), %eax
	movq	_ATTR_POSITION@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_39
## %bb.40:                              ##   in Loop: Header=BB0_38 Depth=3
	movq	%rdx, %r14
	movl	24(%rdx), %edi
	movq	-144(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_VectorCopy
	movq	_tess@GOTPCREL(%rip), %r10
	addq	$16, %rbx
	movq	%rbx, -144(%rbp)                ## 8-byte Spill
	movq	48(%r10), %rax
	movl	(%rax), %eax
	jmp	LBB0_41
	.p2align	4, 0x90
LBB0_39:                                ##   in Loop: Header=BB0_38 Depth=3
	movq	%rdx, %r14
LBB0_41:                                ##   in Loop: Header=BB0_38 Depth=3
	movq	_ATTR_NORMAL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_43
## %bb.42:                              ##   in Loop: Header=BB0_38 Depth=3
	movl	20(%r14), %edi
	movq	-152(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_VectorCopy4
	movq	_tess@GOTPCREL(%rip), %r10
	addq	$16, %rbx
	movq	%rbx, -152(%rbp)                ## 8-byte Spill
	movq	48(%r10), %rax
	movl	(%rax), %eax
LBB0_43:                                ##   in Loop: Header=BB0_38 Depth=3
	movq	_ATTR_TANGENT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_45
## %bb.44:                              ##   in Loop: Header=BB0_38 Depth=3
	movl	16(%r14), %edi
	movq	%r13, %rsi
	callq	_VectorCopy4
	movq	_tess@GOTPCREL(%rip), %r10
	addq	$16, %r13
	movq	48(%r10), %rax
	movl	(%rax), %eax
LBB0_45:                                ##   in Loop: Header=BB0_38 Depth=3
	movq	_ATTR_TEXCOORD@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_47
## %bb.46:                              ##   in Loop: Header=BB0_38 Depth=3
	movl	12(%r14), %edi
	movq	%r12, %rsi
	callq	_VectorCopy2
	movq	_tess@GOTPCREL(%rip), %r10
	addq	$8, %r12
	movq	48(%r10), %rax
	movl	(%rax), %eax
LBB0_47:                                ##   in Loop: Header=BB0_38 Depth=3
	movq	_ATTR_LIGHTCOORD@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_49
## %bb.48:                              ##   in Loop: Header=BB0_38 Depth=3
	movl	8(%r14), %edi
	movq	%r15, %rsi
	callq	_VectorCopy2
	movq	_tess@GOTPCREL(%rip), %r10
	addq	$8, %r15
	movq	48(%r10), %rax
	movl	(%rax), %eax
LBB0_49:                                ##   in Loop: Header=BB0_38 Depth=3
	movq	_ATTR_COLOR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_51
## %bb.50:                              ##   in Loop: Header=BB0_38 Depth=3
	movl	4(%r14), %edi
	movq	-136(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_VectorCopy4
	movq	_tess@GOTPCREL(%rip), %r10
	addq	$16, %rbx
	movq	%rbx, -136(%rbp)                ## 8-byte Spill
	movq	48(%r10), %rax
	movl	(%rax), %eax
LBB0_51:                                ##   in Loop: Header=BB0_38 Depth=3
	movq	_ATTR_LIGHTDIRECTION@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_53
## %bb.52:                              ##   in Loop: Header=BB0_38 Depth=3
	movl	(%r14), %edi
	movq	-160(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_VectorCopy4
	movq	_tess@GOTPCREL(%rip), %r10
	addq	$16, %rbx
	movq	%rbx, -160(%rbp)                ## 8-byte Spill
	jmp	LBB0_53
LBB0_55:                                ##   in Loop: Header=BB0_30 Depth=1
	movl	12(%r10), %esi
	leal	-1(%rbx), %r8d
	cmpl	$2, %ebx
	movq	-176(%rbp), %r12                ## 8-byte Reload
	movq	-168(%rbp), %r11                ## 8-byte Reload
	movdqa	-288(%rbp), %xmm13              ## 16-byte Reload
	movdqa	-272(%rbp), %xmm14              ## 16-byte Reload
	movdqa	LCPI0_1(%rip), %xmm15           ## xmm15 = [0,1,2,3]
	pcmpeqd	%xmm6, %xmm6
	jl	LBB0_68
## %bb.56:                              ##   in Loop: Header=BB0_30 Depth=1
	movq	40(%r10), %rcx
	xorl	%edx, %edx
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	movl	%edi, %r9d
	jmp	LBB0_57
	.p2align	4, 0x90
LBB0_65:                                ##   in Loop: Header=BB0_57 Depth=2
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	movq	-72(%rbp), %rax                 ## 8-byte Reload
LBB0_66:                                ##   in Loop: Header=BB0_57 Depth=2
	incl	%edx
	addl	-88(%rbp), %r9d                 ## 4-byte Folded Reload
	cmpl	%r8d, %edx
	je	LBB0_67
LBB0_57:                                ##   Parent Loop BB0_30 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_61 Depth 3
                                        ##       Child Loop BB0_64 Depth 3
	testl	%eax, %eax
	jle	LBB0_66
## %bb.58:                              ##   in Loop: Header=BB0_57 Depth=2
	xorl	%eax, %eax
	movslq	%esi, %rbx
	cmpl	$3, -192(%rbp)                  ## 4-byte Folded Reload
	jae	LBB0_60
## %bb.59:                              ##   in Loop: Header=BB0_57 Depth=2
	movq	%rbx, %rsi
	jmp	LBB0_63
	.p2align	4, 0x90
LBB0_60:                                ##   in Loop: Header=BB0_57 Depth=2
	movl	%edx, %eax
	imull	-88(%rbp), %eax                 ## 4-byte Folded Reload
	addl	%edi, %eax
	movq	-184(%rbp), %rsi                ## 8-byte Reload
	addq	%rbx, %rsi
	movd	%eax, %xmm0
	pshufd	$0, %xmm0, %xmm8                ## xmm8 = xmm0[0,0,0,0]
	leaq	(%rcx,%rbx,4), %rbx
	movq	-128(%rbp), %rax                ## 8-byte Reload
	movdqa	%xmm15, %xmm1
	.p2align	4, 0x90
LBB0_61:                                ##   Parent Loop BB0_30 Depth=1
                                        ##     Parent Loop BB0_57 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movdqa	%xmm8, %xmm2
	paddd	%xmm1, %xmm2
	movdqa	%xmm2, %xmm3
	psubd	%xmm6, %xmm3
	movdqa	%xmm2, %xmm4
	paddd	%xmm13, %xmm4
	pmovzxdq	%xmm2, %xmm9                    ## xmm9 = xmm2[0],zero,xmm2[1],zero
	pshufd	$68, %xmm4, %xmm11              ## xmm11 = xmm4[0,1,0,1]
	pshufd	$250, %xmm2, %xmm10             ## xmm10 = xmm2[2,2,3,3]
	pshufd	$238, %xmm4, %xmm12             ## xmm12 = xmm4[2,3,2,3]
	movdqa	%xmm2, %xmm5
	punpckldq	%xmm4, %xmm5            ## xmm5 = xmm5[0],xmm4[0],xmm5[1],xmm4[1]
	shufps	$4, %xmm3, %xmm5                ## xmm5 = xmm5[0,1],xmm3[0,0]
	movaps	%xmm3, %xmm7
	shufps	$85, %xmm4, %xmm7               ## xmm7 = xmm7[1,1],xmm4[1,1]
	punpckhdq	%xmm4, %xmm2            ## xmm2 = xmm2[2],xmm4[2],xmm2[3],xmm4[3]
	shufps	$164, %xmm3, %xmm2              ## xmm2 = xmm2[0,1],xmm3[2,2]
	shufps	$255, %xmm4, %xmm3              ## xmm3 = xmm3[3,3],xmm4[3,3]
	psubd	%xmm6, %xmm4
	pblendw	$48, %xmm9, %xmm11              ## xmm11 = xmm11[0,1,2,3],xmm9[4,5],xmm11[6,7]
	pshufd	$80, %xmm4, %xmm6               ## xmm6 = xmm4[0,0,1,1]
	pblendw	$243, %xmm11, %xmm6             ## xmm6 = xmm11[0,1],xmm6[2,3],xmm11[4,5,6,7]
	pblendw	$48, %xmm10, %xmm12             ## xmm12 = xmm12[0,1,2,3],xmm10[4,5],xmm12[6,7]
	pshufd	$250, %xmm4, %xmm0              ## xmm0 = xmm4[2,2,3,3]
	pblendw	$243, %xmm12, %xmm0             ## xmm0 = xmm12[0,1],xmm0[2,3],xmm12[4,5,6,7]
	insertps	$112, %xmm4, %xmm7              ## xmm7 = xmm7[0,1,2],xmm4[1]
	blendps	$8, %xmm4, %xmm3                ## xmm3 = xmm3[0,1,2],xmm4[3]
	movups	%xmm3, 80(%rbx)
	movups	%xmm2, 48(%rbx)
	movdqa	LCPI0_2(%rip), %xmm2            ## xmm2 = [4,4,4,4]
	movups	%xmm7, 32(%rbx)
	movups	%xmm5, (%rbx)
	movdqu	%xmm0, 64(%rbx)
	movdqu	%xmm6, 16(%rbx)
	pcmpeqd	%xmm6, %xmm6
	paddd	%xmm2, %xmm1
	addq	$96, %rbx
	addq	$-4, %rax
	jne	LBB0_61
## %bb.62:                              ##   in Loop: Header=BB0_57 Depth=2
	movq	-128(%rbp), %rdi                ## 8-byte Reload
	movl	%edi, %eax
	cmpq	%rdi, %r11
	je	LBB0_65
LBB0_63:                                ##   in Loop: Header=BB0_57 Depth=2
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%edi, %ebx
	subl	%eax, %ebx
	addl	%r9d, %eax
	.p2align	4, 0x90
LBB0_64:                                ##   Parent Loop BB0_30 Depth=1
                                        ##     Parent Loop BB0_57 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movl	%eax, (%rcx,%rsi,4)
	movd	%eax, %xmm0
	pshufd	$80, %xmm0, %xmm0               ## xmm0 = xmm0[0,0,1,1]
	paddd	%xmm14, %xmm0
	pshufd	$20, %xmm0, %xmm1               ## xmm1 = xmm0[0,1,1,0]
	movd	%xmm0, %edi
	incl	%edi
	movdqu	%xmm1, 4(%rcx,%rsi,4)
	movl	%edi, 20(%rcx,%rsi,4)
	addq	$6, %rsi
	incl	%eax
	decl	%ebx
	jne	LBB0_64
	jmp	LBB0_65
LBB0_34:                                ##   in Loop: Header=BB0_30 Depth=1
	leal	-1(%rbx), %r8d
	jmp	LBB0_68
LBB0_67:                                ##   in Loop: Header=BB0_30 Depth=1
	movq	-112(%rbp), %rbx                ## 8-byte Reload
LBB0_68:                                ##   in Loop: Header=BB0_30 Depth=1
	movl	%esi, 12(%r10)
	imull	-88(%rbp), %ebx                 ## 4-byte Folded Reload
	addl	%ebx, 8(%r10)
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	addl	%r8d, %eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	cmpl	%r12d, %eax
	jl	LBB0_30
LBB0_69:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_71
## %bb.70:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	%rdx, %rdi
	andq	$-2, %rdi
	negq	%rdi
	movl	$1, %r12d
	movl	$1, %esi
	movq	_tess@GOTPCREL(%rip), %r10
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_19 Depth=1
	leaq	(%rdi,%rsi), %rbx
	addq	$2, %rbx
	addq	$2, %rsi
	cmpq	$1, %rbx
	je	LBB0_24
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	ucomiss	(%rcx,%rsi,4), %xmm0
	jb	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	movslq	%r12d, %r12
	movl	%esi, (%r15,%r12,4)
	incl	%r12d
LBB0_21:                                ##   in Loop: Header=BB0_19 Depth=1
	ucomiss	4(%rcx,%rsi,4), %xmm0
	jb	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_19 Depth=1
	movslq	%r12d, %r12
	leal	1(%rsi), %ebx
	movl	%ebx, (%r15,%r12,4)
	incl	%r12d
	jmp	LBB0_23
LBB0_71:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_GRID_SIZE,4,2              ## @MAX_GRID_SIZE
	.comm	_tess,104,3                     ## @tess
	.comm	_SHADER_MAX_VERTEXES,4,2        ## @SHADER_MAX_VERTEXES
	.comm	_SHADER_MAX_INDEXES,4,2         ## @SHADER_MAX_INDEXES
	.comm	_ATTR_POSITION,4,2              ## @ATTR_POSITION
	.comm	_ATTR_NORMAL,4,2                ## @ATTR_NORMAL
	.comm	_ATTR_TANGENT,4,2               ## @ATTR_TANGENT
	.comm	_ATTR_TEXCOORD,4,2              ## @ATTR_TEXCOORD
	.comm	_ATTR_LIGHTCOORD,4,2            ## @ATTR_LIGHTCOORD
	.comm	_ATTR_COLOR,4,2                 ## @ATTR_COLOR
	.comm	_ATTR_LIGHTDIRECTION,4,2        ## @ATTR_LIGHTDIRECTION
	.no_dead_strip	_RB_SurfaceGrid
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function RB_SurfaceGrid
_RB_SurfaceGrid:                        ; @RB_SurfaceGrid
	.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, #128
	mov	x28, 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	x8, _MAX_GRID_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_GRID_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x10, x8, #15
	and	x12, x10, #0x7fffffff0
	sub	x9, x9, x12
	stur	x9, [x29, #-152]                ; 8-byte Folded Spill
	mov	sp, x9
	mov	x9, x8
Lloh8:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh9:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	sub	x19, x8, x12
	mov	sp, x19
	ldr	w0, [x0, #64]
	ldr	x1, [x28, #40]
	ldp	w3, w2, [x28, #56]
	ldp	w4, w5, [x28]
	bl	_RB_SurfaceVaoCached
	cbnz	x0, LBB0_47
; %bb.1:
Lloh10:
	adrp	x20, _tess@GOTPAGE
Lloh11:
	ldr	x20, [x20, _tess@GOTPAGEOFF]
	ldr	w0, [x20, #96]
	bl	_RB_CheckVao
	ldr	d0, [x28]
	ldr	d1, [x20]
	orr.8b	v0, v1, v0
	str	d0, [x20]
	ldp	w1, w0, [x28, #48]
	bl	_LodErrorForVolume
	ldur	x8, [x29, #-152]                ; 8-byte Folded Reload
	str	wzr, [x8]
	ldr	w9, [x28, #8]
	sub	w8, w9, #1
	cmp	w9, #3
	b.lt	LBB0_6
; %bb.2:
	ldr	x9, [x28, #16]
	mov	w10, #1
	mov	w20, #1
Lloh12:
	adrp	x16, _tess@GOTPAGE
Lloh13:
	ldr	x16, [x16, _tess@GOTPAGEOFF]
	ldur	x11, [x29, #-152]               ; 8-byte Folded Reload
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x10, x10, #1
	cmp	x8, x10
	b.eq	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	s1, [x9, x10, lsl #2]
	fcmp	s1, s0
	b.hi	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	str	w10, [x11, w20, sxtw #2]
	add	w20, w20, #1
	b	LBB0_3
LBB0_6:
	mov	w20, #1
Lloh14:
	adrp	x16, _tess@GOTPAGE
Lloh15:
	ldr	x16, [x16, _tess@GOTPAGEOFF]
LBB0_7:
	ldur	x9, [x29, #-152]                ; 8-byte Folded Reload
	str	w8, [x9, w20, sxtw #2]
	str	wzr, [x19]
	ldr	w9, [x28, #24]
	sub	w8, w9, #1
	cmp	w9, #2
	b.le	LBB0_12
; %bb.8:
	ldr	x9, [x28, #32]
	mov	w10, #1
	mov	w21, #1
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x10, x10, #1
	cmp	x8, x10
	b.eq	LBB0_13
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	s1, [x9, x10, lsl #2]
	fcmp	s1, s0
	b.hi	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	str	w10, [x19, w21, sxtw #2]
	add	w21, w21, #1
	b	LBB0_9
LBB0_12:
	str	w8, [x19, #4]
	mov	w21, #1
	mov	w8, #2
	b	LBB0_15
LBB0_13:
	str	w8, [x19, w21, sxtw #2]
	cmp	w21, #1
	b.lt	LBB0_47
; %bb.14:
	add	w8, w21, #1
LBB0_15:
	stur	w8, [x29, #-188]                ; 4-byte Folded Spill
	mov	w27, #0
	add	w22, w20, #1
	add	w8, w22, w22, lsl #1
	movi.2s	v0, #1
	mov.s	v0[0], w22
Lloh16:
	adrp	x23, _SHADER_MAX_VERTEXES@GOTPAGE
Lloh17:
	ldr	x23, [x23, _SHADER_MAX_VERTEXES@GOTPAGEOFF]
	lsl	w24, w8, #1
Lloh18:
	adrp	x25, _SHADER_MAX_INDEXES@GOTPAGE
Lloh19:
	ldr	x25, [x25, _SHADER_MAX_INDEXES@GOTPAGEOFF]
	stur	x19, [x29, #-160]               ; 8-byte Folded Spill
	stur	w20, [x29, #-124]               ; 4-byte Folded Spill
	stp	w24, w21, [x29, #-208]          ; 8-byte Folded Spill
	stur	x22, [x29, #-136]               ; 8-byte Folded Spill
	stur	q0, [x29, #-176]                ; 16-byte Folded Spill
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	bl	_RB_EndSurface
Lloh20:
	adrp	x8, _tess@GOTPAGE
Lloh21:
	ldr	x8, [x8, _tess@GOTPAGEOFF]
Lloh22:
	ldr	x0, [x8, #48]
Lloh23:
	adrp	x8, _tess@GOTPAGE
Lloh24:
	ldr	x8, [x8, _tess@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8, #92]
Lloh26:
	adrp	x8, _tess@GOTPAGE
Lloh27:
	ldr	x8, [x8, _tess@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8, #88]
	bl	_RB_BeginSurface
Lloh29:
	adrp	x16, _tess@GOTPAGE
Lloh30:
	ldr	x16, [x16, _tess@GOTPAGEOFF]
LBB0_17:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_21 Depth 2
                                        ;       Child Loop BB0_24 Depth 3
                                        ;     Child Loop BB0_41 Depth 2
                                        ;       Child Loop BB0_43 Depth 3
	ldr	w9, [x23]
	ldp	w13, w8, [x16, #8]
	sub	w9, w9, w13
	sdiv	w9, w9, w22
	ldr	w10, [x25]
	sub	w10, w10, w8
	cmp	w9, #2
	sdiv	w10, w10, w24
	ccmp	w10, #0, #4, ge
	b.le	LBB0_16
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	sub	w11, w9, #1
	cmp	w9, w10
	csel	w9, w10, w11, hi
	ldur	w12, [x29, #-188]               ; 4-byte Folded Reload
	sub	w10, w12, w27
	add	w11, w9, w27
	cmp	w11, w12
	csel	w0, w10, w9, gt
	cmp	w0, #0
	b.le	LBB0_44
; %bb.19:                               ;   in Loop: Header=BB0_17 Depth=1
	stur	x0, [x29, #-120]                ; 8-byte Folded Spill
	mov	x12, #0
	stur	x13, [x29, #-200]               ; 8-byte Folded Spill
	sxtw	x8, w13
	lsl	x8, x8, #3
	ldp	x9, x10, [x16, #56]
	ldr	x9, [x9, x8]
	stur	x9, [x29, #-96]                 ; 8-byte Folded Spill
	ldr	x21, [x10, x8]
	ldr	x9, [x16, #32]
	ldr	x22, [x9, x8]
	ldp	x10, x9, [x16, #16]
	ldr	x23, [x9, x8]
	ldp	x9, x11, [x16, #72]
	ldr	x24, [x9, x8]
	ldr	x25, [x11, x8]
	ldr	x26, [x10, x8]
	stur	x27, [x29, #-184]               ; 8-byte Folded Spill
	sxtw	x8, w27
	stur	x8, [x29, #-144]                ; 8-byte Folded Spill
	b	LBB0_21
LBB0_20:                                ;   in Loop: Header=BB0_21 Depth=2
	ldp	x8, x12, [x29, #-120]           ; 16-byte Folded Reload
	add	x12, x12, #1
	cmp	x12, x8
	ldur	w20, [x29, #-124]               ; 4-byte Folded Reload
	b.hs	LBB0_38
LBB0_21:                                ;   Parent Loop BB0_17 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_24 Depth 3
	stur	x12, [x29, #-112]               ; 8-byte Folded Spill
	tbnz	w20, #31, LBB0_20
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=2
	ldp	x8, x19, [x29, #-144]           ; 16-byte Folded Reload
	add	x8, x12, x8
	ldp	x9, x27, [x29, #-160]           ; 16-byte Folded Reload
	ldr	w8, [x9, x8, lsl #2]
	stur	w8, [x29, #-100]                ; 4-byte Folded Spill
	b	LBB0_24
LBB0_23:                                ;   in Loop: Header=BB0_24 Depth=3
	mov	x28, x20
	add	x27, x27, #4
	subs	x19, x19, #1
	b.eq	LBB0_20
LBB0_24:                                ;   Parent Loop BB0_17 Depth=1
                                        ;     Parent Loop BB0_21 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	x8, [x28, #40]
	mov	x20, x28
	ldr	w9, [x28, #8]
	ldur	w10, [x29, #-100]               ; 4-byte Folded Reload
	mul	w9, w9, w10
	mov	w10, #28
	smaddl	x8, w9, w10, x8
	ldrsw	x9, [x27]
	madd	x28, x9, x10, x8
	ldr	x8, [x16, #48]
	ldr	w8, [x8]
Lloh31:
	adrp	x9, _ATTR_POSITION@GOTPAGE
Lloh32:
	ldr	x9, [x9, _ATTR_POSITION@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_26
; %bb.25:                               ;   in Loop: Header=BB0_24 Depth=3
	ldr	w0, [x28, #24]
	mov	x1, x26
	bl	_VectorCopy
Lloh34:
	adrp	x16, _tess@GOTPAGE
Lloh35:
	ldr	x16, [x16, _tess@GOTPAGEOFF]
	add	x26, x26, #16
	ldr	x8, [x16, #48]
	ldr	w8, [x8]
LBB0_26:                                ;   in Loop: Header=BB0_24 Depth=3
Lloh36:
	adrp	x9, _ATTR_NORMAL@GOTPAGE
Lloh37:
	ldr	x9, [x9, _ATTR_NORMAL@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_28
; %bb.27:                               ;   in Loop: Header=BB0_24 Depth=3
	ldr	w0, [x28, #20]
	mov	x1, x25
	bl	_VectorCopy4
Lloh39:
	adrp	x16, _tess@GOTPAGE
Lloh40:
	ldr	x16, [x16, _tess@GOTPAGEOFF]
	add	x25, x25, #16
	ldr	x8, [x16, #48]
	ldr	w8, [x8]
LBB0_28:                                ;   in Loop: Header=BB0_24 Depth=3
Lloh41:
	adrp	x9, _ATTR_TANGENT@GOTPAGE
Lloh42:
	ldr	x9, [x9, _ATTR_TANGENT@GOTPAGEOFF]
Lloh43:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_30
; %bb.29:                               ;   in Loop: Header=BB0_24 Depth=3
	ldr	w0, [x28, #16]
	mov	x1, x24
	bl	_VectorCopy4
Lloh44:
	adrp	x16, _tess@GOTPAGE
Lloh45:
	ldr	x16, [x16, _tess@GOTPAGEOFF]
	add	x24, x24, #16
	ldr	x8, [x16, #48]
	ldr	w8, [x8]
LBB0_30:                                ;   in Loop: Header=BB0_24 Depth=3
Lloh46:
	adrp	x9, _ATTR_TEXCOORD@GOTPAGE
Lloh47:
	ldr	x9, [x9, _ATTR_TEXCOORD@GOTPAGEOFF]
Lloh48:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_32
; %bb.31:                               ;   in Loop: Header=BB0_24 Depth=3
	ldr	w0, [x28, #12]
	mov	x1, x23
	bl	_VectorCopy2
Lloh49:
	adrp	x16, _tess@GOTPAGE
Lloh50:
	ldr	x16, [x16, _tess@GOTPAGEOFF]
	add	x23, x23, #8
	ldr	x8, [x16, #48]
	ldr	w8, [x8]
LBB0_32:                                ;   in Loop: Header=BB0_24 Depth=3
Lloh51:
	adrp	x9, _ATTR_LIGHTCOORD@GOTPAGE
Lloh52:
	ldr	x9, [x9, _ATTR_LIGHTCOORD@GOTPAGEOFF]
Lloh53:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_34
; %bb.33:                               ;   in Loop: Header=BB0_24 Depth=3
	ldr	w0, [x28, #8]
	mov	x1, x22
	bl	_VectorCopy2
Lloh54:
	adrp	x16, _tess@GOTPAGE
Lloh55:
	ldr	x16, [x16, _tess@GOTPAGEOFF]
	add	x22, x22, #8
	ldr	x8, [x16, #48]
	ldr	w8, [x8]
LBB0_34:                                ;   in Loop: Header=BB0_24 Depth=3
Lloh56:
	adrp	x9, _ATTR_COLOR@GOTPAGE
Lloh57:
	ldr	x9, [x9, _ATTR_COLOR@GOTPAGEOFF]
Lloh58:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_36
; %bb.35:                               ;   in Loop: Header=BB0_24 Depth=3
	ldr	w0, [x28, #4]
	mov	x1, x21
	bl	_VectorCopy4
Lloh59:
	adrp	x16, _tess@GOTPAGE
Lloh60:
	ldr	x16, [x16, _tess@GOTPAGEOFF]
	add	x21, x21, #16
	ldr	x8, [x16, #48]
	ldr	w8, [x8]
LBB0_36:                                ;   in Loop: Header=BB0_24 Depth=3
Lloh61:
	adrp	x9, _ATTR_LIGHTDIRECTION@GOTPAGE
Lloh62:
	ldr	x9, [x9, _ATTR_LIGHTDIRECTION@GOTPAGEOFF]
Lloh63:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_23
; %bb.37:                               ;   in Loop: Header=BB0_24 Depth=3
	ldr	w0, [x28]
	ldur	x28, [x29, #-96]                ; 8-byte Folded Reload
	mov	x1, x28
	bl	_VectorCopy4
Lloh64:
	adrp	x16, _tess@GOTPAGE
Lloh65:
	ldr	x16, [x16, _tess@GOTPAGEOFF]
	add	x28, x28, #16
	stur	x28, [x29, #-96]                ; 8-byte Folded Spill
	b	LBB0_23
LBB0_38:                                ;   in Loop: Header=BB0_17 Depth=1
	ldr	w8, [x16, #12]
	ldur	x0, [x29, #-120]                ; 8-byte Folded Reload
	sub	w9, w0, #1
	cmp	w0, #2
	ldur	x22, [x29, #-136]               ; 8-byte Folded Reload
	b.lt	LBB0_45
; %bb.39:                               ;   in Loop: Header=BB0_17 Depth=1
	mov	w10, #0
	ldr	x11, [x16, #40]
	ldp	w24, w21, [x29, #-208]          ; 8-byte Folded Reload
	ldur	x27, [x29, #-184]               ; 8-byte Folded Reload
Lloh66:
	adrp	x23, _SHADER_MAX_VERTEXES@GOTPAGE
Lloh67:
	ldr	x23, [x23, _SHADER_MAX_VERTEXES@GOTPAGEOFF]
Lloh68:
	adrp	x25, _SHADER_MAX_INDEXES@GOTPAGE
Lloh69:
	ldr	x25, [x25, _SHADER_MAX_INDEXES@GOTPAGEOFF]
	ldur	x17, [x29, #-200]               ; 8-byte Folded Reload
	b	LBB0_41
LBB0_40:                                ;   in Loop: Header=BB0_41 Depth=2
	add	w10, w10, #1
	add	w17, w17, w22
	cmp	w10, w9
	b.eq	LBB0_46
LBB0_41:                                ;   Parent Loop BB0_17 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_43 Depth 3
	cmp	w20, #1
	b.lt	LBB0_40
; %bb.42:                               ;   in Loop: Header=BB0_41 Depth=2
	add	x12, x11, w8, sxtw #2
	mov	x13, x17
	mov	x14, x20
	ldur	q2, [x29, #-176]                ; 16-byte Folded Reload
LBB0_43:                                ;   Parent Loop BB0_17 Depth=1
                                        ;     Parent Loop BB0_41 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	dup.2s	v0, w13
	str	w13, [x12]
	add.2s	v0, v0, v2
	rev64.4s	v1, v0
	zip1.4s	v1, v0, v1
	fmov	w15, s0
	add	w15, w15, #1
	stur	q1, [x12, #4]
	str	w15, [x12, #20]
	add	x12, x12, #24
	add	w8, w8, #6
	add	w13, w13, #1
	subs	w14, w14, #1
	b.ne	LBB0_43
	b	LBB0_40
LBB0_44:                                ;   in Loop: Header=BB0_17 Depth=1
	sub	w9, w0, #1
	b	LBB0_46
LBB0_45:                                ;   in Loop: Header=BB0_17 Depth=1
	ldp	w24, w21, [x29, #-208]          ; 8-byte Folded Reload
	ldur	x27, [x29, #-184]               ; 8-byte Folded Reload
Lloh70:
	adrp	x23, _SHADER_MAX_VERTEXES@GOTPAGE
Lloh71:
	ldr	x23, [x23, _SHADER_MAX_VERTEXES@GOTPAGEOFF]
Lloh72:
	adrp	x25, _SHADER_MAX_INDEXES@GOTPAGE
Lloh73:
	ldr	x25, [x25, _SHADER_MAX_INDEXES@GOTPAGEOFF]
LBB0_46:                                ;   in Loop: Header=BB0_17 Depth=1
	ldr	w10, [x16, #8]
	madd	w10, w0, w22, w10
	stp	w10, w8, [x16, #8]
	add	w27, w9, w27
	cmp	w27, w21
	b.lt	LBB0_17
LBB0_47:
	ldur	x8, [x29, #-88]
Lloh74:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh75:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh76:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_49
; %bb.48:
	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_49:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGot	Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.loh AdrpLdrGot	Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh63
	.loh AdrpLdrGot	Lloh64, Lloh65
	.loh AdrpLdrGot	Lloh68, Lloh69
	.loh AdrpLdrGot	Lloh66, Lloh67
	.loh AdrpLdrGot	Lloh72, Lloh73
	.loh AdrpLdrGot	Lloh70, Lloh71
	.loh AdrpLdrGotLdr	Lloh74, Lloh75, Lloh76
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_GRID_SIZE,4,2              ; @MAX_GRID_SIZE
	.comm	_tess,104,3                     ; @tess
	.comm	_SHADER_MAX_VERTEXES,4,2        ; @SHADER_MAX_VERTEXES
	.comm	_SHADER_MAX_INDEXES,4,2         ; @SHADER_MAX_INDEXES
	.comm	_ATTR_POSITION,4,2              ; @ATTR_POSITION
	.comm	_ATTR_NORMAL,4,2                ; @ATTR_NORMAL
	.comm	_ATTR_TANGENT,4,2               ; @ATTR_TANGENT
	.comm	_ATTR_TEXCOORD,4,2              ; @ATTR_TEXCOORD
	.comm	_ATTR_LIGHTCOORD,4,2            ; @ATTR_LIGHTCOORD
	.comm	_ATTR_COLOR,4,2                 ; @ATTR_COLOR
	.comm	_ATTR_LIGHTDIRECTION,4,2        ; @ATTR_LIGHTDIRECTION
	.no_dead_strip	_RB_SurfaceGrid
.subsections_via_symbols
