	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_VS_InitSurfacesForTesting      ## -- Begin function VS_InitSurfacesForTesting
	.p2align	4, 0x90
_VS_InitSurfacesForTesting:             ## @VS_InitSurfacesForTesting
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_numDrawSurfaces@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	jle	LBB0_28
## %bb.1:
	movq	_entitySurface@GOTPCREL(%rip), %rbx
	xorl	%edx, %edx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	16(%r13), %edi
	movl	8(%r13), %edx
	movl	12(%r13), %esi
	addq	$4, %r13
	movq	%r13, %rcx
	callq	_VS_SphereFromBounds
	movq	_numDrawSurfaces@GOTPCREL(%rip), %r13
	movq	_entitySurface@GOTPCREL(%rip), %rbx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
LBB0_27:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%rdx
	movslq	(%r13), %rax
	cmpq	%rax, %rdx
	jge	LBB0_28
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_21 Depth 2
                                        ##       Child Loop BB0_23 Depth 3
	movq	(%rbx), %rax
	cmpq	$0, (%rax,%rdx,8)
	jne	LBB0_27
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_drawSurfaces@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	%rdx, %r12
	shlq	$5, %r12
	cmpl	$0, 28(%r14,%r12)
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, 24(%r14,%r12)
	je	LBB0_27
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%r14,%r12), %rcx
	movq	_dshaders@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %edi
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	callq	_ShaderInfoForShader
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	%rax, %r15
	movq	_CONTENTS_TRANSLUCENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_SURF_ALPHASHADOW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r15)
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$0, 8(%r14,%r12)
	js	LBB0_27
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$64, %edi
	callq	_malloc
	movq	%rax, %r13
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$64, %edx
	callq	_memset
	xorl	%eax, %eax
	callq	_MutexAlloc
	movl	%eax, 56(%r13)
	movq	$0, 48(%r13)
	cmpq	$0, 16(%r15)
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_qtrue@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 40(%r13)
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	jmp	LBB0_12
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$0, 8(%r15)
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_qtrue@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 32(%r13)
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_lsurfaceTest@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%r13, (%rax,%rcx,8)
	movq	16(%r14,%r12), %rax
	movq	_MST_TRIANGLE_SOUP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_MST_PLANAR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_MST_PATCH@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movq	%r15, %rdx
	movq	%r13, %rcx
	callq	_VS_FacetsForPatch
	jmp	LBB0_17
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	movq	%r13, %rdx
	callq	_VS_FacetsForTriangleSurface
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_MAX_FACETS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_numfacets@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jl	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str(%rip), %rdi
	callq	_Error
LBB0_19:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	12(%r13), %esi
	movl	16(%r13), %edi
	callq	_ClearBounds
	movl	(%r13), %eax
	testl	%eax, %eax
	jle	LBB0_26
## %bb.20:                              ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r14d, %r14d
	jmp	LBB0_21
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_21 Depth=2
	incq	%r14
	movslq	%eax, %rcx
	cmpq	%rcx, %r14
	jge	LBB0_26
LBB0_21:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_23 Depth 3
	movq	24(%r13), %rcx
	movq	%r14, %rdx
	shlq	$4, %rdx
	cmpl	$0, (%rcx,%rdx)
	jle	LBB0_25
## %bb.22:                              ##   in Loop: Header=BB0_21 Depth=2
	leaq	(%rcx,%rdx), %r12
	leaq	(%rcx,%rdx), %rbx
	addq	$8, %rbx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_23:                                ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_21 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	(%rbx), %rax
	movl	(%rax,%r15,4), %edi
	movl	12(%r13), %edx
	movl	16(%r13), %esi
	callq	_AddPointToBounds
	incq	%r15
	movslq	(%r12), %rax
	cmpq	%rax, %r15
	jl	LBB0_23
## %bb.24:                              ##   in Loop: Header=BB0_21 Depth=2
	movl	(%r13), %eax
	jmp	LBB0_25
LBB0_28:
	movq	_numfacets@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	__printf
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	__printf
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_VS_LinkSurfaces                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_numDrawSurfaces,4,2            ## @numDrawSurfaces
	.comm	_entitySurface,8,3              ## @entitySurface
	.comm	_drawSurfaces,8,3               ## @drawSurfaces
	.comm	_dshaders,8,3                   ## @dshaders
	.comm	_CONTENTS_TRANSLUCENT,4,2       ## @CONTENTS_TRANSLUCENT
	.comm	_SURF_ALPHASHADOW,4,2           ## @SURF_ALPHASHADOW
	.comm	_qtrue,8,3                      ## @qtrue
	.comm	_lsurfaceTest,8,3               ## @lsurfaceTest
	.comm	_MST_TRIANGLE_SOUP,8,3          ## @MST_TRIANGLE_SOUP
	.comm	_MST_PLANAR,8,3                 ## @MST_PLANAR
	.comm	_MST_PATCH,8,3                  ## @MST_PATCH
	.comm	_numfacets,8,3                  ## @numfacets
	.comm	_MAX_FACETS,8,3                 ## @MAX_FACETS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"numfacets >= MAX_FACETS (%d)"

L_.str.1:                               ## @.str.1
	.asciz	"%6d facets\n"

L_.str.2:                               ## @.str.2
	.asciz	"linking surfaces...\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_VS_InitSurfacesForTesting      ; -- Begin function VS_InitSurfacesForTesting
	.p2align	2
_VS_InitSurfacesForTesting:             ; @VS_InitSurfacesForTesting
	.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
Lloh0:
	adrp	x24, _numDrawSurfaces@GOTPAGE
Lloh1:
	ldr	x24, [x24, _numDrawSurfaces@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh2:
	adrp	x25, _numfacets@GOTPAGE
Lloh3:
	ldr	x25, [x25, _numfacets@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_27
; %bb.1:
	mov	x19, #0
Lloh4:
	adrp	x26, _entitySurface@GOTPAGE
Lloh5:
	ldr	x26, [x26, _entitySurface@GOTPAGEOFF]
Lloh6:
	adrp	x27, _drawSurfaces@GOTPAGE
Lloh7:
	ldr	x27, [x27, _drawSurfaces@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldp	w1, w0, [x21, #12]
	add	x3, x21, #4
	ldr	w2, [x21, #8]
	bl	_VS_SphereFromBounds
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x19, x19, #1
	ldrsw	x8, [x24]
	cmp	x19, x8
	b.ge	LBB0_27
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_23 Depth 2
                                        ;       Child Loop BB0_25 Depth 3
	ldr	x8, [x26]
	ldr	x8, [x8, x19, lsl #3]
	cbnz	x8, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x28, [x27]
	add	x22, x28, x19, lsl #5
	ldr	w8, [x22, #28]
	cbnz	w8, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x22, #24]
	cbz	w8, LBB0_3
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
Lloh8:
	adrp	x8, _dshaders@GOTPAGE
Lloh9:
	ldr	x8, [x8, _dshaders@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	ldr	x9, [x22]
	ldr	w0, [x8, x9, lsl #2]
	bl	_ShaderInfoForShader
	mov	x23, x0
	ldr	w8, [x0]
Lloh11:
	adrp	x9, _CONTENTS_TRANSLUCENT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CONTENTS_TRANSLUCENT@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x23, #4]
Lloh14:
	adrp	x9, _SURF_ALPHASHADOW@GOTPAGE
Lloh15:
	ldr	x9, [x9, _SURF_ALPHASHADOW@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x28, x19, lsl #5
	ldr	x8, [x8, #8]
	tbnz	x8, #63, LBB0_3
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #64
	bl	_malloc
	mov	x21, x0
	mov	w1, #0
	mov	w2, #64
	bl	_memset
	bl	_MutexAlloc
	str	w0, [x21, #56]
	str	xzr, [x21, #48]
	ldr	x8, [x23, #16]
	cbz	x8, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
Lloh17:
	adrp	x8, _qtrue@GOTPAGE
Lloh18:
	ldr	x8, [x8, _qtrue@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	str	x8, [x21, #40]
	b	LBB0_14
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x23, #8]
	cbz	x8, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_4 Depth=1
Lloh20:
	adrp	x8, _qtrue@GOTPAGE
Lloh21:
	ldr	x8, [x8, _qtrue@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	str	x8, [x21, #32]
LBB0_14:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh23:
	adrp	x8, _lsurfaceTest@GOTPAGE
Lloh24:
	ldr	x8, [x8, _lsurfaceTest@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	str	x21, [x8, x19, lsl #3]
	add	x8, x28, x19, lsl #5
	ldr	x8, [x8, #16]
Lloh26:
	adrp	x9, _MST_TRIANGLE_SOUP@GOTPAGE
Lloh27:
	ldr	x9, [x9, _MST_TRIANGLE_SOUP@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
Lloh29:
	adrp	x10, _MST_PLANAR@GOTPAGE
Lloh30:
	ldr	x10, [x10, _MST_PLANAR@GOTPAGEOFF]
Lloh31:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x22
	mov	x1, x23
	mov	x2, x21
	bl	_VS_FacetsForTriangleSurface
	b	LBB0_18
LBB0_16:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh32:
	adrp	x9, _MST_PATCH@GOTPAGE
Lloh33:
	ldr	x9, [x9, _MST_PATCH@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x22
	mov	x1, x19
	mov	x2, x23
	mov	x3, x21
	bl	_VS_FacetsForPatch
LBB0_18:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x25]
Lloh35:
	adrp	x9, _MAX_FACETS@GOTPAGE
Lloh36:
	ldr	x9, [x9, _MAX_FACETS@GOTPAGEOFF]
Lloh37:
	ldr	x1, [x9]
	cmp	x8, x1
	b.lt	LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_4 Depth=1
Lloh38:
	adrp	x0, l_.str@PAGE
Lloh39:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Error
LBB0_20:                                ;   in Loop: Header=BB0_4 Depth=1
	ldp	w1, w0, [x21, #12]
	bl	_ClearBounds
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_2
; %bb.21:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x22, #0
	b	LBB0_23
LBB0_22:                                ;   in Loop: Header=BB0_23 Depth=2
	add	x22, x22, #1
	cmp	x22, w8, sxtw
	b.ge	LBB0_2
LBB0_23:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_25 Depth 3
	ldr	x9, [x21, #24]
	add	x23, x9, x22, lsl #4
	ldr	w9, [x23]
	cmp	w9, #1
	b.lt	LBB0_22
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=2
	mov	x28, #0
	add	x20, x23, #8
LBB0_25:                                ;   Parent Loop BB0_4 Depth=1
                                        ;     Parent Loop BB0_23 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	x8, [x20]
	ldr	w0, [x8, x28, lsl #2]
	ldp	w2, w1, [x21, #12]
	bl	_AddPointToBounds
	add	x28, x28, #1
	ldrsw	x8, [x23]
	cmp	x28, x8
	b.lt	LBB0_25
; %bb.26:                               ;   in Loop: Header=BB0_23 Depth=2
	ldr	w8, [x21]
	b	LBB0_22
LBB0_27:
	ldr	x8, [x25]
	str	x8, [sp]
Lloh40:
	adrp	x0, l_.str.1@PAGE
Lloh41:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	__printf
Lloh42:
	adrp	x0, l_.str.2@PAGE
Lloh43:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	__printf
	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
	b	_VS_LinkSurfaces
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_numDrawSurfaces,4,2            ; @numDrawSurfaces
	.comm	_entitySurface,8,3              ; @entitySurface
	.comm	_drawSurfaces,8,3               ; @drawSurfaces
	.comm	_dshaders,8,3                   ; @dshaders
	.comm	_CONTENTS_TRANSLUCENT,4,2       ; @CONTENTS_TRANSLUCENT
	.comm	_SURF_ALPHASHADOW,4,2           ; @SURF_ALPHASHADOW
	.comm	_qtrue,8,3                      ; @qtrue
	.comm	_lsurfaceTest,8,3               ; @lsurfaceTest
	.comm	_MST_TRIANGLE_SOUP,8,3          ; @MST_TRIANGLE_SOUP
	.comm	_MST_PLANAR,8,3                 ; @MST_PLANAR
	.comm	_MST_PATCH,8,3                  ; @MST_PATCH
	.comm	_numfacets,8,3                  ; @numfacets
	.comm	_MAX_FACETS,8,3                 ; @MAX_FACETS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"numfacets >= MAX_FACETS (%d)"

l_.str.1:                               ; @.str.1
	.asciz	"%6d facets\n"

l_.str.2:                               ; @.str.2
	.asciz	"linking surfaces...\n"

.subsections_via_symbols
