// File: /workspace/github_cpp_makefile_star2_O3/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 0x269d
movl %r15d, %r12d
movl $0x1, %ebx
leaq -0x278(%rbp), %r15
leaq -0x48(%rbp), %r13
movq (%r14,%rbx,8), %rsi
movq %r15, %rdi
callq 0x2762
movq (%r14,%rbx,8), %rsi
leaq -0x70(%rbp), %rdi
movq %r13, %rdx
callq 0x391a
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq %r13, %rdi
leaq 0x1b6a(%rip), %rsi      # 0x408a
leaq 0x1b67(%rip), %rdx      # 0x408e
callq 0x39ca
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rcx
leaq -0x70(%rbp), %rdi
xorl %edx, %edx
callq 0x20d0
cmpq $-0x1, %rax
je 0x2551
movq %r15, %rdi
movq -0x50(%rbp), %rsi
callq 0x27bd
movq %r15, %rdi
callq 0x2190
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2572
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2070
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x258b
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2070
incq %rbx
cmpq %rbx, %r12
jne 0x24f2
movl $0x1, %ebx
leaq -0x278(%rbp), %r15
leaq -0x48(%rbp), %r13
movq (%r14,%rbx,8), %rsi
movq %r15, %rdi
callq 0x2762
movq (%r14,%rbx,8), %rsi
leaq -0x70(%rbp), %rdi
movq %r13, %rdx
callq 0x391a
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq %r13, %rdi
leaq 0x1aba(%rip), %rsi      # 0x408f
leaq 0x1ab7(%rip), %rdx      # 0x4093
callq 0x39ca
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rcx
leaq -0x70(%rbp), %rdi
xorl %edx, %edx
callq 0x20d0
cmpq $-0x1, %rax
je 0x2606
movq %r15, %rdi
movq -0x50(%rbp), %rsi
callq 0x33f6
movq %r15, %rdi
callq 0x2190
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2627
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2070
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x2640
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2070
incq %rbx
cmpq %rbx, %r12
jne 0x25a7
movq 0x3985(%rip), %r14      # 0x5fd8
leaq 0x1a91(%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 0x3953(%rip), %rdi      # 0x5fd8
callq 0x2140
movq %rax, %rdi
callq 0x2100
movq -0x50(%rbp), %rdi
callq 0x21f0
jmp 0x26e3
movq 0x394c(%rip), %rbx      # 0x5ff0
leaq 0x19e9(%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 0x391a(%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 0x270d
jmp 0x270d
jmp 0x270d
jmp 0x2712
jmp 0x270d
movq %rax, %r14
jmp 0x274e
movq %rax, %r14
jmp 0x2735
jmp 0x2719
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2735
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2070
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x274e
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2070
leaq -0x278(%rbp), %rdi
callq 0x2040
movq %r14, %rdi
callq 0x21a0