// File: /workspace/github_cpp_makefile_star2_O1/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), %r15
testq %rax, %rax
cmovnsq %rax, %r15
sarq $0xe, %r15
callq 0x32f0
movq %rax, %r12
leaq 0x150(%rbx), %rax
leaq 0x18(%rsp), %r14
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0x6e94
movb $0x1, 0x8(%r14)
addq $0x3b9aca00, %r12       # imm = 0x3B9ACA00
leaq 0x8(%rsp), %rax
movq %r12, (%rax)
leaq 0x178(%rbx), %r12
cvtsi2ss %r15, %xmm1
movss 0x6239(%rip), %xmm0     # 0xc020
movss %xmm1, (%rsp)
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
divsd 0x6234(%rip), %xmm0     # 0xc030
movsd %xmm0, 0x10(%rsp)
movq %r12, %rdi
movq %r14, %rsi
leaq 0x8(%rsp), %rdx
callq 0x8022
movl $0x1, %ebp
cmpb $0x0, 0x1a9(%rbx)
jne 0x5f42
movq 0x1b0(%rbx), %rax
movq 0x1b8(%rbx), %rcx
subq %rax, %rcx
je 0x5ea7
sarq $0x4, %rcx
cmpq $0x1, %rcx
adcq $0x0, %rcx
movl $0x1, %edx
xorl %r13d, %r13d
xorl %esi, %esi
movq (%rax), %rdi
movq 0x168(%rdi), %r8
cmpq %r13, %r8
jbe 0x5e63
movq 0x168(%rdi), %r13
cmpb $0x1, 0x148(%rdi)
jne 0x5e77
addq 0x338(%rdi), %rsi
xorl %edx, %edx
jmp 0x5e87
cmpb $0x1, 0x149(%rdi)
jne 0x5e87
movb $0x0, 0x149(%rdi)
addq $0x10, %rax
decq %rcx
jne 0x5e4d
testl %edx, %edx
sete %al
xorps %xmm0, %xmm0
cvtsi2ss %rsi, %xmm0
mulss 0x617f(%rip), %xmm0     # 0xc024
jmp 0x5eb0
xorpd %xmm0, %xmm0
xorl %eax, %eax
xorl %r13d, %r13d
testb %al, %al
je 0x5f42
movss %xmm0, 0x4(%rsp)
callq 0x32f0
movb $0x1, %r15b
cmpq 0x8(%rsp), %rax
jl 0x5f45
subq 0x140(%rbx), %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
divss 0x6144(%rip), %xmm0     # 0xc028
movq 0xa0e5(%rip), %rax      # 0xffd0
movq (%rax), %rdi
cvtss2sd %xmm0, %xmm0
movss 0x4(%rsp), %xmm1
divss (%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0x6504(%rip), %rsi      # 0xc40c
movq %r13, %rdx
movsd 0x10(%rsp), %xmm2
movb $0x3, %al
callq 0x3340
xorl %r15d, %r15d
movl $0x0, %ebp
cmpq 0x148(%rbx), %r13
jbe 0x5f45
movq %r13, 0x148(%rbx)
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r13, %rsi
callq 0x7dac
xorl %ebp, %ebp
jmp 0x5f45
xorl %r15d, %r15d
testb %r15b, %r15b
jne 0x5e02
leaq 0x18(%rsp), %rdi
callq 0x6e7e
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5f6b
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x6e7e
movq %rbx, %rdi
callq 0x3480