#include <stdio.h>
#include <stdlib.h>

int Decompress(char* inbuf, char* outbuf, size_t inlen, size_t *outlen);

char inbuf[10000];
char outbuf[10000];

int main()
{
    int c, i;
    long flen;
    size_t olen;

    FILE* ifptr = fopen("test.in", "rb");
    FILE* ofptr = fopen("test.out", "wb");

    fseek(ifptr, 0, SEEK_END);
    flen = ftell(ifptr);
    fseek(ifptr, 0, SEEK_SET);
    
    fread(inbuf, (size_t) flen, 1, ifptr);

    olen = GetDecompressedBufSize(inbuf);

    Decompress(inbuf, outbuf, (size_t)flen, &olen);

    fwrite(outbuf, olen, 1, ofptr);

    return 0;
}
