extern void Bignum_Free(int);
extern void Float_Absolute(int);
extern void Bignum_Copy(int *);

int Bignum_InitFromParam(int *p)
{
  int r5;
  if (p[21] == 0)
    p[21] = *(int *)0x02000938;
  if (*(int *)(p[21] + 56) == 0)
    Bignum_Free(p[21]);
  r5 = (short)(((short *)p)[6] & 8);
  if (r5 == 0) {
    if ((((unsigned short *)p)[6] & 16) == 0)
      return -1;
    if ((((unsigned short *)p)[6] & 4) != 0) {
      int w = p[12];
      if (w != 0) {
        if (w != (int)((char *)p + 64))
          Float_Absolute(p[21]);
        p[12] = r5;
      }
    {
      int h = -37;
      int z;
      h &= ((unsigned short *)p)[6];
      z = 0;
      ((unsigned short *)p)[6] = h;
      p[1] = z;
      p[0] = p[4];
    }
    }
    {
      int o = 8;
      o |= ((unsigned short *)p)[6];
      ((unsigned short *)p)[6] = o;
    }
  }
  if (p[4] == 0)
    Bignum_Copy(p);
  if ((((unsigned short *)p)[6] & 1) != 0) {
    p[2] = 0;
    p[6] = -p[5];
  } else {
    int t = ((unsigned short *)p)[6] & 2;
    int u = 0;
    if (t == 0)
      u = p[5];
    p[2] = u;
  }
  return 0;
}
