// File: st0ne[P]XReflectorPlus/dxrfd.cpp
// Function: print_links_file()
static void print_links_file()
{
   inbound_type::iterator inbound_pos;
   inbound *inbound_ptr;

   a_user_list_type::iterator pos;
   struct a_user *a_user_ptr;
   struct tm tm;
   short int i, j;
   char from_mod = ' ';

   statusfp = fopen(STATUS_FILE, "w");
   if (!statusfp)
         traceit("Failed to create status file %s\n", STATUS_FILE);
   else
   {
      setvbuf(statusfp, (char *)NULL, _IOLBF, 0);
      for (pos = a_user_list.begin(); pos != a_user_list.end(); pos++)
      {
         a_user_ptr = (struct a_user *)pos->second;
         for (i = 0; i < 5; i++)
         {
            for (j = 0; j < 4; j++)
            {
               if (a_user_ptr->rpt_mods[i][j] != '\0')
               {
                  if (i == 0)
                     from_mod = 'A';
                  else
                  if (i == 1)
                     from_mod = 'B';
                  else
                  if (i == 2)
                     from_mod = 'C';
                  else
                  if (i == 3)
                     from_mod = 'D';
                  else
                     from_mod = 'E';

               localtime_r(&(a_user_ptr->link_time[i][j]),&tm);
               fprintf(statusfp, "%c,%s,%c,%s,%02d%02d%02d,%02d:%02d:%02d\n",
                       from_mod,
                       a_user_ptr->call, 
                       a_user_ptr->rpt_mods[i][j],
                       pos->first.c_str(),
                       tm.tm_mon+1,tm.tm_mday,tm.tm_year % 100,
                       tm.tm_hour,tm.tm_min,tm.tm_sec);
               }
            }
         }
      }

      for (inbound_pos = inbound_list.begin(); inbound_pos != inbound_list.end(); inbound_pos++)
      {
         inbound_ptr = (inbound *)inbound_pos->second;
         for (i = 0; i < 5; i++)
         {
            if (inbound_ptr->links[i] != ' ')
            {
               if (i == 0)
                  from_mod = 'A';
               else
               if (i == 1)
                  from_mod = 'B';
               else
               if (i == 2)
                  from_mod = 'C';
               else
               if (i == 3)
                  from_mod = 'D';
               else
                  from_mod = 'E';

               localtime_r(&(inbound_ptr->connect_time), &tm);
               fprintf(statusfp, "%c,%s,%c,%s,%02d%02d%02d,%02d:%02d:%02d\n",
                  from_mod,
                  inbound_ptr->call,
                  inbound_ptr->links[i],
                  inbound_pos->first.c_str(),
                  tm.tm_mon+1,tm.tm_mday,tm.tm_year % 100,
                  tm.tm_hour,tm.tm_min,tm.tm_sec);
            }
         }
      }
      fclose(statusfp);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xf8, %rsp
leaq -0x20(%rbp), %rdi
callq 0x10840
leaq -0x30(%rbp), %rdi
callq 0x13d50
movb $0x20, -0x75(%rbp)
leaq 0x1cad3(%rip), %rdi     # 0x21b70
leaq 0x12107(%rip), %rsi     # 0x171ab
callq 0x3380
movq %rax, 0x1dac8(%rip)     # 0x22b78
cmpq $0x0, 0x1dac0(%rip)     # 0x22b78
jne 0x50d4
leaq 0x1255d(%rip), %rdi     # 0x1761e
leaq 0x1caa8(%rip), %rsi     # 0x21b70
movb $0x0, %al
callq 0x3820
jmp 0x54c4
movq 0x1da9d(%rip), %rdi     # 0x22b78
xorl %eax, %eax
movl %eax, %ecx
movl $0x1, %edx
movq %rcx, %rsi
callq 0x3030
leaq 0x1a28d(%rip), %rdi     # 0x1f380
callq 0x13d70
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0x1a275(%rip), %rdi     # 0x1f380
callq 0x13dd0
movq %rax, -0x88(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x13da0
testb $0x1, %al
jne 0x5130
jmp 0x52fd
leaq -0x30(%rbp), %rdi
callq 0x13e00
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
movw $0x0, -0x72(%rbp)
movswl -0x72(%rbp), %eax
cmpl $0x5, %eax
jge 0x52e4
movw $0x0, -0x74(%rbp)
movswl -0x74(%rbp), %eax
cmpl $0x4, %eax
jge 0x52d1
movq -0x38(%rbp), %rax
addq $0x18, %rax
movswq -0x72(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movswq -0x74(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x52be
movswl -0x72(%rbp), %eax
cmpl $0x0, %eax
jne 0x519c
movb $0x41, -0x75(%rbp)
jmp 0x51d3
movswl -0x72(%rbp), %eax
cmpl $0x1, %eax
jne 0x51ab
movb $0x42, -0x75(%rbp)
jmp 0x51d1
movswl -0x72(%rbp), %eax
cmpl $0x2, %eax
jne 0x51ba
movb $0x43, -0x75(%rbp)
jmp 0x51cf
movswl -0x72(%rbp), %eax
cmpl $0x3, %eax
jne 0x51c9
movb $0x44, -0x75(%rbp)
jmp 0x51cd
movb $0x45, -0x75(%rbp)
jmp 0x51cf
jmp 0x51d1
jmp 0x51d3
movq -0x38(%rbp), %rdi
addq $0x30, %rdi
movswq -0x72(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
movswq -0x74(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
leaq -0x70(%rbp), %rsi
callq 0x3190
movq 0x1d975(%rip), %rax     # 0x22b78
movq %rax, -0xc0(%rbp)
movsbl -0x75(%rbp), %eax
movl %eax, -0xac(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x38(%rbp), %rax
addq $0x18, %rax
movswq -0x72(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movswq -0x74(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0xb0(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x13e00
movq %rax, %rdi
callq 0x3140
movq -0xc0(%rbp), %rdi
movq -0xb8(%rbp), %rcx
movl -0xb0(%rbp), %r8d
movq %rax, %r9
movl -0x60(%rbp), %r15d
addl $0x1, %r15d
movl -0x64(%rbp), %r14d
movl -0x5c(%rbp), %eax
movl $0x64, %esi
cltd
idivl %esi
movl %edx, %ebx
movl -0xac(%rbp), %edx
movl -0x68(%rbp), %r11d
movl -0x6c(%rbp), %r10d
movl -0x70(%rbp), %eax
leaq 0x123a3(%rip), %rsi     # 0x1763f
movl %r15d, (%rsp)
movl %r14d, 0x8(%rsp)
movl %ebx, 0x10(%rsp)
movl %r11d, 0x18(%rsp)
movl %r10d, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movb $0x0, %al
callq 0x3470
jmp 0x52c0
movw -0x74(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x74(%rbp)
jmp 0x515a
jmp 0x52d3
movw -0x72(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x72(%rbp)
jmp 0x5147
jmp 0x52e6
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x13e20
movq %rax, -0x90(%rbp)
jmp 0x5104
leaq 0x1a04c(%rip), %rdi     # 0x1f350
callq 0x10860
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x1a02e(%rip), %rdi     # 0x1f350
callq 0x108c0
movq %rax, -0xa0(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x10890
testb $0x1, %al
jne 0x5347
jmp 0x54b8
leaq -0x20(%rbp), %rdi
callq 0x108f0
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
movw $0x0, -0x72(%rbp)
movswl -0x72(%rbp), %eax
cmpl $0x5, %eax
jge 0x549f
movq -0x28(%rbp), %rax
movswq -0x72(%rbp), %rcx
movsbl 0x2c(%rax,%rcx), %eax
cmpl $0x20, %eax
je 0x548c
movswl -0x72(%rbp), %eax
cmpl $0x0, %eax
jne 0x5391
movb $0x41, -0x75(%rbp)
jmp 0x53c8
movswl -0x72(%rbp), %eax
cmpl $0x1, %eax
jne 0x53a0
movb $0x42, -0x75(%rbp)
jmp 0x53c6
movswl -0x72(%rbp), %eax
cmpl $0x2, %eax
jne 0x53af
movb $0x43, -0x75(%rbp)
jmp 0x53c4
movswl -0x72(%rbp), %eax
cmpl $0x3, %eax
jne 0x53be
movb $0x44, -0x75(%rbp)
jmp 0x53c2
movb $0x45, -0x75(%rbp)
jmp 0x53c4
jmp 0x53c6
jmp 0x53c8
movq -0x28(%rbp), %rdi
addq $0x10, %rdi
leaq -0x70(%rbp), %rsi
callq 0x3190
movq 0x1d798(%rip), %rax     # 0x22b78
movq %rax, -0xd8(%rbp)
movsbl -0x75(%rbp), %eax
movl %eax, -0xc4(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x28(%rbp), %rax
movswq -0x72(%rbp), %rcx
movsbl 0x2c(%rax,%rcx), %eax
movl %eax, -0xc8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x108f0
movq %rax, %rdi
callq 0x3140
movq -0xd8(%rbp), %rdi
movq -0xd0(%rbp), %rcx
movl -0xc8(%rbp), %r8d
movq %rax, %r9
movl -0x60(%rbp), %r15d
addl $0x1, %r15d
movl -0x64(%rbp), %r14d
movl -0x5c(%rbp), %eax
movl $0x64, %esi
cltd
idivl %esi
movl %edx, %ebx
movl -0xc4(%rbp), %edx
movl -0x68(%rbp), %r11d
movl -0x6c(%rbp), %r10d
movl -0x70(%rbp), %eax
leaq 0x121d5(%rip), %rsi     # 0x1763f
movl %r15d, (%rsp)
movl %r14d, 0x8(%rsp)
movl %ebx, 0x10(%rsp)
movl %r11d, 0x18(%rsp)
movl %r10d, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movb $0x0, %al
callq 0x3470
jmp 0x548e
movw -0x72(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x72(%rbp)
jmp 0x535e
jmp 0x54a1
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x10910
movq %rax, -0xa8(%rbp)
jmp 0x531b
movq 0x1d6b9(%rip), %rdi     # 0x22b78
callq 0x32d0
addq $0xf8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)