// File: /workspace/github_cpp_makefile_star2_O3/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 0x10159(%rip), %rdi     # 0x13ac0
leaq 0x88f3(%rip), %rsi      # 0xc261
callq 0x2270
movq %rax, 0x1114e(%rip)     # 0x14ac8
testq %rax, %rax
je 0x3bbe
movq %rax, %rdi
xorl %esi, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x2030
movq 0xd94d(%rip), %rbx      # 0x112e8
leaq 0xd936(%rip), %rax      # 0x112d8
cmpq %rax, %rbx
je 0x3abb
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 0x3a7b
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
callq 0x2130
movq 0x110c4(%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 0x8ca1(%rip), %rsi      # 0xc6f5
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 0x39e5
movq 0x18(%rsp), %rax
incq %rax
movq 0x20(%rsp), %r13
addq $0x20, %r13
addq $0x4, %r14
cmpq $0x5, %rax
jne 0x39c2
movq %rbx, %rdi
callq 0x2170
movq %rax, %rbx
jmp 0x399b
movq 0xd7f6(%rip), %r12      # 0x112b8
leaq 0xd7df(%rip), %rax      # 0x112a8
cmpq %rax, %r12
je 0x3ba3
movq 0x40(%r12), %r13
leaq 0x10(%r13), %rax
movq %rax, (%rsp)
xorl %r14d, %r14d
cmpb $0x20, 0x2c(%r13,%r14)
je 0x3b86
leal 0x41(%r14), %ebp
cmpq $0x4, %r14
movl $0x45, %eax
cmovael %eax, %ebp
movq (%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x2130
movq 0x10fb5(%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 0x8b8e(%rip), %rsi      # 0xc6f5
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 0x3ae2
movq %r12, %rdi
callq 0x2170
movq %rax, %r12
jmp 0x3ac2
movq 0x10f1e(%rip), %rdi     # 0x14ac8
callq 0x2200
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8b0f(%rip), %rdi      # 0xc6d4
leaq 0xfef4(%rip), %rsi      # 0x13ac0
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x26fc