heir4(lval) int lval[];
{
  int k, lval2[2];
  k = heir5(lval);
  blanks();
  if (ch() != '&')
    return k;
  if (k)
    rvalue(lval);
  while (1) {
    if (match("&")) {
      push();
      if (heir5(lval2))
        rvalue(lval2);
      pop();
      and();
    } else
      return 0;
  }
}


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

x86 assembly (clang, -O2):
<heir4>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
xor    %eax,%eax
call   1070 <heir5@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1080 <blanks@plt>
xor    %eax,%eax
call   1040 <ch@plt>
cmp    $0x26,%eax
jne    121d <heir4+0x9d>
test   %ebx,%ebx
je     11b6 <heir4+0x36>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <rvalue@plt>
lea    0xe43(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1090 <match@plt>
test   %eax,%eax
je     121d <heir4+0x9d>
lea    0x8(%rsp),%r14
lea    0xe2a(%rip),%r15
xor    %ebx,%ebx
jmp    11fc <heir4+0x7c>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <pop@plt>
xor    %eax,%eax
call   1050 <and@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1090 <match@plt>
test   %eax,%eax
je     121d <heir4+0x9d>
xor    %eax,%eax
call   10a0 <push@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <heir5@plt>
test   %eax,%eax
je     11e0 <heir4+0x60>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <rvalue@plt>
jmp    11e0 <heir4+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 @heir4(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 (...)* @heir5 to i32 (i32*, ...)*)(i32* %6)
store i32 %7, i32* %4
%8 = call i32 (...) @blanks()
%9 = call i32 (...) @ch()
%10 = icmp ne i32 %9, 38
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 (...) @push()
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%26 = call i32 (i32*, ...) bitcast (i32 (...)* @heir5 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 (...) @pop()
%33 = call i32 (...) @and()
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 @heir4(i32* %0) {
%2 = alloca [2 x i32]
%3 = bitcast [2 x i32]* %2 to i8*
%4 = tail call i32 (i32*, ...) bitcast (i32 (...)* @heir5 to i32 (i32*, ...)*)(i32* %0)
%5 = tail call i32 (...) @blanks()
%6 = tail call i32 (...) @ch()
%7 = icmp eq i32 %6, 38
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 (...) @push()
%19 = call i32 (i32*, ...) bitcast (i32 (...)* @heir5 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 (...) @pop()
%25 = call i32 (...) @and()
%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
}