// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: tim_command(char*)
int tim_command(char *line)
{
   if(line == 0) return 1;

   if(!strnicmp(line, "BLN", 3)) {  // new format file
      return 1;
   }
   else if(!strnicmp(line, "DBL", 3)) {
      return 1;
   }
   else if(!strnicmp(line, "S32", 3)) {
      return 1;
   }
   else if(!strnicmp(line, "STR", 3)) {
      return 1;
   }

   else if(!strnicmp(line, "CAP", 3)) {
      if(strlen(line) > 4) {
         if(saw_log_title) strcat(plot_title, " | ");
         strcat(plot_title, &line[4]);
         set_log_title(plot_title);
         return 1;
      }
   }
   else if(!strnicmp(line, "DRIVER", 6)) {
      if(strlen(line) > 6+2) {
         if(saw_log_title) strcat(plot_title, " | ");
         strcat(plot_title, &line[6+2]);
         set_log_title(plot_title);
         return 1;
      }
   }
   else if(!strnicmp(line, "IMO", 3)) {
      if(strlen(line) > 4) {
         if(saw_log_title) strcat(plot_title, " | ");
         strcat(plot_title, &line[4]);
         set_log_title(plot_title);
         return 1;
      }
   }
   else if(!strnicmp(line, "INSTRUMENT", 10)) {
      if(strlen(line) > 10+2) {
         if(saw_log_title) strcat(plot_title, " | ");
         strcat(plot_title, &line[10+2]);
         set_log_title(plot_title);
         return 1;
      }
   }
   else if(!strnicmp(line, "MJD", 3)) {  // modified Julian date
      if(strlen(line) > 4) {
         sscanf(&line[4], "%lf", &read_log_jd);
         read_log_jd += JD_MJD;
         return 1;
      }
   }
   else if(!strnicmp(line, "NOM", 3)) {  // nominal freq
      if(strlen(line) > 4) {
         log_freq = NOMINAL_FREQ;
         sscanf(&line[4], "%lf", &log_freq);
         if(log_freq > 0.0) cha_phase_wrap_interval = 1.0 / log_freq;
         else               cha_phase_wrap_interval = 1.0 / NOMINAL_FREQ;
         return 1;
      }
   }           
   else if(!strnicmp(line, "PER", 3)) {
      if(strlen(line) > 4) {
         adev_period = 1.0;
         sscanf(&line[4], "%lf", &adev_period);   // aaaaaapppppp other periods 
         pps_adev_period = adev_period;
         osc_adev_period = adev_period;
         chc_adev_period = adev_period;
         chd_adev_period = adev_period;
         return 1;
      }
   }
   else if(!strnicmp(line, "SCA", 3)) {
      if(strlen(line) > 4) {
         log_pps_scale = log_osc_scale = 1.0;
         sscanf(&line[4], "%lf %lf", &log_pps_scale, &log_osc_scale);
         return 1;
      }
   }
   else if(!strnicmp(line, "TIC", 3)) {
      saw_timelab_tic = 1;
      return 1;
   }
   else if(!strnicmp(line, "TIM", 3)) {
      if(strlen(line) > 4) {
         if(saw_log_title) strcat(plot_title, " | ");
         strcat(plot_title, &line[4]);
         set_log_title(plot_title);
         return 1;
      }
   }
   else {
      saw_timelab_tic = 0;
      return 1;
   }

   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x1267af
movl $0x1, -0x4(%rbp)
jmp 0x126d56
movq -0x10(%rbp), %rdi
leaq 0x6f46c(%rip), %rsi     # 0x195c26
movl $0x3, %edx
callq 0x94a0
cmpl $0x0, %eax
jne 0x1267d5
movl $0x1, -0x4(%rbp)
jmp 0x126d56
movq -0x10(%rbp), %rdi
leaq 0x6f44a(%rip), %rsi     # 0x195c2a
movl $0x3, %edx
callq 0x94a0
cmpl $0x0, %eax
jne 0x1267fb
movl $0x1, -0x4(%rbp)
jmp 0x126d56
movq -0x10(%rbp), %rdi
leaq 0x6f428(%rip), %rsi     # 0x195c2e
movl $0x3, %edx
callq 0x94a0
cmpl $0x0, %eax
jne 0x126821
movl $0x1, -0x4(%rbp)
jmp 0x126d56
movq -0x10(%rbp), %rdi
leaq 0x6f406(%rip), %rsi     # 0x195c32
movl $0x3, %edx
callq 0x94a0
cmpl $0x0, %eax
jne 0x126847
movl $0x1, -0x4(%rbp)
jmp 0x126d56
movq -0x10(%rbp), %rdi
leaq 0x4a36c(%rip), %rsi     # 0x170bbe
movl $0x3, %edx
callq 0x94a0
cmpl $0x0, %eax
jne 0x1268bd
movq -0x10(%rbp), %rdi
callq 0x9120
cmpq $0x4, %rax
jbe 0x1268b8
cmpl $0x0, 0x2b303d(%rip)    # 0x3d98b4
je 0x12688c
leaq 0x2771b0(%rip), %rdi    # 0x39da30
leaq 0x6f3af(%rip), %rsi     # 0x195c36
callq 0x96a0
movq -0x10(%rbp), %rsi
addq $0x4, %rsi
leaq 0x277195(%rip), %rdi    # 0x39da30
callq 0x96a0
leaq 0x277189(%rip), %rdi    # 0x39da30
callq 0x125960
movl $0x1, -0x4(%rbp)
jmp 0x126d56
jmp 0x126d47
movq -0x10(%rbp), %rdi
leaq 0x6f372(%rip), %rsi     # 0x195c3a
movl $0x6, %edx
callq 0x94a0
cmpl $0x0, %eax
jne 0x126933
movq -0x10(%rbp), %rdi
callq 0x9120
cmpq $0x8, %rax
jbe 0x12692e
cmpl $0x0, 0x2b2fc7(%rip)    # 0x3d98b4
je 0x126902
leaq 0x27713a(%rip), %rdi    # 0x39da30
leaq 0x6f339(%rip), %rsi     # 0x195c36
callq 0x96a0
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
leaq 0x27711f(%rip), %rdi    # 0x39da30
callq 0x96a0
leaq 0x277113(%rip), %rdi    # 0x39da30
callq 0x125960
movl $0x1, -0x4(%rbp)
jmp 0x126d56
jmp 0x126d45
movq -0x10(%rbp), %rdi
leaq 0x6f303(%rip), %rsi     # 0x195c41
movl $0x3, %edx
callq 0x94a0
cmpl $0x0, %eax
jne 0x1269a9
movq -0x10(%rbp), %rdi
callq 0x9120
cmpq $0x4, %rax
jbe 0x1269a4
cmpl $0x0, 0x2b2f51(%rip)    # 0x3d98b4
je 0x126978
leaq 0x2770c4(%rip), %rdi    # 0x39da30
leaq 0x6f2c3(%rip), %rsi     # 0x195c36
callq 0x96a0
movq -0x10(%rbp), %rsi
addq $0x4, %rsi
leaq 0x2770a9(%rip), %rdi    # 0x39da30
callq 0x96a0
leaq 0x27709d(%rip), %rdi    # 0x39da30
callq 0x125960
movl $0x1, -0x4(%rbp)
jmp 0x126d56
jmp 0x126d43
movq -0x10(%rbp), %rdi
leaq 0x6f291(%rip), %rsi     # 0x195c45
movl $0xa, %edx
callq 0x94a0
cmpl $0x0, %eax
jne 0x126a1f
movq -0x10(%rbp), %rdi
callq 0x9120
cmpq $0xc, %rax
jbe 0x126a1a
cmpl $0x0, 0x2b2edb(%rip)    # 0x3d98b4
je 0x1269ee
leaq 0x27704e(%rip), %rdi    # 0x39da30
leaq 0x6f24d(%rip), %rsi     # 0x195c36
callq 0x96a0
movq -0x10(%rbp), %rsi
addq $0xc, %rsi
leaq 0x277033(%rip), %rdi    # 0x39da30
callq 0x96a0
leaq 0x277027(%rip), %rdi    # 0x39da30
callq 0x125960
movl $0x1, -0x4(%rbp)
jmp 0x126d56
jmp 0x126d41
movq -0x10(%rbp), %rdi
leaq 0x6f226(%rip), %rsi     # 0x195c50
movl $0x3, %edx
callq 0x94a0
cmpl $0x0, %eax
jne 0x126a8e
movq -0x10(%rbp), %rdi
callq 0x9120
cmpq $0x4, %rax
jbe 0x126a89
movq -0x10(%rbp), %rdi
addq $0x4, %rdi
leaq 0x6f381(%rip), %rsi     # 0x195dd8
leaq 0x2b2e8a(%rip), %rdx    # 0x3d98e8
movb $0x0, %al
callq 0x9370
movsd 0x4aba3(%rip), %xmm0    # 0x171610
addsd 0x2b2e73(%rip), %xmm0   # 0x3d98e8
movsd %xmm0, 0x2b2e6b(%rip)   # 0x3d98e8
movl $0x1, -0x4(%rbp)
jmp 0x126d56
jmp 0x126d3f
movq -0x10(%rbp), %rdi
leaq 0x6f1bb(%rip), %rsi     # 0x195c54
movl $0x3, %edx
callq 0x94a0
cmpl $0x0, %eax
jne 0x126b3a
movq -0x10(%rbp), %rdi
callq 0x9120
cmpq $0x4, %rax
jbe 0x126b35
movsd 0x486ed(%rip), %xmm0    # 0x16f1b0
movsd %xmm0, 0x2b2e0d(%rip)   # 0x3d98d8
movq -0x10(%rbp), %rdi
addq $0x4, %rdi
leaq 0x6f2fe(%rip), %rsi     # 0x195dd8
leaq 0x2b2df7(%rip), %rdx    # 0x3d98d8
movb $0x0, %al
callq 0x9370
movsd 0x2b2de8(%rip), %xmm0   # 0x3d98d8
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x126b16
movsd 0x48567(%rip), %xmm0    # 0x16f068
divsd 0x2b2dcf(%rip), %xmm0   # 0x3d98d8
leaq 0x245058(%rip), %rax    # 0x36bb68
movsd %xmm0, (%rax)
jmp 0x126b29
leaq 0x24504b(%rip), %rax    # 0x36bb68
movsd 0x48683(%rip), %xmm0    # 0x16f1a8
movsd %xmm0, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x126d56
jmp 0x126d3d
movq -0x10(%rbp), %rdi
leaq 0x6f113(%rip), %rsi     # 0x195c58
movl $0x3, %edx
callq 0x94a0
cmpl $0x0, %eax
jne 0x126c04
movq -0x10(%rbp), %rdi
callq 0x9120
cmpq $0x4, %rax
jbe 0x126bff
leaq 0x175366(%rip), %rax    # 0x29bed8
movsd 0x484ee(%rip), %xmm0    # 0x16f068
movsd %xmm0, (%rax)
movq -0x10(%rbp), %rdi
addq $0x4, %rdi
leaq 0x6f24b(%rip), %rsi     # 0x195dd8
leaq 0x175344(%rip), %rdx    # 0x29bed8
movb $0x0, %al
callq 0x9370
leaq 0x175336(%rip), %rax    # 0x29bed8
movsd (%rax), %xmm0
leaq 0x175333(%rip), %rax    # 0x29bee0
movsd %xmm0, (%rax)
leaq 0x175320(%rip), %rax    # 0x29bed8
movsd (%rax), %xmm0
leaq 0x175325(%rip), %rax    # 0x29bee8
movsd %xmm0, (%rax)
leaq 0x17530a(%rip), %rax    # 0x29bed8
movsd (%rax), %xmm0
leaq 0x175317(%rip), %rax    # 0x29bef0
movsd %xmm0, (%rax)
leaq 0x1752f4(%rip), %rax    # 0x29bed8
movsd (%rax), %xmm0
leaq 0x175309(%rip), %rax    # 0x29bef8
movsd %xmm0, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x126d56
jmp 0x126d3b
movq -0x10(%rbp), %rdi
leaq 0x6f04d(%rip), %rsi     # 0x195c5c
movl $0x3, %edx
callq 0x94a0
cmpl $0x0, %eax
jne 0x126c82
movq -0x10(%rbp), %rdi
callq 0x9120
cmpq $0x4, %rax
jbe 0x126c7d
movsd 0x48433(%rip), %xmm0    # 0x16f068
movsd %xmm0, 0x2b2c83(%rip)   # 0x3d98c0
movsd 0x48423(%rip), %xmm0    # 0x16f068
movsd %xmm0, 0x2b2c6b(%rip)   # 0x3d98b8
movq -0x10(%rbp), %rdi
addq $0x4, %rdi
leaq 0x6f178(%rip), %rsi     # 0x195dd4
leaq 0x2b2c55(%rip), %rdx    # 0x3d98b8
leaq 0x2b2c56(%rip), %rcx    # 0x3d98c0
movb $0x0, %al
callq 0x9370
movl $0x1, -0x4(%rbp)
jmp 0x126d56
jmp 0x126d39
movq -0x10(%rbp), %rdi
leaq 0x697df(%rip), %rsi     # 0x19046c
movl $0x3, %edx
callq 0x94a0
cmpl $0x0, %eax
jne 0x126cb2
movl $0x1, 0x2b2c3a(%rip)    # 0x3d98e0
movl $0x1, -0x4(%rbp)
jmp 0x126d56
movq -0x10(%rbp), %rdi
leaq 0x6f01f(%rip), %rsi     # 0x195cdc
movl $0x3, %edx
callq 0x94a0
cmpl $0x0, %eax
jne 0x126d22
movq -0x10(%rbp), %rdi
callq 0x9120
cmpq $0x4, %rax
jbe 0x126d20
cmpl $0x0, 0x2b2bd2(%rip)    # 0x3d98b4
je 0x126cf7
leaq 0x276d45(%rip), %rdi    # 0x39da30
leaq 0x6ef44(%rip), %rsi     # 0x195c36
callq 0x96a0
movq -0x10(%rbp), %rsi
addq $0x4, %rsi
leaq 0x276d2a(%rip), %rdi    # 0x39da30
callq 0x96a0
leaq 0x276d1e(%rip), %rdi    # 0x39da30
callq 0x125960
movl $0x1, -0x4(%rbp)
jmp 0x126d56
jmp 0x126d35
movl $0x0, 0x2b2bb4(%rip)    # 0x3d98e0
movl $0x1, -0x4(%rbp)
jmp 0x126d56
jmp 0x126d37
jmp 0x126d39
jmp 0x126d3b
jmp 0x126d3d
jmp 0x126d3f
jmp 0x126d41
jmp 0x126d43
jmp 0x126d45
jmp 0x126d47
jmp 0x126d49
jmp 0x126d4b
jmp 0x126d4d
jmp 0x126d4f
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop