// File: Olverine[P]TerminalGraphics/./Graphics.h
// Function: loadShape(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vec4* loadShape(string filePath){
    ifstream shapeFile;
    shapeFile.open(filePath);
	vec4 vertices[256];

    string output[256];
    int line = 0;
    if (shapeFile.is_open()) {

        while (!shapeFile.eof()) {
            getline(shapeFile, output[line]);
            istringstream ss(output[line]);
            string token;

			if(!output[line].empty()){

				int i = 0;
				while (getline(ss, token, ',')) {
					float x = stof(token);
					getline(ss, token, ',');
					float y = stof(token);
					getline(ss, token, ',');
					float z = stof(token);
					vertices[line * 2 + i + 1] = vec4(x,y,z,1);
					i++;
				}
				line++;
			}
        }
        vertices[0] = vec4(line * 2);
    }
    shapeFile.close();
	vec4* verts = vertices;
	return verts;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x34a0, %rsp           # imm = 0x34A0
movq %rdi, -0x3418(%rbp)
movq %rdi, -0x10(%rbp)
leaq -0x218(%rbp), %rdi
movq %rdi, -0x3420(%rbp)
callq 0x2230
movq -0x3420(%rbp), %rdi
movq -0x3418(%rbp), %rsi
movl $0x8, %edx
callq 0x21a0
jmp 0x3713
leaq -0x1230(%rbp), %rax
movq %rax, %rcx
addq $0x1000, %rcx           # imm = 0x1000
movq %rcx, -0x3430(%rbp)
movq %rax, -0x3428(%rbp)
movq -0x3428(%rbp), %rdi
movq %rdi, -0x3438(%rbp)
callq 0x4650
jmp 0x3747
movq -0x3430(%rbp), %rcx
movq -0x3438(%rbp), %rax
addq $0x10, %rax
cmpq %rcx, %rax
movq %rax, -0x3428(%rbp)
jne 0x3732
leaq -0x3230(%rbp), %rax
movq %rax, %rcx
addq $0x2000, %rcx           # imm = 0x2000
movq %rcx, -0x3448(%rbp)
movq %rax, -0x3440(%rbp)
movq -0x3440(%rbp), %rdi
movq %rdi, -0x3450(%rbp)
callq 0x2270
movq -0x3450(%rbp), %rax
movq -0x3448(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x3440(%rbp)
jne 0x3784
movl $0x0, -0x3234(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x22c0
movb %al, -0x3451(%rbp)
jmp 0x37d3
movb -0x3451(%rbp), %al
testb $0x1, %al
jne 0x37e2
jmp 0x3ac9
jmp 0x37e4
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x218(%rbp,%rax), %rdi
callq 0x2350
movb %al, -0x3452(%rbp)
jmp 0x3804
movb -0x3452(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x3815
jmp 0x3a93
movslq -0x3234(%rbp), %rax
shlq $0x5, %rax
leaq -0x3230(%rbp,%rax), %rsi
leaq -0x218(%rbp), %rdi
callq 0x2060
jmp 0x3836
movslq -0x3234(%rbp), %rax
shlq $0x5, %rax
leaq -0x3230(%rbp,%rax), %rsi
leaq -0x33b8(%rbp), %rdi
movl $0x8, %edx
callq 0x22f0
jmp 0x385c
leaq -0x33d8(%rbp), %rdi
callq 0x2270
movslq -0x3234(%rbp), %rax
leaq -0x3230(%rbp), %rdi
shlq $0x5, %rax
addq %rax, %rdi
callq 0x22e0
testb $0x1, %al
jne 0x3a76
movl $0x0, -0x33dc(%rbp)
leaq -0x33b8(%rbp), %rdi
leaq -0x33d8(%rbp), %rsi
movl $0x2c, %edx
callq 0x2360
movq %rax, -0x3460(%rbp)
jmp 0x38b5
movq -0x3460(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2250
movb %al, -0x3461(%rbp)
jmp 0x38d3
movb -0x3461(%rbp), %al
testb $0x1, %al
jne 0x38e2
jmp 0x3a67
xorl %eax, %eax
movl %eax, %esi
leaq -0x33d8(%rbp), %rdi
callq 0x4680
movss %xmm0, -0x3468(%rbp)
jmp 0x38fc
movss -0x3468(%rbp), %xmm0
movss %xmm0, -0x33e0(%rbp)
leaq -0x33b8(%rbp), %rdi
leaq -0x33d8(%rbp), %rsi
movl $0x2c, %edx
callq 0x2360
jmp 0x3926
xorl %eax, %eax
movl %eax, %esi
leaq -0x33d8(%rbp), %rdi
callq 0x4680
movss %xmm0, -0x346c(%rbp)
jmp 0x3940
movss -0x346c(%rbp), %xmm0
movss %xmm0, -0x33e4(%rbp)
leaq -0x33b8(%rbp), %rdi
leaq -0x33d8(%rbp), %rsi
movl $0x2c, %edx
callq 0x2360
jmp 0x396a
xorl %eax, %eax
movl %eax, %esi
leaq -0x33d8(%rbp), %rdi
callq 0x4680
movss %xmm0, -0x3470(%rbp)
jmp 0x3984
movss -0x3470(%rbp), %xmm0
movss %xmm0, -0x33e8(%rbp)
movss -0x33e0(%rbp), %xmm0
movss -0x33e4(%rbp), %xmm1
movss -0x33e8(%rbp), %xmm2
leaq -0x33f8(%rbp), %rdi
movl $0x1, %esi
callq 0x46c0
jmp 0x39bf
movl -0x3234(%rbp), %eax
shll %eax
addl -0x33dc(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq -0x1230(%rbp), %rax
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x33f8(%rbp), %rcx
movq %rcx, (%rax)
movq -0x33f0(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl -0x33dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x33dc(%rbp)
jmp 0x3894
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x3ba3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x3b55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x33d8(%rbp), %rdi
callq 0x2398
leaq -0x33b8(%rbp), %rdi
callq 0x20e0
jmp 0x3b55
movl -0x3234(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3234(%rbp)
leaq -0x33d8(%rbp), %rdi
callq 0x2398
leaq -0x33b8(%rbp), %rdi
callq 0x20e0
jmp 0x37e4
movl -0x3234(%rbp), %eax
addl %eax, %eax
cvtsi2ss %eax, %xmm0
leaq -0x3408(%rbp), %rdi
callq 0x4710
jmp 0x3aad
movq -0x3408(%rbp), %rax
movq %rax, -0x1230(%rbp)
movq -0x3400(%rbp), %rax
movq %rax, -0x1228(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x2070
jmp 0x3ad7
leaq -0x1230(%rbp), %rax
movq %rax, -0x3410(%rbp)
movq -0x3410(%rbp), %rax
movq %rax, -0x8(%rbp)
leaq -0x3230(%rbp), %rax
movq %rax, -0x3480(%rbp)
addq $0x2000, %rax           # imm = 0x2000
movq %rax, -0x3478(%rbp)
movq -0x3478(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x3488(%rbp)
callq 0x2398
movq -0x3480(%rbp), %rcx
movq -0x3488(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x3478(%rbp)
jne 0x3b0b
leaq -0x218(%rbp), %rdi
callq 0x2080
movq -0x8(%rbp), %rax
addq $0x34a0, %rsp           # imm = 0x34A0
popq %rbp
retq
leaq -0x3230(%rbp), %rax
movq %rax, -0x3498(%rbp)
addq $0x2000, %rax           # imm = 0x2000
movq %rax, -0x3490(%rbp)
movq -0x3490(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x34a0(%rbp)
callq 0x2398
movq -0x3498(%rbp), %rcx
movq -0x34a0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x3490(%rbp)
jne 0x3b70
jmp 0x3ba3
leaq -0x218(%rbp), %rdi
callq 0x2080
movq -0x220(%rbp), %rdi
callq 0x2310
nopl (%rax,%rax)