factor(n) long *n;
{
  long x;
  long y;
  switch (yyselect()) {
  case 8: {
    factor(&x);
    get_lexval();
    primary(&y);
    *n = x * y;
  } break;
  case 9: {
    factor(&x);
    get_lexval();
    primary(&y);
    *n = x / y;
  } break;
  case 10: {
    primary(n);
  } break;
  }
}


x86 assembly (clang, -O0):
<factor>:
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    $0x8,%eax
je     1188 <factor+0x48>
jmp    1166 <factor+0x26>
mov    -0x24(%rbp),%eax
sub    $0x9,%eax
je     11b8 <factor+0x78>
jmp    1177 <factor+0x37>
mov    -0x24(%rbp),%eax
sub    $0xa,%eax
je     11ec <factor+0xac>
jmp    11f7 <factor+0xb7>
lea    -0x18(%rbp),%rdi
call   1060 <factor@plt>
mov    $0x0,%al
call   1040 <get_lexval@plt>
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1050 <primary@plt>
mov    -0x18(%rbp),%rcx
imul   -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    11f7 <factor+0xb7>
lea    -0x18(%rbp),%rdi
call   1060 <factor@plt>
mov    $0x0,%al
call   1040 <get_lexval@plt>
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1050 <primary@plt>
mov    -0x18(%rbp),%rax
cqto
idivq  -0x20(%rbp)
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    11f7 <factor+0xb7>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <primary@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factor>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <yyselect@plt>
cmp    $0xa,%eax
je     1185 <factor+0x45>
cmp    $0x9,%eax
je     1191 <factor+0x51>
cmp    $0x8,%eax
jne    11cf <factor+0x8f>
lea    0x8(%rsp),%rdi
call   1060 <factor@plt>
xor    %eax,%eax
call   1040 <get_lexval@plt>
mov    %rsp,%rdi
xor    %eax,%eax
call   1050 <primary@plt>
mov    (%rsp),%rax
imul   0x8(%rsp),%rax
jmp    11cc <factor+0x8c>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <primary@plt>
jmp    11cf <factor+0x8f>
lea    0x8(%rsp),%rdi
call   1060 <factor@plt>
xor    %eax,%eax
call   1040 <get_lexval@plt>
mov    %rsp,%rdi
xor    %eax,%eax
call   1050 <primary@plt>
mov    0x8(%rsp),%rax
mov    (%rsp),%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     11c8 <factor+0x88>
cqto
idiv   %rcx
jmp    11cc <factor+0x8c>
xor    %edx,%edx
div    %ecx
mov    %rax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @factor(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 8, label %7
i32 9, label %15
i32 10, label %23
]
7: ; preds = %1
%8 = call i32 @factor(i64* %4)
%9 = call i32 (...) @get_lexval()
%10 = call i32 (i64*, ...) bitcast (i32 (...)* @primary to i32 (i64*, ...)*)(i64* %5)
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = mul nsw i64 %11, %12
%14 = load i64*, i64** %3
store i64 %13, i64* %14
br label %26
15: ; preds = %1
%16 = call i32 @factor(i64* %4)
%17 = call i32 (...) @get_lexval()
%18 = call i32 (i64*, ...) bitcast (i32 (...)* @primary to i32 (i64*, ...)*)(i64* %5)
%19 = load i64, i64* %4
%20 = load i64, i64* %5
%21 = sdiv 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 (...)* @primary 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 @factor(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 8, label %7
i32 9, label %14
i32 10, label %21
]
7: ; preds = %1
%8 = call i32 @factor(i64* %2)
%9 = call i32 (...) @get_lexval()
%10 = call i32 (i64*, ...) bitcast (i32 (...)* @primary to i32 (i64*, ...)*)(i64* %3)
%11 = load i64, i64* %2
%12 = load i64, i64* %3
%13 = mul nsw i64 %12, %11
store i64 %13, i64* %0
br label %23
14: ; preds = %1
%15 = call i32 @factor(i64* %2)
%16 = call i32 (...) @get_lexval()
%17 = call i32 (i64*, ...) bitcast (i32 (...)* @primary to i32 (i64*, ...)*)(i64* %3)
%18 = load i64, i64* %2
%19 = load i64, i64* %3
%20 = sdiv i64 %18, %19
store i64 %20, i64* %0
br label %23
21: ; preds = %1
%22 = tail call i32 (i64*, ...) bitcast (i32 (...)* @primary to i32 (i64*, ...)*)(i64* %0)
br label %23
23: ; preds = %1, %21, %14, %7
ret i32 undef
}