	.file	"extr_light_trace.c_TriangulateTraceNode_r.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	TriangulateTraceNode_r, @function
TriangulateTraceNode_r:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xor	r13d, r13d
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	test	edi, edi
	js	.L1
	cmp	DWORD PTR numTraceNodes[rip], edi
	jle	.L1
	mov	rbx, QWORD PTR traceNodes[rip]
	movsx	rdi, edi
	sal	rdi, 5
	add	rbx, rdi
	cmp	QWORD PTR [rbx], 0
	jns	.L23
	mov	rdi, QWORD PTR 24[rbx]
	mov	r13d, DWORD PTR 16[rbx]
	mov	QWORD PTR 8[rsp], rdi
	test	r13d, r13d
	jne	.L4
	mov	DWORD PTR 20[rbx], 0
	test	rdi, rdi
	je	.L1
.L21:
	call	free@PLT
.L8:
	mov	r13d, DWORD PTR 16[rbx]
.L1:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L24
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	lea	eax, [r13+r13]
	mov	DWORD PTR 16[rbx], 0
	mov	DWORD PTR 20[rbx], eax
	lea	edi, [rax+r13*4]
	sal	edi, 3
	call	safe_malloc@PLT
	mov	QWORD PTR 24[rbx], rax
	test	r13d, r13d
	jle	.L12
	mov	rcx, QWORD PTR 8[rsp]
	lea	eax, -1[r13]
	lea	rbp, 16[rsp]
	lea	rax, 4[rcx+rax*4]
	mov	r12, rcx
	mov	QWORD PTR [rsp], rax
	.p2align 4,,10
	.p2align 3
.L11:
	movsx	rax, DWORD PTR [r12]
	lea	rdx, [rax+rax*2]
	mov	rax, QWORD PTR traceWindings[rip]
	lea	r13, [rax+rdx*8]
	mov	eax, DWORD PTR 16[r13]
	mov	rdx, QWORD PTR 8[r13]
	cmp	DWORD PTR 0[r13], 2
	mov	DWORD PTR 36[rsp], eax
	mov	ecx, DWORD PTR [rdx]
	mov	rax, QWORD PTR 24[rsp]
	mov	DWORD PTR [rax], ecx
	jle	.L9
	mov	r15d, 8
	mov	r14d, 3
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L25:
	mov	rdx, QWORD PTR 8[r13]
	mov	rax, QWORD PTR 24[rsp]
	add	r14d, 1
.L10:
	mov	edi, DWORD PTR -4[rdx+r15]
	mov	esi, DWORD PTR [rax]
	mov	DWORD PTR 4[rax], edi
	mov	edx, DWORD PTR [rdx+r15]
	add	r15, 4
	mov	DWORD PTR 8[rax], edx
	mov	edx, DWORD PTR 32[rsp]
	call	VectorSubtract@PLT
	mov	rax, QWORD PTR 24[rsp]
	mov	edx, DWORD PTR 16[rsp]
	mov	esi, DWORD PTR [rax]
	mov	edi, DWORD PTR 8[rax]
	call	VectorSubtract@PLT
	mov	rdi, rbp
	call	AddTraceTriangle@PLT
	mov	rdi, rbx
	mov	esi, eax
	call	AddItemToTraceNode@PLT
	cmp	DWORD PTR 0[r13], r14d
	jg	.L25
.L9:
	add	r12, 4
	cmp	QWORD PTR [rsp], r12
	jne	.L11
.L12:
	cmp	QWORD PTR 8[rsp], 0
	je	.L8
	mov	rdi, QWORD PTR 8[rsp]
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L23:
	mov	rax, QWORD PTR 8[rbx]
	mov	edi, DWORD PTR [rax]
	mov	ebp, DWORD PTR 4[rax]
	call	TriangulateTraceNode_r
	mov	edi, ebp
	mov	DWORD PTR 16[rbx], eax
	call	TriangulateTraceNode_r
	add	eax, DWORD PTR 16[rbx]
	mov	DWORD PTR 16[rbx], eax
	mov	r13d, eax
	jmp	.L1
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	TriangulateTraceNode_r, .-TriangulateTraceNode_r
	.comm	traceWindings,8,8
	.comm	traceNodes,8,8
	.comm	numTraceNodes,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_light_trace.c_TriangulateTraceNode_r.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	TriangulateTraceNode_r, %function
TriangulateTraceNode_r:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r3, .L25
	sub	sp, sp, #24
	cmp	r0, #0
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	blt	.L15
	ldr	r3, .L25+4
	ldr	r3, [r3]
	cmp	r3, r0
	ble	.L15
	ldr	r3, .L25+8
	add	r0, r0, r0, lsl #2
	ldr	r5, [r3]
	ldr	r3, [r5, r0, lsl #2]
	add	r5, r5, r0, lsl #2
	cmp	r3, #0
	bge	.L22
	ldr	r6, [r5, #8]
	ldr	r9, [r5, #16]
	cmp	r6, #0
	bne	.L4
	cmp	r9, #0
	str	r6, [r5, #12]
	beq	.L1
.L7:
	mov	r0, r9
	bl	free
.L8:
	ldr	r6, [r5, #8]
	b	.L1
.L15:
	mov	r6, #0
.L1:
	ldr	r3, .L25
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L23
	mov	r0, r6
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L4:
	mov	r2, #0
	lsl	r3, r6, #1
	str	r2, [r5, #8]
	str	r3, [r5, #12]
	lsl	r0, r6, #5
	bl	safe_malloc
	cmp	r6, #0
	str	r0, [r5, #16]
	ble	.L12
	sub	r7, r9, #4
	ldr	r8, .L25+12
	add	r6, r7, r6, lsl #2
.L11:
	ldr	r3, [r7, #4]!
	ldr	r1, [r8]
	add	r3, r3, r3, lsl #1
	add	r10, r1, r3, lsl #2
	ldr	r2, [r10, #4]
	ldr	r3, [r1, r3, lsl #2]
	ldr	r0, [r10, #8]
	ldr	r1, [r2]
	cmp	r3, #2
	ldr	r3, [sp, #8]
	str	r0, [sp, #16]
	str	r1, [r3]
	ble	.L9
	mov	r4, #2
	b	.L10
.L24:
	ldr	r2, [r10, #4]
	ldr	r3, [sp, #8]
.L10:
	add	r1, r2, r4, lsl #2
	ldr	r0, [r1, #-4]
	ldr	r1, [r3]
	str	r0, [r3, #4]
	ldr	r2, [r2, r4, lsl #2]
	add	r4, r4, #1
	str	r2, [r3, #8]
	ldr	r2, [sp, #12]
	bl	VectorSubtract
	ldmib	sp, {r2, r3}
	ldr	r1, [r3]
	ldr	r0, [r3, #8]
	bl	VectorSubtract
	add	r0, sp, #4
	bl	AddTraceTriangle
	mov	r1, r0
	mov	r0, r5
	bl	AddItemToTraceNode
	ldr	r3, [r10]
	cmp	r4, r3
	blt	.L24
.L9:
	cmp	r6, r7
	bne	.L11
.L12:
	cmp	r9, #0
	bne	.L7
	b	.L8
.L22:
	ldr	r3, [r5, #4]
	ldm	r3, {r0, r4}
	bl	TriangulateTraceNode_r
	mov	r3, r0
	mov	r0, r4
	str	r3, [r5, #8]
	bl	TriangulateTraceNode_r
	ldr	r6, [r5, #8]
	add	r6, r0, r6
	str	r6, [r5, #8]
	b	.L1
.L23:
	bl	__stack_chk_fail
.L26:
	.align	2
.L25:
	.word	.LC0
	.word	numTraceNodes
	.word	traceNodes
	.word	traceWindings
	.size	TriangulateTraceNode_r, .-TriangulateTraceNode_r
	.comm	traceWindings,4,4
	.comm	traceNodes,4,4
	.comm	numTraceNodes,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
