// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0x1, %ebx
testq %rdi, %rdi
je 0xd7a50
movq %rdi, %r14
leaq 0x5b959(%rip), %rsi     # 0x132fd2
movl $0x3, %edx
callq 0x94a0
testl %eax, %eax
je 0xd7a50
leaq 0x5b944(%rip), %rsi     # 0x132fd6
movl $0x3, %edx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xd7a50
leaq 0x5b92c(%rip), %rsi     # 0x132fda
movl $0x3, %edx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xd7a50
leaq 0x5b914(%rip), %rsi     # 0x132fde
movl $0x3, %edx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xd7a50
leaq 0x334db(%rip), %rsi     # 0x10abc1
movl $0x3, %edx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xd7802
leaq 0x5b8e0(%rip), %rsi     # 0x132fe2
movl $0x6, %edx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xd783a
leaq 0x5b8cb(%rip), %rsi     # 0x132fe9
movl $0x3, %edx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xd7802
leaq 0x5b8b3(%rip), %rsi     # 0x132fed
movl $0xa, %edx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xd7872
leaq 0x5b8a2(%rip), %rsi     # 0x132ff8
movl $0x3, %edx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xd78c7
leaq 0x5b88a(%rip), %rsi     # 0x132ffc
movl $0x3, %edx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xd7912
leaq 0x5b872(%rip), %rsi     # 0x133000
movl $0x3, %edx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xd7992
leaq 0x5b85a(%rip), %rsi     # 0x133004
movl $0x3, %edx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xd7a03
leaq 0x560ba(%rip), %rsi     # 0x12d880
movl $0x3, %edx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xd7a5d
leaq 0x5b8a2(%rip), %rsi     # 0x133084
movl $0x3, %edx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xd7802
movl $0x0, 0x2a2ea3(%rip)    # 0x37a6a0
jmp 0xd7a50
movq %r14, %rdi
callq 0x9120
cmpq $0x5, %rax
jb 0xd7a4e
cmpl $0x0, 0x2a2e59(%rip)    # 0x37a674
je 0xd7834
leaq 0x26702c(%rip), %r15    # 0x33e850
movq %r15, %rdi
callq 0x9120
movl $0x207c20, (%r15,%rax)  # imm = 0x207C20
addq $0x4, %r14
jmp 0xd78a8
movq %r14, %rdi
callq 0x9120
cmpq $0x9, %rax
jb 0xd7a4e
cmpl $0x0, 0x2a2e21(%rip)    # 0x37a674
je 0xd786c
leaq 0x266ff4(%rip), %r15    # 0x33e850
movq %r15, %rdi
callq 0x9120
movl $0x207c20, (%r15,%rax)  # imm = 0x207C20
addq $0x8, %r14
jmp 0xd78a8
movq %r14, %rdi
callq 0x9120
cmpq $0xd, %rax
jb 0xd7a4e
cmpl $0x0, 0x2a2de9(%rip)    # 0x37a674
je 0xd78a4
leaq 0x266fbc(%rip), %r15    # 0x33e850
movq %r15, %rdi
callq 0x9120
movl $0x207c20, (%r15,%rax)  # imm = 0x207C20
addq $0xc, %r14
leaq 0x266fa1(%rip), %r15    # 0x33e850
movq %r15, %rdi
movq %r14, %rsi
callq 0x96c0
movq %r15, %rdi
callq 0xd6b68
jmp 0xd7a50
movq %r14, %rdi
callq 0x9120
cmpq $0x5, %rax
jb 0xd7a4e
addq $0x4, %r14
leaq 0x5b89c(%rip), %rsi     # 0x133180
leaq 0x2a2dbd(%rip), %rdx    # 0x37a6a8
movq %r14, %rdi
xorl %eax, %eax
callq 0x9360
movsd 0x2a2dab(%rip), %xmm0   # 0x37a6a8
addsd 0x46e13(%rip), %xmm0    # 0x11e718
movsd %xmm0, 0x2a2d9b(%rip)   # 0x37a6a8
jmp 0xd7a50
movq %r14, %rdi
callq 0x9120
cmpq $0x5, %rax
jb 0xd7a4e
movabsq $0x416312d000000000, %rax # imm = 0x416312D000000000
movq %rax, 0x2a2d63(%rip)    # 0x37a698
leaq 0x2a2d5c(%rip), %rdx    # 0x37a698
addq $0x4, %r14
leaq 0x5b839(%rip), %rsi     # 0x133180
movq %r14, %rdi
xorl %eax, %eax
callq 0x9360
movsd 0x2a2d3f(%rip), %xmm0   # 0x37a698
movsd 0x3170f(%rip), %xmm1    # 0x109070
divsd %xmm0, %xmm1
xorpd %xmm2, %xmm2
cmpltsd %xmm0, %xmm2
andpd %xmm2, %xmm1
movsd 0x46836(%rip), %xmm0    # 0x11e1b0
andnpd %xmm0, %xmm2
orpd %xmm1, %xmm2
leaq 0x234fff(%rip), %rax    # 0x30c988
movlpd %xmm2, (%rax)
jmp 0xd7a50
movq %r14, %rdi
callq 0x9120
cmpq $0x5, %rax
jb 0xd7a4e
leaq 0x16534d(%rip), %r15    # 0x23ccf8
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, (%r15)
addq $0x4, %r14
leaq 0x5b7bd(%rip), %rsi     # 0x133180
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x9360
movsd (%r15), %xmm0
leaq 0x165324(%rip), %rax    # 0x23cd00
movsd %xmm0, (%rax)
leaq 0x165321(%rip), %rax    # 0x23cd08
movsd %xmm0, (%rax)
leaq 0x16531e(%rip), %rax    # 0x23cd10
movsd %xmm0, (%rax)
leaq 0x16531b(%rip), %rax    # 0x23cd18
movsd %xmm0, (%rax)
jmp 0xd7a50
movq %r14, %rdi
callq 0x9120
cmpq $0x5, %rax
jb 0xd7a4e
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x2a2c5e(%rip)    # 0x37a680
leaq 0x2a2c57(%rip), %rcx    # 0x37a680
movq %rax, 0x2a2c48(%rip)    # 0x37a678
leaq 0x2a2c41(%rip), %rdx    # 0x37a678
addq $0x4, %r14
leaq 0x5b73a(%rip), %rsi     # 0x13317c
movq %r14, %rdi
xorl %eax, %eax
callq 0x9360
jmp 0xd7a50
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, 0x2a2c39(%rip)    # 0x37a6a0
jmp 0xd7a50