term(n) long *n;
{
  long x;
  long y;
  switch (yyselect()) {
  case 5: {
    term(&x);
    get_lexval();
    factor(&y);
    *n = x + y;
  } break;
  case 6: {
    term(&x);
    get_lexval();
    factor(&y);
    *n = x - y;
  } break;
  case 7: {
    factor(n);
  } break;
  }
}


x86 assembly (clang, -O0):
<term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
call   1030 <yyselect@plt>
mov    %eax,%ecx
mov    %ecx,-0x24(%rbp)
sub    $0x5,%eax
je     1188 <term+0x48>
jmp    1166 <term+0x26>
mov    -0x24(%rbp),%eax
sub    $0x6,%eax
je     11b7 <term+0x77>
jmp    1177 <term+0x37>
mov    -0x24(%rbp),%eax
sub    $0x7,%eax
je     11e6 <term+0xa6>
jmp    11f1 <term+0xb1>
lea    -0x18(%rbp),%rdi
call   1050 <term@plt>
mov    $0x0,%al
call   1040 <get_lexval@plt>
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1060 <factor@plt>
mov    -0x18(%rbp),%rcx
add    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    11f1 <term+0xb1>
lea    -0x18(%rbp),%rdi
call   1050 <term@plt>
mov    $0x0,%al
call   1040 <get_lexval@plt>
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1060 <factor@plt>
mov    -0x18(%rbp),%rcx
sub    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    11f1 <term+0xb1>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1060 <factor@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <yyselect@plt>
cmp    $0x7,%eax
je     1184 <term+0x44>
cmp    $0x6,%eax
je     1190 <term+0x50>
cmp    $0x5,%eax
jne    11b7 <term+0x77>
lea    0x8(%rsp),%rdi
call   1050 <term@plt>
xor    %eax,%eax
call   1040 <get_lexval@plt>
mov    %rsp,%rdi
xor    %eax,%eax
call   1060 <factor@plt>
mov    (%rsp),%rax
add    0x8(%rsp),%rax
jmp    11b4 <term+0x74>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <factor@plt>
jmp    11b7 <term+0x77>
lea    0x8(%rsp),%rdi
call   1050 <term@plt>
xor    %eax,%eax
call   1040 <get_lexval@plt>
mov    %rsp,%rdi
xor    %eax,%eax
call   1060 <factor@plt>
mov    0x8(%rsp),%rax
sub    (%rsp),%rax
mov    %rax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @term(i64* %0) {
%2 = alloca i32
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
%6 = call i32 (...) @yyselect()
switch i32 %6, label %26 [
i32 5, label %7
i32 6, label %15
i32 7, label %23
]
7: ; preds = %1
%8 = call i32 @term(i64* %4)
%9 = call i32 (...) @get_lexval()
%10 = call i32 (i64*, ...) bitcast (i32 (...)* @factor to i32 (i64*, ...)*)(i64* %5)
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = add nsw i64 %11, %12
%14 = load i64*, i64** %3
store i64 %13, i64* %14
br label %26
15: ; preds = %1
%16 = call i32 @term(i64* %4)
%17 = call i32 (...) @get_lexval()
%18 = call i32 (i64*, ...) bitcast (i32 (...)* @factor to i32 (i64*, ...)*)(i64* %5)
%19 = load i64, i64* %4
%20 = load i64, i64* %5
%21 = sub nsw i64 %19, %20
%22 = load i64*, i64** %3
store i64 %21, i64* %22
br label %26
23: ; preds = %1
%24 = load i64*, i64** %3
%25 = call i32 (i64*, ...) bitcast (i32 (...)* @factor to i32 (i64*, ...)*)(i64* %24)
br label %26
26: ; preds = %1, %23, %15, %7
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @term(i64* %0) {
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %2 to i8*
%5 = bitcast i64* %3 to i8*
%6 = tail call i32 (...) @yyselect()
switch i32 %6, label %23 [
i32 5, label %7
i32 6, label %14
i32 7, label %21
]
7: ; preds = %1
%8 = call i32 @term(i64* %2)
%9 = call i32 (...) @get_lexval()
%10 = call i32 (i64*, ...) bitcast (i32 (...)* @factor to i32 (i64*, ...)*)(i64* %3)
%11 = load i64, i64* %2
%12 = load i64, i64* %3
%13 = add nsw i64 %12, %11
store i64 %13, i64* %0
br label %23
14: ; preds = %1
%15 = call i32 @term(i64* %2)
%16 = call i32 (...) @get_lexval()
%17 = call i32 (i64*, ...) bitcast (i32 (...)* @factor to i32 (i64*, ...)*)(i64* %3)
%18 = load i64, i64* %2
%19 = load i64, i64* %3
%20 = sub nsw i64 %18, %19
store i64 %20, i64* %0
br label %23
21: ; preds = %1
%22 = tail call i32 (i64*, ...) bitcast (i32 (...)* @factor to i32 (i64*, ...)*)(i64* %0)
br label %23
23: ; preds = %1, %21, %14, %7
ret i32 undef
}