// File: 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
subq $0x2f0, %rsp            # imm = 0x2F0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x20e0
movl $0x0, -0x34(%rbp)
leaq -0x59(%rbp), %rdi
movq %rdi, -0x258(%rbp)
callq 0x22e0
movq -0x258(%rbp), %rdx
leaq 0x1b6a(%rip), %rsi      # 0x51fb
leaq -0x58(%rbp), %rdi
callq 0x3c00
jmp 0x369c
leaq -0x59(%rbp), %rdi
callq 0x23a0
leaq -0x91(%rbp), %rdi
movq %rdi, -0x260(%rbp)
callq 0x22e0
movq -0x260(%rbp), %rdx
leaq 0x1b35(%rip), %rsi      # 0x51fb
leaq -0x90(%rbp), %rdi
callq 0x3c00
jmp 0x36d4
leaq -0x91(%rbp), %rdi
callq 0x23a0
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x268(%rbp)
callq 0x22e0
movq -0x268(%rbp), %rdx
leaq 0x1afa(%rip), %rsi      # 0x51fb
leaq -0xb8(%rbp), %rdi
callq 0x3c00
jmp 0x370f
leaq -0xb9(%rbp), %rdi
callq 0x23a0
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0x22e0
movq -0x270(%rbp), %rdx
leaq 0x1abf(%rip), %rsi      # 0x51fb
leaq -0xe0(%rbp), %rdi
callq 0x3c00
jmp 0x374a
leaq -0xe1(%rbp), %rdi
callq 0x23a0
movq -0x8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x2150
movq %rax, -0x278(%rbp)
jmp 0x376c
movq -0x278(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2100
movb %al, -0x279(%rbp)
jmp 0x378a
movb -0x279(%rbp), %al
testb $0x1, %al
jne 0x3799
jmp 0x3b77
xorl %eax, %eax
movl %eax, %edx
leaq -0x108(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x7, %ecx
callq 0x22f0
jmp 0x37b4
xorl %eax, %eax
movl %eax, %esi
leaq -0x108(%rbp), %rdi
movl $0xa, %edx
callq 0x3cb0
movl %eax, -0x280(%rbp)
jmp 0x37d1
movl -0x280(%rbp), %eax
movl %eax, -0x34(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x2240
leaq -0x128(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x7, %edx
movl $0xa, %ecx
callq 0x22f0
jmp 0x3802
leaq -0x90(%rbp), %rdi
leaq -0x128(%rbp), %rsi
movq %rsi, -0x288(%rbp)
callq 0x2170
movq -0x288(%rbp), %rdi
callq 0x2240
leaq -0x148(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x11, %edx
movl $0x9, %ecx
callq 0x22f0
jmp 0x3844
leaq -0x58(%rbp), %rdi
leaq -0x148(%rbp), %rsi
movq %rsi, -0x290(%rbp)
callq 0x2170
movq -0x290(%rbp), %rdi
callq 0x2240
leaq -0x168(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x1a, %edx
movl $0xa, %ecx
callq 0x22f0
jmp 0x3883
leaq -0xe0(%rbp), %rdi
leaq -0x168(%rbp), %rsi
movq %rsi, -0x298(%rbp)
callq 0x2170
movq -0x298(%rbp), %rdi
callq 0x2240
leaq -0x188(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x24, %edx
movl $0x9, %ecx
callq 0x22f0
jmp 0x38c5
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x2d0(%rbp)
leaq -0x188(%rbp), %rsi
movq %rsi, -0x2f0(%rbp)
callq 0x2170
movq -0x2f0(%rbp), %rdi
callq 0x2240
leaq -0x90(%rbp), %rdi
movq %rdi, -0x2e8(%rbp)
callq 0x2180
movq -0x2e8(%rbp), %rdi
movq %rax, %rdx
movq %rdx, %rax
incq %rax
movq %rsp, %rcx
movq %rcx, -0x228(%rbp)
addq $0x10, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x2b8(%rbp)
movq %rcx, %rsp
movq %rax, -0x230(%rbp)
callq 0x2090
movq -0x2b8(%rbp), %rdi
movq %rax, %rsi
callq 0x2130
leaq -0x58(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x2180
movq -0x2e0(%rbp), %rdi
movq %rax, %rdx
movq %rdx, %rax
incq %rax
addq $0x10, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x2c8(%rbp)
movq %rcx, %rsp
movq %rax, -0x238(%rbp)
callq 0x2090
movq -0x2c8(%rbp), %rdi
movq %rax, %rsi
callq 0x2130
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x2d8(%rbp)
callq 0x2180
movq -0x2d8(%rbp), %rdi
movq %rax, %rdx
movq %rdx, %rax
incq %rax
addq $0x10, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x2b0(%rbp)
movq %rcx, %rsp
movq %rax, -0x240(%rbp)
callq 0x2090
movq -0x2b0(%rbp), %rdi
movq %rax, %rsi
callq 0x2130
movq -0x2d0(%rbp), %rdi
callq 0x2180
movq -0x2d0(%rbp), %rdi
movq %rax, %rdx
movq %rdx, %rax
incq %rax
addq $0x10, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x2c0(%rbp)
movq %rcx, %rsp
movq %rax, -0x248(%rbp)
callq 0x2090
movq -0x2c0(%rbp), %rdi
movq %rax, %rsi
callq 0x2130
movq -0x2c8(%rbp), %rdx
movq -0x2c0(%rbp), %rcx
movq -0x2b8(%rbp), %r8
movq -0x2b0(%rbp), %r9
movq $0x0, -0x250(%rbp)
movl -0x34(%rbp), %esi
subq $0x10, %rsp
movq %rsp, %rax
movl %esi, (%rax)
leaq 0x16f8(%rip), %rsi      # 0x517c
xorl %eax, %eax
leaq -0x220(%rbp), %rdi
movq %rdi, -0x2a8(%rbp)
callq 0x2330
movq -0x2a8(%rbp), %rsi
addq $0x10, %rsp
movq -0x10(%rbp), %rdi
callq 0x2370
movq %rax, -0x2a0(%rbp)
jmp 0x3ab6
movq -0x2a0(%rbp), %rax
movq %rax, -0x250(%rbp)
movq -0x250(%rbp), %rdi
callq 0x2160
jmp 0x3ad2
movq -0x228(%rbp), %rax
movq %rax, %rsp
jmp 0x3756
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x59(%rbp), %rdi
callq 0x23a0
jmp 0x3bdf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x23a0
jmp 0x3bd6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xb9(%rbp), %rdi
callq 0x23a0
jmp 0x3bca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xe1(%rbp), %rdi
callq 0x23a0
jmp 0x3bbe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x3bb2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x2240
jmp 0x3bb2
leaq -0xe0(%rbp), %rdi
callq 0x2240
leaq -0xb8(%rbp), %rdi
callq 0x2240
leaq -0x90(%rbp), %rdi
callq 0x2240
leaq -0x58(%rbp), %rdi
callq 0x2240
leaq -0x30(%rbp), %rdi
callq 0x2240
movq %rbp, %rsp
popq %rbp
retq
leaq -0xe0(%rbp), %rdi
callq 0x2240
leaq -0xb8(%rbp), %rdi
callq 0x2240
leaq -0x90(%rbp), %rdi
callq 0x2240
leaq -0x58(%rbp), %rdi
callq 0x2240
leaq -0x30(%rbp), %rdi
callq 0x2240
movq -0x68(%rbp), %rdi
callq 0x21f0
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)