	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_RB_EndSurface                  ## -- Begin function RB_EndSurface
	.p2align	4, 0x90
_RB_EndSurface:                         ## @RB_EndSurface
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_tess@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_16
## %bb.1:
	cmpq	$0, 8(%rbx)
	je	LBB0_16
## %bb.2:
	movq	16(%rbx), %rax
	movq	_SHADER_MAX_INDEXES@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	cmpq	$0, -8(%rax,%rcx,8)
	je	LBB0_4
## %bb.3:
	movq	_ri@GOTPCREL(%rip), %rax
	movq	_ERR_DROP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str(%rip), %rsi
	callq	*(%rax)
LBB0_4:
	movq	24(%rbx), %rax
	movq	_SHADER_MAX_VERTEXES@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movq	-8(%rax,%rcx,8), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.5:
	movq	_ri@GOTPCREL(%rip), %rax
	movq	_ERR_DROP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	*(%rax)
LBB0_6:
	movq	64(%rbx), %rax
	movq	_tr@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_17
## %bb.7:
	movq	_r_debugSort@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx), %rcx
	testq	%rcx, %rcx
	je	LBB0_9
## %bb.8:
	cmpq	(%rax), %rcx
	jge	LBB0_9
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_9:
	cmpq	$0, 56(%rbx)
	je	LBB0_11
## %bb.10:
	xorl	%eax, %eax
	callq	_VaoCache_Commit
LBB0_11:
	movq	_backEnd@GOTPCREL(%rip), %rax
	incl	16(%rax)
	movl	8(%rbx), %ecx
	addl	%ecx, 12(%rax)
	movq	(%rbx), %rcx
	addq	%rcx, (%rax)
	imull	32(%rbx), %ecx
	addl	%ecx, 8(%rax)
	xorl	%eax, %eax
	callq	*48(%rbx)
	movq	_r_showtris@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	$0, (%rax)
	je	LBB0_13
## %bb.12:
	movq	_tess@GOTPCREL(%rip), %rdi
	callq	_DrawTris
LBB0_13:
	movq	_r_shownormals@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	$0, (%rax)
	je	LBB0_15
## %bb.14:
	movq	_tess@GOTPCREL(%rip), %rdi
	callq	_DrawNormals
LBB0_15:
	movq	$0, 40(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rbx)
	leaq	L_.str.2(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_GLimp_LogComment               ## TAILCALL
LBB0_17:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_RB_ShadowTessEnd               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_tess,72,3                      ## @tess
	.comm	_SHADER_MAX_INDEXES,4,2         ## @SHADER_MAX_INDEXES
	.comm	_ri,8,3                         ## @ri
	.comm	_ERR_DROP,4,2                   ## @ERR_DROP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"RB_EndSurface() - SHADER_MAX_INDEXES hit"

	.comm	_SHADER_MAX_VERTEXES,4,2        ## @SHADER_MAX_VERTEXES
L_.str.1:                               ## @.str.1
	.asciz	"RB_EndSurface() - SHADER_MAX_VERTEXES hit"

	.comm	_tr,8,3                         ## @tr
	.comm	_r_debugSort,8,3                ## @r_debugSort
	.comm	_backEnd,24,3                   ## @backEnd
	.comm	_r_showtris,8,3                 ## @r_showtris
	.comm	_r_shownormals,8,3              ## @r_shownormals
L_.str.2:                               ## @.str.2
	.asciz	"----------\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_RB_EndSurface                  ; -- Begin function RB_EndSurface
	.p2align	2
_RB_EndSurface:                         ; @RB_EndSurface
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x19, _tess@GOTPAGE
Lloh1:
	ldr	x19, [x19, _tess@GOTPAGEOFF]
	ldp	x8, x9, [x19]
	cmp	x8, #0
	ccmp	x9, #0, #4, ne
	b.ne	LBB0_2
LBB0_1:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_2:
	ldr	x8, [x19, #16]
Lloh2:
	adrp	x9, _SHADER_MAX_INDEXES@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SHADER_MAX_INDEXES@GOTPAGEOFF]
Lloh4:
	ldrsw	x9, [x9]
	add	x8, x8, x9, lsl #3
	ldur	x8, [x8, #-8]
Lloh5:
	adrp	x20, _ri@GOTPAGE
Lloh6:
	ldr	x20, [x20, _ri@GOTPAGEOFF]
Lloh7:
	adrp	x21, _ERR_DROP@GOTPAGE
Lloh8:
	ldr	x21, [x21, _ERR_DROP@GOTPAGEOFF]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	x8, [x20]
	ldr	w0, [x21]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	blr	x8
LBB0_4:
	ldr	x8, [x19, #24]
Lloh11:
	adrp	x9, _SHADER_MAX_VERTEXES@GOTPAGE
Lloh12:
	ldr	x9, [x9, _SHADER_MAX_VERTEXES@GOTPAGEOFF]
Lloh13:
	ldrsw	x9, [x9]
	add	x8, x8, x9, lsl #3
	ldur	x8, [x8, #-8]
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.5:
	ldr	x8, [x20]
	ldr	w0, [x21]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	blr	x8
LBB0_6:
	ldr	x8, [x19, #64]
Lloh16:
	adrp	x9, _tr@GOTPAGE
Lloh17:
	ldr	x9, [x9, _tr@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_16
; %bb.7:
Lloh19:
	adrp	x9, _r_debugSort@GOTPAGE
Lloh20:
	ldr	x9, [x9, _r_debugSort@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	ldr	x9, [x9]
	cbz	x9, LBB0_9
; %bb.8:
	ldr	x8, [x8]
	cmp	x9, x8
	b.lt	LBB0_1
LBB0_9:
	ldr	x8, [x19, #56]
	cbz	x8, LBB0_11
; %bb.10:
	bl	_VaoCache_Commit
LBB0_11:
	add	x8, x19, #8
Lloh22:
	adrp	x9, _backEnd@GOTPAGE
Lloh23:
	ldr	x9, [x9, _backEnd@GOTPAGEOFF]
	movi.2s	v0, #1
	ld1.s	{ v0 }[0], [x8]
	ldur	d1, [x9, #12]
	add.2s	v0, v1, v0
	stur	d0, [x9, #12]
	ldr	x8, [x19]
	ldr	x10, [x9]
	add	x10, x10, x8
	str	x10, [x9]
	ldr	w10, [x19, #32]
	ldr	w11, [x9, #8]
	madd	w8, w10, w8, w11
	str	w8, [x9, #8]
	ldr	x8, [x19, #48]
	blr	x8
Lloh24:
	adrp	x8, _r_showtris@GOTPAGE
Lloh25:
	ldr	x8, [x8, _r_showtris@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	ldr	x8, [x8]
	cbz	x8, LBB0_13
; %bb.12:
Lloh27:
	adrp	x0, _tess@GOTPAGE
Lloh28:
	ldr	x0, [x0, _tess@GOTPAGEOFF]
	bl	_DrawTris
LBB0_13:
Lloh29:
	adrp	x8, _r_shownormals@GOTPAGE
Lloh30:
	ldr	x8, [x8, _r_shownormals@GOTPAGEOFF]
Lloh31:
	ldr	x8, [x8]
	ldr	x8, [x8]
	cbz	x8, LBB0_15
; %bb.14:
Lloh32:
	adrp	x0, _tess@GOTPAGE
Lloh33:
	ldr	x0, [x0, _tess@GOTPAGEOFF]
	bl	_DrawNormals
LBB0_15:
	str	xzr, [x19, #40]
	stp	xzr, xzr, [x19]
Lloh34:
	adrp	x0, l_.str.2@PAGE
Lloh35:
	add	x0, x0, l_.str.2@PAGEOFF
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_GLimp_LogComment
LBB0_16:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_RB_ShadowTessEnd
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_tess,72,3                      ; @tess
	.comm	_SHADER_MAX_INDEXES,4,2         ; @SHADER_MAX_INDEXES
	.comm	_ri,8,3                         ; @ri
	.comm	_ERR_DROP,4,2                   ; @ERR_DROP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"RB_EndSurface() - SHADER_MAX_INDEXES hit"

	.comm	_SHADER_MAX_VERTEXES,4,2        ; @SHADER_MAX_VERTEXES
l_.str.1:                               ; @.str.1
	.asciz	"RB_EndSurface() - SHADER_MAX_VERTEXES hit"

	.comm	_tr,8,3                         ; @tr
	.comm	_r_debugSort,8,3                ; @r_debugSort
	.comm	_backEnd,24,3                   ; @backEnd
	.comm	_r_showtris,8,3                 ; @r_showtris
	.comm	_r_shownormals,8,3              ; @r_shownormals
l_.str.2:                               ; @.str.2
	.asciz	"----------\n"

.subsections_via_symbols
