LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/search.c
// Function: searchNew
SearchIterator *searchNew(SearchNode *root_node)
{
  CR_Region *r = CR_RegionNew();

  SearchIterator *iterator = CR_RegionAlloc(r, sizeof *iterator);
  iterator->r = r;

  iterator->current_path_buffer = allocatorWrapOneSingleGrowableBuffer(r);
  strSet(&iterator->current_path,
         strCopy(str("/"), iterator->current_path_buffer));
  iterator->tmp_buffer = allocatorWrapOneSingleGrowableBuffer(r);

  recursionStepRaw(iterator, root_node, root_node->policy);

  /* Prevent found paths from starting with two slashes. */
  iterator->state.path_length = 0;

  /* Store reference to ignore expression list. */
  iterator->ignore_expressions = *root_node->ignore_expressions;

  /* Initialise the state stack. */
  iterator->state_stack.used = 0;
  iterator->state_stack.capacity = 4;

  Allocator *state_array_buffer = allocatorWrapOneSingleGrowableBuffer(r);
  iterator->state_stack.state_array_buffer = state_array_buffer;
  iterator->state_stack.state_array =
    allocate(state_array_buffer,
             sSizeMul(sizeof *iterator->state_stack.state_array,
                      iterator->state_stack.capacity));

  return iterator;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdi, %r15
callq 0xd89c
movq %rax, %r14
movl $0x80, %esi
movq %rax, %rdi
callq 0xd960
movq %rax, %rbx
movq %r14, (%rax)
movq %r14, %rdi
callq 0x2842
movq %rax, 0x20(%rbx)
leaq 0x8(%rbx), %r12
leaq 0x3f22(%rip), %rsi      # 0xe448
leaq 0x20(%rsp), %r13
movq %r13, %rdi
callq 0xab5c
movq 0x20(%rbx), %rsi
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
leaq 0x38(%rsp), %r13
movq %r13, %rdi
callq 0xac37
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
callq 0xac25
movq %r14, %rdi
callq 0x2842
movq %rax, 0x28(%rbx)
movl 0x2c(%r15), %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa5e5
xorl %eax, %eax
movq %rax, 0x40(%rbx)
movq 0x50(%r15), %rcx
movq (%rcx), %rcx
movq %rcx, 0x30(%rbx)
movq %rax, 0x78(%rbx)
movq $0x4, 0x70(%rbx)
movq %r14, %rdi
callq 0x2842
movq %rax, %r14
movq %rax, 0x68(%rbx)
movq 0x70(%rbx), %rsi
movl $0x28, %edi
callq 0x8790
movq %r14, %rdi
movq %rax, %rsi
callq 0x27ac
movq %rax, 0x60(%rbx)
movq %rbx, %rax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/search.c
// Function: recursionStepRaw
static void recursionStepRaw(SearchIterator *iterator, SearchNode *node,
                             const BackupPolicy policy)
{
  /* Store the directories path length before recursing into it. */
  iterator->state.path_length = iterator->current_path.length;

  if(node != NULL && node->policy == BPOL_none &&
     !node->subnodes_contain_regex)
  {
    iterator->state.is_dir_search = false;
    iterator->state.access.current_node = node->subnodes;
  }
  else
  {
    iterator->state.is_dir_search = true;
    iterator->state.access.search.dir = sDirOpen(iterator->current_path);
    iterator->state.access.search.subnodes = node ? node->subnodes : NULL;
    iterator->state.access.search.fallback_policy = policy;
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebp
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
movq 0x10(%rdi), %rcx
movq %rcx, 0x40(%rdi)
testq %rsi, %rsi
je 0xa636
movq %rsi, %r14
cmpl $0x0, 0x2c(%rsi)
jne 0xa613
cmpb $0x0, 0x48(%r14)
je 0xa665
movb $0x1, 0x38(%rbx)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movups (%rax), %xmm0
movups %xmm0, (%rsp)
callq 0x8c32
movq %rax, 0x48(%rbx)
movq 0x40(%r14), %rax
jmp 0xa655
movb $0x1, 0x38(%rbx)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movups (%rax), %xmm0
movups %xmm0, (%rsp)
callq 0x8c32
movq %rax, 0x48(%rbx)
xorl %eax, %eax
movq %rax, 0x50(%rbx)
movl %ebp, 0x58(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movb $0x0, 0x38(%rbx)
movq 0x40(%r14), %rax
movq %rax, 0x48(%rbx)
jmp 0xa65c
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/search.c
// Function: finishDirectory
static SearchResult finishDirectory(SearchIterator *iterator)
{
  if(iterator->state_stack.used > 0)
  {
    iterator->state_stack.used--;
    iterator->state =
      iterator->state_stack.state_array[iterator->state_stack.used];

    return (SearchResult){ .type = SRT_end_of_directory };
  }

  CR_RegionRelease(iterator->r);

  return (SearchResult){ .type = SRT_end_of_search };
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x78(%rsi), %rax
testq %rax, %rax
je 0xa92c
decq %rax
movq %rax, 0x78(%rsi)
movq 0x60(%rsi), %rcx
leaq (%rax,%rax,4), %rax
movups (%rcx,%rax,8), %xmm0
movups 0x10(%rcx,%rax,8), %xmm1
movups %xmm0, 0x38(%rsi)
movups %xmm1, 0x48(%rsi)
movq 0x20(%rcx,%rax,8), %rax
movq %rax, 0x58(%rsi)
movl $0x10, %ebp
jmp 0xa939
movq (%rsi), %rdi
callq 0xda8a
movl $0x20, %ebp
movl $0xc0, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2190
movl %ebp, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/search.c
// Function: replaceCurrentFilename
static void replaceCurrentFilename(SearchIterator *iterator,
                                   StringView filename)
{
  StringView path_head =
    strCopy(strUnterminated(iterator->current_path.content,
                            iterator->state.path_length),
            iterator->tmp_buffer);
  strSet(
    &iterator->current_path,
    strAppendPath(path_head, filename, iterator->current_path_buffer));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %r14
leaq 0x8(%rdi), %rbx
movq 0x8(%rdi), %rsi
movq 0x40(%rdi), %rdx
leaq 0x50(%rsp), %r15
movq %r15, %rdi
callq 0xab78
movq 0x28(%r14), %rsi
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
leaq 0x68(%rsp), %r15
movq %r15, %rdi
callq 0xac37
movq 0x20(%r14), %rsi
movq 0xb0(%rsp), %rax
movq %rax, 0x28(%rsp)
movaps 0xa0(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
leaq 0x38(%rsp), %r14
movq %r14, %rdi
callq 0xaf03
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0xac25
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/search.c
// Function: finishNodeStep
static SearchResult finishNodeStep(SearchIterator *iterator,
                                   SearchNode *node,
                                   const BackupPolicy policy)
{
  SearchResult found_file = buildSearchResult(iterator, node, policy);

  if(node != NULL)
  {
    node->search_match |= found_file.type;
  }

  if(found_file.type == SRT_directory)
  {
    recursionStep(iterator, node, policy);
  }

  return found_file;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
testq %rdx, %rdx
je 0xaa41
cmpq $0x0, 0x40(%r14)
je 0xaa41
movq 0x18(%r15), %rax
movq %rax, 0x10(%rsp)
movups 0x8(%r15), %xmm0
movups %xmm0, (%rsp)
leaq 0x20(%rsp), %rdi
callq 0x8f5d
jmp 0xaa5d
movq 0x18(%r15), %rax
movq %rax, 0x10(%rsp)
movups 0x8(%r15), %xmm0
movups %xmm0, (%rsp)
leaq 0x20(%rsp), %rdi
callq 0x8fc6
movl $0xf000, %eax           # imm = 0xF000
andl 0x38(%rsp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
je 0xaa7b
cmpl $0xa000, %eax           # imm = 0xA000
jne 0xaa82
movl $0x2, %ebp
jmp 0xaa93
movl $0x1, %ebp
jmp 0xaa93
xorl %ecx, %ecx
cmpl $0x4000, %eax           # imm = 0x4000
setne %cl
leal 0x4(,%rcx,4), %ebp
movl %ebp, (%r12)
movups 0x8(%r15), %xmm0
movups %xmm0, 0x8(%r12)
movq 0x18(%r15), %rax
movq %rax, 0x18(%r12)
movq %r14, 0x20(%r12)
movl %ebx, 0x28(%r12)
addq $0x30, %r12
leaq 0x20(%rsp), %rsi
movl $0x90, %edx
movq %r12, %rdi
callq 0x2280
testq %r14, %r14
je 0xaad4
orl %ebp, 0x28(%r14)
cmpl $0x4, %ebp
jne 0xab4c
movq 0x78(%r15), %rdi
cmpq 0x70(%r15), %rdi
jne 0xab17
movl $0x2, %esi
callq 0x8790
movq %rax, 0x70(%r15)
movq 0x68(%r15), %r12
movl $0x28, %edi
movq %rax, %rsi
callq 0x8790
movq %r12, %rdi
movq %rax, %rsi
callq 0x27ac
movq %rax, 0x60(%r15)
movq 0x78(%r15), %rdi
jmp 0xab1b
movq 0x60(%r15), %rax
leaq (%rdi,%rdi,4), %rcx
movq 0x58(%r15), %rdx
movq %rdx, 0x20(%rax,%rcx,8)
movups 0x38(%r15), %xmm0
movups 0x48(%r15), %xmm1
movups %xmm1, 0x10(%rax,%rcx,8)
movups %xmm0, (%rax,%rcx,8)
incq 0x78(%r15)
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0xa5e5
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/str.c
// Function: strCopyRaw
char *strCopyRaw(StringView string, Allocator *a)
{
  char *raw_string = allocate(a, sSizeAdd(string.length, 1));
  memcpy(raw_string, string.content, string.length);
  raw_string[string.length] = '\0';
  return raw_string;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdi
callq 0x8778
movq %rbx, %rdi
movq %rax, %rsi
callq 0x27ac
movq %rax, %rbx
movq 0x20(%rsp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x2280
movb $0x0, (%rbx,%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/str.c
// Function: strCopy
StringView strCopy(StringView string, Allocator *a)
{
  return (StringView){
    .content = strCopyRaw(string, a),
    .length = string.length,
    .is_terminated = true,
  };
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x30(%rsp), %r15
movq 0x38(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdi
callq 0x8778
movq %rbx, %rdi
movq %rax, %rsi
callq 0x27ac
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2280
movb $0x0, (%rbx,%r12)
movq %rbx, (%r14)
movq %r12, 0x8(%r14)
movb $0x1, 0x10(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/str.c
// Function: strStripTrailingSlashes
StringView strStripTrailingSlashes(StringView string)
{
  size_t new_length = string.length;
  while(new_length > 0 && string.content[new_length - 1] == '/')
  {
    new_length--;
  }

  return (StringView){
    .content = string.content,
    .length = new_length,
    .is_terminated = new_length == string.length && string.is_terminated,
  };
}

// Assembly:
movq %rdi, %rax
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
xorl %ecx, %ecx
testq %rdx, %rdx
je 0xacbb
movq %rdx, %rdi
cmpb $0x2f, -0x1(%rsi,%rdi)
jne 0xacbd
decq %rdi
jne 0xacaf
xorl %edi, %edi
movq %rsi, (%rax)
movq %rdi, 0x8(%rax)
cmpq %rdx, %rdi
jne 0xacd1
leaq 0x8(%rsp), %rcx
movl 0x10(%rcx), %ecx
movb %cl, 0x10(%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/str.c
// Function: strSplitPath
PathSplit strSplitPath(StringView path)
{
  size_t last_slash = path.length;
  while(last_slash > 0 && path.content[last_slash - 1] != '/')
  {
    last_slash--;
  }

  /* If the last slash is preceded by other slashes, get its position
     instead. */
  while(last_slash > 1 && path.content[last_slash - 2] == '/')
  {
    last_slash--;
  }

  return (PathSplit){
    (StringView){
      .content = path.content,
      .length = last_slash > 0 ? last_slash - 1 : 0,
      .is_terminated = false,
    },
    (StringView){
      .content = &path.content[last_slash],
      .length = path.length - last_slash,
      .is_terminated = path.is_terminated,
    },
  };
}

// Assembly:
movq %rdi, %rax
leaq 0x8(%rsp), %rcx
movq (%rcx), %rsi
movq 0x8(%rcx), %rdx
xorl %edi, %edi
testq %rdx, %rdx
je 0xad1e
movq %rdx, %r8
cmpb $0x2f, -0x1(%rsi,%r8)
je 0xacfd
decq %r8
jne 0xacee
jmp 0xad1e
movl $0x1, %edi
cmpq $0x2, %r8
jb 0xad1e
cmpb $0x2f, -0x2(%rsi,%r8)
jne 0xad1b
decq %r8
cmpq $0x1, %r8
ja 0xad08
jmp 0xad1e
movq %r8, %rdi
movq %rsi, (%rax)
xorl %r8d, %r8d
movq %rdi, %r9
subq $0x1, %r9
cmovaeq %r9, %r8
movq %r8, 0x8(%rax)
movb $0x0, 0x10(%rax)
addq %rdi, %rsi
movq %rsi, 0x18(%rax)
subq %rdi, %rdx
movq %rdx, 0x20(%rax)
movb 0x10(%rcx), %cl
movb %cl, 0x28(%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/str.c
// Function: strIsWhitespaceOnly
bool strIsWhitespaceOnly(StringView string)
{
  for(size_t index = 0; index < string.length; index++)
  {
    if(string.content[index] != ' ' && string.content[index] != '\t')
    {
      return false;
    }
  }

  return true;
}

// Assembly:
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
je 0xadcc
leaq 0x8(%rsp), %rax
movq (%rax), %rdx
movq %rcx, %rsi
negq %rsi
movl $0x1, %edi
xorl %eax, %eax
movzbl -0x1(%rdx,%rdi), %r8d
cmpl $0x20, %r8d
je 0xadb4
cmpl $0x9, %r8d
jne 0xadce
cmpq %rcx, %rdi
setae %al
leaq (%rsi,%rdi), %r8
incq %r8
incq %rdi
cmpq $0x1, %r8
jne 0xada2
jmp 0xadce
movb $0x1, %al
andb $0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/string-table.c
// Function: strTableNew
StringTable *strTableNew(CR_Region *region)
{
  StringTable *table = CR_RegionAlloc(region, sizeof(*table));
  table->region = region;
  table->associations = 0;
  table->capacity = 32; /* A small initial value allows the test suite to
                           cover table resizing. */

  for(size_t index = 0; index < sizeof(table->secret_key); index++)
  {
    table->secret_key[index] = sRand() % UINT8_MAX;
  }

  const size_t array_size =
    sSizeMul(table->capacity, sizeof(*table->buckets));
  table->buckets = sMalloc(array_size);
  CR_RegionAttach(table->region, releaseStringTable, table);
  memset(table->buckets, 0, array_size);

  return table;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x30, %esi
callq 0xd960
movq %rax, %rbx
movq %r14, (%rax)
movq $0x0, 0x18(%rax)
movq $0x20, 0x10(%rax)
movl $0x20, %r14d
callq 0x9971
cltq
imulq $-0x7f7f7f7f, %rax, %rcx # imm = 0x80808081
shrq $0x20, %rcx
addl %eax, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
shrl $0x7, %ecx
addl %edx, %ecx
addl %eax, %ecx
movb %cl, (%rbx,%r14)
incq %r14
cmpq $0x30, %r14
jne 0xafc5
movq 0x10(%rbx), %rdi
movl $0x8, %esi
callq 0x8790
movq %rax, %r14
movq %rax, %rdi
callq 0x8804
movq %rax, 0x8(%rbx)
movq (%rbx), %rdi
leaq 0x21(%rip), %rsi        # 0xb03a
movq %rbx, %rdx
callq 0xda39
movq 0x8(%rbx), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2190
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/string-table.c
// Function: strTableMap
void strTableMap(StringTable *table, StringView key, void *data)
{
  if(table->associations == table->capacity)
  {
    doubleTableCapacity(table);
  }

  Bucket *bucket = CR_RegionAlloc(table->region, sizeof(*bucket));
  bucket->hash =
    siphash((const uint8_t *)key.content, key.length, table->secret_key);
  strSet(&bucket->key, key);
  bucket->data = data;

  /* Prepend the bucket to the bucket slot in the bucket array. */
  const size_t bucket_id = bucket->hash % table->capacity;
  bucket->next = table->buckets[bucket_id];
  table->buckets[bucket_id] = bucket;

  table->associations++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x50(%rsp), %rbp
movq 0x18(%rdi), %rdi
cmpq 0x10(%rbx), %rdi
jne 0xb0f0
movl $0x2, %esi
callq 0x8790
movq %rax, %r15
movl $0x8, %esi
movq %rax, %rdi
callq 0x8790
movq %rax, %r13
movq %rax, %rdi
callq 0x8804
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x2190
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0xb0df
xorl %esi, %esi
movq 0x8(%rbx), %rax
movq (%rax,%rsi,8), %rdi
testq %rdi, %rdi
je 0xb0d7
movq (%rdi), %rax
movq 0x28(%rdi), %r8
xorl %edx, %edx
divq %r15
movq (%r12,%rdx,8), %rax
movq %rax, 0x28(%rdi)
movq %rdi, (%r12,%rdx,8)
movq %r8, %rdi
testq %r8, %r8
jne 0xb0b7
incq %rsi
cmpq %rcx, %rsi
jne 0xb0aa
movq 0x8(%rbx), %rdi
callq 0x2040
movq %r12, 0x8(%rbx)
movq %r15, 0x10(%rbx)
movq (%rbx), %rdi
movl $0x30, %esi
callq 0xd960
movq %rax, %r15
movq (%rbp), %rdi
movq 0x8(%rbp), %rsi
leaq 0x20(%rbx), %rdx
callq 0xd43c
movq %rax, (%r15)
leaq 0x8(%r15), %rdi
movq 0x10(%rbp), %rax
movq %rax, 0x10(%rsp)
movups (%rbp), %xmm0
movups %xmm0, (%rsp)
callq 0xac25
movq %r14, 0x20(%r15)
movq (%r15), %rax
xorl %edx, %edx
divq 0x10(%rbx)
movq 0x8(%rbx), %rax
movq (%rax,%rdx,8), %rcx
movq %rcx, 0x28(%r15)
movq %r15, (%rax,%rdx,8)
incq 0x18(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/string-table.c
// Function: strTableGet
void *strTableGet(const StringTable *table, StringView key)
{
  const size_t hash =
    siphash((const uint8_t *)key.content, key.length, table->secret_key);
  const size_t bucket_id = hash % table->capacity;

  for(const Bucket *bucket = table->buckets[bucket_id]; bucket != NULL;
      bucket = bucket->next)
  {
    if(strIsEqual(key, bucket->key))
    {
      return bucket->data;
    }
  }

  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %r14
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rsi
leaq 0x20(%r14), %rdx
callq 0xd43c
xorl %ebx, %ebx
xorl %edx, %edx
divq 0x10(%r14)
movq 0x8(%r14), %rax
movq (%rax,%rdx,8), %r14
testq %r14, %r14
je 0xb1d5
leaq 0x50(%rsp), %r15
xorl %ebx, %ebx
movq 0x18(%r14), %rax
movq %rax, 0x28(%rsp)
movups 0x8(%r14), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
callq 0xad56
testb %al, %al
jne 0xb1d1
movq 0x28(%r14), %r14
testq %r14, %r14
jne 0xb199
jmp 0xb1d5
movq 0x20(%r14), %rbx
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/third-party/BLAKE2/blake2b-optimized.h
// 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 0xb26d
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)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rsp)
movups %xmm0, 0x14(%rsp)
movups %xmm0, 0x24(%rsp)
movups %xmm0, 0x30(%rsp)
xorl %r15d, %r15d
movl $0xf8, %edx
xorl %esi, %esi
callq 0x2190
leaq 0x3e1e(%rip), %rax      # 0xf060
movaps (%rsp,%r15), %xmm0
xorps (%r15,%rax), %xmm0
movups %xmm0, (%r14,%r15)
addq $0x10, %r15
cmpq $0x40, %r15
jne 0xb242
movq %rbx, 0xe8(%r14)
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/third-party/BLAKE2/blake2b-optimized.h
// 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 0xb349
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 0xb31c
movq $0x0, 0xe0(%rbx)
leaq 0x60(%rbx), %r13
leaq (%rbx,%rax), %rdi
addq $0x60, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2280
movq 0x40(%rbx), %rax
subq $-0x80, %rax
movq %rax, 0x40(%rbx)
sbbq $-0x1, 0x48(%rbx)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xb34c
addq %r12, %r14
cmpq $0x81, %r15
jb 0xb31f
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 0xb34c
addq %r12, %r14
addq $-0x80, %r15
cmpq %r12, %r15
ja 0xb2ee
jmp 0xb31f
movq %rdx, %r15
movq 0xe0(%rbx), %rax
leaq (%rbx,%rax), %rdi
addq $0x60, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2280
addq %r15, 0xe0(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/third-party/BLAKE2/blake2b-optimized.h
// Function: blake2b_final
int blake2b_final( blake2b_state *S, void *out, size_t outlen )
{
  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 );

  memcpy( out, &S->h[0], S->outlen );
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rsi, %rsi
je 0xd42e
movq %rdi, %rbx
cmpq %rdx, 0xe8(%rdi)
ja 0xd42e
cmpq $0x0, 0x50(%rbx)
jne 0xd42e
movq %rsi, %r14
movq 0xe0(%rbx), %rax
addq %rax, 0x40(%rbx)
adcq $0x0, 0x48(%rbx)
cmpb $0x0, 0xf0(%rbx)
je 0xd3ec
movq $-0x1, 0x58(%rbx)
movq $-0x1, 0x50(%rbx)
leaq 0x60(%rbx), %r15
leaq (%rbx,%rax), %rdi
addq $0x60, %rdi
movl $0x80, %edx
subq %rax, %rdx
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x2190
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb34c
movq 0xe8(%rbx), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2280
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/third-party/CRegion/alloc-growable.c
// Function: CR_RegionAllocGrowable
void *CR_RegionAllocGrowable(CR_Region *r, size_t size)
{
  if(size == 0)
  {
    CR_ExitFailure("unable to allocate 0 bytes");
  }

  CR_StaticAssert(sizeof(Header) % 8 == 0);
  const size_t chunk_size = CR_SafeAdd(sizeof(Header), size);

  void **attached_pointer = CR_RegionAlloc(r, sizeof *attached_pointer);

  Header *header = malloc(chunk_size);
  if(header == NULL)
  {
    CR_ExitFailure("failed to allocate %zu bytes", chunk_size);
  }

  *attached_pointer = header;
  header->attached_pointer = attached_pointer;
  header->capacity = size;

  CR_RegionAttach(r, freeAttachedPointer, attached_pointer);

  ASAN_POISON_MEMORY_REGION(header, sizeof(Header));
  return header + 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rsi, %rsi
je 0xd627
movq %rsi, %r14
movq %rdi, %rbx
movl $0x10, %edi
callq 0xdb2c
movq %rax, %r15
movl $0x8, %esi
movq %rbx, %rdi
callq 0xd960
movq %rax, %r12
movq %r15, %rdi
callq 0x22d0
testq %rax, %rax
je 0xd635
movq %rax, %r13
movq %rax, (%r12)
movq %r12, (%rax)
movq %r14, 0x8(%rax)
leaq 0x3b(%rip), %rsi        # 0xd646
movq %rbx, %rdi
movq %r12, %rdx
callq 0xda39
addq $0x10, %r13
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x9d6(%rip), %rdi       # 0xe004
xorl %eax, %eax
callq 0x3ca8
leaq 0x9f2(%rip), %rdi       # 0xe02e
movq %r15, %rsi
xorl %eax, %eax
callq 0x3ca8
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/third-party/CRegion/alloc-growable.c
// Function: CR_EnsureCapacity
void *CR_EnsureCapacity(void *ptr, size_t size)
{
  if(size == 0)
  {
    CR_ExitFailure("unable to allocate 0 bytes");
  }
  else if(ptr == NULL)
  {
    return CR_RegionAllocGrowable(CR_GetGlobalRegion(), size);
  }

  Header *header = (Header *)ptr - 1;
  ASAN_UNPOISON_MEMORY_REGION(header, sizeof(Header));
  if(size <= header->capacity)
  {
    ASAN_POISON_MEMORY_REGION(header, sizeof(Header));
    return ptr;
  }

  const size_t chunk_size = CR_SafeAdd(sizeof(Header), size);
  Header *reallocated_header = realloc(header, chunk_size);
  if(reallocated_header == NULL)
  {
    CR_ExitFailure("failed to reallocate %zu bytes", chunk_size);
  }

  *reallocated_header->attached_pointer = reallocated_header;
  reallocated_header->capacity = size;

  ASAN_POISON_MEMORY_REGION(reallocated_header, sizeof(Header));
  return reallocated_header + 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0xd6bc
movq %rsi, %rbx
movq %rdi, %r14
testq %rdi, %rdi
je 0xd6a7
cmpq %rbx, -0x8(%r14)
jae 0xd69e
addq $-0x10, %r14
movl $0x10, %edi
movq %rbx, %rsi
callq 0xdb2c
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x2340
testq %rax, %rax
je 0xd6ca
movq %rax, %r14
movq (%rax), %rax
movq %r14, (%rax)
movq %rbx, 0x8(%r14)
addq $0x10, %r14
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
callq 0xd6dc
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xd5b8
leaq 0x941(%rip), %rdi       # 0xe004
xorl %eax, %eax
callq 0x3ca8
leaq 0x19ef(%rip), %rdi      # 0xf0c0
movq %r15, %rsi
xorl %eax, %eax
callq 0x3ca8
nop
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/third-party/CRegion/global-region.c
// Function: CR_GetGlobalRegion
CR_Region *CR_GetGlobalRegion(void)
{
  static CR_Region *r = NULL;
  if(r == NULL)
  {
    r = CR_RegionNew();
  }

  return r;
}

// Assembly:
movq 0x5b9d(%rip), %rax      # 0x13280
testq %rax, %rax
je 0xd6e9
retq
pushq %rax
callq 0xd89c
movq %rax, 0x5b8a(%rip)      # 0x13280
addq $0x8, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/third-party/CRegion/mempool.c
// Function: CR_MempoolNew
CR_Mempool *CR_MempoolNew(CR_Region *r, size_t object_size,
                          CR_FailableDestructor *explicit_destructor,
                          CR_ReleaseCallback *implicit_destructor)
{
  if(object_size == 0)
  {
    CR_ExitFailure("unable to create memory pool for allocating zero size objects");
  }
  CR_StaticAssert(sizeof(Header) % 8 == 0);

  CR_Mempool *mp = CR_RegionAlloc(r, sizeof *mp);
  mp->r = r;
  mp->explicit_destructor = explicit_destructor;
  mp->implicit_destructor = implicit_destructor;
  mp->chunk_size = CR_SafeAdd(sizeof(Header), object_size);
  mp->allocated_chunks = NULL;
  mp->released_chunks = NULL;
  CR_RegionAttach(r, destroyObjects, mp);

  return mp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rsi, %rsi
je 0xd766
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movl $0x30, %esi
callq 0xd960
movq %rax, %r13
movq %rbx, (%rax)
movq %r12, 0x8(%rax)
movq %r15, 0x10(%rax)
movl $0x20, %edi
movq %r14, %rsi
callq 0xdb2c
movq %rax, 0x18(%r13)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r13)
leaq 0x26(%rip), %rsi        # 0xd774
movq %rbx, %rdi
movq %r13, %rdx
callq 0xda39
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1972(%rip), %rdi      # 0xf0df
xorl %eax, %eax
callq 0x3ca8
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/third-party/CRegion/mempool.c
// Function: CR_MempoolAlloc
void *CR_MempoolAlloc(CR_Mempool *mp)
{
  Header *header = getAvailableChunk(mp);

  header->destructor_state = DS_disabled;
  header->mp = mp;
  header->prev = NULL;

  /* Prepend header to the mempools allocated chunk list. */
  header->next = mp->allocated_chunks;
  mp->allocated_chunks = header;

  if(header->next != NULL)
  {
    ASAN_UNPOISON_MEMORY_REGION(header->next, sizeof(Header));
    header->next->prev = header;
    ASAN_POISON_MEMORY_REGION(header->next, sizeof(Header));
  }

  ASAN_POISON_MEMORY_REGION(header, sizeof(Header));
  return header + 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0xd7ca
movq 0x18(%rax), %rcx
movq %rcx, 0x28(%rbx)
testq %rcx, %rcx
je 0xd7d6
movq $0x0, 0x10(%rcx)
jmp 0xd7d6
movq (%rbx), %rdi
movq 0x18(%rbx), %rsi
callq 0xd960
movl $0x0, (%rax)
movq %rbx, 0x8(%rax)
movq $0x0, 0x10(%rax)
movq 0x20(%rbx), %rcx
movq %rcx, 0x18(%rax)
movq %rax, 0x20(%rbx)
testq %rcx, %rcx
je 0xd7fd
movq %rax, 0x10(%rcx)
addq $0x20, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/third-party/CRegion/region.c
// Function: checkedMalloc
static void *checkedMalloc(size_t size)
{
  void *data = malloc(size);
  if(data == NULL)
  {
    CR_ExitFailure("failed to allocate %zu bytes", size);
  }

  return data;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x22d0
testq %rax, %rax
je 0xd94f
popq %rbx
retq
leaq 0x6d8(%rip), %rdi       # 0xe02e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3ca8
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/third-party/CRegion/region.c
// Function: allocFromChunk
static void *allocFromChunk(CR_Region *r, Chunk *chunk, size_t size)
{
  if(size == 0)
  {
    CR_ExitFailure("unable to allocate 0 bytes");
  }

  if(size <= chunk->capacity - chunk->bytes_used)
  {
    return popBytesFromChunk(chunk, size);
  }
  else if(size < chunk->next_chunk_size - sizeof(ChunkList))
  {
    ChunkList *element = checkedMalloc(chunk->next_chunk_size);

    chunk->chunk = (unsigned char *)element;
    chunk->bytes_used = sizeof *element;
    chunk->capacity = chunk->next_chunk_size;

    element->next = r->chunk_list;
    r->chunk_list = element;

    chunk->next_chunk_size = CR_SafeMultiply(chunk->next_chunk_size, 2);

    return popBytesFromChunk(chunk, size);
  }
  else
  {
    ChunkList *element = checkedMalloc(CR_SafeAdd(sizeof(ChunkList), size));

    element->next = r->chunk_list;
    r->chunk_list = element;

    return element + 1;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdx, %rdx
je 0xda2b
movq %rdx, %rbx
movq %rsi, %r14
movq 0x8(%rsi), %rcx
movq 0x10(%rsi), %rax
subq %rcx, %rax
cmpq %rdx, %rax
jae 0xd9f2
movq %rdi, %r15
movq 0x18(%r14), %rdi
leaq -0x8(%rdi), %rax
cmpq %rbx, %rax
jbe 0xda01
callq 0xd93f
movq %rax, (%r14)
movq $0x8, 0x8(%r14)
movq 0x18(%r14), %rdi
movq %rdi, 0x10(%r14)
movq 0x40(%r15), %rcx
movq %rcx, (%rax)
movq %rax, 0x40(%r15)
movl $0x2, %esi
callq 0xdb44
movq %rax, 0x18(%r14)
movq 0x8(%r14), %rcx
movq (%r14), %rax
addq %rcx, %rax
addq %rcx, %rbx
movq %rbx, 0x8(%r14)
jmp 0xda25
movl $0x8, %edi
movq %rbx, %rsi
callq 0xdb2c
movq %rax, %rdi
callq 0xd93f
movq 0x40(%r15), %rcx
movq %rcx, (%rax)
movq %rax, 0x40(%r15)
addq $0x8, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x5d2(%rip), %rdi       # 0xe004
xorl %eax, %eax
callq 0x3ca8
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/third-party/CRegion/region.c
// Function: CR_RegionAttach
void CR_RegionAttach(CR_Region *r, CR_ReleaseCallback *callback, void *data)
{
  /* Store the callback inside the region as the current pending
     callback. This is required in case the following allocation
     fails and terminates the program. */
  r->pending_callback = callback;
  r->pending_callback_data = data;

  CallbackList *element = allocFromChunkWithPadding(r, sizeof *element);

  r->pending_callback = NULL;
  r->pending_callback_data = NULL;

  /* Prepend the callback to the regions callback-list. */
  element->callback = callback;
  element->data = data;

  element->next = r->callback_list;
  r->callback_list = element;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, 0x50(%rdi)
movq %rdx, 0x58(%rdi)
movl $0x18, %edi
xorl %esi, %esi
callq 0xdb2c
movq %r15, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0xd989
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%r15)
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
movq 0x48(%r15), %rcx
movq %rcx, 0x10(%rax)
movq %rax, 0x48(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/third-party/CRegion/region.c
// Function: CR_RegionRelease
void CR_RegionRelease(CR_Region *r)
{
  /* Call all attached callbacks. */
  if(r->pending_callback != NULL)
  {
    r->pending_callback(r->pending_callback_data);
  }
  for(CallbackList *element = r->callback_list;
      element != NULL; element = element->next)
  {
    element->callback(element->data);
  }

  /* Detach the region from the region-list. */
  if(r->prev != NULL)
  {
    r->prev->next = r->next;
  }
  if(r->next != NULL)
  {
    r->next->prev = r->prev;
  }
  if(r == region_list)
  {
    region_list = region_list->next;
  }

  /* Free all chunks associated with the region. */
  ChunkList *element = r->chunk_list;
  while(element != NULL)
  {
    ChunkList *next = element->next;
    free(element);
    element = next;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x50(%rdi), %rax
testq %rax, %rax
je 0xdaa0
movq 0x58(%rbx), %rdi
callq *%rax
movq 0x48(%rbx), %r14
testq %r14, %r14
je 0xdab6
movq 0x8(%r14), %rdi
callq *(%r14)
movq 0x10(%r14), %r14
jmp 0xdaa4
movq 0x60(%rbx), %rax
movq 0x68(%rbx), %rcx
testq %rax, %rax
je 0xdac7
movq %rcx, 0x68(%rax)
testq %rcx, %rcx
je 0xdad0
movq %rax, 0x60(%rcx)
movq 0x57b1(%rip), %rax      # 0x13288
cmpq %rbx, %rax
jne 0xdae7
movq 0x68(%rax), %rax
movq %rax, 0x57a1(%rip)      # 0x13288
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0xdb00
movq (%rdi), %rbx
callq 0x2040
movq %rbx, %rdi
testq %rbx, %rbx
jne 0xdaf0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/aparrish[P]rwet-examples-c/randlines.c
// Function: main
int main(int argc, char* argv[]) {

	srand(time(NULL));

	/* read in lines */
	line_t* head;
	line_t* last = NULL;
	line_t* current = NULL;
	while (!feof(stdin)) {
		/* malloc a new line_t */
		current = malloc(sizeof(line_t));
		current->next = NULL;
		current->line_no = line_count;

		/* ap_getline populates current->line with pointer to malloced char* */
		current->len = ap_getline(&(current->line), stdin);

		/* set this line_t as the 'next' of previous line_t */
		if (last == NULL) {
			head = current;
		}
		else {
			last->next = current;
		}
		last = current;
		line_count++;
	}

	/* print lines out randomly, removing from linked list as it goes */
	int offset;
	int i;
	line_t* current_line = NULL;
	line_t* prev_line = NULL;
	while (line_count > 0) {
		prev_line = NULL;
		current_line = head;
		offset = rand() % line_count; /* random offset from head of list */

		/* traverse the list until we get to offset, keeping track of previous
 		 * node (so we can remove the node at offset) */
		for (i = 0; i < offset; i++) {
			prev_line = current_line;
			current_line = current_line->next;
		}
		printf("%s", current_line->line);

		/* if offset was zero, the next line is the new head of the list */
		if (offset == 0) 
			head = current_line->next;

		/* the previous line's next now points to the current line's next */
		if (prev_line != NULL)
			prev_line->next = current_line->next;

		/* free the line and the struct */
		free(current_line->line);
		free(current_line);

		line_count--;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %edi, %edi
callq 0x1070
movl %eax, %edi
callq 0x1050
movq 0x2e04(%rip), %r15      # 0x3fe0
movq (%r15), %rdi
callq 0x1060
testl %eax, %eax
jne 0x1241
xorl %r12d, %r12d
movl $0x18, %edi
callq 0x1080
movq %rax, %r14
movq $0x0, 0x10(%rax)
movl 0x2e6e(%rip), %eax      # 0x4074
movl %eax, 0x8(%r14)
movq (%r15), %rsi
movq %r14, %rdi
callq 0x12ec
movl %eax, 0xc(%r14)
movq %r14, %rbx
testq %r12, %r12
je 0x1229
movq %r14, 0x10(%r12)
movq %r13, %rbx
incl 0x2e45(%rip)            # 0x4074
movq (%r15), %rdi
callq 0x1060
movq %rbx, %r13
movq %r14, %r12
testl %eax, %eax
je 0x11eb
cmpl $0x0, 0x2e2c(%rip)      # 0x4074
jle 0x12da
leaq 0xdaf(%rip), %r14       # 0x2004
callq 0x10b0
cltd
idivl 0x2e13(%rip)            # 0x4074
movl %edx, %ebp
testl %edx, %edx
jle 0x1295
movq %rbx, %r12
movq %r12, %r15
movq 0x10(%r12), %r12
decl %ebp
jne 0x126a
movq (%r12), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1040
movq 0x10(%r12), %rax
movq %rax, 0x10(%r15)
movq %rbx, %r15
movq %r12, %rbx
jmp 0x12af
movq (%rbx), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1040
testl %ebp, %ebp
je 0x12ab
movq %rbx, %r15
jmp 0x12af
movq 0x10(%rbx), %r15
movq (%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movl 0x2daf(%rip), %eax      # 0x4074
leal -0x1(%rax), %ecx
movl %ecx, 0x2da6(%rip)      # 0x4074
movq %r15, %rbx
cmpl $0x1, %eax
jg 0x1255
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/richarddurbin[P]hash10x/moshasm.c
// Function: readsetCreate
Readset *readsetCreate (Moshset *ms, int n) /* create empty - n is used to initialise arrays */
{
  Readset *rs = new0 (1, Readset) ;
  rs->ms = ms ;
  rs->reads = arrayCreate (n, Read) ;
  arrayp(rs->reads,0,Read)->nHit = 0 ; /* burn first read, so can use 0 as null */
  /* create inv, invSpace in invBuild() */
  return rs ;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl $0x1, %edi
movl $0x28, %esi
callq 0x6f74
movq %rax, %r15
movq %r14, (%rax)
movl %ebx, %edi
movl $0x48, %esi
callq 0x6714
movq %rax, 0x8(%r15)
movq %rax, %rdi
xorl %esi, %esi
callq 0x69bd
movl $0x0, 0x4(%rax)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/richarddurbin[P]hash10x/moshasm.c
// Function: readsetDestroy
void readsetDestroy (Readset *rs)
{
  int i, n = arrayMax(rs->reads) ; Read *r = arrp(rs->reads,0,Read) ;
  for (i = 0 ; i < n ; ++i, ++r) if (r->nHit) { free(r->hit) ; free(r->dx) ; }
  arrayDestroy (rs->reads) ;
  if (rs->inv) { free (rs->inv) ; free (rs->invSpace) ; }
  free (rs) ;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movl 0x18(%rdi), %ebp
testl %ebp, %ebp
jle 0x1fb3
movq 0x8(%rdi), %r14
addq $0x10, %r14
cmpl $0x0, -0xc(%r14)
je 0x1fa7
movq -0x8(%r14), %rdi
callq 0x1040
movq (%r14), %rdi
callq 0x1040
addq $0x48, %r14
decl %ebp
jne 0x1f8f
movq 0x8(%rbx), %rdi
callq 0x6862
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x1fcf
callq 0x1040
movq 0x20(%rbx), %rdi
callq 0x1040
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O3/richarddurbin[P]hash10x/moshasm.c
// Function: readsetWrite
void readsetWrite (Readset *rs, char *root)
{
  FILE *f ;
  if (!(f = fopenTag (root, "mosh", "w"))) die ("can't open file %s.mosh", root) ;
  moshsetWrite (rs->ms, f) ; fclose (f) ;
  if (!(f = fopenTag (root, "readset", "w"))) die ("can't open file %s.readset", root) ;
  if (fwrite("RSMSHv2",8,1,f) != 1) die ("failed to write readset header") ;
  if (fwrite (&rs->totHit,sizeof(U64),1,f) != 1) die ("failed to write totHit") ;
  arrayWrite (rs->reads, f) ;
  int i, n ; Read *r = arrp(rs->reads,0,Read) ;
  for (i = 0 ; i < arrayMax(rs->reads) ; ++i, ++r)
    if ((n = r->nHit))
      { if (fwrite(r->hit,sizeof(U32),n,f) != n) die ("failed write hits %d", n) ;
	if (fwrite(r->dx,sizeof(U16),n,f) != n) die ("failed write dx %d", n) ;
      }
  fclose (f) ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x605a(%rip), %rsi      # 0x804d
leaq 0x603e(%rip), %rdx      # 0x8038
movq %r15, %rdi
callq 0x70d7
movq %rax, %r14
testq %rax, %rax
jne 0x201b
leaq 0x6029(%rip), %rdi      # 0x803a
movq %r15, %rsi
xorl %eax, %eax
callq 0x6e84
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x55f4
movq %r14, %rdi
callq 0x10a0
leaq 0x6030(%rip), %rsi      # 0x8065
leaq 0x5ffc(%rip), %rdx      # 0x8038
movq %r15, %rdi
callq 0x70d7
movq %rax, %r14
testq %rax, %rax
jne 0x205d
leaq 0x5fff(%rip), %rdi      # 0x8052
movq %r15, %rsi
xorl %eax, %eax
callq 0x6e84
leaq 0x609e(%rip), %rdi      # 0x8102
movl $0x8, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x1230
cmpq $0x1, %rax
je 0x208a
leaq 0x5fea(%rip), %rdi      # 0x806d
xorl %eax, %eax
callq 0x6e84
leaq 0x10(%rbx), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x1230
cmpq $0x1, %rax
je 0x20b4
leaq 0x5fdf(%rip), %rdi      # 0x808c
xorl %eax, %eax
callq 0x6e84
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x6aa3
movq 0x8(%rbx), %rax
cmpl $0x0, 0x18(%rax)
jle 0x2146
movq 0x8(%rax), %rbp
addq $0x10, %rbp
leaq 0x5fca(%rip), %r12      # 0x80a3
xorl %r15d, %r15d
movslq -0xc(%rbp), %r13
testq %r13, %r13
je 0x2135
movq -0x8(%rbp), %rdi
movl $0x4, %esi
movq %r13, %rdx
movq %r14, %rcx
callq 0x1230
cmpq %r13, %rax
je 0x210b
movq %r12, %rdi
movl %r13d, %esi
xorl %eax, %eax
callq 0x6e84
movq (%rbp), %rdi
movl $0x2, %esi
movq %r13, %rdx
movq %r14, %rcx
callq 0x1230
cmpq %r13, %rax
je 0x2135
leaq 0x5f8d(%rip), %rdi      # 0x80b8
movl %r13d, %esi
xorl %eax, %eax
callq 0x6e84
incl %r15d
movq 0x8(%rbx), %rax
addq $0x48, %rbp
cmpl 0x18(%rax), %r15d
jl 0x20dc
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10a0
// File: /workspace/github_c_makefile_star2_O3/richarddurbin[P]hash10x/moshasm.c
// Function: badOverlaps
int badOverlaps (Readset *rs, Read *x)
{
  int i, nBad = 0 ;
  Array olap = findOverlaps (rs, x, 0) ;
  for (i = 0 ; i < arrayMax(olap) ; ++i) if (arrp(olap,i,Overlap)->isBad) ++nBad ;
  arrayDestroy (olap) ;
  return nBad ;
}

// Assembly:
pushq %rbx
xorl %ebx, %ebx
xorl %edx, %edx
callq 0x2e4d
movslq 0x18(%rax), %rcx
testq %rcx, %rcx
jle 0x36be
movq 0x8(%rax), %rdx
movslq 0x14(%rax), %rsi
addq $0xd, %rdx
xorl %ebx, %ebx
cmpb $0x1, (%rdx)
sbbl $-0x1, %ebx
addq %rsi, %rdx
decq %rcx
jne 0x36b0
movq %rax, %rdi
callq 0x6862
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/richarddurbin[P]hash10x/moshasm.c
// Function: markBadReads
void markBadReads (Readset *rs)
{
  int ix ;
  Read *x, *x0 = arrp(rs->reads,0,Read) ;

  for (ix = 0, x = x0 ; ix < arrayMax(rs->reads) ; ++ix, ++x)
    x->bad = 0 ; /* initialise by clearing all bad flags */
  
  /* first pass through findOverlaps - set badOrder10 */
  int nBad = 0 ;
  for (ix = 0, x = x0 ; ix < arrayMax(rs->reads) ; ++ix, ++x)
    if (badOverlaps (rs, x) >= 10) { x->badOrder10 = 1 ; ++nBad ; }
  printf ("MB  %d with >=10 bad overlaps\n", nBad) ;

  /* second pass, set badOrder1 for all 2 or more - will remove some more singleton errors */
  nBad = 0 ;
  for (ix = 0, x = x0 ; ix < arrayMax(rs->reads) ; ++ix, ++x)
    if (badOverlaps (rs, x) > 1 && !x->badOrder10) { x->badOrder1 = 1 ; ++nBad ; }
  printf ("MB  %d with multiple bad overlaps\n", nBad) ;

  /* third pass, set badOrder1 for anything bad  - must be simple pairs - might be too harsh */
  nBad = 0 ;
  for (ix = 0, x = x0 ; ix < arrayMax(rs->reads) ; ++ix, ++x)
    if (badOverlaps (rs, x) > 0 && !x->badOrder10) { x->badOrder1 = 1 ; ++nBad ; }
  printf ("MB  %d with single bad overlaps\n", nBad) ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x8(%rax), %r14
xorl %ebp, %ebp
cmpl $0x0, 0x18(%rax)
movl $0x0, %r15d
jle 0x373f
leaq 0x18(%r14), %rax
xorl %ecx, %ecx
movb $0x0, (%rax)
incl %ecx
movq 0x8(%rbx), %rdx
movl 0x18(%rdx), %edx
addq $0x48, %rax
cmpl %edx, %ecx
jl 0x36f4
xorl %r15d, %r15d
testl %edx, %edx
jle 0x373f
xorl %r13d, %r13d
movq %r14, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x368f
cmpl $0xa, %eax
jl 0x372e
orb $0x2, 0x18(%r12)
incl %r15d
incl %r13d
addq $0x48, %r12
movq 0x8(%rbx), %rax
cmpl 0x18(%rax), %r13d
jl 0x3715
leaq 0x4d03(%rip), %rdi      # 0x8449
movl %r15d, %esi
xorl %eax, %eax
callq 0x10c0
movq 0x8(%rbx), %rax
cmpl $0x0, 0x18(%rax)
jle 0x3793
xorl %ebp, %ebp
xorl %r12d, %r12d
movq %r14, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x368f
cmpl $0x2, %eax
jl 0x3782
movb 0x18(%r15), %al
testb $0x2, %al
jne 0x3782
orb $0x4, %al
movb %al, 0x18(%r15)
incl %ebp
incl %r12d
addq $0x48, %r15
movq 0x8(%rbx), %rax
cmpl 0x18(%rax), %r12d
jl 0x3762
leaq 0x4cce(%rip), %rdi      # 0x8468
xorl %r15d, %r15d
movl %ebp, %esi
xorl %eax, %eax
callq 0x10c0
movq 0x8(%rbx), %rax
cmpl $0x0, 0x18(%rax)
jle 0x37e4
xorl %r15d, %r15d
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x368f
testl %eax, %eax
jle 0x37d5
movb 0x18(%r14), %al
testb $0x2, %al
jne 0x37d5
orb $0x4, %al
movb %al, 0x18(%r14)
incl %r15d
incl %ebp
addq $0x48, %r14
movq 0x8(%rbx), %rax
cmpl 0x18(%rax), %ebp
jl 0x37b5
leaq 0x4ca0(%rip), %rdi      # 0x848b
movl %r15d, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10c0
// File: /workspace/github_c_makefile_star2_O3/richarddurbin[P]hash10x/moshasm.c
// Function: markContained
void markContained (Readset *rs) 
{
  int ix, io ;
  Read *x, *x0 = arrp(rs->reads,0,Read) ;
  int nContained = 0, nNotContained = 0 ;
  U64 totLen = 0 ;
  Array overlaps = 0 ;
  
  for (ix = 0, x = x0 ; ix < arrayMax(rs->reads) ; ++ix, ++x)
    { if (overlaps) { arrayDestroy (overlaps) ; overlaps = 0 ; }
      if (x->bad) continue ;
      overlaps = findOverlaps (rs, x, 0) ;
      int maxHit = 0 ;
      for (io = 0 ; io < arrayMax (overlaps) ; ++io)
	{ Overlap *o = arrp(overlaps,io,Overlap) ;
	  if (o->iy == ix) continue ; /* don't allow self-containment! */
	  Read *y = arrp(rs->reads,o->iy,Read) ;
	  if (y->len < x->len || o->nHit <= maxHit) continue ;
	  if (o->isPlus && (o->offset > 0 || o->offset + y->len < x->len)) continue ;
	  if (!o->isPlus && (o->offset < x->len || o->offset - y->len > 0)) continue ;
	  x->contained = o->iy ; maxHit = o->nHit ;
	}
      if (x->contained) ++nContained ; else { ++nNotContained ; totLen += x->len ; }
    }
  printf ("MC  found %d contained reads, leaving %d not contained, av length %.1f\n",
	  nContained, nNotContained, nNotContained ? totLen/(double)nNotContained : 0.) ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
xorpd %xmm0, %xmm0
cmpl $0x0, 0x18(%rax)
jle 0x3938
movq %rdi, %r14
movq 0x8(%rax), %r15
xorl %r12d, %r12d
xorl %edi, %edi
movq $0x0, (%rsp)
xorl %ebx, %ebx
xorl %ebp, %ebp
testq %rdi, %rdi
je 0x3846
callq 0x6862
xorpd %xmm0, %xmm0
cmpb $0x0, 0x18(%r15)
je 0x3854
xorl %edi, %edi
jmp 0x38f2
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2e4d
movq %rax, %rdi
movslq 0x18(%rax), %rax
testq %rax, %rax
jle 0x38da
movq 0x8(%rdi), %rcx
movslq 0x14(%rdi), %rdx
addq $0xc, %rcx
xorl %esi, %esi
movl -0xc(%rcx), %r8d
cmpl %r12d, %r8d
je 0x38d2
movq 0x8(%r14), %r9
movq 0x8(%r9), %r10
movl 0x14(%r9), %r9d
imull %r8d, %r9d
movl (%r10,%r9), %r10d
movl (%r15), %r11d
cmpl %r11d, %r10d
jl 0x38d2
movl -0x8(%rcx), %r9d
cmpl %esi, %r9d
jle 0x38d2
cmpb $0x0, (%rcx)
movl -0x4(%rcx), %r13d
je 0x38c1
testl %r13d, %r13d
jg 0x38d2
addl %r10d, %r13d
cmpl %r11d, %r13d
jge 0x38cb
jmp 0x38d2
cmpl %r11d, %r13d
jl 0x38d2
cmpl %r10d, %r13d
jg 0x38d2
movl %r8d, 0x20(%r15)
movl %r9d, %esi
addq %rdx, %rcx
decq %rax
jne 0x387b
cmpl $0x0, 0x20(%r15)
xorpd %xmm0, %xmm0
je 0x38e9
incl %ebp
jmp 0x38f2
incl %ebx
movslq (%r15), %rax
addq %rax, (%rsp)
incl %r12d
addq $0x48, %r15
movq 0x8(%r14), %rax
cmpl 0x18(%rax), %r12d
jl 0x3838
testl %ebx, %ebx
je 0x393e
movsd (%rsp), %xmm1
unpcklps 0x46f9(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x4701(%rip), %xmm1     # 0x8020
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %ebx, %xmm1
divsd %xmm1, %xmm0
jmp 0x3940
xorl %ebx, %ebx
xorl %ebp, %ebp
jmp 0x3940
xorl %ebx, %ebx
leaq 0x4b65(%rip), %rdi      # 0x84ac
movl %ebp, %esi
movl %ebx, %edx
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10c0