// File: st0ne[P]XReflectorPlus/dxrfd.cpp
// Function: check_heartbeat()
static void check_heartbeat()
{
   a_user_list_type::iterator pos;
   a_user_list_type::iterator temp_pos = a_user_list.end();
   struct a_user *a_user_ptr;
   blocks_type::iterator block_pos;
   char dropped = ' ';

   for (pos = a_user_list.begin(); pos != a_user_list.end(); pos++) 
   {
      a_user_ptr = (struct a_user *)pos->second;

      block_pos = blocks.find(a_user_ptr->call);
      
      if (block_pos == blocks.end())  /* not blocked */
      {
         sendto(srv_sock, OWNER, strlen(OWNER) + 1,
                0,(struct sockaddr *)&(a_user_ptr->sin),
                sizeof(struct sockaddr_in));

         if (a_user_ptr->countdown >= 0)
            a_user_ptr->countdown --;

         if (a_user_ptr->countdown < 0)
         {
            dropped = 't'; // timeout
            temp_pos = pos;
         }
      }
      else
      {
         dropped = 'b'; // blocked
         temp_pos = pos;
      }
   }

   if (temp_pos != a_user_list.end())
   {
      a_user_ptr = (struct a_user *)temp_pos->second;

      traceit("call=%s %s, removing %s\n",
              a_user_ptr->call,
              (dropped == 't')?"timeout":"blocked",
              temp_pos->first.c_str());

      free(temp_pos->second);
      temp_pos->second = NULL;
      a_user_list.erase(temp_pos);

      print_links_file();
   }

   return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
leaq -0x8(%rbp), %rdi
callq 0x13d50
leaq 0x11645(%rip), %rdi     # 0x1f380
callq 0x13dd0
movq %rax, -0x10(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x13370
movb $0x20, -0x21(%rbp)
leaq 0x11628(%rip), %rdi     # 0x1f380
callq 0x13d70
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
leaq 0x11610(%rip), %rdi     # 0x1f380
callq 0x13dd0
movq %rax, -0x38(%rbp)
leaq -0x8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x13da0
testb $0x1, %al
jne 0xdd8f
jmp 0xdf18
leaq -0x8(%rbp), %rdi
callq 0x13e00
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0x61(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x3520
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
leaq -0x60(%rbp), %rdi
callq 0x11f00
jmp 0xddd4
leaq 0x11605(%rip), %rdi     # 0x1f3e0
leaq -0x60(%rbp), %rsi
callq 0x14250
movq %rax, -0xb8(%rbp)
jmp 0xdded
movq -0xb8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x31e0
leaq -0x61(%rbp), %rdi
callq 0x3330
leaq 0x115c7(%rip), %rdi     # 0x1f3e0
callq 0x13480
movq %rax, -0x80(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x14720
testb $0x1, %al
jne 0xde38
jmp 0xdef3
movl 0x1149a(%rip), %eax     # 0x1f2d8
movl %eax, -0xbc(%rbp)
leaq 0x14d35(%rip), %rdi     # 0x22b80
callq 0x3150
movl -0xbc(%rbp), %edi
movq %rax, %rdx
addq $0x1, %rdx
movq -0x18(%rbp), %r8
addq $0xd0, %r8
leaq 0x14d11(%rip), %rsi     # 0x22b80
xorl %ecx, %ecx
movl $0x10, %r9d
callq 0x3080
movq -0x18(%rbp), %rax
movswl 0xe0(%rax), %eax
cmpl $0x0, %eax
jl 0xded5
movq -0x18(%rbp), %rax
movw 0xe0(%rax), %cx
addw $-0x1, %cx
movw %cx, 0xe0(%rax)
jmp 0xded5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0xdec7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x31e0
leaq -0x61(%rbp), %rdi
callq 0x3330
jmp 0xe01d
movq -0x18(%rbp), %rax
movswl 0xe0(%rax), %eax
cmpl $0x0, %eax
jge 0xdef1
movb $0x74, -0x21(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0xdeff
movb $0x62, -0x21(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0xdf01
leaq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x13e20
movq %rax, -0x88(%rbp)
jmp 0xdd69
leaq 0x11461(%rip), %rdi     # 0x1f380
callq 0x13dd0
movq %rax, -0x90(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x13da0
testb $0x1, %al
jne 0xdf44
jmp 0xe014
leaq -0x10(%rbp), %rdi
callq 0x13e00
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xc8(%rbp)
movsbl -0x21(%rbp), %eax
cmpl $0x74, %eax
jne 0xdf79
leaq 0x9d27(%rip), %rax      # 0x17c97
movq %rax, -0xd0(%rbp)
jmp 0xdf89
leaq 0x9d1f(%rip), %rax      # 0x17c9f
movq %rax, -0xd0(%rbp)
jmp 0xdf89
movq -0xd0(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x13e00
movq %rax, %rdi
callq 0x3140
movq -0xc8(%rbp), %rsi
movq -0xd8(%rbp), %rdx
movq %rax, %rcx
leaq 0x9cbe(%rip), %rdi      # 0x17c7e
movb $0x0, %al
callq 0x3820
leaq -0x10(%rbp), %rdi
callq 0x13e00
movq 0x20(%rax), %rdi
callq 0x3390
leaq -0x10(%rbp), %rdi
callq 0x13e00
movq $0x0, 0x20(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rsi
leaq 0x1137d(%rip), %rdi     # 0x1f380
callq 0x145a0
movq %rax, -0xa0(%rbp)
callq 0x5070
addq $0xe0, %rsp
popq %rbp
retq
movq -0x70(%rbp), %rdi
callq 0x3500
nopw %cs:(%rax,%rax)