void bu_compile_literal(lit) struct conscell *lit;
{
  long litref;
  if (!lit)
    goto er;
  litref = bu_litref(lit);
  EMIT1ATM("PUSHL");
  EMIT1FIX(litref);
  EMITEND();
  return;
er:
  cerror("literal: a literal is required but not found", lit);
}


x86 assembly (clang, -O0):
<bu_compile_literal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    116c <bu_compile_literal+0x1c>
jmp    11a2 <bu_compile_literal+0x52>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <bu_litref@plt>
cltq
mov    %rax,-0x10(%rbp)
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1050 <EMIT1ATM@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1070 <EMIT1FIX@plt>
mov    $0x0,%al
call   1030 <EMITEND@plt>
jmp    11b4 <bu_compile_literal+0x64>
mov    -0x8(%rbp),%rsi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1060 <cerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bu_compile_literal>:
test   %rdi,%rdi
je     1180 <bu_compile_literal+0x30>
push   %rbx
xor    %eax,%eax
call   1040 <bu_litref@plt>
movslq %eax,%rbx
lea    0xe99(%rip),%rdi
xor    %eax,%eax
call   1050 <EMIT1ATM@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <EMIT1FIX@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <EMITEND@plt>
lea    0xe7f(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
jmp    1060 <cerror@plt>

LLVM IR (-O0):
%struct.conscell = type opaque
@.str = [6 x i8] c"PUSHL\00"
@.str.1 = [45 x i8] c"literal: a literal is required but not found\00"
define void @bu_compile_literal(%struct.conscell* %0) {
%2 = alloca %struct.conscell*
%3 = alloca i64
store %struct.conscell* %0, %struct.conscell** %2
%4 = load %struct.conscell*, %struct.conscell** %2
%5 = icmp ne %struct.conscell* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
br label %15
7: ; preds = %1
%8 = load %struct.conscell*, %struct.conscell** %2
%9 = call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @bu_litref to i32 (%struct.conscell*, ...)*)(%struct.conscell* %8)
%10 = sext i32 %9 to i64
store i64 %10, i64* %3
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%12 = load i64, i64* %3
%13 = call i32 (i64, ...) bitcast (i32 (...)* @EMIT1FIX to i32 (i64, ...)*)(i64 %12)
%14 = call i32 (...) @EMITEND()
br label %18
15: ; preds = %6
%16 = load %struct.conscell*, %struct.conscell** %2
%17 = call i32 (i8*, %struct.conscell*, ...) bitcast (i32 (...)* @cerror to i32 (i8*, %struct.conscell*, ...)*)(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* %16)
br label %18
18: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
%struct.conscell = type opaque
@.str = [6 x i8] c"PUSHL\00"
@.str.1 = [45 x i8] c"literal: a literal is required but not found\00"
define void @bu_compile_literal(%struct.conscell* %0) {
%2 = icmp eq %struct.conscell* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @bu_litref to i32 (%struct.conscell*, ...)*)(%struct.conscell* %0)
%5 = sext i32 %4 to i64
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (i64, ...) bitcast (i32 (...)* @EMIT1FIX to i32 (i64, ...)*)(i64 %5)
%8 = tail call i32 (...) @EMITEND()
br label %11
9: ; preds = %1
%10 = tail call i32 (i8*, %struct.conscell*, ...) bitcast (i32 (...)* @cerror to i32 (i8*, %struct.conscell*, ...)*)(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* null)
br label %11
11: ; preds = %9, %3
ret void
}