// File: nikhilYadala[P]Python_to_cpp/Source/src/generate_cpp_code.cpp
// Function: source_code::generate_cpp_code()
void source_code::generate_cpp_code()
{

	generated_cpp_code.resize(functions.size());
	main_func(*this);
	std::string converted_code;
	std::vector< std::pair< std::string,function_declaration > >::iterator itr2=generated_cpp_code.begin()+1;
	for(std::vector< int_pair >::iterator itr1=functions.begin()+1;itr1!=functions.end();++itr1,++itr2)
	{
		converted_code.clear();
		function_declaration _function;
		std::map< std::string,std::string > variables;	//name,pair(value,type)
		convert_to_cpp(itr1->first,itr1->second,lines,converted_code,&_function,variables);
					
		if(_function.return_type=="")
				_function.return_type="void";		
		
				itr2->second=_function;	
		itr2->first=converted_code;	

	}

	// for(std::vector< std::pair< std::string,function_declaration > >::iterator itr=generated_cpp_code.begin();itr!=generated_cpp_code.end();++itr)
	// 	{
	// 		std::cout<<itr->first<<"\n";
	// 		std::cout<<"name-"<<itr->second.name<<"  return_type-"<<itr->second.return_type<<"args-\n";
			
	// 		for(std::vector< string_pair >::iterator itr1=itr->second.args.begin();itr1!=itr->second.args.end();++itr1)
	// 			std::cout<<itr1->first<<"   "<<itr1->second<<"\n";
				
	// 			std::cout<<"\n\n";						
	// 	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
movq %rdi, %rax
addq $0x80, %rax
movq %rax, -0xf8(%rbp)
addq $0x50, %rdi
callq 0xc2d0
movq -0xf8(%rbp), %rdi
movq %rax, %rsi
callq 0xd590
movq -0xf0(%rbp), %rdi
callq 0xcf10
leaq -0x28(%rbp), %rdi
callq 0x3360
movq -0xf0(%rbp), %rdi
addq $0x80, %rdi
callq 0xd620
movq %rax, -0x38(%rbp)
leaq -0x38(%rbp), %rdi
movl $0x1, %esi
callq 0xd650
movq -0xf0(%rbp), %rdi
movq %rax, -0x30(%rbp)
addq $0x50, %rdi
callq 0xbac0
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rdi
movl $0x1, %esi
callq 0xd690
movq %rax, -0x40(%rbp)
movq -0xf0(%rbp), %rdi
addq $0x50, %rdi
callq 0xba90
movq %rax, -0x50(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xd6d0
testb $0x1, %al
jne 0xd1e0
jmp 0xd345
leaq -0x28(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x3300
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0xd370
leaq -0xd8(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0xd490
leaq -0x40(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0xd710
movq -0x120(%rbp), %rdi
movslq (%rax), %rax
movq %rax, -0x118(%rbp)
callq 0xd710
movq -0xf0(%rbp), %rdx
movq -0x118(%rbp), %rdi
movq -0x110(%rbp), %rcx
movq -0x108(%rbp), %r8
movq -0x100(%rbp), %r9
movslq 0x4(%rax), %rsi
addq $0x38, %rdx
callq 0x4520
jmp 0xd26e
leaq -0x88(%rbp), %rdi
leaq 0x8f92(%rip), %rsi      # 0x1620e
callq 0x71d0
movb %al, -0x121(%rbp)
jmp 0xd289
movb -0x121(%rbp), %al
testb $0x1, %al
jne 0xd295
jmp 0xd2e1
leaq -0x88(%rbp), %rdi
leaq 0x8fbd(%rip), %rsi      # 0x16260
callq 0x3330
jmp 0xd2aa
jmp 0xd2e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0xd530
leaq -0xa8(%rbp), %rdi
callq 0xd550
leaq -0x28(%rbp), %rdi
callq 0x3170
jmp 0xd357
leaq -0x30(%rbp), %rdi
callq 0xd730
movq %rax, %rdi
addq $0x20, %rdi
leaq -0xa8(%rbp), %rsi
callq 0xd4d0
jmp 0xd2ff
leaq -0x30(%rbp), %rdi
callq 0xd730
movq %rax, %rdi
leaq -0x28(%rbp), %rsi
callq 0x3040
jmp 0xd316
leaq -0xd8(%rbp), %rdi
callq 0xd530
leaq -0xa8(%rbp), %rdi
callq 0xd550
leaq -0x40(%rbp), %rdi
callq 0xd750
leaq -0x30(%rbp), %rdi
callq 0xd770
jmp 0xd1b6
leaq -0x28(%rbp), %rdi
callq 0x3170
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq -0xe0(%rbp), %rdi
callq 0x33f0
nopw %cs:(%rax,%rax)
nopl (%rax)