// File: 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
subq $0x550, %rsp            # imm = 0x550
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3360
movq -0x18(%rbp), %rdi
leaq 0x6ad4(%rip), %rsi      # 0x160dd
callq 0x32d0
movq %rax, -0x530(%rbp)
jmp 0xf617
movq -0x530(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0xf6fb
jmp 0xf62f
movq -0x40(%rbp), %rcx
leaq -0x450(%rbp), %rdi
movl $0x1, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x3390
movq %rax, -0x538(%rbp)
jmp 0xf652
movq -0x538(%rbp), %rax
movq %rax, -0x458(%rbp)
cmpq $0x0, -0x458(%rbp)
je 0xf6ee
leaq -0x38(%rbp), %rdi
movq %rdi, -0x548(%rbp)
callq 0x3140
movq %rax, -0x468(%rbp)
leaq -0x460(%rbp), %rdi
leaq -0x468(%rbp), %rsi
callq 0xf8c0
movq -0x548(%rbp), %rdi
movq -0x458(%rbp), %rax
leaq -0x450(%rbp,%rax), %rcx
movq -0x460(%rbp), %rsi
leaq -0x450(%rbp), %rdx
callq 0xf830
movq %rax, -0x540(%rbp)
jmp 0xf6ca
movq -0x540(%rbp), %rax
movq %rax, -0x470(%rbp)
jmp 0xf62f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xf81c
movq -0x40(%rbp), %rdi
callq 0x3230
jmp 0xf6f9
jmp 0xf717
movq 0xf8d6(%rip), %rdi      # 0x1efd8
leaq 0x6b5c(%rip), %rsi      # 0x16265
callq 0x3220
jmp 0xf710
xorl %edi, %edi
callq 0x32e0
movl $0x0, -0x474(%rbp)
movq -0x18(%rbp), %rax
movslq -0x474(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2e, %eax
jne 0xf746
movq -0x18(%rbp), %rax
movslq -0x474(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0xf759
jmp 0xf748
movl -0x474(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x474(%rbp)
jmp 0xf721
leaq -0x528(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xf900
jmp 0xf76b
movq -0x18(%rbp), %rax
movq %rax, -0x4f8(%rbp)
leaq -0x528(%rbp), %rdi
callq 0xaee0
jmp 0xf784
leaq -0x528(%rbp), %rdi
callq 0xd110
jmp 0xf792
leaq -0x528(%rbp), %rdi
callq 0x139a0
jmp 0xf7a0
leaq -0x528(%rbp), %rdi
callq 0x103f0
jmp 0xf7ae
movq -0x18(%rbp), %rsi
movq 0xf81f(%rip), %rdi      # 0x1efd8
callq 0x3220
movq %rax, -0x550(%rbp)
jmp 0xf7c7
movq -0x550(%rbp), %rdi
leaq 0x6ab7(%rip), %rsi      # 0x1628c
callq 0x3220
jmp 0xf7dc
movl $0x0, -0x4(%rbp)
leaq -0x528(%rbp), %rdi
callq 0xf970
leaq -0x38(%rbp), %rdi
callq 0x3170
movl -0x4(%rbp), %eax
addq $0x550, %rsp            # imm = 0x550
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x528(%rbp), %rdi
callq 0xf970
leaq -0x38(%rbp), %rdi
callq 0x3170
movq -0x48(%rbp), %rdi
callq 0x33f0
nop