// File: 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
subq $0x660, %rsp            # imm = 0x660
leaq 0x17f06c(%rip), %rax    # 0x29e11e
cmpb $0x0, (%rax)
je 0x11f0bc
jmp 0x11f4f3
leaq 0x17e47d(%rip), %rax    # 0x29d540
cmpq $0x0, (%rax)
jne 0x11f0ce
jmp 0x11f4f3
movl $0x1, %edi
callq 0x127d80
cmpl $0x0, %eax
jne 0x11f0e2
jmp 0x11f4f3
leaq 0x17e507(%rip), %rax    # 0x29d5f0
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x11f141
leaq 0x17f04a(%rip), %rax    # 0x29e144
cmpl $0x0, (%rax)
jle 0x11f141
leaq 0x17e43a(%rip), %rax    # 0x29d540
movq (%rax), %rdi
leaq 0x79516(%rip), %rsi     # 0x198626
movb $0x0, %al
callq 0x9550
leaq 0x17e4e2(%rip), %rax    # 0x29d600
cmpl $0x0, (%rax)
je 0x11f13f
leaq 0x17e416(%rip), %rax    # 0x29d540
cmpq $0x0, (%rax)
je 0x11f13f
leaq 0x17e409(%rip), %rax    # 0x29d540
movq (%rax), %rdi
callq 0x9430
jmp 0x11f141
movl $0x1, %edi
callq 0x127d80
andl $0x1, %eax
cmpl $0x0, %eax
je 0x11f209
movl $0x5, %edi
leaq -0x658(%rbp), %rsi
callq 0x162900
leaq -0x658(%rbp), %rdi
callq 0x166e20
movl $0x6, %edi
leaq -0x658(%rbp), %rsi
callq 0x162900
leaq -0x658(%rbp), %rdi
callq 0x166e20
movl $0x7, %edi
leaq -0x658(%rbp), %rsi
callq 0x162900
leaq -0x658(%rbp), %rdi
callq 0x166e20
movl $0x8, %edi
leaq -0x658(%rbp), %rsi
callq 0x162900
leaq -0x658(%rbp), %rdi
callq 0x166e20
leaq 0x17d96e(%rip), %rdi    # 0x29cb40
leaq 0x52bc3(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x17d94f(%rip), %rdi    # 0x29cb40
leaq 0x52ba4(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
movl $0x1, %edi
callq 0x127d80
andl $0x2, %eax
cmpl $0x0, %eax
je 0x11f2ce
xorl %edi, %edi
leaq -0x658(%rbp), %rsi
callq 0x162900
leaq -0x658(%rbp), %rdi
callq 0x166e20
movl $0x1, %edi
leaq -0x658(%rbp), %rsi
callq 0x162900
leaq -0x658(%rbp), %rdi
callq 0x166e20
movl $0x2, %edi
leaq -0x658(%rbp), %rsi
callq 0x162900
leaq -0x658(%rbp), %rdi
callq 0x166e20
movl $0x3, %edi
leaq -0x658(%rbp), %rsi
callq 0x162900
leaq -0x658(%rbp), %rdi
callq 0x166e20
leaq 0x17d8a9(%rip), %rdi    # 0x29cb40
leaq 0x52afe(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x17d88a(%rip), %rdi    # 0x29cb40
leaq 0x52adf(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
movl $0x1, %edi
callq 0x127d80
andl $0x4, %eax
cmpl $0x0, %eax
je 0x11f396
movl $0xa, %edi
leaq -0x658(%rbp), %rsi
callq 0x162900
leaq -0x658(%rbp), %rdi
callq 0x166e20
movl $0xb, %edi
leaq -0x658(%rbp), %rsi
callq 0x162900
leaq -0x658(%rbp), %rdi
callq 0x166e20
movl $0xc, %edi
leaq -0x658(%rbp), %rsi
callq 0x162900
leaq -0x658(%rbp), %rdi
callq 0x166e20
movl $0xd, %edi
leaq -0x658(%rbp), %rsi
callq 0x162900
leaq -0x658(%rbp), %rdi
callq 0x166e20
leaq 0x17d7e1(%rip), %rdi    # 0x29cb40
leaq 0x52a36(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x17d7c2(%rip), %rdi    # 0x29cb40
leaq 0x52a17(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
movl $0x1, %edi
callq 0x127d80
andl $0x8, %eax
cmpl $0x0, %eax
je 0x11f45e
movl $0xf, %edi
leaq -0x658(%rbp), %rsi
callq 0x162900
leaq -0x658(%rbp), %rdi
callq 0x166e20
movl $0x10, %edi
leaq -0x658(%rbp), %rsi
callq 0x162900
leaq -0x658(%rbp), %rdi
callq 0x166e20
movl $0x11, %edi
leaq -0x658(%rbp), %rsi
callq 0x162900
leaq -0x658(%rbp), %rdi
callq 0x166e20
movl $0x12, %edi
leaq -0x658(%rbp), %rsi
callq 0x162900
leaq -0x658(%rbp), %rdi
callq 0x166e20
leaq 0x17d719(%rip), %rdi    # 0x29cb40
leaq 0x5296e(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x17d6fa(%rip), %rdi    # 0x29cb40
leaq 0x5294f(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
cmpl $0x0, 0x394e9b(%rip)    # 0x4b4300
je 0x11f481
xorl %edi, %edi
leaq -0x658(%rbp), %rsi
callq 0x15e3b0
leaq -0x658(%rbp), %rdi
callq 0x166e20
cmpl $0x0, 0x394e7c(%rip)    # 0x4b4304
je 0x11f4a7
movl $0x1, %edi
leaq -0x658(%rbp), %rsi
callq 0x15e3b0
leaq -0x658(%rbp), %rdi
callq 0x166e20
cmpl $0x0, 0x394e5a(%rip)    # 0x4b4308
je 0x11f4cd
movl $0x2, %edi
leaq -0x658(%rbp), %rsi
callq 0x15e3b0
leaq -0x658(%rbp), %rdi
callq 0x166e20
cmpl $0x0, 0x394e38(%rip)    # 0x4b430c
je 0x11f4f3
movl $0x3, %edi
leaq -0x658(%rbp), %rsi
callq 0x15e3b0
leaq -0x658(%rbp), %rdi
callq 0x166e20
addq $0x660, %rsp            # imm = 0x660
popq %rbp
retq
nopl (%rax)