// File: /workspace/github_cpp_makefile_star2_O3/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, -0xd8(%rbp)
movq %rdi, %r12
leaq -0xb8(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x98(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xd7b(%rip), %rdx       # 0x41b7
leaq -0xa8(%rbp), %rdi
movq %rdx, %rsi
callq 0x39ca
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xd5d(%rip), %rdx       # 0x41b7
leaq -0x88(%rbp), %rdi
movq %rdx, %rsi
callq 0x39ca
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xd3f(%rip), %rdx       # 0x41b7
leaq -0x68(%rbp), %rdi
movq %rdx, %rsi
callq 0x39ca
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xd24(%rip), %rdx       # 0x41b7
leaq -0x48(%rbp), %rdi
movq %rdx, %rsi
callq 0x39ca
leaq -0x170(%rbp), %r13
leaq -0xc8(%rbp), %rbx
leaq -0x180(%rbp), %r14
movq %r12, -0xd0(%rbp)
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2290
movsbl %al, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2030
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3775
movl $0x7, %ecx
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2240
movq -0x180(%rbp), %r14
callq 0x2270
movq %rax, %rbx
movl (%rax), %r15d
movl $0x0, (%rax)
movq %r14, %rdi
leaq -0xe8(%rbp), %rsi
movl $0xa, %edx
callq 0x2200
cmpq %r14, -0xe8(%rbp)
je 0x3816
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x3822
movl (%rbx), %ecx
cmpl $0x22, %ecx
je 0x3822
movq %rax, -0xe0(%rbp)
testl %ecx, %ecx
leaq -0x180(%rbp), %r14
jne 0x3567
movl %r15d, (%rbx)
movq -0x180(%rbp), %rdi
cmpq %r13, %rdi
je 0x3582
movq -0x170(%rbp), %rsi
incq %rsi
callq 0x2070
movl $0x7, %edx
movl $0xa, %ecx
movq %r14, %rdi
leaq -0xc8(%rbp), %rbx
movq %rbx, %rsi
callq 0x2240
leaq -0x88(%rbp), %rdi
movq %r14, %rsi
callq 0x2130
movq -0x180(%rbp), %rdi
cmpq %r13, %rdi
je 0x35c8
movq -0x170(%rbp), %rsi
incq %rsi
callq 0x2070
movl $0x11, %edx
movl $0x9, %ecx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2240
leaq -0xa8(%rbp), %rdi
movq %r14, %rsi
callq 0x2130
movq -0x180(%rbp), %rdi
cmpq %r13, %rdi
je 0x3607
movq -0x170(%rbp), %rsi
incq %rsi
callq 0x2070
movl $0x1a, %edx
movl $0xa, %ecx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2240
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0x2130
movq -0x180(%rbp), %rdi
cmpq %r13, %rdi
je 0x3643
movq -0x170(%rbp), %rsi
incq %rsi
callq 0x2070
movl $0x24, %edx
movl $0x9, %ecx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2240
leaq -0x68(%rbp), %rdi
movq %r14, %rsi
callq 0x2130
movq -0x180(%rbp), %rdi
cmpq %r13, %rdi
je 0x367f
movq -0x170(%rbp), %rsi
incq %rsi
callq 0x2070
movq %rsp, %r13
movq -0x80(%rbp), %rax
movq %rsp, %rbx
addq $0x10, %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
movq -0x88(%rbp), %rsi
movq %rbx, %rdi
callq 0x20f0
movq -0xa0(%rbp), %rax
movq %rsp, %r14
addq $0x10, %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
movq -0xa8(%rbp), %rsi
movq %r14, %rdi
callq 0x20f0
movq -0x40(%rbp), %rax
movq %rsp, %r15
addq $0x10, %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
movq -0x48(%rbp), %rsi
movq %r15, %rdi
callq 0x20f0
movq -0x60(%rbp), %rax
movq %rsp, %r12
addq $0x10, %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
movq -0x68(%rbp), %rsi
movq %r12, %rdi
callq 0x20f0
subq $0x8, %rsp
leaq -0x180(%rbp), %rdi
leaq 0xa17(%rip), %rsi       # 0x4138
movq %r14, %rdx
movq %rdi, %r14
movq %r12, %rcx
movq %rbx, %r8
movq %r15, %r9
xorl %eax, %eax
pushq -0xe0(%rbp)
callq 0x2280
addq $0x10, %rsp
movq -0xd8(%rbp), %rdi
movq %r14, %rsi
callq 0x22a0
movq %rax, %rdi
callq 0x2120
movq %r13, %rsp
movq -0xd0(%rbp), %r12
leaq -0x170(%rbp), %r13
leaq -0xc8(%rbp), %rbx
jmp 0x34bb
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x378e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2070
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x37a7
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2070
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x37c3
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2070
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x37e5
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2070
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x3807
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x2070
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa08(%rip), %rdi       # 0x4225
callq 0x2080
leaq 0x9fc(%rip), %rdi       # 0x4225
callq 0x2180
movq %rax, %r14
jmp 0x3898
movq %rax, %r14
jmp 0x38b1
movq %rax, %r14
jmp 0x38cd
movq %rax, %r14
jmp 0x38ef
jmp 0x387c
jmp 0x387c
jmp 0x387c
jmp 0x387c
jmp 0x387c
jmp 0x387c
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x385f
movl %r15d, (%rbx)
movq -0x180(%rbp), %rdi
cmpq %r13, %rdi
je 0x387f
movq -0x170(%rbp), %rsi
incq %rsi
callq 0x2070
jmp 0x387f
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x3898
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2070
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x38b1
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2070
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x38cd
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2070
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x38ef
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2070
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x3911
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x2070
movq %r14, %rdi
callq 0x21a0
nop