// File: /workspace/github_cpp_makefile_star2_O2/Distrotech[P]stund/stun.cxx
// Function: stunTest(StunAddress4&, int, bool, StunAddress4*)
void 
stunTest( StunAddress4& dest, int testNum, bool verbose, StunAddress4* sAddr )
{ 
   assert( dest.addr != 0 );
   assert( dest.port != 0 );
	
   int port = stunRandomPort();
   UInt32 interfaceIp=0;
   if (sAddr)
   {
      interfaceIp = sAddr->addr;
      if ( sAddr->port != 0 )
      {
        port = sAddr->port;
      }
   }
   Socket myFd = openPort(port,interfaceIp,verbose);
	
   StunAtrString username;
   StunAtrString password;
	
   username.sizeValue = 0;
   password.sizeValue = 0;
	
#ifdef USE_TLS
   stunGetUserNameAndPassword( dest, username, password );
#endif
	
   stunSendTest( myFd, dest, username, password, testNum, verbose );
    
   char msg[STUN_MAX_MESSAGE_SIZE];
   int msgLen = STUN_MAX_MESSAGE_SIZE;
	
   StunAddress4 from;
   getMessage( myFd,
               msg,
               &msgLen,
               &from.addr,
               &from.port,verbose );
	
   StunMessage resp;
   memset(&resp, 0, sizeof(StunMessage));
	
   if ( verbose ) clog << "Got a response" << endl;
   bool ok = stunParseMessage( msg,msgLen, resp,verbose );
	
   if ( verbose )
   {
      clog << "\t ok=" << ok << endl;
      clog << "\t id=" << resp.msgHdr.id << endl;
      clog << "\t mappedAddr=" << resp.mappedAddress.ipv4 << endl;
      clog << "\t changedAddr=" << resp.changedAddress.ipv4 << endl;
      clog << endl;
   }
	
   if (sAddr)
   {
      sAddr->port = resp.mappedAddress.ipv4.port;
      sAddr->addr = resp.mappedAddress.ipv4.addr;
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xee0, %rsp            # imm = 0xEE0
cmpl $0x0, 0x4(%rdi)
je 0x58d8
movq %rdi, %r15
cmpw $0x0, (%rdi)
je 0x58f7
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r14d
callq 0x40cb
testq %rbx, %rbx
je 0x574e
movl 0x4(%rbx), %esi
movzwl (%rbx), %ecx
testl %ecx, %ecx
cmovnel %ecx, %eax
jmp 0x5750
xorl %esi, %esi
movzbl %bpl, %ebp
movl %eax, %edi
movl %ebp, %edx
callq 0x67f4
movl %eax, %r12d
leaq 0x5de(%rsp), %rdx
andw $0x0, 0x100(%rdx)
leaq 0x4dc(%rsp), %rcx
andw $0x0, 0x100(%rcx)
movl %eax, %edi
movq %r15, %rsi
movl %r14d, %r8d
movl %ebp, %r9d
callq 0x5916
leaq 0x8(%rsp), %rdx
movl $0x800, (%rdx)          # imm = 0x800
leaq 0x10(%rsp), %rcx
leaq 0x6e0(%rsp), %rsi
leaq 0xc(%rsp), %r8
movl %r12d, %edi
movl %ebp, %r9d
callq 0x6a0e
leaq 0x14(%rsp), %rdi
movl $0x4c8, %edx            # imm = 0x4C8
xorl %esi, %esi
callq 0x2110
testb %bpl, %bpl
je 0x57e9
movq 0x57e3(%rip), %rdi      # 0xafb8
leaq 0x279d(%rip), %rsi      # 0x7f79
callq 0x21d0
movq %rax, %rdi
callq 0x20c0
movl 0x8(%rsp), %esi
leaq 0x6e0(%rsp), %rdi
leaq 0x14(%rsp), %rdx
movl %ebp, %ecx
callq 0x2d54
testb %bpl, %bpl
je 0x58b4
movl %eax, %r15d
movq 0x57a4(%rip), %r14      # 0xafb8
leaq 0x276d(%rip), %rsi      # 0x7f88
movq %r14, %rdi
callq 0x21d0
movzbl %r15b, %esi
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
callq 0x20c0
leaq 0x2750(%rip), %rsi      # 0x7f8e
movq %r14, %rdi
callq 0x21d0
movq %rax, %r15
leaq 0x18(%rsp), %rsi
movq %rax, %rdi
callq 0x429e
movq %r15, %rdi
callq 0x20c0
leaq 0x272f(%rip), %rsi      # 0x7f94
movq %r14, %rdi
callq 0x21d0
movq %rax, %r15
leaq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x3732
movq %r15, %rdi
callq 0x20c0
leaq 0x2716(%rip), %rsi      # 0x7fa2
movq %r14, %rdi
callq 0x21d0
movq %rax, %r15
leaq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0x3732
movq %r15, %rdi
callq 0x20c0
movq %r14, %rdi
callq 0x20c0
testq %rbx, %rbx
je 0x58c8
movzwl 0x30(%rsp), %eax
movw %ax, (%rbx)
movl 0x34(%rsp), %eax
movl %eax, 0x4(%rbx)
addq $0xee0, %rsp            # imm = 0xEE0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x25e7(%rip), %rdi      # 0x7ec6
leaq 0x1e67(%rip), %rsi      # 0x774d
leaq 0x2653(%rip), %rcx      # 0x7f40
movl $0x716, %edx            # imm = 0x716
callq 0x2120
leaq 0x25d7(%rip), %rdi      # 0x7ed5
leaq 0x1e48(%rip), %rsi      # 0x774d
leaq 0x2634(%rip), %rcx      # 0x7f40
movl $0x717, %edx            # imm = 0x717
callq 0x2120