LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/./hashapi.h
// Function: CommitMessage::hash(Sha1Hash&, Blake2Hash&)
int hash(Sha1Hash& sha, Blake2Hash& b2h) {
    // header.data() contains a \x00 character, so leave it out of string s.
    sha.update(header.data(), header.size());
    std::string s = toRawString();
    sha.update(s.c_str(), s.size());
    sha.flush();
    b2h.update(header.data(), header.size());
    b2h.update(s.c_str(), s.size());
    b2h.flush();
    return 0;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdx
subq %rsi, %rdx
movq %r15, %rdi
callq 0x6710
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x674a
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r15, %rdi
callq 0x6710
leaq 0x14(%r15), %rsi
movq %r15, %rdi
callq 0x3440
movb $0x0, 0x74(%r15)
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x6b1e
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x6b1e
leaq 0x48(%rbx), %rdi
movl $0x40, %edx
movq %rbx, %rsi
callq 0x9a17
movb $0x0, 0x40(%rbx)
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5952
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3240
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x597e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3240
movq %rbx, %rdi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/git-mine.cpp
// Function: MineBoss::commitMatch()
void commitMatch() {
    for (size_t i = 0; i < pool.size(); i++) {
      if (pool.at(i)->matchFound) {
        commitMatchWith(*pool.at(i));
        return;
      }
    }
    fprintf(stderr, "A thread set searchDone but didn't set matchFound.\n");
  }

// Assembly:
pushq %rax
movq 0x1b0(%rdi), %rax
movq 0x1b8(%rdi), %rdx
subq %rax, %rdx
je 0x5e74
sarq $0x4, %rdx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq (%rax), %rcx
cmpq $0x0, 0x160(%rcx)
jne 0x5e7b
addq $0x10, %rax
decq %rdx
jne 0x5e5e
callq 0x3621
popq %rax
retq
movq 0x150(%rcx), %rdi
leaq 0x180(%rcx), %rsi
leaq 0x1f8(%rcx), %rdx
addq $0x18, %rcx
popq %rax
jmp 0x395b
// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/git-mine.cpp
// Function: MineBoss::stop()
void stop() {
    { // Signal all threads to quit.
      std::unique_lock<std::mutex> lock(bossMutex);
      stopRequested = true;
      cond.notify_all();
    }
    // Wait for threads to quit.
    for (size_t patience = 5; ; patience--) {
      if (!patience) {
        fprintf(stderr,
                "Out of patience! Use ctrl+C to kill me.\n"
                "Threads seem to be deadlocked.\n");
        break;
      }
      if (patience != 5) {
        fprintf(stderr, "stop: wait %zus:", patience);
      }
      if (printProgressAt1Hz()) {
        break;
      }
    }
    // Print something if thread cleanup hangs process.
    if (0) fprintf(stderr, "Cleaning up threads.\n");
    // Join (reap) threads in ThreadLocal::~ThreadLocal().
    pool.clear();
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x150(%rdi), %rax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0x6d1e
movb $0x1, %al
movb %al, 0x8(%r14)
movb %al, 0x1a8(%rbx)
leaq 0x178(%rbx), %rdi
callq 0x3450
movq %r14, %rdi
callq 0x6d08
movl $0x5, %r14d
movq 0x90e7(%rip), %r12      # 0xefd8
leaq 0x568c(%rip), %r15      # 0xb584
cmpq $0x5, %r14
jne 0x5f0f
movq %rbx, %rdi
callq 0x5c3c
decq %r14
testl %eax, %eax
je 0x5ef8
jmp 0x5f2c
testq %r14, %r14
je 0x5f27
movq (%r12), %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x3340
jmp 0x5efe
callq 0x363d
addq $0x1b0, %rbx            # imm = 0x1B0
movq %rbx, %rdi
callq 0x7e94
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/./hashapi.h
// Function: CommitMessage::parseTimestamp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, long long*)
static int parseTimestamp(std::string* packed, std::string* thetime,
                            std::string* thetz, long long* binarytime) {
    const char* s = packed->c_str();
    int n = 0;
    int limit = strlen(s);
    // The timestamp is after <email-id> and some whitespace.
    const char* token[] = {"<", ">", " "};
    for (size_t i = 0; i < sizeof(token)/sizeof(token[0]); i++) {
      n += strcspn(s + n, token[i]);
      n += strspn(s + n, token[i]);
      if (n >= limit) {
        break;
      }
    }
    if (n >= limit) {
      fprintf(stderr, "invalid timestamp - overran limit\n");
      return 1;
    }
    s += n;
    limit -= n;
    if (sscanf(s, "%lld%n", binarytime, &n) != 1) {
      fprintf(stderr, "invalid timestamp: \"%.*s\"\n", limit, s);
      return 1;
    }
    thetime->assign(s, s + n);
    thetz->assign(s + n);
    packed->erase(packed->begin() + (s - packed->c_str()), packed->end());
    return 0;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, 0x20(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, 0x18(%rsp)
movq (%rdi), %rbx
movq %rbx, %rdi
callq 0x3100
movq %rax, %rbp
xorl %r15d, %r15d
leaq 0x8888(%rip), %r12      # 0xecb0
xorl %r14d, %r14d
movslq %r14d, %r14
leaq (%rbx,%r14), %rdi
movq (%r15,%r12), %r13
movq %r13, %rsi
callq 0x3040
addl %eax, %r14d
movslq %r14d, %r14
leaq (%rbx,%r14), %rdi
movq %r13, %rsi
callq 0x30f0
addl %eax, %r14d
movl %ebp, %r13d
subl %r14d, %r13d
jle 0x64fb
addq $0x8, %r15
cmpq $0x18, %r15
jne 0x642b
leaq 0x4(%rsp), %rcx
movl %r14d, (%rcx)
movslq %r14d, %rax
addq %rax, %rbx
leaq 0x4bdf(%rip), %rsi      # 0xb05d
xorl %ebp, %ebp
movq %rbx, %rdi
movq 0x20(%rsp), %rdx
xorl %eax, %eax
callq 0x3210
cmpl $0x1, %eax
jne 0x6502
movslq 0x4(%rsp), %r8
movq 0x8(%rsp), %rdi
movq 0x8(%rdi), %rdx
xorl %esi, %esi
movq %rbx, %rcx
callq 0x3280
movslq 0x4(%rsp), %r12
addq %rbx, %r12
movq 0x10(%rsp), %r14
movq 0x8(%r14), %r13
movq %r12, %rdi
callq 0x3100
movq %r14, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r12, %rcx
movq %rax, %r8
callq 0x33a0
movq %rbx, %rax
movq 0x18(%rsp), %rcx
subq (%rcx), %rax
movq %rax, 0x8(%rcx)
movb $0x0, (%rbx)
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3681
jmp 0x6520
movq 0x8acf(%rip), %rax      # 0xefd8
movq (%rax), %rdi
leaq 0x4db6(%rip), %rsi      # 0xb2c9
movl %r13d, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x3340
movl $0x1, %ebp
jmp 0x64ea
nop
// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/./hashapi.h
// Function: Sha1Hash::update(char const*, unsigned long)
void update(const char* data, size_t len) {
    if (!init_done) {
      SHA1_Init(&ctx);
      init_done = true;
    }
    SHA1_Update(&ctx, reinterpret_cast<const void*>(data), len);
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpb $0x0, 0x74(%rdi)
jne 0x6732
leaq 0x14(%r15), %rdi
callq 0x31d0
movb $0x1, 0x74(%r15)
addq $0x14, %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x3070
nop
// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/./hashapi.h
// Function: Blake2Hash::update(char const*, unsigned long)
void update(const char* data, size_t len) {
    if (!init_done) {
      init_done = true;
      blake2b_init(&ctx, sizeof(result));
    }
    blake2b_update(&ctx, reinterpret_cast<const void*>(data), len);
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpb $0x0, 0x40(%rdi)
jne 0x6b45
movb $0x1, 0x40(%r15)
leaq 0x48(%r15), %rdi
movl $0x40, %esi
callq 0x7f91
addq $0x48, %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x8193
// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/git-mine.cpp
// Function: MineBoss::ThreadLocal::worker()
void worker() {
      doWork();
      std::unique_lock<std::mutex> lock(parent->bossMutex);
      go = false;
      parent->cond.notify_all();
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x7542
movl $0x150, %eax            # imm = 0x150
addq (%rbx), %rax
movq %rsp, %r14
movq %rax, (%r14)
xorl %ebp, %ebp
movb %bpl, 0x8(%r14)
movq %r14, %rdi
callq 0x6d1e
movb $0x1, 0x8(%r14)
movb %bpl, 0x148(%rbx)
movl $0x178, %edi            # imm = 0x178
addq (%rbx), %rdi
callq 0x3450
movq %r14, %rdi
callq 0x6d08
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/git-mine.cpp
// Function: MineBoss::ThreadLocal::doWork()
void doWork() {
      noodle.set_ctime(parent->ctime_hint);
      for (;;) {
        if (search(parent->atime_hint)) {
          return;
        }

        // Increment ctime and try again.
        commit_delta++;
        noodle.set_ctime(noodle.ctime() + 1);
      }
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
movq (%rdi), %rax
movq 0x138(%rax), %rsi
movq %r14, %rdi
callq 0x758e
movq (%rbx), %rax
movq 0x130(%rax), %rsi
movq %rbx, %rdi
callq 0x7680
testl %eax, %eax
jne 0x7585
incq 0x10(%rbx)
movq 0x140(%rbx), %rsi
incq %rsi
jmp 0x7557
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/./hashapi.h
// Function: Blake2Hash::instr(unsigned char*, unsigned long, unsigned long*)
int instr(uint8_t* want, size_t wantlen, size_t* matchlen) {
    int best = -1;
    *matchlen = 0;
    if (!wantlen) {
      return best;
    }
    for (size_t n = 0; n < sizeof(result); ) {
      size_t i = 0;
      void* p = memchr(&result[n], want[i], sizeof(result) - n);
      if (!p) {
        return best;
      }
      // memchr matched one byte.
      n = (reinterpret_cast<uint8_t*>(p) - result) + 1;
      i++;
      // Check how many bytes long this match is.
      while (n < sizeof(result) && i < wantlen && want[i] == result[n]) {
        i++;
        n++;
      }
      if (i > *matchlen) {
        best = n - i;
        *matchlen = i;
      }
    }
    return best;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq $0x0, (%rcx)
testq %rdx, %rdx
je 0x7abd
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %r13d, %r13d
xorl %r8d, %r8d
leaq (%r12,%r8), %rdi
movzbl (%r15), %esi
movl $0x40, %edx
subq %r8, %rdx
callq 0x3260
testq %rax, %rax
je 0x7ac2
cmpq $0x1, %r14
sete %dl
subq %r12, %rax
incq %rax
cmpq $0x40, %rax
setae %sil
movl $0x1, %ecx
orb %dl, %sil
jne 0x7aa2
movb (%r15,%rcx), %dl
cmpb (%r12,%rax), %dl
jne 0x7aa2
incq %rcx
leaq 0x1(%rax), %r8
cmpq $0x3e, %rax
ja 0x7aa5
movq %r8, %rax
cmpq %r14, %rcx
jb 0x7a81
jmp 0x7aa5
movq %rax, %r8
cmpq %r13, %rcx
jbe 0x7ab5
movl %r8d, %ebp
subl %ecx, %ebp
movq %rcx, (%rbx)
movq %rcx, %r13
cmpq $0x40, %r8
jb 0x7a48
jmp 0x7ac2
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/blake2b-ref.c
// Function: blake2b_init_param
int blake2b_init_param( blake2b_state *S, const blake2b_param *P )
{
  const uint8_t *p = ( const uint8_t * )( P );
  size_t i;

  blake2b_init0( S );

  /* IV XOR ParamBlock */
  for( i = 0; i < 8; ++i )
    S->h[i] ^= load64( p + sizeof( S->h[i] ) * i );

  S->outlen = P->digest_length;
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
addq $0x40, %rdi
xorl %r15d, %r15d
movl $0xb8, %edx
xorl %esi, %esi
callq 0x3170
movaps 0x3827(%rip), %xmm0     # 0xb770
movups %xmm0, (%rbx)
movaps 0x382d(%rip), %xmm0     # 0xb780
movups %xmm0, 0x10(%rbx)
movaps 0x3832(%rip), %xmm0     # 0xb790
movups %xmm0, 0x20(%rbx)
movaps 0x3837(%rip), %xmm0     # 0xb7a0
movups %xmm0, 0x30(%rbx)
movq (%r14,%r15,8), %rax
xorq %rax, (%rbx,%r15,8)
incq %r15
cmpq $0x8, %r15
jne 0x7f6d
movzbl (%r14), %eax
movq %rax, 0xe8(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/blake2b-ref.c
// Function: blake2b_init
int blake2b_init( blake2b_state *S, size_t outlen )
{
  blake2b_param P[1];

  if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1;

  P->digest_length = (uint8_t)outlen;
  P->key_length    = 0;
  P->fanout        = 1;
  P->depth         = 1;
  store32( &P->leaf_length, 0 );
  store32( &P->node_offset, 0 );
  store32( &P->xof_length, 0 );
  P->node_depth    = 0;
  P->inner_length  = 0;
  memset( P->reserved, 0, sizeof( P->reserved ) );
  memset( P->salt,     0, sizeof( P->salt ) );
  memset( P->personal, 0, sizeof( P->personal ) );
  return blake2b_init_param( S, P );
}

// Assembly:
leaq -0x41(%rsi), %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $-0x40, %rcx
jb 0x8046
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movb %bl, (%rsp)
movw $0x100, 0x1(%rsp)       # imm = 0x100
movb $0x1, 0x3(%rsp)
addq $0x40, %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rsp)
movups %xmm0, 0x14(%rsp)
movups %xmm0, 0x24(%rsp)
movups %xmm0, 0x30(%rsp)
xorl %r15d, %r15d
movl $0xb8, %edx
xorl %esi, %esi
callq 0x3170
movaps 0x377d(%rip), %xmm0     # 0xb770
movups %xmm0, (%r14)
movaps 0x3782(%rip), %xmm0     # 0xb780
movups %xmm0, 0x10(%r14)
movaps 0x3786(%rip), %xmm0     # 0xb790
movups %xmm0, 0x20(%r14)
movaps 0x378a(%rip), %xmm0     # 0xb7a0
movups %xmm0, 0x30(%r14)
movups (%r14,%r15,8), %xmm0
xorps (%rsp,%r15,8), %xmm0
movups %xmm0, (%r14,%r15,8)
addq $0x2, %r15
cmpq $0x8, %r15
jne 0x801b
movq %rbx, 0xe8(%r14)
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/blake2b-ref.c
// Function: blake2b_init_key
int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen )
{
  blake2b_param P[1];

  if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1;

  if ( !key || !keylen || keylen > BLAKE2B_KEYBYTES ) return -1;

  P->digest_length = (uint8_t)outlen;
  P->key_length    = (uint8_t)keylen;
  P->fanout        = 1;
  P->depth         = 1;
  store32( &P->leaf_length, 0 );
  store32( &P->node_offset, 0 );
  store32( &P->xof_length, 0 );
  P->node_depth    = 0;
  P->inner_length  = 0;
  memset( P->reserved, 0, sizeof( P->reserved ) );
  memset( P->salt,     0, sizeof( P->salt ) );
  memset( P->personal, 0, sizeof( P->personal ) );

  if( blake2b_init_param( S, P ) < 0 ) return -1;

  {
    uint8_t block[BLAKE2B_BLOCKBYTES];
    memset( block, 0, BLAKE2B_BLOCKBYTES );
    memcpy( block, key, keylen );
    blake2b_update( S, block, BLAKE2B_BLOCKBYTES );
    secure_zero_memory( block, BLAKE2B_BLOCKBYTES ); /* Burn the key from stack */
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
leaq -0x41(%rsi), %rax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq $-0x40, %rax
jb 0x817f
movq %rcx, %r14
movq %rdx, %r15
testq %rdx, %rdx
sete %al
addq $-0x41, %rcx
cmpq $-0x40, %rcx
setb %cl
orb %al, %cl
jne 0x817f
movq %rsi, %r12
movq %rdi, %rbx
movb %r12b, (%rsp)
movb %r14b, 0x1(%rsp)
movw $0x101, 0x2(%rsp)       # imm = 0x101
addq $0x40, %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rsp)
movups %xmm0, 0x14(%rsp)
movups %xmm0, 0x24(%rsp)
movups %xmm0, 0x30(%rsp)
xorl %r13d, %r13d
movl $0xb8, %edx
xorl %esi, %esi
callq 0x3170
movaps 0x369f(%rip), %xmm0     # 0xb770
movups %xmm0, (%rbx)
movaps 0x36a5(%rip), %xmm0     # 0xb780
movups %xmm0, 0x10(%rbx)
movaps 0x36aa(%rip), %xmm0     # 0xb790
movups %xmm0, 0x20(%rbx)
movaps 0x36af(%rip), %xmm0     # 0xb7a0
movups %xmm0, 0x30(%rbx)
movups (%rbx,%r13,8), %xmm0
xorps (%rsp,%r13,8), %xmm0
movups %xmm0, (%rbx,%r13,8)
addq $0x2, %r13
cmpq $0x8, %r13
jne 0x80f5
movq %r12, 0xe8(%rbx)
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %r12
movaps %xmm0, 0x70(%r12)
movaps %xmm0, 0x60(%r12)
movaps %xmm0, 0x50(%r12)
movaps %xmm0, 0x40(%r12)
movaps %xmm0, 0x30(%r12)
movaps %xmm0, 0x20(%r12)
movaps %xmm0, 0x10(%r12)
movaps %xmm0, (%r12)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x31e0
movl $0x80, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8193
movq 0x6c0f(%rip), %rax      # 0xed80
xorl %ebp, %ebp
movl $0x80, %edx
movq %r12, %rdi
xorl %esi, %esi
callq *%rax
movl %ebp, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/blake2b-ref.c
// Function: blake2b_update
int blake2b_update( blake2b_state *S, const void *pin, size_t inlen )
{
  const unsigned char * in = (const unsigned char *)pin;
  if( inlen > 0 )
  {
    size_t left = S->buflen;
    size_t fill = BLAKE2B_BLOCKBYTES - left;
    if( inlen > fill )
    {
      S->buflen = 0;
      memcpy( S->buf + left, in, fill ); /* Fill buffer */
      blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );
      blake2b_compress( S, S->buf ); /* Compress */
      in += fill; inlen -= fill;
      while(inlen > BLAKE2B_BLOCKBYTES) {
        blake2b_increment_counter(S, BLAKE2B_BLOCKBYTES);
        blake2b_compress( S, in );
        in += BLAKE2B_BLOCKBYTES;
        inlen -= BLAKE2B_BLOCKBYTES;
      }
    }
    memcpy( S->buf + S->buflen, in, inlen );
    S->buflen += inlen;
  }
  return 0;
}

// Assembly:
testq %rdx, %rdx
je 0x826e
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0xe0(%rdi), %rax
movl $0x80, %r12d
subq %rax, %r12
movq %rdx, %r15
subq %r12, %r15
jbe 0x8241
movq $0x0, 0xe0(%rbx)
leaq 0x60(%rbx), %r13
leaq (%rbx,%rax), %rdi
addq $0x60, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x31e0
movq 0x40(%rbx), %rax
subq $-0x80, %rax
movq %rax, 0x40(%rbx)
sbbq $-0x1, 0x48(%rbx)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x8271
addq %r12, %r14
cmpq $0x81, %r15
jb 0x8244
movl $0x80, %r12d
movq 0x40(%rbx), %rax
leaq (%rax,%r12), %rcx
movq %rcx, 0x40(%rbx)
cmpq $-0x80, %rax
sbbq $-0x1, 0x48(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8271
addq %r12, %r14
addq $-0x80, %r15
cmpq %r12, %r15
ja 0x8213
jmp 0x8244
movq %rdx, %r15
movq 0xe0(%rbx), %rax
leaq (%rbx,%rax), %rdi
addq $0x60, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x31e0
addq %r15, 0xe0(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/blake2b-ref.c
// Function: blake2b_final
int blake2b_final( blake2b_state *S, void *out, size_t outlen )
{
  uint8_t buffer[BLAKE2B_OUTBYTES] = {0};
  size_t i;

  if( out == NULL || outlen < S->outlen )
    return -1;

  if( blake2b_is_lastblock( S ) )
    return -1;

  blake2b_increment_counter( S, S->buflen );
  blake2b_set_lastblock( S );
  memset( S->buf + S->buflen, 0, BLAKE2B_BLOCKBYTES - S->buflen ); /* Padding */
  blake2b_compress( S, S->buf );

  for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */
    store64( buffer + sizeof( S->h[i] ) * i, S->h[i] );

  memcpy( out, buffer, S->outlen );
  secure_zero_memory(buffer, sizeof(buffer));
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rsi, %rsi
je 0x9af3
movq %rdi, %r14
cmpq %rdx, 0xe8(%rdi)
ja 0x9af3
cmpq $0x0, 0x50(%r14)
jne 0x9af3
movq %rsi, %rbx
movq 0xe0(%r14), %rax
addq %rax, 0x40(%r14)
adcq $0x0, 0x48(%r14)
cmpb $0x0, 0xf0(%r14)
je 0x9a87
movq $-0x1, 0x58(%r14)
movq $-0x1, 0x50(%r14)
leaq 0x60(%r14), %r15
leaq (%r14,%rax), %rdi
addq $0x60, %rdi
movl $0x80, %edx
subq %rax, %rdx
xorl %r12d, %r12d
xorl %esi, %esi
callq 0x3170
movq %r14, %rdi
movq %r15, %rsi
callq 0x8271
movq (%r14,%r12,8), %rax
movq %rax, (%rsp,%r12,8)
incq %r12
cmpq $0x8, %r12
jne 0x9ab8
movq 0xe8(%r14), %rdx
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x31e0
movq 0x529b(%rip), %rax      # 0xed80
xorl %ebp, %ebp
movl $0x40, %edx
movq %r14, %rdi
xorl %esi, %esi
callq *%rax
movl %ebp, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/blake2b-ref.c
// Function: blake2b
int blake2b( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen )
{
  blake2b_state S[1];

  /* Verify parameters */
  if ( NULL == in && inlen > 0 ) return -1;

  if ( NULL == out ) return -1;

  if( NULL == key && keylen > 0 ) return -1;

  if( !outlen || outlen > BLAKE2B_OUTBYTES ) return -1;

  if( keylen > BLAKE2B_KEYBYTES ) return -1;

  if( keylen > 0 )
  {
    if( blake2b_init_key( S, outlen, key, keylen ) < 0 ) return -1;
  }
  else
  {
    if( blake2b_init( S, outlen ) < 0 ) return -1;
  }

  blake2b_update( S, ( const uint8_t * )in, inlen );
  blake2b_final( S, out, outlen );
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rcx, %r12
testq %rdx, %rdx
sete %al
testq %rcx, %rcx
setne %cl
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x9b9a
andb %cl, %al
jne 0x9b9a
testq %r8, %r8
sete %al
testq %r9, %r9
setne %cl
cmpq $0x40, %r9
ja 0x9b9a
movq %rdx, %r13
movq %rsi, %r14
leaq -0x41(%rsi), %rdx
cmpq $-0x40, %rdx
jb 0x9b9a
andb %cl, %al
jne 0x9b9a
movq %rdi, %r15
movq %rsp, %rdi
movq %r14, %rsi
testq %r9, %r9
je 0x9b70
movq %r8, %rdx
movq %r9, %rcx
callq 0x8047
jmp 0x9b75
callq 0x7f91
testl %eax, %eax
js 0x9b9a
movq %rsp, %rbx
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x8193
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x9a17
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/ndsol[P]git-mine/hashapi.cpp
// Function: hexdump(char*, unsigned long, unsigned char*, unsigned long)
int hexdump(char* buf, size_t buflen, uint8_t* bytes, size_t byteslen) {
  char* p = buf;
  size_t len = buflen;
  for (size_t i = 0; len > 0 && i < byteslen; i++) {
    size_t r = snprintf(p, len, "%02x", bytes[i]);
    if (r < len) {
      p += r;
      len -= r;
    } else {
      fprintf(stderr, "overflow on byte %zu\n", i);
      return 1;
    }
  }
  if (len) {
    *p = 0;
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
sete %al
testq %rcx, %rcx
sete %cl
orb %al, %cl
jne 0x9c0c
movq %rdx, %r12
leaq 0x1bce(%rip), %rbp      # 0xb7b0
xorl %r13d, %r13d
movzbl (%r12,%r13), %ecx
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x33e0
cltq
subq %rax, %r14
jbe 0x9c25
addq %rax, %rbx
incq %r13
cmpq %r13, %r15
jne 0x9be5
xorl %eax, %eax
testq %r14, %r14
je 0x9c16
movb $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x53ac(%rip), %rax      # 0xefd8
movq (%rax), %rdi
leaq 0x1b7f(%rip), %rsi      # 0xb7b5
movq %r13, %rdx
xorl %eax, %eax
callq 0x3340
movl $0x1, %eax
jmp 0x9c16
// File: /workspace/github_cpp_makefile_star2_O3/Diggie-Bro[P]StreamCode/test/../misc/../src/builtin/io.h
// Function: getIOModule()
struct Module getIOModule() {
    struct Module ioModule;
    ioModule.module_names_ = "io";
    ioModule.configure_file_ = "io/config.strmcode";

    vector<string> module_vector;
    module_vector.push_back("io/cio.h");
    ioModule.module_files_ = module_vector;
    
    return ioModule;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
xorl %eax, %eax
movq %rax, 0x8(%rdi)
movb %al, 0x10(%rdi)
leaq 0x30(%rdi), %rcx
movq %rcx, 0x20(%rdi)
movq %rax, 0x28(%rdi)
movb %al, 0x30(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rdi)
movq %rax, 0x50(%rdi)
leaq 0x2c47(%rip), %rcx      # 0x5024
movl $0x2, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x21b0
leaq 0x20(%rbx), %rdi
movq 0x28(%rbx), %rdx
leaq 0x2c2c(%rip), %rcx      # 0x5027
movl $0x12, %r8d
xorl %esi, %esi
callq 0x21b0
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
movq $0x0, -0x20(%rbp)
leaq -0x40(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x2c14(%rip), %rsi      # 0x503a
leaq 0x2c15(%rip), %rdx      # 0x5042
leaq -0x50(%rbp), %rdi
callq 0x4014
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x3dc8
leaq 0x40(%rbx), %r14
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x2455
callq 0x20f0
leaq -0x30(%rbp), %rsi
movq %r14, %rdi
callq 0x2aee
leaq -0x30(%rbp), %rdi
callq 0x2c76
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x248d
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x2490
callq 0x20f0
jmp 0x2490
movq %rax, %r14
leaq -0x30(%rbp), %rdi
callq 0x2c76
jmp 0x249e
movq %rax, %r14
movq %rbx, %rdi
callq 0x2cce
movq %r14, %rdi
callq 0x21e0
// File: /workspace/github_cpp_makefile_star2_O3/Diggie-Bro[P]StreamCode/test/../misc/../src/builtin/io.h
// Function: executor(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<Variables, std::allocator<Variables>>)
struct Variables executor(string function, vector<struct Variables> param) {
    if (function == "print") {
        cio_std_out(param.at(0));
        struct Variables return_variable;
        return_variable.type = VOID;
        return_variable.value = "";
        return return_variable;
    } else {
        struct Variables return_variable;
        return_variable.type = VOID;
        return_variable.value = "";
        return return_variable;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x2b78(%rip), %rsi      # 0x5043
movq %rax, %rdi
callq 0x2050
testl %eax, %eax
je 0x2510
leaq 0x8(%rbx), %r14
leaq 0x18(%rbx), %r15
movq %r15, 0x8(%rbx)
movq $0x0, 0x10(%rbx)
movb $0x0, 0x18(%rbx)
movl $0x4, (%rbx)
leaq 0x2c17(%rip), %rcx      # 0x5113
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x21b0
jmp 0x259b
movq (%r14), %rax
cmpq %rax, 0x8(%r14)
je 0x25a9
movl (%rax), %ecx
leaq -0x38(%rbp), %rdi
movl %ecx, -0x8(%rdi)
leaq -0x28(%rbp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
callq 0x34aa
cmpl $0x2, -0x18(%r14)
jne 0x2559
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq 0x4a84(%rip), %rdi      # 0x6fd8
callq 0x2120
movq -0x38(%rbp), %rdi
cmpq %r14, %rdi
je 0x2567
callq 0x20f0
leaq 0x8(%rbx), %r14
leaq 0x18(%rbx), %r15
movq %r15, 0x8(%rbx)
movq $0x0, 0x10(%rbx)
movb $0x0, 0x18(%rbx)
movl $0x4, (%rbx)
leaq 0x2b87(%rip), %rcx      # 0x5113
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x21b0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2b1a(%rip), %rdi      # 0x50ca
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2190
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r14, %rdi
jne 0x25d6
jmp 0x25db
jmp 0x25cb
movq %rax, %rbx
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x25db
callq 0x20f0
movq %rbx, %rdi
callq 0x21e0
// File: /workspace/github_cpp_makefile_star2_O3/Diggie-Bro[P]StreamCode/test/../misc/../src/runtime/memory.h
// Function: VariableManager::editVariable(VariableMem*, Variables&)
void editVariable(struct VariableMem* mem, struct Variables& variable) {
            if (variable.type != mem->type) return;
            if (mem->type == INT) {
                int nvariable = mem->integerMem;
                nvariable = atoi(variable.value.c_str());
            } else if (mem->type == DOUBLE) {
                double nvariable = mem->doubleMem;
                nvariable = atof(variable.value.c_str());
            } else if (mem->type == STRING) {
                string nvariable = mem->stringMem;
            } else if (mem->type == BOOL) {
                bool nvariable = mem->booleanMem;
                nvariable = variable.value == "false" ? false : true;
            }
        }

// Assembly:
movl (%rdx), %eax
cmpl (%rsi), %eax
jne 0x359a
cmpl $0x3, %eax
je 0x359b
cmpl $0x2, %eax
jne 0x359a
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
leaq -0x20(%rbp), %r14
movq %r14, -0x10(%r14)
movq 0x38(%rsi), %rax
movq 0x40(%rsi), %rdx
addq %rax, %rdx
leaq -0x30(%rbp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x34aa
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0x3592
callq 0x20f0
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
addq $0x8, %rdx
leaq 0x1af2(%rip), %rsi      # 0x5098
movq %rdx, %rdi
jmp 0x2050
// File: /workspace/github_cpp_makefile_star2_O3/Diggie-Bro[P]StreamCode/test/../misc/../src/runtime/memory.h
// Function: VariableManager::declareVariable(Variables&, Variables&)
struct VariableMem declareVariable(struct Variables& varname, struct Variables& variable) {
            // if (varname.type != VARIABLE) break
            struct VariableMem mem {variable.type, varname.value, 0, 0.0, "", true};

            if (variable.type == INT) {
                mem.integerMem = stoi(variable.value);
            } else if (variable.type == DOUBLE) {
                mem.doubleMem = stof(variable.value);
            } else if (variable.type == STRING) {
                mem.stringMem = variable.value;
            } else if (variable.type == BOOL) {
                mem.booleanMem = variable.value == "false" ? false : true;
            } else {
                // :TODO hmmmm..... 
            }

            return mem;
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdi, %rbx
movl (%rcx), %eax
movl %eax, (%rdi)
leaq 0x8(%rdi), %r12
leaq 0x18(%rdi), %r13
movq %r13, 0x8(%rdi)
movq 0x8(%rdx), %rsi
movq 0x10(%rdx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x34aa
movl $0x0, 0x28(%rbx)
movq $0x0, 0x30(%rbx)
leaq 0x38(%rbx), %r15
leaq 0x48(%rbx), %rax
movq %rax, 0x38(%rbx)
leaq 0x1b0c(%rip), %rdx      # 0x5113
movq %r15, %rdi
movq %rdx, %rsi
callq 0x4014
movb $0x1, 0x58(%rbx)
movl (%r14), %eax
cmpq $0x3, %rax
ja 0x3704
leaq 0x19da(%rip), %rcx      # 0x5004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%r14), %r15
callq 0x2030
movq %rax, %r14
movl (%rax), %r13d
movl $0x0, (%rax)
leaq -0x30(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x2160
cmpq %r15, (%r12)
je 0x3716
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x372e
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x372e
testl %ecx, %ecx
jne 0x3685
movl %r13d, (%r14)
movl %eax, 0x28(%rbx)
jmp 0x3704
addq $0x8, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x2090
jmp 0x3704
addq $0x8, %r14
leaq 0x19f2(%rip), %rsi      # 0x5098
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
setne 0x58(%rbx)
jmp 0x3704
movq 0x8(%r14), %r15
callq 0x2030
movq %rax, %r14
movl (%rax), %r13d
movl $0x0, (%rax)
leaq -0x30(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x2150
cmpq %r15, (%r12)
je 0x3722
movl (%r14), %eax
testl %eax, %eax
je 0x36f8
cmpl $0x22, %eax
jne 0x36fb
leaq 0x19b0(%rip), %rdi      # 0x50a3
callq 0x2170
movl %r13d, (%r14)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x30(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1981(%rip), %rdi      # 0x509e
callq 0x20a0
leaq 0x197a(%rip), %rdi      # 0x50a3
callq 0x20a0
leaq 0x1969(%rip), %rdi      # 0x509e
callq 0x2170
movq %rax, %r15
jmp 0x374d
jmp 0x3741
movq %rax, %r15
cmpl $0x0, (%r14)
jne 0x374d
movl %r13d, (%r14)
movq %rbx, %rdi
callq 0x3770
jmp 0x3768
movq %rax, %r15
movq (%r12), %rdi
cmpq %r13, %rdi
je 0x3768
callq 0x20f0
movq %r15, %rdi
callq 0x21e0
// File: /workspace/github_cpp_makefile_star2_O3/Diggie-Bro[P]StreamCode/test/../misc/../src/runtime/memory.h
// Function: VariableManager::getVariable(VariableMem*)
struct Variables getVariable(struct VariableMem* mem) {
            struct Variables variable {mem->type, ""};
            if (mem->type == INT) variable.value = to_string(mem->integerMem);
            else if (mem->type == DOUBLE) variable.value = to_string(mem->doubleMem);
            else if (mem->type == STRING) variable.value = mem->stringMem;
            else if (mem->type == BOOL) variable.value = (mem->booleanMem == true ? "true" : "false");
            return variable;
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r15
movq %rdi, %rbx
movl (%rdx), %eax
movl %eax, (%rdi)
leaq 0x8(%rdi), %r14
leaq 0x18(%rdi), %r12
movq %r12, 0x8(%rdi)
leaq 0x193f(%rip), %rdx      # 0x5113
movq %r14, %rdi
movq %rdx, %rsi
callq 0x4014
movl (%r15), %eax
cmpq $0x3, %rax
ja 0x3947
leaq 0x1821(%rip), %rcx      # 0x5014
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r12, -0x30(%rbp)
movl 0x28(%r15), %r15d
movl %r15d, %r12d
negl %r12d
cmovsl %r15d, %r12d
movl $0x1, %r13d
cmpl $0xa, %r12d
jb 0x38f4
movl $0x4, %r13d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r12d, %ecx
cmpl $0x63, %ecx
jbe 0x38eb
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x38f1
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x38f4
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r13d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x382c
addl $-0x3, %r13d
jmp 0x38f4
addq $0x38, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2090
jmp 0x3947
movzbl 0x58(%r15), %r8d
leaq 0x1834(%rip), %rax      # 0x50c2
leaq 0x1803(%rip), %rcx      # 0x5098
testq %r8, %r8
cmovneq %rax, %rcx
movq 0x10(%rbx), %rdx
xorq $0x5, %r8
movq %r14, %rdi
xorl %esi, %esi
callq 0x21b0
jmp 0x3947
movsd 0x30(%r15), %xmm0
movq 0x3708(%rip), %rsi      # 0x6fc8
leaq 0x1800(%rip), %rcx      # 0x50c7
leaq -0x50(%rbp), %rdi
movl $0x148, %edx            # imm = 0x148
movb $0x1, %al
callq 0x3d16
leaq -0x50(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2140
movq (%r15), %rdi
jmp 0x3939
addl $-0x2, %r13d
jmp 0x38f4
decl %r13d
shrl $0x1f, %r15d
leal (%r15,%r13), %esi
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x50(%rbp), %rdi
movl $0x2d, %edx
callq 0x2130
leaq -0x50(%rbp), %rax
addq (%rax), %r15
movq %r15, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x3ca4
movq %r14, %rdi
leaq -0x50(%rbp), %r14
movq %r14, %rsi
callq 0x2140
movq (%r14), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3947
callq 0x20f0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3961
jmp 0x395d
movq %r12, -0x30(%rbp)
movq %rax, %rbx
movq (%r14), %rdi
cmpq -0x30(%rbp), %rdi
je 0x3972
callq 0x20f0
movq %rbx, %rdi
callq 0x21e0
// File: /workspace/github_cpp_makefile_star2_O3/patmorin[P]rotate/jain.cpp
// Function: void print_array<unsigned int, unsigned long>(unsigned int*, unsigned long)
void print_array(T *a, I n) {
    if (n < 50) {
        for (I i = 0; i < n-1; i++) {
            std::cout << a[i] << ",";
        }
        std::cout << a[n-1] << std::endl;
    }
}

// Assembly:
cmpq $0x31, %rsi
ja 0x23dd
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r13
decq %r13
movq %rsi, %rbx
movq %rdi, %r14
je 0x2394
movq 0x3c69(%rip), %r15      # 0x5fd0
leaq 0x1f60(%rip), %r12      # 0x42ce
xorl %ebp, %ebp
movl (%r14,%rbp,4), %esi
movq %r15, %rdi
callq 0x10a0
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x1110
incq %rbp
cmpq %rbp, %r13
jne 0x2370
movl -0x4(%r14,%rbx,4), %esi
movq 0x3c30(%rip), %rdi      # 0x5fd0
callq 0x10a0
movq %rax, %rbx
movq (%rax), %rax
movl $0xa, %esi
movq -0x18(%rax), %rdi
addq %rbx, %rdi
callq 0x10e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1040
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10b0
retq
// File: /workspace/github_cpp_makefile_star2_O3/patmorin[P]rotate/jain.cpp
// Function: void jain_inshuffle<unsigned int, unsigned long>(unsigned int*, unsigned long)
void jain_inshuffle(Data *a, Index n) {
	while (n > 1) {
		// Compute appropriate value of m
		Index m = 1;
		while (3*m-1 <= n) m *= 3;
		m -= 1;

		// Move correct m elements to front of the array
		std::rotate(a+m/2, a+n/2, a+n/2+m/2);

		// Now use Jain's trick to shuffle a[0,...,m-1];
		for (Index g = 1; g < m; g *= 3) {
			Index cur = g-1;
			Data t = a[cur];
			do {
				Index nxt = inshuffle_perm3(cur, m);
				Data t2 = a[nxt];
				a[nxt] = t;
				t = t2;
				cur = nxt;
			} while (cur != g-1);
		}

		// Recurse on a[m,...n-1]
		a += m;
		n -= m;
	}
}

// Assembly:
cmpq $0x2, %rsi
jb 0x2498
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movl $0x1, %eax
movq %rax, %r12
leaq (%rax,%rax,2), %rax
leaq -0x1(%r12,%r12,2), %rcx
cmpq %rbx, %rcx
jbe 0x2401
movq %rbx, %rax
shrq %rax
leaq -0x1(%r12), %r13
leaq (%r14,%rax,4), %rsi
movq %r13, %rbp
shrq %rbp
leaq (%r14,%rbp,4), %rdi
leaq (%rsi,%rbp,4), %rdx
callq 0x2c04
cmpq $0x2, %r13
jb 0x2479
movl $0x1, %eax
movl -0x4(%r14,%rax,4), %edx
leaq -0x1(%rax), %rcx
movq %rcx, %rsi
cmpq %rsi, %rbp
leaq 0x1(%rsi,%rsi), %rdi
movq %r12, %rsi
cmovaq %r15, %rsi
subq %rsi, %rdi
movl (%r14,%rdi,4), %r8d
movl %edx, (%r14,%rdi,4)
movq %rdi, %rsi
movl %r8d, %edx
cmpq %rcx, %rdi
jne 0x244b
leaq (%rax,%rax,2), %rax
cmpq %r13, %rax
jb 0x243f
leaq (%r14,%r13,4), %r14
subq %r13, %rbx
cmpq $0x1, %rbx
ja 0x23fc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/patmorin[P]rotate/jain.cpp
// Function: void prime_inshuffle<unsigned int, unsigned long>(unsigned int*, unsigned long)
void prime_inshuffle(Data *a, Index n) {
	while (n > 1) {
		// Compute appropriate value of m
		int i = 0;
		while (sprimes[i+1] <= n) i++;
		Index m = sprimes[i];

		// Move correct m elements to front of the array
		std::rotate(a+m/2, a+n/2, a+n/2+m/2);

		// Now use Jain's trick to shuffle a[0,...,m-1];
		Index cur = 0;
		Data t = a[cur];
		do {
			Index nxt = inshuffle_perm3(cur, m);
			Data t2 = a[nxt];
			a[nxt] = t;
			t = t2;
			cur = nxt;
		} while (cur != 0);

		// Recurse on a[m,...n-1]
		a += m;
		n -= m;
	}
}

// Assembly:
cmpq $0x2, %rsi
jb 0x259d
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x3bd1(%rip), %r15      # 0x60e0
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
movq $-0x1, %rax
movq %rax, %rcx
incq %rax
cmpq %rbx, 0x10(%r15,%rcx,8)
jbe 0x251f
movl %eax, %eax
movq (%r15,%rax,8), %r13
movq %rbx, %rax
shrq %rax
leaq (%r14,%rax,4), %rsi
movq %r13, %rbp
shrq %rbp
leaq (%r14,%rbp,4), %rdi
leaq (%rsi,%rbp,4), %rdx
callq 0x2c04
movl (%r14), %ecx
movq %r13, %rax
notq %rax
xorl %edx, %edx
cmpq %rdx, %rbp
movq %rax, %rsi
cmovaq %r12, %rsi
leaq (%rsi,%rdx,2), %rdi
leaq 0x1(%rsi,%rdx,2), %rsi
movl 0x4(%r14,%rdi,4), %r8d
movl %ecx, 0x4(%r14,%rdi,4)
movq %rsi, %rdx
movl %r8d, %ecx
testq %rsi, %rsi
jne 0x255a
leaq (%r14,%r13,4), %r14
subq %r13, %rbx
cmpq $0x1, %rbx
ja 0x2518
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/patmorin[P]rotate/jain.cpp
// Function: void jain_inshuffle_pf<unsigned int, unsigned long>(unsigned int*, unsigned long)
void jain_inshuffle_pf(Data *a, Index n) {
	while (n > 1) {
		// Compute appropriate value of m
		Index m = 1;
		while (3*m-1 <= n) m *= 3;
		m -= 1;

		// Move correct m elements to front of the array
		std::rotate(a+m/2, a+n/2, a+n/2+m/2);

		// Now use Jain's trick to shuffle a[0,...,m-1];
		for (Index g = 1; g < m; g *= 3) {
			Index cur = g-1;
			Data t = a[cur];

			const Index readahead = 35;
			Index buf[readahead];
			buf[0] = cur;
			for (Index i = 1; i < readahead; i++) {
				buf[i] = inshuffle_perm3(buf[i-1], m);
				__builtin_prefetch(a+buf[i]);
			}

			Index bicur = 0;
			do {
				Index biprv = bicur == 0 ? readahead-1 : bicur-1;
				Index binxt = bicur+1 == readahead ? 0 : bicur+1;

				buf[bicur] = inshuffle_perm3(buf[biprv], m);
				__builtin_prefetch(a+buf[bicur], 1);

				Data t2 = a[buf[binxt]];
				a[buf[binxt]] = t;
				t = t2;
				bicur = binxt;
			} while (buf[bicur] != g-1);
		}

		// Recurse on a[m,...n-1]
		a += m;
		n -= m;
	}
}

// Assembly:
cmpq $0x2, %rsi
jb 0x26d0
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movl $0x22, %r12d
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movl $0x1, %eax
movq %rax, %r13
leaq (%rax,%rax,2), %rax
leaq -0x1(%r13,%r13,2), %rcx
cmpq %rbx, %rcx
jbe 0x25cd
movq %rbx, %rax
shrq %rax
leaq -0x1(%r13), %rbp
leaq (%r14,%rax,4), %rsi
movq %rbp, 0x8(%rsp)
shrq %rbp
leaq (%r14,%rbp,4), %rdi
leaq (%rsi,%rbp,4), %rdx
callq 0x2c04
movq 0x8(%rsp), %r10
cmpq $0x2, %r10
jb 0x26ae
movl $0x1, %eax
movl -0x4(%r14,%rax,4), %edx
leaq -0x1(%rax), %rcx
movl $0x1, %esi
movq %rcx, %rdi
movq %rcx, 0x10(%rsp)
cmpq %rdi, %rbp
leaq 0x1(%rdi,%rdi), %rdi
movq %r13, %r8
cmovaq %r15, %r8
subq %r8, %rdi
movq %rdi, 0x10(%rsp,%rsi,8)
prefetcht0 (%r14,%rdi,4)
incq %rsi
cmpq $0x23, %rsi
jne 0x262b
xorl %esi, %esi
movq %rsi, %rdi
subq $0x1, %rdi
leaq 0x1(%rsi), %r8
cmovbq %r12, %rdi
cmpq $0x23, %r8
movq 0x10(%rsp,%rdi,8), %rdi
cmoveq %r15, %r8
leaq 0x1(%rdi,%rdi), %r9
cmpq %rdi, %rbp
movq %r13, %rdi
cmovaq %r15, %rdi
subq %rdi, %r9
movq %r9, 0x10(%rsp,%rsi,8)
prefetchw (%r14,%r9,4)
movq 0x10(%rsp,%r8,8), %rdi
movl (%r14,%rdi,4), %esi
movl %edx, (%r14,%rdi,4)
movl %esi, %edx
movq %r8, %rsi
cmpq %rcx, %rdi
jne 0x2652
leaq (%rax,%rax,2), %rax
cmpq %r10, %rax
jb 0x2615
leaq (%r14,%r10,4), %r14
subq %r10, %rbx
cmpq $0x1, %rbx
ja 0x25c8
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/patmorin[P]rotate/jain.cpp
// Function: void prime_inshuffle_pf<unsigned int, unsigned long>(unsigned int*, unsigned long)
void prime_inshuffle_pf(Data *a, Index n) {
	while (n > 1) {
		// Compute appropriate value of m
 		int i = 0;
 		while (sprimes[i+1] <= n) i++;
 		Index m = sprimes[i];

		// Move correct m elements to front of the array
		std::rotate(a+m/2, a+n/2, a+n/2+m/2);

		// Now use Jain's trick to shuffle a[0,...,m-1];
		Index cur = 1;
		Data t = a[cur];

		const Index readahead = 35;
		Index buf[readahead];
		buf[0] = cur;
		for (Index i = 1; i < readahead; i++) {
			buf[i] = inshuffle_perm3(buf[i-1], m);
			__builtin_prefetch(a+buf[i]);
		}

		Index bicur = 0;
		do {
			Index biprv = bicur == 0 ? readahead-1 : bicur-1;
			Index binxt = bicur+1 == readahead ? 0 : bicur+1;

			buf[bicur] = inshuffle_perm3(buf[biprv], m);
			__builtin_prefetch(a+buf[bicur], 1);

			Data t2 = a[buf[binxt]];
			a[buf[binxt]] = t;
			t = t2;
			bicur = binxt;
		} while (buf[bicur] != 1);

		// Recurse on a[m,...n-1]
		a += m;
		n -= m;
	}
}

// Assembly:
cmpq $0x2, %rsi
jb 0x27fa
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
leaq 0x39ed(%rip), %r15      # 0x60e0
movl $0x22, %r13d
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
movq $-0x1, %rax
movq %rax, %rcx
incq %rax
cmpq %rbx, 0x10(%r15,%rcx,8)
jbe 0x2709
movl %eax, %eax
movq (%r15,%rax,8), %rbp
movq %rbx, %rax
shrq %rax
leaq (%r14,%rax,4), %rsi
movq %rbp, 0x8(%rsp)
shrq %rbp
leaq (%r14,%rbp,4), %rdi
leaq (%rsi,%rbp,4), %rdx
callq 0x2c04
movq 0x8(%rsp), %r10
movl 0x4(%r14), %ecx
movl $0x1, %edx
movl $0x1, %esi
movq $0x1, 0x10(%rsp)
movq %r10, %rax
notq %rax
cmpq %rdx, %rbp
movq %rax, %rdi
cmovaq %r12, %rdi
leaq (%rdi,%rdx,2), %r8
leaq 0x1(%rdi,%rdx,2), %rdx
movq %rdx, 0x10(%rsp,%rsi,8)
prefetcht0 0x4(%r14,%r8,4)
incq %rsi
cmpq $0x23, %rsi
jne 0x275d
xorl %edx, %edx
movq %rdx, %rsi
subq $0x1, %rsi
leaq 0x1(%rdx), %rdi
movq %rax, %r8
cmovbq %r13, %rsi
cmpq $0x23, %rdi
movq 0x10(%rsp,%rsi,8), %rsi
cmoveq %r12, %rdi
cmpq %rsi, %rbp
cmovaq %r12, %r8
leaq (%r8,%rsi,2), %r9
leaq 0x1(%r8,%rsi,2), %rsi
movq %rsi, 0x10(%rsp,%rdx,8)
prefetchw 0x4(%r14,%r9,4)
movq 0x10(%rsp,%rdi,8), %rsi
movl (%r14,%rsi,4), %edx
movl %ecx, (%r14,%rsi,4)
movl %edx, %ecx
movq %rdi, %rdx
cmpq $0x1, %rsi
jne 0x2786
leaq (%r14,%r10,4), %r14
subq %r10, %rbx
cmpq $0x1, %rbx
ja 0x2702
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/patmorin[P]rotate/jain.cpp
// Function: void prime_outshuffle<void blocked_outshuffle<96u, false, unsigned int, unsigned long>(unsigned int*, unsigned long)::block, unsigned long>(void blocked_outshuffle<96u, false, unsigned int, unsigned long>(unsigned int*, unsigned long)::block*, unsigned long)
void prime_outshuffle(Data *a, Index n) {
	if (n <= 1) return;

	// Compute appropriate value of m
	int i = 0;
	while (sprimes[i+1] <= n) i++;
	Index m = sprimes[i];

	// Follow the cycle through a[0,...,m-1];
	Index cur = 0;
	Data t[2];
	int flipflop = 0;
	t[flipflop] = a[cur];
	do {
		Index nxt = outshuffle_perm3(cur, m);
		t[!flipflop] = a[nxt];
		a[nxt] = t[flipflop];
		flipflop = !flipflop;
		cur = nxt;
	} while (cur != 0);

	// Recurse on a[m,...n-1]
	prime_outshuffle(a+m, n-m);

	// Regroup odds and evens
	std::rotate(a+m/2, a+m, a+m+(n-m)/2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
movq %rdi, (%rsp)
cmpq $0x2, %rsi
jb 0x2e6c
movq $-0x1, %rcx
leaq 0x3352(%rip), %rax      # 0x60e0
movq %rsi, %rbx
movq %rcx, %rdx
incq %rcx
cmpq %rbx, 0x10(%rax,%rdx,8)
jbe 0x2d91
movq (%rsp), %rsi
movl %ecx, %ecx
movq (%rax,%rcx,8), %r13
leaq 0x10(%rsp), %rdi
movl $0x180, %edx            # imm = 0x180
callq 0x10c0
movq %r13, 0x8(%rsp)
shrq %r13
xorl %ebp, %ebp
xorl %r12d, %r12d
movq %r13, %rax
testb $0x1, %bpl
je 0x2dcf
xorl %eax, %eax
shrq %rbp
movl %r12d, %r14d
xorl $0x1, %r14d
movl $0x180, %edx            # imm = 0x180
addq %rax, %rbp
leaq (%r14,%r14,2), %rax
leaq (%rbp,%rbp,2), %r15
shlq $0x7, %rax
shlq $0x7, %r15
addq (%rsp), %r15
leaq 0x10(%rsp,%rax), %rdi
movq %r15, %rsi
callq 0x10c0
movl %r12d, %eax
leaq (%rax,%rax,2), %rax
movl $0x180, %edx            # imm = 0x180
movq %r15, %rdi
shlq $0x7, %rax
leaq 0x10(%rsp,%rax), %rsi
callq 0x10c0
movl %r14d, %r12d
testq %rbp, %rbp
jne 0x2dc4
movq 0x8(%rsp), %rax
movq (%rsp), %r14
leaq (%rax,%rax,2), %r15
subq %rax, %rbx
movq %rbx, %rsi
shlq $0x7, %r15
addq %r14, %r15
movq %r15, %rdi
callq 0x2d61
shrq %rbx
leaq (%r13,%r13,2), %rdi
movq %r15, %rsi
leaq (%rbx,%rbx,2), %rdx
shlq $0x7, %rdi
shlq $0x7, %rdx
addq %r14, %rdi
addq %r15, %rdx
callq 0x2e7e
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/patmorin[P]rotate/jain.cpp
// Function: void check_outshuffle_output<unsigned int, unsigned long>(unsigned int*, unsigned long)
void check_outshuffle_output(Data *a, Index n) {
	for (Index i = 0; i < n; i++) {
		if (a[i] != inshuffle_perm3(i, n)) {
			std::cerr << "Mistake in output!!!" << std::endl;
			exit(-1);
		}
	}
}

// Assembly:
testq %rsi, %rsi
je 0x28c6
movq %rsi, %rax
movq %rsi, %rcx
shrq %rax
notq %rcx
movl $0x1, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
movl (%rdi,%r9,4), %r10d
cmpq %r9, %rax
movq %rcx, %r11
cmovaq %r8, %r11
addq %rdx, %r11
cmpq %r10, %r11
jne 0x28c7
incq %r9
addq $0x2, %rdx
cmpq %r9, %rsi
jne 0x28a4
retq
pushq %rax
movq 0x3721(%rip), %rdi      # 0x5ff0
leaq 0x19fa(%rip), %rsi      # 0x42d0
callq 0x10f0
movq %rax, %rdi
callq 0x1080
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1120