// File: /workspace/github_cpp_makefile_star2_O3/tenup-coin[P]seeder/bitcoin.cpp
// Function: CNode::Run()
bool Run() {
    bool res = true;
    if (!ConnectSocket(you, sock)) return false;
    PushVersion();
    Send();
    int64 now;
    while (now = time(NULL), ban == 0 && (doneAfter == 0 || doneAfter > now) && sock != INVALID_SOCKET) {
      char pchBuf[0x10000];
      fd_set set;
      FD_ZERO(&set);
      FD_SET(sock,&set);
      struct timeval wa;
      if (doneAfter) {
        wa.tv_sec = doneAfter - now;
        wa.tv_usec = 0;
      } else {
        wa.tv_sec = GetTimeout();
        wa.tv_usec = 0;
      }
      int ret = select(sock+1, &set, NULL, &set, &wa);
      if (ret != 1) {
        if (!doneAfter) res = false;
        break;
      }
      int nBytes = recv(sock, pchBuf, sizeof(pchBuf), 0);
      int nPos = vRecv.size();
      if (nBytes > 0) {
        vRecv.resize(nPos + nBytes);
        memcpy(&vRecv[nPos], pchBuf, nBytes);
      } else if (nBytes == 0) {
         //printf("%s: BAD (connection closed prematurely)\n", ToString(you).c_str());
        res = false;
        break;
      } else {
         //printf("%s: BAD (connection error)\n", ToString(you).c_str());
        res = false;
        break;
      }
      ProcessMessages();
      Send();
    }
    if (sock == INVALID_SOCKET) res = false;
    close(sock);
    sock = INVALID_SOCKET;
    return (ban == 0) && res;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x100a8, %rsp          # imm = 0x100A8
movq %rdi, %rbx
leaq 0xa8(%rdi), %r14
leaq 0x175a0(%rip), %rax     # 0x1c3b0
movl (%rax), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x79d2
testb %al, %al
je 0x4fbf
movq %rbx, %rdi
callq 0x50e6
movq %rbx, %rdi
callq 0x52a4
xorl %edi, %edi
callq 0x33c0
movb $0x1, %r15b
cmpl $0x0, 0x98(%rbx)
jne 0x4fd4
leaq 0x30(%rbx), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x20(%rsp), %r12
leaq 0xa0(%rsp), %r15
movq 0xa0(%rbx), %rsi
testq %rsi, %rsi
setne %cl
movq %rsi, %rdx
subq %rax, %rdx
setle %al
testb %al, %cl
jne 0x4fba
movl (%rbx), %ecx
cmpl $-0x1, %ecx
je 0x4fba
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movl $0x1, %eax
shlq %cl, %rax
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movl %ecx, %edi
shrl $0x6, %edi
orq %rax, 0x20(%rsp,%rdi,8)
testq %rsi, %rsi
je 0x4ee3
movq %rdx, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
jmp 0x4f0b
movq %r14, %rdi
callq 0x92aa
testb %al, %al
movl $0x1e, %eax
movl $0x78, %ecx
cmovneq %rcx, %rax
movq %rax, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movl (%rbx), %ecx
incl %ecx
movl %ecx, %edi
movq %r12, %rsi
xorl %edx, %edx
movq %r12, %rcx
leaq 0x8(%rsp), %r8
callq 0x33e0
cmpl $0x1, %eax
jne 0x4fc3
movl (%rbx), %edi
movl $0x10000, %edx          # imm = 0x10000
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x3140
movq %rax, %r13
testl %r13d, %r13d
jle 0x4fd1
movq 0x38(%rbx), %rbp
movl 0x48(%rbx), %eax
movq 0x30(%rbx), %rcx
addq %rax, %rcx
subq %rcx, %rbp
leal (%rbp,%r13), %ecx
movslq %ecx, %rsi
movb $0x0, 0x7(%rsp)
addq %rax, %rsi
movq 0x18(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x5db4
movslq %ebp, %rax
movl 0x48(%rbx), %edi
addq 0x30(%rbx), %rdi
addq %rax, %rdi
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movq %r15, %rsi
movq %r13, %rdx
callq 0x3350
movq %rbx, %rdi
callq 0x5302
movq %rbx, %rdi
callq 0x52a4
xorl %edi, %edi
callq 0x33c0
cmpl $0x0, 0x98(%rbx)
je 0x4e62
movb $0x1, %r15b
jmp 0x4fd4
xorl %eax, %eax
jmp 0x4ff8
cmpq $0x0, 0xa0(%rbx)
setne %r15b
jmp 0x4fd4
xorl %r15d, %r15d
movl (%rbx), %edi
cmpl $-0x1, %edi
setne %bpl
callq 0x36e0
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
cmpl $0x0, 0x98(%rbx)
sete %al
andb %bpl, %al
andb %r15b, %al
addq $0x100a8, %rsp          # imm = 0x100A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq