1/* { dg-do compile } */
2/* { dg-options "-O1" } */
3
4int *ptr;
5int *fn1 (int *);
6int fn2 (int, int);
7int fn3 (void);
8int fn4 (int);
9
10static int
11foo (int x, int y, int z)
12{
13  int b;
14  asm ("" : "=a" (b), "=&d" (x) : "0" (y), "1" (x), "mr" (z));
15  return x;
16}
17
18static int
19bar (int x, int y)
20{
21  int a;
22  if (!y)
23    {
24      for (a = 0; a <= (x >> 1); )
25	;
26      a = foo (y, fn2 (2, x), x);
27      if (x)
28	a = x;
29      return a;
30    }
31}
32
33static int
34baz (int x, int y)
35{
36  int *a = ptr;
37  int t, xk1 = fn3 (), xk = x * xk1;
38  for (t = 0; t < xk; t += xk1)
39    {
40      if (fn4 (a[2]))
41	return -y;
42      a = fn1 (a);
43    }
44  return 0;
45}
46
47void
48test (int x, long y, int z)
49{
50  int a = fn3 ();
51  int b;
52  int c = bar (x, z);
53  for (b = 0; b <= y; b++)
54    c = baz (x, c);
55  fn2 (c, a);
56}
57