// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: dump_signals(char*)
void dump_signals(char *fn)
{
FILE *f;
int az, el;

   // write signal strength data to a log file

   if(!strstr(fn, ".")) {
      strcat(fn, ".sig");
   }
   f = topen(fn, "w");
   if(f == 0) return;

   write_log_header(f, 3);
   month = fix_month(month);
   fprintf(f,"#   %02d:%02d:%02d %s   %02d %s %04d\n", 
      hours,minutes,seconds, (time_flags & TFLAGS_UTC)?"UTC":"GPS", day,months[month],year);
   fprintf(f, "#\n");
   fprintf(f, "#az el dBc\n");

   for(el=0; el<=90; el++) {
      for(az=0; az<=360; az++) {
         if(db_3d_count[az][el] > 0.0F) {
            fprintf(f, "%03d %02d %5.2f\n", az, el, db_3d_sum[az][el]/db_3d_count[az][el]);
         }
      }
   }

   fclose(f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x3e301(%rip), %rsi     # 0x195dc8
callq 0x9090
cmpq $0x0, %rax
jne 0x157ae2
movq -0x8(%rbp), %rdi
leaq 0x235eb(%rip), %rsi     # 0x17b0c8
callq 0x96a0
movq -0x8(%rbp), %rdi
leaq 0x2cb5e(%rip), %rsi     # 0x18464b
callq 0x9b20
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x157b02
jmp 0x157cc5
movq -0x10(%rbp), %rdi
movl $0x3, %esi
callq 0x110390
leaq 0x214ba1(%rip), %rax    # 0x36c6b8
movl (%rax), %edi
callq 0x9c2e0
movl %eax, %ecx
leaq 0x214b91(%rip), %rax    # 0x36c6b8
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0x214b78(%rip), %rax    # 0x36c6b0
movl (%rax), %eax
movl %eax, -0x24(%rbp)
leaq 0x214b68(%rip), %rax    # 0x36c6ac
movl (%rax), %eax
movl %eax, -0x20(%rbp)
leaq 0x214b58(%rip), %rax    # 0x36c6a8
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
leaq 0x214b28(%rip), %rax    # 0x36c684
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x157b73
leaq 0x3fed3(%rip), %rax     # 0x197a40
movq %rax, -0x38(%rbp)
jmp 0x157b80
leaq 0x3e8df(%rip), %rax     # 0x196459
movq %rax, -0x38(%rbp)
jmp 0x157b80
movl -0x1c(%rbp), %r8d
movl -0x20(%rbp), %ecx
movl -0x24(%rbp), %edx
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %r9
leaq 0x214b1b(%rip), %rax    # 0x36c6b4
movl (%rax), %r11d
leaq 0x214b15(%rip), %rax    # 0x36c6b8
movslq (%rax), %rsi
leaq 0x71b93(%rip), %rax     # 0x1c9740
movq (%rax,%rsi,8), %r10
leaq 0x214b04(%rip), %rax    # 0x36c6bc
movl (%rax), %eax
leaq 0x40136(%rip), %rsi     # 0x197cf7
movl %r11d, (%rsp)
movq %r10, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0x9550
movq -0x10(%rbp), %rdi
leaq 0x3c889(%rip), %rsi     # 0x194469
movb $0x0, %al
callq 0x9550
movq -0x10(%rbp), %rdi
leaq 0x4012b(%rip), %rsi     # 0x197d1d
movb $0x0, %al
callq 0x9550
movl $0x0, -0x18(%rbp)
cmpl $0x5a, -0x18(%rbp)
jg 0x157cbc
movl $0x0, -0x14(%rbp)
cmpl $0x168, -0x14(%rbp)     # imm = 0x168
jg 0x157cac
movslq -0x14(%rbp), %rcx
leaq 0x9a727(%rip), %rax     # 0x1f2350
imulq $0x16c, %rcx, %rcx      # imm = 0x16C
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x157c9c
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
movslq -0x14(%rbp), %rsi
leaq 0x7a5a7(%rip), %rax     # 0x1d2200
imulq $0x16c, %rsi, %rsi      # imm = 0x16C
addq %rsi, %rax
movslq -0x18(%rbp), %rsi
movss (%rax,%rsi,4), %xmm0
movslq -0x14(%rbp), %rsi
leaq 0x9a6d9(%rip), %rax     # 0x1f2350
imulq $0x16c, %rsi, %rsi      # imm = 0x16C
addq %rsi, %rax
movslq -0x18(%rbp), %rsi
divss (%rax,%rsi,4), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x40094(%rip), %rsi     # 0x197d29
movb $0x1, %al
callq 0x9550
jmp 0x157c9e
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x157c11
jmp 0x157cae
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x157c00
movq -0x10(%rbp), %rdi
callq 0x9380
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)