// File: /workspace/github_cpp_makefile_star2_O3/gualtieromalde[P]owmread/owmread.C
// Function: readCoord(int)
Coord readCoord(int port)
{
    const std::string url_lat = "http://localhost:" + std::to_string(port) + "/json/position/latitude-deg";
    const std::string url_lon = "http://localhost:" + std::to_string(port) + "/json/position/longitude-deg";

    CURL* curlLat = curl_easy_init();

    curl_easy_setopt(curlLat, CURLOPT_URL, url_lat.c_str());
    curl_easy_setopt(curlLat, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
    curl_easy_setopt(curlLat, CURLOPT_TIMEOUT, 10);
    curl_easy_setopt(curlLat, CURLOPT_FOLLOWLOCATION, 1L);
    long httpCode(0);
    std::string httpDataLat;
    curl_easy_setopt(curlLat, CURLOPT_WRITEFUNCTION, WriteCallback);
    curl_easy_setopt(curlLat, CURLOPT_WRITEDATA, &httpDataLat);
    curl_easy_perform(curlLat);
    curl_easy_getinfo(curlLat, CURLINFO_RESPONSE_CODE, &httpCode);
    curl_easy_cleanup(curlLat);
    Json::Value jsonDataLat;
    Json::Reader jsonReaderLat;
    jsonReaderLat.parse(httpDataLat, jsonDataLat);   
    double lat = jsonDataLat["value"].asDouble();	     
    
     CURL* curlLon = curl_easy_init();

    curl_easy_setopt(curlLon, CURLOPT_URL, url_lon.c_str());
    curl_easy_setopt(curlLon, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
    curl_easy_setopt(curlLon, CURLOPT_TIMEOUT, 10);
    curl_easy_setopt(curlLon, CURLOPT_FOLLOWLOCATION, 1L);
    long httpCodeLon(0);
    std::string httpDataLon;
    curl_easy_setopt(curlLon, CURLOPT_WRITEFUNCTION, WriteCallback);
    curl_easy_setopt(curlLon, CURLOPT_WRITEDATA, &httpDataLon);
    curl_easy_perform(curlLon);
    curl_easy_getinfo(curlLon, CURLINFO_RESPONSE_CODE, &httpCodeLon);
    curl_easy_cleanup(curlLon);
    Json::Value jsonDataLon;
    Json::Reader jsonReaderLon;
    jsonReaderLon.parse(httpDataLon, jsonDataLon);   
    double lon = jsonDataLon["value"].asDouble();	     
    
    
    
    return Coord(lat,lon);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
movl %edi, %r14d
movl %edi, %ebx
negl %ebx
cmovsl %edi, %ebx
movl $0x1, %r15d
cmpl $0xa, %ebx
jb 0xac1a
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebx, %ecx
cmpl $0x63, %ecx
jbe 0xac11
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0xac17
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0xac1a
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0xabde
addl $-0x3, %r15d
jmp 0xac1a
addl $-0x2, %r15d
jmp 0xac1a
decl %r15d
shrl $0x1f, %r14d
leal (%r15,%r14), %esi
leaq 0x218(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x208(%rsp), %r12
movq %r12, %rdi
movl $0x2d, %edx
callq 0x83d0
movq (%r12), %rdi
addq %r14, %rdi
movl %r15d, %esi
movl %ebx, %edx
callq 0xc7d0
leaq 0x28964(%rip), %rcx     # 0x335bf
movl $0x11, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x8130
leaq 0x108(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xac9d
movq %rdx, 0xf8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x108(%rsp)
jmp 0xaca5
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq 0xf8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x28906(%rip), %rsi     # 0x335d1
callq 0x8450
leaq 0x18(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xacf7
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0xacfd
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xf8(%rsp), %rdi
cmpq %r13, %rdi
je 0xad27
callq 0x8350
movq 0x208(%rsp), %rdi
cmpq %rbp, %rdi
je 0xad39
callq 0x8350
movl $0x1, %r15d
cmpl $0xa, %ebx
jb 0xad8d
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebx, %ecx
cmpl $0x63, %ecx
jbe 0xad84
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0xad8a
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0xad8d
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0xad51
addl $-0x3, %r15d
jmp 0xad8d
addl $-0x2, %r15d
jmp 0xad8d
decl %r15d
leal (%r14,%r15), %esi
leaq 0x208(%rsp), %rdi
movq %rbp, (%rdi)
movl $0x2d, %edx
callq 0x83d0
leaq 0x208(%rsp), %r12
addq (%r12), %r14
movq %r14, %rdi
movl %r15d, %esi
movl %ebx, %edx
callq 0xc7d0
leaq 0x287f9(%rip), %rcx     # 0x335bf
movl $0x11, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x8130
movq %r13, 0xf8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xae04
movq %rdx, 0xf8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x108(%rsp)
jmp 0xae0c
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq 0xf8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x287bb(%rip), %rsi     # 0x335ed
callq 0x8450
leaq 0x58(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xae5e
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0xae65
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xf8(%rsp), %rdi
cmpq %r13, %rdi
je 0xae8f
callq 0x8350
movq 0x208(%rsp), %rdi
cmpq %rbp, %rdi
je 0xaea1
callq 0x8350
callq 0x8700
movq %rax, %rbx
movq 0x8(%rsp), %rdx
movq %rax, %rdi
movl $0x2712, %esi           # imm = 0x2712
xorl %eax, %eax
callq 0x85f0
movq %rbx, %rdi
movl $0x71, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x85f0
movq %rbx, %rdi
movl $0xd, %esi
movl $0xa, %edx
xorl %eax, %eax
callq 0x85f0
movl $0x1, %edx
movq %rbx, %rdi
movl $0x34, %esi
xorl %eax, %eax
callq 0x85f0
xorl %eax, %eax
movq %rax, 0x40(%rsp)
leaq 0x98(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rax, -0x8(%r15)
movb $0x0, (%r15)
leaq -0x17a1(%rip), %rdx     # 0x977a
movq %rbx, %rdi
movl $0x4e2b, %esi           # imm = 0x4E2B
xorl %eax, %eax
callq 0x85f0
leaq 0x88(%rsp), %rdx
movq %rbx, %rdi
movl $0x2711, %esi           # imm = 0x2711
xorl %eax, %eax
callq 0x85f0
movq %rbx, %rdi
callq 0x8490
leaq 0x40(%rsp), %rdx
movq %rbx, %rdi
movl $0x200002, %esi         # imm = 0x200002
xorl %eax, %eax
callq 0x86d0
movq %rbx, %rdi
callq 0x80f0
leaq 0xd0(%rsp), %rdi
xorl %esi, %esi
callq 0x260c0
leaq 0xf8(%rsp), %rdi
callq 0x1b250
leaq 0xf8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
movl $0x1, %ecx
callq 0x1ce40
leaq 0x28660(%rip), %rsi     # 0x3360a
leaq 0xd0(%rsp), %rdi
callq 0x29ce0
movq %rax, %rdi
callq 0x242d0
movsd %xmm0, 0x30(%rsp)
callq 0x8700
movq %rax, %rbx
movq 0x48(%rsp), %rdx
movq %rax, %rdi
movl $0x2712, %esi           # imm = 0x2712
xorl %eax, %eax
callq 0x85f0
movq %rbx, %rdi
movl $0x71, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x85f0
movq %rbx, %rdi
movl $0xd, %esi
movl $0xa, %edx
xorl %eax, %eax
callq 0x85f0
movl $0x1, %edx
movq %rbx, %rdi
movl $0x34, %esi
xorl %eax, %eax
callq 0x85f0
xorl %eax, %eax
movq %rax, 0x38(%rsp)
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
movq %rax, -0x8(%r12)
movb $0x0, (%r12)
leaq -0x18c5(%rip), %rdx     # 0x977a
movq %rbx, %rdi
movl $0x4e2b, %esi           # imm = 0x4E2B
xorl %eax, %eax
callq 0x85f0
leaq 0x68(%rsp), %rdx
movq %rbx, %rdi
movl $0x2711, %esi           # imm = 0x2711
xorl %eax, %eax
callq 0x85f0
movq %rbx, %rdi
callq 0x8490
leaq 0x38(%rsp), %rdx
movq %rbx, %rdi
movl $0x200002, %esi         # imm = 0x200002
xorl %eax, %eax
callq 0x86d0
movq %rbx, %rdi
callq 0x80f0
leaq 0xa8(%rsp), %rdi
xorl %esi, %esi
callq 0x260c0
leaq 0x208(%rsp), %rdi
callq 0x1b250
leaq 0x208(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
movl $0x1, %ecx
callq 0x1ce40
leaq 0x28542(%rip), %rsi     # 0x3360a
leaq 0xa8(%rsp), %rdi
callq 0x29ce0
movq %rax, %rdi
callq 0x242d0
movsd %xmm0, 0x28(%rsp)
leaq 0x300(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb0f9
callq 0x8350
leaq 0x2b8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb10f
callq 0x8350
leaq 0x258(%rsp), %rdi
callq 0xc604
leaq 0x208(%rsp), %rdi
callq 0xc786
leaq 0xa8(%rsp), %rdi
callq 0x275e0
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0xb145
callq 0x8350
leaq 0x1f0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb15b
callq 0x8350
leaq 0x1a8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb171
callq 0x8350
leaq 0x148(%rsp), %rdi
callq 0xc604
leaq 0xf8(%rsp), %rdi
callq 0xc786
leaq 0xd0(%rsp), %rdi
callq 0x275e0
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0xb1aa
callq 0x8350
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0xb1b9
callq 0x8350
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb1cd
callq 0x8350
movsd 0x30(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb277
movq %rax, %rbx
jmp 0xb287
jmp 0xb298
jmp 0xb2ac
movq %rax, %rbx
jmp 0xb2bc
jmp 0xb2cb
movq %rax, %rbx
movq 0xf8(%rsp), %rdi
cmpq %r13, %rdi
je 0xb229
callq 0x8350
jmp 0xb229
movq %rax, %rbx
movq 0x208(%rsp), %rdi
cmpq %rbp, %rdi
jne 0xb2ef
jmp 0xb2f4
movq %rax, %rbx
jmp 0xb2f4
movq %rax, %rbx
movq 0xf8(%rsp), %rdi
cmpq %r13, %rdi
je 0xb261
callq 0x8350
jmp 0xb261
movq %rax, %rbx
movq 0x208(%rsp), %rdi
cmpq %rbp, %rdi
jne 0xb303
jmp 0xb308
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
callq 0xbfe2
leaq 0xa8(%rsp), %rdi
callq 0x275e0
jmp 0xb29b
jmp 0xb2ac
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0xb2af
callq 0x8350
jmp 0xb2af
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0xbfe2
leaq 0xd0(%rsp), %rdi
callq 0x275e0
jmp 0xb2ce
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0xb2e5
callq 0x8350
jmp 0xb2e5
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0xb2f4
callq 0x8350
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb308
callq 0x8350
movq %rbx, %rdi
callq 0x8440