// File: /workspace/github_cpp_makefile_star2_O1/Distrotech[P]stund/stun.cxx
// Function: stunServerProcess(StunServerInfo&, bool)
bool
stunServerProcess(StunServerInfo& info, bool verbose)
{
   char msg[STUN_MAX_MESSAGE_SIZE];
   int msgLen = sizeof(msg);
   	
   bool ok = false;
   bool recvAltIp =false;
   bool recvAltPort = false;
	
   fd_set fdSet; 
   Socket maxFd=0;

   FD_ZERO(&fdSet); 
   FD_SET(info.myFd,&fdSet); 
   if ( info.myFd >= maxFd ) maxFd=info.myFd+1;
   FD_SET(info.altPortFd,&fdSet); 
   if ( info.altPortFd >= maxFd ) maxFd=info.altPortFd+1;

   if ( info.altIpFd != INVALID_SOCKET )
   {
      FD_SET(info.altIpFd,&fdSet);
      if (info.altIpFd>=maxFd) maxFd=info.altIpFd+1;
   }
   if ( info.altIpPortFd != INVALID_SOCKET )
   {
      FD_SET(info.altIpPortFd,&fdSet);
      if (info.altIpPortFd>=maxFd) maxFd=info.altIpPortFd+1;
   }

   if (info.relay)
   {
      for (int i=0; i<MAX_MEDIA_RELAYS; ++i)
      {
         StunMediaRelay* relay = &info.relays[i];
         if (relay->fd)
         {
            FD_SET(relay->fd, &fdSet);
            if (relay->fd >= maxFd) 
			{
				maxFd=relay->fd+1;
			}
         }
      }
   }
   
   if ( info.altIpFd != INVALID_SOCKET )
   {
      FD_SET(info.altIpFd,&fdSet);
      if (info.altIpFd>=maxFd) maxFd=info.altIpFd+1;
   }
   if ( info.altIpPortFd != INVALID_SOCKET )
   {
      FD_SET(info.altIpPortFd,&fdSet);
      if (info.altIpPortFd>=maxFd) maxFd=info.altIpPortFd+1;
   }
   
   struct timeval tv;
   tv.tv_sec = 0;
   tv.tv_usec = 1000;
	
   int e = select( maxFd, &fdSet, NULL,NULL, &tv );
   if (e < 0)
   {
      int err = getErrno();
      clog << "Error on select: " << strerror(err) << endl;
   }
   else if (e >= 0)
   {
      StunAddress4 from;

      // do the media relaying
      if (info.relay)
      {
         time_t now = time(0);
         for (int i=0; i<MAX_MEDIA_RELAYS; ++i)
         {
            StunMediaRelay* relay = &info.relays[i];
            if (relay->fd)
            {
               if (FD_ISSET(relay->fd, &fdSet))
               {
                  char msg[MAX_RTP_MSG_SIZE];
                  int msgLen = sizeof(msg);
                  
                  StunAddress4 rtpFrom;
                  ok = getMessage( relay->fd, msg, &msgLen, &rtpFrom.addr, &rtpFrom.port ,verbose);
                  if (ok)
                  {
                     sendMessage(info.myFd, msg, msgLen, relay->destination.addr, relay->destination.port, verbose);
                     relay->expireTime = now + MEDIA_RELAY_TIMEOUT;
                     if ( verbose ) clog << "Relay packet on " 
                                         << relay->fd 
                                         << " from " << rtpFrom 
                                         << " -> " << relay->destination 
                                         << endl;
                  }
               }
               else if (now > relay->expireTime)
               {
                  closesocket(relay->fd);
                  relay->fd = 0;
               }
            }
         }
      }
      
     
      if (FD_ISSET(info.myFd,&fdSet))
      {
         if (verbose) clog << "received on A1:P1" << endl;
         recvAltIp = false;
         recvAltPort = false;
         ok = getMessage( info.myFd, msg, &msgLen, &from.addr, &from.port,verbose );
      }
      else if (FD_ISSET(info.altPortFd, &fdSet))
      {
         if (verbose) clog << "received on A1:P2" << endl;
         recvAltIp = false;
         recvAltPort = true;
         ok = getMessage( info.altPortFd, msg, &msgLen, &from.addr, &from.port,verbose );
      }
      else if ( (info.altIpFd!=INVALID_SOCKET) && FD_ISSET(info.altIpFd,&fdSet))
      {
         if (verbose) clog << "received on A2:P1" << endl;
         recvAltIp = true;
         recvAltPort = false;
         ok = getMessage( info.altIpFd, msg, &msgLen, &from.addr, &from.port ,verbose);
      }
      else if ( (info.altIpPortFd!=INVALID_SOCKET) && FD_ISSET(info.altIpPortFd, &fdSet))
      {
         if (verbose) clog << "received on A2:P2" << endl;
         recvAltIp = true;
         recvAltPort = true;
         ok = getMessage( info.altIpPortFd, msg, &msgLen, &from.addr, &from.port,verbose );
      }
      else
      {
         return true;
      }

      int relayPort = 0;
      if (info.relay)
      {
         for (int i=0; i<MAX_MEDIA_RELAYS; ++i)
         {
            StunMediaRelay* relay = &info.relays[i];
            if (relay->destination.addr == from.addr && 
                relay->destination.port == from.port)
            {
               relayPort = relay->relayPort;
               relay->expireTime = time(0) + MEDIA_RELAY_TIMEOUT;
               break;
            }
         }

         if (relayPort == 0)
         {
            for (int i=0; i<MAX_MEDIA_RELAYS; ++i)
            {
               StunMediaRelay* relay = &info.relays[i];
               if (relay->fd == 0)
               {
                  if ( verbose ) clog << "Open relay port " << relay->relayPort << endl;
                  
                  relay->fd = openPort(relay->relayPort, info.myAddr.addr, verbose);
                  relay->destination.addr = from.addr;
                  relay->destination.port = from.port;
                  relay->expireTime = time(0) + MEDIA_RELAY_TIMEOUT;
                  relayPort = relay->relayPort;
                  break;
               }
            }
         }
      }
         
      if ( !ok ) 
      {
         if ( verbose ) clog << "Get message did not return a valid message" <<endl;
         return true;
      }
		
      if ( verbose ) clog << "Got a request (len=" << msgLen << ") from " << from << endl;
		
      if ( msgLen <= 0 )
      {
         return true;
      }
		
      bool changePort = false;
      bool changeIp = false;
		
      StunMessage resp;
      StunAddress4 dest;
      StunAtrString hmacPassword;  
      hmacPassword.sizeValue = 0;

      StunAddress4 secondary;
      secondary.port = 0;
      secondary.addr = 0;
               
      if (info.relay && relayPort)
      {
         secondary = from;
         
         from.addr = info.myAddr.addr;
         from.port = relayPort;
      }
      
      ok = stunServerProcessMsg( msg, msgLen, from, secondary,
                                 recvAltIp ? info.altAddr : info.myAddr,
                                 recvAltIp ? info.myAddr : info.altAddr, 
                                 &resp,
                                 &dest,
                                 &hmacPassword,
                                 &changePort,
                                 &changeIp,
                                 verbose );
		
      if ( !ok )
      {
         if ( verbose ) clog << "Failed to parse message" << endl;
         return true;
      }
		
      char buf[STUN_MAX_MESSAGE_SIZE];
      int len = sizeof(buf);
      		
      len = stunEncodeMessage( resp, buf, len, hmacPassword,verbose );
		
      if ( dest.addr == 0 )  ok=false;
      if ( dest.port == 0 ) ok=false;
		
      if ( ok )
      {
         assert( dest.addr != 0 );
         assert( dest.port != 0 );
			
         Socket sendFd;
			
         bool sendAltIp   = recvAltIp;   // send on the received IP address 
         bool sendAltPort = recvAltPort; // send on the received port
			
         if ( changeIp )   sendAltIp   = !sendAltIp;   // if need to change IP, then flip logic 
         if ( changePort ) sendAltPort = !sendAltPort; // if need to change port, then flip logic 
			
         if ( !sendAltPort )
         {
            if ( !sendAltIp )
            {
               sendFd = info.myFd;
            }
            else
            {
               sendFd = info.altIpFd;
            }
         }
         else
         {
            if ( !sendAltIp )
            {
               sendFd = info.altPortFd;
            }
            else
            {
               sendFd = info.altIpPortFd;
            }
         }
	
         if ( sendFd != INVALID_SOCKET )
         {
            sendMessage( sendFd, buf, len, dest.addr, dest.port, verbose );
         }
      }
   }
	
   return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x16c8, %rsp           # imm = 0x16C8
movq %rdi, %rbx
movl $0x800, 0x2c(%rsp)      # imm = 0x800
xorps %xmm0, %xmm0
movaps %xmm0, 0xd0(%rsp)
movaps %xmm0, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movl 0x10(%rdi), %ecx
leal 0x3f(%rcx), %edx
xorl %eax, %eax
testl %ecx, %ecx
cmovnsl %ecx, %edx
leal 0x1(%rcx), %edi
cmovnsl %edi, %eax
movl %edx, %edi
andl $-0x40, %edi
subl %edi, %ecx
movl $0x1, %edi
shlq %cl, %rdi
sarl $0x6, %edx
movslq %edx, %rcx
orq %rdi, 0x60(%rsp,%rcx,8)
movl 0x14(%rbx), %r8d
leal 0x3f(%r8), %edx
testl %r8d, %r8d
cmovnsl %r8d, %edx
movl %edx, %edi
andl $-0x40, %edi
movl %r8d, %ecx
subl %edi, %ecx
movl $0x1, %edi
shlq %cl, %rdi
sarl $0x6, %edx
movslq %edx, %rcx
orq %rdi, 0x60(%rsp,%rcx,8)
movl %esi, 0x8(%rsp)
movl $0x1, %edx
leal 0x1(%r8), %edi
cmpl %eax, %r8d
cmovll %eax, %edi
movl 0x18(%rbx), %eax
cmpl $-0x1, %eax
je 0x5c6c
leal 0x3f(%rax), %esi
testl %eax, %eax
cmovnsl %eax, %esi
movl %esi, %r8d
andl $-0x40, %r8d
movl %eax, %ecx
subl %r8d, %ecx
shlq %cl, %rdx
sarl $0x6, %esi
movslq %esi, %rcx
orq %rdx, 0x60(%rsp,%rcx,8)
leal 0x1(%rax), %ecx
cmpl %edi, %eax
cmovgel %ecx, %edi
movl 0x1c(%rbx), %edx
cmpl $-0x1, %edx
je 0x5ca4
leal 0x3f(%rdx), %esi
testl %edx, %edx
cmovnsl %edx, %esi
movl %esi, %r8d
andl $-0x40, %r8d
movl %edx, %ecx
subl %r8d, %ecx
movl $0x1, %r8d
shlq %cl, %r8
sarl $0x6, %esi
movslq %esi, %rcx
orq %r8, 0x60(%rsp,%rcx,8)
leal 0x1(%rdx), %ecx
cmpl %edi, %edx
cmovgel %ecx, %edi
cmpb $0x1, 0x20(%rbx)
jne 0x5cfc
movl $0x2c, %esi
movl (%rbx,%rsi), %r8d
testl %r8d, %r8d
je 0x5cef
leal 0x3f(%r8), %r9d
testl %r8d, %r8d
cmovnsl %r8d, %r9d
movl %r9d, %r10d
andl $-0x40, %r10d
movl %r8d, %ecx
subl %r10d, %ecx
movl $0x1, %r10d
shlq %cl, %r10
sarl $0x6, %r9d
movslq %r9d, %rcx
orq %r10, 0x60(%rsp,%rcx,8)
leal 0x1(%r8), %ecx
cmpl %edi, %r8d
cmovgel %ecx, %edi
addq $0x18, %rsi
cmpq $0x2f0c, %rsi           # imm = 0x2F0C
jne 0x5caf
cmpl $-0x1, %eax
je 0x5d31
leal 0x3f(%rax), %esi
testl %eax, %eax
cmovnsl %eax, %esi
movl %esi, %r8d
andl $-0x40, %r8d
movl %eax, %ecx
subl %r8d, %ecx
movl $0x1, %r8d
shlq %cl, %r8
sarl $0x6, %esi
movslq %esi, %rcx
orq %r8, 0x60(%rsp,%rcx,8)
leal 0x1(%rax), %ecx
cmpl %edi, %eax
cmovgel %ecx, %edi
cmpl $-0x1, %edx
je 0x5d61
leal 0x3f(%rdx), %eax
testl %edx, %edx
cmovnsl %edx, %eax
movl %eax, %esi
andl $-0x40, %esi
movl %edx, %ecx
subl %esi, %ecx
movl $0x1, %esi
shlq %cl, %rsi
sarl $0x6, %eax
cltq
orq %rsi, 0x60(%rsp,%rax,8)
leal 0x1(%rdx), %eax
cmpl %edi, %edx
cmovgel %eax, %edi
leaq 0xe0(%rsp), %r8
movq $0x0, (%r8)
movq $0x3e8, 0x8(%r8)        # imm = 0x3E8
leaq 0x60(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x21a0
testl %eax, %eax
js 0x5fee
leaq 0x10(%rbx), %rax
movq %rax, 0x38(%rsp)
cmpb $0x1, 0x20(%rbx)
movzbl 0x8(%rsp), %r14d
movq %r14, 0x20(%rsp)
jne 0x5f47
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x2190
movq %rax, %r15
leaq 0x6c4(%rsp), %rbp
movq %rax, %r13
addq $0xb4, %r13
leaq 0x30(%rbx), %rax
movq %rax, 0x30(%rsp)
movq %r13, 0x10(%rsp)
movl 0x2c(%rbx,%r12), %edi
testl %edi, %edi
je 0x5f36
leal 0x3f(%rdi), %eax
testl %edi, %edi
cmovnsl %edi, %eax
sarl $0x6, %eax
cltq
movq 0x60(%rsp,%rax,8), %rax
btq %rdi, %rax
jae 0x5f21
movl $0x5dc, 0x1f8(%rsp) # imm = 0x5DC
leaq 0xec0(%rsp), %rsi
leaq 0x1f8(%rsp), %rdx
movq %rbp, %rcx
leaq 0x6c0(%rsp), %r8
movl %r14d, %r9d
callq 0x7f4a
testb %al, %al
je 0x5f36
movl 0x10(%rbx), %edi
movl 0x1f8(%rsp), %edx
movl 0x34(%rbx,%r12), %ecx
movzwl 0x30(%rbx,%r12), %r8d
leaq 0xec0(%rsp), %rsi
movl %r14d, %r9d
callq 0x8101
movq %r13, 0x38(%rbx,%r12)
testb %r14b, %r14b
je 0x5f36
movq %r15, %r13
movq %rbp, %r15
movq 0x30(%rsp), %rax
leaq (%rax,%r12), %rbp
movl $0x10, %edx
movq 0x7132(%rip), %r14      # 0xcfb8
movq %r14, %rdi
leaq 0x3f70(%rip), %rsi      # 0x9e00
callq 0x21f0
movl 0x2c(%rbx,%r12), %esi
movq %r14, %rdi
callq 0x22a0
movq %rax, %r14
movl $0x6, %edx
movq %rax, %rdi
leaq 0x3ffb(%rip), %rsi      # 0x9eaf
callq 0x21f0
movq %r14, %rdi
leaq 0x6c0(%rsp), %rsi
callq 0x3f5b
movl $0x4, %edx
movq %r14, %rdi
leaq 0x3f39(%rip), %rsi      # 0x9e11
callq 0x21f0
movq %r14, %rdi
movq %rbp, %rsi
movq %r15, %rbp
movq %r13, %r15
movq 0x10(%rsp), %r13
callq 0x3f5b
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
movq 0x20(%rsp), %r14
callq 0x2030
movq %rax, %rdi
callq 0x2140
jmp 0x5f36
cmpq 0x38(%rbx,%r12), %r15
jle 0x5f36
callq 0x22c0
movl $0x0, 0x2c(%rbx,%r12)
addq $0x18, %r12
cmpq $0x2ee0, %r12           # imm = 0x2EE0
jne 0x5dd9
leaq 0x14(%rbx), %r15
leaq 0x18(%rbx), %rsi
leaq 0x1c(%rbx), %rdx
movq 0x38(%rsp), %rax
movl (%rax), %eax
leal 0x3f(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
sarl $0x6, %ecx
movslq %ecx, %rcx
movq 0x60(%rsp,%rcx,8), %rcx
btq %rax, %rcx
movq %r15, 0x58(%rsp)
movq %rdx, 0x30(%rsp)
movq %rsi, 0x50(%rsp)
jae 0x603d
cmpb $0x0, 0x8(%rsp)
je 0x5fd4
movq 0x7024(%rip), %r14      # 0xcfb8
leaq 0x3e7b(%rip), %rsi      # 0x9e16
movl $0x11, %edx
movq %r14, %rdi
callq 0x21f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
movq 0x20(%rsp), %r14
callq 0x2030
movq %rax, %rdi
callq 0x2140
movl $0x0, 0xc(%rsp)
movq 0x38(%rsp), %rax
movl $0x0, 0x10(%rsp)
jmp 0x60bc
callq 0x2040
movl (%rax), %ebp
movq 0x6fbc(%rip), %rbx      # 0xcfb8
leaq 0x3deb(%rip), %rsi      # 0x9dee
movl $0x11, %edx
movq %rbx, %rdi
callq 0x21f0
movl %ebp, %edi
callq 0x20a0
testq %rax, %rax
je 0x63fe
movq %rax, %r14
movq %rax, %rdi
callq 0x20c0
movq 0x6f86(%rip), %rdi      # 0xcfb8
movq %r14, %rsi
movq %rax, %rdx
jmp 0x6434
movl (%r15), %eax
leal 0x3f(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
sarl $0x6, %ecx
movslq %ecx, %rcx
movq 0x60(%rsp,%rcx,8), %rcx
btq %rax, %rcx
jae 0x6474
movb $0x1, %al
movl %eax, 0xc(%rsp)
cmpb $0x0, 0x8(%rsp)
je 0x60b1
movq 0x6f47(%rip), %r14      # 0xcfb8
leaq 0x3db0(%rip), %rsi      # 0x9e28
movl $0x11, %edx
movq %r14, %rdi
callq 0x21f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
movq 0x20(%rsp), %r14
callq 0x2030
movq %rax, %rdi
callq 0x2140
movl $0x0, 0x10(%rsp)
movq %r15, %rax
movl (%rax), %edi
leaq 0x1c(%rsp), %rcx
leaq 0xec0(%rsp), %rsi
leaq 0x2c(%rsp), %rdx
leaq 0x18(%rsp), %r8
movl %r14d, %r9d
callq 0x7f4a
movl %eax, %r15d
xorl %ebp, %ebp
cmpb $0x1, 0x20(%rbx)
jne 0x6214
xorl %ebp, %ebp
movl $0x38, %r14d
movl -0x4(%rbx,%r14), %eax
cmpl 0x1c(%rsp), %eax
jne 0x6126
movzwl -0x8(%rbx,%r14), %eax
cmpw 0x18(%rsp), %ax
jne 0x6126
movl -0x10(%rbx,%r14), %ebp
xorl %edi, %edi
callq 0x2190
addq $0xb4, %rax
movq %rax, (%rbx,%r14)
movb $0x1, %al
jmp 0x6128
xorl %eax, %eax
testb %al, %al
jne 0x613c
leaq 0x18(%r14), %rax
cmpq $0x2f00, %r14           # imm = 0x2F00
movq %rax, %r14
jne 0x60f4
testl %ebp, %ebp
movq 0x20(%rsp), %r14
jne 0x6214
xorl %r13d, %r13d
xorl %ebp, %ebp
movl 0x2c(%rbx,%r13), %r12d
testl %r12d, %r12d
jne 0x61fb
cmpb $0x0, 0x8(%rsp)
je 0x61ba
movl $0x10, %edx
movq 0x6e49(%rip), %r14      # 0xcfb8
movq %r14, %rdi
leaq 0x3ce5(%rip), %rsi      # 0x9e5e
callq 0x21f0
movl 0x28(%rbx,%r13), %esi
movq %r14, %rdi
callq 0x22a0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
movq 0x20(%rsp), %r14
callq 0x2030
movq %rax, %rdi
callq 0x2140
movzwl 0x28(%rbx,%r13), %edi
movl 0x4(%rbx), %esi
movl %r14d, %edx
callq 0x7c10
movl %eax, 0x2c(%rbx,%r13)
movl 0x1c(%rsp), %eax
movl %eax, 0x34(%rbx,%r13)
movzwl 0x18(%rsp), %eax
movw %ax, 0x30(%rbx,%r13)
xorl %edi, %edi
callq 0x2190
addq $0xb4, %rax
movq %rax, 0x38(%rbx,%r13)
movl 0x28(%rbx,%r13), %ebp
testl %r12d, %r12d
je 0x6214
leaq 0x18(%r13), %rax
cmpq $0x2ec8, %r13           # imm = 0x2EC8
movq %rax, %r13
jne 0x614e
testb %r15b, %r15b
je 0x63e2
cmpb $0x0, 0x8(%rsp)
je 0x6296
movq 0x6d8d(%rip), %r14      # 0xcfb8
leaq 0x3c68(%rip), %rsi      # 0x9e9a
movl $0x13, %edx
movq %r14, %rdi
callq 0x21f0
movl 0x2c(%rsp), %esi
movq %r14, %rdi
callq 0x22a0
movq %rax, %r14
leaq 0x3c59(%rip), %rsi      # 0x9eae
movl $0x7, %edx
movq %rax, %rdi
callq 0x21f0
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x3f5b
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
movl 0x2c(%rsp), %esi
testl %esi, %esi
jle 0x6460
xorl %eax, %eax
movb %al, 0x7(%rsp)
movb %al, 0x6(%rsp)
movw %ax, 0x1f6(%rsp)
movw %ax, 0x40(%rsp)
movl $0x0, 0x44(%rsp)
cmpb $0x1, 0x20(%rbx)
jne 0x62e1
testl %ebp, %ebp
je 0x62e1
movq 0x18(%rsp), %rax
movq %rax, 0x40(%rsp)
movl 0x4(%rbx), %eax
movl %eax, 0x1c(%rsp)
movw %bp, 0x18(%rsp)
leaq 0x8(%rbx), %r9
movl 0x10(%rsp), %ebp
testb %bpl, %bpl
movq %rbx, %r8
cmovneq %r9, %r8
cmovneq %rbx, %r9
leaq 0x6(%rsp), %rax
leaq 0x7(%rsp), %r10
leaq 0xf6(%rsp), %r11
leaq 0x48(%rsp), %rbx
leaq 0x1f8(%rsp), %r14
leaq 0xec0(%rsp), %rdi
leaq 0x18(%rsp), %rdx
leaq 0x40(%rsp), %rcx
movq 0x20(%rsp), %r15
pushq %r15
pushq %rax
pushq %r10
pushq %r11
pushq %rbx
pushq %r14
callq 0x4f4b
addq $0x30, %rsp
testb %al, %al
je 0x6417
movl %eax, %ebx
leaq 0x1f8(%rsp), %rdi
leaq 0x6c0(%rsp), %rsi
leaq 0xf6(%rsp), %rcx
movl $0x800, %edx            # imm = 0x800
movl %r15d, %r8d
callq 0x40bb
movl 0x4c(%rsp), %ecx
testl %ecx, %ecx
setne %sil
movzwl 0x48(%rsp), %edx
testw %dx, %dx
je 0x6460
andb %sil, %bl
je 0x6460
xorb 0x6(%rsp), %bpl
movl 0xc(%rsp), %r8d
xorb 0x7(%rsp), %r8b
testb %bpl, %bpl
movq 0x38(%rsp), %rsi
cmovneq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdi
cmovneq 0x30(%rsp), %rdi
testb %r8b, %r8b
cmoveq %rsi, %rdi
movl (%rdi), %edi
cmpl $-0x1, %edi
je 0x6460
movzwl %dx, %r8d
leaq 0x6c0(%rsp), %rsi
movl %eax, %edx
movl %r15d, %r9d
callq 0x8101
jmp 0x6460
cmpb $0x0, 0x8(%rsp)
je 0x6460
movq 0x6bc8(%rip), %rbx      # 0xcfb8
leaq 0x3a78(%rip), %rsi      # 0x9e6f
movl $0x2a, %edx
jmp 0x6431
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2290
jmp 0x6439
cmpb $0x0, 0x8(%rsp)
je 0x6460
movq 0x6b93(%rip), %rbx      # 0xcfb8
leaq 0x3a8a(%rip), %rsi      # 0x9eb6
movl $0x17, %edx
movq %rbx, %rdi
callq 0x21f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
movb $0x1, %al
addq $0x16c8, %rsp           # imm = 0x16C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl (%rsi), %eax
cmpl $-0x1, %eax
je 0x64dd
leal 0x3f(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
sarl $0x6, %ecx
movslq %ecx, %rcx
movq 0x60(%rsp,%rcx,8), %rcx
btq %rax, %rcx
jae 0x64dd
cmpb $0x0, 0x8(%rsp)
je 0x654a
movb $0x1, %al
movl %eax, 0x10(%rsp)
movq 0x6b0c(%rip), %r14      # 0xcfb8
movq %rsi, %r15
leaq 0x3984(%rip), %rsi      # 0x9e3a
movl $0x11, %edx
movq %r14, %rdi
callq 0x21f0
movq %r14, %rdi
movq 0x20(%rsp), %r14
callq 0x20d0
movl $0x0, 0xc(%rsp)
jmp 0x60b9
movl (%rdx), %eax
cmpl $-0x1, %eax
je 0x6460
leal 0x3f(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
sarl $0x6, %ecx
movslq %ecx, %rcx
movq 0x60(%rsp,%rcx,8), %rcx
btq %rax, %rcx
jae 0x6460
movb $0x1, %al
movl %eax, 0xc(%rsp)
cmpb $0x0, 0x8(%rsp)
je 0x653a
movq 0x6a9f(%rip), %r14      # 0xcfb8
leaq 0x392c(%rip), %rsi      # 0x9e4c
movl $0x11, %edx
movq %r14, %rdi
callq 0x21f0
movq %r14, %rdi
movq 0x20(%rsp), %r14
callq 0x20d0
movq 0x30(%rsp), %rax
movb $0x1, %cl
movl %ecx, 0x10(%rsp)
jmp 0x60bc
movb $0x1, %al
movl %eax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movq %rsi, %rax
jmp 0x60bc