LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_zTXt
static unsigned addChunk_zTXt(ucvector* out, const char* keyword, const char* textstring,
                              LodePNGCompressSettings* zlibsettings) {
  unsigned error = 0;
  unsigned char* chunk = 0;
  unsigned char* compressed = 0;
  size_t compressedsize = 0;
  size_t textsize = lodepng_strlen(textstring);
  size_t keysize = lodepng_strlen(keyword);
  if(keysize < 1 || keysize > 79) return 89; /*error: invalid keyword size*/

  error = zlib_compress(&compressed, &compressedsize,
                        (const unsigned char*)textstring, textsize, zlibsettings);
  if(!error) {
    size_t size = keysize + 2 + compressedsize;
    error = lodepng_chunk_init(&chunk, out, size, "zTXt");
  }
  if(!error) {
    lodepng_memcpy(chunk + 8, keyword, keysize);
    chunk[8 + keysize] = 0; /*null termination char*/
    chunk[9 + keysize] = 0; /*compression method: 0*/
    lodepng_memcpy(chunk + 10 + keysize, compressed, compressedsize);
    lodepng_chunk_generate_crc(chunk);
  }

  lodepng_free(compressed);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r8
movq %rsi, %rbx
movq %rdi, %r15
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movq %rax, 0x8(%rsp)
movq %rax, (%rsp)
movq $-0x1, %rcx
cmpb $0x0, 0x1(%rdx,%rcx)
leaq 0x1(%rcx), %rcx
jne 0xbc96
movq $-0x1, %r14
cmpb $0x0, 0x1(%rbx,%r14)
leaq 0x1(%r14), %r14
jne 0xbca8
leaq -0x50(%r14), %rax
movl $0x59, %ebp
cmpq $-0x4f, %rax
jb 0xbd56
movq 0x18(%r8), %rax
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
testq %rax, %rax
je 0xbcdc
callq *%rax
jmp 0xbce1
callq 0x53d7
movl %eax, %ebp
testl %eax, %eax
jne 0xbd4c
movl (%rsp), %eax
leal (%rax,%r14), %edx
addl $0x2, %edx
leaq 0x6fa9(%rip), %rcx      # 0x12ca1
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0xd210
movl %eax, %ebp
testl %eax, %eax
jne 0xbd4c
movq 0x10(%rsp), %r15
leaq 0x8(%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1130
movw $0x0, 0x8(%r15,%r14)
movq (%rsp), %rdx
testq %rdx, %rdx
je 0xbd42
movq 0x8(%rsp), %rsi
leaq (%r15,%r14), %rdi
addq $0xa, %rdi
callq 0x1130
movq %r15, %rdi
callq 0x568d
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
callq 0x1030
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_tEXt
static unsigned addChunk_tEXt(ucvector* out, const char* keyword, const char* textstring) {
  unsigned char* chunk = 0;
  size_t keysize = lodepng_strlen(keyword), textsize = lodepng_strlen(textstring);
  size_t size = keysize + 1 + textsize;
  if(keysize < 1 || keysize > 79) return 89; /*error: invalid keyword size*/
  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, size, "tEXt"));
  lodepng_memcpy(chunk + 8, keyword, keysize);
  chunk[8 + keysize] = 0; /*null termination char*/
  lodepng_memcpy(chunk + 9 + keysize, textstring, textsize);
  lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %rsi
movq $0x0, 0x8(%rsp)
movq $-0x1, %r14
cmpb $0x0, 0x1(%r15,%r14)
leaq 0x1(%r14), %r14
jne 0xbd89
movq $-0x1, %r12
movl %r14d, %edx
incl %edx
cmpb $0x0, 0x1(%rbx,%r12)
leaq 0x1(%r12), %r12
jne 0xbd9f
leaq -0x50(%r14), %rcx
movl $0x59, %eax
cmpq $-0x4f, %rcx
jb 0xbe0e
leaq 0x6ed8(%rip), %rcx      # 0x12c9c
leaq 0x8(%rsp), %rdi
callq 0xd210
testl %eax, %eax
jne 0xbe0e
movq 0x8(%rsp), %r13
leaq 0x8(%r13), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1130
movb $0x0, 0x8(%r13,%r14)
testq %r12, %r12
je 0xbe04
leaq (%r14,%r13), %rdi
addq $0x9, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x1130
movq %r13, %rdi
callq 0x568d
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: ucvector_resize
static unsigned ucvector_resize(ucvector* p, size_t size) {
  if(size > p->allocsize) {
    size_t newsize = size + (p->allocsize >> 1u);
    void* data = lodepng_realloc(p->data, newsize);
    if(data) {
      p->allocsize = newsize;
      p->data = (unsigned char*)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
movq 0x10(%rdi), %r15
cmpq %rsi, %r15
jae 0xc257
shrq %r15
addq %rbx, %r15
movq (%r14), %rdi
movq %r15, %rsi
callq 0x1170
testq %rax, %rax
je 0xc266
movq %r15, 0x10(%r14)
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0xc260
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: huffmanDecodeSymbol
static unsigned huffmanDecodeSymbol(LodePNGBitReader* reader, const HuffmanTree* codetree) {
  unsigned short code = peekBits(reader, FIRSTBITS);
  unsigned short l = codetree->table_len[code];
  unsigned short value = codetree->table_value[code];
  if(l <= FIRSTBITS) {
    advanceBits(reader, l);
    return value;
  } else {
    unsigned index2;
    advanceBits(reader, FIRSTBITS);
    index2 = value + peekBits(reader, l - FIRSTBITS);
    advanceBits(reader, codetree->table_len[index2] - FIRSTBITS);
    return codetree->table_value[index2];
  }
}

// Assembly:
movl 0x20(%rdi), %eax
movl %eax, %r8d
andl $0x1ff, %r8d            # imm = 0x1FF
movzbl (%rsi,%r8), %ecx
movl %r8d, %r8d
movzwl (%rdx,%r8,2), %r8d
cmpq $0x9, %rcx
ja 0xc295
shrl %cl, %eax
movl %eax, 0x20(%rdi)
addq %rcx, 0x18(%rdi)
jmp 0xc2e5
movzwl %r8w, %r9d
shrl $0x9, %eax
movl %eax, 0x20(%rdi)
movq 0x18(%rdi), %r8
leaq 0x9(%r8), %r10
addb $-0x9, %cl
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
shll %cl, %r11d
movq %r10, 0x18(%rdi)
notl %r11d
andl %eax, %r11d
addq %r9, %r11
movzbl (%rsi,%r11), %esi
movl $0xfffffff7, %ecx       # imm = 0xFFFFFFF7
addq %rsi, %rcx
movl %ecx, %esi
shrl %cl, %eax
movl %eax, 0x20(%rdi)
leaq (%rsi,%r8), %rax
addq $0x9, %rax
movq %rax, 0x18(%rdi)
movzwl (%rdx,%r11,2), %r8d
movzwl %r8w, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: writeBits
static void writeBits(LodePNGBitWriter* writer, unsigned value, size_t nbits) {
  if(nbits == 1) { /* compiler should statically compile this case if nbits == 1 */
    WRITEBIT(writer, value);
  } else {
    /* TODO: increase output size only once here rather than in each WRITEBIT */
    size_t i;
    for(i = 0; i != nbits; ++i) {
      WRITEBIT(writer, (unsigned char)((value >> i) & 1));
    }
  }
}

// Assembly:
testq %rdx, %rdx
je 0xc93b
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
cmpq $0x1, %rdx
jne 0xc8d5
movb 0x8(%rbx), %cl
andb $0x7, %cl
jne 0xc8bf
movq (%rbx), %rdi
movq 0x8(%rdi), %rsi
incq %rsi
callq 0xc226
testl %eax, %eax
je 0xc931
movq (%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movb $0x0, -0x1(%rcx,%rax)
movb 0x8(%rbx), %cl
andb $0x7, %cl
shll %cl, %ebp
movq (%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
orb %bpl, -0x1(%rcx,%rax)
incb 0x8(%rbx)
jmp 0xc931
movb 0x8(%rbx), %cl
xorl %r15d, %r15d
andb $0x7, %cl
jne 0xc908
movq (%rbx), %rdi
movq 0x8(%rdi), %rsi
incq %rsi
callq 0xc226
testl %eax, %eax
je 0xc931
movq (%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movb $0x0, -0x1(%rcx,%rax)
movb 0x8(%rbx), %cl
andb $0x7, %cl
xorl %eax, %eax
btl %r15d, %ebp
setb %al
shll %cl, %eax
movq (%rbx), %rcx
movq (%rcx), %rdx
movq 0x8(%rcx), %rcx
orb %al, -0x1(%rdx,%rcx)
movb 0x8(%rbx), %cl
incb %cl
movb %cl, 0x8(%rbx)
incq %r15
cmpq %r15, %r14
jne 0xc8db
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: writeLZ77data
static void writeLZ77data(LodePNGBitWriter* writer, const uivector* lz77_encoded,
                          const HuffmanTree* tree_ll, const HuffmanTree* tree_d) {
  size_t i = 0;
  for(i = 0; i != lz77_encoded->size; ++i) {
    unsigned val = lz77_encoded->data[i];
    writeBitsReversed(writer, tree_ll->codes[val], tree_ll->lengths[val]);
    if(val > 256) /*for a length code, 3 more things have to be added*/ {
      unsigned length_index = val - FIRST_LENGTH_CODE_INDEX;
      unsigned n_length_extra_bits = LENGTHEXTRA[length_index];
      unsigned length_extra_bits = lz77_encoded->data[++i];

      unsigned distance_code = lz77_encoded->data[++i];

      unsigned distance_index = distance_code;
      unsigned n_distance_extra_bits = DISTANCEEXTRA[distance_index];
      unsigned distance_extra_bits = lz77_encoded->data[++i];

      writeBits(writer, length_extra_bits, n_length_extra_bits);
      writeBitsReversed(writer, tree_d->codes[distance_code], tree_d->lengths[distance_code]);
      writeBits(writer, distance_extra_bits, n_distance_extra_bits);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x8(%rsp)
cmpq $0x0, 0x8(%rsi)
je 0xd06f
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebx, %ebx
movq (%r15), %rax
movl (%rax,%rbx,4), %r13d
movq (%r14), %rax
movq 0x8(%r14), %rcx
movl (%rax,%r13,4), %esi
movl (%rcx,%r13,4), %edx
movq %r12, %rdi
callq 0xd07e
cmpq $0x101, %r13            # imm = 0x101
jb 0xd062
addl $0xfffffeff, %r13d      # imm = 0xFFFFFEFF
leaq 0x585f(%rip), %rax      # 0x12860
movl (%rax,%r13,4), %edx
movq (%r15), %rax
movl 0x4(%rax,%rbx,4), %esi
movq %r14, %r13
movl 0x8(%rax,%rbx,4), %r14d
leaq 0x5945(%rip), %rcx      # 0x12960
movl (%rcx,%r14,4), %ecx
movq %rcx, 0x10(%rsp)
movl 0xc(%rax,%rbx,4), %ebp
addq $0x3, %rbx
movq %r12, %rdi
callq 0xc86d
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
movl (%rax,%r14,4), %esi
movl (%rcx,%r14,4), %edx
movq %r13, %r14
movq %r12, %rdi
callq 0xd07e
movq %r12, %rdi
movl %ebp, %esi
movq 0x10(%rsp), %rdx
callq 0xc86d
incq %rbx
cmpq 0x8(%r15), %rbx
jne 0xcfcc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xd170
shrq %r15
addq %rax, %r15
movq (%r14), %rdi
movq %r15, %rsi
callq 0x1170
testq %rax, %rax
je 0xd17f
movq %r15, 0x10(%r14)
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0xd179
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x1, %r12d
xorl %eax, %eax
leaq (%r15,%rax), %rsi
leaq -0x4(%rcx), %rdi
decq %r12
cmpq %rdx, %rsi
jbe 0xd1c5
decq %rax
cmpl $0x0, -0x8(%r14,%rcx)
movq %rdi, %rcx
je 0xd1a7
callq 0x1140
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0xd202
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 0x2c12
testl %eax, %eax
jne 0xd207
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xc482
movl $0x53, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x4d, %eax
addq %r13, %rbp
jb 0xd282
subq $-0xc, %rbp
jae 0xd282
movq %rcx, %r14
movl %edx, %ebx
movq %rsi, %r12
movq %rdi, %r15
movq %rsi, %rdi
movq %rbp, %rsi
callq 0xc226
testl %eax, %eax
je 0xd27d
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), %rax
movl (%r14), %ecx
movl %ecx, 0x4(%rax)
xorl %eax, %eax
jmp 0xd282
movl $0x53, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xd3d2
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), %rdi
movq (%rbx), %rbp
movq %rdi, (%rsp)
movq %rbp, 0x8(%rsp)
movq %rbp, 0x10(%rsp)
testq %rdx, %rdx
je 0xd418
addq %rbp, %rdx
cmpq %rdx, %rbp
jae 0xd410
shrq %rbp
addq %rdx, %rbp
movq %rbp, %rsi
callq 0x1170
testq %rax, %rax
je 0xd410
movq %rbp, 0x10(%rsp)
movq %rax, (%rsp)
movq (%rbx), %rax
movq %rax, 0x8(%rsp)
movq %rsp, %rbp
movq %rbp, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x5272
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_O3/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 0x4c73(%rip), %r15      # 0x12a30
leaq 0x4c8c(%rip), %r12      # 0x12a50
leaq 0x4ca5(%rip), %r13      # 0x12a70
leaq 0x4cbe(%rip), %rbp      # 0x12a90
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 0xde1c
movl $0x0, (%rdi,%r14)
addq $0x4, %r14
cmpq $0x1c, %r14
jne 0xddd2
xorl %eax, %eax
movq %rax, (%r8)
movq %rax, (%rcx)
movq %rax, (%r10)
movl 0x40(%rsp), %ebp
movl (%rdi,%rax), %edx
movl (%rsi,%rax), %r9d
testl %edx, %edx
je 0xde5b
testl %r9d, %r9d
je 0xde58
movl %edx, %ebx
imull %ebp, %ebx
addl $0x7, %ebx
shrl $0x3, %ebx
incl %ebx
imull %r9d, %ebx
jmp 0xde5d
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
cmpq $0x1c, %rax
jne 0xde35
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xe997
testb %al, %al
je 0xe93a
movq %rsp, %r13
xorl %ebp, %ebp
jmp 0xe94f
leaq 0x8(%rsp), %r13
leaq 0x56af(%rip), %rax      # 0x13ff5
movq %rax, -0x8(%r13)
movl $0x1, %ebp
movq %r15, %rdi
callq 0xe997
leaq 0x1(%rbp), %rcx
testb %al, %al
jne 0xe96e
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 0xe9f0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xeee6
movq (%r14), %rax
testq %rax, %rax
je 0xe9e6
movl 0xa769(%rip), %ecx      # 0x19120
leaq 0xa282(%rip), %rdx      # 0x18c40
movq (%rdx,%rcx,8), %rcx
movb (%rcx), %sil
testb %sil, %sil
je 0xe9e6
movb -0x1(%rbx,%rax), %dl
incq %rcx
cmpb %dl, %sil
sete %al
je 0xe9e8
movb (%rcx), %sil
incq %rcx
testb %sil, %sil
jne 0xe9d1
jmp 0xe9e8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xa234(%rip), %eax      # 0x19120
testq %rax, %rax
je 0xf0e9
leaq 0x9d44(%rip), %rcx      # 0x18c40
movq (%rcx,%rax,8), %rcx
movb (%rcx), %dl
testb %dl, %dl
je 0xef1e
movb (%rdi), %dil
incq %rcx
xorl %eax, %eax
cmpb %dil, %dl
je 0xef22
movb (%rcx), %dl
incq %rcx
testb %dl, %dl
jne 0xef0e
jmp 0xef27
xorl %eax, %eax
jmp 0xef27
movl $0x1, %eax
movq %rax, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/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, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpl $0x1, 0xa1da(%rip)      # 0x19120
jne 0xef5a
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1050
testl %eax, %eax
jmp 0xefae
movb (%r15), %bpl
testb %bpl, %bpl
je 0xef9c
xorl %r12d, %r12d
movsbq (%r14,%r12), %r13
testq %r13, %r13
je 0xefab
cmpq %r12, %rbx
je 0xefab
callq 0x1200
movq (%rax), %rax
movsbq %bpl, %rcx
movl (%rax,%rcx,4), %ecx
cmpl (%rax,%r13,4), %ecx
jne 0xefc0
movb 0x1(%r15,%r12), %bpl
incq %r12
testb %bpl, %bpl
jne 0xef65
addq %r12, %r14
subq %r12, %rbx
testq %rbx, %rbx
je 0xefa7
cmpb $0x0, (%r14)
jmp 0xefae
movb $0x1, %al
jmp 0xefb1
cmpq %r12, %rbx
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0xefb1
// File: /workspace/github_c_makefile_star2_O3/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 0xf022
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0xeee6
movq (%rsp), %rsi
addq %r12, %rsi
movq %r12, %rdi
movq %rbx, %rdx
callq 0xfa98
testb %al, %al
jne 0xf024
movq 0x30(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x30(%rbx)
movq 0x8(%r14,%rcx,8), %r12
testq %r12, %r12
jne 0xefe9
jmp 0xf024
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xeee6
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 0xf28a
addq %rcx, %rbp
leaq (%r14,%r13), %rdi
movq %rbp, %rsi
callq 0x1180
cmpq %rbx, %r13
cmovaeq %rbx, %r13
testq %r13, %r13
je 0xf2a4
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x1180
testq %rbx, %rbx
je 0xf2bc
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_O3/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 0xeee6
movq (%r15), %rsi
addq %r14, %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0xfa98
movl %eax, %ebp
testb %al, %al
je 0xf348
movq %rbx, %rdi
callq 0xfb19
jmp 0xf33a
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x9c78(%rip), %eax      # 0x19120
leaq 0x9791(%rip), %rcx      # 0x18c40
movq (%rcx,%rax,8), %rcx
movb (%rcx), %sil
testb %sil, %sil
je 0xf4d4
movb (%rdi), %dl
incq %rcx
cmpb %dl, %sil
sete %al
je 0xf4d3
movb (%rcx), %sil
incq %rcx
testb %sil, %sil
jne 0xf4c0
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xf30f
testb %al, %al
je 0xf6c3
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rax
cmpq %rdx, %rax
jb 0xf6c3
xorl %ecx, %ecx
cmpb $0x2e, (%rax,%rcx)
je 0xf6cd
leaq (%rax,%rcx), %rsi
decq %rsi
decq %rcx
cmpq %rdx, %rsi
jae 0xf6ae
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 0xf6c5
// File: /workspace/github_c_makefile_star2_O3/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)
movb (%rsi), %al
testb %al, %al
je 0xfb16
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl 0x966b(%rip), %ecx      # 0x19120
leaq 0x9184(%rip), %rdx      # 0x18c40
movq (%rdx,%rcx,8), %rcx
movb (%rcx), %dl
incq %rcx
movq %rcx, %rdi
movl %edx, %r8d
testb %dl, %dl
je 0xfaf2
cmpb %al, %r8b
je 0xfae1
movb (%rdi), %r8b
incq %rdi
testb %r8b, %r8b
jne 0xfacf
jmp 0xfaef
movb 0x1(%rsi), %al
incq %rsi
testb %al, %al
jne 0xfac5
xorl %eax, %eax
jmp 0xfb0e
movq %rsi, %r14
movq %r14, 0x10(%rbx)
movq %r14, %rdi
callq 0xfbcb
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
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x10(%rdi), %r14
movq 0x20(%rdi), %rsi
movb (%r14,%rsi), %dl
testb %dl, %dl
je 0xfbc1
movl 0x95e9(%rip), %eax      # 0x19120
leaq 0x9102(%rip), %rcx      # 0x18c40
movq (%rcx,%rax,8), %rax
movb (%rax), %cl
testb %cl, %cl
je 0xfb64
movq %rdi, %rbx
addq %rsi, %r14
leaq 0x1(%rax), %rsi
movl %ecx, %edi
cmpb %dl, %dil
je 0xfb83
movb (%rsi), %dil
incq %rsi
testb %dil, %dil
jne 0xfb54
leaq 0x4365(%rip), %rdi      # 0x13ed0
leaq 0x4377(%rip), %rsi      # 0x13ee9
leaq 0x4382(%rip), %rcx      # 0x13efb
movl $0x4c9, %edx            # imm = 0x4C9
callq 0x10d0
incq %rax
movb 0x1(%r14), %dl
incq %r14
movq %rax, %rsi
movl %ecx, %edi
cmpb %dl, %dil
je 0xfb86
movb (%rsi), %dil
incq %rsi
testb %dil, %dil
jne 0xfb92
testb %dl, %dl
je 0xfbc1
movq %r14, 0x10(%rbx)
movq %r14, %rdi
callq 0xfbcb
movq %rax, 0x18(%rbx)
subq %r14, %rax
movq %rax, 0x20(%rbx)
movb $0x1, %al
jmp 0xfbc3
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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), %cl
testb %cl, %cl
je 0xfc10
movl 0x9546(%rip), %edx      # 0x19120
leaq 0x905f(%rip), %rsi      # 0x18c40
movq (%rsi,%rdx,8), %rdx
movb (%rdx), %sil
incq %rdx
movq %rdx, %rdi
movl %esi, %r8d
testb %sil, %sil
je 0xfc06
cmpb %cl, %r8b
je 0xfc10
movb (%rdi), %r8b
incq %rdi
testb %r8b, %r8b
jne 0xfbf6
movb 0x1(%rax), %cl
incq %rax
testb %cl, %cl
jne 0xfbeb
retq
// File: /workspace/github_c_makefile_star2_O3/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), %r8
movq 0x10(%rdi), %rcx
cmpq %r8, %rcx
jbe 0xfc77
pushq %rbp
pushq %r14
pushq %rbx
leaq -0x1(%rcx), %rdx
movl 0x94f4(%rip), %eax      # 0x19120
leaq 0x900d(%rip), %rsi      # 0x18c40
movq (%rsi,%rax,8), %rsi
movb (%rsi), %r9b
leaq 0x1(%rsi), %r10
movq %rdx, %r14
movq %rcx, %r11
testb %r9b, %r9b
je 0xfc80
movq %r14, %rbx
movb (%r14), %al
movq %r10, %r14
movl %r9d, %ebp
cmpb %al, %bpl
je 0xfc67
movb (%r14), %bpl
incq %r14
testb %bpl, %bpl
jne 0xfc55
jmp 0xfc7a
leaq -0x1(%rbx), %r14
xorl %eax, %eax
movq %rbx, %r11
cmpq %r8, %r14
jae 0xfc44
jmp 0xfce3
xorl %eax, %eax
retq
movq %rbx, %rdx
movq %r11, %rcx
movq %rcx, 0x18(%rdi)
cmpq %r8, %rdx
jbe 0xfcb7
movb (%rsi), %al
leaq 0x1(%rsi), %r9
testb %al, %al
je 0xfcaa
movb (%rdx), %r10b
movq %r9, %r11
movl %eax, %ebx
cmpb %r10b, %bl
je 0xfcb9
movb (%r11), %bl
incq %r11
testb %bl, %bl
jne 0xfc9b
decq %rdx
cmpq %r8, %rdx
ja 0xfc8f
movq %r8, %rdx
jmp 0xfcb9
movb (%rsi), %al
testb %al, %al
je 0xfcd6
movb (%rdx), %r8b
incq %rsi
cmpb %r8b, %al
je 0xfcd3
movb (%rsi), %al
incq %rsi
testb %al, %al
jne 0xfcc3
jmp 0xfcd6
incq %rdx
movq %rdx, 0x10(%rdi)
subq %rdx, %rcx
movq %rcx, 0x20(%rdi)
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x40, %rsp
movl %esi, %ebx
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 0xfce8
cmpl $0x1, %eax
je 0xfe22
cmpl $0x2, %eax
sete %cl
testb %bl, %cl
je 0xfe30
movb $0x1, %bpl
movl %ebp, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
cmpl $0x2, %eax
jne 0xfee1
movq 0x28(%rsp), %rax
xorl %r14d, %r14d
cmpq $0x0, (%rax)
je 0xff21
movq %rsp, %rbx
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0xfc11
testb %al, %al
jne 0xfeab
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0xff21
movq %rax, %rcx
decq %rcx
movq %rcx, 0x30(%rsp)
movq 0x28(%rsp), %rcx
je 0xfe92
movq -0x8(%rcx,%rax,8), %rdi
movq %rdi, %rsi
movq %rbx, %rdx
callq 0xfa98
testb %al, %al
je 0xfe5c
jmp 0xfe9f
movq (%rcx), %rdi
movq %rbx, %rsi
callq 0xf30f
jmp 0xfe58
movq %rbx, %rdi
callq 0xfb19
testb %al, %al
jne 0xfe9f
movq %rbx, %rdi
callq 0xfce8
cmpl $0x2, %eax
je 0xfeca
testl %eax, %eax
jne 0xfecd
testl %r14d, %r14d
jns 0xfe22
incl %r14d
jmp 0xfecd
decl %r14d
movq 0x28(%rsp), %rax
cmpq $0x0, (%rax)
jne 0xfe50
jmp 0xfe25
movq %rsp, %rdi
callq 0xf064
xorl %ebp, %ebp
testb %al, %al
je 0xfe25
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xfce8
cmpl $0x2, %eax
je 0xff0b
testl %eax, %eax
jne 0xff15
incl %ebp
jmp 0xff15
testl %ebp, %ebp
jle 0xfe22
decl %ebp
movq %rbx, %rdi
callq 0xf064
testb %al, %al
jne 0xfef6
xorl %ebp, %ebp
jmp 0xfe25
// File: /workspace/github_c_makefile_star2_O3/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), %r15
leaq 0xc(%rdi), %r14
movq %r15, %rsi
movq %r14, %rdx
callq 0xa1cb
movq (%rbx), %rdi
testl %eax, %eax
je 0xff8f
movl $0x1, %ebp
testq %rdi, %rdi
je 0x1008a
callq 0x1030
movq $0x0, (%rbx)
jmp 0x1008a
testq %rdi, %rdi
je 0x10085
movl (%r14), %ecx
testl %ecx, %ecx
je 0x10081
movl (%r15), %edx
xorl %eax, %eax
movss 0x20f0(%rip), %xmm0     # 0x120a0
movl %edx, %esi
testl %esi, %esi
je 0x10075
xorl %ecx, %ecx
movq (%rbx), %rdi
imull %eax, %esi
addl %ecx, %esi
shll $0x2, %esi
movb 0x3(%rdi,%rsi), %r8b
cmpb $-0x1, %r8b
je 0x10062
movzbl %r8b, %edx
xorps %xmm1, %xmm1
cvtsi2ss %edx, %xmm1
movl %esi, %edx
movzbl (%rdi,%rdx), %esi
xorps %xmm2, %xmm2
cvtsi2ss %esi, %xmm2
divss %xmm0, %xmm1
mulss %xmm1, %xmm2
cvttss2si %xmm2, %esi
movb %sil, (%rdi,%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)
movl 0x8(%rbx), %edx
incl %ecx
movl %edx, %esi
cmpl %edx, %ecx
jb 0xffbc
movl (%r14), %ecx
movl %edx, %esi
jmp 0x10077
xorl %esi, %esi
incl %eax
cmpl %ecx, %eax
jb 0xffb2
xorl %ebp, %ebp
jmp 0x1008a
movl $0x1, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x336c(%rip), %xmm2     # 0x14090
cvtdq2ps %xmm1, %xmm1
mulps 0x3372(%rip), %xmm1     # 0x140a0
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 0x335b(%rip), %xmm0     # 0x140b0
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
movl $0x1, %eax
cmovbel %ecx, %eax
retq