struct triple *conditional_expr(struct compile_state *state) {
  struct triple *def;
  def = lor_expr(state);
  if (peek(state) == 28) {
    struct triple *test, *left, *right;
    bool(state, def);
    test = ltrue_expr(state, read_expr(state, def));
    eat(state, 28);
    left = read_expr(state, expr(state));
    eat(state, 7);
    right = read_expr(state, conditional_expr(state));
    def = mkcond_expr(state, test, left, right);
  }
  return def;
}


x86 assembly (clang, -O0):
<conditional_expr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   10b0 <lor_expr@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <peek@plt>
cmp    $0x1c,%eax
jne    1282 <conditional_expr+0xf2>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1090 <bool@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1060 <read_expr@plt>
mov    -0x40(%rbp),%rdi
mov    %eax,%esi
mov    $0x0,%al
call   1040 <ltrue_expr@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1c,%esi
mov    $0x0,%al
call   1050 <eat@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1080 <expr@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%esi
mov    $0x0,%al
call   1060 <read_expr@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x7,%esi
mov    $0x0,%al
call   1050 <eat@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   10a0 <conditional_expr@plt>
mov    -0x30(%rbp),%rdi
mov    %rax,%rsi
mov    $0x0,%al
call   1060 <read_expr@plt>
cltq
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x0,%al
call   1070 <mkcond_expr@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conditional_expr>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   10b0 <lor_expr@plt>
movslq %eax,%r14
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <peek@plt>
cmp    $0x1c,%eax
jne    1240 <conditional_expr+0xb0>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <bool@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <read_expr@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <ltrue_expr@plt>
movslq %eax,%r14
mov    %rbx,%rdi
mov    $0x1c,%esi
xor    %eax,%eax
call   1050 <eat@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <expr@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <read_expr@plt>
movslq %eax,%r15
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <eat@plt>
mov    %rbx,%rdi
call   10a0 <conditional_expr@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <read_expr@plt>
movslq %eax,%rcx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1070 <mkcond_expr@plt>
movslq %eax,%r14
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.triple = type opaque
%struct.compile_state = type opaque
define %struct.triple* @conditional_expr(%struct.compile_state* %0) {
%2 = alloca %struct.compile_state*
%3 = alloca %struct.triple*
%4 = alloca %struct.triple*
%5 = alloca %struct.triple*
%6 = alloca %struct.triple*
store %struct.compile_state* %0, %struct.compile_state** %2
%7 = load %struct.compile_state*, %struct.compile_state** %2
%8 = call i32 (%struct.compile_state*, ...) bitcast (i32 (...)* @lor_expr to i32 (%struct.compile_state*, ...)*)(%struct.compile_state* %7)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to %struct.triple*
store %struct.triple* %10, %struct.triple** %3
%11 = load %struct.compile_state*, %struct.compile_state** %2
%12 = call i32 (%struct.compile_state*, ...) bitcast (i32 (...)* @peek to i32 (%struct.compile_state*, ...)*)(%struct.compile_state* %11)
%13 = icmp eq i32 %12, 28
br i1 %13, label %14, label %48
14: ; preds = %1
%15 = load %struct.compile_state*, %struct.compile_state** %2
%16 = load %struct.triple*, %struct.triple** %3
%17 = call i32 (%struct.compile_state*, %struct.triple*, ...) bitcast (i32 (...)* @bool to i32 (%struct.compile_state*, %struct.triple*, ...)*)(%struct.compile_state* %15, %struct.triple* %16)
%18 = load %struct.compile_state*, %struct.compile_state** %2
%19 = load %struct.compile_state*, %struct.compile_state** %2
%20 = load %struct.triple*, %struct.triple** %3
%21 = call i32 (%struct.compile_state*, %struct.triple*, ...) bitcast (i32 (...)* @read_expr to i32 (%struct.compile_state*, %struct.triple*, ...)*)(%struct.compile_state* %19, %struct.triple* %20)
%22 = call i32 (%struct.compile_state*, i32, ...) bitcast (i32 (...)* @ltrue_expr to i32 (%struct.compile_state*, i32, ...)*)(%struct.compile_state* %18, i32 %21)
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to %struct.triple*
store %struct.triple* %24, %struct.triple** %4
%25 = load %struct.compile_state*, %struct.compile_state** %2
%26 = call i32 (%struct.compile_state*, i32, ...) bitcast (i32 (...)* @eat to i32 (%struct.compile_state*, i32, ...)*)(%struct.compile_state* %25, i32 28)
%27 = load %struct.compile_state*, %struct.compile_state** %2
%28 = load %struct.compile_state*, %struct.compile_state** %2
%29 = call i32 (%struct.compile_state*, ...) bitcast (i32 (...)* @expr to i32 (%struct.compile_state*, ...)*)(%struct.compile_state* %28)
%30 = call i32 (%struct.compile_state*, i32, ...) bitcast (i32 (...)* @read_expr to i32 (%struct.compile_state*, i32, ...)*)(%struct.compile_state* %27, i32 %29)
%31 = sext i32 %30 to i64
%32 = inttoptr i64 %31 to %struct.triple*
store %struct.triple* %32, %struct.triple** %5
%33 = load %struct.compile_state*, %struct.compile_state** %2
%34 = call i32 (%struct.compile_state*, i32, ...) bitcast (i32 (...)* @eat to i32 (%struct.compile_state*, i32, ...)*)(%struct.compile_state* %33, i32 7)
%35 = load %struct.compile_state*, %struct.compile_state** %2
%36 = load %struct.compile_state*, %struct.compile_state** %2
%37 = call %struct.triple* @conditional_expr(%struct.compile_state* %36)
%38 = call i32 (%struct.compile_state*, %struct.triple*, ...) bitcast (i32 (...)* @read_expr to i32 (%struct.compile_state*, %struct.triple*, ...)*)(%struct.compile_state* %35, %struct.triple* %37)
%39 = sext i32 %38 to i64
%40 = inttoptr i64 %39 to %struct.triple*
store %struct.triple* %40, %struct.triple** %6
%41 = load %struct.compile_state*, %struct.compile_state** %2
%42 = load %struct.triple*, %struct.triple** %4
%43 = load %struct.triple*, %struct.triple** %5
%44 = load %struct.triple*, %struct.triple** %6
%45 = call i32 (%struct.compile_state*, %struct.triple*, %struct.triple*, %struct.triple*, ...) bitcast (i32 (...)* @mkcond_expr to i32 (%struct.compile_state*, %struct.triple*, %struct.triple*, %struct.triple*, ...)*)(%struct.compile_state* %41, %struct.triple* %42, %struct.triple* %43, %struct.triple* %44)
%46 = sext i32 %45 to i64
%47 = inttoptr i64 %46 to %struct.triple*
store %struct.triple* %47, %struct.triple** %3
br label %48
48: ; preds = %14, %1
%49 = load %struct.triple*, %struct.triple** %3
ret %struct.triple* %49
}

LLVM IR (-O2):
%struct.triple = type opaque
%struct.compile_state = type opaque
define %struct.triple* @conditional_expr(%struct.compile_state* %0) {
%2 = tail call i32 (%struct.compile_state*, ...) bitcast (i32 (...)* @lor_expr to i32 (%struct.compile_state*, ...)*)(%struct.compile_state* %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to %struct.triple*
%5 = tail call i32 (%struct.compile_state*, ...) bitcast (i32 (...)* @peek to i32 (%struct.compile_state*, ...)*)(%struct.compile_state* %0)
%6 = icmp eq i32 %5, 28
br i1 %6, label %9, label %7
7: ; preds = %1, %9
%8 = phi %struct.triple* [ %27, %9 ], [ %4, %1 ]
ret %struct.triple* %8
9: ; preds = %1
%10 = tail call i32 (%struct.compile_state*, %struct.triple*, ...) bitcast (i32 (...)* @bool to i32 (%struct.compile_state*, %struct.triple*, ...)*)(%struct.compile_state* %0, %struct.triple* %4)
%11 = tail call i32 (%struct.compile_state*, %struct.triple*, ...) bitcast (i32 (...)* @read_expr to i32 (%struct.compile_state*, %struct.triple*, ...)*)(%struct.compile_state* %0, %struct.triple* %4)
%12 = tail call i32 (%struct.compile_state*, i32, ...) bitcast (i32 (...)* @ltrue_expr to i32 (%struct.compile_state*, i32, ...)*)(%struct.compile_state* %0, i32 %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to %struct.triple*
%15 = tail call i32 (%struct.compile_state*, i32, ...) bitcast (i32 (...)* @eat to i32 (%struct.compile_state*, i32, ...)*)(%struct.compile_state* %0, i32 28)
%16 = tail call i32 (%struct.compile_state*, ...) bitcast (i32 (...)* @expr to i32 (%struct.compile_state*, ...)*)(%struct.compile_state* %0)
%17 = tail call i32 (%struct.compile_state*, i32, ...) bitcast (i32 (...)* @read_expr to i32 (%struct.compile_state*, i32, ...)*)(%struct.compile_state* %0, i32 %16)
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to %struct.triple*
%20 = tail call i32 (%struct.compile_state*, i32, ...) bitcast (i32 (...)* @eat to i32 (%struct.compile_state*, i32, ...)*)(%struct.compile_state* %0, i32 7)
%21 = tail call %struct.triple* @conditional_expr(%struct.compile_state* %0)
%22 = tail call i32 (%struct.compile_state*, %struct.triple*, ...) bitcast (i32 (...)* @read_expr to i32 (%struct.compile_state*, %struct.triple*, ...)*)(%struct.compile_state* %0, %struct.triple* %21)
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to %struct.triple*
%25 = tail call i32 (%struct.compile_state*, %struct.triple*, %struct.triple*, %struct.triple*, ...) bitcast (i32 (...)* @mkcond_expr to i32 (%struct.compile_state*, %struct.triple*, %struct.triple*, %struct.triple*, ...)*)(%struct.compile_state* %0, %struct.triple* %14, %struct.triple* %19, %struct.triple* %24)
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to %struct.triple*
br label %7
}