// File: /workspace/github_cpp_makefile_star2_O1/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 0x10277(%rip), %rdi     # 0x13ac0
leaq 0x89e5(%rip), %rsi      # 0xc235
callq 0x2270
movq %rax, 0x1126c(%rip)     # 0x14ac8
testq %rax, %rax
je 0x3aa0
movq %rax, %rdi
xorl %esi, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x2030
movq 0xda6b(%rip), %rbx      # 0x112e8
leaq 0xda54(%rip), %rax      # 0x112d8
cmpq %rax, %rbx
je 0x399d
movq 0x40(%rbx), %rax
leaq 0x18(%rax), %r14
movq %rax, (%rsp)
leaq 0x30(%rax), %r13
xorl %eax, %eax
movq %rbx, 0x28(%rsp)
movzwl %ax, %ecx
addl $0x41, %ecx
movq %rax, 0x18(%rsp)
cmpq $0x4, %rax
movl $0x45, %eax
cmovael %eax, %ecx
movl %ecx, 0x8(%rsp)
movq %r13, 0x20(%rsp)
xorl %r15d, %r15d
cmpb $0x0, (%r14,%r15)
je 0x395d
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
callq 0x2130
movq 0x111e2(%rip), %rdi     # 0x14ac8
movsbl (%r14,%r15), %r8d
movq 0x20(%rbx), %r9
movl 0x40(%rsp), %r10d
incl %r10d
movl 0x3c(%rsp), %eax
movq %rax, 0x10(%rsp)
movslq 0x44(%rsp), %rbx
imulq $0x51eb851f, %rbx, %rax # imm = 0x51EB851F
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
imull $0x64, %eax, %eax
subl %eax, %ebx
movl 0x38(%rsp), %r12d
movl 0x30(%rsp), %ebp
movq %r14, %r11
movl 0x34(%rsp), %r14d
leaq 0x8d93(%rip), %rsi      # 0xc6c9
movl 0x8(%rsp), %edx
movq (%rsp), %rcx
xorl %eax, %eax
pushq %rbp
pushq %r14
movq %r11, %r14
pushq %r12
pushq %rbx
movq 0x48(%rsp), %rbx
pushq 0x30(%rsp)
pushq %r10
callq 0x2340
addq $0x30, %rsp
incq %r15
addq $0x8, %r13
cmpq $0x4, %r15
jne 0x38c7
movq 0x18(%rsp), %rax
incq %rax
addq $0x4, %r14
movq 0x20(%rsp), %r13
addq $0x20, %r13
cmpq $0x5, %rax
jne 0x38a4
movq %rbx, %rdi
callq 0x2170
movq %rax, %rbx
jmp 0x387d
movq 0xd914(%rip), %r12      # 0x112b8
leaq 0xd8fd(%rip), %rax      # 0x112a8
cmpq %rax, %r12
je 0x3a85
movq 0x40(%r12), %r13
leaq 0x10(%r13), %rax
movq %rax, (%rsp)
xorl %r14d, %r14d
cmpb $0x20, 0x2c(%r13,%r14)
je 0x3a68
leal 0x41(%r14), %ebp
cmpq $0x4, %r14
movl $0x45, %eax
cmovael %eax, %ebp
movq (%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x2130
movq 0x110d3(%rip), %rdi     # 0x14ac8
movsbl 0x2c(%r13,%r14), %r8d
movq 0x20(%r12), %r9
movl 0x40(%rsp), %r10d
incl %r10d
movl 0x3c(%rsp), %eax
movq %rax, 0x10(%rsp)
movslq 0x44(%rsp), %r15
imulq $0x51eb851f, %r15, %rax # imm = 0x51EB851F
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
imull $0x64, %eax, %eax
subl %eax, %r15d
movl 0x38(%rsp), %eax
movq %rax, 0x8(%rsp)
movl 0x30(%rsp), %ebx
movl 0x34(%rsp), %r11d
leaq 0x8c80(%rip), %rsi      # 0xc6c9
movl %ebp, %edx
movq %r13, %rcx
xorl %eax, %eax
pushq %rbx
pushq %r11
pushq 0x18(%rsp)
pushq %r15
pushq 0x30(%rsp)
pushq %r10
callq 0x2340
addq $0x30, %rsp
incq %r14
cmpq $0x5, %r14
jne 0x39c4
movq %r12, %rdi
callq 0x2170
movq %rax, %r12
jmp 0x39a4
movq 0x1103c(%rip), %rdi     # 0x14ac8
callq 0x2200
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8c01(%rip), %rdi      # 0xc6a8
leaq 0x10012(%rip), %rsi     # 0x13ac0
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x26fc