// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/git-mine.cpp
// Function: MineBoss::start()
void start() {
    size_t nCPU = 0;
    FILE* cpuinfo = fopen("/proc/cpuinfo", "r");
    if (!cpuinfo) {
      fprintf(stderr, "Failed to open /proc/cpuinfo: %d %s\n", errno, strerror(errno));
      return;
    }
    char buf[256];
    while (!feof(cpuinfo)) {
      if (!fgets(buf, sizeof(buf), cpuinfo)) {
        if (feof(cpuinfo)) break;
        fprintf(stderr, "Read /proc/cpuinfo failed: %d %s\n", errno,
                strerror(errno));
        return;
      }
      buf[strcspn(buf, "\r\n")] = 0;
      if (!strncmp(buf, "processor", strlen("processor"))) {
        int n = strcspn(buf, ":");
        if (n < (int)strlen(buf)) {
          size_t v;
          int end;
          if (sscanf(buf + n + 1, "%zu%n", &v, &end) == 1 &&
              (int)strlen(buf + n + 1) == end) {
            if (v + 1 > nCPU) {
              nCPU = v + 1;
            }
          }
        }
      }
    }
    fclose(cpuinfo);
    if (pool.size()) {
      fprintf(stderr, "pool not empty - already started?\n");
      return;
    }
    if (atime_hint < orig.atime()) {
      if (atime_hint) {
        fprintf(stderr, "invalid atime_hint %lld (must be at least %lld)\n",
                atime_hint, orig.atime());
      }
      atime_hint = orig.atime();
    }
    if (ctime_hint < orig.ctime()) {
      if (ctime_hint) {
        fprintf(stderr, "invalid ctime_hint %lld (must be at least %lld)\n",
                ctime_hint, orig.ctime());
      }
      ctime_hint = orig.ctime();
    }

    // Lock bossMutex while adding threads to pool.
    std::unique_lock<std::mutex> lock(bossMutex);
    for (size_t i = 0; i < nCPU; i++) {
      pool.emplace(pool.begin(), new ThreadLocal(this, i, nCPU));
    }
    start_t = Clock::now();
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, %rbx
leaq 0x596d(%rip), %rdi      # 0xb30e
leaq 0x59c3(%rip), %rsi      # 0xb36b
callq 0x32b0
testq %rax, %rax
je 0x5bb7
movq %rax, %r15
movq %rbx, (%rsp)
movq %rax, %rdi
callq 0x33b0
testl %eax, %eax
je 0x59d1
xorl %r14d, %r14d
jmp 0x5ab1
leaq 0x20(%rsp), %r12
leaq 0x584a(%rip), %r13      # 0xb227
movabsq $0x6f737365636f7270, %rbp # imm = 0x6F737365636F7270
xorl %r14d, %r14d
movq %r12, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdx
callq 0x33d0
testq %rax, %rax
je 0x5aa1
movq %r12, %rdi
movq %r13, %rsi
callq 0x3040
movb $0x0, 0x20(%rsp,%rax)
movq 0x20(%rsp), %rax
xorq %rbp, %rax
movzbl 0x28(%rsp), %ecx
xorq $0x72, %rcx
orq %rax, %rcx
jne 0x5a8f
movq %r12, %rdi
leaq 0x5b60(%rip), %rsi      # 0xb593
callq 0x3040
movq %rax, %rbx
movq %r12, %rdi
callq 0x3100
cmpl %eax, %ebx
jge 0x5a8f
movslq %ebx, %rbx
leaq 0x21(%rsp), %rax
addq %rax, %rbx
movq %rbx, %rdi
leaq 0x574e(%rip), %rsi      # 0xb1aa
leaq 0x10(%rsp), %rdx
leaq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x3210
cmpl $0x1, %eax
jne 0x5a8f
movq %rbx, %rdi
callq 0x3100
cmpl %eax, 0x8(%rsp)
jne 0x5a8f
movq 0x10(%rsp), %rax
incq %rax
cmpq %r14, %rax
cmovaq %rax, %r14
movq %r15, %rdi
callq 0x33b0
testl %eax, %eax
je 0x59ea
jmp 0x5ab1
movq %r15, %rdi
callq 0x33b0
testl %eax, %eax
je 0x5c0d
movq %r15, %rdi
callq 0x3220
movq (%rsp), %rbx
movq 0x1b8(%rbx), %rax
cmpq 0x1b0(%rbx), %rax
jne 0x5bbe
movq 0x120(%rbx), %rcx
movq 0x130(%rbx), %rdx
cmpq %rcx, %rdx
jge 0x5af4
testq %rdx, %rdx
jne 0x5bc5
movq %rcx, 0x130(%rbx)
movq 0x128(%rbx), %rcx
movq 0x138(%rbx), %rdx
cmpq %rcx, %rdx
jge 0x5b17
testq %rdx, %rdx
jne 0x5be9
movq %rcx, 0x138(%rbx)
leaq 0x150(%rbx), %rax
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movb $0x0, 0x8(%rbx)
movq %rbx, %rdi
callq 0x6d1e
movb $0x1, 0x8(%rbx)
testq %r14, %r14
je 0x5b8b
movq (%rsp), %rax
leaq 0x1b0(%rax), %r15
xorl %r12d, %r12d
leaq 0x8(%rsp), %r13
movq (%r15), %rbp
movl $0x340, %edi            # imm = 0x340
callq 0x3230
movq %rax, %rbx
movq %rax, %rdi
movq (%rsp), %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x6c4c
movq %rbx, 0x8(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x6d5a
incq %r12
cmpq %r12, %r14
jne 0x5b4e
callq 0x32f0
movq (%rsp), %rcx
movq %rax, 0x140(%rcx)
leaq 0x10(%rsp), %rdi
callq 0x6d08
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x35ea
jmp 0x5ba5
callq 0x3590
jmp 0x5ba5
movq 0x940c(%rip), %rax      # 0xefd8
movq (%rax), %rdi
leaq 0x57ba(%rip), %rsi      # 0xb390
xorl %eax, %eax
callq 0x3340
movq 0x120(%rbx), %rcx
jmp 0x5aed
movq 0x93e8(%rip), %rax      # 0xefd8
movq (%rax), %rdi
leaq 0x57c7(%rip), %rsi      # 0xb3c1
xorl %eax, %eax
callq 0x3340
movq 0x128(%rbx), %rcx
jmp 0x5b10
callq 0x35b2
jmp 0x5ba5
movq %rax, %r14
movl $0x340, %esi            # imm = 0x340
movq %rbx, %rdi
callq 0x3240
jmp 0x5c29
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x6d08
movq %r14, %rdi
callq 0x3480
nop