// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/git-mine.cpp
// Function: MineBoss::ThreadLocal::search(long long)
int search(long long atime) {
      float total_work = float(noodle.ctime() - atime);
      // Use floats to trade off accuracy for avoiding overflow.
      long long my_work_start =
          (long long) ((float(id) * total_work) / float(idMax)) + atime;
      long long my_work_end =
          (long long) ((float(id + 1) * total_work) / float(idMax)) + atime;
      int my_count = 1;
      for (long long t = my_work_start; t < my_work_end; t++, my_count++) {
        if ((my_count & (COUNT_DIVISOR - 1)) == 0) {
          my_count = 0;
          std::unique_lock<std::mutex> lock(parent->bossMutex);
          count++;
          if (parent->stopRequested) {
            return 1;
          }
        }
        noodle.set_atime(t);
        noodle.hash(sha, b2h);
        size_t matchlen = 0;
        int match = b2h.instr(sha.result, sizeof(sha.result), &matchlen);
        if (match != -1) {
          if (matchlen > best) {
            best = matchlen;
            best_atime = t;
            best_ctime = noodle.ctime();
          }
          if (matchlen >= terminateAt) {
            // Signal that a match was found.
            std::unique_lock<std::mutex> lock(parent->bossMutex);
            matchFound = 1;
            parent->searchDone = true;
            parent->cond.notify_all();
            return 1;
          }
        }
      }
      return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x140(%rdi), %rcx
movq 0x150(%rdi), %rax
subq %rsi, %rcx
cvtsi2ss %rcx, %xmm0
testq %rax, %rax
js 0x76b3
cvtsi2ss %rax, %xmm2
jmp 0x76ca
movq %rax, %rcx
shrq %rcx
movl %eax, %edx
andl $0x1, %edx
orq %rcx, %rdx
cvtsi2ss %rdx, %xmm2
addss %xmm2, %xmm2
mulss %xmm0, %xmm2
movq 0x158(%rbx), %rcx
testq %rcx, %rcx
js 0x76e1
cvtsi2ss %rcx, %xmm1
jmp 0x76f6
movq %rcx, %rdx
shrq %rdx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm1
addss %xmm1, %xmm1
divss %xmm1, %xmm2
cvttss2si %xmm2, %r14
incq %rax
js 0x770e
xorps %xmm2, %xmm2
cvtsi2ss %rax, %xmm2
jmp 0x7726
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm2, %xmm2
cvtsi2ss %rax, %xmm2
addss %xmm2, %xmm2
mulss %xmm2, %xmm0
divss %xmm1, %xmm0
cvttss2si %xmm0, %rcx
xorl %eax, %eax
movq %rcx, 0x8(%rsp)
cmpq %rcx, %r14
jge 0x789d
leaq 0x18(%rbx), %r12
addq %rsi, 0x8(%rsp)
addq %rsi, %r14
leaq 0x180(%rbx), %r13
leaq 0x1f8(%rbx), %rax
movq %rax, 0x30(%rsp)
movl $0x1, %ebp
movq %r13, 0x28(%rsp)
testl $0x3fff, %ebp           # imm = 0x3FFF
jne 0x77c8
movq (%rbx), %rax
movl $0x150, %ecx            # imm = 0x150
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movb $0x0, 0x20(%rsp)
leaq 0x18(%rsp), %rbp
movq %rbp, %rdi
callq 0x6d1e
movb $0x1, 0x20(%rsp)
incq 0x338(%rbx)
movq (%rbx), %rax
movq %rbx, %r15
movb 0x1a8(%rax), %bl
movq %rbp, %rdi
callq 0x6d08
xorl %ebp, %ebp
testb %bl, %bl
movq %r15, %rbx
movq 0x28(%rsp), %r13
jne 0x7898
movq %r12, %rdi
movq %r14, %rsi
callq 0x7928
movq %r12, %rdi
movq %r13, %rsi
movq 0x30(%rsp), %r15
movq %r15, %rdx
callq 0x58a4
movq $0x0, 0x10(%rsp)
movl $0x14, %edx
movq %r15, %rdi
movq %r13, %rsi
leaq 0x10(%rsp), %rcx
callq 0x7a16
cmpl $-0x1, %eax
je 0x7839
movq 0x10(%rsp), %rax
cmpq 0x168(%rbx), %rax
jbe 0x7833
movq %rax, 0x168(%rbx)
movq %r14, 0x170(%rbx)
movq 0x140(%rbx), %rcx
movq %rcx, 0x178(%rbx)
cmpq $0x5, %rax
jae 0x784d
incq %r14
incl %ebp
cmpq 0x8(%rsp), %r14
jl 0x776c
xorl %eax, %eax
jmp 0x789d
movl $0x150, %eax            # imm = 0x150
addq (%rbx), %rax
leaq 0x18(%rsp), %r14
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0x6d1e
movb $0x1, %al
movb %al, 0x8(%r14)
movq $0x1, 0x160(%rbx)
movq (%rbx), %rdi
movb %al, 0x1a9(%rdi)
addq $0x178, %rdi            # imm = 0x178
callq 0x3450
movq %r14, %rdi
callq 0x6d08
movl $0x1, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq