// File: /workspace/github_cpp_makefile_star2_O1/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 $0x258, %rsp            # imm = 0x258
movq %rsi, %r14
movl %edi, %r15d
leaq -0x278(%rbp), %rdi
callq 0x20c0
callq 0x2415
movq %rax, -0x50(%rbp)
cmpl $0x2, %r15d
jl 0x269f
movl %r15d, %ebx
movl $0x1, %r12d
leaq -0x278(%rbp), %r15
leaq -0x48(%rbp), %r13
movq (%r14,%r12,8), %rsi
movq %r15, %rdi
callq 0x2764
movq (%r14,%r12,8), %rsi
leaq -0x70(%rbp), %rdi
movq %r13, %rdx
callq 0x392e
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq %r13, %rdi
leaq 0x1b69(%rip), %rsi      # 0x408a
leaq 0x1b66(%rip), %rdx      # 0x408e
callq 0x39de
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rcx
leaq -0x70(%rbp), %rdi
xorl %edx, %edx
callq 0x20d0
cmpq $-0x1, %rax
je 0x2552
movq %r15, %rdi
movq -0x50(%rbp), %rsi
callq 0x27bf
movq %r15, %rdi
callq 0x2190
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2573
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2070
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x258c
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2070
incq %r12
cmpq %r12, %rbx
jne 0x24f3
movl $0x1, %r12d
leaq -0x278(%rbp), %r15
leaq -0x48(%rbp), %r13
movq (%r14,%r12,8), %rsi
movq %r15, %rdi
callq 0x2764
movq (%r14,%r12,8), %rsi
leaq -0x70(%rbp), %rdi
movq %r13, %rdx
callq 0x392e
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq %r13, %rdi
leaq 0x1ab8(%rip), %rsi      # 0x408f
leaq 0x1ab5(%rip), %rdx      # 0x4093
callq 0x39de
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rcx
leaq -0x70(%rbp), %rdi
xorl %edx, %edx
callq 0x20d0
cmpq $-0x1, %rax
je 0x2608
movq %r15, %rdi
movq -0x50(%rbp), %rsi
callq 0x340b
movq %r15, %rdi
callq 0x2190
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2629
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2070
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x2642
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2070
incq %r12
cmpq %r12, %rbx
jne 0x25a9
movq 0x3983(%rip), %r14      # 0x5fd8
leaq 0x1a8f(%rip), %rsi      # 0x40eb
movl $0x2d, %edx
movq %r14, %rdi
callq 0x2230
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2290
movsbl %al, %esi
movq 0x3951(%rip), %rdi      # 0x5fd8
callq 0x2140
movq %rax, %rdi
callq 0x2100
movq -0x50(%rbp), %rdi
callq 0x21f0
jmp 0x26e5
movq 0x394a(%rip), %rbx      # 0x5ff0
leaq 0x19e7(%rip), %rsi      # 0x4094
movl $0x56, %edx
movq %rbx, %rdi
callq 0x2230
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2290
movsbl %al, %esi
movq 0x3918(%rip), %rdi      # 0x5ff0
callq 0x2140
movq %rax, %rdi
callq 0x2100
leaq -0x278(%rbp), %rdi
callq 0x2040
xorl %eax, %eax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x270f
jmp 0x270f
jmp 0x270f
jmp 0x2714
jmp 0x270f
movq %rax, %r14
jmp 0x2750
movq %rax, %r14
jmp 0x2737
jmp 0x271b
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2737
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2070
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x2750
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2070
leaq -0x278(%rbp), %rdi
callq 0x2040
movq %r14, %rdi
callq 0x21a0