// File: /workspace/github_cpp_makefile_star2_O1/tenup-coin[P]seeder/main.cpp
// Function: ThreadDumper
void* ThreadDumper(void*) {
  int count = 0;
  do {
    Sleep(100000 << count); // First 100s, than 200s, 400s, 800s, 1600s, and then 3200s forever
    if (count < 5)
        count++;
    {
      vector<CAddrReport> v = db.GetAll();
      sort(v.begin(), v.end(), StatCompare);
      FILE *f = fopen("dnsseed.dat.new","w+");
      if (f) {
        {
          CAutoFile cf(f);
          cf << db;
        }
        rename("dnsseed.dat.new", "dnsseed.dat");
      }
      FILE *d = fopen("dnsseed.dump", "w");
      fprintf(d, "# address                                        good  lastSuccess    %%(2h)   %%(8h)   %%(1d)   %%(7d)  %%(30d)  blocks      svcs  version\n");
      double stat[5]={0,0,0,0,0};
      for (vector<CAddrReport>::const_iterator it = v.begin(); it < v.end(); it++) {
        CAddrReport rep = *it;
        fprintf(d, "%-47s  %4d  %11" PRId64 "  %6.2f%% %6.2f%% %6.2f%% %6.2f%% %6.2f%%  %6i  %08" PRIx64 "  %5i \"%s\"\n", rep.ip.ToString().c_str(), (int)rep.fGood, rep.lastSuccess, 100.0*rep.uptime[0], 100.0*rep.uptime[1], 100.0*rep.uptime[2], 100.0*rep.uptime[3], 100.0*rep.uptime[4], rep.blocks, rep.services, rep.clientVersion, rep.clientSubVersion.c_str());
        stat[0] += rep.uptime[0];
        stat[1] += rep.uptime[1];
        stat[2] += rep.uptime[2];
        stat[3] += rep.uptime[3];
        stat[4] += rep.uptime[4];
      }
      fclose(d);
      FILE *ff = fopen("dnsstats.log", "a");
      fprintf(ff, "%llu %g %g %g %g %g\n", (unsigned long long)(time(NULL)), stat[0], stat[1], stat[2], stat[3], stat[4]);
      fclose(ff);
    }
  } while(1);
  return nullptr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
leaq 0x90(%rsp), %rbx
leaq 0xa0(%rsp), %rbp
leaq 0x48(%rsp), %r14
leaq 0x30(%rsp), %r12
leaq 0x622a(%rip), %r15      # 0x13b81
xorl %r13d, %r13d
movl $0x186a0, %eax          # imm = 0x186A0
movl %r13d, %ecx
shll %cl, %eax
cltq
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rcx
addl %edx, %ecx
movslq %ecx, %rcx
movq %rcx, 0x48(%rsp)
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
subl %ecx, %eax
imull $0xf4240, %eax, %eax    # imm = 0xF4240
cltq
movq %rax, 0x50(%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x3100
cmpl $0x5, %r13d
adcl $0x0, %r13d
movl %r13d, 0x2c(%rsp)
movq %r12, %rdi
leaq 0xead0(%rip), %rsi      # 0x1c488
callq 0xec7e
movq 0x30(%rsp), %r12
movq 0x38(%rsp), %r13
cmpq %r13, %r12
je 0xda07
movq %r13, %rax
subq %r12, %rax
sarq $0x7, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r13, %rsi
leaq -0xf9(%rip), %rcx       # 0xd8f7
callq 0x1067f
movq %r12, %rdi
movq %r13, %rsi
leaq -0x10b(%rip), %rdx      # 0xd8f7
callq 0x1078b
leaq 0x60ba(%rip), %rdi      # 0x13ac8
leaq 0x60c3(%rip), %rsi      # 0x13ad8
callq 0x3460
testq %rax, %rax
je 0xda65
movq %rax, 0x48(%rsp)
movl $0x11500, 0x58(%rsp)    # imm = 0x11500
movabsq $0x200050000, %rax      # imm = 0x200050000
movq %rax, 0x50(%rsp)
movq %r14, %rdi
leaq 0xea43(%rip), %rsi      # 0x1c488
callq 0xed88
movq %r14, %rdi
callq 0xfeee
leaq 0x606f(%rip), %rdi      # 0x13ac8
leaq 0x607b(%rip), %rsi      # 0x13adb
callq 0x3260
leaq 0x607b(%rip), %rdi      # 0x13ae7
leaq 0x6063(%rip), %rsi      # 0x13ad6
callq 0x3460
movq %rax, %r12
movq %rax, %rdi
leaq 0x606f(%rip), %rsi      # 0x13af4
xorl %eax, %eax
callq 0x3570
movq 0x30(%rsp), %r13
xorpd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd %xmm0, (%rsp)
movsd %xmm0, 0x8(%rsp)
movsd %xmm0, 0x18(%rsp)
movsd %xmm0, 0x20(%rsp)
cmpq 0x38(%rsp), %r13
jae 0xdc46
movsd %xmm0, 0x20(%rsp)
movsd %xmm0, 0x18(%rsp)
movsd %xmm0, 0x8(%rsp)
movsd %xmm0, (%rsp)
movsd %xmm0, 0x10(%rsp)
movl $0x9, %ecx
movq %r14, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rbp, 0x90(%rsp)
movq 0x48(%r13), %rsi
movq 0x50(%r13), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x7106
movq 0x78(%r13), %rax
movq %rax, 0x30(%rbx)
movupd 0x68(%r13), %xmm0
movupd %xmm0, 0x20(%rbx)
leaq 0xc8(%rsp), %rdi
movq %r14, %rsi
callq 0xa476
movq 0xc8(%rsp), %rdx
movzbl 0xb8(%rsp), %ecx
movq 0xb0(%rsp), %r8
movsd 0x68(%rsp), %xmm0
movsd 0x5f24(%rip), %xmm5     # 0x13a70
mulsd %xmm5, %xmm0
movsd 0x70(%rsp), %xmm1
mulsd %xmm5, %xmm1
movsd 0x78(%rsp), %xmm2
mulsd %xmm5, %xmm2
movsd 0x80(%rsp), %xmm3
mulsd %xmm5, %xmm3
movsd 0x88(%rsp), %xmm4
mulsd %xmm5, %xmm4
movl 0x5c(%rsp), %r10d
movl 0x60(%rsp), %r9d
subq $0x8, %rsp
movq %r12, %rdi
movq %r15, %rsi
movb $0x5, %al
pushq 0x98(%rsp)
pushq %r10
pushq 0xd8(%rsp)
callq 0x3570
addq $0x20, %rsp
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0xdbc7
callq 0x33d0
movsd 0x10(%rsp), %xmm0
addsd 0x68(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd (%rsp), %xmm0
addsd 0x70(%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd 0x8(%rsp), %xmm0
addsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x18(%rsp), %xmm0
addsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x20(%rsp), %xmm0
addsd 0x88(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x90(%rsp), %rdi
cmpq %rbp, %rdi
je 0xdc37
callq 0x33d0
subq $-0x80, %r13
cmpq 0x38(%rsp), %r13
jb 0xdada
movq %r12, %rdi
callq 0x33f0
leaq 0x5f7e(%rip), %rdi      # 0x13bd3
leaq 0x557b(%rip), %rsi      # 0x131d7
callq 0x3460
movq %rax, %r12
xorl %edi, %edi
callq 0x33c0
movq %r12, %rdi
leaq 0x5f6b(%rip), %rsi      # 0x13be0
movq %rax, %rdx
movsd 0x10(%rsp), %xmm0
movsd (%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
movsd 0x18(%rsp), %xmm3
movsd 0x20(%rsp), %xmm4
movb $0x5, %al
callq 0x3570
movq %r12, %rdi
callq 0x33f0
leaq 0x30(%rsp), %r12
movq %r12, %rdi
callq 0xee18
movl 0x2c(%rsp), %r13d
jmp 0xd95a
jmp 0xdccc
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xfeee
jmp 0xdcf0
movq %rax, %rdi
callq 0x50b0
jmp 0xdcd6
movq %rax, %rbx
jmp 0xdcf0
movq %rax, %rbx
movq 0x90(%rsp), %rdi
cmpq %rbp, %rdi
je 0xdcf0
callq 0x33d0
leaq 0x30(%rsp), %rdi
callq 0xee18
movq %rbx, %rdi
callq 0x3650