LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x12c50
movw %ax, -0x1a(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movzwl -0x1a(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movw %ax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movzwl -0x1a(%rbp), %ecx
movw (%rax,%rcx,2), %ax
movw %ax, -0x1e(%rbp)
movzwl -0x1c(%rbp), %eax
cmpl $0x9, %eax
ja 0x1356b
movq -0x10(%rbp), %rdi
movzwl -0x1c(%rbp), %eax
movl %eax, %esi
callq 0x12c80
movzwl -0x1e(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x135cc
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x12c80
movq -0x10(%rbp), %rdi
movzwl -0x1c(%rbp), %eax
subl $0x9, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x12c50
movl %eax, %ecx
movzwl -0x1e(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x1e(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movzwl -0x1e(%rbp), %ecx
movzbl (%rax,%rcx), %eax
subl $0x9, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x12c80
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movzwl -0x1e(%rbp), %ecx
movzwl (%rax,%rcx,2), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: lvandeve[P]lodepng/lodepng.cpp
// Function: reverseBits(unsigned int, unsigned int)
static unsigned reverseBits(unsigned bits, unsigned num) {
  /*TODO: implement faster lookup table based version when needed*/
  unsigned i, result = 0;
  for(i = 0; i < num; i++) result |= ((bits >> (num - i - 1u)) & 1u) << i;
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl $0x0, -0x10(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x8(%rbp), %eax
jae 0x14137
movl -0x4(%rbp), %eax
movl -0x8(%rbp), %ecx
subl -0xc(%rbp), %ecx
subl $0x1, %ecx
shrl %cl, %eax
andl $0x1, %eax
movl -0xc(%rbp), %ecx
shll %cl, %eax
orl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x14108
movl -0x10(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: lvandeve[P]lodepng/lodepng.cpp
// Function: ensureBits17(LodePNGBitReader*, unsigned long)
static LODEPNG_INLINE void ensureBits17(LodePNGBitReader* reader, size_t nbits) {
  size_t start = reader->bp >> 3u;
  size_t size = reader->size;
  if(start + 2u < size) {
    reader->buffer = (unsigned)reader->data[start + 0] | ((unsigned)reader->data[start + 1] << 8u) |
                     ((unsigned)reader->data[start + 2] << 16u);
    reader->buffer >>= (reader->bp & 7u);
  } else {
    reader->buffer = 0;
    if(start + 0u < size) reader->buffer |= reader->data[start + 0];
    if(start + 1u < size) reader->buffer |= ((unsigned)reader->data[start + 1] << 8u);
    reader->buffer >>= (reader->bp & 7u);
  }
  (void)nbits;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x3, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x2, %rax
cmpq -0x20(%rbp), %rax
jae 0x141d2
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rdx
movzbl 0x1(%rax,%rdx), %eax
shll $0x8, %eax
orl %eax, %ecx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rdx
movzbl 0x2(%rax,%rdx), %eax
shll $0x10, %eax
orl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
andq $0x7, %rcx
movq -0x8(%rbp), %rax
movl 0x20(%rax), %edx
shrl %cl, %edx
movl %edx, %ecx
movl %ecx, 0x20(%rax)
jmp 0x14249
movq -0x8(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
addq $0x0, %rax
cmpq -0x20(%rbp), %rax
jae 0x14204
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
movq -0x8(%rbp), %rax
orl 0x20(%rax), %ecx
movl %ecx, 0x20(%rax)
movq -0x18(%rbp), %rax
addq $0x1, %rax
cmpq -0x20(%rbp), %rax
jae 0x1422f
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movzbl 0x1(%rax,%rcx), %ecx
shll $0x8, %ecx
movq -0x8(%rbp), %rax
orl 0x20(%rax), %ecx
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
andq $0x7, %rcx
movq -0x8(%rbp), %rax
movl 0x20(%rax), %edx
shrl %cl, %edx
movl %edx, %ecx
movl %ecx, 0x20(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: lvandeve[P]lodepng/lodepng.cpp
// Function: addLengthDistance(uivector*, unsigned long, unsigned long)
static void addLengthDistance(uivector* values, size_t length, size_t distance) {
  /*values in encoded vector are those used by deflate:
  0-255: literal bytes
  256: end
  257-285: length/distance pair (length code, followed by extra length bits, distance code, extra distance bits)
  286-287: invalid*/

  unsigned length_code = (unsigned)searchCodeIndex(LENGTHBASE, 29, length);
  unsigned extra_length = (unsigned)(length - LENGTHBASE[length_code]);
  unsigned dist_code = (unsigned)searchCodeIndex(DISTANCEBASE, 30, distance);
  unsigned extra_distance = (unsigned)(distance - DISTANCEBASE[dist_code]);

  size_t pos = values->size;
  /*TODO: return error when this fails (out of memory)*/
  unsigned ok = uivector_resize(values, values->size + 4);
  if(ok) {
    values->data[pos + 0] = length_code + FIRST_LENGTH_CODE_INDEX;
    values->data[pos + 1] = extra_length;
    values->data[pos + 2] = dist_code;
    values->data[pos + 3] = extra_distance;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdx
leaq 0x9af71(%rip), %rdi     # 0xb1280
movl $0x1d, %esi
callq 0x16490
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
leaq 0x9af54(%rip), %rcx     # 0xb1280
movl (%rcx,%rdx,4), %ecx
subq %rcx, %rax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rdx
leaq 0x9b040(%rip), %rdi     # 0xb1380
movl $0x1e, %esi
callq 0x16490
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
leaq 0x9b023(%rip), %rcx     # 0xb1380
movl (%rcx,%rdx,4), %ecx
subq %rcx, %rax
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
addq $0x4, %rsi
callq 0x163f0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x163dd
movl -0x1c(%rbp), %edx
addl $0x101, %edx            # imm = 0x101
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x20(%rbp), %edx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
movl %edx, 0x4(%rax,%rcx,4)
movl -0x24(%rbp), %edx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
movl %edx, 0x8(%rax,%rcx,4)
movl -0x28(%rbp), %edx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
movl %edx, 0xc(%rax,%rcx,4)
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
shlq $0x2, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x1646f
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
shrq %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x5590
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x16464
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x1646d
movl $0x0, -0x4(%rbp)
jmp 0x16482
jmp 0x1646f
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rdx
subq $0x1, %rdx
xorl %eax, %eax
cmpl $0x0, (%rcx,%rdx,4)
movb %al, -0x31(%rbp)
jne 0x16578
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
seta %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x16581
jmp 0x1658f
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x16553
movq -0x28(%rbp), %rdi
shlq $0x2, %rdi
callq 0x3bc0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x165bb
movl $0x53, -0x4(%rbp)
jmp 0x16605
movl -0x2c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x28(%rbp), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
movl -0x2c(%rbp), %ecx
callq 0x3840
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jne 0x165ff
movq -0x10(%rbp), %rdi
callq 0x139d0
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: lvandeve[P]lodepng/lodepng.cpp
// Function: inflatev(ucvector*, unsigned char const*, unsigned long, LodePNGDecompressSettings const*)
static unsigned inflatev(ucvector* out, const unsigned char* in, size_t insize,
                        const LodePNGDecompressSettings* settings) {
  if(settings->custom_inflate) {
    unsigned error = settings->custom_inflate(&out->data, &out->size, in, insize, settings);
    out->allocsize = out->size;
    if(error) {
      /*the custom inflate 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 && out->size > settings->max_output_size) error = 109;
    }
    return error;
  } else {
    return lodepng_inflatev(out, in, insize, settings);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x166a3
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
callq *%rax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
cmpl $0x0, -0x2c(%rbp)
je 0x1669b
movl $0x6e, -0x2c(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x16699
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x16699
movl $0x6d, -0x2c(%rbp)
jmp 0x1669b
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x166bb
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x42f0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x5180
cmpl $0x0, %eax
je 0x167e6
movl $0x4d, -0x4(%rbp)
jmp 0x16872
movq -0x30(%rbp), %rdi
movl $0xc, %esi
leaq -0x30(%rbp), %rdx
callq 0x5180
cmpl $0x0, %eax
je 0x16806
movl $0x4d, -0x4(%rbp)
jmp 0x16872
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x12cb0
cmpl $0x0, %eax
jne 0x16821
movl $0x53, -0x4(%rbp)
jmp 0x16872
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq -0x30(%rbp), %rcx
xorl %eax, %eax
subq -0x20(%rbp), %rax
addq %rax, %rcx
addq $-0xc, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movl %eax, %esi
callq 0x4af0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
addq $0x4, %rdi
movq -0x28(%rbp), %rsi
movl $0x4, %edx
callq 0x5820
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: lvandeve[P]lodepng/lodepng.cpp
// Function: alloc_string_sized(char const*, unsigned long)
static char* alloc_string_sized(const char* in, size_t insize) {
  char* out = (char*)lodepng_malloc(insize + 1);
  if(out) {
    lodepng_memcpy(out, in, insize);
    out[insize] = 0;
  }
  return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x1, %rdi
callq 0x3bc0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x168c5
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x5820
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: lvandeve[P]lodepng/lodepng.cpp
// Function: unfilter(unsigned char*, unsigned char const*, unsigned int, unsigned int, unsigned int)
static unsigned unfilter(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, unsigned bpp) {
  /*
  For PNG filter method 0
  this function unfilters a single image (e.g. without interlacing this is called once, with Adam7 seven times)
  out must have enough bytes allocated already, in must have the scanlines + 1 filtertype byte per scanline
  w and h are image dimensions or dimensions of reduced image, bpp is bits per pixel
  in and out are allowed to be the same memory address (but aren't the same size since in has the extra filter bytes)
  */

  unsigned y;
  unsigned char* prevline = 0;

  /*bytewidth is used for filtering, is 1 when bpp < 8, number of bytes per pixel otherwise*/
  size_t bytewidth = (bpp + 7u) / 8u;
  /*the width of a scanline in bytes, not including the filter type*/
  size_t linebytes = lodepng_get_raw_size_idat(w, 1, bpp) - 1u;

  for(y = 0; y < h; ++y) {
    size_t outindex = linebytes * y;
    size_t inindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/
    unsigned char filterType = in[inindex];

    CERROR_TRY_RETURN(unfilterScanline(&out[outindex], &in[inindex + 1], prevline, bytewidth, filterType, linebytes));

    prevline = &out[outindex];
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq $0x0, -0x30(%rbp)
movl -0x24(%rbp), %eax
addl $0x7, %eax
shrl $0x3, %eax
movl %eax, %eax
movq %rax, -0x38(%rbp)
movl -0x1c(%rbp), %edi
movl -0x24(%rbp), %edx
movl $0x1, %esi
callq 0x16c80
subq $0x1, %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x20(%rbp), %eax
jae 0x17006
movq -0x40(%rbp), %rax
movl -0x28(%rbp), %ecx
imulq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movl -0x28(%rbp), %ecx
imulq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq -0x50(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x51(%rbp)
movq -0x10(%rbp), %rdi
addq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x50(%rbp), %rax
addq $0x1, %rax
addq %rax, %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movb -0x51(%rbp), %al
movq -0x40(%rbp), %r9
movzbl %al, %r8d
callq 0x17700
movl %eax, -0x58(%rbp)
cmpl $0x0, -0x58(%rbp)
je 0x16fec
movl -0x58(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1700d
movq -0x10(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x16f70
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: lvandeve[P]lodepng/lodepng.cpp
// Function: paethPredictor(unsigned char, unsigned char, unsigned char)
static unsigned char paethPredictor(unsigned char a, unsigned char b, unsigned char c) {
  /* the subtractions of unsigned char cast it to a signed type.
  With gcc, short is faster than int, with clang int is as fast (as of april 2023)*/
  short pa = (b - c) < 0 ? -(b - c) : (b - c);
  short pb = (a - c) < 0 ? -(a - c) : (a - c);
  /* writing it out like this compiles to something faster than introducing a temp variable*/
  short pc = (a + b - c - c) < 0 ? -(a + b - c - c) : (a + b - c - c);
  /* return input value associated with smallest of pa, pb, pc (with certain priority if equal) */
  if(pb < pa) { a = b; pa = pb; }
  return (pc < pa) ? c : a;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dl, %al
movb %sil, %cl
movb %dil, %dl
movb %dl, -0x1(%rbp)
movb %cl, -0x2(%rbp)
movb %al, -0x3(%rbp)
movzbl -0x2(%rbp), %eax
movzbl -0x3(%rbp), %ecx
subl %ecx, %eax
cmpl $0x0, %eax
jge 0x18da7
movzbl -0x2(%rbp), %ecx
movzbl -0x3(%rbp), %eax
subl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x10(%rbp)
jmp 0x18db4
movzbl -0x2(%rbp), %eax
movzbl -0x3(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movw %ax, -0x6(%rbp)
movzbl -0x1(%rbp), %eax
movzbl -0x3(%rbp), %ecx
subl %ecx, %eax
cmpl $0x0, %eax
jge 0x18ddd
movzbl -0x1(%rbp), %ecx
movzbl -0x3(%rbp), %eax
subl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x14(%rbp)
jmp 0x18dea
movzbl -0x1(%rbp), %eax
movzbl -0x3(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movw %ax, -0x8(%rbp)
movzbl -0x1(%rbp), %eax
movzbl -0x2(%rbp), %ecx
addl %ecx, %eax
movzbl -0x3(%rbp), %ecx
subl %ecx, %eax
movzbl -0x3(%rbp), %ecx
subl %ecx, %eax
cmpl $0x0, %eax
jge 0x18e2b
movzbl -0x1(%rbp), %ecx
movzbl -0x2(%rbp), %eax
addl %eax, %ecx
movzbl -0x3(%rbp), %eax
subl %eax, %ecx
movzbl -0x3(%rbp), %eax
subl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x18(%rbp)
jmp 0x18e44
movzbl -0x1(%rbp), %eax
movzbl -0x2(%rbp), %ecx
addl %ecx, %eax
movzbl -0x3(%rbp), %ecx
subl %ecx, %eax
movzbl -0x3(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movw %ax, -0xa(%rbp)
movswl -0x8(%rbp), %eax
movswl -0x6(%rbp), %ecx
cmpl %ecx, %eax
jge 0x18e65
movb -0x2(%rbp), %al
movb %al, -0x1(%rbp)
movw -0x8(%rbp), %ax
movw %ax, -0x6(%rbp)
movswl -0xa(%rbp), %eax
movswl -0x6(%rbp), %ecx
cmpl %ecx, %eax
jge 0x18e79
movb -0x3(%rbp), %al
movb %al, -0x19(%rbp)
jmp 0x18e7f
movb -0x1(%rbp), %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: lvandeve[P]lodepng/lodepng.cpp
// Function: ilog2i(unsigned long)
static size_t ilog2i(size_t i) {
  size_t l;
  if(i == 0) return 0;
  l = ilog2(i);
  /* approximate i*log2(i): l is integer logarithm, ((i - (1u << l)) << 1u)
  linearly approximates the missing fractional part multiplied by i */
  return i * l + ((i - (((size_t)1) << l)) << 1u);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x1a29d
movq $0x0, -0x8(%rbp)
jmp 0x1a2d8
movq -0x10(%rbp), %rdi
callq 0x1a2f0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
imulq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq -0x20(%rbp), %rcx
subq %rdx, %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: lvandeve[P]lodepng/lodepng.cpp
// Function: ilog2(unsigned long)
static size_t ilog2(size_t i) {
  size_t result = 0;
  if(i >= 65536) { result += 16; i >>= 16; }
  if(i >= 256) { result += 8; i >>= 8; }
  if(i >= 16) { result += 4; i >>= 4; }
  if(i >= 4) { result += 2; i >>= 2; }
  if(i >= 2) { result += 1; /*i >>= 1;*/ }
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
cmpq $0x10000, -0x8(%rbp)    # imm = 0x10000
jb 0x1a322
movq -0x10(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
shrq $0x10, %rax
movq %rax, -0x8(%rbp)
cmpq $0x100, -0x8(%rbp)      # imm = 0x100
jb 0x1a344
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
shrq $0x8, %rax
movq %rax, -0x8(%rbp)
cmpq $0x10, -0x8(%rbp)
jb 0x1a363
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
shrq $0x4, %rax
movq %rax, -0x8(%rbp)
cmpq $0x4, -0x8(%rbp)
jb 0x1a382
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
shrq $0x2, %rax
movq %rax, -0x8(%rbp)
cmpq $0x2, -0x8(%rbp)
jb 0x1a395
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
popq %rbp
retq
nopl (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x2d0, %rsp            # imm = 0x2D0
movq %rdi, -0x2b0(%rbp)
movq %rdi, -0x2a8(%rbp)
movq %rsi, -0x8(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x11ad0
movq -0x8(%rbp), %rdi
callq 0x1a3a0
movb %al, -0x29d(%rbp)
jmp 0x1c0ea
movb -0x29d(%rbp), %al
testb $0x1, %al
jne 0x1c0f6
jmp 0x1c101
xorl %eax, %eax
movq %rax, -0x2b8(%rbp)
jmp 0x1c127
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1a3e0
movq %rax, -0x2c0(%rbp)
jmp 0x1c117
movq -0x2c0(%rbp), %rax
movq %rax, -0x2b8(%rbp)
jmp 0x1c127
movq -0x2b8(%rbp), %rax
movq %rax, -0x2d0(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1a400
movq %rax, -0x2c8(%rbp)
jmp 0x1c147
movq -0x2c8(%rbp), %r8
movq -0x2d0(%rbp), %rcx
leaq -0xc(%rbp), %rdi
leaq -0x10(%rbp), %rsi
leaq -0x290(%rbp), %rdx
callq 0xa1d0
jmp 0x1c16b
movq -0x2b0(%rbp), %rdi
leaq -0x290(%rbp), %rsi
addq $0xd0, %rsi
movl $0x1a8, %edx            # imm = 0x1A8
callq 0x31e0
leaq -0x290(%rbp), %rdi
callq 0x11b20
movq -0x2a8(%rbp), %rax
addq $0x2d0, %rsp            # imm = 0x2D0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x298(%rbp)
movl %eax, -0x29c(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x11b20
jmp 0x1c1c6
jmp 0x1c1c8
movq -0x298(%rbp), %rdi
callq 0x3430
movq %rax, %rdi
callq 0x1a490
nopl (%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpl $0x8, -0x1c(%rbp)
jne 0x1de29
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x4(%rbp)
jmp 0x1deae
cmpl $0x4, -0x1c(%rbp)
jne 0x1de54
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
shrq %rcx
movzbl (%rax,%rcx), %eax
movq -0x18(%rbp), %rcx
andq $0x1, %rcx
shlq $0x2, %rcx
sarl %cl, %eax
andl $0xf, %eax
movl %eax, -0x4(%rbp)
jmp 0x1deae
cmpl $0x2, -0x1c(%rbp)
jne 0x1de7f
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
shrq $0x2, %rcx
movzbl (%rax,%rcx), %eax
movq -0x18(%rbp), %rcx
andq $0x3, %rcx
shlq %rcx
sarl %cl, %eax
andl $0x3, %eax
movl %eax, -0x4(%rbp)
jmp 0x1deae
cmpl $0x1, -0x1c(%rbp)
jne 0x1dea7
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
shrq $0x3, %rcx
movzbl (%rax,%rcx), %eax
movq -0x18(%rbp), %rcx
andq $0x7, %rcx
sarl %cl, %eax
andl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x1deae
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::validateICC(lodepng::LodePNGICC const*)
static unsigned validateICC(const LodePNGICC* icc) {
  /* disable for unsupported things in the icc profile */
  if(icc->inputspace == 0) return 0;
  /* if we didn't recognize both chrm and trc, then maybe the ICC uses data
  types not supported here yet, so fall back to not using it. */
  if(icc->inputspace == 2) {
    /* RGB profile should have chromaticities */
    if(!icc->has_chromaticity) return 0;
  }
  /* An ICC profile without whitepoint is invalid for the kind of profiles used here. */
  if(!icc->has_whitepoint) return 0;
  if(!icc->has_trc) return 0;
  return 1; /* ok */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x1ef0a
movl $0x0, -0x4(%rbp)
jmp 0x1ef55
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x1ef28
movq -0x10(%rbp), %rax
cmpl $0x0, 0x54(%rax)
jne 0x1ef26
movl $0x0, -0x4(%rbp)
jmp 0x1ef55
jmp 0x1ef28
movq -0x10(%rbp), %rax
cmpl $0x0, 0x44(%rax)
jne 0x1ef3b
movl $0x0, -0x4(%rbp)
jmp 0x1ef55
movq -0x10(%rbp), %rax
cmpl $0x0, 0x7c(%rax)
jne 0x1ef4e
movl $0x0, -0x4(%rbp)
jmp 0x1ef55
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x80, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x14(%rbp), %eax
movl %eax, %edi
movl -0x18(%rbp), %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdx
callq 0x1ef60
cmpl $0x0, %eax
je 0x1f370
movl $0x5c, -0x4(%rbp)
jmp 0x1f465
leaq -0x70(%rbp), %rdi
movq 0x10(%rbp), %rsi
movl -0x24(%rbp), %edx
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %r8
callq 0x21940
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x1f39c
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1f465
cmpl $0x0, -0x24(%rbp)
je 0x1f3af
movq -0x30(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x1f45e
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x1f45c
movq -0x40(%rbp), %rax
shlq $0x2, %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rdi
movq -0x78(%rbp), %rax
addq $0x0, %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movq -0x78(%rbp), %rax
addq $0x1, %rax
shlq $0x2, %rax
addq %rax, %rsi
movq -0x10(%rbp), %rdx
movq -0x78(%rbp), %rax
addq $0x2, %rax
shlq $0x2, %rax
addq %rax, %rdx
leaq -0x70(%rbp), %rcx
movq -0x10(%rbp), %rax
movq -0x78(%rbp), %r8
movss (%rax,%r8,4), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x10(%rbp), %rax
movq -0x78(%rbp), %r8
movss 0x4(%rax,%r8,4), %xmm1
cvtss2sd %xmm1, %xmm1
movq -0x10(%rbp), %rax
movq -0x78(%rbp), %r8
movss 0x8(%rax,%r8,4), %xmm2
cvtss2sd %xmm2, %xmm2
callq 0x21b80
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x1f3b7
jmp 0x1f45e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::convertToXYZFloat(float*, float*, float const*, unsigned int, unsigned int, LodePNGState const*)
unsigned convertToXYZFloat(float* out, float whitepoint[3], const float* in,
                           unsigned w, unsigned h, const LodePNGState* state) {
  unsigned error = 0;
  const LodePNGInfo* info = &state->info_png;

  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);
  }
  /* Input is floating point, so lookup table cannot be used, but it's ensured to
  use float pow, not the slower double pow. */
  error = convertToXYZ_gamma(out, in, w, h, info, use_icc, &icc);
  if(error) goto cleanup;
  error = convertToXYZ_chrm(out, w, h, info, use_icc, &icc, whitepoint);
  if(error) goto cleanup;

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x28(%rbp), %rax
addq $0xd0, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x1df30
movq -0x38(%rbp), %rax
cmpl $0x0, 0xfc(%rax)
je 0x1f514
movq -0x38(%rbp), %rax
movq 0x108(%rax), %rsi
movq -0x38(%rbp), %rax
movl 0x110(%rax), %eax
movl %eax, %edx
leaq -0x168(%rbp), %rdi
callq 0x1e550
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x1f505
jmp 0x1f578
leaq -0x168(%rbp), %rdi
callq 0x1eef0
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movq -0x38(%rbp), %r8
movl -0x3c(%rbp), %r9d
leaq -0x168(%rbp), %rax
movq %rax, (%rsp)
callq 0x1f590
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x1f545
jmp 0x1f578
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
movq -0x38(%rbp), %rcx
movl -0x3c(%rbp), %r8d
movq -0x10(%rbp), %rax
leaq -0x168(%rbp), %r9
movq %rax, (%rsp)
callq 0x1f320
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x1f576
jmp 0x1f578
jmp 0x1f578
leaq -0x168(%rbp), %rdi
callq 0x1df80
movl -0x2c(%rbp), %eax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
// File: 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
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x20(%rbp), %rax
addq $0xd0, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x1df30
movq -0x38(%rbp), %rax
cmpl $0x0, 0xfc(%rax)
je 0x203f6
movq -0x38(%rbp), %rax
movq 0x108(%rax), %rsi
movq -0x38(%rbp), %rax
movl 0x110(%rax), %eax
movl %eax, %edx
leaq -0x168(%rbp), %rdi
callq 0x1e550
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x203e7
jmp 0x20462
leaq -0x168(%rbp), %rdi
callq 0x1eef0
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
movq -0x38(%rbp), %r8
movl -0x3c(%rbp), %r9d
movq -0x28(%rbp), %r10
movl 0x10(%rbp), %eax
leaq -0x168(%rbp), %r11
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movl %eax, 0x10(%rsp)
callq 0x1fe10
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x20437
jmp 0x20462
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movq -0x38(%rbp), %rcx
movl -0x3c(%rbp), %r8d
leaq -0x168(%rbp), %r9
callq 0x200b0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x20460
jmp 0x20462
jmp 0x20462
leaq -0x168(%rbp), %rdi
callq 0x1df80
movl -0x2c(%rbp), %eax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
nopw (%rax,%rax)
// File: lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::convertRGBModel(unsigned char*, unsigned char const*, unsigned int, unsigned int, LodePNGState const*, LodePNGState const*, unsigned int)
unsigned convertRGBModel(unsigned char* out, const unsigned char* in,
                         unsigned w, unsigned h,
                         const LodePNGState* state_out,
                         const LodePNGState* state_in,
                         unsigned rendering_intent) {
  if(modelsEqual(state_in, state_out)) {
    return lodepng_convert(out, in, &state_out->info_raw, &state_in->info_raw, w, h);
  } else {
    unsigned error = 0;
    size_t n, bytes;
    if(lodepng_mulofl((size_t)w, (size_t)h, &n)) return 92;
    if(lodepng_mulofl(n, 4 * sizeof(float), &bytes)) return 92;
    float* xyz = (float*)lodepng_malloc(bytes);
    float whitepoint[3];
    error = convertToXYZ(xyz, whitepoint, in, w, h, state_in);
    if (!error) error = convertFromXYZ(out, xyz, w, h, state_out, whitepoint, rendering_intent);
    lodepng_free(xyz);
    return error;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x205a0
cmpl $0x0, %eax
je 0x204e6
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
addq $0xa8, %rdx
movq -0x30(%rbp), %rcx
addq $0xa8, %rcx
movl -0x1c(%rbp), %r8d
movl -0x20(%rbp), %r9d
callq 0x6d60
movl %eax, -0x4(%rbp)
jmp 0x20596
movl $0x0, -0x34(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, %edi
movl -0x20(%rbp), %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdx
callq 0x1ef60
cmpl $0x0, %eax
je 0x20511
movl $0x5c, -0x4(%rbp)
jmp 0x20596
movq -0x40(%rbp), %rdi
movl $0x10, %esi
leaq -0x48(%rbp), %rdx
callq 0x1ef60
cmpl $0x0, %eax
je 0x20531
movl $0x5c, -0x4(%rbp)
jmp 0x20596
movq -0x48(%rbp), %rdi
callq 0x1efb0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
leaq -0x5c(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
movl -0x20(%rbp), %r8d
movq -0x30(%rbp), %r9
callq 0x1dfd0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x20587
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movq -0x28(%rbp), %r8
leaq -0x5c(%rbp), %r9
movl 0x10(%rbp), %eax
movl %eax, (%rsp)
callq 0x1f890
movl %eax, -0x34(%rbp)
movq -0x50(%rbp), %rdi
callq 0x1df10
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nop
// File: 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
movq %rsp, %rbp
subq $0x2b0, %rsp            # imm = 0x2B0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0xd2a0
leaq -0x2a0(%rbp), %rdi
addq $0xa8, %rdi
movq -0x20(%rbp), %rsi
addq $0xa8, %rsi
callq 0x5780
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
movq -0x20(%rbp), %r9
leaq -0x2a0(%rbp), %r8
movl $0x1, (%rsp)
callq 0x20480
addq $0x2b0, %rsp            # imm = 0x2B0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq $0x4, %rax
cmpq -0x18(%rbp), %rax
jbe 0x20aee
movl $0x0, -0x4(%rbp)
jmp 0x20b6e
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
movq -0x28(%rbp), %rax
movzbl (%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x29(%rbp)
jne 0x20b63
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movzbl 0x1(%rax,%rcx), %ecx
movq -0x28(%rbp), %rax
movzbl 0x1(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x29(%rbp)
jne 0x20b63
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movzbl 0x2(%rax,%rcx), %ecx
movq -0x28(%rbp), %rax
movzbl 0x2(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x29(%rbp)
jne 0x20b63
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movzbl 0x3(%rax,%rcx), %eax
movq -0x28(%rbp), %rcx
movzbl 0x3(%rcx), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::decodeICCInt32(unsigned char const*, unsigned long, unsigned long*)
static int decodeICCInt32(const unsigned char* data, size_t size, size_t* pos) {
  *pos += 4;
  if (*pos > size) return 0;
  /*TODO: this is incorrect if sizeof(int) != 4*/
  return (data[*pos - 4] << 24) | (data[*pos - 3] << 16) | (data[*pos - 2] << 8) | (data[*pos - 1] << 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rcx
addq $0x4, %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
cmpq -0x18(%rbp), %rax
jbe 0x20c24
movl $0x0, -0x4(%rbp)
jmp 0x20c85
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
subq $0x4, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rdx
movq (%rdx), %rdx
subq $0x3, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rdx
movq (%rdx), %rdx
subq $0x2, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rdx
movq (%rdx), %rdx
subq $0x1, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x0, %ecx
orl %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::mulMatrix(float*, float*, float*, float const*, double, double, double)
static void mulMatrix(float* x2, float* y2, float* z2, const float* m, double x, double y, double z) {
  /* double used as inputs even though in general the images are float, so the sums happen in
  double precision, because float can give numerical problems for nearby values */
  *x2 = (float)(x * m[0] + y * m[1] + z * m[2]);
  *y2 = (float)(x * m[3] + y * m[4] + z * m[5]);
  *z2 = (float)(x * m[6] + y * m[7] + z * m[8]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movsd %xmm0, -0x28(%rbp)
movsd %xmm1, -0x30(%rbp)
movsd %xmm2, -0x38(%rbp)
movsd -0x28(%rbp), %xmm1
movq -0x20(%rbp), %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm2
movsd -0x30(%rbp), %xmm0
movq -0x20(%rbp), %rax
movss 0x4(%rax), %xmm3
cvtss2sd %xmm3, %xmm3
mulsd %xmm3, %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x38(%rbp), %xmm0
movq -0x20(%rbp), %rax
movss 0x8(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, (%rax)
movsd -0x28(%rbp), %xmm1
movq -0x20(%rbp), %rax
movss 0xc(%rax), %xmm0
cvtss2sd %xmm0, %xmm2
movsd -0x30(%rbp), %xmm0
movq -0x20(%rbp), %rax
movss 0x10(%rax), %xmm3
cvtss2sd %xmm3, %xmm3
mulsd %xmm3, %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x38(%rbp), %xmm0
movq -0x20(%rbp), %rax
movss 0x14(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, (%rax)
movsd -0x28(%rbp), %xmm1
movq -0x20(%rbp), %rax
movss 0x18(%rax), %xmm0
cvtss2sd %xmm0, %xmm2
movsd -0x30(%rbp), %xmm0
movq -0x20(%rbp), %rax
movss 0x1c(%rax), %xmm3
cvtss2sd %xmm3, %xmm3
mulsd %xmm3, %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x38(%rbp), %xmm0
movq -0x20(%rbp), %rax
movss 0x20(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, (%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::getChrmMatrixXY(float*, float, float, float, float, float, float, float, float)
static unsigned getChrmMatrixXY(float* m,
                                float wx, float wy,
                                float rx, float ry,
                                float gx, float gy,
                                float bx, float by) {
  if(wy == 0 || ry == 0 || gy == 0 || by == 0) {
    return 1; /* error, division through zero */
  } else {
    float wX = wx / wy, wY = 1, wZ = (1 - wx - wy) / wy;
    float rX = rx / ry, rY = 1, rZ = (1 - rx - ry) / ry;
    float gX = gx / gy, gY = 1, gZ = (1 - gx - gy) / gy;
    float bX = bx / by, bY = 1, bZ = (1 - bx - by) / by;
    return getChrmMatrixXYZ(m, wX, wY, wZ, rX, rY, rZ, gX, gY, gZ, bX, bY, bZ);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movss %xmm0, -0x14(%rbp)
movss %xmm1, -0x18(%rbp)
movss %xmm2, -0x1c(%rbp)
movss %xmm3, -0x20(%rbp)
movss %xmm4, -0x24(%rbp)
movss %xmm5, -0x28(%rbp)
movss %xmm6, -0x2c(%rbp)
movss %xmm7, -0x30(%rbp)
movss -0x18(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x220b8
jp 0x220b8
jmp 0x220e9
movss -0x20(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x220c9
jp 0x220c9
jmp 0x220e9
movss -0x28(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x220da
jp 0x220da
jmp 0x220e9
movss -0x30(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x220f5
jp 0x220f5
movl $0x1, -0x4(%rbp)
jmp 0x2223c
movss -0x14(%rbp), %xmm0
divss -0x18(%rbp), %xmm0
movss %xmm0, -0x34(%rbp)
movss 0x908e8(%rip), %xmm0    # 0xb29f4
movss %xmm0, -0x38(%rbp)
movss 0x908db(%rip), %xmm0    # 0xb29f4
subss -0x14(%rbp), %xmm0
subss -0x18(%rbp), %xmm0
divss -0x18(%rbp), %xmm0
movss %xmm0, -0x3c(%rbp)
movss -0x1c(%rbp), %xmm0
divss -0x20(%rbp), %xmm0
movss %xmm0, -0x40(%rbp)
movss 0x908b0(%rip), %xmm0    # 0xb29f4
movss %xmm0, -0x44(%rbp)
movss 0x908a3(%rip), %xmm0    # 0xb29f4
subss -0x1c(%rbp), %xmm0
subss -0x20(%rbp), %xmm0
divss -0x20(%rbp), %xmm0
movss %xmm0, -0x48(%rbp)
movss -0x24(%rbp), %xmm0
divss -0x28(%rbp), %xmm0
movss %xmm0, -0x4c(%rbp)
movss 0x90878(%rip), %xmm0    # 0xb29f4
movss %xmm0, -0x50(%rbp)
movss 0x9086b(%rip), %xmm0    # 0xb29f4
subss -0x24(%rbp), %xmm0
subss -0x28(%rbp), %xmm0
divss -0x28(%rbp), %xmm0
movss %xmm0, -0x54(%rbp)
movss -0x2c(%rbp), %xmm0
divss -0x30(%rbp), %xmm0
movss %xmm0, -0x58(%rbp)
movss 0x90840(%rip), %xmm0    # 0xb29f4
movss %xmm0, -0x5c(%rbp)
movss 0x90833(%rip), %xmm0    # 0xb29f4
subss -0x2c(%rbp), %xmm0
subss -0x30(%rbp), %xmm0
divss -0x30(%rbp), %xmm0
movss %xmm0, -0x60(%rbp)
movq -0x10(%rbp), %rdi
movss -0x34(%rbp), %xmm0
movss -0x38(%rbp), %xmm1
movss -0x3c(%rbp), %xmm2
movss -0x40(%rbp), %xmm3
movss -0x44(%rbp), %xmm4
movss -0x48(%rbp), %xmm5
movss -0x4c(%rbp), %xmm6
movss -0x50(%rbp), %xmm7
movss -0x54(%rbp), %xmm11
movss -0x58(%rbp), %xmm10
movss -0x5c(%rbp), %xmm9
movss -0x60(%rbp), %xmm8
movss %xmm11, (%rsp)
movss %xmm10, 0x8(%rsp)
movss %xmm9, 0x10(%rsp)
movss %xmm8, 0x18(%rsp)
callq 0x22910
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)