// File: /workspace/github_cpp_makefile_star2_O2/allasandeep[P]LocationBoundaryFinder/prog1.cc
// Function: processBoundFiles(std::basic_ifstream<char, std::char_traits<char>>&, pg_conn*)
void processBoundFiles(ifstream& is, PGconn *db)
{
	//Required Variables
	string line;	
	int id = 0;
	string minLatitude = "";
	string minLongitude = "";
	string maxLatitude = "";
	string maxLongitude = "";

	//Reading data from file line by line 
	while(std::getline(is,line))
	{
		//Getting the substrings and putting them into the respective variables
		id = stoi(line.substr(0,7));
		minLongitude = line.substr(7,10);
		minLatitude = line.substr(17,9);
		maxLongitude = line.substr(26,10);
		maxLatitude = line.substr(36,9);	        
		char query[150];
		//Converting all the string variables into char *
		char min_longitude[minLongitude.length()+1];
		strcpy(min_longitude, minLongitude.c_str());
		char min_latitude[minLatitude.length()+1];
		strcpy(min_latitude, minLatitude.c_str());
		char max_longitude[maxLongitude.length()+1];
		strcpy(max_longitude, maxLongitude.c_str());
		char max_latitude[maxLatitude.length()+1];
		strcpy(max_latitude, maxLatitude.c_str());
		PGresult * result = nullptr;
		//Psql Query by concatinating with c++ variables
		sprintf(query,"update region set min_latitude = '%s' ,max_latitude = '%s' ,min_longitude = '%s' ,max_longitude = '%s' where id = %d;", min_latitude, max_latitude, min_longitude, max_longitude, id);
		//Executing the query and storing the result in result.
		result = PQexec(db,query);
		//Clearing the result
		PQclear(result);   
	}	

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rsi, -0x30(%rbp)
movq %rdi, -0x38(%rbp)
leaq -0xd8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x153f(%rip), %rsi      # 0x41b7
leaq -0xc8(%rbp), %rdi
leaq -0x180(%rbp), %rdx
callq 0x2f72
leaq 0x1525(%rip), %rsi      # 0x41b7
leaq -0xa8(%rbp), %rdi
leaq -0x180(%rbp), %rdx
callq 0x2f72
leaq 0x150b(%rip), %rsi      # 0x41b7
leaq -0x88(%rbp), %rdi
leaq -0x180(%rbp), %rdx
callq 0x2f72
leaq 0x14f1(%rip), %rsi      # 0x41b7
leaq -0x68(%rbp), %rdi
leaq -0x180(%rbp), %rdx
callq 0x2f72
leaq -0xe8(%rbp), %rbx
leaq -0x180(%rbp), %r12
pushq $0x7
popq %r14
pushq $0xa
popq %r15
pushq $0x9
popq %r13
movq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x20d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2eb5
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %r14, %rcx
callq 0x2200
movq %r12, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x2fad
movq %rax, -0x48(%rbp)
movq %r12, %rdi
callq 0x21a0
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x2200
leaq -0xa8(%rbp), %rdi
movq %r12, %rsi
callq 0x20f0
movq %r12, %rdi
callq 0x21a0
movq %r12, %rdi
movq %rbx, %rsi
pushq $0x11
popq %rdx
movq %r13, %rcx
callq 0x2200
leaq -0xc8(%rbp), %rdi
movq %r12, %rsi
callq 0x20f0
movq %r12, %rdi
callq 0x21a0
movq %r12, %rdi
movq %rbx, %rsi
pushq $0x1a
popq %rdx
movq %r15, %rcx
callq 0x2200
leaq -0x68(%rbp), %rdi
movq %r12, %rsi
callq 0x20f0
movq %r12, %rdi
callq 0x21a0
movq %r12, %rdi
movq %rbx, %rsi
pushq $0x24
popq %rdx
movq %r13, %rcx
callq 0x2200
leaq -0x88(%rbp), %rdi
movq %r12, %rsi
callq 0x20f0
movq %r12, %rdi
callq 0x21a0
movq %rsp, -0x40(%rbp)
movq -0xa0(%rbp), %rax
movq %rsp, %rbx
addq $0x10, %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
movq -0xa8(%rbp), %rsi
movq %rbx, %rdi
callq 0x20c0
movq -0xc0(%rbp), %rax
movq %rsp, %r14
addq $0x10, %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
movq -0xc8(%rbp), %rsi
movq %r14, %rdi
callq 0x20c0
movq -0x60(%rbp), %rax
movq %rsp, %r15
addq $0x10, %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
movq -0x68(%rbp), %rsi
movq %r15, %rdi
callq 0x20c0
movq -0x80(%rbp), %rax
movq %rsp, %r13
addq $0x10, %rax
andq $-0x10, %rax
subq %rax, %r13
movq %r13, %rsp
movq -0x88(%rbp), %rsi
movq %r13, %rdi
callq 0x20c0
subq $0x8, %rsp
movq %r12, %rdi
leaq 0x12bf(%rip), %rsi      # 0x4138
movq %r14, %rdx
movq %r13, %rcx
movq %rbx, %r8
movq %r15, %r9
xorl %eax, %eax
pushq -0x48(%rbp)
callq 0x2240
popq %rcx
popq %rdx
movq -0x30(%rbp), %rdi
movq %r12, %rsi
callq 0x2250
movq %rax, %rdi
callq 0x20e0
movq -0x40(%rbp), %rsp
leaq -0xe8(%rbp), %rbx
jmp 0x2ce4
leaq -0x68(%rbp), %rdi
callq 0x21a0
leaq -0x88(%rbp), %rdi
callq 0x21a0
leaq -0xa8(%rbp), %rdi
callq 0x21a0
leaq -0xc8(%rbp), %rdi
callq 0x21a0
leaq -0xe8(%rbp), %rdi
callq 0x21a0
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2f3a
movq %rax, %rbx
jmp 0x2f46
movq %rax, %rbx
jmp 0x2f52
movq %rax, %rbx
jmp 0x2f5e
movq %rax, %rbx
leaq -0x180(%rbp), %rdi
callq 0x21a0
jmp 0x2f31
jmp 0x2f2e
jmp 0x2f2e
jmp 0x2f2e
jmp 0x2f2e
jmp 0x2f2e
jmp 0x2f2e
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x21a0
leaq -0x88(%rbp), %rdi
callq 0x21a0
leaq -0xa8(%rbp), %rdi
callq 0x21a0
leaq -0xc8(%rbp), %rdi
callq 0x21a0
leaq -0xe8(%rbp), %rdi
callq 0x21a0
movq %rbx, %rdi
callq 0x2160