LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_IDAT(ucvector*, unsigned char const*, unsigned long, LodePNGCompressSettings*)
static unsigned addChunk_IDAT(ucvector* out, const unsigned char* data, size_t datasize,
                              LodePNGCompressSettings* zlibsettings) {
  unsigned error = 0;
  unsigned char* zlib = 0;
  size_t pos = 0;
  size_t zlibsize = 0;
  /* max chunk length allowed by the specification is 2147483647 bytes */
  const size_t max_chunk_length = 2147483647u;

  error = zlib_compress(&zlib, &zlibsize, data, datasize, zlibsettings);
  while(!error) {
    if(zlibsize - pos > max_chunk_length) {
      error = lodepng_chunk_createv(out, max_chunk_length, "IDAT", zlib + pos);
      pos += max_chunk_length;
    } else {
      error = lodepng_chunk_createv(out, zlibsize - pos, "IDAT", zlib + pos);
      break;
    }
  }
  lodepng_free(zlib);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r8
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %rbx
xorl %eax, %eax
movq %rsp, %rdi
movq %rax, (%rdi)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
callq 0xd16b
testl %eax, %eax
jne 0xc83f
xorl %r15d, %r15d
leaq 0x693b4(%rip), %r14     # 0x75ba2
xorl %r12d, %r12d
movq 0x8(%rsp), %rsi
addq %r15, %rsi
movq %rsi, %rax
shrq $0x1f, %rax
movq (%rsp), %rcx
addq %r12, %rcx
testq %rax, %rax
je 0xc830
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq %rbx, %rdi
movq %r14, %rdx
callq 0x523c
addq $0x7fffffff, %r12       # imm = 0x7FFFFFFF
addq $-0x7fffffff, %r15      # imm = 0x80000001
testl %eax, %eax
je 0xc7f1
jmp 0xc83f
leaq 0x6936b(%rip), %rdx     # 0x75ba2
movq %rbx, %rdi
callq 0x523c
movl %eax, %ebp
movq (%rsp), %rdi
callq 0x2290
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_tIME(ucvector*, LodePNGTime const*)
static unsigned addChunk_tIME(ucvector* out, const LodePNGTime* time) {
  unsigned char* chunk;
  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 7, "tIME"));
  chunk[8] = (unsigned char)(time->year >> 8);
  chunk[9] = (unsigned char)(time->year & 255);
  chunk[10] = (unsigned char)time->month;
  chunk[11] = (unsigned char)time->day;
  chunk[12] = (unsigned char)time->hour;
  chunk[13] = (unsigned char)time->minute;
  chunk[14] = (unsigned char)time->second;
  lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %rsi
leaq 0x67f0b(%rip), %rcx     # 0x74776
leaq 0x8(%rsp), %rdi
movl $0x7, %edx
callq 0xe9f0
testl %eax, %eax
jne 0xc8b3
movb 0x1(%rbx), %al
movq 0x8(%rsp), %rdi
movb %al, 0x8(%rdi)
movb (%rbx), %al
movb %al, 0x9(%rdi)
movb 0x4(%rbx), %al
movb %al, 0xa(%rdi)
movb 0x8(%rbx), %al
movb %al, 0xb(%rdi)
movb 0xc(%rbx), %al
movb %al, 0xc(%rdi)
movb 0x10(%rbx), %al
movb %al, 0xd(%rdi)
movb 0x14(%rbx), %al
movb %al, 0xe(%rdi)
callq 0x4f2f
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_zTXt(ucvector*, char const*, char const*, LodePNGCompressSettings*)
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 0xc8e3
movq $-0x1, %r14
cmpb $0x0, 0x1(%rbx,%r14)
leaq 0x1(%r14), %r14
jne 0xc8f5
leaq -0x50(%r14), %rax
movl $0x59, %ebp
cmpq $-0x4f, %rax
jb 0xc99b
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0xd16b
movl %eax, %ebp
testl %eax, %eax
jne 0xc949
movq (%rsp), %rax
leaq (%rax,%r14), %rdx
addq $0x2, %rdx
leaq 0x67e32(%rip), %rcx     # 0x7476c
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0xe9f0
movl %eax, %ebp
testl %ebp, %ebp
jne 0xc991
movq 0x10(%rsp), %r15
testq %r14, %r14
je 0xc966
leaq 0x8(%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x21d0
movw $0x0, 0x8(%r15,%r14)
movq (%rsp), %rdx
testq %rdx, %rdx
je 0xc989
movq 0x8(%rsp), %rsi
leaq (%r15,%r14), %rdi
addq $0xa, %rdi
callq 0x21d0
movq %r15, %rdi
callq 0x4f2f
movq 0x8(%rsp), %rdi
callq 0x2290
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_tEXt(ucvector*, char const*, char const*)
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 0xc9ce
movq $-0x1, %r12
movq %r14, %rdx
incq %rdx
cmpb $0x0, 0x1(%rbx,%r12)
leaq 0x1(%r12), %r12
jne 0xc9e4
leaq -0x50(%r14), %rcx
movl $0x59, %eax
cmpq $-0x4f, %rcx
jb 0xca59
leaq 0x67d5d(%rip), %rcx     # 0x74767
leaq 0x8(%rsp), %rdi
callq 0xe9f0
testl %eax, %eax
jne 0xca59
movq 0x8(%rsp), %r13
testq %r14, %r14
je 0xca31
leaq 0x8(%r13), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x21d0
movb $0x0, 0x8(%r13,%r14)
testq %r12, %r12
je 0xca4f
leaq (%r14,%r13), %rdi
addq $0x9, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x21d0
movq %r13, %rdi
callq 0x4f2f
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng.cpp
// Function: lodepng::load_file(std::vector<unsigned char, std::allocator<unsigned char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
unsigned load_file(std::vector<unsigned char>& buffer, const std::string& filename) {
  unsigned error;
  FILE* file = fopen(filename.c_str(), "rb");
  if(!file) return 78;
  error = load_file_(buffer, file);
  fclose(file);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rsi), %rdi
leaq 0x6782d(%rip), %rsi     # 0x7474d
callq 0x2280
testq %rax, %rax
je 0xcf7e
movq %rax, %rbx
movq %rax, %rdi
callq 0xd8f9
testq %rax, %rax
js 0xcf85
movq %rax, %r15
xorl %ebp, %ebp
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x10b40
testq %r15, %r15
je 0xcf8a
movq (%r14), %rdi
movq 0x8(%r14), %rdx
subq %rdi, %rdx
movl $0x1, %esi
movq %rbx, %rcx
callq 0x22d0
movq 0x8(%r14), %rcx
subq (%r14), %rcx
xorl %edx, %edx
cmpq %rcx, %rax
movl $0x4e, %ebp
cmovel %edx, %ebp
jmp 0xcf8a
movl $0x4e, %ebp
jmp 0xcf92
movl $0x4e, %ebp
movq %rbx, %rdi
callq 0x2220
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng.cpp
// Function: lodepng::decompress(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned char const*, unsigned long, LodePNGDecompressSettings const&)
unsigned decompress(std::vector<unsigned char>& out, const unsigned char* in, size_t insize,
                    const LodePNGDecompressSettings& settings) {
  unsigned char* buffer = 0;
  size_t buffersize = 0;
  unsigned error = zlib_decompress(&buffer, &buffersize, 0, in, insize, &settings);
  if(buffer) {
    out.insert(out.end(), buffer, &buffer[buffersize]);
    lodepng_free(buffer);
  }
  return error;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r9
movq %rdx, %r8
movq %rsi, %rcx
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %rsp, %rsi
movq %rax, (%rsi)
movq %r14, %rdi
xorl %edx, %edx
callq 0xd01a
movl %eax, %ebp
movq (%r14), %rdx
testq %rdx, %rdx
je 0xd00f
movq 0x8(%rbx), %rsi
movq (%rsp), %rcx
addq %rdx, %rcx
movq %rbx, %rdi
callq 0x10d3e
movq 0x8(%rsp), %rdi
callq 0x2290
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng.cpp
// Function: zlib_decompress(unsigned char**, unsigned long*, unsigned long, unsigned char const*, unsigned long, LodePNGDecompressSettings const*)
static unsigned zlib_decompress(unsigned char** out, size_t* outsize, size_t expected_size,
                                const unsigned char* in, size_t insize, const LodePNGDecompressSettings* settings) {
  unsigned error;
  if(settings->custom_zlib) {
    error = settings->custom_zlib(out, outsize, in, insize, settings);
    if(error) {
      /*the custom zlib is allowed to have its own error codes, however, we translate it to code 110*/
      error = 110;
      /*if there's a max output size, and the custom zlib returned error, then indicate that error instead*/
      if(settings->max_output_size && *outsize > settings->max_output_size) error = 109;
    }
  } else {
    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, %r12
movq %rcx, %r13
movq %rsi, %rbx
movq %rdi, %r15
movq 0x10(%r9), %rax
testq %rax, %rax
je 0xd06f
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq %r14, %r8
callq *%rax
testl %eax, %eax
je 0xd0dd
movq 0x8(%r14), %rax
testq %rax, %rax
je 0xd0e1
cmpq (%rbx), %rax
movl $0x6e, %eax
sbbl $0x0, %eax
jmp 0xd0e6
movq (%r15), %rdi
movq (%rbx), %rbp
movq %rdi, (%rsp)
movq %rbp, 0x8(%rsp)
movq %rbp, 0x10(%rsp)
testq %rdx, %rdx
je 0xd0b9
addq %rbp, %rdx
movq %rdx, 0x8(%rsp)
cmpq %rdx, %rbp
jae 0xd0b1
shrq %rbp
addq %rdx, %rbp
movq %rbp, %rsi
callq 0x2350
testq %rax, %rax
je 0xd0b1
movq %rbp, 0x10(%rsp)
movq %rax, (%rsp)
movq (%rbx), %rax
movq %rax, 0x8(%rsp)
movq %rsp, %rbp
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x4a3a
movq (%rbp), %rcx
movq %rcx, (%r15)
movq 0x8(%rbp), %rcx
movq %rcx, (%rbx)
jmp 0xd0e6
xorl %eax, %eax
jmp 0xd0e6
movl $0x6e, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng.cpp
// Function: lodepng::compress(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned char const*, unsigned long, LodePNGCompressSettings const&)
unsigned compress(std::vector<unsigned char>& out, const unsigned char* in, size_t insize,
                  const LodePNGCompressSettings& settings) {
  unsigned char* buffer = 0;
  size_t buffersize = 0;
  unsigned error = zlib_compress(&buffer, &buffersize, in, insize, &settings);
  if(buffer) {
    out.insert(out.end(), buffer, &buffer[buffersize]);
    lodepng_free(buffer);
  }
  return error;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r8
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %rsp, %rsi
movq %rax, (%rsi)
movq %r14, %rdi
callq 0xd16b
movl %eax, %ebp
movq (%r14), %rdx
testq %rdx, %rdx
je 0xd160
movq 0x8(%rbx), %rsi
movq (%rsp), %rcx
addq %rdx, %rcx
movq %rbx, %rdi
callq 0x10d3e
movq 0x8(%rsp), %rdi
callq 0x2290
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng.cpp
// Function: lodepng_filesize(_IO_FILE*)
static long lodepng_filesize(FILE* file) {
  long size;
  if(fseek(file, 0, SEEK_END) != 0) return -1;
  size = ftell(file);
  /* It may give LONG_MAX as directory size, this is invalid for us. */
  if(size == LONG_MAX) return -1;
  if(fseek(file, 0, SEEK_SET) != 0) return -1;
  return size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
xorl %esi, %esi
movl $0x2, %edx
callq 0x2260
movq $-0x1, %rbx
testl %eax, %eax
jne 0xd948
movq %r14, %rdi
callq 0x2030
movq %rax, %r15
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rax, %r15
je 0xd948
xorl %ebx, %ebx
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2260
negl %eax
sbbq %rbx, %rbx
orq %r15, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng.cpp
// Function: ucvector_reserve(ucvector*, unsigned long)
static unsigned ucvector_reserve(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*/
  }
  return 1; /*success*/
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x10(%rdi), %r15
movl $0x1, %ebx
cmpq %rsi, %r15
jae 0xd988
movq %rdi, %r14
shrq %r15
addq %rsi, %r15
movq (%rdi), %rdi
movq %r15, %rsi
callq 0x2350
testq %rax, %rax
je 0xd986
movq %r15, 0x10(%r14)
movq %rax, (%r14)
jmp 0xd988
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng.cpp
// Function: huffmanDecodeSymbol(LodePNGBitReader*, HuffmanTree const*)
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 {
    advanceBits(reader, FIRSTBITS);
    value += peekBits(reader, l - FIRSTBITS);
    advanceBits(reader, codetree->table_len[value] - FIRSTBITS);
    return codetree->table_value[value];
  }
}

// Assembly:
movl 0x20(%rdi), %eax
movl %eax, %r9d
andl $0x1ff, %r9d            # imm = 0x1FF
movq 0x18(%rsi), %r8
movq 0x20(%rsi), %rdx
movzbl (%r8,%r9), %ecx
movl %r9d, %esi
movzwl (%rdx,%rsi,2), %esi
cmpq $0x9, %rcx
ja 0xd9c2
shrl %cl, %eax
movl %eax, 0x20(%rdi)
addq %rcx, 0x18(%rdi)
jmp 0xda11
shrl $0x9, %eax
movl %eax, 0x20(%rdi)
movq 0x18(%rdi), %r9
leaq 0x9(%r9), %r10
movq %r10, 0x18(%rdi)
addb $-0x9, %cl
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
shll %cl, %r10d
notl %r10d
andl %eax, %r10d
addl %r10d, %esi
movzwl %si, %esi
movzbl (%r8,%rsi), %r8d
movl $0xfffffff7, %ecx       # imm = 0xFFFFFFF7
addq %r8, %rcx
movl %ecx, %r8d
shrl %cl, %eax
movl %eax, 0x20(%rdi)
leaq (%r8,%r9), %rax
addq $0x9, %rax
movq %rax, 0x18(%rdi)
movzwl (%rdx,%rsi,2), %esi
movzwl %si, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng.cpp
// Function: writeLZ77data(LodePNGBitWriter*, uivector const*, HuffmanTree const*, HuffmanTree const*)
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 0xe83f
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 0xe84e
cmpq $0x101, %r13            # imm = 0x101
jb 0xe832
addl $0xfffffeff, %r13d      # imm = 0xFFFFFEFF
leaq 0x65b1f(%rip), %rax     # 0x742f0
movl (%rax,%r13,4), %edx
movq (%r15), %rax
movl 0x4(%rax,%rbx,4), %esi
movq %r14, %r13
movl 0x8(%rax,%rbx,4), %r14d
leaq 0x65c05(%rip), %rcx     # 0x743f0
movl (%rcx,%r14,4), %ecx
movq %rcx, 0x10(%rsp)
movl 0xc(%rax,%rbx,4), %ebp
addq $0x3, %rbx
movq %r12, %rdi
callq 0xdfde
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 0xe84e
movq %r12, %rdi
movl %ebp, %esi
movq 0x10(%rsp), %rdx
callq 0xdfde
incq %rbx
cmpq 0x8(%r15), %rbx
jne 0xe79c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng.cpp
// Function: uivector_resize(uivector*, unsigned long)
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 0xe950
shrq %r15
addq %rax, %r15
movq (%r14), %rdi
movq %r15, %rsi
callq 0x2350
testq %rax, %rax
je 0xe95f
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 0xe959
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng.cpp
// Function: HuffmanTree_makeFromFrequencies(HuffmanTree*, unsigned int const*, unsigned long, unsigned long, unsigned int)
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 0xe9a5
decq %rax
cmpl $0x0, -0x8(%r14,%rcx)
movq %rdi, %rcx
je 0xe987
callq 0x22a0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0xe9e2
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 0x2701
testl %eax, %eax
jne 0xe9e7
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xdba2
movl $0x53, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng.cpp
// Function: lodepng_chunk_init(unsigned char**, ucvector*, unsigned long, char const*)
static unsigned lodepng_chunk_init(unsigned char** chunk,
                                   ucvector* out,
                                   size_t 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, (unsigned)length);

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

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x8(%rsi), %rbp
movl $0x4d, %eax
addq %rdx, %rbp
jb 0xea61
subq $-0xc, %rbp
jae 0xea61
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
movq %rbp, 0x8(%rsi)
movq %rsi, %rdi
movq %rbp, %rsi
callq 0xd951
testl %eax, %eax
je 0xea5c
addq (%r12), %rbp
subq %rbx, %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 0xea61
movl $0x53, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::getPNGHeaderInfo(std::vector<unsigned char, std::allocator<unsigned char>> const&)
LodePNGInfo getPNGHeaderInfo(const std::vector<unsigned char>& png) {
  unsigned w, h;
  lodepng::State state;
  lodepng_inspect(&w, &h, &state, png.empty() ? NULL : &png[0], png.size());
  return state.info_png;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x290, %rsp            # imm = 0x290
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0xd1a0
movq (%r14), %rax
movq 0x8(%r14), %r8
xorl %ecx, %ecx
subq %rax, %r8
cmovneq %rax, %rcx
leaq 0xc(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %r15, %rdx
callq 0x7c69
leaq 0xe0(%rsp), %rsi
movl $0x1a8, %edx            # imm = 0x1A8
movq %rbx, %rdi
callq 0x21d0
leaq 0x10(%rsp), %rdi
callq 0xd1c8
movq %rbx, %rax
addq $0x290, %rsp            # imm = 0x290
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xd1c8
movq %rbx, %rdi
callq 0x23b0
movq %rax, %rdi
callq 0x14f59
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::getChunkInfo(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, std::vector<unsigned long, std::allocator<unsigned long>>&, std::vector<unsigned char, std::allocator<unsigned char>> const&)
unsigned getChunkInfo(std::vector<std::string>& names, std::vector<size_t>& sizes,
                      const std::vector<unsigned char>& png) {
  // Listing chunks is based on the original file, not the decoded png info.
  const unsigned char *chunk, *end;
  end = &png.back() + 1;
  chunk = &png.front() + 8;

  while(chunk < end && end - chunk >= 8) {
    char type[5];
    lodepng_chunk_type(type, chunk);
    if(std::string(type).size() != 4) return 1;

    unsigned length = lodepng_chunk_length(chunk);
    names.push_back(type);
    sizes.push_back(length);
    chunk = lodepng_chunk_next_const(chunk, end);
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, 0x30(%rsp)
movq (%rdx), %r12
movq 0x8(%rdx), %r15
addq $0x8, %r12
leaq 0x20(%rsp), %r14
xorl %eax, %eax
movq %r15, %rcx
subq %r12, %rcx
jbe 0x110d4
cmpq $0x8, %rcx
jl 0x110d4
leaq 0xb(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x4e89
movq %r14, 0x10(%rsp)
movq %r13, %rdi
callq 0x2100
leaq (%rsp,%rax), %rdx
addq $0xb, %rdx
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x1517a
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rbp
cmpq %r14, %rdi
je 0x11029
callq 0x2200
cmpq $0x4, %rbp
jne 0x110c5
movq %rbx, %r13
movq %r12, %rdi
callq 0x4e84
movl %eax, %ebx
movq %r14, 0x10(%rsp)
leaq 0xb(%rsp), %rdi
callq 0x2100
leaq (%rsp,%rax), %rdx
addq $0xb, %rdx
leaq 0x10(%rsp), %rdi
leaq 0xb(%rsp), %rsi
callq 0x1517a
movq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x14f64
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x11084
callq 0x2200
movl %ebx, %eax
movq %rax, 0x10(%rsp)
movq %r13, %rbx
movq 0x8(%r13), %rsi
cmpq 0x10(%r13), %rsi
je 0x110a5
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x110b2
movq %rbx, %rdi
leaq 0x10(%rsp), %rdx
callq 0x15524
leaq 0x20(%rsp), %r14
movq %r12, %rdi
movq %r15, %rsi
callq 0x4fe2
movq %rax, %r12
cmpq $0x4, %rbp
je 0x10fcb
movl $0x1, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x110f5
callq 0x2200
movq %rbx, %rdi
callq 0x23b0
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::getPaletteValue(unsigned char const*, unsigned long, int)
int getPaletteValue(const unsigned char* data, size_t i, int bits) {
  if(bits == 8) return data[i];
  else if(bits == 4) return (data[i / 2] >> ((i % 2) * 4)) & 15;
  else if(bits == 2) return (data[i / 4] >> ((i % 4) * 2)) & 3;
  else if(bits == 1) return (data[i / 8] >> (i % 8)) & 1;
  else return 0;
}

// Assembly:
xorl %eax, %eax
decl %edx
cmpl $0x7, %edx
ja 0x11c84
leaq 0x63f9b(%rip), %rcx     # 0x75c00
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movq %rsi, %rax
shrq $0x3, %rax
movzbl (%rdi,%rax), %ecx
andl $0x7, %esi
xorl %eax, %eax
btl %esi, %ecx
setb %al
retq
movq %rsi, %rax
shrq %rax
movzbl (%rdi,%rax), %eax
shll $0x2, %esi
andb $0x4, %sil
movl %esi, %ecx
shrl %cl, %eax
andl $0xf, %eax
retq
movq %rsi, %rax
shrq $0x2, %rax
movzbl (%rdi,%rax), %eax
addl %esi, %esi
andb $0x6, %sil
movl %esi, %ecx
shrl %cl, %eax
andl $0x3, %eax
retq
movzbl (%rdi,%rsi), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::convertToXYZ_gamma_table(float*, unsigned long, unsigned long, LodePNGInfo const*, unsigned int, lodepng::LodePNGICC const*)
static void convertToXYZ_gamma_table(float* out, size_t n, size_t c,
                                     const LodePNGInfo* info, unsigned use_icc, const LodePNGICC* icc) {
  size_t i;
  float mul = 1.0f / (n - 1);
  if(use_icc) {
    for(i = 0; i < n; i++) {
      float v = i * mul;
      out[i] = iccForwardTRC(&icc->trc[c], v);
    }
  } else if(info->gama_defined && !info->srgb_defined) {
    /* no power needed if gamma is 1 */
    if(info->gama_gamma == 100000) {
      for(i = 0; i < n; i++) {
        out[i] = i * mul;
      }
    } else {
      float gamma = 100000.0f / info->gama_gamma;
      for(i = 0; i < n; i++) {
        float v = i * mul;
        out[i] = lodepng_powf(v, gamma);
      }
    }
  } else {
    for(i = 0; i < n; i++) {
      /* sRGB gamma expand */
      float v = i * mul;
      out[i] = (v < 0.04045f) ? (v / 12.92f) : lodepng_powf((v + 0.055f) / 1.055f, 2.4f);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq -0x1(%rsi), %rax
cvtsi2ss %rax, %xmm0
movq %rdi, %r14
movss 0x633f5(%rip), %xmm1    # 0x75d64
divss %xmm0, %xmm1
testl %r8d, %r8d
movss %xmm1, (%rsp)
je 0x129c1
testq %rbx, %rbx
je 0x12a36
imulq $0x38, %rdx, %rax
leaq (%r9,%rax), %r15
addq $0x80, %r15
xorl %r12d, %r12d
xorps %xmm0, %xmm0
cvtsi2ss %r12, %xmm0
mulss %xmm1, %xmm0
movq %r15, %rdi
callq 0x13ca9
movss (%rsp), %xmm1
movss %xmm0, (%r14,%r12,4)
incq %r12
cmpq %r12, %rbx
jne 0x12998
jmp 0x12a36
cmpl $0x0, 0xc8(%rcx)
je 0x129d3
cmpl $0x0, 0xf4(%rcx)
je 0x12a42
testq %rbx, %rbx
je 0x12a36
xorl %r15d, %r15d
movss 0x63399(%rip), %xmm2    # 0x75d7c
xorps %xmm0, %xmm0
cvtsi2ss %r15, %xmm0
mulss %xmm1, %xmm0
ucomiss %xmm0, %xmm2
jbe 0x129fe
divss 0x63390(%rip), %xmm0    # 0x75d8c
jmp 0x12a28
addss 0x6337a(%rip), %xmm0    # 0x75d80
divss 0x63376(%rip), %xmm0    # 0x75d84
movss 0x63372(%rip), %xmm1    # 0x75d88
callq 0x13e86
movss 0x63359(%rip), %xmm2    # 0x75d7c
movss (%rsp), %xmm1
movss %xmm0, (%r14,%r15,4)
incq %r15
cmpq %r15, %rbx
jne 0x129e3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl 0xcc(%rcx), %eax
cmpl $0x186a0, %eax          # imm = 0x186A0
jne 0x12a72
testq %rbx, %rbx
je 0x12a36
xorl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
mulss %xmm1, %xmm0
movss %xmm0, (%r14,%rax,4)
incq %rax
cmpq %rax, %rbx
jne 0x12a56
jmp 0x12a36
testq %rbx, %rbx
je 0x12a36
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
movss 0x632ef(%rip), %xmm2    # 0x75d78
divss %xmm0, %xmm2
movss %xmm2, 0x4(%rsp)
xorl %r15d, %r15d
xorps %xmm0, %xmm0
cvtsi2ss %r15, %xmm0
mulss %xmm1, %xmm0
movss 0x4(%rsp), %xmm1
callq 0x13e86
movss (%rsp), %xmm1
movss %xmm0, (%r14,%r15,4)
incq %r15
cmpq %r15, %rbx
jne 0x12a96
jmp 0x12a36
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::convertToXYZ_chrm(float*, unsigned int, unsigned int, LodePNGInfo const*, unsigned int, lodepng::LodePNGICC const*, float*)
static unsigned convertToXYZ_chrm(float* im, unsigned w, unsigned h,
                                  const LodePNGInfo* info, unsigned use_icc, const LodePNGICC* icc,
                                  float whitepoint[3]) {
  unsigned error = 0;
  size_t i, n;
  float m[9]; /* XYZ to linear RGB matrix */
  if(lodepng_mulofl((size_t)w, (size_t)h, &n)) return 92;

  /* Must be called even for grayscale, to get the correct whitepoint to output */
  error = getChrm(m, whitepoint, use_icc, icc, info);
  if(error) return error;

  /* Note: no whitepoint adaptation done to m here, because we only do the
  adaptation in convertFromXYZ (we only whitepoint adapt when going to the
  target RGB space, but here we're going from the source RGB space to XYZ) */

  /* Apply the above computed linear-RGB-to-XYZ matrix to the pixels.
  Skip the transform if it's the unit matrix (which is the case if grayscale profile) */
  if(!use_icc || icc->inputspace == 2) {
    for(i = 0; i < n; i++) {
      size_t j = i * 4;
      mulMatrix(&im[j + 0], &im[j + 1], &im[j + 2], m, im[j + 0], im[j + 1], im[j + 2]);
    }
  }

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %r9, %r14
movl %r8d, %ebp
movq %rcx, %r8
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
movq 0x60(%rsp), %rsi
movq %rsp, %rdi
movl %ebp, %edx
movq %r9, %rcx
callq 0x142b2
testl %eax, %eax
jne 0x12c1f
movl %r12d, %ecx
movl %r15d, %eax
imulq %rcx, %rax
testl %ebp, %ebp
je 0x12b21
cmpl $0x2, (%r14)
sete %cl
testq %rax, %rax
setne %dl
testb %dl, %cl
jne 0x12b2a
jmp 0x12c1d
testq %rax, %rax
je 0x12c1d
cvtss2sd (%rsp), %xmm0
cvtss2sd 0x4(%rsp), %xmm1
cvtss2sd 0x8(%rsp), %xmm2
cvtss2sd 0xc(%rsp), %xmm3
cvtss2sd 0x10(%rsp), %xmm4
cvtss2sd 0x14(%rsp), %xmm5
cvtss2sd 0x18(%rsp), %xmm6
cvtss2sd 0x1c(%rsp), %xmm7
cvtss2sd 0x20(%rsp), %xmm8
cmpq $0x1, %rax
adcq $0x0, %rax
addq $0x8, %rbx
xorps %xmm9, %xmm9
cvtss2sd -0x8(%rbx), %xmm9
xorps %xmm11, %xmm11
cvtss2sd -0x4(%rbx), %xmm11
xorps %xmm10, %xmm10
cvtss2sd (%rbx), %xmm10
movaps %xmm11, %xmm12
mulsd %xmm1, %xmm12
movaps %xmm9, %xmm13
mulsd %xmm0, %xmm13
addsd %xmm12, %xmm13
movaps %xmm10, %xmm12
mulsd %xmm2, %xmm12
addsd %xmm13, %xmm12
movaps %xmm11, %xmm13
mulsd %xmm4, %xmm13
movaps %xmm9, %xmm14
mulsd %xmm3, %xmm14
addsd %xmm13, %xmm14
movaps %xmm10, %xmm13
mulsd %xmm5, %xmm13
addsd %xmm14, %xmm13
cvtsd2ss %xmm12, %xmm12
cvtsd2ss %xmm13, %xmm13
movss %xmm12, -0x8(%rbx)
mulsd %xmm7, %xmm11
mulsd %xmm6, %xmm9
addsd %xmm11, %xmm9
mulsd %xmm8, %xmm10
addsd %xmm9, %xmm10
xorps %xmm9, %xmm9
cvtsd2ss %xmm10, %xmm9
movss %xmm13, -0x4(%rbx)
movss %xmm9, (%rbx)
addq $0x10, %rbx
decq %rax
jne 0x12b6c
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::convertFromXYZFloat(float*, float const*, unsigned int, unsigned int, LodePNGState const*, float const*, unsigned int)
unsigned convertFromXYZFloat(float* out, const float* in, unsigned w, unsigned h,
                             const LodePNGState* state,
                             const float whitepoint[3], unsigned rendering_intent) {
  unsigned error = 0;
  const LodePNGInfo* info = &state->info_png;

  /* parse ICC if present */
  unsigned use_icc = 0;
  LodePNGICC icc;
  lodepng_icc_init(&icc);
  if(info->iccp_defined) {
    error = parseICC(&icc, info->iccp_profile, info->iccp_profile_size);
    if(error) goto cleanup; /* corrupted ICC profile */
    use_icc = validateICC(&icc);
  }

  /* Handle gamut */
  error = convertFromXYZ_chrm(out, in, w, h, info, use_icc, &icc, whitepoint, rendering_intent);
  if(error) goto cleanup;

  /* Handle transfer function */
  error = convertFromXYZ_gamma(out, w, h, info, use_icc, &icc);
  if(error) goto cleanup;

cleanup:
  lodepng_icc_cleanup(&icc);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %r9, %r11
movq %r8, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x98(%rsp)
movups %xmm0, 0xd0(%rsp)
movups %xmm0, 0x108(%rsp)
xorl %r12d, %r12d
cmpl $0x0, 0x1cc(%r8)
je 0x138a6
movq %rsi, (%rsp)
movq %r11, 0x8(%rsp)
movq %rdi, %r13
movl %edx, %r15d
movl %ecx, %r14d
movq 0x1d8(%rbx), %rsi
movl 0x1e0(%rbx), %edx
leaq 0x10(%rsp), %rdi
callq 0x12165
movl $0x1, %ebp
testl %eax, %eax
jne 0x138fb
movl 0x10(%rsp), %eax
testl %eax, %eax
je 0x13891
cmpl $0x2, %eax
movl %r14d, %ecx
movl %r15d, %edx
movq %r13, %rdi
movq 0x8(%rsp), %r11
movq (%rsp), %rsi
jne 0x13879
cmpl $0x0, 0x64(%rsp)
je 0x138a6
cmpl $0x0, 0x54(%rsp)
je 0x138a6
xorl %r12d, %r12d
cmpl $0x0, 0x8c(%rsp)
setne %r12b
jmp 0x138a6
movl %eax, %r12d
movl %r14d, %ecx
movl %r15d, %edx
movq %r13, %rdi
movq 0x8(%rsp), %r11
movq (%rsp), %rsi
movl 0x170(%rsp), %eax
addq $0xd0, %rbx
subq $0x8, %rsp
leaq 0x18(%rsp), %r10
movq %rdi, %r15
movl %edx, %r14d
movl %ecx, %r13d
movq %rbx, %r8
movl %r12d, %r9d
pushq %rax
pushq %r11
pushq %r10
callq 0x1327c
addq $0x20, %rsp
movl %eax, %ebp
testl %eax, %eax
jne 0x138fb
leaq 0x10(%rsp), %r9
movq %r15, %rdi
movl %r14d, %esi
movl %r13d, %edx
movq %rbx, %rcx
movl %r12d, %r8d
callq 0x134c1
movl %eax, %ebp
movq 0x98(%rsp), %rdi
callq 0x2290
movq 0xd0(%rsp), %rdi
callq 0x2290
movq 0x108(%rsp), %rdi
callq 0x2290
movl %ebp, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::convertToSrgb(unsigned char*, unsigned char const*, unsigned int, unsigned int, LodePNGState const*)
unsigned convertToSrgb(unsigned char* out, const unsigned char* in,
                       unsigned w, unsigned h,
                       const LodePNGState* state_in) {
  LodePNGState srgb;
  lodepng_state_init(&srgb);
  lodepng_color_mode_copy(&srgb.info_raw, &state_in->info_raw);
  return convertRGBModel(out, in, w, h, &srgb, state_in, 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %r8, %rbx
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
leaq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0xa3ab
movl $0xa8, %esi
leaq (%rsi,%r13), %rdi
addq %rbx, %rsi
callq 0x52e4
movl $0x1, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %r14d, %edx
movl %ebp, %ecx
movq %r13, %r8
movq %rbx, %r9
callq 0x13936
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::convertFromSrgb(unsigned char*, unsigned char const*, unsigned int, unsigned int, LodePNGState const*)
unsigned convertFromSrgb(unsigned char* out, const unsigned char* in,
                         unsigned w, unsigned h,
                         const LodePNGState* state_out) {
  LodePNGState srgb;
  lodepng_state_init(&srgb);
  lodepng_color_mode_copy(&srgb.info_raw, &state_out->info_raw);
  return convertRGBModel(out, in, w, h, state_out, &srgb, 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %r8, %rbx
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
leaq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0xa3ab
movl $0xa8, %esi
leaq (%rsi,%r13), %rdi
addq %rbx, %rsi
callq 0x52e4
movl $0x1, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %r14d, %edx
movl %ebp, %ecx
movq %rbx, %r8
movq %r13, %r9
callq 0x13936
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::isICCword(unsigned char const*, unsigned long, unsigned long, char const*)
static unsigned isICCword(const unsigned char* data, size_t size, size_t pos, const char* word) {
  if(pos + 4 > size) return 0;
  return data[pos + 0] == (unsigned char)word[0] &&
         data[pos + 1] == (unsigned char)word[1] &&
         data[pos + 2] == (unsigned char)word[2] &&
         data[pos + 3] == (unsigned char)word[3];
}

// Assembly:
leaq 0x4(%rdx), %r8
xorl %eax, %eax
cmpq %rsi, %r8
ja 0x13ca8
movb (%rdi,%rdx), %sil
cmpb (%rcx), %sil
jne 0x13ca8
movb 0x1(%rdi,%rdx), %sil
cmpb 0x1(%rcx), %sil
jne 0x13ca8
movb 0x2(%rdi,%rdx), %sil
cmpb 0x2(%rcx), %sil
jne 0x13ca8
movb 0x3(%rdi,%rdx), %dl
xorl %eax, %eax
cmpb 0x3(%rcx), %dl
sete %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::invMatrix(float*)
static unsigned invMatrix(float* m) {
  int i;
  /* double used instead of float for intermediate computations to avoid
  intermediate numerical precision issues */
  double e0 = (double)m[4] * m[8] - (double)m[5] * m[7];
  double e3 = (double)m[5] * m[6] - (double)m[3] * m[8];
  double e6 = (double)m[3] * m[7] - (double)m[4] * m[6];
  /* inverse determinant */
  double d = 1.0 / (m[0] * e0 + m[1] * e3 + m[2] * e6);
  double result[9];
  if((d > 0 ? d : -d) > 1e15) return 1; /* error, likely not invertible */
  result[0] = e0 * d;
  result[1] = ((double)m[2] * m[7] - (double)m[1] * m[8]) * d;
  result[2] = ((double)m[1] * m[5] - (double)m[2] * m[4]) * d;
  result[3] = e3 * d;
  result[4] = ((double)m[0] * m[8] - (double)m[2] * m[6]) * d;
  result[5] = ((double)m[3] * m[2] - (double)m[0] * m[5]) * d;
  result[6] = e6 * d;
  result[7] = ((double)m[6] * m[1] - (double)m[0] * m[7]) * d;
  result[8] = ((double)m[0] * m[4] - (double)m[3] * m[1]) * d;
  for(i = 0; i < 9; i++) m[i] = (float)result[i];
  return 0; /* ok */
}

// Assembly:
cvtss2sd 0x10(%rdi), %xmm0
cvtss2sd 0x20(%rdi), %xmm6
cvtss2sd 0x14(%rdi), %xmm4
cvtss2sd 0x1c(%rdi), %xmm1
movaps %xmm4, %xmm2
mulsd %xmm1, %xmm2
movaps %xmm0, %xmm13
mulsd %xmm6, %xmm13
cvtss2sd 0x18(%rdi), %xmm3
cvtss2sd 0xc(%rdi), %xmm7
subsd %xmm2, %xmm13
movapd 0x614b2(%rip), %xmm2    # 0x75e30
movapd %xmm6, %xmm5
mulsd %xmm7, %xmm5
movaps %xmm4, %xmm11
mulsd %xmm3, %xmm11
subsd %xmm5, %xmm11
movaps %xmm0, %xmm5
mulsd %xmm3, %xmm5
movapd %xmm7, %xmm9
mulsd %xmm1, %xmm9
subsd %xmm5, %xmm9
xorps %xmm5, %xmm5
cvtss2sd (%rdi), %xmm5
cvtss2sd 0x4(%rdi), %xmm8
movapd %xmm11, %xmm10
mulsd %xmm8, %xmm10
movaps %xmm5, %xmm14
mulsd %xmm13, %xmm14
addsd %xmm10, %xmm14
cvtss2sd 0x8(%rdi), %xmm12
movaps %xmm12, %xmm15
mulsd %xmm9, %xmm15
addsd %xmm14, %xmm15
movsd 0x6145c(%rip), %xmm10   # 0x75e48
divsd %xmm15, %xmm10
movapd %xmm10, %xmm14
xorpd %xmm2, %xmm14
movapd %xmm10, %xmm15
maxsd %xmm14, %xmm15
movl $0x1, %eax
ucomisd 0x6143d(%rip), %xmm15   # 0x75e50
ja 0x14b0a
xorpd %xmm7, %xmm2
mulsd %xmm10, %xmm13
movsd %xmm13, -0x48(%rsp)
movapd %xmm6, %xmm13
mulsd %xmm8, %xmm13
movaps %xmm12, %xmm14
mulsd %xmm1, %xmm14
subsd %xmm13, %xmm14
mulsd %xmm10, %xmm14
movsd %xmm14, -0x40(%rsp)
movaps %xmm0, %xmm13
mulsd %xmm12, %xmm13
movapd %xmm8, %xmm14
mulsd %xmm4, %xmm14
subsd %xmm13, %xmm14
mulsd %xmm10, %xmm14
movsd %xmm14, -0x38(%rsp)
mulsd %xmm10, %xmm11
movsd %xmm11, -0x30(%rsp)
movapd %xmm3, %xmm11
mulsd %xmm12, %xmm11
mulsd %xmm5, %xmm6
subsd %xmm11, %xmm6
mulsd %xmm10, %xmm6
movsd %xmm6, -0x28(%rsp)
mulsd %xmm5, %xmm4
mulsd %xmm12, %xmm7
subsd %xmm4, %xmm7
mulsd %xmm10, %xmm7
movsd %xmm7, -0x20(%rsp)
mulsd %xmm10, %xmm9
movsd %xmm9, -0x18(%rsp)
mulsd %xmm5, %xmm1
mulsd %xmm8, %xmm3
subsd %xmm1, %xmm3
mulsd %xmm10, %xmm3
movsd %xmm3, -0x10(%rsp)
mulsd %xmm8, %xmm2
mulsd %xmm0, %xmm5
addsd %xmm2, %xmm5
mulsd %xmm10, %xmm5
movsd %xmm5, -0x8(%rsp)
xorl %eax, %eax
xorl %ecx, %ecx
xorps %xmm0, %xmm0
cvtsd2ss -0x48(%rsp,%rcx,8), %xmm0
movss %xmm0, (%rdi,%rcx,4)
incq %rcx
cmpq $0x9, %rcx
jne 0x14af3
retq
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::getAdaptationMatrix(float*, int, float, float, float, float, float, float)
static unsigned getAdaptationMatrix(float* m, int type,
                                    float wx0, float wy0, float wz0,
                                    float wx1, float wy1, float wz1) {
  int i;
  static const float bradford[9] = {
    0.8951f, 0.2664f, -0.1614f,
    -0.7502f, 1.7135f, 0.0367f,
    0.0389f, -0.0685f, 1.0296f
  };
  static const float bradfordinv[9] = {
    0.9869929f, -0.1470543f, 0.1599627f,
    0.4323053f, 0.5183603f, 0.0492912f,
   -0.0085287f, 0.0400428f, 0.9684867f
  };
  static const float vonkries[9] = {
    0.40024f, 0.70760f, -0.08081f,
    -0.22630f, 1.16532f, 0.04570f,
    0.00000f, 0.00000f, 0.91822f,
  };
  static const float vonkriesinv[9] = {
    1.8599364f, -1.1293816f, 0.2198974f,
    0.3611914f, 0.6388125f, -0.0000064f,
   0.0000000f, 0.0000000f, 1.0890636f
  };
  if(type == 0) {
    for(i = 0; i < 9; i++) m[i] = 0;
    m[0] = wx1 / wx0;
    m[4] = wy1 / wy0;
    m[8] = wz1 / wz0;
  } else {
    const float* cat = (type == 1) ? bradford : vonkries;
    const float* inv = (type == 1) ? bradfordinv : vonkriesinv;
    float rho0, gam0, bet0, rho1, gam1, bet1, rho2, gam2, bet2;
    mulMatrix(&rho0, &gam0, &bet0, cat, wx0, wy0, wz0);
    mulMatrix(&rho1, &gam1, &bet1, cat, wx1, wy1, wz1);
    rho2 = rho1 / rho0;
    gam2 = gam1 / gam0;
    bet2 = bet1 / bet0;
    /* Multiply diagonal matrix with cat */
    for(i = 0; i < 3; i++) {
      m[i + 0] = rho2 * cat[i + 0];
      m[i + 3] = gam2 * cat[i + 3];
      m[i + 6] = bet2 * cat[i + 6];
    }
    mulMatrixMatrix(m, inv, m);
  }
  return 0; /* ok */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movss %xmm5, 0xc(%rsp)
movss %xmm4, 0x8(%rsp)
movss %xmm3, 0x4(%rsp)
movq %rdi, %rbx
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
cvtss2sd %xmm2, %xmm2
leaq 0x611cf(%rip), %r14     # 0x75d10
leaq 0x24(%rsp), %r13
leaq 0x14(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %r13, %rdi
movq %r14, %rcx
callq 0x148a7
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x8(%rsp), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0xc(%rsp), %xmm2
leaq 0x20(%rsp), %rbp
leaq 0x1c(%rsp), %r15
leaq 0x18(%rsp), %r12
movq %rbp, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x148a7
movss (%rbp), %xmm0
divss (%r13), %xmm0
movss (%r15), %xmm1
leaq 0x14(%rsp), %rax
divss (%rax), %xmm1
movss (%r12), %xmm2
leaq 0x10(%rsp), %rax
divss (%rax), %xmm2
xorl %eax, %eax
movss (%r14,%rax,4), %xmm3
mulss %xmm0, %xmm3
movss %xmm3, (%rbx,%rax,4)
movss 0xc(%r14,%rax,4), %xmm3
mulss %xmm1, %xmm3
movss %xmm3, 0xc(%rbx,%rax,4)
movss 0x18(%r14,%rax,4), %xmm3
mulss %xmm2, %xmm3
movss %xmm3, 0x18(%rbx,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x14bc0
leaq 0x6113f(%rip), %rsi     # 0x75d40
movq %rbx, %rdi
movq %rbx, %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x14dfa
// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::getChrmMatrixXYZ(float*, float, float, float, float, float, float, float, float, float, float, float, float)
static unsigned getChrmMatrixXYZ(float* m,
                                 float wX, float wY, float wZ,
                                 float rX, float rY, float rZ,
                                 float gX, float gY, float gZ,
                                 float bX, float bY, float bZ) {
  float t[9];
  float rs, gs, bs;
  t[0] = rX; t[1] = gX; t[2] = bX;
  t[3] = rY; t[4] = gY; t[5] = bY;
  t[6] = rZ; t[7] = gZ; t[8] = bZ;
  if(invMatrix(t)) return 1; /* error, not invertible */
  mulMatrix(&rs, &gs, &bs, t, wX, wY, wZ);
  m[0] = rs * rX; m[1] = gs * gX; m[2] = bs * bX;
  m[3] = rs * rY; m[4] = gs * gY; m[5] = bs * bY;
  m[6] = rs * rZ; m[7] = gs * gZ; m[8] = bs * bZ;
  return 0;
}

// Assembly:
pushq %rbx
subq $0x50, %rsp
movss %xmm2, 0x8(%rsp)
movss %xmm1, 0x4(%rsp)
movss %xmm0, (%rsp)
movq %rdi, %rbx
movss 0x78(%rsp), %xmm0
movss 0x70(%rsp), %xmm2
movss 0x68(%rsp), %xmm8
movss 0x60(%rsp), %xmm1
leaq 0x20(%rsp), %rdi
movss %xmm3, 0xc(%rsp)
movss %xmm3, (%rdi)
movss %xmm6, 0x10(%rsp)
movss %xmm6, 0x4(%rdi)
movss %xmm8, 0x8(%rdi)
movss %xmm4, 0x14(%rsp)
movss %xmm4, 0xc(%rdi)
movss %xmm7, 0x18(%rsp)
movss %xmm7, 0x10(%rdi)
movss %xmm2, 0x14(%rdi)
movss %xmm5, 0x1c(%rsp)
movss %xmm5, 0x18(%rdi)
movss %xmm1, 0x1c(%rdi)
movss %xmm0, 0x20(%rdi)
callq 0x14943
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x14df4
xorps %xmm2, %xmm2
cvtss2sd (%rsp), %xmm2
xorps %xmm4, %xmm4
cvtss2sd 0x4(%rsp), %xmm4
xorps %xmm0, %xmm0
cvtss2sd 0x20(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x8(%rsp), %xmm1
xorps %xmm3, %xmm3
cvtss2sd 0x24(%rsp), %xmm3
mulsd %xmm4, %xmm3
mulsd %xmm2, %xmm0
addsd %xmm3, %xmm0
xorps %xmm3, %xmm3
cvtss2sd 0x28(%rsp), %xmm3
mulsd %xmm1, %xmm3
addsd %xmm0, %xmm3
xorps %xmm0, %xmm0
cvtsd2ss %xmm3, %xmm0
xorps %xmm3, %xmm3
cvtss2sd 0x2c(%rsp), %xmm3
xorps %xmm5, %xmm5
cvtss2sd 0x30(%rsp), %xmm5
mulsd %xmm4, %xmm5
mulsd %xmm2, %xmm3
addsd %xmm5, %xmm3
xorps %xmm5, %xmm5
cvtss2sd 0x34(%rsp), %xmm5
mulsd %xmm1, %xmm5
addsd %xmm3, %xmm5
xorps %xmm3, %xmm3
cvtsd2ss %xmm5, %xmm3
xorps %xmm5, %xmm5
cvtss2sd 0x38(%rsp), %xmm5
xorps %xmm6, %xmm6
cvtss2sd 0x3c(%rsp), %xmm6
mulsd %xmm4, %xmm6
mulsd %xmm2, %xmm5
addsd %xmm6, %xmm5
xorps %xmm2, %xmm2
cvtss2sd 0x40(%rsp), %xmm2
mulsd %xmm1, %xmm2
addsd %xmm5, %xmm2
xorps %xmm1, %xmm1
cvtsd2ss %xmm2, %xmm1
movss 0xc(%rsp), %xmm2
mulss %xmm0, %xmm2
movss %xmm2, (%rbx)
movss 0x10(%rsp), %xmm2
mulss %xmm3, %xmm2
movss %xmm2, 0x4(%rbx)
movss 0x68(%rsp), %xmm2
mulss %xmm1, %xmm2
movss %xmm2, 0x8(%rbx)
movss 0x14(%rsp), %xmm2
mulss %xmm0, %xmm2
movss %xmm2, 0xc(%rbx)
movss 0x18(%rsp), %xmm2
mulss %xmm3, %xmm2
movss %xmm2, 0x10(%rbx)
movss 0x70(%rsp), %xmm2
mulss %xmm1, %xmm2
movss %xmm2, 0x14(%rbx)
movss 0x1c(%rsp), %xmm2
mulss %xmm0, %xmm2
movss %xmm2, 0x18(%rbx)
movss 0x60(%rsp), %xmm0
mulss %xmm3, %xmm0
movss %xmm0, 0x1c(%rbx)
movss 0x78(%rsp), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x20(%rbx)
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
retq