// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: open_it(char*, char*)
FILE *open_it(char *line, char *fn)
{
FILE *file;

    if(line == 0) return 0;
    if(fn == 0) return 0;

    strcpy(line, fn);
    file = topen(line, "r");
    if(file) return file;

    if(strstr(fn, ".")) return file; // extension given,  we are done trying

    // no extension give. try to open file with default extensions
    if(rcvr_type == CS_RCVR) {
       strcpy(line, fn);
       strcat(line, ".xml");
       file = topen(line, "r");
       if(file) return file;

       strcpy(line, fn);
       strcat(line, ".log");
       file = topen(line, "r");
       if(file) return file;
    }
    else {
       strcpy(line, fn);
       strcat(line, ".log");
       file = topen(line, "r");
       if(file) return file;

       strcpy(line, fn);
       strcat(line, ".xml");
       file = topen(line, "r");
       if(file) return file;
    }

    strcpy(line, fn);
    strcat(line, ".gpx");
    file = topen(line, "r");
    if(file) return file;

    strcpy(line, fn);
    strcat(line, ".kml");
    file = topen(line, "r");
    if(file) return file;

    strcpy(line, fn);         // RINEX
    strcat(line, ".obs");
    file = topen(line, "r");
    if(file) return file;


    // try non-log file names
    strcpy(line, fn);
    strcat(line, ".scr");
    file = topen(line, "r");
    if(file) return file;

    strcpy(line, fn);
    strcat(line, ".lla");
    file = topen(line, "r");
    if(file) return file;

    strcpy(line, fn);
    strcat(line, ".cal");
    file = topen(line, "r");
    if(file) return file;

    strcpy(line, fn);
    strcat(line, ".sig");
    file = topen(line, "r");
    if(file) return file;

    strcpy(line, fn);
    strcat(line, ".prn");
    file = topen(line, "r");
    if(file) return file;

    strcpy(line, fn);
    strcat(line, ".adv");
    file = topen(line, "r");
    if(file) return file;

    strcpy(line, fn);
    strcat(line, ".tim");
    file = topen(line, "r");
    if(file) return file;

    strcpy(line, fn);
    strcat(line, ".tie");
    file = topen(line, "r");
    if(file) return file;

    strcpy(line, fn);
    strcat(line, ".rpn");
    file = topen(line, "r");
    if(file) return file;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0xd376f
xorl %eax, %eax
jmp 0xd378e
movq %rsi, %r14
movq %rdi, %rbx
callq 0x9340
leaq 0x4d52c(%rip), %rsi     # 0x120cad
movq %rbx, %rdi
callq 0x9a4d
testq %rax, %rax
je 0xd3799
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movl $0x2e, %esi
callq 0x9100
testq %rax, %rax
jne 0xd376b
leaq 0x14511e(%rip), %rax    # 0x2188d0
movq (%rax), %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9120
addq %rbx, %rax
cmpq $0x20000, %r15          # imm = 0x20000
jne 0xd380e
movb $0x0, 0x4(%rax)
movl $0x6c6d782e, (%rax)     # imm = 0x6C6D782E
leaq 0x4d4c8(%rip), %rsi     # 0x120cad
movq %rbx, %rdi
callq 0x9a4d
testq %rax, %rax
jne 0xd378e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9120
movl $0x676f6c2e, (%rbx,%rax) # imm = 0x676F6C2E
jmp 0xd384a
movb $0x0, 0x4(%rax)
movl $0x676f6c2e, (%rax)     # imm = 0x676F6C2E
leaq 0x4d48e(%rip), %rsi     # 0x120cad
movq %rbx, %rdi
callq 0x9a4d
testq %rax, %rax
jne 0xd378e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9120
movl $0x6c6d782e, (%rbx,%rax) # imm = 0x6C6D782E
movb $0x0, 0x4(%rbx,%rax)
leaq 0x4d457(%rip), %rsi     # 0x120cad
movq %rbx, %rdi
callq 0x9a4d
testq %rax, %rax
jne 0xd378e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9120
movl $0x7870672e, (%rbx,%rax) # imm = 0x7870672E
movb $0x0, 0x4(%rbx,%rax)
leaq 0x4d420(%rip), %rsi     # 0x120cad
movq %rbx, %rdi
callq 0x9a4d
testq %rax, %rax
jne 0xd378e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9120
movl $0x6c6d6b2e, (%rbx,%rax) # imm = 0x6C6D6B2E
movb $0x0, 0x4(%rbx,%rax)
leaq 0x4d3e9(%rip), %rsi     # 0x120cad
movq %rbx, %rdi
callq 0x9a4d
testq %rax, %rax
jne 0xd378e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9120
movl $0x73626f2e, (%rbx,%rax) # imm = 0x73626F2E
movb $0x0, 0x4(%rbx,%rax)
leaq 0x4d3b2(%rip), %rsi     # 0x120cad
movq %rbx, %rdi
callq 0x9a4d
testq %rax, %rax
jne 0xd378e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9120
movl $0x7263732e, (%rbx,%rax) # imm = 0x7263732E
movb $0x0, 0x4(%rbx,%rax)
leaq 0x4d37b(%rip), %rsi     # 0x120cad
movq %rbx, %rdi
callq 0x9a4d
testq %rax, %rax
jne 0xd378e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9120
movl $0x616c6c2e, (%rbx,%rax) # imm = 0x616C6C2E
movb $0x0, 0x4(%rbx,%rax)
leaq 0x4d344(%rip), %rsi     # 0x120cad
movq %rbx, %rdi
callq 0x9a4d
testq %rax, %rax
jne 0xd378e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9120
movl $0x6c61632e, (%rbx,%rax) # imm = 0x6C61632E
movb $0x0, 0x4(%rbx,%rax)
leaq 0x4d30d(%rip), %rsi     # 0x120cad
movq %rbx, %rdi
callq 0x9a4d
testq %rax, %rax
jne 0xd378e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9120
movl $0x6769732e, (%rbx,%rax) # imm = 0x6769732E
movb $0x0, 0x4(%rbx,%rax)
leaq 0x4d2d6(%rip), %rsi     # 0x120cad
movq %rbx, %rdi
callq 0x9a4d
testq %rax, %rax
jne 0xd378e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9120
movl $0x6e72702e, (%rbx,%rax) # imm = 0x6E72702E
movb $0x0, 0x4(%rbx,%rax)
leaq 0x4d29f(%rip), %rsi     # 0x120cad
movq %rbx, %rdi
callq 0x9a4d
testq %rax, %rax
jne 0xd378e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9120
movl $0x7664612e, (%rbx,%rax) # imm = 0x7664612E
movb $0x0, 0x4(%rbx,%rax)
leaq 0x4d268(%rip), %rsi     # 0x120cad
movq %rbx, %rdi
callq 0x9a4d
testq %rax, %rax
jne 0xd378e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9120
movl $0x6d69742e, (%rbx,%rax) # imm = 0x6D69742E
movb $0x0, 0x4(%rbx,%rax)
leaq 0x4d231(%rip), %rsi     # 0x120cad
movq %rbx, %rdi
callq 0x9a4d
testq %rax, %rax
jne 0xd378e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9120
movl $0x6569742e, (%rbx,%rax) # imm = 0x6569742E
movb $0x0, 0x4(%rbx,%rax)
leaq 0x4d1fa(%rip), %rsi     # 0x120cad
movq %rbx, %rdi
callq 0x9a4d
testq %rax, %rax
jne 0xd378e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9120
movl $0x6e70722e, (%rbx,%rax) # imm = 0x6E70722E
movb $0x0, 0x4(%rbx,%rax)
leaq 0x4d1c3(%rip), %rsi     # 0x120cad
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x9a4d