// File: /workspace/github_cpp_makefile_star2_O2/ndsol[P]git-mine/git-mine.cpp
// Function: MineBoss::printProgressAt1Hz()
int printProgressAt1Hz() {
    long long total_work = (ctime_hint - atime_hint) / COUNT_DIVISOR;
    auto t0 = Clock::now();
    // lock is needed for cond.wait_until.
    std::unique_lock<std::mutex> lock(bossMutex);
    for (auto t1 = t0 + std::chrono::seconds(1);;) {
      long long total = 0;
      cond.wait_until(lock, t1);
      if (searchDone) {
        return 1;
      }

      // Check threads to see who is still running.
      int r = 1;
      size_t best = 0;
      for (size_t i = 0; i < pool.size(); i++) {
        if (pool.at(i)->best > best) {
          best = pool.at(i)->best;
        }
        if (pool.at(i)->go) {
          r = 0;  // At least 1 thread is still running.
          total += pool.at(i)->count;
        } else if (pool.at(i)->bossSaidGo) {
          pool.at(i)->bossSaidGo = false;
          //fprintf(stderr, "Thread %zu quit.\n", i);
          // In stop, do join(). Not here.
        }
      }
      if (r) return r;
      t0 = Clock::now();
      if (t0 < t1) continue;

      // Report progress if a full second passed.
      std::chrono::duration<float> elapsed_sec = t0 - start_t;
      fprintf(stderr, "%4.1fs progress: %7.2f%%   best:%zu  100%%=%.2f MHash\n",
              elapsed_sec.count(),
              100.0f*float(total)/float(total_work), best,
              float(total_work) * COUNT_DIVISOR / 1e6);
      if (best > last_best) {
        last_best = best;
        dumpMatchAt(best);
      }
      break;
    }
    return 0;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x138(%rdi), %rax
subq 0x130(%rdi), %rax
movl $0x4000, %ecx           # imm = 0x4000
cqto
idivq %rcx
movq %rax, 0x8(%rsp)
callq 0x3320
movq %rax, %r14
leaq 0x150(%rbx), %rsi
leaq 0x18(%rsp), %rdi
callq 0x4d3c
addq $0x3b9aca00, %r14       # imm = 0x3B9ACA00
movq %rsp, %rax
movq %r14, (%rax)
leaq 0x178(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x1b0(%rbx), %r14
movq 0x10(%rsp), %rdi
leaq 0x18(%rsp), %rsi
movq %rsp, %rdx
callq 0x5d2a
cmpb $0x0, 0x1a9(%rbx)
jne 0x4101
xorl %r13d, %r13d
pushq $0x1
popq %rbp
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x1b8(%rbx), %rax
subq 0x1b0(%rbx), %rax
sarq $0x4, %rax
cmpq %rax, %r12
jae 0x4068
movq %r14, %rdi
movq %r12, %rsi
callq 0x5ae2
movq (%rax), %rax
movq 0x168(%rax), %rax
cmpq %r15, %rax
jbe 0x4004
movq %r14, %rdi
movq %r12, %rsi
callq 0x5ae2
movq (%rax), %rax
movq 0x168(%rax), %r15
movq %r14, %rdi
movq %r12, %rsi
callq 0x5ae2
movq (%rax), %rax
cmpb $0x1, 0x148(%rax)
jne 0x4034
movq %r14, %rdi
movq %r12, %rsi
callq 0x5ae2
movq (%rax), %rax
addq 0x338(%rax), %r13
xorl %ebp, %ebp
jmp 0x4060
movq %r14, %rdi
movq %r12, %rsi
callq 0x5ae2
movq (%rax), %rax
cmpb $0x1, 0x149(%rax)
jne 0x4060
movq %r14, %rdi
movq %r12, %rsi
callq 0x5ae2
movq (%rax), %rax
movb $0x0, 0x149(%rax)
incq %r12
jmp 0x3fba
testl %ebp, %ebp
jne 0x4101
callq 0x3320
cmpq (%rsp), %rax
jl 0x3f8f
subq 0x140(%rbx), %rax
cvtsi2ss %rax, %xmm0
divss 0x5f8d(%rip), %xmm0     # 0xa020
cvtsi2ss %r13, %xmm1
movq 0xaf39(%rip), %rax      # 0xefd8
mulss 0x5f7d(%rip), %xmm1     # 0xa024
movq (%rax), %rdi
cvtsi2ssq 0x8(%rsp), %xmm2
cvtss2sd %xmm0, %xmm0
divss %xmm2, %xmm1
mulss 0x5f67(%rip), %xmm2     # 0xa028
cvtss2sd %xmm1, %xmm1
cvtss2sd %xmm2, %xmm2
divsd 0x5f5f(%rip), %xmm2     # 0xa030
leaq 0x630a(%rip), %rsi      # 0xa3e2
movq %r15, %rdx
movb $0x3, %al
callq 0x33a0
cmpq 0x148(%rbx), %r15
jbe 0x40fd
movq %r15, 0x148(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5b04
xorl %ebx, %ebx
jmp 0x4104
pushq $0x1
popq %rbx
leaq 0x18(%rsp), %rdi
callq 0x4e0e
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4123
jmp 0x4123
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x4e0e
movq %rbx, %rdi
callq 0x34b0