// File: /workspace/github_cpp_makefile_star2_O3/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 0xcf06(%rip), %rsi      # 0x1301c
movq %r15, %rdi
callq 0x30e0
testl %eax, %eax
je 0x62b5
leaq 0xd0f6(%rip), %rsi      # 0x13223
movq %r15, %rdi
callq 0x30e0
testl %eax, %eax
je 0x633a
leaq 0xd10c(%rip), %rsi      # 0x13250
movq %r15, %rdi
callq 0x30e0
testl %eax, %eax
jne 0x6435
cmpq $0x0, 0x90(%rbx)
je 0x6435
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 0x6c4b
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 0x61de
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 0x61de
movq %rax, 0xa0(%rbx)
leaq 0x258(%r14), %r13
leal -0x69780(%r14), %r12d
addq $-0x93a80, %r14         # imm = 0xFFF6C580
cmpq 0x18(%rsp), %r15
setne %bpl
je 0x629d
movl 0x20(%r15), %eax
cmpl $0x5f5e101, %eax        # imm = 0x5F5E101
setb %cl
movl %eax, %eax
cmpq %rax, %r13
setl %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0x6224
movl %r12d, 0x20(%r15)
movq %r12, %rax
cmpq %rax, %r14
jge 0x6261
movq 0x90(%rbx), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x6259
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 0x6261
movq %r15, %rdx
callq 0x6f4c
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 0x61f3
movq $0x1, 0xa0(%rbx)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x6437
callq 0x33d0
jmp 0x6437
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0xab1c
leaq 0x40(%rsp), %rdi
callq 0xab1c
movq $0x1, 0x8(%rsp)
leaq 0x60(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x6662
leaq 0xc0(%rbx), %rsi
movq %r14, %rdi
movl $0x8, %edx
callq 0x6662
leaq 0x38(%rsp), %rsi
movq %r14, %rdi
movl $0x8, %edx
callq 0x6662
movl 0x20(%r14), %edx
movl 0x24(%r14), %ecx
movq %r12, %rdi
movq %r14, %rsi
callq 0x6a58
movl 0x60(%rbx), %eax
cmpl $0x283c, %eax           # imm = 0x283C
jne 0x634f
movl $0x12c, (%r15)          # imm = 0x12C
movl $0x12c, %eax            # imm = 0x12C
jmp 0x6358
movl 0x60(%rbx), %eax
movl $0x11500, %ecx          # imm = 0x11500
cmpl %ecx, %eax
cmovll %eax, %ecx
movl %ecx, 0x54(%rbx)
jmp 0x642d
cmpl $0x6a, %eax
jl 0x6427
movq 0x8(%r14), %rcx
subq (%r14), %rcx
movl 0x18(%r14), %edx
cmpq %rdx, %rcx
je 0x639b
movl 0x20(%r14), %edx
movl 0x24(%r14), %ecx
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x6a58
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
movl $0x8, %edx
callq 0x6662
movl (%r15), %eax
cmpl $0x6a, %eax
jl 0x6427
movq 0x8(%r14), %rcx
subq (%r14), %rcx
movl 0x18(%r14), %edx
cmpq %rdx, %rcx
je 0x63c2
leaq 0x68(%rbx), %rsi
movl 0x20(%r14), %edx
movl 0x24(%r14), %ecx
movq %r14, %rdi
callq 0x6b36
movl 0x60(%rbx), %eax
cmpl $0xd1, %eax
jl 0x6427
movq 0x8(%r14), %rax
subq (%r14), %rax
movl 0x18(%r14), %ecx
cmpq %rcx, %rax
je 0x63f7
leaq 0x88(%rbx), %rsi
movq %r14, %rdi
movl $0x4, %edx
callq 0x6662
movl 0x60(%rbx), %eax
cmpl $0xd0, %eax
jle 0x6427
leaq 0xce25(%rip), %rsi      # 0x13223
movq %rbx, %rdi
callq 0x5686
movq %rbx, %rdi
callq 0x56f2
movl 0x60(%rbx), %eax
movl $0x11500, %ecx          # imm = 0x11500
cmpl %ecx, %eax
cmovll %eax, %ecx
movl %ecx, 0x2c(%rbx)
cmpl $0xd0, %eax
jle 0x642a
jmp 0x6435
movl %eax, 0x2c(%rbx)
movl %eax, 0x54(%rbx)
movq %rbx, %rdi
callq 0x69ee
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x644a
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x645c
callq 0x33d0
movq %rbx, %rdi
callq 0x3650