/*

  LzmaDecode.c

  LZMA Decoder (optimized for Speed version)

  

  LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)

  http://www.7-zip.org/



  LZMA SDK is licensed under two licenses:

  1) GNU Lesser General Public License (GNU LGPL)

  2) Common Public License (CPL)

  It means that you can select one of these two licenses and 

  follow rules of that license.



  SPECIAL EXCEPTION:

  Igor Pavlov, as the author of this Code, expressly permits you to 

  statically or dynamically link your Code (or bind by name) to the 

  interfaces of this file without subjecting your linked Code to the 

  terms of the CPL or GNU LGPL. Any modifications or additions 

  to this file, however, are subject to the LGPL or CPL terms.

*/

#include <assert.h>



#include "edgelzma_LzmaDecode.h"



//#define Literal 0x736



//#if Literal != LZMA_BASE_SIZE

#if 0x736 != LZMA_BASE_SIZE

StopCompilingDueBUG

#endif



int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size)

{

  unsigned char prop0;

  if (size < LZMA_PROPERTIES_SIZE)

    return LZMA_RESULT_DATA_ERROR;

  prop0 = propsData[0];

  if (prop0 >= 0xE1/*(9 * 5 * 5)*/)

    return LZMA_RESULT_DATA_ERROR;

  {

    for (propsRes->pb = 0; prop0 >= 0x2D/*(9 * 5)*/; propsRes->pb++, prop0 -= 0x2D/*(9 * 5)*/);

    for (propsRes->lp = 0; prop0 >= 9; propsRes->lp++, prop0 -= 9);

    propsRes->lc = prop0;

  }

  return LZMA_RESULT_OK;

}

