// File: /workspace/github_cpp_makefile_star2_O1/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), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x382f(%rip), %rsi      # 0xb0cd
movq %rbx, %rdi
callq 0x2270
testq %rax, %rax
je 0x7a65
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 0x78f3
movq %rax, %r13
movq -0x40(%rbp), %rsi
movq %r12, %rdi
xorl %edx, %edx
movq %r15, %rcx
movq %rax, %r8
callq 0x2240
testq %r13, %r13
jne 0x78bd
movq %r14, %rdi
callq 0x21f0
movq %rbx, %rax
cmpb $0x2e, (%rax)
leaq 0x1(%rax), %rax
jne 0x78fe
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 0x4df8
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 0x60fc
leaq -0x450(%rbp), %rdi
callq 0x6cda
leaq -0x450(%rbp), %rdi
callq 0x9c78
leaq -0x450(%rbp), %rdi
callq 0x7c14
testq %rbx, %rbx
je 0x79b2
movq %rbx, %rdi
callq 0x20d0
movq 0x7633(%rip), %rdi      # 0xefd8
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2250
jmp 0x79d0
movq 0x761f(%rip), %rax      # 0xefd8
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %rdi
movl 0x20(%rax,%rcx), %esi
orl $0x1, %esi
callq 0x2350
movq 0x7601(%rip), %rdi      # 0xefd8
leaq 0x38cf(%rip), %rsi      # 0xb2ad
movl $0x1c, %edx
callq 0x2250
leaq -0x3b8(%rbp), %rdi
callq 0x7b12
leaq -0x3d0(%rbp), %rbx
movq %rbx, %rdi
callq 0x7b46
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x7a11
callq 0x21c0
leaq -0x418(%rbp), %rbx
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x7a26
callq 0x21c0
movq %rbx, %rdi
callq 0x7b7a
movq -0x450(%rbp), %rdi
cmpq %r14, %rdi
je 0x7a3f
callq 0x21c0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x7a51
callq 0x21c0
xorl %eax, %eax
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x756c(%rip), %rdi      # 0xefd8
leaq 0x3813(%rip), %rsi      # 0xb286
callq 0x21e0
xorl %edi, %edi
callq 0x2280
jmp 0x7a94
jmp 0x7a94
movq %rax, %rbx
leaq -0x450(%rbp), %rdi
callq 0x7ab2
jmp 0x7a97
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x7aa9
callq 0x21c0
movq %rbx, %rdi
callq 0x2380
nop