// File: /workspace/github_cpp_makefile_star2_O1/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 0x8991(%rip), %rsi      # 0xf1f0
cmovneq %rax, %rsi
leaq -0x108(%rbp), %rbx
leaq -0x60(%rbp), %rdx
movq %rbx, %rdi
callq 0x8a4c
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 0x4c52(%rip), %r14      # 0xb515
movl $0xb, %ecx
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2260
movl $0xb, %ecx
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x22e0
incl %r15d
cmpq $-0x1, %rax
jne 0x68c3
movl %r15d, -0x34(%rbp)
testl %r15d, %r15d
je 0x698e
xorl %ebx, %ebx
leaq -0x108(%rbp), %r14
leaq -0x1c0(%rbp), %r13
movl -0x34(%rbp), %r15d
movl $0xb, %ecx
movq %r14, %rdi
leaq 0x4bf3(%rip), %rsi      # 0xb515
movq %rbx, %rdx
callq 0x2260
movq %rax, %r12
movl $0xc, %ecx
movq %r14, %rdi
leaq 0x4bd8(%rip), %rsi      # 0xb514
movq %rax, %rdx
callq 0x22e0
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 0x7b92
fstp %st(0)
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x6989
movq -0x1b0(%rbp), %rsi
incq %rsi
callq 0x21b0
decl %r15d
jne 0x6913
cmpl $0x4, -0x34(%rbp)
jb 0x7165
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 0x4b42(%rip), %rbx      # 0xb515
movq %rbx, %rsi
movq -0xe8(%rbp), %rdx
callq 0x2260
movq %rax, %r12
movl $0xb, %ecx
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rbx
movq %rax, %rdx
callq 0x22e0
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 0x6a40
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0xb, %ecx
movq %r15, %rdi
leaq 0x4ac6(%rip), %rbx      # 0xb515
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2260
movq %rax, %r12
movl $0xb, %ecx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x22e0
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 0x6ab8
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0xb, %ecx
movq %r15, %rdi
leaq 0x4a4e(%rip), %rbx      # 0xb515
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2260
movq %rax, %r12
movl $0xb, %ecx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x22e0
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 0x6b33
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0xb, %ecx
movq %r15, %rdi
leaq 0x49d3(%rip), %rbx      # 0xb515
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2260
movq %rax, %r12
movl $0xb, %ecx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x22e0
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 0x46aa(%rip), %rbx      # 0xb24e
je 0x6bb5
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0x4, %edx
movq -0x30(%rbp), %rdi
leaq 0x495c(%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 0x6c80
movq -0x30(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x2320
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21d0
cmpl $0x0, -0x38(%rbp)
je 0x6ca2
movq -0x30(%rbp), %rdi
movl -0x38(%rbp), %esi
callq 0x2320
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 0x4838(%rip), %rbx      # 0xb515
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2260
movq %rax, %r12
movl $0xb, %ecx
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rbx
movq %rax, %rdx
callq 0x22e0
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 0x6d49
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0xb, %ecx
movq %r15, %rdi
leaq 0x47bd(%rip), %rbx      # 0xb515
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2260
movq %rax, %r12
movl $0xb, %ecx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x22e0
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 0x6dc8
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0xb, %ecx
movq %r15, %rdi
leaq 0x473e(%rip), %r12      # 0xb515
movq %r12, %rsi
movq -0xe8(%rbp), %rdx
callq 0x2260
movq %rax, %rbx
movl $0xb, %ecx
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x22e0
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 0x6e44
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0xb, %ecx
movq %r15, %rdi
leaq 0x46c2(%rip), %r14      # 0xb515
movq %r14, %rsi
movq %r12, %rdx
callq 0x2260
movq %rax, %rbx
movl $0xb, %ecx
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x22e0
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 0x43a2(%rip), %r14      # 0xb24e
leaq -0x198(%rbp), %rbx
leaq -0x178(%rbp), %r15
je 0x6ecb
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0x4, %edx
movq -0x30(%rbp), %rdi
leaq 0x464b(%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 0x8afc
leaq -0x158(%rbp), %rdi
xorl %esi, %esi
callq 0x7b92
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 0x8afc
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7b92
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 0x8afc
fldz
fstp %st(0)
leaq -0x138(%rbp), %rdi
xorl %esi, %esi
callq 0x7b92
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 0x8afc
movq %r15, %rdi
xorl %esi, %esi
callq 0x7b92
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 0x707c
movq -0x168(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0x709e
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x198(%rbp), %rdi
leaq -0x188(%rbp), %rax
cmpq %rax, %rdi
je 0x70c0
movq -0x188(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x158(%rbp), %rdi
leaq -0x148(%rbp), %rax
cmpq %rax, %rdi
je 0x70e2
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x21b0
cmpl $0x0, -0x3c(%rbp)
movq -0x1a0(%rbp), %rbx
je 0x710b
movq -0x30(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x2320
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
cmpl $0x0, -0x38(%rbp)
je 0x712d
movq -0x30(%rbp), %rdi
movl -0x38(%rbp), %esi
callq 0x2320
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 0x69b6
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x7187
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
leaq -0x50(%rbp), %rbx
leaq -0x70(%rbp), %r14
je 0x71b1
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x80(%rbp), %rdi
cmpq %r14, %rdi
je 0x71c6
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x60(%rbp), %rdi
cmpq %rbx, %rdi
je 0x71db
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x21b0
leaq -0xf8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x71fa
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 0x7336
jmp 0x7336
jmp 0x7336
jmp 0x7336
jmp 0x7336
jmp 0x7336
jmp 0x7336
jmp 0x7336
jmp 0x7336
movq %rax, %rbx
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x7339
movq -0x1b0(%rbp), %rsi
incq %rsi
callq 0x21b0
jmp 0x7339
movq %rax, %rbx
leaq -0x50(%rbp), %r14
leaq -0x70(%rbp), %r15
leaq -0xb0(%rbp), %r12
leaq -0x90(%rbp), %r13
jmp 0x7312
movq %rax, %rbx
jmp 0x72b1
fstp %st(0)
movq %rax, %rbx
movq -0x178(%rbp), %rdi
leaq -0x168(%rbp), %rax
cmpq %rax, %rdi
je 0x72b1
movq -0x168(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0x72da
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x21b0
jmp 0x72da
fstp %st(0)
movq %rax, %rbx
leaq -0x50(%rbp), %r14
leaq -0x70(%rbp), %r15
leaq -0xb0(%rbp), %r12
leaq -0x90(%rbp), %r13
movq -0x198(%rbp), %rdi
leaq -0x188(%rbp), %rax
cmpq %rax, %rdi
je 0x7312
movq -0x188(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x158(%rbp), %rdi
leaq -0x148(%rbp), %rax
cmpq %rax, %rdi
je 0x734f
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x21b0
jmp 0x734f
movq %rax, %rbx
leaq -0x50(%rbp), %r14
leaq -0x70(%rbp), %r15
leaq -0xb0(%rbp), %r12
leaq -0x90(%rbp), %r13
movq -0xa0(%rbp), %rdi
cmpq %r13, %rdi
je 0x736a
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0xc0(%rbp), %rdi
cmpq %r12, %rdi
je 0x7385
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x80(%rbp), %rdi
cmpq %r15, %rdi
je 0x739a
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x60(%rbp), %rdi
cmpq %r14, %rdi
je 0x73af
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x21b0
leaq -0xf8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x73ce
movq -0xf8(%rbp), %rsi
incq %rsi
callq 0x21b0
movq %rbx, %rdi
callq 0x2340