// File: /workspace/github_cpp_makefile_star2_O1/tenup-coin[P]seeder/bitcoin.cpp
// Function: CNode::ProcessMessage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, CDataStream&)
bool ProcessMessage(string strCommand, CDataStream& vRecv) {
    //printf("%s: RECV %s\n", ToString(you).c_str(), strCommand.c_str());
    if (strCommand == "version") {
      int64 nTime;
      CAddress addrMe;
      CAddress addrFrom;
      uint64 nNonce = 1;
      vRecv >> nVersion >> you.nServices >> nTime >> addrMe;
      if (nVersion == 10300) nVersion = 300;
      if (nVersion >= 106 && !vRecv.empty())
        vRecv >> addrFrom >> nNonce;
      if (nVersion >= 106 && !vRecv.empty())
        vRecv >> strSubVer;
      if (nVersion >= 209 && !vRecv.empty())
        vRecv >> nStartingHeight;
      
      if (nVersion >= 209) {
        BeginMessage("verack");
        EndMessage();
      }
      vSend.SetVersion(min(nVersion, PROTOCOL_VERSION));
      if (nVersion < 209) {
        this->vRecv.SetVersion(min(nVersion, PROTOCOL_VERSION));
        GotVersion();
      }
      return false;
    }
    
    if (strCommand == "verack") {
      this->vRecv.SetVersion(min(nVersion, PROTOCOL_VERSION));
      GotVersion();
      return false;
    }
    
    if (strCommand == "addr" && vAddr) {
      vector<CAddress> vAddrNew;
      vRecv >> vAddrNew;
       //printf("%s: got %i addresses\n", ToString(you).c_str(), (int)vAddrNew.size());
      int64 now = time(NULL);
      vector<CAddress>::iterator it = vAddrNew.begin();
      if (vAddrNew.size() > 1) {
        if (doneAfter == 0 || doneAfter > now + 1) doneAfter = now + 1;
      }
      while (it != vAddrNew.end()) {
        CAddress &addr = *it;
        //printf("%s: got address %s\n", ToString(you).c_str(), addr.ToString().c_str(), (int)(vAddr->size()));
        it++;
        if (addr.nTime <= 100000000 || addr.nTime > now + 600)
          addr.nTime = now - 5 * 86400;
        if (addr.nTime > now - 604800)
          vAddr->push_back(addr);
        //printf("%s: added address %s (#%i)\n", ToString(you).c_str(), addr.ToString().c_str(), (int)(vAddr->size()));
        if (vAddr->size() > 1000) {doneAfter = 1; return true; }
      }
      return false;
    }
    
    return false;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xcea4(%rip), %rsi      # 0x1301c
movq %r15, %rdi
callq 0x30e0
testl %eax, %eax
je 0x6317
leaq 0xd094(%rip), %rsi      # 0x13223
movq %r15, %rdi
callq 0x30e0
testl %eax, %eax
je 0x6464
leaq 0xd0aa(%rip), %rsi      # 0x13250
movq %r15, %rdi
callq 0x30e0
testl %eax, %eax
jne 0x647c
cmpq $0x0, 0x90(%rbx)
je 0x647c
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movl 0x20(%r14), %edx
movl 0x24(%r14), %ecx
leaq 0x40(%rsp), %r8
movq %r14, %rdi
callq 0x6cad
xorl %edi, %edi
callq 0x33c0
movq %rax, %r14
movq 0x10(%rsp), %r15
movq 0x18(%rsp), %rax
subq %r15, %rax
sarq $0x3, %rax
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rcx, %rax
cmpq $0x2, %rax
jb 0x6240
movq 0xa0(%rbx), %rcx
testq %rcx, %rcx
sete %dl
leaq 0x1(%r14), %rax
cmpq %rax, %rcx
setg %cl
orb %dl, %cl
cmpb $0x1, %cl
jne 0x6240
movq %rax, 0xa0(%rbx)
leaq 0x258(%r14), %r13
leal -0x69780(%r14), %r12d
addq $-0x93a80, %r14         # imm = 0xFFF6C580
cmpq 0x18(%rsp), %r15
setne %bpl
je 0x62ff
movl 0x20(%r15), %eax
cmpl $0x5f5e101, %eax        # imm = 0x5F5E101
setb %cl
movl %eax, %eax
cmpq %rax, %r13
setl %al
orb %cl, %al
cmpb $0x1, %al
jne 0x6282
movl %r12d, 0x20(%r15)
movl 0x20(%r15), %eax
cmpq %rax, %r14
jge 0x62c3
movq 0x90(%rbx), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x62bb
movq 0x20(%r15), %rax
movq %rax, 0x20(%rsi)
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
addq $0x28, 0x8(%rdi)
jmp 0x62c3
movq %r15, %rdx
callq 0x6fe4
movq 0x90(%rbx), %rax
movq 0x8(%rax), %rcx
subq (%rax), %rcx
addq $0x28, %r15
sarq $0x3, %rcx
movabsq $-0x3333333333333333, %rax # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rcx
cmpq $0x3e9, %rcx            # imm = 0x3E9
jb 0x6255
movq $0x1, 0xa0(%rbx)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x647e
callq 0x33d0
jmp 0x647e
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0xacac
leaq 0x40(%rsp), %rdi
callq 0xacac
movq $0x1, 0x8(%rsp)
leaq 0x60(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x66c6
leaq 0xc0(%rbx), %rsi
movq %r14, %rdi
movl $0x8, %edx
callq 0x66c6
leaq 0x38(%rsp), %rsi
movq %r14, %rdi
movl $0x8, %edx
callq 0x66c6
movl 0x20(%r14), %edx
movl 0x24(%r14), %ecx
movq %r12, %rdi
movq %r14, %rsi
callq 0x6ab4
cmpl $0x283c, 0x60(%rbx)     # imm = 0x283C
jne 0x6394
movl $0x12c, (%r15)          # imm = 0x12C
cmpl $0x6a, (%r15)
jl 0x63d1
movq 0x8(%r14), %rax
subq (%r14), %rax
movl 0x18(%r14), %ecx
cmpq %rcx, %rax
je 0x63d1
movl 0x20(%r14), %edx
movl 0x24(%r14), %ecx
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x6ab4
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
movl $0x8, %edx
callq 0x66c6
cmpl $0x6a, (%r15)
jl 0x63fb
movq 0x8(%r14), %rax
subq (%r14), %rax
movl 0x18(%r14), %ecx
cmpq %rcx, %rax
je 0x63fb
leaq 0x68(%rbx), %rsi
movl 0x20(%r14), %edx
movl 0x24(%r14), %ecx
movq %r14, %rdi
callq 0x6b8c
cmpl $0xd1, (%r15)
jl 0x6428
movq 0x8(%r14), %rax
subq (%r14), %rax
movl 0x18(%r14), %ecx
cmpq %rcx, %rax
je 0x6428
leaq 0x88(%rbx), %rsi
movq %r14, %rdi
movl $0x4, %edx
callq 0x66c6
cmpl $0xd1, (%r15)
jl 0x6448
leaq 0xcdeb(%rip), %rsi      # 0x13223
movq %rbx, %rdi
callq 0x56e6
movq %rbx, %rdi
callq 0x5752
movl 0x60(%rbx), %eax
movl $0x11500, %ecx          # imm = 0x11500
cmpl %ecx, %eax
cmovll %eax, %ecx
movl %ecx, 0x2c(%rbx)
cmpl $0xd0, %eax
jg 0x647c
movl %eax, 0x54(%rbx)
jmp 0x6474
movl 0x60(%rbx), %eax
movl $0x11500, %ecx          # imm = 0x11500
cmpl %ecx, %eax
cmovll %eax, %ecx
movl %ecx, 0x54(%rbx)
movq %rbx, %rdi
callq 0x6a4a
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6491
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x64a3
callq 0x33d0
movq %rbx, %rdi
callq 0x3650