// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: log_adevs()
void log_adevs()
{
struct ADEV_INFO bins;

   // write all adev tables to the log file
   if(luxor) return;
   if(log_file == 0) return;

   if(adevs_active(1) == 0) return;

   if((log_stream & LOG_HEX_STREAM) && (kol > 0)) {
      fprintf(log_file, "\n");
      if(log_flush_mode && log_file) fflush(log_file);
   }

   if(adevs_active(1) & 0x01) {
      fetch_adev_info(PPS_ADEV, &bins);
      write_log_adevs(&bins);  

      fetch_adev_info(PPS_HDEV, &bins);
      write_log_adevs(&bins);  

      fetch_adev_info(PPS_MDEV, &bins);
      write_log_adevs(&bins);  

      fetch_adev_info(PPS_TDEV, &bins);
      write_log_adevs(&bins);  

      sprintf(log_text, "#");
      write_log_comment(1);

      sprintf(log_text, "#");
      write_log_comment(1);
   }


   if(adevs_active(1) & 0x02) {
      fetch_adev_info(OSC_ADEV, &bins);
      write_log_adevs(&bins);

      fetch_adev_info(OSC_HDEV, &bins);
      write_log_adevs(&bins);

      fetch_adev_info(OSC_MDEV, &bins);
      write_log_adevs(&bins);

      fetch_adev_info(OSC_TDEV, &bins);
      write_log_adevs(&bins);

      sprintf(log_text, "#");
      write_log_comment(1);

      sprintf(log_text, "#");
      write_log_comment(1);
   }


   if(adevs_active(1) & 0x04) {
      fetch_adev_info(CHC_ADEV, &bins);
      write_log_adevs(&bins);

      fetch_adev_info(CHC_HDEV, &bins);
      write_log_adevs(&bins);

      fetch_adev_info(CHC_MDEV, &bins);
      write_log_adevs(&bins);

      fetch_adev_info(CHC_TDEV, &bins);
      write_log_adevs(&bins);

      sprintf(log_text, "#");
      write_log_comment(1);

      sprintf(log_text, "#");
      write_log_comment(1);
   }


   if(adevs_active(1) & 0x08) {
      fetch_adev_info(CHD_ADEV, &bins);
      write_log_adevs(&bins);

      fetch_adev_info(CHD_HDEV, &bins);
      write_log_adevs(&bins);

      fetch_adev_info(CHD_MDEV, &bins);
      write_log_adevs(&bins);

      fetch_adev_info(CHD_TDEV, &bins);
      write_log_adevs(&bins);

      sprintf(log_text, "#");
      write_log_comment(1);

      sprintf(log_text, "#");
      write_log_comment(1);
   }

   if(mtie_q_count[CHA_MTIE]) {
      fetch_mtie_info(CHA_MTIE, &bins);
      write_log_adevs(&bins);
   }

   if(mtie_q_count[CHB_MTIE]) {
      fetch_mtie_info(CHB_MTIE, &bins);
      write_log_adevs(&bins);
   }

   if(mtie_q_count[CHC_MTIE]) {
      fetch_mtie_info(CHC_MTIE, &bins);
      write_log_adevs(&bins);
   }

   if(mtie_q_count[CHD_MTIE]) {
      fetch_mtie_info(CHD_MTIE, &bins);
      write_log_adevs(&bins);
   }

//fprintf(log_file, "active:%d  qin:%d qout:%d count:%d\n", adevs_active(1), adev_q_in,adev_q_out,adev_q_count);  // aaaaaa
//int i;
//for(i=0; i<adev_q_count; i++) {
//   fprintf(log_file, "%d: %.12f %.12f %.12f\n", i, adev_q[i].osc, adev_q[i].pps, adev_q[i].chc);
//}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x660, %rsp            # imm = 0x660
leaq 0x16d508(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
jne 0xd1d8b
leaq 0x16c91a(%rip), %rbx    # 0x23e360
cmpq $0x0, (%rbx)
je 0xd1d8b
movl $0x1, %edi
callq 0xd84d7
testl %eax, %eax
je 0xd1d8b
leaq 0x16c9a7(%rip), %rax    # 0x23e410
testb $0x1, (%rax)
je 0xd1aa9
leaq 0x16d4ef(%rip), %rax    # 0x23ef64
cmpl $0x0, (%rax)
jle 0xd1aa9
movq (%rbx), %rsi
movl $0xa, %edi
callq 0x9480
leaq 0x16c992(%rip), %rax    # 0x23e420
cmpl $0x0, (%rax)
setne %al
movq (%rbx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xd1aa9
callq 0x9420
movl $0x1, %edi
callq 0xd84d7
testb $0x1, %al
je 0xd1b3e
leaq -0x668(%rbp), %rbx
movl $0x5, %edi
movq %rbx, %rsi
callq 0x100c0d
movq %rbx, %rdi
callq 0x10383d
movl $0x6, %edi
movq %rbx, %rsi
callq 0x100c0d
movq %rbx, %rdi
callq 0x10383d
movl $0x7, %edi
movq %rbx, %rsi
callq 0x100c0d
movq %rbx, %rdi
callq 0x10383d
movl $0x8, %edi
movq %rbx, %rsi
callq 0x100c0d
movq %rbx, %rdi
callq 0x10383d
leaq 0x16be43(%rip), %rbx    # 0x23d960
movw $0x23, %r14w
movw %r14w, (%rbx)
movl $0x1, %edi
callq 0xc3105
movw %r14w, (%rbx)
movl $0x1, %edi
callq 0xc3105
movl $0x1, %edi
callq 0xd84d7
testb $0x2, %al
je 0xd1bd0
leaq -0x668(%rbp), %rbx
xorl %edi, %edi
movq %rbx, %rsi
callq 0x100c0d
movq %rbx, %rdi
callq 0x10383d
movl $0x1, %edi
movq %rbx, %rsi
callq 0x100c0d
movq %rbx, %rdi
callq 0x10383d
movl $0x2, %edi
movq %rbx, %rsi
callq 0x100c0d
movq %rbx, %rdi
callq 0x10383d
movl $0x3, %edi
movq %rbx, %rsi
callq 0x100c0d
movq %rbx, %rdi
callq 0x10383d
leaq 0x16bdb1(%rip), %rbx    # 0x23d960
movw $0x23, %r14w
movw %r14w, (%rbx)
movl $0x1, %edi
callq 0xc3105
movw %r14w, (%rbx)
movl $0x1, %edi
callq 0xc3105
movl $0x1, %edi
callq 0xd84d7
testb $0x4, %al
je 0xd1c65
leaq -0x668(%rbp), %rbx
movl $0xa, %edi
movq %rbx, %rsi
callq 0x100c0d
movq %rbx, %rdi
callq 0x10383d
movl $0xb, %edi
movq %rbx, %rsi
callq 0x100c0d
movq %rbx, %rdi
callq 0x10383d
movl $0xc, %edi
movq %rbx, %rsi
callq 0x100c0d
movq %rbx, %rdi
callq 0x10383d
movl $0xd, %edi
movq %rbx, %rsi
callq 0x100c0d
movq %rbx, %rdi
callq 0x10383d
leaq 0x16bd1c(%rip), %rbx    # 0x23d960
movw $0x23, %r14w
movw %r14w, (%rbx)
movl $0x1, %edi
callq 0xc3105
movw %r14w, (%rbx)
movl $0x1, %edi
callq 0xc3105
movl $0x1, %edi
callq 0xd84d7
testb $0x8, %al
je 0xd1cfa
leaq -0x668(%rbp), %rbx
movl $0xf, %edi
movq %rbx, %rsi
callq 0x100c0d
movq %rbx, %rdi
callq 0x10383d
movl $0x10, %edi
movq %rbx, %rsi
callq 0x100c0d
movq %rbx, %rdi
callq 0x10383d
movl $0x11, %edi
movq %rbx, %rsi
callq 0x100c0d
movq %rbx, %rdi
callq 0x10383d
movl $0x12, %edi
movq %rbx, %rsi
callq 0x100c0d
movq %rbx, %rdi
callq 0x10383d
leaq 0x16bc87(%rip), %rbx    # 0x23d960
movw $0x23, %r14w
movw %r14w, (%rbx)
movl $0x1, %edi
callq 0xc3105
movw %r14w, (%rbx)
movl $0x1, %edi
callq 0xc3105
cmpl $0x0, 0x3830ef(%rip)    # 0x454df0
je 0xd1d1c
leaq -0x668(%rbp), %rbx
xorl %edi, %edi
movq %rbx, %rsi
callq 0xfdee3
movq %rbx, %rdi
callq 0x10383d
cmpl $0x0, 0x3830d1(%rip)    # 0x454df4
je 0xd1d41
leaq -0x668(%rbp), %rbx
movl $0x1, %edi
movq %rbx, %rsi
callq 0xfdee3
movq %rbx, %rdi
callq 0x10383d
cmpl $0x0, 0x3830b0(%rip)    # 0x454df8
je 0xd1d66
leaq -0x668(%rbp), %rbx
movl $0x2, %edi
movq %rbx, %rsi
callq 0xfdee3
movq %rbx, %rdi
callq 0x10383d
cmpl $0x0, 0x38308f(%rip)    # 0x454dfc
je 0xd1d8b
leaq -0x668(%rbp), %rbx
movl $0x3, %edi
movq %rbx, %rsi
callq 0xfdee3
movq %rbx, %rdi
callq 0x10383d
addq $0x660, %rsp            # imm = 0x660
popq %rbx
popq %r14
popq %rbp
retq