	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function CreateSurfaceLights
LCPI0_0:
	.quad	0x3fd0000000000000              ## double 0.25
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2
LCPI0_1:
	.long	0x00000000                      ## float 0
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_CreateSurfaceLights
	.p2align	4, 0x90
_CreateSurfaceLights:                   ## @CreateSurfaceLights
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	leaq	L_.str(%rip), %rdi
	callq	_qprintf
	movq	_numDrawSurfaces@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_32
## %bb.1:
	movq	_drawSurfaces@GOTPCREL(%rip), %r12
	xorl	%ebx, %ebx
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_4
LBB0_31:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	(%rdi), %esi
	movl	8(%rdi), %edx
	movl	16(%rdi), %ecx
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	__printf
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jge	LBB0_33
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
                                        ##       Child Loop BB0_19 Depth 3
                                        ##       Child Loop BB0_23 Depth 3
	movq	(%r12), %r14
	movq	_dshaders@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	shlq	$5, %rbx
	movq	(%r14,%rbx), %rcx
	movl	(%rax,%rcx,4), %edi
	callq	_ShaderInfoForShader
	cmpl	$0, (%rax)
	je	LBB0_2
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %r13
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	incl	%eax
	cmpq	$0, 24(%r13)
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	je	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_surfaceTest@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rax,%rcx,8), %rax
	testq	%rax, %rax
	je	LBB0_26
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%rax), %rbx
	cmpl	$1, (%rax)
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$4, (%rbx)
	je	LBB0_10
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	16(%rbx), %rax
	movl	(%rax), %esi
	movl	8(%rax), %edx
	movl	16(%rax), %ecx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	__printf
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	16(%rbx), %rax
	movq	(%rax), %rdi
	movq	8(%rax), %rsi
	callq	_VectorAdd
	movq	16(%rbx), %rax
	movq	16(%rax), %rdi
	callq	_VectorAdd
	movq	16(%rbx), %rbx
	jmp	LBB0_28
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$0, 8(%r13)
	js	LBB0_2
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	movss	4(%r13), %xmm0                  ## xmm0 = mem[0],zero,zero,zero
	movaps	%xmm0, %xmm2
	cmpneqss	LCPI0_1(%rip), %xmm2
	andps	%xmm2, %xmm0
	movq	_defaultLightSubdivide@GOTPCREL(%rip), %rax
	movss	(%rax), %xmm1                   ## xmm1 = mem[0],zero,zero,zero
	andnps	%xmm1, %xmm2
	orps	%xmm0, %xmm2
	movaps	%xmm2, -96(%rbp)                ## 16-byte Spill
	leaq	(%r14,%rbx), %rcx
	addq	$16, %rcx
	xorl	%r12d, %r12d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_15 Depth=2
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	_qtrue@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	movq	%r15, %rsi
	movaps	-96(%rbp), %xmm0                ## 16-byte Reload
	callq	_SubdivideAreaLight
LBB0_14:                                ##   in Loop: Header=BB0_15 Depth=2
	leal	1(%r12), %eax
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	cmpl	8(%r13), %r12d
	movl	%eax, %r12d
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	jge	LBB0_29
LBB0_15:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_19 Depth 3
                                        ##       Child Loop BB0_23 Depth 3
	movq	_surfaceTest@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%rbx,8), %rax
	testq	%rax, %rax
	je	LBB0_21
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=2
	cmpl	$0, (%rax)
	jle	LBB0_14
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=2
	xorl	%r13d, %r13d
	xorl	%r15d, %r15d
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_19 Depth=3
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	_qtrue@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movaps	-96(%rbp), %xmm0                ## 16-byte Reload
	callq	_SubdivideAreaLight
	incq	%r15
	movq	_surfaceTest@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%rbx,8), %rax
	movslq	(%rax), %rcx
	addq	$24, %r13
	cmpq	%rcx, %r15
	jge	LBB0_14
LBB0_19:                                ##   Parent Loop BB0_4 Depth=1
                                        ##     Parent Loop BB0_15 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	8(%rax), %rbx
	movl	(%rbx,%r13), %edi
	callq	_AllocWinding
	movq	%rax, %r14
	movl	(%rbx,%r13), %eax
	movl	%eax, (%r14)
	movq	8(%r14), %rdi
	movq	16(%rbx,%r13), %rsi
	shll	$2, %eax
	leal	(%rax,%rax,2), %edx
	callq	_memcpy
	movq	8(%rbx,%r13), %rdi
	callq	_VectorCopy
	testl	%r12d, %r12d
	je	LBB0_18
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=3
	movq	%r14, %rdi
	callq	_ReverseWinding
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_FreeWinding
	movq	_vec3_origin@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_VectorSubtract
	movq	%rbx, %r14
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_15 Depth=2
	movl	(%rcx), %edi
	callq	_AllocWinding
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, %r15
	movl	(%rcx), %eax
	movl	%eax, (%r15)
	testl	%eax, %eax
	movq	_drawVerts@GOTPCREL(%rip), %r14
	jle	LBB0_24
## %bb.22:                              ##   in Loop: Header=BB0_15 Depth=2
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_23:                                ##   Parent Loop BB0_4 Depth=1
                                        ##     Parent Loop BB0_15 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	(%r14), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	-8(%rcx), %rcx
	addq	%rbx, %rcx
	movq	(%rax,%rcx,8), %rdi
	movq	8(%r15), %rax
	movq	(%rax,%rbx,8), %rsi
	callq	_VectorCopy
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	incq	%rbx
	movslq	(%rcx), %rax
	cmpq	%rax, %rbx
	jl	LBB0_23
LBB0_24:                                ##   in Loop: Header=BB0_15 Depth=2
	movq	8(%rcx), %rax
	movq	16(%rax), %rdi
	callq	_VectorCopy
	testl	%r12d, %r12d
	je	LBB0_13
## %bb.25:                              ##   in Loop: Header=BB0_15 Depth=2
	movq	%r15, %rdi
	callq	_ReverseWinding
	movq	%rax, %r14
	movq	%r15, %rdi
	callq	_FreeWinding
	movq	_vec3_origin@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_VectorSubtract
	movq	%r14, %r15
	jmp	LBB0_13
LBB0_26:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_drawVerts@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%r14,%rbx), %rcx
	cmpl	$4, 16(%r14,%rbx)
	movq	(%rax,%rcx,8), %rdi
	jne	LBB0_31
## %bb.27:                              ##   in Loop: Header=BB0_4 Depth=1
	leaq	(%rax,%rcx,8), %rbx
	movq	8(%rbx), %rsi
	callq	_VectorAdd
	movq	16(%rbx), %rdi
	callq	_VectorAdd
LBB0_28:                                ##   in Loop: Header=BB0_4 Depth=1
	addq	$24, %rbx
	movq	(%rbx), %rdi
	callq	_VectorAdd
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	callq	_VectorScale
	movq	_numPointLights@GOTPCREL(%rip), %rax
	incl	(%rax)
	movl	$32, %edi
	callq	_malloc
	movq	%rax, %rbx
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	_lights@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rax
	movq	%rax, 24(%rbx)
	movq	%rbx, (%rcx)
	movq	16(%rbx), %rsi
	callq	_VectorCopy
	movq	16(%r13), %rdi
	movq	8(%rbx), %rsi
	callq	_VectorCopy
	movq	_pointScale@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	(%r13), %eax
	movl	%eax, (%rbx)
	movq	_emit_point@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	jmp	LBB0_2
LBB0_29:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_numDrawSurfaces@GOTPCREL(%rip), %r15
	movq	_drawSurfaces@GOTPCREL(%rip), %r12
	jmp	LBB0_3
LBB0_32:
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
LBB0_33:
	leaq	L_.str.3(%rip), %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	__printf                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"--- CreateSurfaceLights ---\n"

	.comm	_numDrawSurfaces,4,2            ## @numDrawSurfaces
	.comm	_drawSurfaces,8,3               ## @drawSurfaces
	.comm	_dshaders,8,3                   ## @dshaders
	.comm	_defaultLightSubdivide,4,2      ## @defaultLightSubdivide
	.comm	_surfaceTest,8,3                ## @surfaceTest
L_.str.1:                               ## @.str.1
	.asciz	"WARNING: surface at (%i %i %i) has autosprite shader but isn't a quad\n"

	.comm	_drawVerts,8,3                  ## @drawVerts
L_.str.2:                               ## @.str.2
	.asciz	"WARNING: surface at (%i %i %i) has autosprite shader but %i verts\n"

	.comm	_numPointLights,4,2             ## @numPointLights
	.comm	_lights,8,3                     ## @lights
	.comm	_pointScale,4,2                 ## @pointScale
	.comm	_emit_point,4,2                 ## @emit_point
	.comm	_vec3_origin,4,2                ## @vec3_origin
	.comm	_qtrue,4,2                      ## @qtrue
L_.str.3:                               ## @.str.3
	.asciz	"%5i light emitting surfaces\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CreateSurfaceLights            ; -- Begin function CreateSurfaceLights
	.p2align	2
_CreateSurfaceLights:                   ; @CreateSurfaceLights
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	d9, d8, [sp, #32]               ; 16-byte Folded Spill
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_qprintf
Lloh2:
	adrp	x24, _numDrawSurfaces@GOTPAGE
Lloh3:
	ldr	x24, [x24, _numDrawSurfaces@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_30
; %bb.1:
	mov	x26, #0
	mov	w20, #0
Lloh4:
	adrp	x25, _drawSurfaces@GOTPAGE
Lloh5:
	ldr	x25, [x25, _drawSurfaces@GOTPAGEOFF]
Lloh6:
	adrp	x21, _surfaceTest@GOTPAGE
Lloh7:
	ldr	x21, [x21, _surfaceTest@GOTPAGEOFF]
Lloh8:
	adrp	x27, _drawVerts@GOTPAGE
Lloh9:
	ldr	x27, [x27, _drawVerts@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w20, [sp, #20]                  ; 4-byte Folded Reload
Lloh10:
	adrp	x24, _numDrawSurfaces@GOTPAGE
Lloh11:
	ldr	x24, [x24, _numDrawSurfaces@GOTPAGEOFF]
Lloh12:
	adrp	x25, _drawSurfaces@GOTPAGE
Lloh13:
	ldr	x25, [x25, _drawSurfaces@GOTPAGEOFF]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x26, x26, #1
	ldrsw	x8, [x24]
	cmp	x26, x8
	b.ge	LBB0_31
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_15 Depth 2
                                        ;       Child Loop BB0_19 Depth 3
                                        ;       Child Loop BB0_23 Depth 3
	ldr	x19, [x25]
Lloh14:
	adrp	x8, _dshaders@GOTPAGE
Lloh15:
	ldr	x8, [x8, _dshaders@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	lsl	x9, x26, #5
	ldr	x9, [x19, x9]
	ldr	w0, [x8, x9, lsl #2]
	bl	_ShaderInfoForShader
	ldr	w8, [x0]
	cbz	w8, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x22, x0
	ldr	s0, [x0, #4]
Lloh17:
	adrp	x8, _defaultLightSubdivide@GOTPAGE
Lloh18:
	ldr	x8, [x8, _defaultLightSubdivide@GOTPAGEOFF]
Lloh19:
	ldr	s1, [x8]
	fcmp	s0, #0.0
	fcsel	s8, s0, s1, ne
	add	w20, w20, #1
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x21]
	ldr	x8, [x8, x26, lsl #3]
	cbz	x8, LBB0_26
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x19, [x8, #8]
	ldr	w8, [x8]
	cmp	w8, #1
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x19]
	cmp	w8, #4
	b.eq	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #16]
	ldr	w1, [x8]
	ldp	x9, x8, [x8, #8]
	stp	x9, x8, [sp]
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	__printf
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #16]
	ldp	x0, x1, [x8]
	bl	_VectorAdd
	ldr	x8, [x19, #16]
	ldr	x0, [x8, #16]
	bl	_VectorAdd
	ldr	x8, [x19, #16]
	add	x8, x8, #24
	b	LBB0_28
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x22, #8]
	tbnz	w8, #31, LBB0_3
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	str	w20, [sp, #20]                  ; 4-byte Folded Spill
	mov	w25, #0
	add	x8, x19, x26, lsl #5
	add	x19, x8, #16
	add	x20, x8, #8
	add	x8, x8, #24
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
	b	LBB0_15
LBB0_13:                                ;   in Loop: Header=BB0_15 Depth=2
Lloh22:
	adrp	x8, _qtrue@GOTPAGE
Lloh23:
	ldr	x8, [x8, _qtrue@GOTPAGEOFF]
Lloh24:
	ldr	w3, [x8]
	mov	x0, x22
	mov	x1, x23
	fmov	s0, s8
	bl	_SubdivideAreaLight
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=2
	add	w8, w25, #1
	ldr	w9, [x22, #8]
	cmp	w25, w9
	mov	x25, x8
Lloh25:
	adrp	x27, _drawVerts@GOTPAGE
Lloh26:
	ldr	x27, [x27, _drawVerts@GOTPAGEOFF]
	b.ge	LBB0_2
LBB0_15:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_19 Depth 3
                                        ;       Child Loop BB0_23 Depth 3
	ldr	x8, [x21]
	ldr	x8, [x8, x26, lsl #3]
	cbz	x8, LBB0_21
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=2
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_14
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=2
	mov	x28, #0
	mov	x27, #0
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_19 Depth=3
Lloh27:
	adrp	x8, _qtrue@GOTPAGE
Lloh28:
	ldr	x8, [x8, _qtrue@GOTPAGEOFF]
Lloh29:
	ldr	w3, [x8]
	mov	x0, x22
	mov	x1, x23
	fmov	s0, s8
	bl	_SubdivideAreaLight
	add	x27, x27, #1
	ldr	x8, [x21]
	ldr	x8, [x8, x26, lsl #3]
	ldrsw	x9, [x8]
	add	x28, x28, #24
	cmp	x27, x9
	b.ge	LBB0_14
LBB0_19:                                ;   Parent Loop BB0_4 Depth=1
                                        ;     Parent Loop BB0_15 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	x8, [x8, #8]
	add	x24, x8, x28
	ldr	w0, [x24]
	bl	_AllocWinding
	mov	x23, x0
	ldr	w8, [x24]
	str	w8, [x0]
	ldr	x0, [x0, #8]
	ldr	x1, [x24, #16]
	add	w8, w8, w8, lsl #1
	lsl	w2, w8, #2
	bl	_memcpy
	ldr	x0, [x24, #8]
	bl	_VectorCopy
	cbz	w25, LBB0_18
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=3
	mov	x0, x23
	bl	_ReverseWinding
	mov	x24, x0
	mov	x0, x23
	bl	_FreeWinding
Lloh30:
	adrp	x8, _vec3_origin@GOTPAGE
Lloh31:
	ldr	x8, [x8, _vec3_origin@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	bl	_VectorSubtract
	mov	x23, x24
	b	LBB0_18
LBB0_21:                                ;   in Loop: Header=BB0_15 Depth=2
	ldr	w0, [x19]
	bl	_AllocWinding
	mov	x23, x0
	ldr	w8, [x19]
	str	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_24
; %bb.22:                               ;   in Loop: Header=BB0_15 Depth=2
	mov	x24, #0
LBB0_23:                                ;   Parent Loop BB0_4 Depth=1
                                        ;     Parent Loop BB0_15 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	x8, [x27]
	ldr	x9, [x20]
	add	x9, x24, x9
	ldr	x0, [x8, x9, lsl #3]
	ldr	x8, [x23, #8]
	ldr	x1, [x8, x24, lsl #3]
	bl	_VectorCopy
	add	x24, x24, #1
	ldrsw	x8, [x19]
	cmp	x24, x8
	b.lt	LBB0_23
LBB0_24:                                ;   in Loop: Header=BB0_15 Depth=2
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	ldr	x8, [x8]
	ldr	x0, [x8, #16]
	bl	_VectorCopy
	cbz	w25, LBB0_13
; %bb.25:                               ;   in Loop: Header=BB0_15 Depth=2
	mov	x0, x23
	bl	_ReverseWinding
	mov	x24, x0
	mov	x0, x23
	bl	_FreeWinding
Lloh33:
	adrp	x8, _vec3_origin@GOTPAGE
Lloh34:
	ldr	x8, [x8, _vec3_origin@GOTPAGEOFF]
Lloh35:
	ldr	w0, [x8]
	bl	_VectorSubtract
	mov	x23, x24
	b	LBB0_13
LBB0_26:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x27]
	add	x9, x19, x26, lsl #5
	ldr	x10, [x9, #8]
	add	x19, x8, x10, lsl #3
	ldr	w8, [x9, #16]
	ldr	x0, [x19]
	cmp	w8, #4
	b.ne	LBB0_29
; %bb.27:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x1, [x19, #8]
	bl	_VectorAdd
	ldr	x0, [x19, #16]
	bl	_VectorAdd
	add	x8, x19, #24
LBB0_28:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x8]
	bl	_VectorAdd
	fmov	d0, #0.25000000
	bl	_VectorScale
Lloh36:
	adrp	x9, _numPointLights@GOTPAGE
Lloh37:
	ldr	x9, [x9, _numPointLights@GOTPAGEOFF]
	ldr	w8, [x9]
	add	w8, w8, #1
	str	w8, [x9]
	mov	w0, #32
	bl	_malloc
	mov	x23, x0
	mov	w1, #0
	mov	w2, #32
	bl	_memset
Lloh38:
	adrp	x9, _lights@GOTPAGE
Lloh39:
	ldr	x9, [x9, _lights@GOTPAGEOFF]
	ldr	x8, [x9]
	str	x8, [x23, #24]
	str	x23, [x9]
	ldr	x1, [x23, #16]
	bl	_VectorCopy
	ldr	x0, [x22, #16]
	ldr	x1, [x23, #8]
	bl	_VectorCopy
	ldr	w8, [x22]
Lloh40:
	adrp	x9, _pointScale@GOTPAGE
Lloh41:
	ldr	x9, [x9, _pointScale@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x9]
	mul	w8, w9, w8
	str	w8, [x23]
Lloh43:
	adrp	x8, _emit_point@GOTPAGE
Lloh44:
	ldr	x8, [x8, _emit_point@GOTPAGEOFF]
Lloh45:
	ldr	w8, [x8]
	str	w8, [x23, #4]
	b	LBB0_3
LBB0_29:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x0]
	ldp	x8, x9, [x0, #8]
	stp	x8, x9, [sp]
Lloh46:
	adrp	x0, l_.str.2@PAGE
Lloh47:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	__printf
	b	LBB0_3
LBB0_30:
	mov	w20, #0
LBB0_31:
Lloh48:
	adrp	x0, l_.str.3@PAGE
Lloh49:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x20
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #32]               ; 16-byte Folded Reload
	add	sp, sp, #144
	b	__printf
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpAdd	Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"--- CreateSurfaceLights ---\n"

	.comm	_numDrawSurfaces,4,2            ; @numDrawSurfaces
	.comm	_drawSurfaces,8,3               ; @drawSurfaces
	.comm	_dshaders,8,3                   ; @dshaders
	.comm	_defaultLightSubdivide,4,2      ; @defaultLightSubdivide
	.comm	_surfaceTest,8,3                ; @surfaceTest
l_.str.1:                               ; @.str.1
	.asciz	"WARNING: surface at (%i %i %i) has autosprite shader but isn't a quad\n"

	.comm	_drawVerts,8,3                  ; @drawVerts
l_.str.2:                               ; @.str.2
	.asciz	"WARNING: surface at (%i %i %i) has autosprite shader but %i verts\n"

	.comm	_numPointLights,4,2             ; @numPointLights
	.comm	_lights,8,3                     ; @lights
	.comm	_pointScale,4,2                 ; @pointScale
	.comm	_emit_point,4,2                 ; @emit_point
	.comm	_vec3_origin,4,2                ; @vec3_origin
	.comm	_qtrue,4,2                      ; @qtrue
l_.str.3:                               ; @.str.3
	.asciz	"%5i light emitting surfaces\n"

.subsections_via_symbols
