MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / stb_decompress_token

Function stb_decompress_token

KBotExt/imgui/imgui_draw.cpp:4042–4058  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4040#define stb__in4(x) ((i[x] << 24) + stb__in3((x)+1))
4041
4042static const unsigned char* stb_decompress_token(const unsigned char* i)
4043{
4044 if (*i >= 0x20) { // use fewer if's for cases that expand small
4045 if (*i >= 0x80) stb__match(stb__dout - i[1] - 1, i[0] - 0x80 + 1), i += 2;
4046 else if (*i >= 0x40) stb__match(stb__dout - (stb__in2(0) - 0x4000 + 1), i[2] + 1), i += 3;
4047 else /* *i >= 0x20 */ stb__lit(i + 1, i[0] - 0x20 + 1), i += 1 + (i[0] - 0x20 + 1);
4048 }
4049 else { // more ifs for cases that expand large, since overhead is amortized
4050 if (*i >= 0x18) stb__match(stb__dout - (stb__in3(0) - 0x180000 + 1), i[3] + 1), i += 4;
4051 else if (*i >= 0x10) stb__match(stb__dout - (stb__in3(0) - 0x100000 + 1), stb__in2(3) + 1), i += 5;
4052 else if (*i >= 0x08) stb__lit(i + 2, stb__in2(0) - 0x0800 + 1), i += 2 + (stb__in2(0) - 0x0800 + 1);
4053 else if (*i == 0x07) stb__lit(i + 3, stb__in2(1) + 1), i += 3 + (stb__in2(1) + 1);
4054 else if (*i == 0x06) stb__match(stb__dout - (stb__in3(1) + 1), i[4] + 1), i += 5;
4055 else if (*i == 0x04) stb__match(stb__dout - (stb__in3(1) + 1), stb__in2(4) + 1), i += 6;
4056 }
4057 return i;
4058}
4059
4060static unsigned int stb_adler32(unsigned int adler32, unsigned char* buffer, unsigned int buflen)
4061{

Callers 1

stb_decompressFunction · 0.85

Calls 2

stb__matchFunction · 0.85
stb__litFunction · 0.85

Tested by

no test coverage detected