// File: /workspace/github_cpp_makefile_star2_O3/nikhilYadala[P]Python_to_cpp/Source/src/main.cpp
// Function: main
int main(int argc, char *argv[])
{

	char *f=argv[1];
	std::string input_src;
	if (FILE *fp = fopen(f,"r"))
	{
		char buf[chunk];
		while (size_t len = fread(buf, 1, sizeof(buf), fp))
			input_src.insert(input_src.end(), buf, buf + len);
		fclose(fp);

		
	}
	else {
		std::cout<<"Unable to open source file (main.cpp)\n";
		exit(0);
	}

	
	for(int i=0;;++i)
		if(f[i]=='.')
		{
			f[i]='\0';
			break;
		}
		

	source_code input_code(input_src);
	input_code.file_name=f;
	input_code.functionize();
	//input_code.make_classes();
	
	input_code.generate_cpp_code();

	input_code.generate_cpp_classes();

	// std::cout<<f<<"\n";
	
	input_code.render_code();
		 std::cout<<f<<"done with rendering of code\n";





	// for(std::vector< line_pair >::iterator itr=input_code.lines.begin();itr!=input_code.lines.end();++itr)
	// 	std::cout<<itr->first<<"\n";

	return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
movq 0x8(%rsi), %rbx
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
leaq 0x38b9(%rip), %rsi      # 0xb0cd
movq %rbx, %rdi
callq 0x2270
testq %rax, %rax
je 0x79ac
movq %rax, %r14
leaq -0x450(%rbp), %r15
leaq -0x48(%rbp), %r12
movl $0x1, %esi
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
movq %r14, %rcx
callq 0x22f0
testq %rax, %rax
je 0x7863
movq -0x40(%rbp), %rsi
movq %r12, %rdi
xorl %edx, %edx
movq %r15, %rcx
movq %rax, %r8
callq 0x2240
jmp 0x7833
movq %r14, %rdi
callq 0x21f0
movq %rbx, %rax
cmpb $0x2e, (%rax)
leaq 0x1(%rax), %rax
jne 0x786e
movb $0x0, -0x1(%rax)
leaq -0x440(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x450(%rbp), %rdi
callq 0x4d94
xorps %xmm0, %xmm0
leaq -0x450(%rbp), %rdi
movups %xmm0, 0x98(%rdi)
movups %xmm0, 0x88(%rdi)
movups %xmm0, 0x78(%rdi)
movups %xmm0, 0x68(%rdi)
movups %xmm0, 0x58(%rdi)
movups %xmm0, 0x48(%rdi)
movups %xmm0, 0x38(%rdi)
movq $0x0, 0xa8(%rdi)
movq %rbx, 0x30(%rdi)
callq 0x607c
leaq -0x450(%rbp), %rdi
callq 0x6c72
leaq -0x450(%rbp), %rdi
callq 0x9ba8
leaq -0x450(%rbp), %rdi
callq 0x7b60
movq %rbx, %rdi
callq 0x20d0
movq 0x76c8(%rip), %rdi      # 0xefd8
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2250
movq 0x76b6(%rip), %rdi      # 0xefd8
leaq 0x3984(%rip), %rsi      # 0xb2ad
movl $0x1c, %edx
callq 0x2250
leaq -0x3b8(%rbp), %rdi
callq 0x7a54
leaq -0x3d0(%rbp), %rbx
movq %rbx, %rdi
callq 0x7a88
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x795c
callq 0x21c0
leaq -0x418(%rbp), %rbx
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x7971
callq 0x21c0
movq %rbx, %rdi
callq 0x7abc
movq -0x450(%rbp), %rdi
cmpq %r14, %rdi
je 0x798a
callq 0x21c0
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x7998
callq 0x21c0
xorl %eax, %eax
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x7625(%rip), %rdi      # 0xefd8
leaq 0x38cc(%rip), %rsi      # 0xb286
callq 0x21e0
xorl %edi, %edi
callq 0x2280
jmp 0x79db
jmp 0x79db
movq %rax, %rbx
leaq -0x450(%rbp), %rdi
callq 0x79f4
jmp 0x79de
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x79ec
callq 0x21c0
movq %rbx, %rdi
callq 0x2370