// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x1
popq %rbx
testq %rdi, %rdi
je 0xc67a3
movq %rdi, %r14
leaq 0x56bf7(%rip), %rsi     # 0x11cfe2
pushq $0x3
popq %rdx
callq 0x94a0
testl %eax, %eax
je 0xc67a3
leaq 0x56be4(%rip), %rsi     # 0x11cfe6
pushq $0x3
popq %rdx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xc67a3
leaq 0x56bce(%rip), %rsi     # 0x11cfea
pushq $0x3
popq %rdx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xc67a3
leaq 0x56bb8(%rip), %rsi     # 0x11cfee
pushq $0x3
popq %rdx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xc67a3
leaq 0x2e7fc(%rip), %rsi     # 0xf4c4c
pushq $0x3
popq %rdx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xc6555
leaq 0x56b88(%rip), %rsi     # 0x11cff2
pushq $0x6
popq %rdx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xc658d
leaq 0x56b75(%rip), %rsi     # 0x11cff9
pushq $0x3
popq %rdx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xc6555
leaq 0x56b5f(%rip), %rsi     # 0x11cffd
pushq $0xa
popq %rdx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xc65c5
leaq 0x56b50(%rip), %rsi     # 0x11d008
pushq $0x3
popq %rdx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xc661a
leaq 0x56b3a(%rip), %rsi     # 0x11d00c
pushq $0x3
popq %rdx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xc6665
leaq 0x56b24(%rip), %rsi     # 0x11d010
pushq $0x3
popq %rdx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xc66e5
leaq 0x56b0e(%rip), %rsi     # 0x11d014
pushq $0x3
popq %rdx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xc6756
leaq 0x51370(%rip), %rsi     # 0x117890
pushq $0x3
popq %rdx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xc67b0
leaq 0x56b5a(%rip), %rsi     # 0x11d094
pushq $0x3
popq %rdx
movq %r14, %rdi
callq 0x94a0
testl %eax, %eax
je 0xc6555
andl $0x0, 0x29e150(%rip)    # 0x3646a0
jmp 0xc67a3
movq %r14, %rdi
callq 0x9120
cmpq $0x5, %rax
jb 0xc67a1
cmpl $0x0, 0x29e106(%rip)    # 0x364674
je 0xc6587
leaq 0x2622d9(%rip), %r15    # 0x328850
movq %r15, %rdi
callq 0x9120
movl $0x207c20, (%r15,%rax)  # imm = 0x207C20
addq $0x4, %r14
jmp 0xc65fb
movq %r14, %rdi
callq 0x9120
cmpq $0x9, %rax
jb 0xc67a1
cmpl $0x0, 0x29e0ce(%rip)    # 0x364674
je 0xc65bf
leaq 0x2622a1(%rip), %r15    # 0x328850
movq %r15, %rdi
callq 0x9120
movl $0x207c20, (%r15,%rax)  # imm = 0x207C20
addq $0x8, %r14
jmp 0xc65fb
movq %r14, %rdi
callq 0x9120
cmpq $0xd, %rax
jb 0xc67a1
cmpl $0x0, 0x29e096(%rip)    # 0x364674
je 0xc65f7
leaq 0x262269(%rip), %r15    # 0x328850
movq %r15, %rdi
callq 0x9120
movl $0x207c20, (%r15,%rax)  # imm = 0x207C20
addq $0xc, %r14
leaq 0x26224e(%rip), %r15    # 0x328850
movq %r15, %rdi
movq %r14, %rsi
callq 0x96c0
movq %r15, %rdi
callq 0xc5928
jmp 0xc67a3
movq %r14, %rdi
callq 0x9120
cmpq $0x5, %rax
jb 0xc67a1
addq $0x4, %r14
leaq 0x56b59(%rip), %rsi     # 0x11d190
leaq 0x29e06a(%rip), %rdx    # 0x3646a8
movq %r14, %rdi
xorl %eax, %eax
callq 0x9350
movsd 0x29e058(%rip), %xmm0   # 0x3646a8
addsd 0x420e8(%rip), %xmm0    # 0x108740
movsd %xmm0, 0x29e048(%rip)   # 0x3646a8
jmp 0xc67a3
movq %r14, %rdi
callq 0x9120
cmpq $0x5, %rax
jb 0xc67a1
movabsq $0x416312d000000000, %rax # imm = 0x416312D000000000
movq %rax, 0x29e010(%rip)    # 0x364698
leaq 0x29e009(%rip), %rdx    # 0x364698
addq $0x4, %r14
leaq 0x56af6(%rip), %rsi     # 0x11d190
movq %r14, %rdi
xorl %eax, %eax
callq 0x9350
movsd 0x29dfec(%rip), %xmm0   # 0x364698
movsd 0x2c9bc(%rip), %xmm1    # 0xf3070
divsd %xmm0, %xmm1
xorpd %xmm2, %xmm2
cmpltsd %xmm0, %xmm2
andpd %xmm2, %xmm1
movsd 0x41c03(%rip), %xmm0    # 0x1082d0
andnpd %xmm0, %xmm2
orpd %xmm1, %xmm2
leaq 0x2302ac(%rip), %rax    # 0x2f6988
movlpd %xmm2, (%rax)
jmp 0xc67a3
movq %r14, %rdi
callq 0x9120
cmpq $0x5, %rax
jb 0xc67a1
leaq 0x1605fa(%rip), %r15    # 0x226cf8
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, (%r15)
addq $0x4, %r14
leaq 0x56a7a(%rip), %rsi     # 0x11d190
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x9350
movsd (%r15), %xmm0
leaq 0x1605d1(%rip), %rax    # 0x226d00
movsd %xmm0, (%rax)
leaq 0x1605ce(%rip), %rax    # 0x226d08
movsd %xmm0, (%rax)
leaq 0x1605cb(%rip), %rax    # 0x226d10
movsd %xmm0, (%rax)
leaq 0x1605c8(%rip), %rax    # 0x226d18
movsd %xmm0, (%rax)
jmp 0xc67a3
movq %r14, %rdi
callq 0x9120
cmpq $0x5, %rax
jb 0xc67a1
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x29df0b(%rip)    # 0x364680
leaq 0x29df04(%rip), %rcx    # 0x364680
movq %rax, 0x29def5(%rip)    # 0x364678
leaq 0x29deee(%rip), %rdx    # 0x364678
addq $0x4, %r14
leaq 0x569f7(%rip), %rsi     # 0x11d18c
movq %r14, %rdi
xorl %eax, %eax
callq 0x9350
jmp 0xc67a3
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, 0x29dee6(%rip)    # 0x3646a0
jmp 0xc67a3