heir3(lval) int lval[];
{
  int k, lval2[2];
  k = heir4(lval);
  blanks();
  if (ch() != '^')
    return k;
  if (k)
    rvalue(lval);
  while (1) {
    if (match("^")) {
      zpush();
      if (heir4(lval2))
        rvalue(lval2);
      zpop();
      zxor();
    } else
      return 0;
  }
}


x86 assembly (clang, -O0):
<heir3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   10a0 <heir4@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1060 <blanks@plt>
mov    $0x0,%al
call   1050 <ch@plt>
cmp    $0x5e,%eax
je     11bc <heir3+0x3c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1237 <heir3+0xb7>
cmpl   $0x0,-0x14(%rbp)
je     11d1 <heir3+0x51>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <rvalue@plt>
jmp    11d6 <heir3+0x56>
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1080 <match@plt>
cmp    $0x0,%eax
je     1226 <heir3+0xa6>
mov    $0x0,%al
call   1040 <zpush@plt>
lea    -0x1c(%rbp),%rdi
mov    $0x0,%al
call   10a0 <heir4@plt>
cmp    $0x0,%eax
je     1213 <heir3+0x93>
lea    -0x1c(%rbp),%rdi
mov    $0x0,%al
call   1030 <rvalue@plt>
mov    $0x0,%al
call   1070 <zpop@plt>
mov    $0x0,%al
call   1090 <zxor@plt>
jmp    1232 <heir3+0xb2>
movl   $0x0,-0x4(%rbp)
jmp    1237 <heir3+0xb7>
jmp    11d6 <heir3+0x56>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heir3>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
xor    %eax,%eax
call   10a0 <heir4@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <blanks@plt>
xor    %eax,%eax
call   1050 <ch@plt>
cmp    $0x5e,%eax
jne    121d <heir3+0x9d>
test   %ebx,%ebx
je     11b6 <heir3+0x36>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <rvalue@plt>
lea    0xe43(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1080 <match@plt>
test   %eax,%eax
je     121d <heir3+0x9d>
lea    0x8(%rsp),%r14
lea    0xe2a(%rip),%r15
xor    %ebx,%ebx
jmp    11fc <heir3+0x7c>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <zpop@plt>
xor    %eax,%eax
call   1090 <zxor@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1080 <match@plt>
test   %eax,%eax
je     121d <heir3+0x9d>
xor    %eax,%eax
call   1040 <zpush@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   10a0 <heir4@plt>
test   %eax,%eax
je     11e0 <heir3+0x60>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <rvalue@plt>
jmp    11e0 <heir3+0x60>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"^\00"
define i32 @heir3(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca [2 x i32]
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @heir4 to i32 (i32*, ...)*)(i32* %6)
store i32 %7, i32* %4
%8 = call i32 (...) @blanks()
%9 = call i32 (...) @ch()
%10 = icmp ne i32 %9, 94
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %36
13: ; preds = %1
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32*, i32** %3
%18 = call i32 (i32*, ...) bitcast (i32 (...)* @rvalue to i32 (i32*, ...)*)(i32* %17)
br label %19
19: ; preds = %16, %13
br label %20
20: ; preds = %19, %35
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %34
23: ; preds = %20
%24 = call i32 (...) @zpush()
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%26 = call i32 (i32*, ...) bitcast (i32 (...)* @heir4 to i32 (i32*, ...)*)(i32* %25)
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %23
%29 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%30 = call i32 (i32*, ...) bitcast (i32 (...)* @rvalue to i32 (i32*, ...)*)(i32* %29)
br label %31
31: ; preds = %28, %23
%32 = call i32 (...) @zpop()
%33 = call i32 (...) @zxor()
br label %35
34: ; preds = %20
store i32 0, i32* %2
br label %36
35: ; preds = %31
br label %20
36: ; preds = %34, %11
%37 = load i32, i32* %2
ret i32 %37
}

LLVM IR (-O2):
@.str = [2 x i8] c"^\00"
define i32 @heir3(i32* %0) {
%2 = alloca [2 x i32]
%3 = bitcast [2 x i32]* %2 to i8*
%4 = tail call i32 (i32*, ...) bitcast (i32 (...)* @heir4 to i32 (i32*, ...)*)(i32* %0)
%5 = tail call i32 (...) @blanks()
%6 = tail call i32 (...) @ch()
%7 = icmp eq i32 %6, 94
br i1 %7, label %8, label %28
8: ; preds = %1
%9 = icmp eq i32 %4, 0
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = tail call i32 (i32*, ...) bitcast (i32 (...)* @rvalue to i32 (i32*, ...)*)(i32* %0)
br label %12
12: ; preds = %10, %8
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %28, label %15
15: ; preds = %12
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
br label %17
17: ; preds = %15, %23
%18 = call i32 (...) @zpush()
%19 = call i32 (i32*, ...) bitcast (i32 (...)* @heir4 to i32 (i32*, ...)*)(i32* %16)
%20 = icmp eq i32 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %17
%22 = call i32 (i32*, ...) bitcast (i32 (...)* @rvalue to i32 (i32*, ...)*)(i32* %16)
br label %23
23: ; preds = %21, %17
%24 = call i32 (...) @zpop()
%25 = call i32 (...) @zxor()
%26 = call i32 (i8*, ...) bitcast (i32 (...)* @match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %17
28: ; preds = %23, %12, %1
%29 = phi i32 [ %4, %1 ], [ 0, %12 ], [ 0, %23 ]
ret i32 %29
}