// File: /workspace/github_cpp_makefile_star2_O2/allasandeep[P]LocationBoundaryFinder/prog1.cc
// Function: main
int main(int argc, char* argv[])
{
	//File Stream object
	ifstream is;
	PGconn *db; 
	db = conn();
	if(argc > 1)
	{
		for(int i = 1; i < argc; i++)
		{
			//Calling open_files function by passing input file stream objects as arguments.
			openFiles(is,argv[i]); 
			string str(argv[i]);
			string toFind = ".RTC";
			//Finding whether the file contains the bnd extension
			size_t found = str.find(toFind);
			//If the file contains bnd extension go to processBoundFiles or go to processNameFiles
			if(found != string::npos)
				processNameFiles(is,db);//Calling processBoundFiles function by passing input file stream objects as arguments.
			//Calling closeFiles function by passing input file stream objects as arguments.
			closeFiles(is);
		}

		for(int i = 1; i < argc; i++)
		{
			//Calling open_files function by passing input file stream objects as arguments.
			openFiles(is,argv[i]); 
			string str(argv[i]);
			string toFind = ".bnd";
			//Finding whether the file contains the bnd extension
			size_t found = str.find(toFind);
			//If the file contains bnd extension go to processBoundFiles or go to processNameFiles
			if(found != string::npos)
				processBoundFiles(is,db);//Calling processBoundFiles function by passing input file stream objects as arguments.
			//Calling closeFiles function by passing input file stream objects as arguments.
			closeFiles(is);
		}
	}
	else
	{
		cerr<<"**Note: Please input data files as commad line arguments to insert data into database!"<<endl;
		return 0;
	}

	cout<<"Data Successfully inserted into the database!"<<endl;
	PQfinish(db);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rsi, %r14
movl %edi, %r15d
leaq -0x288(%rbp), %rdi
callq 0x20a0
callq 0x23d5
movq %rax, -0x38(%rbp)
cmpl $0x2, %r15d
jl 0x2504
movl %r15d, %eax
movq %rax, -0x40(%rbp)
pushq $0x1
popq %rbx
leaq -0x288(%rbp), %r15
leaq -0x80(%rbp), %r12
leaq -0x60(%rbp), %r13
cmpq %rbx, -0x40(%rbp)
je 0x2524
movq (%r14,%rbx,8), %rsi
movq %r15, %rdi
callq 0x2629
movq (%r14,%rbx,8), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x2f72
movq %r13, %rdi
leaq 0x1bcb(%rip), %rsi      # 0x408a
leaq -0x29(%rbp), %rdx
callq 0x2f72
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2150
cmpq $-0x1, %rax
je 0x24e7
movq %r15, %rdi
movq -0x38(%rbp), %rsi
callq 0x2680
movq %r15, %rdi
callq 0x2140
movq %r13, %rdi
callq 0x21a0
movq %r12, %rdi
callq 0x21a0
incq %rbx
jmp 0x2490
movq 0x3ae5(%rip), %rdi      # 0x5ff0
leaq 0x1b82(%rip), %rsi      # 0x4094
callq 0x2100
movq %rax, %rdi
callq 0x2210
jmp 0x25ca
pushq $0x1
popq %rbx
leaq -0x288(%rbp), %r15
leaq -0x80(%rbp), %r12
leaq -0x60(%rbp), %r13
cmpq %rbx, -0x40(%rbp)
je 0x25a6
movq (%r14,%rbx,8), %rsi
movq %r15, %rdi
callq 0x2629
movq (%r14,%rbx,8), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x2f72
movq %r13, %rdi
leaq 0x1b2e(%rip), %rsi      # 0x408f
leaq -0x29(%rbp), %rdx
callq 0x2f72
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2150
cmpq $-0x1, %rax
je 0x2589
movq %r15, %rdi
movq -0x38(%rbp), %rsi
callq 0x2c42
movq %r15, %rdi
callq 0x2140
movq %r13, %rdi
callq 0x21a0
movq %r12, %rdi
callq 0x21a0
incq %rbx
jmp 0x2536
movq 0x3a23(%rip), %rdi      # 0x5fd0
leaq 0x1b37(%rip), %rsi      # 0x40eb
callq 0x2100
movq %rax, %rdi
callq 0x2210
movq -0x38(%rbp), %rdi
callq 0x21c0
leaq -0x288(%rbp), %rdi
callq 0x2030
xorl %eax, %eax
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x25f4
jmp 0x25f4
jmp 0x25f4
jmp 0x25f9
jmp 0x25f4
movq %rax, %rbx
jmp 0x2615
movq %rax, %rbx
jmp 0x260c
jmp 0x2600
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x21a0
leaq -0x80(%rbp), %rdi
callq 0x21a0
leaq -0x288(%rbp), %rdi
callq 0x2030
movq %rbx, %rdi
callq 0x2160