// File: /workspace/github_cpp_makefile_star2_O2/Distrotech[P]stund/stun.cxx
// Function: stunNatType(StunAddress4&, bool, bool*, bool*, int, StunAddress4*)
NatType
stunNatType( StunAddress4& dest, 
             bool verbose,
             bool* preservePort, // if set, is return for if NAT preservers ports or not
             bool* hairpin,  // if set, is the return for if NAT will hairpin packets
             int port, // port to use for the test, 0 to choose random port
             StunAddress4* sAddr // NIC to use 
   )
{ 
   assert( dest.addr != 0 );
   assert( dest.port != 0 );
	
   if ( hairpin ) 
   {
      *hairpin = false;
   }
	
   if ( port == 0 )
   {
      port = stunRandomPort();
   }
   UInt32 interfaceIp=0;
   if (sAddr)
   {
      interfaceIp = sAddr->addr;
   }
   Socket myFd1 = openPort(port,interfaceIp,verbose);
   Socket myFd2 = openPort(port+1,interfaceIp,verbose);

   if ( ( myFd1 == INVALID_SOCKET) || ( myFd2 == INVALID_SOCKET) )
   {
        cerr << "Some problem opening port/interface to send on" << endl;
       return StunTypeFailure; 
   }

   assert( myFd1 != INVALID_SOCKET );
   assert( myFd2 != INVALID_SOCKET );
    
   bool respTestI=false;
   bool isNat=true;
   StunAddress4 testIchangedAddr;
   StunAddress4 testImappedAddr;
   bool respTestI2=false; 
   bool mappedIpSame = true;
   StunAddress4 testI2mappedAddr;
   StunAddress4 testI2dest=dest;
   bool respTestII=false;
   bool respTestIII=false;

   bool respTestHairpin=false;
   bool respTestPreservePort=false;
	
   memset(&testImappedAddr,0,sizeof(testImappedAddr));
	
   StunAtrString username;
   StunAtrString password;
	
   username.sizeValue = 0;
   password.sizeValue = 0;
	
#ifdef USE_TLS 
   stunGetUserNameAndPassword( dest, username, password );
#endif
	
   int count=0;
   while ( count < 7 )
   {
      struct timeval tv;
      fd_set fdSet; 
#ifdef WIN32
      unsigned int fdSetSize;
#else
      int fdSetSize;
#endif
      FD_ZERO(&fdSet); fdSetSize=0;
      FD_SET(myFd1,&fdSet); fdSetSize = (myFd1+1>fdSetSize) ? myFd1+1 : fdSetSize;
      FD_SET(myFd2,&fdSet); fdSetSize = (myFd2+1>fdSetSize) ? myFd2+1 : fdSetSize;
      tv.tv_sec=0;
      tv.tv_usec=150*1000; // 150 ms 
      if ( count == 0 ) tv.tv_usec=0;
		
      int  err = select(fdSetSize, &fdSet, NULL, NULL, &tv);
      int e = getErrno();
      if ( err == SOCKET_ERROR )
      {
         // error occured
         cerr << "Error " << e << " " << strerror(e) << " in select" << endl;
        return StunTypeFailure; 
     }
      else if ( err == 0 )
      {
         // timeout occured 
         count++;
			
         if ( !respTestI ) 
         {
            stunSendTest( myFd1, dest, username, password, 1 ,verbose );
         }         
			
         if ( (!respTestI2) && respTestI ) 
         {
            // check the address to send to if valid 
            if (  ( testI2dest.addr != 0 ) &&
                  ( testI2dest.port != 0 ) )
            {
               stunSendTest( myFd1, testI2dest, username, password, 10  ,verbose);
            }
         }
			
         if ( !respTestII )
         {
            stunSendTest( myFd2, dest, username, password, 2 ,verbose );
         }
			
         if ( !respTestIII )
         {
            stunSendTest( myFd2, dest, username, password, 3 ,verbose );
         }
			
         if ( respTestI && (!respTestHairpin) )
         {
            if (  ( testImappedAddr.addr != 0 ) &&
                  ( testImappedAddr.port != 0 ) )
            {
               stunSendTest( myFd1, testImappedAddr, username, password, 11 ,verbose );
            }
         }
      }
      else
      {
         //if (verbose) clog << "-----------------------------------------" << endl;
         assert( err>0 );
         // data is avialbe on some fd 
			
         for ( int i=0; i<2; i++)
         {
            Socket myFd;
            if ( i==0 ) 
            {
               myFd=myFd1;
            }
            else
            {
               myFd=myFd2;
            }
				
            if ( myFd!=INVALID_SOCKET ) 
            {					
               if ( FD_ISSET(myFd,&fdSet) )
               {
                  char msg[STUN_MAX_MESSAGE_SIZE];
                  int msgLen = sizeof(msg);
                  						
                  StunAddress4 from;
						
                  getMessage( myFd,
                              msg,
                              &msgLen,
                              &from.addr,
                              &from.port,verbose );
						
                  StunMessage resp;
                  memset(&resp, 0, sizeof(StunMessage));
						
                  stunParseMessage( msg,msgLen, resp,verbose );
						
                  if ( verbose )
                  {
                     clog << "Received message of type " << resp.msgHdr.msgType 
                          << "  id=" << (int)(resp.msgHdr.id.octet[0]) << endl;
                  }
						
                  switch( resp.msgHdr.id.octet[0] )
                  {
                     case 1:
                     {
                        if ( !respTestI )
                        {
									
                           testIchangedAddr.addr = resp.changedAddress.ipv4.addr;
                           testIchangedAddr.port = resp.changedAddress.ipv4.port;
                           testImappedAddr.addr = resp.mappedAddress.ipv4.addr;
                           testImappedAddr.port = resp.mappedAddress.ipv4.port;
			
                           respTestPreservePort = ( testImappedAddr.port == port ); 
                           if ( preservePort )
                           {
                              *preservePort = respTestPreservePort;
                           }								
									
                           testI2dest.addr = resp.changedAddress.ipv4.addr;
									
                           if (sAddr)
                           {
                              sAddr->port = testImappedAddr.port;
                              sAddr->addr = testImappedAddr.addr;
                           }
									
                           count = 0;
                        }		
                        respTestI=true;
                     }
                     break;
                     case 2:
                     {  
                        respTestII=true;
                     }
                     break;
                     case 3:
                     {
                        respTestIII=true;
                     }
                     break;
                     case 10:
                     {
                        if ( !respTestI2 )
                        {
                           testI2mappedAddr.addr = resp.mappedAddress.ipv4.addr;
                           testI2mappedAddr.port = resp.mappedAddress.ipv4.port;
								
                           mappedIpSame = false;
                           if ( (testI2mappedAddr.addr  == testImappedAddr.addr ) &&
                                (testI2mappedAddr.port == testImappedAddr.port ))
                           { 
                              mappedIpSame = true;
                           }
								
							
                        }
                        respTestI2=true;
                     }
                     break;
                     case 11:
                     {
							
                        if ( hairpin ) 
                        {
                           *hairpin = true;
                        }
                        respTestHairpin = true;
                     }
                     break;
                  }
               }
            }
         }
      }
   }
	
   // see if we can bind to this address 
   //cerr << "try binding to " << testImappedAddr << endl;
   Socket s = openPort( 0/*use ephemeral*/, testImappedAddr.addr, false );
   if ( s != INVALID_SOCKET )
   {
      closesocket(s);
      isNat = false;
      //cerr << "binding worked" << endl;
   }
   else
   {
      isNat = true;
      //cerr << "binding failed" << endl;
   }
	
   if (verbose)
   {
      clog << "test I = " << respTestI << endl;
      clog << "test II = " << respTestII << endl;
      clog << "test III = " << respTestIII << endl;
      clog << "test I(2) = " << respTestI2 << endl;
      clog << "is nat  = " << isNat <<endl;
      clog << "mapped IP same = " << mappedIpSame << endl;
      clog << "hairpin = " << respTestHairpin << endl;
      clog << "preserver port = " << respTestPreservePort << endl;
   }
	
#if 0
   // implement logic flow chart from draft RFC
   if ( respTestI )
   {
      if ( isNat )
      {
         if (respTestII)
         {
            return StunTypeConeNat;
         }
         else
         {
            if ( mappedIpSame )
            {
               if ( respTestIII )
               {
                  return StunTypeRestrictedNat;
               }
               else
               {
                  return StunTypePortRestrictedNat;
               }
            }
            else
            {
               return StunTypeSymNat;
            }
         }
      }
      else
      {
         if (respTestII)
         {
            return StunTypeOpen;
         }
         else
         {
            return StunTypeSymFirewall;
         }
      }
   }
   else
   {
      return StunTypeBlocked;
   }
#else
   if ( respTestI ) // not blocked 
   {
      if ( isNat )
      {
         if ( mappedIpSame )
         {
            if (respTestII)
            {
               return StunTypeIndependentFilter;
            }
            else
            {
               if ( respTestIII )
               {
                  return StunTypeDependentFilter;
               }
               else
               {
                  return StunTypePortDependedFilter;
               }
            }
         }
         else // mappedIp is not same 
         {
            return StunTypeDependentMapping;
         }
      }
      else  // isNat is false
      {
         if (respTestII)
         {
            return StunTypeOpen;
         }
         else
         {
            return StunTypeFirewall;
         }
      }
   }
   else
   {
      return StunTypeBlocked;
   }
#endif
	
   return StunTypeUnknown;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1038, %rsp           # imm = 0x1038
movq %r8, 0x40(%rsp)
movq %rdx, 0x98(%rsp)
movl %esi, 0x1c(%rsp)
cmpl $0x0, 0x4(%rdi)
je 0x6337
movq %rdi, %r15
cmpw $0x0, (%rdi)
je 0x6356
movq %r9, %rbx
testq %rcx, %rcx
je 0x5b19
movb $0x0, (%rcx)
cmpl $0x0, 0x40(%rsp)
movq %rcx, 0xc0(%rsp)
jne 0x5b32
callq 0x40cb
movq %rax, 0x40(%rsp)
testq %rbx, %rbx
movq %rbx, 0x90(%rsp)
je 0x5b44
movl 0x4(%rbx), %ebx
jmp 0x5b46
xorl %ebx, %ebx
movl $0xffff, %ebp           # imm = 0xFFFF
movq 0x40(%rsp), %r14
movl %r14d, %edi
andl %ebp, %edi
movzbl 0x1c(%rsp), %r13d
movl %ebx, %esi
movl %r13d, %edx
callq 0x67f4
movl %eax, %r12d
leal 0x1(%r14), %edi
andl %ebp, %edi
movl %ebx, %esi
movl %r13d, (%rsp)
movl %r13d, %edx
callq 0x67f4
movl %eax, %ebx
cmpl $-0x1, %r12d
setne %al
cmpl $-0x1, %ebx
setne %cl
testb %cl, %al
jne 0x5bb2
pushq $0x1
popq %rbp
movq 0x5457(%rip), %rdi      # 0xaff0
leaq 0x2460(%rip), %rsi      # 0x8000
callq 0x21d0
movq %rax, %rdi
callq 0x20c0
jmp 0x62e5
movq %r15, 0x48(%rsp)
movq (%r15), %rsi
leaq 0x80(%rsp), %rax
leaq 0x68(%rsp), %rcx
andq $0x0, (%rcx)
leaq 0x266(%rsp), %rcx
andw $0x0, 0x100(%rcx)
leaq 0x164(%rsp), %rcx
andw $0x0, 0x100(%rcx)
movq %rsi, (%rax)
pushq $0x40
popq %rdi
movl %r12d, %eax
cltd
idivl %edi
movslq %eax, %rcx
movq %rcx, 0xb8(%rsp)
shll $0x6, %eax
movl %r12d, %ecx
subl %eax, %ecx
pushq $0x1
popq %r8
movq %r8, %rax
shlq %cl, %rax
movq %rax, 0xa8(%rsp)
testl %r12d, %r12d
pushq $-0x1
popq %r9
cmovnsl %r12d, %r9d
incl %r9d
movl %ebx, %eax
cltd
idivl %edi
movslq %eax, %rcx
movq %rcx, 0xa0(%rsp)
shll $0x6, %eax
movl %ebx, %ecx
subl %eax, %ecx
shlq %cl, %r8
movq %r8, 0xb0(%rsp)
leal 0x1(%rbx), %eax
cmpl %r9d, %eax
cmovgl %eax, %r9d
movl %r9d, 0x74(%rsp)
movq %rsi, 0x88(%rsp)
shrq $0x20, %rsi
movq %rsi, 0x50(%rsp)
movb $0x1, %al
movl %eax, 0x8(%rsp)
xorl %ebp, %ebp
movq $0x0, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
xorl %r14d, %r14d
movq $0x0, 0x30(%rsp)
movq $0x0, 0x60(%rsp)
movq $0x0, 0x58(%rsp)
movq $0x0, 0x78(%rsp)
movl $0x0, 0xc(%rsp)
movq %rbx, 0x10(%rsp)
cmpl $0x6, 0xc(%rsp)
jg 0x60ed
xorl %eax, %eax
cmpq $0x10, %rax
je 0x5cdb
andq $0x0, 0xe0(%rsp,%rax,8)
incq %rax
jmp 0x5cc7
movl %ebp, 0x4(%rsp)
movq 0xb8(%rsp), %rax
movq 0xa8(%rsp), %rcx
orq %rcx, 0xe0(%rsp,%rax,8)
movq 0xb0(%rsp), %rax
movq 0xa0(%rsp), %rcx
orq %rax, 0xe0(%rsp,%rcx,8)
andq $0x0, 0xd0(%rsp)
cmpl $0x0, 0xc(%rsp)
movl $0x249f0, %eax          # imm = 0x249F0
movl $0x0, %ecx
cmoveq %rcx, %rax
movq %rax, 0xd8(%rsp)
movl 0x74(%rsp), %edi
leaq 0xe0(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
leaq 0xd0(%rsp), %r8
callq 0x21b0
movl %eax, %r15d
callq 0x67e9
testl %r15d, %r15d
je 0x5f8e
cmpl $-0x1, %r15d
je 0x6288
testl %r15d, %r15d
jle 0x6318
pushq $0x2
popq %rax
movl %eax, %ebp
subl $0x1, %ebp
jb 0x5feb
cmpl $0x2, %eax
movl %ebx, %edi
cmovel %r12d, %edi
movl %edi, %eax
cltd
pushq $0x40
popq %rcx
idivl %ecx
cltq
movq 0xe0(%rsp,%rax,8), %rax
btq %rdx, %rax
jae 0x5f87
movq %r14, %r13
movl %r12d, %ebx
movl $0x800, 0x3c(%rsp)      # imm = 0x800
leaq 0x830(%rsp), %r15
movq %r15, %rsi
leaq 0x3c(%rsp), %rdx
leaq 0xcc(%rsp), %rcx
leaq 0xc8(%rsp), %r8
movl (%rsp), %r14d
movl %r14d, %r9d
callq 0x6a0e
movl $0x4c8, %edx            # imm = 0x4C8
leaq 0x368(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x2110
movl 0x3c(%rsp), %esi
movq %r15, %rdi
movq %r12, %rdx
movl %r14d, %ecx
callq 0x2d54
cmpb $0x0, 0x1c(%rsp)
je 0x5e5b
movq 0x51a0(%rip), %rdi      # 0xafb8
leaq 0x2228(%rip), %rsi      # 0x8047
callq 0x21d0
movzwl 0x368(%rsp), %esi
movq %rax, %rdi
callq 0x2290
movq %rax, %rdi
leaq 0x2223(%rip), %rsi      # 0x8061
callq 0x21d0
movzbl 0x36c(%rsp), %esi
movq %rax, %rdi
callq 0x22a0
movq %rax, %rdi
callq 0x20c0
movzbl 0x36c(%rsp), %eax
decl %eax
cmpl $0xa, %eax
ja 0x5f6a
leaq 0x158b(%rip), %rdx      # 0x7400
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
movl %ebx, %r12d
jmpq *%rax
movb $0x1, %al
testb $0x1, %r13b
movq 0x10(%rsp), %rbx
jne 0x5f84
movzwl 0x384(%rsp), %ecx
movq %rcx, 0x28(%rsp)
movzwl %cx, %ecx
movq 0x40(%rsp), %rdi
cmpl %ecx, %edi
sete %dl
movq %rdx, 0x78(%rsp)
movq 0x98(%rsp), %rsi
testq %rsi, %rsi
movq 0x90(%rsp), %rdx
je 0x5ecb
cmpl %ecx, %edi
sete (%rsi)
movl 0x388(%rsp), %esi
movl $0x0, 0xc(%rsp)
movl 0x3c0(%rsp), %ecx
movq %rcx, 0x50(%rsp)
testq %rdx, %rdx
movl %esi, 0x4(%rsp)
je 0x5f84
movq 0x28(%rsp), %rcx
movw %cx, (%rdx)
movl %esi, 0x4(%rdx)
jmp 0x5f84
movb $0x1, %al
movq %rax, 0x60(%rsp)
jmp 0x5f13
movb $0x1, %al
movq %rax, 0x30(%rsp)
movl %r13d, %eax
movq 0x10(%rsp), %rbx
jmp 0x5f84
testb $0x1, 0x20(%rsp)
movq 0x10(%rsp), %rbx
jne 0x5f7a
movl 0x4(%rsp), %eax
cmpl %eax, 0x388(%rsp)
jne 0x5f72
movq 0x28(%rsp), %rax
cmpw %ax, 0x384(%rsp)
sete %al
movl %eax, 0x8(%rsp)
jmp 0x5f7a
movb $0x1, %al
movq %rax, 0x58(%rsp)
movq 0xc0(%rsp), %rax
testq %rax, %rax
movq 0x10(%rsp), %rbx
je 0x5f81
movb $0x1, (%rax)
jmp 0x5f81
movl %r13d, %eax
movl %ebx, %r12d
jmp 0x5f16
movl $0x0, 0x8(%rsp)
movb $0x1, %al
movq %rax, 0x20(%rsp)
movl %r13d, %eax
movl %eax, %r14d
movl %ebp, %eax
jmp 0x5d79
testb $0x1, %r14b
je 0x600e
cmpw $0x0, 0x88(%rsp)
setne %al
movq 0x20(%rsp), %rcx
notb %cl
cmpl $0x0, 0x50(%rsp)
setne %dl
andb %cl, %dl
andb %al, %dl
cmpb $0x1, %dl
movq 0x30(%rsp), %r15
movl 0x4(%rsp), %ebp
jne 0x603c
movl %r12d, %edi
leaq 0x80(%rsp), %rsi
leaq 0x266(%rsp), %rdx
leaq 0x164(%rsp), %rcx
pushq $0xa
popq %r8
movl (%rsp), %r9d
callq 0x5916
jmp 0x603c
movl 0x4(%rsp), %ebp
movl %ebp, 0x6c(%rsp)
movq 0x50(%rsp), %rax
movl %eax, 0x84(%rsp)
movq 0x28(%rsp), %rax
movw %ax, 0x68(%rsp)
jmp 0x5cba
movl %r12d, %edi
movq 0x48(%rsp), %rsi
leaq 0x266(%rsp), %rdx
leaq 0x164(%rsp), %rcx
pushq $0x1
popq %r8
movl (%rsp), %r9d
callq 0x5916
movq 0x30(%rsp), %r15
movl 0x4(%rsp), %ebp
movq %r15, 0x30(%rsp)
testb $0x1, %r15b
jne 0x606b
movl %ebx, %edi
movq 0x48(%rsp), %rsi
leaq 0x266(%rsp), %rdx
leaq 0x164(%rsp), %rcx
pushq $0x2
popq %r8
movl (%rsp), %r9d
callq 0x5916
testb $0x1, 0x60(%rsp)
jne 0x6096
movl %ebx, %edi
movq 0x48(%rsp), %rsi
leaq 0x266(%rsp), %rdx
leaq 0x164(%rsp), %rcx
pushq $0x3
popq %r8
movl (%rsp), %r9d
callq 0x5916
incl 0xc(%rsp)
testb $0x1, %r14b
je 0x5cba
testb $0x1, 0x58(%rsp)
jne 0x5cba
testl %ebp, %ebp
je 0x5cba
cmpw $0x0, 0x28(%rsp)
je 0x5cba
movl %r12d, %edi
leaq 0x68(%rsp), %rsi
leaq 0x266(%rsp), %rdx
leaq 0x164(%rsp), %rcx
pushq $0xb
popq %r8
movl (%rsp), %r9d
callq 0x5916
jmp 0x5cba
xorl %edi, %edi
movl %ebp, %esi
xorl %edx, %edx
callq 0x67f4
movl %eax, %ebx
cmpl $-0x1, %eax
je 0x6106
movl %ebx, %edi
callq 0x22c0
movzbl 0x60(%rsp), %eax
cmpb $0x0, 0x1c(%rsp)
movq 0x30(%rsp), %r15
je 0x6264
xorl %ebp, %ebp
cmpl $-0x1, %ebx
sete %bpl
movq 0x4e8d(%rip), %r12      # 0xafb8
movl %eax, (%rsp)
leaq 0x1f32(%rip), %rsi      # 0x8067
movq %r12, %rdi
callq 0x21d0
movzbl %r14b, %esi
andl $0x1, %esi
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
callq 0x20c0
leaq 0x1f16(%rip), %rsi      # 0x8071
movq %r12, %rdi
callq 0x21d0
movq %r15, %r13
movzbl %r15b, %esi
andl $0x1, %esi
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
callq 0x20c0
leaq 0x1ef8(%rip), %rsi      # 0x807c
movq %r12, %rdi
callq 0x21d0
movl (%rsp), %esi
andl $0x1, %esi
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
callq 0x20c0
leaq 0x1edf(%rip), %rsi      # 0x8088
movq %r12, %rdi
callq 0x21d0
movzbl 0x20(%rsp), %esi
andl $0x1, %esi
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
callq 0x20c0
leaq 0x1ec5(%rip), %rsi      # 0x8095
movq %r12, %rdi
callq 0x21d0
movq %rax, %rdi
movl %ebp, %esi
callq 0x2280
movq %rax, %rdi
callq 0x20c0
leaq 0x1eaf(%rip), %rsi      # 0x80a0
movq %r12, %rdi
callq 0x21d0
movzbl 0x8(%rsp), %esi
andl $0x1, %esi
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
callq 0x20c0
leaq 0x1e9a(%rip), %rsi      # 0x80b2
movq %r12, %rdi
callq 0x21d0
movzbl 0x58(%rsp), %esi
andl $0x1, %esi
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
callq 0x20c0
leaq 0x1e7e(%rip), %rsi      # 0x80bd
movq %r12, %rdi
callq 0x21d0
movzbl 0x78(%rsp), %esi
andl $0x1, %esi
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
callq 0x20c0
movl (%rsp), %eax
jmp 0x6267
movq %r15, %r13
testb $0x1, %r14b
pushq $0x3
popq %rbp
je 0x62e5
cmpl $-0x1, %ebx
je 0x62f9
testb $0x1, %r13b
pushq $0x2
popq %rax
pushq $0x8
popq %rbp
cmovnel %eax, %ebp
jmp 0x62e5
movl %eax, %ebp
movq 0x4d5f(%rip), %rdi      # 0xaff0
leaq 0x1d97(%rip), %rsi      # 0x802f
callq 0x21d0
movq %rax, %rdi
movl %ebp, %esi
callq 0x22a0
leaq 0x11d7(%rip), %rsi      # 0x7485
movq %rax, %rdi
callq 0x21d0
movq %rax, %rbx
movl %ebp, %edi
callq 0x2090
movq %rbx, %rdi
movq %rax, %rsi
callq 0x21d0
leaq 0x1d64(%rip), %rsi      # 0x8036
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x20c0
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x1038, %rsp           # imm = 0x1038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb $0x1, 0x8(%rsp)
je 0x630a
testb $0x1, %r13b
je 0x630e
pushq $0x4
jmp 0x62e4
pushq $0x7
jmp 0x62e4
andl $0x1, %eax
pushq $0x6
popq %rbp
subl %eax, %ebp
jmp 0x62e5
leaq 0x1d22(%rip), %rdi      # 0x8041
leaq 0x1427(%rip), %rsi      # 0x774d
leaq 0x1c84(%rip), %rcx      # 0x7fb1
movl $0x7d5, %edx            # imm = 0x7D5
callq 0x2120
leaq 0x1b88(%rip), %rdi      # 0x7ec6
leaq 0x1408(%rip), %rsi      # 0x774d
leaq 0x1c65(%rip), %rcx      # 0x7fb1
movl $0x75b, %edx            # imm = 0x75B
callq 0x2120
leaq 0x1b78(%rip), %rdi      # 0x7ed5
leaq 0x13e9(%rip), %rsi      # 0x774d
leaq 0x1c46(%rip), %rcx      # 0x7fb1
movl $0x75c, %edx            # imm = 0x75C
callq 0x2120