/* StdCCorpse4.c */

typedef	struct	label←t	{
	int	val[14];
} label←t;

int Proc1(n)
int n;
{
	label←t l;
	register sum = 0;
	int i;
	l.val[0] = l.val[1] = 1;
	for (i=2; i<14; i++) l.val[i] = l.val[i-1] + l.val[i-2];
	for (i=0; i<n; i++) sum += l.val[i];
	{
		int ans = sum + sum/2;
		sum += ans;
	}
	sum += 1;
	return sum;
}

Proc2()
{
	1;
}

int Proc3(i, c)
int i;
char c;
{

	{
		unsigned u;
		u = i;
		c += u;
	}
	
	{
		int d;
		d = c;
		i += d;
	}
	return i;
}

int Proc4(i, c)
int i;
char c;
{

	{
		i += c;
	}
	
	{
		c += i;
	}
	return i+c;
}


/* Test case 1 from John C. Wenn:ESCP10's message of 15 Jul 92 to Laurie Horton */

int an←int = 42;
float a←float = 3.14159;
char a←str[] = "a string!";

struct foo2←1 {
	int* i;
	float* f;
	char* c;
	};

struct foo2←1  a←foo2←1 = {&an←int, &a←float, a←str};
struct foo2←1 *p←foo2←1 = &a←foo2←1;

int depth←1←1 (f2)
  struct foo2←1* f2;
{
   *f2->i = *f2->i + 6;
   return *f2->i;
}

struct foo←bar {int a, b;};

int update←1(x, index, y)
int x;
register int index;
int y;
{
  int ix;
  static int iy = 1;
  int  results = 4;
  float other;
  char none[20];
  struct foo2←1 bletch;
  typedef struct barf {int c, d;} barf;
  barf b;
 
  other = 4.5; ix = 12; iy = 31; other = 3.141592653;
  none[0] = 'A'; none[1] = 'B'; none[2] = 'C'; none[3] = 'D'; none[4] = '\0';
  bletch.i = &results;
  bletch.f = &other;
  bletch.c = none;
  iy = depth←1←1(&bletch);
  for (ix=0; ix<10; ++ix)
  	results += (ix + index);

  return(results);

} 

/* Test Case 2 */

struct foo2 {
	int* i;
	float* f;
	char* c;
	};

struct foo1 {
	struct foo2* f2;
	int i2;
	};

struct foo2  a←foo2 = {&an←int, &a←float, a←str};
struct foo2 *p←foo2 = &a←foo2;
struct foo1  a←foo1 = {&a←foo2, 47};
struct foo1 *p←foo1 = &a←foo1;

int depth←3 (f2, f1, ch, i, pch, pi)
 struct foo2 f2;
 struct foo1* f1;
 char ch;
 int i;
 char* pch;
 int* pi;
{
    *f1->f2->i = *f1->f2->i + 23;
    *f2.i = *f2.i + 8;
    *f2.f = *f2.f + 3.2;
    return *f2.i;
}

int depth←2 (f2, f1, ch, i, pch, pi)
 struct foo2 f2;
 struct foo1* f1;
 char ch;
 int i;
 char* pch;
 int* pi;
{
    *f2.i = *f2.i + 7;
    depth←3(f2, f1, ch, i, pch, pi);
    return *f2.i;
}

int depth←1 (f2, f1, ch, i, pch, pi)
 struct foo2 f2;
 struct foo1* f1;
 char ch;
 int i;
 char* pch;
 int* pi;
{
    *f2.i = *f2.i + 6;
    depth←2(f2, f1, ch, i, pch, pi);
    return *f2.i;
}

int tinycall(ix)
  int ix;
{
  ix = ix + 23;
  return ix - 5;
}

int update(index)
 int index;
{
  int ix, iy,
     results = 4;
  float other;
  char none[20];
  struct foo2 bletch;
  struct foo1 blortch;

  other = 4.5; ix = 12; iy = 31; other = 3.141592653;
  none[0] = 'A'; none[1] = 'B'; none[2] = 'C'; none[3] = 'D'; none[4] = '\0';
  bletch.i = &results;
  bletch.f = &other;
  bletch.c = none;
  blortch.f2 = &bletch;
  blortch.i2 = iy;
  tinycall(4);
  iy = depth←1(bletch, &blortch, none[0], ix, none, &results);
  for (ix=0; ix<10; ++ix)
  	results += (ix + index);

  return(results);

}  /*  update  */