// File: /workspace/github_cpp_makefile_star2_O2/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 0x66ad(%rip), %rdi      # 0xa2e4
leaq 0x6703(%rip), %rsi      # 0xa341
callq 0x32d0
testq %rax, %rax
je 0x3e29
movq %rax, %r15
movq %rbx, (%rsp)
leaq 0x20(%rsp), %r12
leaq 0x66da(%rip), %rbp      # 0xa339
pushq $0x9
popq %r13
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x3400
testl %eax, %eax
jne 0x3d38
movq %r12, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdx
callq 0x3420
testq %rax, %rax
je 0x3d28
movq %r12, %rdi
leaq 0x658e(%rip), %rsi      # 0xa227
callq 0x3040
movb $0x0, 0x20(%rsp,%rax)
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x3270
testl %eax, %eax
jne 0x3c66
movq %r12, %rdi
leaq 0x68aa(%rip), %rsi      # 0xa569
callq 0x3040
movq %rax, %rbx
movq %r12, %rdi
callq 0x3100
cmpl %eax, %ebx
jge 0x3c66
movslq %ebx, %rbx
leaq 0x21(%rsp), %rax
addq %rax, %rbx
movq %rbx, %rdi
leaq 0x64c2(%rip), %rsi      # 0xa1aa
leaq 0x10(%rsp), %rdx
leaq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x3230
cmpl $0x1, %eax
jne 0x3c66
movq %rbx, %rdi
callq 0x3100
cmpl %eax, 0x8(%rsp)
jne 0x3c66
movq 0x10(%rsp), %rax
incq %rax
cmpq %r14, %rax
cmovaq %rax, %r14
jmp 0x3c66
movq %r15, %rdi
callq 0x3400
testl %eax, %eax
je 0x3e86
movq %r15, %rdi
callq 0x3240
movq (%rsp), %rbx
movq 0x1b8(%rbx), %rax
cmpq 0x1b0(%rbx), %rax
jne 0x3e68
movq 0x120(%rbx), %rcx
movq 0x130(%rbx), %rdx
cmpq %rcx, %rdx
jge 0x3d7b
testq %rdx, %rdx
jne 0x3eb9
movq %rcx, 0x130(%rbx)
movq 0x128(%rbx), %rcx
movq 0x138(%rbx), %rdx
cmpq %rcx, %rdx
jge 0x3d9e
testq %rdx, %rdx
jne 0x3edd
movq %rcx, 0x138(%rbx)
leaq 0x1b0(%rbx), %r15
leaq 0x150(%rbx), %rsi
leaq 0x10(%rsp), %rdi
callq 0x4d3c
xorl %r12d, %r12d
leaq 0x8(%rsp), %r13
cmpq %r12, %r14
je 0x3dfd
movq (%r15), %rbp
movl $0x340, %edi            # imm = 0x340
callq 0x3250
movq %rax, %rbx
movq %rax, %rdi
movq (%rsp), %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x4d52
movq %rbx, 0x8(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x4e62
incq %r12
jmp 0x3dbe
callq 0x3320
movq (%rsp), %rcx
movq %rax, 0x140(%rcx)
leaq 0x10(%rsp), %rdi
callq 0x4e0e
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xb1a8(%rip), %rax      # 0xefd8
movq (%rax), %rbx
callq 0x3030
movl (%rax), %ebp
movl %ebp, %edi
callq 0x30b0
leaq 0x64aa(%rip), %rsi      # 0xa2f2
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x33a0
movq 0xb169(%rip), %rax      # 0xefd8
movq (%rax), %rcx
leaq 0x64ca(%rip), %rdi      # 0xa343
pushq $0x22
popq %rsi
pushq $0x1
popq %rdx
callq 0x3510
jmp 0x3e17
movq 0xb14b(%rip), %rax      # 0xefd8
movq (%rax), %rbx
callq 0x3030
movl (%rax), %ebp
movl %ebp, %edi
callq 0x30b0
leaq 0x6472(%rip), %rsi      # 0xa317
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x33a0
jmp 0x3e17
movq 0xb118(%rip), %rax      # 0xefd8
movq (%rax), %rdi
leaq 0x649c(%rip), %rsi      # 0xa366
xorl %eax, %eax
callq 0x33a0
movq 0x120(%rbx), %rcx
jmp 0x3d74
movq 0xb0f4(%rip), %rax      # 0xefd8
movq (%rax), %rdi
leaq 0x64a9(%rip), %rsi      # 0xa397
xorl %eax, %eax
callq 0x33a0
movq 0x128(%rbx), %rcx
jmp 0x3d97
movq %rax, %r14
movl $0x340, %esi            # imm = 0x340
movq %rbx, %rdi
callq 0x3260
jmp 0x3f16
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x4e0e
movq %r14, %rdi
callq 0x34b0