// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq 0xf498(%rip), %rdi      # 0x12ae0
leaq 0x7b92(%rip), %rsi      # 0xb1e1
callq 0x22b0
movq %rax, 0x1048d(%rip)     # 0x13ae8
testq %rax, %rax
je 0x3883
pushq $0x1
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x2030
movq 0xcc8e(%rip), %rbx      # 0x10308
leaq 0xcc77(%rip), %rax      # 0x102f8
cmpq %rax, %rbx
je 0x378c
movq 0x40(%rbx), %rax
leaq 0x18(%rax), %r14
movq %rax, 0x28(%rsp)
leaq 0x30(%rax), %r13
xorl %eax, %eax
cmpq $0x5, %rax
je 0x377c
movzwl %ax, %ecx
addl $0x41, %ecx
movq %rax, 0x18(%rsp)
cmpq $0x4, %rax
pushq $0x45
popq %rax
cmovael %eax, %ecx
movl %ecx, (%rsp)
movq %r13, 0x20(%rsp)
xorl %r15d, %r15d
cmpq $0x4, %r15
je 0x3762
cmpb $0x0, (%r14,%r15)
je 0x3756
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
callq 0x2150
movq 0x103fc(%rip), %rdi     # 0x13ae8
movsbl (%r14,%r15), %r8d
movq 0x20(%rbx), %r9
movl 0x40(%rsp), %r11d
incl %r11d
movl 0x3c(%rsp), %eax
movq %rax, 0x10(%rsp)
movl 0x44(%rsp), %eax
cltd
pushq $0x64
popq %rcx
idivl %ecx
movq %rdx, 0x8(%rsp)
movl 0x38(%rsp), %r12d
movl 0x30(%rsp), %ebp
movq %r14, %r10
movq %rbx, %r14
movl 0x34(%rsp), %ebx
leaq 0x7f46(%rip), %rsi      # 0xb675
movl (%rsp), %edx
movq 0x28(%rsp), %rcx
xorl %eax, %eax
pushq %rbp
pushq %rbx
movq %r14, %rbx
movq %r10, %r14
pushq %r12
pushq 0x20(%rsp)
pushq 0x30(%rsp)
pushq %r11
callq 0x2380
addq $0x30, %rsp
incq %r15
addq $0x8, %r13
jmp 0x36c7
movq 0x18(%rsp), %rax
incq %rax
movq 0x20(%rsp), %r13
addq $0x20, %r13
addq $0x4, %r14
jmp 0x369d
movq %rbx, %rdi
callq 0x2190
movq %rax, %rbx
jmp 0x367a
movq 0xcb45(%rip), %r14      # 0x102d8
leaq 0xcb2e(%rip), %rax      # 0x102c8
cmpq %rax, %r14
je 0x3868
movq 0x40(%r14), %r12
leaq 0x10(%r12), %rax
movq %rax, (%rsp)
xorl %ebx, %ebx
cmpq $0x5, %rbx
je 0x3858
cmpb $0x20, 0x2c(%r12,%rbx)
je 0x3850
leal 0x41(%rbx), %ebp
cmpq $0x4, %rbx
pushq $0x45
popq %rax
cmovael %eax, %ebp
movq (%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x2150
movq 0x102fe(%rip), %rdi     # 0x13ae8
movsbl 0x2c(%r12,%rbx), %r8d
movq 0x20(%r14), %r9
movl 0x40(%rsp), %r11d
incl %r11d
movl 0x3c(%rsp), %eax
movq %rax, 0x10(%rsp)
movl 0x44(%rsp), %eax
cltd
pushq $0x64
popq %rcx
idivl %ecx
movq %rdx, 0x8(%rsp)
movq %r14, %r10
movl 0x38(%rsp), %r14d
movl 0x30(%rsp), %r13d
movl 0x34(%rsp), %r15d
leaq 0x7e48(%rip), %rsi      # 0xb675
movl %ebp, %edx
movq %r12, %rcx
xorl %eax, %eax
pushq %r13
pushq %r15
pushq %r14
movq %r10, %r14
pushq 0x20(%rsp)
pushq 0x30(%rsp)
pushq %r11
callq 0x2380
addq $0x30, %rsp
incq %rbx
jmp 0x37b2
movq %r14, %rdi
callq 0x2190
movq %rax, %r14
jmp 0x3793
movq 0x10279(%rip), %rdi     # 0x13ae8
callq 0x2230
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7dca(%rip), %rdi      # 0xb654
leaq 0xf24f(%rip), %rsi      # 0x12ae0
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x274c