// File: /workspace/github_cpp_makefile_star2_O3/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
leaq 0x3fff(%rax), %rcx
testq %rax, %rax
cmovnsq %rax, %rcx
sarq $0xe, %rcx
movq %rcx, 0x8(%rsp)
callq 0x32f0
movq %rax, %r15
leaq 0x150(%rbx), %rax
leaq 0x18(%rsp), %r14
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0x6d1e
movb $0x1, 0x8(%r14)
addq $0x3b9aca00, %r15       # imm = 0x3B9ACA00
leaq 0x10(%rsp), %r12
movq %r15, (%r12)
leaq 0x178(%rbx), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x7e2c
cmpb $0x0, 0x1a9(%rbx)
jne 0x5e06
movq 0x1b0(%rbx), %rax
movq 0x1b8(%rbx), %rsi
subq %rax, %rsi
je 0x5e06
sarq $0x4, %rsi
xorl %ecx, %ecx
cmpq $0x1, %rsi
movl $0x0, %edx
sbbq %rsi, %rdx
xorl %r15d, %r15d
xorl %esi, %esi
xorl %ebp, %ebp
leaq 0x1(%rcx), %r8
shlq $0x4, %rcx
addq %rax, %rcx
movq %rcx, %rdi
movq %r8, %rcx
movq (%rdi), %r8
movq 0x168(%r8), %r9
cmpq %r15, %r9
jbe 0x5d24
movq 0x168(%r8), %r15
cmpb $0x0, 0x148(%r8)
jne 0x5d56
cmpb $0x1, 0x149(%r8)
jne 0x5d40
movb $0x0, 0x149(%r8)
leaq (%rdx,%rcx), %r8
incq %r8
incq %rcx
addq $0x10, %rdi
cmpq $0x1, %r8
jne 0x5d0e
jmp 0x5d6a
addq 0x338(%r8), %rbp
movb $0x1, %sil
movq %rdx, %rdi
addq %rcx, %rdi
jne 0x5cfd
jmp 0x5d74
testb $0x1, %sil
je 0x5e06
callq 0x32f0
cmpq 0x10(%rsp), %rax
jl 0x5cb2
cvtsi2ss %rbp, %xmm1
mulss 0x528f(%rip), %xmm1     # 0xb020
subq 0x140(%rbx), %rax
cvtsi2ss %rax, %xmm0
divss 0x527f(%rip), %xmm0     # 0xb024
movq 0x922c(%rip), %rax      # 0xefd8
movq (%rax), %rdi
cvtsi2ssq 0x8(%rsp), %xmm2
cvtss2sd %xmm0, %xmm0
divss %xmm2, %xmm1
mulss 0x5262(%rip), %xmm2     # 0xb028
cvtss2sd %xmm1, %xmm1
cvtss2sd %xmm2, %xmm2
divsd 0x525a(%rip), %xmm2     # 0xb030
leaq 0x562f(%rip), %rsi      # 0xb40c
movq %r15, %rdx
movb $0x3, %al
callq 0x3340
cmpq 0x148(%rbx), %r15
jbe 0x5e02
movq %r15, 0x148(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7bb6
xorl %ebx, %ebx
jmp 0x5e0b
movl $0x1, %ebx
leaq 0x18(%rsp), %rdi
callq 0x6d08
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5e28
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x6d08
movq %rbx, %rdi
callq 0x3480
nop