// File: st0ne[P]XReflectorPlus/dxrfd.cpp
// Function: link_to_ref(char*)
static int link_to_ref(char *call)
{
   char payload[MAXHOSTNAMELEN + 1];

   /* IP-port */
   char search_value[MAXHOSTNAMELEN + 7];

   inbound_type::iterator inbound_pos;
   inbound *inbound_ptr;
   pair<inbound_type::iterator,bool> inbound_insert_pair;
   struct sockaddr_in sin;
   unsigned char queryCommand[56];
   unsigned short j;

   char local_mod = ' ';
   char ref[CALL_SIZE + 1];
   char remote_mod = ' ';

   local_mod = call[0];

   if ((local_mod != 'A') && (local_mod != 'B') && 
       (local_mod != 'C') && (local_mod != 'D')) 
   {
      traceit("Invalid local module %c for linking\n", local_mod);
      return -1;
   }

   memset(ref, ' ', sizeof(ref));
   memcpy(ref, call + 1, 6);
   ref[8] = '\0'; 

   /* Is it blocked ? */
   if (blocks.find(ref) != blocks.end())
      return -1;

   if ((memcmp(ref, "REF", 3) != 0) && (memcmp(ref, "XRF", 3) != 0))
   {
      traceit("XRF or REF only\n");
      return -1;
   }

   if (strcmp(ref, OWNER) == 0)
   {
      traceit("Can not link to itself\n");
      return -1;
   }

   remote_mod = call[7];
   if ((remote_mod != 'A') && (remote_mod != 'B') && (remote_mod != 'C') && 
       (remote_mod != 'D') && (remote_mod != 'X'))
   {
      traceit("Invalid remote module %c\n", remote_mod);
      return -1;
   }

   payload[0] = '\0';
   /* get the IP address from database */
   if (!get_ip(ref, payload))
      return -1;

   /* No IP in db? */
   if (payload[0] == '\0')
   {
      traceit("No host or IP address for %s\n", ref);
      return -1;
   }

   if (strcmp(payload, "0.0.0.0") == 0)
   {
      traceit("Invalid IP in db\n");
      return -1;
   }

   if (memcmp(ref, "XRF", 3) == 0)
   {
      return link_to_xrf(local_mod, ref, remote_mod, payload);
   }

   /* Is it already linked? */
   sprintf(search_value, "%s-20001", payload);

   inbound_pos = inbound_list.find(search_value);
   if (inbound_pos != inbound_list.end())
   {
      inbound_ptr = (inbound *)inbound_pos->second;
      if (!inbound_ptr->is_ref)
      {
         traceit("This connection is not a reflector\n");
         return -1;
      }

      /* update the links */
      if (remote_mod == 'X')
         remote_mod = ' ';
      else
      if ((inbound_ptr->links[0] == remote_mod) ||
          (inbound_ptr->links[1] == remote_mod) ||
          (inbound_ptr->links[2] == remote_mod) ||
          (inbound_ptr->links[3] == remote_mod) ||
          (inbound_ptr->links[4] == remote_mod))
      {
         traceit ("Already set or duplicate assignment\n");
         return 0;
      }

      if (local_mod == 'A')
         inbound_ptr->links[0] = remote_mod;
      else
      if (local_mod == 'B')
         inbound_ptr->links[1] = remote_mod;
      else
      if (local_mod == 'C')
         inbound_ptr->links[2] = remote_mod;
      else
      if (local_mod == 'D')
         inbound_ptr->links[3] = remote_mod;
      else
         inbound_ptr->links[4] = remote_mod;

      if ((inbound_ptr->links[0] == ' ') && 
          (inbound_ptr->links[1] == ' ') &&
          (inbound_ptr->links[2] == ' ') &&
          (inbound_ptr->links[3] == ' ') &&
          (inbound_ptr->links[4] == ' '))
          
      {
         /* all links removed, disconnect from remote system */

         traceit("All links removed, disconnecting from %s\n", inbound_ptr->call);
         refbuf[0] = 5;
         refbuf[1] = 0;
         refbuf[2] = 24;
         refbuf[3] = 0;
         refbuf[4] = 0;
         sendto(ref_sock,(char *)refbuf,5,0,
                (struct sockaddr *)&(inbound_ptr->sin),
                sizeof(struct sockaddr_in));

         free(inbound_pos->second);
         inbound_pos->second = NULL;
         inbound_list.erase(inbound_pos);
      } 
      print_links_file();
      return 0;
   }

   if (remote_mod == 'X')
   {
      traceit("X can not be used, there is no connection to unlink\n");
      return -1;
   }

   if ((inbound_list.size() + 1) > MAX_OTHER_USERS)
   {
      traceit("Over the MAX_OTHER_USERS limit of %d\n", MAX_OTHER_USERS);
      return -1;
   }

   sin.sin_family = AF_INET;
   sin.sin_addr.s_addr = inet_addr(payload);
   sin.sin_port = htons(20001);
  
   /* assume that we will be ok */
   inbound_ptr = (inbound *)malloc(sizeof(inbound));
   if (inbound_ptr)
   {
      inbound_ptr->countdown = TIMEOUT;
      memcpy((char *)&(inbound_ptr->sin),(char *)&sin, sizeof(struct sockaddr_in));
      strcpy(inbound_ptr->call, ref);
      time(&(inbound_ptr->connect_time));
      inbound_ptr->isMute = false;
      inbound_ptr->mod = ' ';
      inbound_ptr->is_ref = true;
      inbound_ptr->links[0] = inbound_ptr->links[1] = inbound_ptr->links[2] = inbound_ptr->links[3] = inbound_ptr->links[4] = ' '; 
      if (local_mod == 'A')
         inbound_ptr->links[0] = remote_mod;
      else
      if (local_mod == 'B')
         inbound_ptr->links[1] = remote_mod;
      else
      if (local_mod == 'C')
         inbound_ptr->links[2] = remote_mod;
      else
      if (local_mod == 'D')
         inbound_ptr->links[3] = remote_mod;
      else
         inbound_ptr->links[4] = remote_mod;

      strcpy(inbound_ptr->serial, "REF     ");

      inbound_insert_pair = inbound_list.insert(pair<string, inbound *>(search_value, inbound_ptr));
      if (inbound_insert_pair.second)
      {
         traceit("new CALL=%s,REPEATER,ip=%s, users=%d\n",
                  inbound_ptr->call,search_value,inbound_list.size() + a_user_list.size());

         /* request to connect */
         queryCommand[0] = 5;
         queryCommand[1] = 0;
         queryCommand[2] = 24;
         queryCommand[3] = 0;
         queryCommand[4] = 1;
         for (j = 0; j < 2; j++)
            sendto(ref_sock,(char *)queryCommand,5,0,
                   (struct sockaddr *)&(inbound_ptr->sin),
                   sizeof(struct sockaddr_in));

         print_links_file();
      }
      else
      {
         traceit("failed to add CALL=%s,ip=%s\n",inbound_ptr->call,search_value);
         free(inbound_ptr);
         inbound_ptr = NULL;
         return -1;
      }
   }
   else
   {
      traceit("malloc() failed for call=%s,ip=%s\n",ref,search_value);
      return -1;
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
movq %rdi, -0x10(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x10840
leaq -0xd0(%rbp), %rdi
callq 0x13f10
movb $0x20, -0x123(%rbp)
movb $0x20, -0x131(%rbp)
movq -0x10(%rbp), %rax
movb (%rax), %al
movb %al, -0x123(%rbp)
movsbl -0x123(%rbp), %eax
cmpl $0x41, %eax
je 0xf752
movsbl -0x123(%rbp), %eax
cmpl $0x42, %eax
je 0xf752
movsbl -0x123(%rbp), %eax
cmpl $0x43, %eax
je 0xf752
movsbl -0x123(%rbp), %eax
cmpl $0x44, %eax
je 0xf752
movsbl -0x123(%rbp), %esi
leaq 0x872b(%rip), %rdi      # 0x17e6a
movb $0x0, %al
callq 0x3820
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x101df
movabsq $0x2020202020202020, %rax # imm = 0x2020202020202020
movq %rax, -0x130(%rbp)
movb $0x20, -0x128(%rbp)
movq -0x10(%rbp), %rax
movw 0x5(%rax), %cx
movw %cx, -0x12c(%rbp)
movl 0x1(%rax), %eax
movl %eax, -0x130(%rbp)
movb $0x0, -0x128(%rbp)
leaq -0x161(%rbp), %rdi
movq %rdi, -0x218(%rbp)
callq 0x3520
movq -0x218(%rbp), %rdx
leaq -0x160(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x11f00
jmp 0xf7b8
leaq 0xfc21(%rip), %rdi      # 0x1f3e0
leaq -0x160(%rbp), %rsi
callq 0x14250
movq %rax, -0x220(%rbp)
jmp 0xf7d4
movq -0x220(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq 0xfbf7(%rip), %rdi      # 0x1f3e0
callq 0x13480
movq %rax, -0x180(%rbp)
leaq -0x140(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x13450
movb %al, -0x221(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x31e0
leaq -0x161(%rbp), %rdi
callq 0x3330
movb -0x221(%rbp), %al
testb $0x1, %al
jne 0xf832
jmp 0xf881
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x101df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x170(%rbp)
movl %eax, -0x174(%rbp)
jmp 0xf870
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x170(%rbp)
movl %eax, -0x174(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x31e0
leaq -0x161(%rbp), %rdi
callq 0x3330
jmp 0x101eb
leaq -0x130(%rbp), %rdi
leaq 0x8600(%rip), %rsi      # 0x17e8f
movl $0x3, %edx
callq 0x3170
cmpl $0x0, %eax
je 0xf8d5
leaq -0x130(%rbp), %rdi
leaq 0x7998(%rip), %rsi      # 0x17244
movl $0x3, %edx
callq 0x3170
cmpl $0x0, %eax
je 0xf8d5
leaq 0x85d1(%rip), %rdi      # 0x17e93
movb $0x0, %al
callq 0x3820
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x101df
leaq -0x130(%rbp), %rdi
leaq 0x1329d(%rip), %rsi     # 0x22b80
callq 0x3460
cmpl $0x0, %eax
jne 0xf907
leaq 0x85b0(%rip), %rdi      # 0x17ea4
movb $0x0, %al
callq 0x3820
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x101df
movq -0x10(%rbp), %rax
movb 0x7(%rax), %al
movb %al, -0x131(%rbp)
movsbl -0x131(%rbp), %eax
cmpl $0x41, %eax
je 0xf971
movsbl -0x131(%rbp), %eax
cmpl $0x42, %eax
je 0xf971
movsbl -0x131(%rbp), %eax
cmpl $0x43, %eax
je 0xf971
movsbl -0x131(%rbp), %eax
cmpl $0x44, %eax
je 0xf971
movsbl -0x131(%rbp), %eax
cmpl $0x58, %eax
je 0xf971
movsbl -0x131(%rbp), %esi
leaq 0x855e(%rip), %rdi      # 0x17ebc
movb $0x0, %al
callq 0x3820
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x101df
movb $0x0, -0x60(%rbp)
leaq -0x130(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x10200
testb $0x1, %al
jne 0xf995
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x101df
movsbl -0x60(%rbp), %eax
cmpl $0x0, %eax
jne 0xf9bf
leaq -0x130(%rbp), %rsi
leaq 0x852a(%rip), %rdi      # 0x17ed6
movb $0x0, %al
callq 0x3820
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x101df
leaq -0x60(%rbp), %rdi
leaq 0x852a(%rip), %rsi      # 0x17ef4
callq 0x3460
cmpl $0x0, %eax
jne 0xf9ee
leaq 0x8521(%rip), %rdi      # 0x17efc
movb $0x0, %al
callq 0x3820
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x101df
leaq -0x130(%rbp), %rdi
leaq 0x7848(%rip), %rsi      # 0x17244
movl $0x3, %edx
callq 0x3170
cmpl $0x0, %eax
jne 0xfa35
movb -0x123(%rbp), %dl
leaq -0x130(%rbp), %rsi
movb -0x131(%rbp), %al
leaq -0x60(%rbp), %rcx
movsbl %dl, %edi
movsbl %al, %edx
callq 0x103c0
movl %eax, -0x4(%rbp)
jmp 0x101df
leaq 0x84d2(%rip), %rsi      # 0x17f0e
xorl %eax, %eax
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x238(%rbp)
leaq -0x60(%rbp), %rdx
callq 0x30d0
leaq -0x1a9(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x3520
movq -0x238(%rbp), %rsi
movq -0x230(%rbp), %rdx
leaq -0x1a8(%rbp), %rdi
callq 0x11f00
jmp 0xfa84
leaq 0xf8c5(%rip), %rdi      # 0x1f350
leaq -0x1a8(%rbp), %rsi
callq 0x14090
movq %rax, -0x240(%rbp)
jmp 0xfaa0
movq -0x240(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x31e0
leaq -0x1a9(%rbp), %rdi
callq 0x3330
leaq 0xf875(%rip), %rdi      # 0x1f350
callq 0x108c0
movq %rax, -0x1b8(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x10890
testb $0x1, %al
jne 0xfb03
jmp 0xfddc
leaq -0xb8(%rbp), %rdi
callq 0x108f0
movq 0x20(%rax), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
testb $0x1, 0x2b(%rax)
jne 0xfb84
leaq 0x83e9(%rip), %rdi      # 0x17f17
movb $0x0, %al
callq 0x3820
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x101df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x170(%rbp)
movl %eax, -0x174(%rbp)
jmp 0xfb73
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x170(%rbp)
movl %eax, -0x174(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x31e0
leaq -0x1a9(%rbp), %rdi
callq 0x3330
jmp 0x101eb
movsbl -0x131(%rbp), %eax
cmpl $0x58, %eax
jne 0xfb9c
movb $0x20, -0x131(%rbp)
jmp 0xfc26
movq -0xc0(%rbp), %rax
movsbl 0x2c(%rax), %eax
movsbl -0x131(%rbp), %ecx
cmpl %ecx, %eax
je 0xfc0a
movq -0xc0(%rbp), %rax
movsbl 0x2d(%rax), %eax
movsbl -0x131(%rbp), %ecx
cmpl %ecx, %eax
je 0xfc0a
movq -0xc0(%rbp), %rax
movsbl 0x2e(%rax), %eax
movsbl -0x131(%rbp), %ecx
cmpl %ecx, %eax
je 0xfc0a
movq -0xc0(%rbp), %rax
movsbl 0x2f(%rax), %eax
movsbl -0x131(%rbp), %ecx
cmpl %ecx, %eax
je 0xfc0a
movq -0xc0(%rbp), %rax
movsbl 0x30(%rax), %eax
movsbl -0x131(%rbp), %ecx
cmpl %ecx, %eax
jne 0xfc24
leaq 0x832a(%rip), %rdi      # 0x17f3b
movb $0x0, %al
callq 0x3820
movl $0x0, -0x4(%rbp)
jmp 0x101df
jmp 0xfc26
movsbl -0x123(%rbp), %eax
cmpl $0x41, %eax
jne 0xfc44
movb -0x131(%rbp), %cl
movq -0xc0(%rbp), %rax
movb %cl, 0x2c(%rax)
jmp 0xfcb4
movsbl -0x123(%rbp), %eax
cmpl $0x42, %eax
jne 0xfc62
movb -0x131(%rbp), %cl
movq -0xc0(%rbp), %rax
movb %cl, 0x2d(%rax)
jmp 0xfcb2
movsbl -0x123(%rbp), %eax
cmpl $0x43, %eax
jne 0xfc80
movb -0x131(%rbp), %cl
movq -0xc0(%rbp), %rax
movb %cl, 0x2e(%rax)
jmp 0xfcb0
movsbl -0x123(%rbp), %eax
cmpl $0x44, %eax
jne 0xfc9e
movb -0x131(%rbp), %cl
movq -0xc0(%rbp), %rax
movb %cl, 0x2f(%rax)
jmp 0xfcae
movb -0x131(%rbp), %cl
movq -0xc0(%rbp), %rax
movb %cl, 0x30(%rax)
jmp 0xfcb0
jmp 0xfcb2
jmp 0xfcb4
movq -0xc0(%rbp), %rax
movsbl 0x2c(%rax), %eax
cmpl $0x20, %eax
jne 0xfdcb
movq -0xc0(%rbp), %rax
movsbl 0x2d(%rax), %eax
cmpl $0x20, %eax
jne 0xfdcb
movq -0xc0(%rbp), %rax
movsbl 0x2e(%rax), %eax
cmpl $0x20, %eax
jne 0xfdcb
movq -0xc0(%rbp), %rax
movsbl 0x2f(%rax), %eax
cmpl $0x20, %eax
jne 0xfdcb
movq -0xc0(%rbp), %rax
movsbl 0x30(%rax), %eax
cmpl $0x20, %eax
jne 0xfdcb
movq -0xc0(%rbp), %rsi
leaq 0x823a(%rip), %rdi      # 0x17f60
movb $0x0, %al
callq 0x3820
movb $0x5, 0x11a3c(%rip)     # 0x21770
movb $0x0, 0x11a36(%rip)     # 0x21771
movb $0x18, 0x11a30(%rip)    # 0x21772
movb $0x0, 0x11a2a(%rip)     # 0x21773
movb $0x0, 0x11a24(%rip)     # 0x21774
movl 0xf58a(%rip), %edi      # 0x1f2e0
movq -0xc0(%rbp), %r8
addq $0x18, %r8
leaq 0x11a08(%rip), %rsi     # 0x21770
movl $0x5, %edx
xorl %ecx, %ecx
movl $0x10, %r9d
callq 0x3080
leaq -0xb8(%rbp), %rdi
callq 0x108f0
movq 0x20(%rax), %rdi
callq 0x3390
leaq -0xb8(%rbp), %rdi
callq 0x108f0
movq $0x0, 0x20(%rax)
movq -0xb8(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x1c0(%rbp), %rsi
leaq 0xf591(%rip), %rdi      # 0x1f350
callq 0x14210
movq %rax, -0x1c8(%rbp)
callq 0x5070
movl $0x0, -0x4(%rbp)
jmp 0x101df
movsbl -0x131(%rbp), %eax
cmpl $0x58, %eax
jne 0xfe02
leaq 0x819b(%rip), %rdi      # 0x17f8a
movb $0x0, %al
callq 0x3820
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x101df
leaq 0xf547(%rip), %rdi      # 0x1f350
callq 0x141f0
addq $0x1, %rax
movl 0xf4dc(%rip), %ecx      # 0x1f2f4
cmpq %rcx, %rax
jbe 0xfe3d
movl 0xf4d1(%rip), %esi      # 0x1f2f4
leaq 0x8195(%rip), %rdi      # 0x17fbf
movb $0x0, %al
callq 0x3820
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x101df
movw $0x2, -0xe0(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x32f0
movl %eax, -0xdc(%rbp)
movl $0x4e21, %edi           # imm = 0x4E21
callq 0x3070
movw %ax, -0xde(%rbp)
movl $0x40, %edi
callq 0x3430
movq %rax, -0xc0(%rbp)
cmpq $0x0, -0xc0(%rbp)
je 0x101b3
movw 0xf46c(%rip), %cx       # 0x1f2f8
movq -0xc0(%rbp), %rax
movw %cx, 0x28(%rax)
movq -0xc0(%rbp), %rax
movq -0xe0(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq -0xd8(%rbp), %rcx
movq %rcx, 0x20(%rax)
movq -0xc0(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x32b0
movq -0xc0(%rbp), %rdi
addq $0x10, %rdi
callq 0x32a0
movq -0xc0(%rbp), %rax
movb $0x0, 0x9(%rax)
movq -0xc0(%rbp), %rax
movb $0x20, 0x2a(%rax)
movq -0xc0(%rbp), %rax
movb $0x1, 0x2b(%rax)
movq -0xc0(%rbp), %rax
movb $0x20, 0x30(%rax)
movq -0xc0(%rbp), %rax
movb $0x20, 0x2f(%rax)
movq -0xc0(%rbp), %rax
movb $0x20, 0x2e(%rax)
movq -0xc0(%rbp), %rax
movb $0x20, 0x2d(%rax)
movq -0xc0(%rbp), %rax
movb $0x20, 0x2c(%rax)
movsbl -0x123(%rbp), %eax
cmpl $0x41, %eax
jne 0xff4d
movb -0x131(%rbp), %cl
movq -0xc0(%rbp), %rax
movb %cl, 0x2c(%rax)
jmp 0xffbd
movsbl -0x123(%rbp), %eax
cmpl $0x42, %eax
jne 0xff6b
movb -0x131(%rbp), %cl
movq -0xc0(%rbp), %rax
movb %cl, 0x2d(%rax)
jmp 0xffbb
movsbl -0x123(%rbp), %eax
cmpl $0x43, %eax
jne 0xff89
movb -0x131(%rbp), %cl
movq -0xc0(%rbp), %rax
movb %cl, 0x2e(%rax)
jmp 0xffb9
movsbl -0x123(%rbp), %eax
cmpl $0x44, %eax
jne 0xffa7
movb -0x131(%rbp), %cl
movq -0xc0(%rbp), %rax
movb %cl, 0x2f(%rax)
jmp 0xffb7
movb -0x131(%rbp), %cl
movq -0xc0(%rbp), %rax
movb %cl, 0x30(%rax)
jmp 0xffb9
jmp 0xffbb
jmp 0xffbd
movq -0xc0(%rbp), %rdi
addq $0x31, %rdi
leaq 0x8016(%rip), %rsi      # 0x17fe5
callq 0x32b0
leaq -0x200(%rbp), %rdi
movq %rdi, -0x258(%rbp)
leaq -0xb0(%rbp), %rsi
leaq -0xc0(%rbp), %rdx
callq 0x142d0
movq -0x258(%rbp), %rsi
leaq 0xf34d(%rip), %rdi      # 0x1f350
callq 0x14290
movb %dl, -0x249(%rbp)
movq %rax, -0x248(%rbp)
jmp 0x10017
movb -0x249(%rbp), %al
movq -0x248(%rbp), %rcx
movq %rcx, -0x210(%rbp)
movb %al, -0x208(%rbp)
movq -0x210(%rbp), %rax
movq %rax, -0x1d8(%rbp)
movb -0x208(%rbp), %al
movb %al, -0x1d0(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x14350
leaq -0x200(%rbp), %rdi
callq 0x14380
testb $0x1, -0xc8(%rbp)
je 0x10175
movq -0xc0(%rbp), %rax
movq %rax, -0x268(%rbp)
leaq -0xb0(%rbp), %rax
movq %rax, -0x260(%rbp)
leaq 0xf2b6(%rip), %rdi      # 0x1f350
callq 0x141f0
movq %rax, -0x270(%rbp)
leaq 0xf2d3(%rip), %rdi      # 0x1f380
callq 0x141d0
movq -0x270(%rbp), %rcx
movq -0x268(%rbp), %rsi
movq -0x260(%rbp), %rdx
addq %rax, %rcx
leaq 0x7f1d(%rip), %rdi      # 0x17fee
movb $0x0, %al
callq 0x3820
movb $0x5, -0x120(%rbp)
movb $0x0, -0x11f(%rbp)
movb $0x18, -0x11e(%rbp)
movb $0x0, -0x11d(%rbp)
movb $0x1, -0x11c(%rbp)
movw $0x0, -0x122(%rbp)
movzwl -0x122(%rbp), %eax
cmpl $0x2, %eax
jge 0x1016e
movl 0xf1ca(%rip), %edi      # 0x1f2e0
leaq -0x120(%rbp), %rsi
movq -0xc0(%rbp), %r8
addq $0x18, %r8
movl $0x5, %edx
xorl %ecx, %ecx
movl $0x10, %r9d
callq 0x3080
movw -0x122(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x122(%rbp)
jmp 0x10104
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x170(%rbp)
movl %eax, -0x174(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x14380
jmp 0x101eb
callq 0x5070
jmp 0x101b1
movq -0xc0(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
leaq 0x7e8a(%rip), %rdi      # 0x18014
movb $0x0, %al
callq 0x3820
movq -0xc0(%rbp), %rdi
callq 0x3390
movq $0x0, -0xc0(%rbp)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x101df
jmp 0x101d8
leaq -0x130(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
leaq 0x7a39(%rip), %rdi      # 0x17c01
movb $0x0, %al
callq 0x3820
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x101df
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
movq -0x170(%rbp), %rdi
callq 0x3500
nopw (%rax,%rax)