// File: /workspace/github_cpp_makefile_star2_O3/openflightmaps[P]ofm2xplane/main.cpp
// Function: write_coordinates(rapidxml::xml_node<char>*, std::basic_ofstream<char, std::char_traits<char>>&, int, int)
void write_coordinates(xml_node<> *source, ofstream &out, int line, int light)
{
    // Extracting coordinates 
    string s(source->value());
    size_t l=0,r=-1, ll, rr;
    int c=0;
    string x,y,bx,by;
    
    while(true)
    {
        l=s.find_first_of("1234567890.",r+1);
        r=s.find_first_not_of("1234567890.",l)-1;
        c++;
        if(r==s.npos-1)
            break;
    }
    c--;

    long double *coor=new long double[c];
    l=0;
    r=-1;
    
    for(int i=0;i<c;i++)
    {
        l=s.find_first_of("1234567890.",r+1);
        r=s.find_first_not_of("11234567890.",l)-1;
        coor[i]=my_stold(s.substr(l,r-l+1));
    }
    delete [] coor;
    c=c/2;
        
    r=-1;
    l=0;
    for(int i=0;i<c-1;i=i+3)
    {
        l=s.find_first_of("1234567890.",r+1);
        r=s.find_first_not_of("1234567890.",l)-1;
        x=s.substr(l,r-l+1);
        l=s.find_first_of("1234567890.",r+1);
        r=s.find_first_not_of("1234567890.",l)-1;
        y=s.substr(l,r-l+1);     
        
        l=s.find_first_of("1234567890.",r+1);
        r=s.find_first_not_of("1234567890.",l)-1;
        bx=s.substr(l,r-l+1);
        l=s.find_first_of("1234567890.",r+1);
        r=s.find_first_not_of("1234567890.",l)-1;
        by=s.substr(l,r-l+1);    
        
        //out << "112 " << y << " " << x << " " << by << " " << bx << " ";
        out << "112 " << y << " " << x << " ";
        out << by << " " << bx << " ";
        //out << 2*my_stold(y)-my_stold(by) << " " << 2*my_stold(x)-my_stold(bx) << " ";
        if(line!=0)
            out << line << " ";
        if(light!=0)
            out << light << " ";
        out << endl;
        
        l=s.find_first_of("1234567890.",r+1);
        r=s.find_first_not_of("1234567890.",l)-1;
        bx=s.substr(l,r-l+1);
        l=s.find_first_of("1234567890.",r+1);
        r=s.find_first_not_of("1234567890.",l)-1;
        by=s.substr(l,r-l+1);
        
        ll=l;
        rr=r;     
        
        l=s.find_first_of("1234567890.",r+1);
        r=s.find_first_not_of("1234567890.",l)-1;
        x=s.substr(l,r-l+1);
        l=s.find_first_of("1234567890.",r+1);
        r=s.find_first_not_of("1234567890.",l)-1;
        y=s.substr(l,r-l+1);  
        
        out << "116 " << y << " " << x << " ";
        //out << by << " " << bx << " ";
        out << 2*my_stold(y)-my_stold(by) << " " << 2*my_stold(x)-my_stold(bx) << " ";
        
        if(line!=0)
            out << line << " "; // line
        if(light!=0)
            out << light << " "; // light
        out << endl;
        r=rr;
        l=ll;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movl %ecx, -0x38(%rbp)
movl %edx, -0x3c(%rbp)
movq %rsi, -0x30(%rbp)
movq 0x8(%rdi), %rax
testq %rax, %rax
leaq 0x8957(%rip), %rsi      # 0xf1e8
cmovneq %rax, %rsi
leaq -0x108(%rbp), %rbx
leaq -0x60(%rbp), %rdx
movq %rbx, %rdi
callq 0x8a02
leaq -0x50(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x70(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xb0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x90(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
leaq 0x4c20(%rip), %r14      # 0xb515
movl $0xb, %ecx
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2250
movl $0xb, %ecx
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x22d0
incl %r15d
cmpq $-0x1, %rax
jne 0x68f5
movl %r15d, -0x34(%rbp)
testl %r15d, %r15d
je 0x7197
xorl %ebx, %ebx
leaq -0x108(%rbp), %r14
leaq -0x1c0(%rbp), %r13
movl -0x34(%rbp), %r15d
movl $0xb, %ecx
movq %r14, %rdi
leaq 0x4bc1(%rip), %rsi      # 0xb515
movq %rbx, %rdx
callq 0x2250
movq %rax, %r12
movl $0xc, %ecx
movq %r14, %rdi
leaq 0x4ba6(%rip), %rsi      # 0xb514
movq %rax, %rdx
callq 0x22d0
movq %rax, %rbx
movq %rax, %rcx
subq %r12, %rcx
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x21c0
movq %r13, %rdi
xorl %esi, %esi
callq 0x7c10
fstp %st(0)
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x69bb
movq -0x1b0(%rbp), %rsi
incq %rsi
callq 0x21b0
decl %r15d
jne 0x6945
cmpl $0x4, -0x34(%rbp)
jb 0x7197
movl -0x34(%rbp), %eax
shrl %eax
decl %eax
movl %eax, -0x34(%rbp)
xorl %ebx, %ebx
leaq -0xe0(%rbp), %r13
movq $0x0, -0xe8(%rbp)
movq %rbx, -0x1a0(%rbp)
movl $0xb, %ecx
leaq -0x108(%rbp), %r15
movq %r15, %rdi
leaq 0x4b10(%rip), %rbx      # 0xb515
movq %rbx, %rsi
movq -0xe8(%rbp), %rdx
callq 0x2250
movq %rax, %r12
movl $0xb, %ecx
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rbx
movq %rax, %rdx
callq 0x22d0
movq %rax, %r14
movq %rax, %rcx
subq %r12, %rcx
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x21c0
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
callq 0x21f0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x6a72
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0xb, %ecx
movq %r15, %rdi
leaq 0x4a94(%rip), %rbx      # 0xb515
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2250
movq %rax, %r12
movl $0xb, %ecx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x22d0
movq %rax, %r14
movq %rax, %rcx
subq %r12, %rcx
movq %r13, %rbx
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x21c0
leaq -0x80(%rbp), %rdi
movq %rbx, %rsi
callq 0x21f0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x6aea
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0xb, %ecx
movq %r15, %rdi
leaq 0x4a1c(%rip), %rbx      # 0xb515
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2250
movq %rax, %r12
movl $0xb, %ecx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x22d0
movq %rax, %r14
movq %rax, %rcx
subq %r12, %rcx
movq %r13, %rbx
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x21c0
leaq -0xc0(%rbp), %rdi
movq %rbx, %rsi
callq 0x21f0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x6b65
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0xb, %ecx
movq %r15, %rdi
leaq 0x49a1(%rip), %rbx      # 0xb515
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2250
movq %rax, %r12
movl $0xb, %ecx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x22d0
movq %rax, %r14
movq %rax, %rcx
subq %r12, %rcx
movq %r13, %rbx
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x21c0
leaq -0xa0(%rbp), %rdi
movq %rbx, %rsi
callq 0x21f0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
leaq 0x4678(%rip), %rbx      # 0xb24e
je 0x6be7
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0x4, %edx
movq -0x30(%rbp), %rdi
leaq 0x492a(%rip), %rsi      # 0xb521
callq 0x21d0
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x21d0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21d0
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq %r12, %rdi
callq 0x21d0
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21d0
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x21d0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21d0
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
movq %r12, %rdi
callq 0x21d0
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21d0
cmpl $0x0, -0x3c(%rbp)
je 0x6cb2
movq -0x30(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x2310
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21d0
cmpl $0x0, -0x38(%rbp)
je 0x6cd4
movq -0x30(%rbp), %rdi
movl -0x38(%rbp), %esi
callq 0x2310
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21d0
movq -0x30(%rbp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq -0x30(%rbp), %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movl $0xb, %ecx
movq %r15, %rdi
leaq 0x4806(%rip), %rbx      # 0xb515
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2250
movq %rax, %r12
movl $0xb, %ecx
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rbx
movq %rax, %rdx
callq 0x22d0
movq %rax, %r14
movq %rax, %rcx
subq %r12, %rcx
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x21c0
leaq -0xc0(%rbp), %rdi
movq %rbx, %rsi
callq 0x21f0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x6d7b
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0xb, %ecx
movq %r15, %rdi
leaq 0x478b(%rip), %rbx      # 0xb515
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2250
movq %rax, %r12
movl $0xb, %ecx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x22d0
movq %rax, %rcx
movq %rax, -0xe8(%rbp)
subq %r12, %rcx
movq %r13, %rbx
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x21c0
leaq -0xa0(%rbp), %rdi
movq %rbx, %rsi
callq 0x21f0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x6dfa
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0xb, %ecx
movq %r15, %rdi
leaq 0x470c(%rip), %r12      # 0xb515
movq %r12, %rsi
movq -0xe8(%rbp), %rdx
callq 0x2250
movq %rax, %rbx
movl $0xb, %ecx
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x22d0
movq %rax, %r12
movq %rax, %rcx
subq %rbx, %rcx
movq %r13, %r14
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x21c0
leaq -0x60(%rbp), %rdi
movq %r14, %rsi
callq 0x21f0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x6e76
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0xb, %ecx
movq %r15, %rdi
leaq 0x4690(%rip), %r14      # 0xb515
movq %r14, %rsi
movq %r12, %rdx
callq 0x2250
movq %rax, %rbx
movl $0xb, %ecx
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x22d0
subq %rbx, %rax
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x21c0
leaq -0x80(%rbp), %rdi
movq %r13, %rsi
callq 0x21f0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
leaq 0x4370(%rip), %r14      # 0xb24e
leaq -0x198(%rbp), %rbx
leaq -0x178(%rbp), %r15
je 0x6efd
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0x4, %edx
movq -0x30(%rbp), %rdi
leaq 0x4619(%rip), %rsi      # 0xb526
callq 0x21d0
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x21d0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq %r12, %rdi
callq 0x21d0
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
leaq -0x148(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0x158(%rbp), %rdi
callq 0x8ab0
leaq -0x158(%rbp), %rdi
xorl %esi, %esi
callq 0x7c10
fstpt -0x114(%rbp)
leaq -0x188(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x8ab0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7c10
fldt -0x114(%rbp)
fadd %st, %st(0)
fsubp %st, %st(1)
fstpt (%rsp)
movq -0x30(%rbp), %rdi
callq 0x2100
fldz
movq %rax, %r12
fstp %st(0)
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
fldz
fstp %st(0)
leaq -0x128(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
leaq -0x138(%rbp), %rdi
callq 0x8ab0
fldz
fstp %st(0)
leaq -0x138(%rbp), %rdi
xorl %esi, %esi
callq 0x7c10
fstpt -0x114(%rbp)
leaq -0x168(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x8ab0
movq %r15, %rdi
xorl %esi, %esi
callq 0x7c10
fldt -0x114(%rbp)
fadd %st, %st(0)
fsubp %st, %st(1)
fstpt (%rsp)
movq %r12, %rdi
callq 0x2100
fldz
fstp %st(0)
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
fldz
fstp %st(0)
movq -0x178(%rbp), %rdi
leaq -0x168(%rbp), %rax
cmpq %rax, %rdi
je 0x70ae
movq -0x168(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0x70d0
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x198(%rbp), %rdi
leaq -0x188(%rbp), %rax
cmpq %rax, %rdi
je 0x70f2
movq -0x188(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x158(%rbp), %rdi
leaq -0x148(%rbp), %rax
cmpq %rax, %rdi
je 0x7114
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x21b0
cmpl $0x0, -0x3c(%rbp)
movq -0x1a0(%rbp), %rbx
je 0x713d
movq -0x30(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x2310
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
cmpl $0x0, -0x38(%rbp)
je 0x715f
movq -0x30(%rbp), %rdi
movl -0x38(%rbp), %esi
callq 0x2310
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
movq -0x30(%rbp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq -0x30(%rbp), %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
addl $0x3, %ebx
cmpl -0x34(%rbp), %ebx
jl 0x69e8
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x71b9
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
leaq -0x70(%rbp), %rbx
je 0x71df
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x80(%rbp), %rdi
cmpq %rbx, %rdi
leaq -0x50(%rbp), %rbx
je 0x71f8
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x60(%rbp), %rdi
cmpq %rbx, %rdi
je 0x720d
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x21b0
leaq -0xf8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x722c
movq -0xf8(%rbp), %rsi
incq %rsi
callq 0x21b0
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x734d
jmp 0x734d
jmp 0x734d
jmp 0x734d
jmp 0x734d
jmp 0x734d
jmp 0x734d
jmp 0x734d
movq %rax, %rbx
jmp 0x7313
movq %rax, %rbx
jmp 0x72c8
movq %rax, %rbx
jmp 0x7335
movq %rax, %rbx
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x7335
movq -0x1b0(%rbp), %rsi
jmp 0x732d
fstp %st(0)
movq %rax, %rbx
movq -0x178(%rbp), %rdi
leaq -0x168(%rbp), %rax
cmpq %rax, %rdi
je 0x72c8
movq -0x168(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0x72f1
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x21b0
jmp 0x72f1
fstp %st(0)
movq %rax, %rbx
movq -0x198(%rbp), %rdi
leaq -0x188(%rbp), %rax
cmpq %rax, %rdi
je 0x7313
movq -0x188(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x158(%rbp), %rdi
leaq -0x148(%rbp), %rax
cmpq %rax, %rdi
je 0x7335
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x21b0
leaq -0x50(%rbp), %r15
leaq -0x70(%rbp), %r14
leaq -0xb0(%rbp), %r12
leaq -0x90(%rbp), %rax
jmp 0x7366
movq %rax, %rbx
leaq -0x70(%rbp), %r14
leaq -0xb0(%rbp), %r12
leaq -0x90(%rbp), %rax
leaq -0x50(%rbp), %r15
movq -0xa0(%rbp), %rdi
cmpq %rax, %rdi
je 0x7381
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0xc0(%rbp), %rdi
cmpq %r12, %rdi
je 0x739c
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x80(%rbp), %rdi
cmpq %r14, %rdi
je 0x73b1
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x73c6
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x21b0
leaq -0xf8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x73e5
movq -0xf8(%rbp), %rsi
incq %rsi
callq 0x21b0
movq %rbx, %rdi
callq 0x2330