LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: zlib_decompress
static unsigned zlib_decompress(unsigned char** out, size_t* outsize, size_t expected_size,
                                const unsigned char* in, size_t insize, const LodePNGDecompressSettings* settings) {
  if(settings->custom_zlib) {
    return settings->custom_zlib(out, outsize, in, insize, settings);
  } else {
    unsigned error;
    ucvector v = ucvector_init(*out, *outsize);
    if(expected_size) {
      /*reserve the memory to avoid intermediate reallocations*/
      ucvector_resize(&v, *outsize + expected_size);
      v.size = *outsize;
    }
    error = lodepng_zlib_decompressv(&v, in, insize, settings);
    *out = v.data;
    *outsize = v.size;
    return error;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r14
movq %rcx, %r13
movq %rsi, %rbx
movq %rdi, %r12
movq 0x8(%r9), %rax
testq %rax, %rax
je 0xd5b6
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r8, %rcx
movq %r14, %r8
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movq %rdx, %rbp
movq (%r12), %rdi
movq (%rbx), %r15
movq %rdi, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %r15, 0x18(%rsp)
testq %rdx, %rdx
je 0xd610
addq %r15, %rbp
cmpq %rbp, %r15
jae 0xd603
shrq %r15
addq %rbp, %r15
movq %r15, %rsi
movq %r8, 0x20(%rsp)
callq 0x1170
movq 0x20(%rsp), %r8
testq %rax, %rax
je 0xd608
movq %r15, 0x18(%rsp)
movq %rax, 0x8(%rsp)
movq %rbp, 0x10(%rsp)
movq (%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
movq %r8, %rdx
movq %r14, %rcx
callq 0x4f9a
movq (%r15), %rcx
movq %rcx, (%r12)
movq 0x8(%r15), %rcx
movq %rcx, (%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: Adam7_getpassvalues
static void Adam7_getpassvalues(unsigned passw[7], unsigned passh[7], size_t filter_passstart[8],
                                size_t padded_passstart[8], size_t passstart[8], unsigned w, unsigned h, unsigned bpp) {
  /*the passstart values have 8 values: the 8th one indicates the byte after the end of the 7th (= last) pass*/
  unsigned i;

  /*calculate width and height in pixels of each pass*/
  for(i = 0; i != 7; ++i) {
    passw[i] = (w + ADAM7_DX[i] - ADAM7_IX[i] - 1) / ADAM7_DX[i];
    passh[i] = (h + ADAM7_DY[i] - ADAM7_IY[i] - 1) / ADAM7_DY[i];
    if(passw[i] == 0) passh[i] = 0;
    if(passh[i] == 0) passw[i] = 0;
  }

  filter_passstart[0] = padded_passstart[0] = passstart[0] = 0;
  for(i = 0; i != 7; ++i) {
    /*if passw[i] is 0, it's 0 bytes, not 1 (no filtertype-byte)*/
    filter_passstart[i + 1] = filter_passstart[i]
                            + ((passw[i] && passh[i]) ? passh[i] * (1u + (passw[i] * bpp + 7u) / 8u) : 0);
    /*bits padded if needed to fill full byte at end of each scanline*/
    padded_passstart[i + 1] = padded_passstart[i] + passh[i] * ((passw[i] * bpp + 7u) / 8u);
    /*only padded at end of reduced image*/
    passstart[i + 1] = passstart[i] + (passh[i] * passw[i] * bpp + 7u) / 8u;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r10
movl 0x38(%rsp), %ebx
xorl %r14d, %r14d
leaq 0x4927(%rip), %r15      # 0x12930
leaq 0x4940(%rip), %r12      # 0x12950
leaq 0x4959(%rip), %r13      # 0x12970
leaq 0x4972(%rip), %rbp      # 0x12990
movl (%r14,%r15), %r11d
movl (%r14,%r12), %eax
notl %eax
addl %r11d, %eax
addl %r9d, %eax
xorl %edx, %edx
divl %r11d
movl %eax, (%rdi,%r14)
movl (%r14,%r13), %r11d
movl (%r14,%rbp), %eax
notl %eax
addl %r11d, %eax
addl %ebx, %eax
xorl %edx, %edx
divl %r11d
movl %eax, (%rsi,%r14)
movl (%rdi,%r14), %edx
testl %edx, %edx
cmovel %edx, %eax
movl %eax, (%rsi,%r14)
testl %eax, %eax
jne 0xe068
movl $0x0, (%rdi,%r14)
addq $0x4, %r14
cmpq $0x1c, %r14
jne 0xe01e
xorl %eax, %eax
movq %rax, (%r8)
movq %rax, (%rcx)
movq %rax, (%r10)
movl 0x40(%rsp), %ebx
movl (%rdi,%rax), %edx
testl %edx, %edx
je 0xe0a9
movl (%rsi,%rax), %r9d
testl %r9d, %r9d
je 0xe0a9
movl %edx, %r11d
imull %ebx, %r11d
addl $0x7, %r11d
shrl $0x3, %r11d
incl %r11d
imull %r11d, %r9d
jmp 0xe0ac
xorl %r9d, %r9d
addq (%r10,%rax,2), %r9
movq %r9, 0x8(%r10,%rax,2)
movl (%rsi,%rax), %r9d
imull %ebx, %edx
leal 0x7(%rdx), %r11d
shrl $0x3, %r11d
imull %r9d, %r11d
addq (%rcx,%rax,2), %r11
movq %r11, 0x8(%rcx,%rax,2)
imull %r9d, %edx
addl $0x7, %edx
shrl $0x3, %edx
addq (%r8,%rax,2), %rdx
movq %rdx, 0x8(%r8,%rax,2)
addq $0x4, %rax
cmpq $0x1c, %rax
jne 0xe081
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/cwalk/cwalk.c
// Function: cwk_path_get_absolute
size_t cwk_path_get_absolute(const char *base, const char *path, char *buffer,
  size_t buffer_size)
{
  size_t i;
  const char *paths[4];

  // The basename should be an absolute path if the caller is using the API
  // correctly. However, he might not and in that case we will append a fake
  // root at the beginning.
  if (cwk_path_is_absolute(base)) {
    i = 0;
  } else {
    paths[0] = "/";
    i = 1;
  }

  if (cwk_path_is_absolute(path)) {
    // If the submitted path is not relative the base path becomes irrelevant.
    // We will only normalize the submitted path instead.
    paths[i++] = path;
    paths[i] = NULL;
  } else {
    // Otherwise we append the relative path to the base path and normalize it.
    // The result will be a new absolute path.
    paths[i++] = base;
    paths[i++] = path;
    paths[i] = NULL;
  }

  // Finally join everything together and normalize it.
  return cwk_path_join_and_normalize_multiple(paths, buffer, buffer_size);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0xeb9b
testb %al, %al
je 0xeb3e
movq %rsp, %r13
xorl %ebp, %ebp
jmp 0xeb53
leaq 0x8(%rsp), %r13
leaq 0x53ab(%rip), %rax      # 0x13ef5
movq %rax, -0x8(%r13)
movl $0x1, %ebp
movq %r15, %rdi
callq 0xeb9b
leaq 0x1(%rbp), %rcx
testb %al, %al
jne 0xeb72
movq %r12, (%r13)
orq $0x2, %rbp
leaq (%rsp,%rcx,8), %r13
movq %rbp, %rcx
movq %r15, (%r13)
movq $0x0, (%rsp,%rcx,8)
movq %rsp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xec01
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/cwalk/cwalk.c
// Function: cwk_path_is_absolute
bool cwk_path_is_absolute(const char *path)
{
  size_t length;

  // We grab the root of the path. This root does not include the first
  // separator of a path.
  cwk_path_get_root(path, &length);

  // Now we can determine whether the root is absolute or not.
  return cwk_path_is_root_absolute(path, length);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rsi
callq 0xf131
movq (%r14), %rdx
testq %rdx, %rdx
je 0xebf7
movl 0xa565(%rip), %eax      # 0x19120
leaq 0xa07e(%rip), %rcx      # 0x18c40
movq (%rcx,%rax,8), %rcx
movb (%rcx), %sil
testb %sil, %sil
setne %al
je 0xebf9
movb -0x1(%rbx,%rdx), %dl
movb $0x1, %al
cmpb %dl, %sil
je 0xebf9
incq %rcx
movb (%rcx), %sil
testb %sil, %sil
setne %al
cmpb %dl, %sil
je 0xebf9
incq %rcx
testb %sil, %sil
jne 0xebdf
jmp 0xebf9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/cwalk/cwalk.c
// Function: cwk_path_get_root
void cwk_path_get_root(const char *path, size_t *length)
{
  // We use a different implementation here based on the configuration of the
  // library.
  if (path_style == CWK_STYLE_WINDOWS) {
    cwk_path_get_root_windows(path, length);
  } else {
    cwk_path_get_root_unix(path, length);
  }
}

// Assembly:
movl 0x9fe9(%rip), %eax      # 0x19120
testq %rax, %rax
je 0xf361
leaq 0x9af9(%rip), %rcx      # 0x18c40
movq (%rcx,%rax,8), %rax
movb (%rax), %r8b
testb %r8b, %r8b
setne %dl
je 0xf178
movb (%rdi), %cl
movb $0x1, %dl
cmpb %cl, %r8b
je 0xf178
incq %rax
movb (%rax), %dil
testb %dil, %dil
setne %dl
cmpb %cl, %dil
je 0xf178
incq %rax
testb %dil, %dil
jne 0xf162
movzbl %dl, %eax
movq %rax, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/cwalk/cwalk.c
// Function: cwk_path_is_string_equal
static bool cwk_path_is_string_equal(const char *first, const char *second,
  size_t n)
{
  // If the path style is UNIX, we will compare case sensitively. This can be
  // done easily using strncmp.
  if (path_style == CWK_STYLE_UNIX) {
    return strncmp(first, second, n) == 0;
  }

  // However, if this is windows we will have to compare case insensitively.
  // Since there is no standard method to do that we will have to do it on our
  // own.
  while (*first && *second && n > 0) {
    // We can consider the string to be not equal if the two lowercase
    // characters are not equal.
    if (tolower(*first++) != tolower(*second++)) {
      return false;
    }

    --n;
  }

  // We can consider the string to be equal if we either reached n == 0 or both
  // cursors point to a null character.
  return n == 0 || (*first == '\0' && *second == '\0');
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
cmpl $0x1, 0x9f89(%rip)      # 0x19120
jne 0xf1ab
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1050
testl %eax, %eax
jmp 0xf21a
movb (%r15), %bpl
testb %bpl, %bpl
setne %cl
je 0xf20d
movb (%rbx), %r12b
testb %r12b, %r12b
sete %al
testq %r14, %r14
sete %dl
orb %al, %dl
jne 0xf20d
callq 0x1200
movq (%rax), %rax
movl $0x1, %esi
movq %rsi, %rdx
movsbq %bpl, %rcx
movl (%rax,%rcx,4), %ecx
movsbq %r12b, %rsi
cmpl (%rax,%rsi,4), %ecx
jne 0xf226
movb (%r15,%rdx), %bpl
testb %bpl, %bpl
setne %cl
je 0xf207
movb (%rbx,%rdx), %r12b
testb %r12b, %r12b
je 0xf207
leaq 0x1(%rdx), %rsi
cmpq %rdx, %r14
jne 0xf1d6
subq %rdx, %r14
addq %rdx, %rbx
testq %r14, %r14
sete %al
orb %al, %cl
jne 0xf21d
cmpb $0x0, (%rbx)
sete %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0xf21d
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/cwalk/cwalk.c
// Function: cwk_path_get_first_segment_joined
static bool cwk_path_get_first_segment_joined(const char **paths,
  struct cwk_segment_joined *sj)
{
  bool result;

  // Prepare the first segment. We position the joined segment on the first path
  // and assign the path array to the struct.
  sj->path_index = 0;
  sj->paths = paths;

  // We loop through all paths until we find one which has a segment. The result
  // is stored in a variable, so we can let the caller know whether we found one
  // or not.
  result = false;
  while (paths[sj->path_index] != NULL &&
         (result = cwk_path_get_first_segment(paths[sj->path_index],
            &sj->segment)) == false) {
    ++sj->path_index;
  }

  return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq $0x0, 0x30(%rsi)
movq %rdi, 0x28(%rsi)
movq (%rdi), %r12
testq %r12, %r12
je 0xf288
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0xf131
movq (%rsp), %rsi
addq %r12, %rsi
movq %r12, %rdi
movq %rbx, %rdx
callq 0xfddb
testb %al, %al
jne 0xf28a
movq 0x30(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x30(%rbx)
movq 0x8(%r14,%rcx,8), %r12
testq %r12, %r12
jne 0xf24f
jmp 0xf28a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/cwalk/cwalk.c
// Function: cwk_path_change_root
size_t cwk_path_change_root(const char *path, const char *new_root,
  char *buffer, size_t buffer_size)
{
  const char *tail;
  size_t root_length, path_length, tail_length, new_root_length, new_path_size;

  // First we need to determine the actual size of the root which we will
  // change.
  cwk_path_get_root(path, &root_length);

  // Now we determine the sizes of the new root and the path. We need that to
  // determine the size of the part after the root (the tail).
  new_root_length = strlen(new_root);
  path_length = strlen(path);

  // Okay, now we calculate the position of the tail and the length of it.
  tail = path + root_length;
  tail_length = path_length - root_length;

  // We first output the tail and then the new root, that's because the source
  // path and the buffer may be overlapping. This way the root will not
  // overwrite the tail.
  cwk_path_output_sized(buffer, buffer_size, new_root_length, tail,
    tail_length);
  cwk_path_output_sized(buffer, buffer_size, 0, new_root, new_root_length);

  // Finally we calculate the size o the new path and terminate the output with
  // a '\0'.
  new_path_size = tail_length + new_root_length;
  cwk_path_terminate_output(buffer, buffer_size, new_path_size);

  return new_path_size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbp
movq %rsp, %r12
movq %r12, %rsi
callq 0xf131
movq %r15, %rdi
callq 0x10a0
movq %rax, %r13
movq %rbp, %rdi
callq 0x10a0
movq (%r12), %rcx
subq %rcx, %rax
leaq (%rax,%r13), %r12
xorl %edx, %edx
movq %rbx, %rsi
subq %r13, %rsi
cmovaeq %rsi, %rdx
cmpq %rbx, %r12
cmovbq %rax, %rdx
testq %rdx, %rdx
je 0xf58d
addq %rcx, %rbp
leaq (%r14,%r13), %rdi
movq %rbp, %rsi
callq 0x1180
cmpq %rbx, %r13
cmovaeq %rbx, %r13
testq %r13, %r13
je 0xf5a7
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x1180
testq %rbx, %rbx
je 0xf5bf
leaq (%r14,%r12), %rax
cmpq %rbx, %r12
leaq -0x1(%r14,%rbx), %rcx
cmovbq %rax, %rcx
movb $0x0, (%rcx)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/cwalk/cwalk.c
// Function: cwk_path_get_basename
void cwk_path_get_basename(const char *path, const char **basename,
  size_t *length)
{
  struct cwk_segment segment;

  // We get the last segment of the path. The last segment will contain the
  // basename if there is any. If there are no segments we will set the basename
  // to NULL and the length to 0.
  if (!cwk_path_get_last_segment(path, &segment)) {
    *basename = NULL;
    *length = 0;
    return;
  }

  // Now we can just output the segment contents, since that's our basename.
  // There might be trailing separators after the basename, but the size does
  // not include those.
  *basename = segment.begin;
  *length = segment.size;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rsp, %rsi
callq 0xf617
testb %al, %al
je 0xf603
movq 0x10(%rsp), %rax
movq %rax, (%r14)
movq 0x20(%rsp), %rax
jmp 0xf60c
movq $0x0, (%r14)
xorl %eax, %eax
movq %rax, (%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/cwalk/cwalk.c
// Function: cwk_path_get_last_segment
bool cwk_path_get_last_segment(const char *path, struct cwk_segment *segment)
{
  // We first grab the first segment. This might be our last segment as well,
  // but we don't know yet. There is no last segment if there is no first
  // segment, so we return false in that case.
  if (!cwk_path_get_first_segment(path, segment)) {
    return false;
  }

  // Now we find our last segment. The segment struct of the caller
  // will contain the last segment, since the function we call here will not
  // change the segment struct when it reaches the end.
  while (cwk_path_get_next_segment(segment)) {
    // We just loop until there is no other segment left.
  }

  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %r15
movq %r15, %rsi
callq 0xf131
movq (%r15), %rsi
addq %r14, %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0xfddb
movl %eax, %ebp
testb %al, %al
je 0xf650
movq %rbx, %rdi
callq 0xfe6f
jmp 0xf642
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/cwalk/cwalk.c
// Function: cwk_path_is_separator
bool cwk_path_is_separator(const char *str)
{
  const char *c;

  // We loop over all characters in the read symbols.
  c = separators[path_style];
  while (*c) {
    if (*c == *str) {
      return true;
    }

    ++c;
  }

  return false;
}

// Assembly:
movl 0x9952(%rip), %eax      # 0x19120
leaq 0x946b(%rip), %rcx      # 0x18c40
movq (%rcx,%rax,8), %rcx
movb (%rcx), %sil
testb %sil, %sil
setne %al
je 0xf804
movb (%rdi), %dl
cmpb %dl, %sil
je 0xf804
incq %rcx
movb (%rcx), %sil
testb %sil, %sil
setne %al
cmpb %dl, %sil
je 0xf804
incq %rcx
testb %sil, %sil
jne 0xf7ee
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/cwalk/cwalk.c
// Function: cwk_path_get_extension
bool cwk_path_get_extension(const char *path, const char **extension,
  size_t *length)
{
  struct cwk_segment segment;
  const char *c;

  // We get the last segment of the path. The last segment will contain the
  // extension if there is any.
  if (!cwk_path_get_last_segment(path, &segment)) {
    return false;
  }

  // Now we search for a dot within the segment. If there is a dot, we consider
  // the rest of the segment the extension. We do this from the end towards the
  // beginning, since we want to find the last dot.
  for (c = segment.end; c >= segment.begin; --c) {
    if (*c == '.') {
      // Okay, we found an extension. We can stop looking now.
      *extension = c;
      *length = (size_t)(segment.end - c);
      return true;
    }
  }

  // We couldn't find any extension.
  return false;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rsp, %rsi
callq 0xf617
testb %al, %al
je 0xfa08
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rax
cmpq %rdx, %rax
jb 0xfa08
xorl %ecx, %ecx
cmpb $0x2e, (%rax,%rcx)
je 0xfa12
leaq (%rax,%rcx), %rsi
decq %rsi
decq %rcx
cmpq %rdx, %rsi
jae 0xf9f3
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
addq %rcx, %rax
movq %rax, (%r14)
negq %rcx
movq %rcx, (%rbx)
movb $0x1, %al
jmp 0xfa0a
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/cwalk/cwalk.c
// Function: cwk_path_get_first_segment_without_root
static bool cwk_path_get_first_segment_without_root(const char *path,
  const char *segments, struct cwk_segment *segment)
{
  // Let's remember the path. We will move the path pointer afterwards, that's
  // why this has to be done first.
  segment->path = path;
  segment->segments = segments;

  // Now let's check whether this is an empty string. An empty string has no
  // segment it could use.
  if (*segments == '\0') {
    return false;
  }

  // If the string starts with separators, we will jump over those. If there is
  // only a slash and a '\0' after it, we can't determine the first segment
  // since there is none.
  while (cwk_path_is_separator(segments)) {
    ++segments;
    if (*segments == '\0') {
      return false;
    }
  }

  // So this is the beginning of our segment.
  segment->begin = segments;

  // Now let's determine the end of the segment, which we do by moving the path
  // pointer further until we find a separator.
  segments = cwk_path_find_next_stop(segments);

  // And finally, calculate the size of the segment by subtracting the position
  // from the end.
  segment->size = (size_t)(segments - segment->begin);
  segment->end = segments;

  // Tell the caller that we found a segment.
  return true;
}

// Assembly:
movq %rdi, (%rdx)
movq %rsi, 0x8(%rdx)
cmpb $0x0, (%rsi)
je 0xfe48
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl 0x9329(%rip), %eax      # 0x19120
leaq 0x8e42(%rip), %rcx      # 0x18c40
movq (%rcx,%rax,8), %rax
movb (%rax), %cl
testb %cl, %cl
setne %dl
incq %rax
movl %edx, %edi
testb %cl, %cl
je 0xfe34
movb (%r14), %sil
cmpb %sil, %cl
je 0xfe39
movq %rax, %r8
movb (%r8), %r9b
testb %r9b, %r9b
setne %dil
cmpb %sil, %r9b
je 0xfe34
incq %r8
testb %r9b, %r9b
jne 0xfe1d
testb %dil, %dil
je 0xfe4b
cmpb $0x0, 0x1(%r14)
leaq 0x1(%r14), %r14
jne 0xfe0c
xorl %eax, %eax
jmp 0xfe67
xorl %eax, %eax
retq
movq %r14, 0x10(%rbx)
movq %r14, %rdi
callq 0xff4d
movq %rax, %rcx
subq %r14, %rcx
movq %rcx, 0x20(%rbx)
movq %rax, 0x18(%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/cwalk/cwalk.c
// Function: cwk_path_get_next_segment
bool cwk_path_get_next_segment(struct cwk_segment *segment)
{
  const char *c;

  // First we jump to the end of the previous segment. The first character must
  // be either a '\0' or a separator.
  c = segment->begin + segment->size;
  if (*c == '\0') {
    return false;
  }

  // Now we skip all separator until we reach something else. We are not yet
  // guaranteed to have a segment, since the string could just end afterwards.
  assert(cwk_path_is_separator(c));
  do {
    ++c;
  } while (cwk_path_is_separator(c));

  // If the string ends here, we can safely assume that there is no other
  // segment after this one.
  if (*c == '\0') {
    return false;
  }

  // Now we are safe to assume there is a segment. We store the beginning of
  // this segment in the segment struct of the caller.
  segment->begin = c;

  // And now determine the size of this segment, and store it in the struct of
  // the caller as well.
  c = cwk_path_find_next_stop(c);
  segment->end = c;
  segment->size = (size_t)(c - segment->begin);

  // Tell the caller that we found a segment.
  return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %r14
movq 0x20(%rdi), %rsi
movb (%r14,%rsi), %dil
testb %dil, %dil
je 0xff24
movl 0x928f(%rip), %eax      # 0x19120
leaq 0x8da8(%rip), %rcx      # 0x18c40
movq (%rcx,%rax,8), %rax
movb (%rax), %cl
testb %cl, %cl
setne %dl
movl %edx, %r8d
je 0xfec8
cmpb %dil, %cl
je 0xfecd
leaq 0x1(%rax), %r9
movb (%r9), %r10b
testb %r10b, %r10b
setne %r8b
cmpb %dil, %r10b
je 0xfec8
incq %r9
testb %r10b, %r10b
jne 0xfeb1
testb %r8b, %r8b
je 0xff2e
addq %rsi, %r14
incq %rax
incq %r14
movl %edx, %edi
testb %cl, %cl
je 0xfefe
movb (%r14), %sil
cmpb %sil, %cl
je 0xfed3
movq %rax, %r8
movb (%r8), %r9b
testb %r9b, %r9b
setne %dil
cmpb %sil, %r9b
je 0xfefe
incq %r8
testb %r9b, %r9b
jne 0xfee7
testb %dil, %dil
jne 0xfed3
cmpb $0x0, (%r14)
je 0xff24
movq %r14, 0x10(%rbx)
movq %r14, %rdi
callq 0xff4d
movq %rax, 0x18(%rbx)
subq %r14, %rax
movq %rax, 0x20(%rbx)
movb $0x1, %al
jmp 0xff26
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x3e9b(%rip), %rdi      # 0x13dd0
leaq 0x3ead(%rip), %rsi      # 0x13de9
leaq 0x3eb8(%rip), %rcx      # 0x13dfb
movl $0x4c9, %edx            # imm = 0x4C9
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/cwalk/cwalk.c
// Function: cwk_path_find_next_stop
static const char *cwk_path_find_next_stop(const char *c)
{
  // We just move forward until we find a '\0' or a separator, which will be our
  // next "stop".
  while (*c != '\0' && !cwk_path_is_separator(c)) {
    ++c;
  }

  // Return the pointer of the next stop.
  return c;
}

// Assembly:
movq %rdi, %rax
movb (%rdi), %sil
testb %sil, %sil
je 0xffab
movl 0x91c2(%rip), %ecx      # 0x19120
leaq 0x8cdb(%rip), %rdx      # 0x18c40
movq (%rdx,%rcx,8), %rcx
movb (%rcx), %dl
testb %dl, %dl
setne %dil
incq %rcx
movl %edi, %r8d
testb %dl, %dl
je 0xff9a
cmpb %sil, %dl
je 0xffab
movq %rcx, %r9
movb (%r9), %r10b
testb %r10b, %r10b
setne %r8b
cmpb %sil, %r10b
je 0xff9a
incq %r9
testb %r10b, %r10b
jne 0xff83
testb %r8b, %r8b
jne 0xffab
movb 0x1(%rax), %sil
incq %rax
testb %sil, %sil
jne 0xff74
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/cwalk/cwalk.c
// Function: cwk_path_get_previous_segment
bool cwk_path_get_previous_segment(struct cwk_segment *segment)
{
  const char *c;

  // The current position might point to the first character of the path, which
  // means there are no previous segments available.
  c = segment->begin;
  if (c <= segment->segments) {
    return false;
  }

  // We move towards the beginning of the path until we either reached the
  // beginning or the character is no separator anymore.
  do {
    --c;
    if (c < segment->segments) {
      // So we reached the beginning here and there is no segment. So we return
      // false and don't change the segment structure submitted by the caller.
      return false;
    }
  } while (cwk_path_is_separator(c));

  // We are guaranteed now that there is another segment, since we moved before
  // the previous separator and did not reach the segment path beginning.
  segment->end = c + 1;
  segment->begin = cwk_path_find_previous_stop(segment->segments, c);
  segment->size = (size_t)(segment->end - segment->begin);

  return true;
}

// Assembly:
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rax
cmpq %rsi, %rax
jbe 0xffc2
leaq -0x1(%rax), %r11
cmpq %rsi, %r11
jae 0xffc5
xorl %eax, %eax
retq
pushq %rbp
pushq %r14
pushq %rbx
movl 0x9151(%rip), %ecx      # 0x19120
leaq 0x8c6a(%rip), %rdx      # 0x18c40
movq (%rdx,%rcx,8), %rcx
movb (%rcx), %r8b
testb %r8b, %r8b
setne %r9b
leaq 0x1(%rcx), %r10
movq %r11, %rdx
movl %r9d, %ebx
testb %r8b, %r8b
je 0x10014
movb (%rdx), %r11b
cmpb %r11b, %r8b
je 0x10018
movq %r10, %r14
movb (%r14), %bpl
testb %bpl, %bpl
setne %bl
cmpb %r11b, %bpl
je 0x10014
incq %r14
testb %bpl, %bpl
jne 0xfffe
testb %bl, %bl
je 0x1002b
leaq -0x1(%rdx), %r11
movq %rdx, %rax
cmpq %rsi, %r11
jae 0xffe8
xorl %eax, %eax
jmp 0x100bf
movq %rax, 0x18(%rdi)
cmpq %rsi, %rdx
jbe 0x1007a
movb (%rcx), %r8b
testb %r8b, %r8b
setne %r9b
leaq 0x1(%rcx), %r10
movl %r9d, %ebx
testb %r8b, %r8b
je 0x1006b
movb (%rdx), %r11b
cmpb %r11b, %r8b
je 0x1007a
movq %r10, %r14
movb (%r14), %bpl
testb %bpl, %bpl
setne %bl
cmpb %r11b, %bpl
je 0x1006b
incq %r14
testb %bpl, %bpl
jne 0x10055
testb %bl, %bl
jne 0x1007a
decq %rdx
cmpq %rsi, %rdx
ja 0x10042
movq %rsi, %rdx
movb (%rcx), %r9b
testb %r9b, %r9b
setne %r8b
je 0x100ab
movb (%rdx), %sil
movb $0x1, %r8b
cmpb %sil, %r9b
je 0x100ab
incq %rcx
movb (%rcx), %r9b
testb %r9b, %r9b
setne %r8b
cmpb %sil, %r9b
je 0x100ab
incq %rcx
testb %r9b, %r9b
jne 0x10094
movzbl %r8b, %ecx
addq %rcx, %rdx
movq %rdx, 0x10(%rdi)
subq %rdx, %rax
movq %rax, 0x20(%rdi)
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/cwalk/cwalk.c
// Function: cwk_path_segment_will_be_removed
static bool
cwk_path_segment_will_be_removed(const struct cwk_segment_joined *sj,
  bool absolute)
{
  enum cwk_segment_type type;
  struct cwk_segment_joined sjc;

  // We copy the joined path so we don't need to modify it.
  sjc = *sj;

  // First we check whether this is a CWK_CURRENT or CWK_BACK segment, since
  // those will always be dropped.
  type = cwk_path_get_segment_type(&sj->segment);
  if (type == CWK_CURRENT) {
    return true;
  } else if (type == CWK_BACK && absolute) {
    return true;
  } else if (type == CWK_BACK) {
    return cwk_path_segment_back_will_be_removed(&sjc);
  } else {
    return cwk_path_segment_normal_will_be_removed(&sjc);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movl %esi, %ebp
movq 0x30(%rdi), %rax
movq %rax, 0x30(%rsp)
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movups 0x20(%rdi), %xmm2
movaps %xmm2, 0x20(%rsp)
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
callq 0x100c4
movb $0x1, %bl
cmpl $0x1, %eax
je 0x10206
cmpl $0x2, %eax
sete %cl
testb %bpl, %cl
je 0x10216
andb $0x1, %bl
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x2, %eax
jne 0x102d3
xorl %r15d, %r15d
movq %rsp, %r14
movq 0x28(%rsp), %rax
cmpq $0x0, (%rax)
je 0x10297
movq %r14, %rdi
callq 0xffac
movb $0x1, %bl
testb %al, %al
jne 0x10299
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x10297
movq %rax, %rcx
decq %rcx
movq %rcx, 0x30(%rsp)
movq 0x28(%rsp), %rcx
je 0x1027a
movq -0x8(%rcx,%rax,8), %rdi
movq %rdi, %rsi
movq %r14, %rdx
callq 0xfddb
movl %eax, %ebx
testb %al, %al
je 0x10287
movq %r14, %rdi
callq 0xfe6f
jmp 0x1026c
movq (%rcx), %rdi
movq %r14, %rsi
callq 0xf617
movl %eax, %ebx
testb %bl, %bl
jne 0x10299
movq 0x30(%rsp), %rax
testq %rax, %rax
jne 0x10248
jmp 0x10299
xorl %ebx, %ebx
testb %bl, %bl
je 0x10206
movq %r14, %rdi
callq 0x100c4
cmpl $0x2, %eax
je 0x102cb
testl %eax, %eax
jne 0x10225
leal 0x1(%r15), %eax
testl %r15d, %r15d
movl %eax, %r15d
js 0x10225
jmp 0x10206
decl %r15d
jmp 0x10225
movq %rsp, %rdi
callq 0xf2ca
movl %eax, %ebx
testb %al, %al
je 0x10206
xorl %ebp, %ebp
movq %rsp, %r14
movq %r14, %rdi
callq 0x100c4
cmpl $0x2, %eax
je 0x102ff
testl %eax, %eax
jne 0x10309
incl %ebp
jmp 0x10309
testl %ebp, %ebp
jle 0x10206
decl %ebp
movq %r14, %rdi
callq 0xf2ca
movl %eax, %ebx
testb %al, %al
jne 0x102ea
jmp 0x10206
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/image.c
// Function: image_load_rgba
image_error_t image_load_rgba(image_t *const image, const char *infile) {
	image->buffer = NULL;

	image_error_t error;

	unsigned int status = lodepng_decode32_file(&image->buffer, &image->width, &image->height, infile);
	if (status || image->buffer == NULL) {
		error = IMAGE_ERROR_OPEN;
		goto error;
	}

	for (unsigned int y = 0; y < image->height; y++) {
		for (unsigned int x = 0; x < image->width; x++) {
			if (image->buffer[((y * image->width *4 ) + (x * 4)) + 3] != 255) {
				float a = ((float)image->buffer[((y * image->width * 4) + (x * 4)) + 3]) / 255.0f;
				image->buffer[((y * image->width * 4) + (x * 4)) + 0] = (unsigned char)(((float)image->buffer[((y * image->width * 4) + (x * 4)) + 0]) * a);
				image->buffer[((y * image->width * 4) + (x * 4)) + 1] = (unsigned char)(((float)image->buffer[((y * image->width * 4) + (x * 4)) + 1]) * a);
				image->buffer[((y * image->width * 4) + (x * 4)) + 2] = (unsigned char)(((float)image->buffer[((y * image->width * 4) + (x * 4)) + 2]) * a);
				image->buffer[((y * image->width * 4) + (x * 4)) + 3] = 255;
			}
		}
	}

	return IMAGE_ERROR_NO_ERROR;

error:
	if (image->buffer != NULL) {
		image_free_rgba(image);
	}
	return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rcx
movq %rdi, %rbx
movq $0x0, (%rdi)
leaq 0x8(%rdi), %r14
leaq 0xc(%rdi), %r15
movq %r14, %rsi
movq %r15, %rdx
callq 0xa1de
testl %eax, %eax
je 0x10383
movq (%rbx), %rdi
movl $0x1, %ebp
testq %rdi, %rdi
je 0x10467
callq 0x1030
movq $0x0, (%rbx)
jmp 0x10467
cmpq $0x0, (%rbx)
je 0x10361
cmpl $0x0, (%r15)
je 0x10465
xorl %eax, %eax
movss 0x1ca3(%rip), %xmm0     # 0x12040
movl (%r14), %edx
testl %edx, %edx
je 0x1045a
xorl %ecx, %ecx
movq (%rbx), %rsi
imull %eax, %edx
addl %ecx, %edx
shll $0x2, %edx
movb 0x3(%rsi,%rdx), %dil
cmpb $-0x1, %dil
je 0x1044d
movzbl %dil, %edi
xorps %xmm1, %xmm1
cvtsi2ss %edi, %xmm1
movl %edx, %edx
movzbl (%rsi,%rdx), %edi
xorps %xmm2, %xmm2
cvtsi2ss %edi, %xmm2
divss %xmm0, %xmm1
mulss %xmm1, %xmm2
cvttss2si %xmm2, %edi
movb %dil, (%rsi,%rdx)
movq (%rbx), %rdx
movl 0x8(%rbx), %esi
imull %eax, %esi
addl %ecx, %esi
shll $0x2, %esi
movzbl 0x1(%rdx,%rsi), %edi
xorps %xmm2, %xmm2
cvtsi2ss %edi, %xmm2
mulss %xmm1, %xmm2
cvttss2si %xmm2, %edi
movb %dil, 0x1(%rdx,%rsi)
movq (%rbx), %rdx
movl 0x8(%rbx), %esi
imull %eax, %esi
addl %ecx, %esi
shll $0x2, %esi
movzbl 0x2(%rdx,%rsi), %edi
xorps %xmm2, %xmm2
cvtsi2ss %edi, %xmm2
mulss %xmm1, %xmm2
cvttss2si %xmm2, %edi
movb %dil, 0x2(%rdx,%rsi)
movq (%rbx), %rdx
movl 0x8(%rbx), %esi
imull %eax, %esi
addl %ecx, %esi
shll $0x2, %esi
movb $-0x1, 0x3(%rdx,%rsi)
incl %ecx
movl (%r14), %edx
cmpl %edx, %ecx
jb 0x103aa
incl %eax
cmpl (%r15), %eax
jb 0x1039d
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/path.c
// Function: path_get_output_filename
void path_get_output_filename(char *buffer, size_t buffer_length, const char *output_dir, const char *filename) {
	const char *basename;
	size_t basename_length;
	cwk_path_get_basename(filename, &basename, &basename_length);

	char temp_buffer[basename_length + 1];
	memcpy(&temp_buffer, basename, basename_length);
	temp_buffer[basename_length] = '\0';

	cwk_path_join(output_dir, temp_buffer, buffer, buffer_length);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r15
movq %rsi, -0x38(%rbp)
movq %rdi, -0x30(%rbp)
leaq -0x48(%rbp), %r12
leaq -0x40(%rbp), %r13
movq %rcx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xf5db
movq %rsp, %r14
movq (%r13), %rax
movq %rsp, %rbx
addq $0x10, %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
movq (%r12), %rsi
movq (%r13), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x1130
movb $0x0, (%r12,%rbx)
movq %r15, %rdi
movq %rbx, %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0xf333
movq %r14, %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/shadetabler.c
// Function: palette_qsort_compare
static int palette_qsort_compare(const void *a, const void *b) {
	unsigned char ra = ((unsigned char *)a)[0];
	unsigned char ga = ((unsigned char *)a)[1];
	unsigned char ba = ((unsigned char *)a)[2];

	unsigned char rb = ((unsigned char *)b)[0];
	unsigned char gb = ((unsigned char *)b)[1];
	unsigned char bb = ((unsigned char *)b)[2];

	float af = (0.2126f * ((float)ra)) + (0.7152f * ((float)ga)) + (0.0722 * ((float)ba));
	float bf = (0.2126f * ((float)rb)) + (0.7152f * ((float)gb)) + (0.0722 * ((float)bb));

	if (af > bf) {
		return 1;
	} else if (bf > af) {
		return -1;
	} else {
		return 0;
	}
}

// Assembly:
movzbl (%rdi), %eax
movzbl 0x1(%rdi), %ecx
movzbl 0x2(%rdi), %edx
cvtsi2ss %eax, %xmm0
cvtsi2ss %ecx, %xmm1
movss 0x2d98(%rip), %xmm2     # 0x13f28
mulss %xmm2, %xmm1
movss 0x2d90(%rip), %xmm3     # 0x13f2c
mulss %xmm3, %xmm0
addss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %edx, %xmm1
movsd 0x2d89(%rip), %xmm4     # 0x13f40
mulsd %xmm4, %xmm1
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movzbl (%rsi), %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
movzbl 0x1(%rsi), %eax
cvtsi2ss %eax, %xmm5
movzbl 0x2(%rsi), %eax
mulss %xmm2, %xmm5
mulss %xmm3, %xmm1
addss %xmm5, %xmm1
cvtss2sd %xmm1, %xmm1
xorps %xmm2, %xmm2
cvtsi2sd %eax, %xmm2
mulsd %xmm4, %xmm2
addsd %xmm1, %xmm2
xorps %xmm1, %xmm1
cvtsd2ss %xmm2, %xmm1
xorl %ecx, %ecx
ucomiss %xmm0, %xmm1
seta %cl
negl %ecx
ucomiss %xmm1, %xmm0
movl $0x1, %eax
cmovbel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/shadetabler.c
// Function: save_image
static void save_image(const char *filename, unsigned char *buffer, unsigned int width, unsigned int height, unsigned char *palette, unsigned int colors) {
	LodePNGState state;
	lodepng_state_init(&state);
	state.info_raw.colortype = LCT_PALETTE;
	state.info_raw.bitdepth = 8;
	state.info_png.color.colortype = LCT_PALETTE;
	state.info_png.color.bitdepth = 8;

	state.encoder.filter_palette_zero = 0;
	state.encoder.filter_strategy = LFS_ZERO;
	state.encoder.auto_convert = 0;
	state.encoder.force_palette = 1;

	unsigned char *p = palette;
	for (unsigned int i = 0; i < colors; i++) {
		lodepng_palette_add(&state.info_png.color, p[0], p[1], p[2], p[3]);
		lodepng_palette_add(&state.info_raw, p[0], p[1], p[2], p[3]);
		p += 4;
	}

	unsigned char *output_file_data;
	size_t output_file_size;
	unsigned int status = lodepng_encode(&output_file_data, &output_file_size, buffer, width, height, &state);
	if (status) {
		fprintf(stderr, "Can't encode image: %s\n", lodepng_error_text(status));
		goto error;
	}

	FILE *fp = fopen(filename, "wb");
	if (!fp) {
		fprintf(stderr, "Unable to write to %s\n", filename);
		goto error;
	}
	fwrite(output_file_data, 1, output_file_size, fp);
	fclose(fp);

error:
	lodepng_state_cleanup(&state);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movl %r9d, %ebp
movq %r8, %r12
movl %ecx, 0x4(%rsp)
movl %edx, (%rsp)
movq %rsi, %r15
movq %rdi, 0x8(%rsp)
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x9ff8
movabsq $0x800000003, %rax      # imm = 0x800000003
movq %rax, 0x90(%rbx)
movq %rax, 0xc8(%rbx)
movl $0x0, 0x70(%rbx)
movq $0x0, 0x68(%rbx)
movl $0x1, 0x80(%rbx)
testl %ebp, %ebp
je 0x112db
leaq 0xb0(%rsp), %r13
leaq 0xe8(%rsp), %rbx
movl %ebp, %ebp
xorl %r14d, %r14d
movzbl (%r12,%r14,4), %esi
movzbl 0x1(%r12,%r14,4), %edx
movzbl 0x2(%r12,%r14,4), %ecx
movzbl 0x3(%r12,%r14,4), %r8d
movq %rbx, %rdi
callq 0x57c9
movzbl (%r12,%r14,4), %esi
movzbl 0x1(%r12,%r14,4), %edx
movzbl 0x2(%r12,%r14,4), %ecx
movzbl 0x3(%r12,%r14,4), %r8d
movq %r13, %rdi
callq 0x57c9
incq %r14
cmpl %r14d, %ebp
jne 0x11295
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x20(%rsp), %r9
movq %r15, %rdx
movl (%rsp), %ecx
movl 0x4(%rsp), %r8d
callq 0xa377
testl %eax, %eax
jne 0x11355
leaq 0x1880(%rip), %rsi      # 0x12b85
movq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x1190
testq %rax, %rax
je 0x1135e
movq %rax, %rbx
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
movl $0x1, %esi
movq %rax, %rcx
callq 0x11d0
movq %rbx, %rdi
callq 0x1090
leaq 0x20(%rsp), %rdi
callq 0xa0f8
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x1390
jmp 0x11339
movq 0x7c93(%rip), %rax      # 0x18ff8
movq (%rax), %rdi
leaq 0x2f47(%rip), %rsi      # 0x142b6
movq %r14, %rdx
xorl %eax, %eax
callq 0x1110
jmp 0x11339
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/shadetabler.c
// Function: usage
static void usage() {
	printf(SHADETABLER_HEADER "\n");
	printf("Usage: shadetabler -o <output directory> <additional options> <input files...>\n");
	printf("\n");
	printf("Available options are:\n");
	printf(" -o, --output                    Output directory. (Required)\n");
	printf(" -v, --verbose                   Verbose output.\n");
	printf(" -f, --force                     Overwrite existing files, never prompt.\n");
	printf(" -c, --colors [2-256]            Number of colors saved in the output file. (Default 256)\n");
	printf(" -s, --shades [2-256]            Number of shades in shade table. (Default 64)\n");
	printf(" -t, --type [light|dark|both]    Type of shade table(s) to genereate. (Default \"light\")\n");
	printf(" -h, --hq                        High quality quantization quality.\n");
	printf(" -r, --reserve                   Reserve colors for black and white.\n");
	printf(" -p, --priority [0-...]          Priority of input file colors over generated shaded. (Default 0)\n");
	printf(" -l, --light                     Light shade table filename. (Default \"shadetable_light.png\")\n");
	printf(" -d, --dark                      Dark shade table filename. (Default \"shadetable_dark.png\")\n");
	printf("\n");
}

// Assembly:
pushq %rax
leaq 0x2d48(%rip), %rdi      # 0x142eb
callq 0x1060
leaq 0x2d8d(%rip), %rdi      # 0x1433c
callq 0x1060
movl $0xa, %edi
callq 0x1040
leaq 0x2dc6(%rip), %rdi      # 0x1438b
callq 0x1060
leaq 0x2dd1(%rip), %rdi      # 0x143a2
callq 0x1060
leaq 0x2e03(%rip), %rdi      # 0x143e0
callq 0x1060
leaq 0x2e28(%rip), %rdi      # 0x14411
callq 0x1060
leaq 0x2e65(%rip), %rdi      # 0x1445a
callq 0x1060
leaq 0x2eb3(%rip), %rdi      # 0x144b4
callq 0x1060
leaq 0x2ef6(%rip), %rdi      # 0x14503
callq 0x1060
leaq 0x2f42(%rip), %rdi      # 0x1455b
callq 0x1060
leaq 0x2f7a(%rip), %rdi      # 0x1459f
callq 0x1060
leaq 0x2fb3(%rip), %rdi      # 0x145e4
callq 0x1060
leaq 0x3009(%rip), %rdi      # 0x14646
callq 0x1060
leaq 0x305b(%rip), %rdi      # 0x146a4
callq 0x1060
movl $0xa, %edi
popq %rax
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O1/MAGI003769[P]EE450-Socket-Project/aws.c
// Function: sigchld_handler
void sigchld_handler(int s){
    // waitpid() might overwrite errno, so we save and restore it:
    int saved_errno = errno;
    
    while(waitpid(-1, NULL, WNOHANG) > 0);
    
    errno = saved_errno;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
callq 0x1050
movq %rax, %rbx
movl (%rax), %r14d
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %esi, %esi
movl $0x1, %edx
callq 0x1180
testl %eax, %eax
jg 0x14be
movl %r14d, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/MAGI003769[P]EE450-Socket-Project/aws.c
// Function: setupTCP
int setupTCP(char* port) {
    int rv;
    int sockfd;
    struct addrinfo hints, *servinfo, *p;
    struct sigaction sa;
    int yes = 1;
    memset(&hints, 0, sizeof hints);
    hints.ai_family = AF_UNSPEC;
    hints.ai_socktype = SOCK_STREAM;
    hints.ai_flags = AI_PASSIVE;

    if((rv = getaddrinfo(IPADDRESS, port, &hints, &servinfo)) != 0) {
        fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv));
		return 1;
    }

    for(p = servinfo; p != NULL; p = p->ai_next) {
        if((sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) {
            perror("server: socket");
            continue;
        }
        if(setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1){
            perror("setsockopt");
            exit(1);
        }
        if(bind(sockfd, p->ai_addr, p->ai_addrlen) == -1) {
            close(sockfd);
            perror("server: bind");
            continue;
        }
        break;
    }

    freeaddrinfo(servinfo);

    if(p == NULL) {
        fprintf(stderr, "server: failed to bind\n");
        exit(1);
    }

    if(listen(sockfd, BACKLOG) == -1) {
        perror("listen");
        exit(1);
    }
    
    sa.sa_handler = sigchld_handler; // reap all dead processes sigemptyset(&sa.sa_mask);
    sa.sa_flags = SA_RESTART;
    if (sigaction(SIGCHLD, &sa, NULL) == -1) {
        perror("sigaction");
        exit(1); 
    }

    return sockfd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %rsi
movl $0x1, %ebx
movl %ebx, -0x2c(%rbp)
xorps %xmm0, %xmm0
leaq -0x70(%rbp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
movl %ebx, 0x8(%rdx)
movl %ebx, (%rdx)
leaq 0xa4f(%rip), %rdi       # 0x2004
leaq -0x38(%rbp), %rcx
callq 0x11f0
testl %eax, %eax
jne 0x16b2
movq -0x38(%rbp), %r15
testq %r15, %r15
sete %r12b
je 0x1652
leaq 0xa45(%rip), %r13       # 0x201f
leaq -0x2c(%rbp), %r14
movl 0x4(%r15), %edi
movl 0x8(%r15), %esi
movl 0xc(%r15), %edx
callq 0x1220
movl %eax, %ebx
movq %r13, %rdi
cmpl $-0x1, %eax
je 0x163e
movl %ebx, %edi
movl $0x1, %esi
movl $0x2, %edx
movq %r14, %rcx
movl $0x4, %r8d
callq 0x1090
cmpl $-0x1, %eax
je 0x16bb
movq 0x18(%r15), %rsi
movl 0x10(%r15), %edx
movl %ebx, %edi
callq 0x1170
cmpl $-0x1, %eax
jne 0x1652
movl %ebx, %edi
callq 0x1100
leaq 0x9fb(%rip), %rdi       # 0x2039
callq 0x1190
movq 0x28(%r15), %r15
testq %r15, %r15
sete %r12b
jne 0x15de
jmp 0x1652
movq -0x38(%rbp), %rdi
callq 0x1210
testb $0x1, %r12b
jne 0x16c0
movl %ebx, %edi
movl $0xa, %esi
callq 0x1150
cmpl $-0x1, %eax
je 0x16c5
leaq -0x1cd(%rip), %rax      # 0x14ac
leaq -0x108(%rbp), %rsi
movq %rax, (%rsi)
movl $0x10000000, 0x88(%rsi) # imm = 0x10000000
movl $0x11, %edi
xorl %edx, %edx
callq 0x1080
cmpl $-0x1, %eax
je 0x16ca
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x1240
jmp 0x169e
callq 0x1270
callq 0x12b8
callq 0x12a0
callq 0x1288
// File: /workspace/github_c_makefile_star2_O1/MAGI003769[P]EE450-Socket-Project/aws.c
// Function: setupUDP2
int setupUDP2(char* port)
{
	int sockfd;
	int rv;
	struct addrinfo hints, *servinfo, *p;
	socklen_t addr_len;
	memset(&hints, 0, sizeof hints);
	hints.ai_family = AF_UNSPEC;
	hints.ai_socktype = SOCK_DGRAM;

	if ((rv = getaddrinfo(IPADDRESS, port, &hints, &servinfo)) != 0) {
		fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv));
		return 1;
	}

	// loop through all the results and make a socket
	for(p = servinfo; p != NULL; p = p->ai_next) {
		if ((sockfd = socket(p->ai_family, p->ai_socktype,
				p->ai_protocol)) == -1) {
			perror("talker: socket");
			continue;
		}

        if(bind(sockfd, p->ai_addr, p->ai_addrlen) == -1) {
            close(sockfd);
            perror("server: bind");
            continue;
        }

		break;
	}

	if (p == NULL) {
		fprintf(stderr, "talker: failed to create socket\n");
		return 2;
	}

	freeaddrinfo(servinfo); // done with servinfo
	return sockfd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rsi
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
movl $0x2, 0x8(%rdx)
leaq 0x901(%rip), %rdi       # 0x2004
leaq -0x30(%rbp), %rcx
callq 0x11f0
testl %eax, %eax
jne 0x179c
movq -0x30(%rbp), %r14
testq %r14, %r14
sete %r12b
je 0x177c
leaq 0x947(%rip), %r15       # 0x206f
leaq 0x90a(%rip), %r13       # 0x2039
movl 0x4(%r14), %edi
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
callq 0x1220
movl %eax, %ebx
movq %r15, %rdi
cmpl $-0x1, %eax
je 0x1768
movq 0x18(%r14), %rsi
movl 0x10(%r14), %edx
movl %ebx, %edi
callq 0x1170
cmpl $-0x1, %eax
jne 0x177c
movl %ebx, %edi
callq 0x1100
movq %r13, %rdi
callq 0x1190
movq 0x28(%r14), %r14
testq %r14, %r14
sete %r12b
jne 0x172f
jmp 0x177c
testb $0x1, %r12b
jne 0x17aa
movq -0x30(%rbp), %rdi
callq 0x1210
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x12e0
movl $0x1, %ebx
jmp 0x178b
callq 0x1310
movl $0x2, %ebx
jmp 0x178b
// File: /workspace/github_c_makefile_star2_O1/MAGI003769[P]EE450-Socket-Project/aws.c
// Function: check_vtx
int check_vtx(char *source_vtx, char *target_vtx, char *data) {
    int source_flag = 0, target_flag = 0;
    char *end_str;
    char *token = strtok_r(data, "\n", &end_str);
    int i = 0;

    while (token != NULL) {
        char *end_token;
        //printf("debug: check line -- %s\n", token);
        if(i >= 3) {
            char *token2 = strtok_r(token, " ", &end_token);
            int j = 0;
            while (token2 != NULL && j < 2) {
                //printf("debug: check word -- %s\n", token2);
                if(strcmp(token2, source_vtx) == 0) {
                    source_flag = 1;
                } else if(strcmp(token2, target_vtx) == 0) {
                    target_flag = 1;
                }

                if(target_flag == 1 && source_flag == 1) {
                    return 11;
                }

                token2 = strtok_r(NULL, " ", &end_token);
                j++;
            }
        }
        token = strtok_r(NULL, "\n", &end_str);
        i++;
    }
    return (target_flag * 10 + source_flag);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rax
movq %rsi, -0x50(%rbp)
movq %rdi, -0x58(%rbp)
leaq 0x71b(%rip), %rsi       # 0x205c
leaq -0x68(%rbp), %rdx
movq %rax, %rdi
callq 0x1110
movq $0x0, -0x30(%rbp)
xorl %r15d, %r15d
xorl %r14d, %r14d
testq %rax, %rax
je 0x1a7e
cmpl $0x3, %r14d
jl 0x1a32
movl %r14d, -0x3c(%rbp)
movq %rax, -0x48(%rbp)
movq %rax, %rdi
leaq 0xc56(%rip), %rsi       # 0x25d6
leaq -0x60(%rbp), %rdx
callq 0x1110
testq %rax, %rax
sete %r13b
je 0x1a3a
movq %rax, %r12
movq %r15, -0x38(%rbp)
xorl %r14d, %r14d
movq %r12, %rdi
movq -0x58(%rbp), %rsi
callq 0x1120
movl $0x1, %ebx
testl %eax, %eax
je 0x19d1
movq %r12, %rdi
movq -0x50(%rbp), %rsi
callq 0x1120
testl %eax, %eax
movl $0x1, %eax
movq -0x38(%rbp), %rcx
cmovel %eax, %ecx
jmp 0x19de
movl $0x1, %eax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rcx
movq %rcx, -0x38(%rbp)
cmpl $0x1, %ecx
jne 0x19f3
movl $0x1, %r15d
cmpl $0x1, -0x30(%rbp)
je 0x1a40
xorl %edi, %edi
leaq 0xbda(%rip), %rsi       # 0x25d6
leaq -0x60(%rbp), %rdx
callq 0x1110
movq %rax, %r12
testq %rax, %rax
sete %al
addl $-0x1, %r14d
setb %r13b
orb %al, %r13b
movq -0x30(%rbp), %rax
movl %eax, %ebx
movq -0x38(%rbp), %rax
movl %eax, %r15d
testb $0x1, %r13b
je 0x19a0
jmp 0x1a40
movq -0x30(%rbp), %rax
movl %eax, %ebx
jmp 0x1a4a
movq -0x30(%rbp), %rax
movl %eax, %ebx
testb $0x1, %r13b
movl -0x3c(%rbp), %r14d
je 0x1a63
xorl %edi, %edi
leaq 0x609(%rip), %rsi       # 0x205c
leaq -0x68(%rbp), %rdx
callq 0x1110
incl %r14d
movb $0x1, %cl
jmp 0x1a69
xorl %ecx, %ecx
movq -0x48(%rbp), %rax
movl %ebx, %edx
movq %rdx, -0x30(%rbp)
testb %cl, %cl
jne 0x195b
movl $0xb, %eax
jmp 0x1a89
leal (%r15,%r15,4), %eax
movq -0x30(%rbp), %rcx
leal (%rcx,%rax,2), %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq