LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: uivector_resize
static unsigned uivector_resize(uivector* p, size_t size) {
  size_t allocsize = size * sizeof(unsigned);
  if(allocsize > p->allocsize) {
    size_t newsize = allocsize + (p->allocsize >> 1u);
    void* data = lodepng_realloc(p->data, newsize);
    if(data) {
      p->allocsize = newsize;
      p->data = (unsigned*)data;
    }
    else return 0; /*error: not enough memory*/
  }
  p->size = size;
  return 1; /*success*/
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq (,%rsi,4), %rax
movq 0x10(%rdi), %r15
cmpq %r15, %rax
jbe 0xb502
shrq %r15
addq %rax, %r15
movq (%r14), %rdi
movq %r15, %rsi
callq 0x1160
testq %rax, %rax
je 0xb50f
movq %r15, 0x10(%r14)
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0xb509
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: HuffmanTree_makeFromFrequencies
static unsigned HuffmanTree_makeFromFrequencies(HuffmanTree* tree, const unsigned* frequencies,
                                                size_t mincodes, size_t numcodes, unsigned maxbitlen) {
  unsigned error = 0;
  while(!frequencies[numcodes - 1] && numcodes > mincodes) --numcodes; /*trim zeroes*/
  tree->lengths = (unsigned*)lodepng_malloc(numcodes * sizeof(unsigned));
  if(!tree->lengths) return 83; /*alloc fail*/
  tree->maxbitlen = maxbitlen;
  tree->numcodes = (unsigned)numcodes; /*number of symbols*/

  error = lodepng_huffman_code_lengths(tree->lengths, frequencies, numcodes, maxbitlen);
  if(!error) error = HuffmanTree_makeFromLengths2(tree);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebp
movq %rcx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x4(,%rcx,4), %rcx
pushq $0x1
popq %r12
xorl %eax, %eax
leaq (%r15,%rax), %rsi
leaq -0x4(%rcx), %rdi
decq %r12
cmpq %rdx, %rsi
jbe 0xb590
decq %rax
cmpl $0x0, -0x8(%r14,%rcx)
movq %rdi, %rcx
je 0xb572
callq 0x1130
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0xb5cd
leaq (%r15,%r12), %rdx
movl %ebp, 0x10(%rbx)
addl %r12d, %r15d
movl %r15d, 0x14(%rbx)
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %ecx
callq 0x28b3
testl %eax, %eax
jne 0xb5d0
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa940
pushq $0x53
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lodepng_chunk_init
static unsigned lodepng_chunk_init(unsigned char** chunk,
                                   ucvector* out,
                                   unsigned length, const char* type) {
  size_t new_length = out->size;
  if(lodepng_addofl(new_length, length, &new_length)) return 77;
  if(lodepng_addofl(new_length, 12, &new_length)) return 77;
  if(!ucvector_resize(out, new_length)) return 83; /*alloc fail*/
  *chunk = out->data + new_length - length - 12u;

  /*1: length*/
  lodepng_set32bitInt(*chunk, length);

  /*2: chunk name (4 letters)*/
  lodepng_memcpy(*chunk + 4, type, 4);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r13d
movq 0x8(%rsi), %rbp
pushq $0x4d
popq %rax
addq %r13, %rbp
jb 0xb650
subq $-0xc, %rbp
jae 0xb650
movq %rcx, %r14
movl %edx, %ebx
movq %rsi, %r12
movq %rdi, %r15
movq %rsi, %rdi
movq %rbp, %rsi
callq 0xa6f2
testl %eax, %eax
je 0xb64d
addq (%r12), %rbp
subq %r13, %rbp
leaq -0xc(%rbp), %rax
movq %rax, (%r15)
movl %ebx, %eax
shrl $0x18, %eax
movb %al, -0xc(%rbp)
movl %ebx, %eax
shrl $0x10, %eax
movb %al, -0xb(%rbp)
movb %bh, -0xa(%rbp)
movb %bl, -0x9(%rbp)
movq (%r15), %rdi
addq $0x4, %rdi
pushq $0x4
popq %rdx
movq %r14, %rsi
callq 0x4a33
xorl %eax, %eax
jmp 0xb650
pushq $0x53
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: alloc_string_sized
static char* alloc_string_sized(const char* in, size_t insize) {
  char* out = (char*)lodepng_malloc(insize + 1);
  if(out) {
    lodepng_memcpy(out, in, insize);
    out[insize] = 0;
  }
  return out;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x1(%rsi), %rdi
callq 0x1130
movq %rax, %r14
testq %rax, %rax
je 0xb6a0
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x4a33
movb $0x0, (%r14,%rbx)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: readBitsFromReversedStream
static unsigned readBitsFromReversedStream(size_t* bitpointer, const unsigned char* bitstream, size_t nbits) {
  unsigned result = 0;
  size_t i;
  for(i = 0 ; i < nbits; ++i) {
    result <<= 1u;
    result |= (unsigned)readBitFromReversedStream(bitpointer, bitstream);
  }
  return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
xorl %r15d, %r15d
subq $0x1, %rbx
jb 0xb6d7
movq %r12, %rdi
movq %r14, %rsi
callq 0xb6e6
movzbl %al, %eax
leal (%rax,%r15,2), %r15d
jmp 0xb6bd
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 $0x18, %rsp
movq %r9, %r14
movq %r8, %r15
movq %rcx, %r13
movq %rsi, %rbx
movq %rdi, %r12
movq 0x8(%r9), %rax
testq %rax, %rax
je 0xb805
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r15, %rcx
movq %r14, %r8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movq (%r12), %rax
movq (%rbx), %rsi
movq %rax, (%rsp)
movq %rsi, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
testq %rdx, %rdx
je 0xb834
addq %rdx, %rsi
movq %rsp, %rbp
movq %rbp, %rdi
callq 0xa6f2
movq (%rbx), %rax
movq %rax, 0x8(%rbp)
movq %rsp, %rbp
movq %rbp, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x43b7
movq (%rbp), %rcx
movq %rcx, (%r12)
movq 0x8(%rbp), %rcx
movq %rcx, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3a6d(%rip), %r15      # 0xf940
leaq 0x3a86(%rip), %r12      # 0xf960
leaq 0x3a9f(%rip), %r13      # 0xf980
leaq 0x3ab8(%rip), %rbp      # 0xf9a0
cmpq $0x1c, %r14
je 0xbf3b
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 0xbf35
andl $0x0, (%rdi,%r14)
addq $0x4, %r14
jmp 0xbee8
andq $0x0, (%r8)
andq $0x0, (%rcx)
andq $0x0, (%r10)
xorl %eax, %eax
movl 0x40(%rsp), %ebp
cmpq $0x1c, %rax
je 0xbfb5
movl (%rdi,%rax), %edx
movl (%rsi,%rax), %r9d
testl %edx, %edx
je 0xbf79
testl %r9d, %r9d
je 0xbf76
movl %edx, %ebx
imull %ebp, %ebx
addl $0x7, %ebx
shrl $0x3, %ebx
incl %ebx
imull %r9d, %ebx
jmp 0xbf7b
xorl %r9d, %r9d
xorl %ebx, %ebx
addq (%r10,%rax,2), %rbx
movq %rbx, 0x8(%r10,%rax,2)
imull %ebp, %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
jmp 0xbf4d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: paethPredictor
static unsigned char paethPredictor(short a, short b, short c) {
  short pa = LODEPNG_ABS(b - c);
  short pb = LODEPNG_ABS(a - c);
  short pc = LODEPNG_ABS(a + b - c - c);
  /* return input value associated with smallest of pa, pb, pc (with certain priority if equal) */
  if(pb < pa) { a = b; pa = pb; }
  return (pc < pa) ? c : a;
}

// Assembly:
movl %edi, %eax
movl $0xffff, %ecx           # imm = 0xFFFF
movl %esi, %r8d
andl %ecx, %r8d
movl %edx, %r9d
andl %ecx, %r9d
subl %r9d, %r8d
movl %r8d, %edi
negl %edi
cmovsl %r8d, %edi
andl %ecx, %edi
movl %eax, %r8d
andl %ecx, %r8d
subl %r9d, %r8d
movl %r8d, %r9d
negl %r9d
cmovsl %r8d, %r9d
andl %ecx, %r9d
leal (%rsi,%rax), %r8d
subl %edx, %r8d
subl %edx, %r8d
movl %r8d, %r10d
negl %r10d
cmovsl %r8d, %r10d
andl %ecx, %r10d
cmpl %edi, %r9d
cmovael %edi, %r9d
cmovbl %esi, %eax
cmpl %r9d, %r10d
cmovbl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: setBitOfReversedStream
static void setBitOfReversedStream(size_t* bitpointer, unsigned char* bitstream, unsigned char bit) {
  /*the current bit in bitstream may be 0 or 1 for this to work*/
  if(bit == 0) bitstream[(*bitpointer) >> 3u] &=  (unsigned char)(~(1u << (7u - ((*bitpointer) & 7u))));
  else         bitstream[(*bitpointer) >> 3u] |=  (1u << (7u - ((*bitpointer) & 7u)));
  ++(*bitpointer);
}

// Assembly:
movq (%rdi), %rax
movl %eax, %ecx
notb %cl
andb $0x7, %cl
movb $0x1, %r8b
shlb %cl, %r8b
testl %edx, %edx
je 0xc03d
shrq $0x3, %rax
orb %r8b, (%rsi,%rax)
jmp 0xc048
notb %r8b
shrq $0x3, %rax
andb %r8b, (%rsi,%rax)
incq (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xca3a
testb %al, %al
je 0xc9e2
movq %rsp, %r13
xorl %ebp, %ebp
jmp 0xc9f5
leaq 0x8(%rsp), %r13
leaq 0x4517(%rip), %rax      # 0x10f05
movq %rax, -0x8(%r13)
pushq $0x1
popq %rbp
movq %r15, %rdi
callq 0xca3a
leaq 0x1(%rbp), %rcx
testb %al, %al
jne 0xca14
movq %r12, (%r13)
orq $0x2, %rbp
leaq (%rsp,%rcx,8), %r13
movq %rbp, %rcx
movq %r15, (%r13)
andq $0x0, (%rsp,%rcx,8)
movq %rsp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xca5e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
cmpl $0x1, 0xa2a6(%rip)      # 0x17118
jne 0xce86
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1050
testl %eax, %eax
jmp 0xcec9
xorl %r12d, %r12d
movsbq (%r15,%r12), %r13
testq %r13, %r13
je 0xceb8
movsbq (%rbx,%r12), %rbp
testq %rbp, %rbp
je 0xcec6
cmpq %r12, %r14
je 0xcec6
callq 0x11f0
movq (%rax), %rax
movl (%rax,%r13,4), %ecx
cmpl (%rax,%rbp,4), %ecx
jne 0xcedb
incq %r12
jmp 0xce89
movb $0x1, %al
cmpq %r12, %r14
je 0xcecc
cmpb $0x0, (%rbx,%r12)
jmp 0xcec9
cmpq %r12, %r14
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0xcecc
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rsi, %rbx
andq $0x0, 0x30(%rsi)
movq %rdi, %r14
movq %rdi, 0x28(%rsi)
xorl %eax, %eax
movq (%r14,%rax,8), %r15
testq %r15, %r15
je 0xcf2d
movq %r15, %rdi
movq %rbx, %rsi
callq 0xd825
testb %al, %al
jne 0xcf2d
movq 0x30(%rbx), %rax
incq %rax
movq %rax, 0x30(%rbx)
jmp 0xcf08
testq %r15, %r15
setne %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xce34
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 0xd157
addq %rcx, %rbp
leaq (%r14,%r13), %rdi
movq %rbp, %rsi
callq 0x1170
cmpq %rbx, %r13
cmovaeq %rbx, %r13
testq %r13, %r13
je 0xd171
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x1170
testq %rbx, %rbx
je 0xd189
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_O2/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 0xd1dc
testb %al, %al
je 0xd4d2
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdx
xorl %eax, %eax
leaq (%rdx,%rax), %rsi
cmpq %rcx, %rsi
jb 0xd4d2
cmpb $0x2e, (%rsi)
je 0xd4d6
decq %rax
jmp 0xd4bf
xorl %eax, %eax
jmp 0xd4e1
movq %rsi, (%r14)
negq %rax
movq %rax, (%rbx)
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/cwalk/cwalk.c
// Function: cwk_path_output
static size_t cwk_path_output(char *buffer, size_t buffer_size, size_t position,
  const char *str)
{
  size_t length;

  // This just does a sized output internally, but first measuring the
  // null-terminated string.
  length = strlen(str);
  return cwk_path_output_sized(buffer, buffer_size, position, str, length);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r12
movq %rcx, %rdi
callq 0x10a0
movq %rax, %r14
addq %r15, %rax
xorl %edx, %edx
movq %r13, %rcx
subq %r15, %rcx
cmovaeq %rcx, %rdx
cmpq %r13, %rax
cmovbq %r14, %rdx
testq %rdx, %rdx
je 0xd6f1
addq %r15, %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1170
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x10(%rdi), %r15
movq 0x20(%rdi), %r12
cmpb $0x0, (%r15,%r12)
je 0xd915
movq %rdi, %rbx
leaq (%r15,%r12), %r14
movq %r14, %rdi
callq 0xd313
testb %al, %al
je 0xd923
addq %r12, %r15
incq %r14
movq %r14, %rdi
callq 0xd313
incq %r15
testb %al, %al
jne 0xd8e2
cmpb $0x0, (%r14)
je 0xd915
movq %r14, 0x10(%rbx)
movq %r14, %rdi
callq 0xd942
movq %rax, 0x18(%rbx)
subq %r15, %rax
movq %rax, 0x20(%rbx)
movb $0x1, %al
jmp 0xd917
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x34b6(%rip), %rdi      # 0x10de0
leaq 0x34c8(%rip), %rsi      # 0x10df9
leaq 0x34d3(%rip), %rcx      # 0x10e0b
movl $0x4c9, %edx            # imm = 0x4C9
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbx
movq %rdi, %rbx
cmpb $0x0, (%rbx)
je 0xd95c
movq %rbx, %rdi
callq 0xd313
testb %al, %al
jne 0xd95c
incq %rbx
jmp 0xd946
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rdi), %r15
movq 0x10(%rdi), %r14
cmpq %r15, %r14
jbe 0xd9b2
movq %rdi, %rbx
decq %r14
cmpq %r15, %r14
jb 0xd9b2
movq %r14, %rdi
callq 0xd313
testb %al, %al
jne 0xd979
leaq 0x1(%r14), %rax
movq %rax, 0x18(%rbx)
pushq $-0x1
popq %r12
cmpq %r15, %r14
jbe 0xd9b6
movq %r14, %rdi
callq 0xd313
testb %al, %al
jne 0xd9b6
decq %r14
decq %r12
jmp 0xd999
xorl %eax, %eax
jmp 0xd9d4
movq %r14, %rdi
callq 0xd313
movzbl %al, %eax
addq %rax, %r14
movq %r14, 0x10(%rbx)
addq %rax, %r12
negq %r12
movq %r12, 0x20(%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xd9e0
movb $0x1, %bl
cmpl $0x1, %eax
je 0xdc05
cmpl $0x2, %eax
sete %cl
testb %bpl, %cl
jne 0xdc05
xorl %r15d, %r15d
movq %rsp, %r14
cmpl $0x2, %eax
jne 0xdbd1
movq 0x28(%rsp), %rax
cmpq $0x0, (%rax)
setne %bl
je 0xdc03
movq %r14, %rdi
callq 0xd961
testb %al, %al
jne 0xdba6
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0xdc03
movq %rax, %rcx
decq %rcx
movq %rcx, 0x30(%rsp)
movq 0x28(%rsp), %rcx
je 0xdb8d
movq -0x8(%rcx,%rax,8), %rdi
movq %rdi, %rsi
movq %r14, %rdx
callq 0xd858
testb %al, %al
je 0xdb57
jmp 0xdb9a
movq (%rcx), %rdi
movq %r14, %rsi
callq 0xd1dc
jmp 0xdb53
movq %r14, %rdi
callq 0xd8b5
testb %al, %al
jne 0xdb9a
movq %r14, %rdi
callq 0xd9e0
cmpl $0x2, %eax
je 0xdbc9
testl %eax, %eax
jne 0xdb39
leal 0x1(%r15), %eax
testl %r15d, %r15d
movl %eax, %r15d
js 0xdb39
jmp 0xdc05
decl %r15d
jmp 0xdb39
movq %r14, %rdi
callq 0xcfb1
movl %eax, %ebx
testb %al, %al
je 0xdc05
movq %r14, %rdi
callq 0xd9e0
cmpl $0x2, %eax
je 0xdbf5
testl %eax, %eax
jne 0xdbd1
incl %r15d
jmp 0xdbd1
leal -0x1(%r15), %eax
testl %r15d, %r15d
movl %eax, %r15d
jg 0xdbd1
jmp 0xdc05
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 %rdi, %rbx
andq $0x0, (%rdi)
movq %rsi, %rcx
leaq 0x8(%rdi), %r14
leaq 0xc(%rdi), %r15
movq %r14, %rsi
movq %r15, %rdx
callq 0x89f3
movq (%rbx), %rcx
testl %eax, %eax
je 0xdc6f
pushq $0x1
popq %rbp
testq %rcx, %rcx
je 0xdd3e
movq %rbx, %rdi
callq 0xdc14
jmp 0xdd3e
testq %rcx, %rcx
je 0xdd3b
xorl %ebp, %ebp
movss 0x141e(%rip), %xmm0     # 0xf0a0
xorl %eax, %eax
cmpl (%r15), %eax
jae 0xdd3e
xorl %ecx, %ecx
movl (%r14), %esi
cmpl %esi, %ecx
jae 0xdd34
movq (%rbx), %rdx
imull %eax, %esi
addl %ecx, %esi
shll $0x2, %esi
movb 0x3(%rdx,%rsi), %dil
cmpb $-0x1, %dil
je 0xdd2d
movzbl %dil, %edi
cvtsi2ss %edi, %xmm1
movl %esi, %esi
movzbl (%rdx,%rsi), %edi
cvtsi2ss %edi, %xmm2
divss %xmm0, %xmm1
mulss %xmm1, %xmm2
cvttss2si %xmm2, %edi
movb %dil, (%rdx,%rsi)
movq (%rbx), %rdx
movl 0x8(%rbx), %esi
imull %eax, %esi
addl %ecx, %esi
shll $0x2, %esi
movzbl 0x1(%rdx,%rsi), %edi
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
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
jmp 0xdc8f
incl %eax
jmp 0xdc84
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xd1a5
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 0x1120
movb $0x0, (%r12,%rbx)
movq %r15, %rdi
movq %rbx, %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0xd008
movq %r14, %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 (%rsi), %ecx
movzbl 0x1(%rsi), %edx
movzbl 0x2(%rsi), %eax
movzbl (%rdi), %esi
shll $0x8, %esi
orl %ecx, %esi
movd %esi, %xmm1
pxor %xmm0, %xmm0
punpcklbw %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
punpcklwd %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
movzbl 0x1(%rdi), %ecx
shll $0x8, %ecx
orl %edx, %ecx
movd %ecx, %xmm2
punpcklbw %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3],xmm2[4],xmm0[4],xmm2[5],xmm0[5],xmm2[6],xmm0[6],xmm2[7],xmm0[7]
punpcklwd %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
cvtdq2ps %xmm2, %xmm2
mulps 0x261a(%rip), %xmm2     # 0x10fa0
cvtdq2ps %xmm1, %xmm1
mulps 0x2620(%rip), %xmm1     # 0x10fb0
addps %xmm2, %xmm1
cvtps2pd %xmm1, %xmm1
movzbl 0x2(%rdi), %ecx
shll $0x8, %ecx
orl %eax, %ecx
movd %ecx, %xmm2
punpcklbw %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3],xmm2[4],xmm0[4],xmm2[5],xmm0[5],xmm2[6],xmm0[6],xmm2[7],xmm0[7]
punpcklwd %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
cvtdq2pd %xmm2, %xmm0
mulpd 0x2609(%rip), %xmm0     # 0x10fc0
addpd %xmm1, %xmm0
cvtpd2ps %xmm0, %xmm0
movapd %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm1     # xmm1 = xmm1[1,1],xmm0[1,1]
xorl %ecx, %ecx
ucomiss %xmm1, %xmm0
seta %cl
negl %ecx
ucomiss %xmm0, %xmm1
pushq $0x1
popq %rax
cmovbel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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), %rdi
callq 0x88c0
leaq 0xb0(%rsp), %r13
movabsq $0x800000003, %rax      # imm = 0x800000003
movq %rax, (%r13)
leaq 0xe8(%rsp), %rbx
movq %rax, (%rbx)
andl $0x0, -0x58(%rbx)
andq $0x0, -0x60(%rbx)
movl $0x1, -0x48(%rbx)
movl %ebp, %ebp
xorl %r14d, %r14d
cmpl %r14d, %ebp
je 0xea89
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 0x4a5a
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 0x4a5a
incq %r14
jmp 0xea41
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x20(%rsp), %r9
movq %r15, %rdx
movl (%rsp), %ecx
movl 0x4(%rsp), %r8d
callq 0x8b0c
testl %eax, %eax
jne 0xeb01
leaq 0x10e2(%rip), %rsi      # 0xfb95
movq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x1180
testq %rax, %rax
je 0xeb21
movq %rax, %rbx
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
pushq $0x1
popq %rsi
movq %rax, %rcx
callq 0x11c0
movq %rbx, %rdi
callq 0x1090
leaq 0x20(%rsp), %rdi
callq 0x8927
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x84f0(%rip), %rcx      # 0x16ff8
movq (%rcx), %rbx
movl %eax, %edi
callq 0xa6d4
leaq 0x27bd(%rip), %rsi      # 0x112d6
movq %rbx, %rdi
movq %rax, %rdx
jmp 0xeb35
movq 0x84d0(%rip), %rax      # 0x16ff8
movq (%rax), %rdi
leaq 0x27bc(%rip), %rsi      # 0x112ee
movq %r14, %rdx
xorl %eax, %eax
callq 0x1100
jmp 0xeae5
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
leaq 0x2568(%rip), %rdi      # 0x11323
callq 0x1060
leaq 0x25ad(%rip), %rdi      # 0x11374
callq 0x1060
pushq $0xa
popq %rbx
movl %ebx, %edi
callq 0x1040
leaq 0x25e6(%rip), %rdi      # 0x113c3
callq 0x1060
leaq 0x25f1(%rip), %rdi      # 0x113da
callq 0x1060
leaq 0x2623(%rip), %rdi      # 0x11418
callq 0x1060
leaq 0x2648(%rip), %rdi      # 0x11449
callq 0x1060
leaq 0x2685(%rip), %rdi      # 0x11492
callq 0x1060
leaq 0x26d3(%rip), %rdi      # 0x114ec
callq 0x1060
leaq 0x2716(%rip), %rdi      # 0x1153b
callq 0x1060
leaq 0x2762(%rip), %rdi      # 0x11593
callq 0x1060
leaq 0x279a(%rip), %rdi      # 0x115d7
callq 0x1060
leaq 0x27d3(%rip), %rdi      # 0x1161c
callq 0x1060
leaq 0x2829(%rip), %rdi      # 0x1167e
callq 0x1060
leaq 0x287b(%rip), %rdi      # 0x116dc
callq 0x1060
movl %ebx, %edi
popq %rbx
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
callq 0x1050
movq %rax, %rbx
movl (%rax), %r12d
pushq $-0x1
popq %r14
pushq $0x1
popq %r15
movl %r14d, %edi
xorl %esi, %esi
movl %r15d, %edx
callq 0x1190
testl %eax, %eax
jg 0x135a
movl %r12d, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x40, %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 0xa4a(%rip), %rdi       # 0x2004
leaq -0x28(%rbp), %rbx
movq %rbx, %rcx
callq 0x1200
testl %eax, %eax
jne 0x163f
leaq 0xa9e(%rip), %r15       # 0x206f
leaq 0xa61(%rip), %r12       # 0x2039
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x166a
movl 0x4(%rbx), %edi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
callq 0x1230
movq %r15, %rdi
cmpl $-0x1, %eax
je 0x161b
movl %eax, %r14d
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movl %eax, %edi
callq 0x1180
cmpl $-0x1, %eax
jne 0x1626
movl %r14d, %edi
callq 0x1100
movq %r12, %rdi
callq 0x11a0
addq $0x28, %rbx
jmp 0x15d8
movq -0x28(%rbp), %rdi
callq 0x1220
movl %r14d, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x29b2(%rip), %rcx      # 0x3ff8
movq (%rcx), %rbx
movl %eax, %edi
callq 0x10d0
leaq 0x9b7(%rip), %rsi       # 0x200e
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1130
pushq $0x1
popq %r14
jmp 0x162f
movq 0x2987(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xa03(%rip), %rdi       # 0x207e
pushq $0x20
popq %rsi
pushq $0x1
popq %rdx
callq 0x11f0
pushq $0x2
jmp 0x1666
// File: /workspace/github_c_makefile_star2_O2/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 $0x28, %rsp
movq %rsi, -0x40(%rbp)
movq %rdi, %r14
leaq 0x7ff(%rip), %rbx       # 0x205c
leaq -0x38(%rbp), %r12
movq %rdx, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x1110
xorl %r13d, %r13d
xorl %r15d, %r15d
xorl %ecx, %ecx
testq %rax, %rax
je 0x193b
movl %ecx, -0x2c(%rbp)
cmpl $0x3, %ecx
jb 0x1912
movq %rax, %rdi
leaq 0xd40(%rip), %rsi       # 0x25d6
leaq -0x48(%rbp), %rdx
callq 0x1110
movq %rax, %r12
xorl %ebx, %ebx
testq %r12, %r12
je 0x1907
cmpl $0x1, %ebx
ja 0x1907
movq %r12, %rdi
movq %r14, %rsi
callq 0x1120
testl %eax, %eax
je 0x18d8
movq %r12, %rdi
movq -0x40(%rbp), %rsi
callq 0x1120
pushq $0x1
popq %rcx
testl %eax, %eax
je 0x18d3
movl %r15d, %ecx
movl %ecx, %r15d
jmp 0x18de
pushq $0x1
popq %rax
movl %eax, %r13d
movl %r15d, %eax
xorl $0x1, %eax
movl %r13d, %ecx
xorl $0x1, %ecx
orl %eax, %ecx
je 0x1929
xorl %edi, %edi
leaq 0xcdf(%rip), %rsi       # 0x25d6
leaq -0x48(%rbp), %rdx
callq 0x1110
movq %rax, %r12
incl %ebx
jmp 0x18a4
leaq 0x74e(%rip), %rbx       # 0x205c
leaq -0x38(%rbp), %r12
xorl %edi, %edi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x1110
movl -0x2c(%rbp), %ecx
incl %ecx
jmp 0x1877
pushq $0xb
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
imull $0xa, %r15d, %eax
addl %r13d, %eax
jmp 0x192c
// File: /workspace/github_c_makefile_star2_O2/aligrudi[P]neatmkfn/mkfn.c
// Function: mkfn_script
int mkfn_script(char *script, int nscripts)
{
	/* fill mkfn_scripts (if unspecified) in the first call */
	if (!mkfn_scripts) {
		if (nscripts == 1 || !script)
			return 1;
		if (!strcmp("DFLT", script))
			mkfn_scripts = "DFLT";
		else
			mkfn_scripts = "latn";
	}
	if (!strcmp("list", mkfn_scripts))
		printf("%s\n", script ? script : "");
	if (strchr(script, ' '))
		*strchr(script, ' ') = '\0';
	return !!strstr(mkfn_scripts, script);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %eax
movq %rdi, %rbx
movq 0x3183c(%rip), %rsi     # 0x6eb48
testq %rsi, %rsi
jne 0x3d347
cmpl $0x1, %eax
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0x3d39f
leaq 0x4d38(%rip), %r14      # 0x42060
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3d150
testl %eax, %eax
leaq 0x4d29(%rip), %rsi      # 0x42065
cmoveq %r14, %rsi
movq %rsi, 0x31801(%rip)     # 0x6eb48
leaq 0x4d1c(%rip), %rdi      # 0x4206a
callq 0x3d150
testl %eax, %eax
jne 0x3d36a
testq %rbx, %rbx
leaq 0x53a9(%rip), %rdi      # 0x4270a
cmovneq %rbx, %rdi
callq 0x3d070
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x3d0b0
testq %rax, %rax
je 0x3d37d
movb $0x0, (%rax)
movq 0x317c4(%rip), %rdi     # 0x6eb48
movq %rbx, %rsi
callq 0x3d1e0
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x1
popq %rax
jmp 0x3d397
// File: /workspace/github_c_makefile_star2_O2/aligrudi[P]neatmkfn/mkfn.c
// Function: mkfn_lang
int mkfn_lang(char *lang, int nlangs)
{
	if (!mkfn_langs)
		return 1;
	if (!lang)
		lang = "";
	if (!strcmp("list", mkfn_langs))
		printf("%s\n", lang);
	if (strchr(lang, ' '))
		*strchr(lang, ' ') = '\0';
	return !!strstr(mkfn_langs, lang);
}

// Assembly:
movq 0x317a5(%rip), %rsi     # 0x6eb50
testq %rsi, %rsi
je 0x3d406
pushq %rbx
testq %rdi, %rdi
leaq 0x534f(%rip), %rbx      # 0x4270a
cmovneq %rdi, %rbx
leaq 0x4ca4(%rip), %rdi      # 0x4206a
callq 0x3d150
testl %eax, %eax
jne 0x3d3d7
movq %rbx, %rdi
callq 0x3d070
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x3d0b0
testq %rax, %rax
je 0x3d3ea
movb $0x0, (%rax)
movq 0x3175f(%rip), %rdi     # 0x6eb50
movq %rbx, %rsi
callq 0x3d1e0
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
setne %al
popq %rbx
retq
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/aligrudi[P]neatmkfn/mkfn.c
// Function: mkfn_font
int mkfn_font(char *font)
{
	static int idx;			/* font index */
	idx++;
	if (!mkfn_subfont)
		return idx == 1;
	if (!strcmp("list", mkfn_subfont))
		printf("%s\n", font);
	if (mkfn_subfont[0] && isdigit((unsigned char) mkfn_subfont[0]))
		if (atoi(mkfn_subfont) == idx)
			return 1;
	return !strcmp(mkfn_subfont, font);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl 0x31743(%rip), %eax     # 0x6eb58
leal 0x1(%rax), %ecx
movl %ecx, 0x3173a(%rip)     # 0x6eb58
movq 0x3173b(%rip), %r14     # 0x6eb60
testq %r14, %r14
je 0x3d489
movq %rdi, %rbx
leaq 0x4c36(%rip), %rdi      # 0x4206a
movq %r14, %rsi
callq 0x3d150
testl %eax, %eax
jne 0x3d44f
movq %rbx, %rdi
callq 0x3d070
movq 0x31711(%rip), %r14     # 0x6eb60
movzbl (%r14), %r15d
testq %r15, %r15
je 0x3d47a
callq 0x3d1f0
movq (%rax), %rax
testb $0x8, 0x1(%rax,%r15,2)
je 0x3d47a
movq %r14, %rdi
callq 0x3d1b0
movb $0x1, %cl
cmpl 0x316e0(%rip), %eax     # 0x6eb58
je 0x3d48e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3d150
testl %eax, %eax
jmp 0x3d48b
testl %eax, %eax
sete %cl
movzbl %cl, %eax
popq %rbx
popq %r14
popq %r15
retq