// File: Lut99[P]RayTracer/src/lib/LodePNG.cpp
// Function: lodepng_error_text(unsigned int)
const char* lodepng_error_text(unsigned code) {
  switch(code) {
    case 0: return "no error, everything went ok";
    case 1: return "nothing done yet"; /*the Encoder/Decoder has done nothing yet, error checking makes no sense yet*/
    case 10: return "end of input memory reached without huffman end code"; /*while huffman decoding*/
    case 11: return "error in code tree made it jump outside of huffman tree"; /*while huffman decoding*/
    case 13: return "problem while processing dynamic deflate block";
    case 14: return "problem while processing dynamic deflate block";
    case 15: return "problem while processing dynamic deflate block";
    /*this error could happen if there are only 0 or 1 symbols present in the huffman code:*/
    case 16: return "nonexistent code while processing dynamic deflate block";
    case 17: return "end of out buffer memory reached while inflating";
    case 18: return "invalid distance code while inflating";
    case 19: return "end of out buffer memory reached while inflating";
    case 20: return "invalid deflate block BTYPE encountered while decoding";
    case 21: return "NLEN is not ones complement of LEN in a deflate block";

    /*end of out buffer memory reached while inflating:
    This can happen if the inflated deflate data is longer than the amount of bytes required to fill up
    all the pixels of the image, given the color depth and image dimensions. Something that doesn't
    happen in a normal, well encoded, PNG image.*/
    case 22: return "end of out buffer memory reached while inflating";
    case 23: return "end of in buffer memory reached while inflating";
    case 24: return "invalid FCHECK in zlib header";
    case 25: return "invalid compression method in zlib header";
    case 26: return "FDICT encountered in zlib header while it's not used for PNG";
    case 27: return "PNG file is smaller than a PNG header";
    /*Checks the magic file header, the first 8 bytes of the PNG file*/
    case 28: return "incorrect PNG signature, it's no PNG or corrupted";
    case 29: return "first chunk is not the header chunk";
    case 30: return "chunk length too large, chunk broken off at end of file";
    case 31: return "illegal PNG color type or bpp";
    case 32: return "illegal PNG compression method";
    case 33: return "illegal PNG filter method";
    case 34: return "illegal PNG interlace method";
    case 35: return "chunk length of a chunk is too large or the chunk too small";
    case 36: return "illegal PNG filter type encountered";
    case 37: return "illegal bit depth for this color type given";
    case 38: return "the palette is too small or too big"; /*0, or more than 256 colors*/
    case 39: return "tRNS chunk before PLTE or has more entries than palette size";
    case 40: return "tRNS chunk has wrong size for grayscale image";
    case 41: return "tRNS chunk has wrong size for RGB image";
    case 42: return "tRNS chunk appeared while it was not allowed for this color type";
    case 43: return "bKGD chunk has wrong size for palette image";
    case 44: return "bKGD chunk has wrong size for grayscale image";
    case 45: return "bKGD chunk has wrong size for RGB image";
    case 48: return "empty input buffer given to decoder. Maybe caused by non-existing file?";
    case 49: return "jumped past memory while generating dynamic huffman tree";
    case 50: return "jumped past memory while generating dynamic huffman tree";
    case 51: return "jumped past memory while inflating huffman block";
    case 52: return "jumped past memory while inflating";
    case 53: return "size of zlib data too small";
    case 54: return "repeat symbol in tree while there was no value symbol yet";
    /*jumped past tree while generating huffman tree, this could be when the
    tree will have more leaves than symbols after generating it out of the
    given lengths. They call this an oversubscribed dynamic bit lengths tree in zlib.*/
    case 55: return "jumped past tree while generating huffman tree";
    case 56: return "given output image colortype or bitdepth not supported for color conversion";
    case 57: return "invalid CRC encountered (checking CRC can be disabled)";
    case 58: return "invalid ADLER32 encountered (checking ADLER32 can be disabled)";
    case 59: return "requested color conversion not supported";
    case 60: return "invalid window size given in the settings of the encoder (must be 0-32768)";
    case 61: return "invalid BTYPE given in the settings of the encoder (only 0, 1 and 2 are allowed)";
    /*LodePNG leaves the choice of RGB to grayscale conversion formula to the user.*/
    case 62: return "conversion from color to grayscale not supported";
    /*(2^31-1)*/
    case 63: return "length of a chunk too long, max allowed for PNG is 2147483647 bytes per chunk";
    /*this would result in the inability of a deflated block to ever contain an end code. It must be at least 1.*/
    case 64: return "the length of the END symbol 256 in the Huffman tree is 0";
    case 66: return "the length of a text chunk keyword given to the encoder is longer than the maximum of 79 bytes";
    case 67: return "the length of a text chunk keyword given to the encoder is smaller than the minimum of 1 byte";
    case 68: return "tried to encode a PLTE chunk with a palette that has less than 1 or more than 256 colors";
    case 69: return "unknown chunk type with 'critical' flag encountered by the decoder";
    case 71: return "nonexistent interlace mode given to encoder (must be 0 or 1)";
    case 72: return "while decoding, nonexistent compression method encountering in zTXt or iTXt chunk (it must be 0)";
    case 73: return "invalid tIME chunk size";
    case 74: return "invalid pHYs chunk size";
    /*length could be wrong, or data chopped off*/
    case 75: return "no null termination char found while decoding text chunk";
    case 76: return "iTXt chunk too short to contain required bytes";
    case 77: return "integer overflow in buffer size";
    case 78: return "failed to open file for reading"; /*file doesn't exist or couldn't be opened for reading*/
    case 79: return "failed to open file for writing";
    case 80: return "tried creating a tree of 0 symbols";
    case 81: return "lazy matching at pos 0 is impossible";
    case 82: return "color conversion to palette requested while a color isn't in palette, or index out of bounds";
    case 83: return "memory allocation failed";
    case 84: return "given image too small to contain all pixels to be encoded";
    case 86: return "impossible offset in lz77 encoding (internal bug)";
    case 87: return "must provide custom zlib function pointer if LODEPNG_COMPILE_ZLIB is not defined";
    case 88: return "invalid filter strategy given for LodePNGEncoderSettings.filter_strategy";
    case 89: return "text chunk keyword too short or long: must have size 1-79";
    /*the windowsize in the LodePNGCompressSettings. Requiring POT(==> & instead of %) makes encoding 12% faster.*/
    case 90: return "windowsize must be a power of two";
    case 91: return "invalid decompressed idat size";
    case 92: return "integer overflow due to too many pixels";
    case 93: return "zero width or height is invalid";
    case 94: return "header chunk must have a size of 13 bytes";
    case 95: return "integer overflow with combined idat chunk size";
    case 96: return "invalid gAMA chunk size";
    case 97: return "invalid cHRM chunk size";
    case 98: return "invalid sRGB chunk size";
    case 99: return "invalid sRGB rendering intent";
    case 100: return "invalid ICC profile color type, the PNG specification only allows RGB or GRAY";
    case 101: return "PNG specification does not allow RGB ICC profile on gray color types and vice versa";
    case 102: return "not allowed to set grayscale ICC profile with colored pixels by PNG specification";
    case 103: return "invalid palette index in bKGD chunk. Maybe it came before PLTE chunk?";
    case 104: return "invalid bKGD color while encoding (e.g. palette index out of range)";
    case 105: return "integer overflow of bitsize";
    case 106: return "PNG file must have PLTE chunk if color type is palette";
    case 107: return "color convert from palette mode requested without setting the palette data in it";
    case 108: return "tried to add more than 256 values to a palette";
  }
  return "unknown error code";
}

// Assembly:
movl %edi, -0xc(%rsp)
movl -0xc(%rsp), %eax
movq %rax, -0x18(%rsp)
subq $0x6c, %rax
ja 0x14a8c0
movq -0x18(%rsp), %rax
leaq 0x2bf35(%rip), %rcx     # 0x1761b8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2c47e(%rip), %rax     # 0x176711
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c48a(%rip), %rax     # 0x17672e
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c48a(%rip), %rax     # 0x17673f
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c4ae(%rip), %rax     # 0x176774
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c4d5(%rip), %rax     # 0x1767ac
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c4c4(%rip), %rax     # 0x1767ac
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c4b3(%rip), %rax     # 0x1767ac
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c4d1(%rip), %rax     # 0x1767db
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c4f8(%rip), %rax     # 0x176813
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c518(%rip), %rax     # 0x176844
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c4d6(%rip), %rax     # 0x176813
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c51c(%rip), %rax     # 0x17686a
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c542(%rip), %rax     # 0x1768a1
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c4a3(%rip), %rax     # 0x176813
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c556(%rip), %rax     # 0x1768d7
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c575(%rip), %rax     # 0x176907
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c582(%rip), %rax     # 0x176925
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c59b(%rip), %rax     # 0x17694f
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c5c7(%rip), %rax     # 0x17698c
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c5dc(%rip), %rax     # 0x1769b2
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c5fd(%rip), %rax     # 0x1769e4
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c610(%rip), %rax     # 0x176a08
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c637(%rip), %rax     # 0x176a40
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c644(%rip), %rax     # 0x176a5e
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c652(%rip), %rax     # 0x176a7d
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c65b(%rip), %rax     # 0x176a97
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c667(%rip), %rax     # 0x176ab4
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c692(%rip), %rax     # 0x176af0
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c6a5(%rip), %rax     # 0x176b14
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c6c0(%rip), %rax     # 0x176b40
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c6d3(%rip), %rax     # 0x176b64
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c6ff(%rip), %rax     # 0x176ba1
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c71c(%rip), %rax     # 0x176bcf
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c733(%rip), %rax     # 0x176bf7
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c763(%rip), %rax     # 0x176c38
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c77e(%rip), %rax     # 0x176c64
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c79b(%rip), %rax     # 0x176c92
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c7b2(%rip), %rax     # 0x176cba
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c7e9(%rip), %rax     # 0x176d02
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c7d8(%rip), %rax     # 0x176d02
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c800(%rip), %rax     # 0x176d3b
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c820(%rip), %rax     # 0x176d6c
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c832(%rip), %rax     # 0x176d8f
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c83d(%rip), %rax     # 0x176dab
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c866(%rip), %rax     # 0x176de5
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c884(%rip), %rax     # 0x176e14
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c8bf(%rip), %rax     # 0x176e60
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c8e5(%rip), %rax     # 0x176e97
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c913(%rip), %rax     # 0x176ed6
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c92b(%rip), %rax     # 0x176eff
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c965(%rip), %rax     # 0x176f4a
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c9a5(%rip), %rax     # 0x176f9b
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2c9c5(%rip), %rax     # 0x176fcc
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2ca02(%rip), %rax     # 0x17701a
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2ca2b(%rip), %rax     # 0x177054
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2ca79(%rip), %rax     # 0x1770b3
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cac6(%rip), %rax     # 0x177111
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cb0e(%rip), %rax     # 0x17716a
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cb40(%rip), %rax     # 0x1771ad
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cb6c(%rip), %rax     # 0x1771ea
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cbbc(%rip), %rax     # 0x17724b
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cbc3(%rip), %rax     # 0x177263
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cbca(%rip), %rax     # 0x17727b
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cbf2(%rip), %rax     # 0x1772b4
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cc10(%rip), %rax     # 0x1772e3
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cc1f(%rip), %rax     # 0x177303
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cc2e(%rip), %rax     # 0x177323
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cc3d(%rip), %rax     # 0x177343
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cc4f(%rip), %rax     # 0x177366
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cc63(%rip), %rax     # 0x17738b
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2ccaf(%rip), %rax     # 0x1773e8
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2ccb7(%rip), %rax     # 0x177401
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cce0(%rip), %rax     # 0x17743b
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cd01(%rip), %rax     # 0x17746d
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cd41(%rip), %rax     # 0x1774be
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cd79(%rip), %rax     # 0x177507
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cda2(%rip), %rax     # 0x177541
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cdb3(%rip), %rax     # 0x177563
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cdc1(%rip), %rax     # 0x177582
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cdd8(%rip), %rax     # 0x1775aa
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cde7(%rip), %rax     # 0x1775ca
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2ce00(%rip), %rax     # 0x1775f4
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2ce1e(%rip), %rax     # 0x177623
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2ce25(%rip), %rax     # 0x17763b
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2ce2c(%rip), %rax     # 0x177653
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2ce33(%rip), %rax     # 0x17766b
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2ce40(%rip), %rax     # 0x177689
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2ce80(%rip), %rax     # 0x1776d7
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cec6(%rip), %rax     # 0x17772b
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cf0a(%rip), %rax     # 0x17777d
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cf42(%rip), %rax     # 0x1777c3
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cf78(%rip), %rax     # 0x177807
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cf86(%rip), %rax     # 0x177823
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cfaf(%rip), %rax     # 0x17785a
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2cff2(%rip), %rax     # 0x1778ab
movq %rax, -0x8(%rsp)
jmp 0x14a8cc
leaq 0x2d013(%rip), %rax     # 0x1778da
movq %rax, -0x8(%rsp)
movq -0x8(%rsp), %rax
retq
nopw %cs:(%rax,%rax)