xunge/DecIR huggingface dataset:
void putch(unsigned char c) {
  while (!(*(volatile unsigned *)(0xBF800000 + (0x22010)) & 0x00000100))
    continue;
again:
  *(volatile unsigned *)(0xBF800000 + (0x22020)) = c;
  while (!(*(volatile unsigned *)(0xBF800000 + (0x22010)) & 0x00000100))
    continue;
  if (c == '\n') {
    c = '\r';
    goto again;
  }
}


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xbf822010,%eax
mov    (%rax),%eax
and    $0x100,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112b <putch+0x2b>
jmp    1130 <putch+0x30>
jmp    110a <putch+0xa>
jmp    1135 <putch+0x35>
movzbl -0x1(%rbp),%ecx
mov    $0xbf822020,%eax
mov    %ecx,(%rax)
mov    $0xbf822010,%eax
mov    (%rax),%eax
and    $0x100,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1161 <putch+0x61>
jmp    1166 <putch+0x66>
jmp    1140 <putch+0x40>
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    117c <putch+0x7c>
movb   $0xd,-0x1(%rbp)
jmp    1135 <putch+0x35>
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch>:
mov    $0xbf822010,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x100,(%rax)
je     1110 <putch+0x10>
nopl   0x0(%rax,%rax,1)
movzbl %dil,%ecx
mov    %ecx,0x10(%rax)
nopw   0x0(%rax,%rax,1)
testl  $0x100,(%rax)
je     1130 <putch+0x30>
cmp    $0xa,%dil
mov    $0xd,%dil
je     1120 <putch+0x20>
ret

LLVM IR (-O0):
define void @putch(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i32, i32* inttoptr (i64 3212976144 to i32*)
%5 = and i32 %4, 256
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
br label %10
10: ; preds = %23, %9
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
store volatile i32 %12, i32* inttoptr (i64 3212976160 to i32*)
br label %13
13: ; preds = %18, %10
%14 = load volatile i32, i32* inttoptr (i64 3212976144 to i32*)
%15 = and i32 %14, 256
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
br i1 %17, label %18, label %19
18: ; preds = %13
br label %13
19: ; preds = %13
%20 = load i8, i8* %2
%21 = zext i8 %20 to i32
%22 = icmp eq i32 %21, 10
br i1 %22, label %23, label %24
23: ; preds = %19
store i8 13, i8* %2
br label %10
24: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @putch(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 3212976144 to i32*)
%4 = and i32 %3, 256
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2, %13
%7 = phi i8 [ 13, %13 ], [ %0, %2 ]
%8 = zext i8 %7 to i32
store volatile i32 %8, i32* inttoptr (i64 3212976160 to i32*)
br label %9
9: ; preds = %9, %6
%10 = load volatile i32, i32* inttoptr (i64 3212976144 to i32*)
%11 = and i32 %10, 256
%12 = icmp eq i32 %11, 0
br i1 %12, label %9, label %13
13: ; preds = %9
%14 = icmp eq i8 %7, 10
br i1 %14, label %6, label %15
15: ; preds = %13
ret void
}
int compareLatency(const void *a, const void *b) {
  return (*(long long *)a) - (*(long long *)b);
}


x86 assembly (clang, -O0):
<compareLatency>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareLatency>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compareLatency(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @compareLatency(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
int get_decoder_buffer_size(void) { return 1024; }


x86 assembly (clang, -O0):
<get_decoder_buffer_size>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_decoder_buffer_size>:
mov    $0x400,%eax
ret

LLVM IR (-O0):
define i32 @get_decoder_buffer_size() {
ret i32 1024
}

LLVM IR (-O2):
define i32 @get_decoder_buffer_size() {
ret i32 1024
}
/* Variables and functions */
int /*<<< orphan*/ vfork();
main() { vfork(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
call   1030 <vfork@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <vfork@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @vfork()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = call i32 @vfork()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ func(char *);
int main() {
  char *mystr = "Auth1";
  func(mystr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <func@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Auth1\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @func(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Auth1\00"
define i32 @main() {
%1 = tail call i32 @func(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void BN_CTX_free(void) {}


x86 assembly (clang, -O0):
<BN_CTX_free>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_CTX_free>:
ret

LLVM IR (-O0):
define void @BN_CTX_free() {
ret void
}

LLVM IR (-O2):
define void @BN_CTX_free() {
ret void
}
int __attribute__((no_icf)) bar() { return 2; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @bar() {
ret i32 2
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 2
}
char base64_encode_value(unsigned char value_in) {
  static const char *encoding =
      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  if (value_in > 63)
    return '=';
  return encoding[(int)value_in];
}


x86 assembly (clang, -O0):
<base64_encode_value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x3f,%eax
jle    1120 <base64_encode_value+0x20>
movb   $0x3d,-0x1(%rbp)
jmp    1134 <base64_encode_value+0x34>
mov    0x2ef9(%rip),%rax
movzbl -0x2(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_encode_value>:
mov    $0x3d,%al
cmp    $0x3f,%dil
ja     1116 <base64_encode_value+0x16>
movzbl %dil,%eax
lea    0xeed(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@base64_encode_value.encoding = internal global i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i32 0, i32 0)
@.str = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define signext i8 @base64_encode_value(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sgt i32 %5, 63
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 61, i8* %2
br label %15
8: ; preds = %1
%9 = load i8*, i8** @base64_encode_value.encoding
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = load i8, i8* %13
store i8 %14, i8* %2
br label %15
15: ; preds = %8, %7
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
@.str = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define signext i8 @base64_encode_value(i8 zeroext %0) {
%2 = icmp ugt i8 %0, 63
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = zext i8 %0 to i64
%5 = getelementptr inbounds [65 x i8], [65 x i8]* @.str, i64 0, i64 %4
%6 = load i8, i8* %5
br label %7
7: ; preds = %1, %3
%8 = phi i8 [ %6, %3 ], [ 61, %1 ]
ret i8 %8
}
void HplCC2430InterruptsC$InterruptRFErr$fired(void) {
  HalCC2430RadioP$InterruptRFErr$fired();
}


x86 assembly (clang, -O0):
<HplCC2430InterruptsC$InterruptRFErr$fired>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HalCC2430RadioP$InterruptRFErr$fired@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HplCC2430InterruptsC$InterruptRFErr$fired>:
xor    %eax,%eax
jmp    1030 <HalCC2430RadioP$InterruptRFErr$fired@plt>

LLVM IR (-O0):
define void @"HplCC2430InterruptsC$InterruptRFErr$fired"() {
%1 = call i32 (...) @"HalCC2430RadioP$InterruptRFErr$fired"()
ret void
}

LLVM IR (-O2):
define void @"HplCC2430InterruptsC$InterruptRFErr$fired"() {
%1 = tail call i32 (...) @"HalCC2430RadioP$InterruptRFErr$fired"()
ret void
}
int abs(int i) {
  if (i < 0)
    return ~(--i);
  return i;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1125 <abs+0x25>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
xor    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    112b <abs+0x2b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, -1
store i32 %8, i32* %3
%9 = xor i32 %8, -1
store i32 %9, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 false)
ret i32 %2
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ printf(char *, char const *);
void err(const char *message) {
  if (errno) {
    perror(message);
  } else {
    printf("ERROR: %s\n", message);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
cmpq   $0x0,(%rax)
je     115b <err+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    116b <err+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rax
mov    %rdi,%rsi
mov    0x2ea5(%rip),%rax
cmpq   $0x0,(%rax)
je     1153 <err+0x23>
mov    %rsi,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @perror(i8* %6)
br label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %5
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @err(i8* %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sla_rdplan_(double *, int *, double *, double *, double *,
                               double *, double *);
void slaRdplan(double date, int np, double elong, double phi, double *ra,
               double *dec, double *diam) {
  sla_rdplan_(&date, &np, &elong, &phi, ra, dec, diam);
}


x86 assembly (clang, -O0):
<slaRdplan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    -0x38(%rbp),%rax
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
mov    %rax,(%rsp)
call   1030 <sla_rdplan_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaRdplan>:
sub    $0x28,%rsp
mov    %rdx,%r9
mov    %rsi,%r8
movsd  %xmm0,0x20(%rsp)
mov    %edi,0xc(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
mov    %rcx,(%rsp)
lea    0x20(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1030 <sla_rdplan_@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @slaRdplan(double %0, i32 %1, double %2, double %3, double* %4, double* %5, double* %6) {
%8 = alloca double
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
store double %0, double* %8
store i32 %1, i32* %9
store double %2, double* %10
store double %3, double* %11
store double* %4, double** %12
store double* %5, double** %13
store double* %6, double** %14
%15 = load double*, double** %12
%16 = load double*, double** %13
%17 = load double*, double** %14
%18 = call i32 @sla_rdplan_(double* %8, i32* %9, double* %10, double* %11, double* %15, double* %16, double* %17)
ret void
}

LLVM IR (-O2):
define void @slaRdplan(double %0, i32 %1, double %2, double %3, double* %4, double* %5, double* %6) {
%8 = alloca double
%9 = alloca i32
%10 = alloca double
%11 = alloca double
store double %0, double* %8
store i32 %1, i32* %9
store double %2, double* %10
store double %3, double* %11
%12 = call i32 @sla_rdplan_(double* %8, i32* %9, double* %10, double* %11, double* %4, double* %5, double* %6)
ret void
}
/* Type definitions */
typedef union u_argument {
  int dummy;
} u_argument;
struct sockaddr_in {
  int dummy;
};
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
struct sockaddr_in *svc_getcaller(int /*<<< orphan*/ *);
char *svc_getcaller_test(union u_argument *inVar, SVCXPRT *transp) {
  struct sockaddr_in *sa = NULL;
  static int result;
  sa = svc_getcaller(transp);
  result = (sa != NULL) ? 0 : 1;
  return (char *)&result;
}


x86 assembly (clang, -O0):
<svc_getcaller_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <svc_getcaller@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,0x2edf(%rip)
lea    0x2ed8(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svc_getcaller_test>:
push   %rax
mov    %rsi,%rdi
call   1030 <svc_getcaller@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,0x2f05(%rip)
lea    0x2efe(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
%union.u_argument = type { i32 }
%struct.sockaddr_in = type { i32 }
@svc_getcaller_test.result = internal global i32 0
define i8* @svc_getcaller_test(%union.u_argument* %0, i32* %1) {
%3 = alloca %union.u_argument*
%4 = alloca i32*
%5 = alloca %struct.sockaddr_in*
store %union.u_argument* %0, %union.u_argument** %3
store i32* %1, i32** %4
store %struct.sockaddr_in* null, %struct.sockaddr_in** %5
%6 = load i32*, i32** %4
%7 = call %struct.sockaddr_in* @svc_getcaller(i32* %6)
store %struct.sockaddr_in* %7, %struct.sockaddr_in** %5
%8 = load %struct.sockaddr_in*, %struct.sockaddr_in** %5
%9 = icmp ne %struct.sockaddr_in* %8, null
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 1
store i32 %11, i32* @svc_getcaller_test.result
ret i8* bitcast (i32* @svc_getcaller_test.result to i8*)
}

LLVM IR (-O2):
%union.u_argument = type { i32 }
%struct.sockaddr_in = type { i32 }
@svc_getcaller_test.result = internal global i32 0
define i8* @svc_getcaller_test(%union.u_argument* nocapture readnone %0, i32* %1) {
%3 = tail call %struct.sockaddr_in* @svc_getcaller(i32* %1)
%4 = icmp eq %struct.sockaddr_in* %3, null
%5 = zext i1 %4 to i32
store i32 %5, i32* @svc_getcaller_test.result
ret i8* bitcast (i32* @svc_getcaller_test.result to i8*)
}
/* Type definitions */
struct iam_leaf {
  int dummy;
};
struct iam_key {
  int dummy;
};
struct iam_ikey {
  int dummy;
};

/* Variables and functions */
int iam_lfix_lookup(struct iam_leaf *, struct iam_key const *);
int iam_lfix_ilookup(struct iam_leaf *l, const struct iam_ikey *ik) {
  return iam_lfix_lookup(l, (const struct iam_key *)ik);
}


x86 assembly (clang, -O0):
<iam_lfix_ilookup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <iam_lfix_lookup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iam_lfix_ilookup>:
jmp    1030 <iam_lfix_lookup@plt>

LLVM IR (-O0):
%struct.iam_leaf = type { i32 }
%struct.iam_ikey = type { i32 }
%struct.iam_key = type { i32 }
define i32 @iam_lfix_ilookup(%struct.iam_leaf* %0, %struct.iam_ikey* %1) {
%3 = alloca %struct.iam_leaf*
%4 = alloca %struct.iam_ikey*
store %struct.iam_leaf* %0, %struct.iam_leaf** %3
store %struct.iam_ikey* %1, %struct.iam_ikey** %4
%5 = load %struct.iam_leaf*, %struct.iam_leaf** %3
%6 = load %struct.iam_ikey*, %struct.iam_ikey** %4
%7 = bitcast %struct.iam_ikey* %6 to %struct.iam_key*
%8 = call i32 @iam_lfix_lookup(%struct.iam_leaf* %5, %struct.iam_key* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.iam_leaf = type { i32 }
%struct.iam_ikey = type { i32 }
%struct.iam_key = type { i32 }
define i32 @iam_lfix_ilookup(%struct.iam_leaf* %0, %struct.iam_ikey* %1) {
%3 = bitcast %struct.iam_ikey* %1 to %struct.iam_key*
%4 = tail call i32 @iam_lfix_lookup(%struct.iam_leaf* %0, %struct.iam_key* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ eval(int /*<<< orphan*/);
char *print(int /*<<< orphan*/);
int /*<<< orphan*/ read(char *);
char *rep(char *s) { return print(eval(read(s))); }


x86 assembly (clang, -O0):
<rep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <read@plt>
mov    %eax,%edi
call   1050 <eval@plt>
mov    %eax,%edi
call   1030 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rep>:
push   %rax
call   1040 <read@plt>
mov    %eax,%edi
call   1050 <eval@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <print@plt>

LLVM IR (-O0):
define i8* @rep(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @read(i8* %3)
%5 = call i32 @eval(i32 %4)
%6 = call i8* @print(i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @rep(i8* %0) {
%2 = tail call i32 @read(i8* %0)
%3 = tail call i32 @eval(i32 %2)
%4 = tail call i8* @print(i32 %3)
ret i8* %4
}
/* Variables and functions */
char *STRDUP(int /*<<< orphan*/);
int /*<<< orphan*/ fatal(char *, int);
int /*<<< orphan*/ strip_white_space(char *);
char *strtok(int /*<<< orphan*/, char *);
char *rest_of_buffer(int lineno) {
  char *p = strtok(0, "");
  if (p)
    return STRDUP(strip_white_space(p));
  else {
    fatal("something missing at line %d\n", lineno);
    return 0;
  }
}


x86 assembly (clang, -O0):
<rest_of_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
xor    %edi,%edi
lea    0xec9(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1181 <rest_of_buffer+0x41>
mov    -0x18(%rbp),%rdi
call   1030 <strip_white_space@plt>
mov    %eax,%edi
call   1040 <STRDUP@plt>
mov    %rax,-0x8(%rbp)
jmp    1198 <rest_of_buffer+0x58>
mov    -0xc(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1060 <fatal@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rest_of_buffer>:
push   %rbx
mov    %edi,%ebx
lea    0xed3(%rip),%rsi
xor    %edi,%edi
call   1050 <strtok@plt>
test   %rax,%rax
je     1166 <rest_of_buffer+0x26>
mov    %rax,%rdi
call   1030 <strip_white_space@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <STRDUP@plt>
lea    0xe93(%rip),%rdi
mov    %ebx,%esi
call   1060 <fatal@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [30 x i8] c"something missing at line %d\0A\00"
define i8* @rest_of_buffer(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
%5 = call i8* @strtok(i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %4
%10 = call i32 @strip_white_space(i8* %9)
%11 = call i8* @STRDUP(i32 %10)
store i8* %11, i8** %2
br label %15
12: ; preds = %1
%13 = load i32, i32* %3
%14 = call i32 @fatal(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %13)
store i8* null, i8** %2
br label %15
15: ; preds = %12, %8
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [30 x i8] c"something missing at line %d\0A\00"
define i8* @rest_of_buffer(i32 %0) {
%2 = tail call i8* @strtok(i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @strip_white_space(i8* %2)
%6 = tail call i8* @STRDUP(i32 %5)
br label %9
7: ; preds = %1
%8 = tail call i32 @fatal(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %9
9: ; preds = %7, %4
%10 = phi i8* [ %6, %4 ], [ null, %7 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int /*<<< orphan*/ IntEnable(int);
int /*<<< orphan*/ IntRegister(int, void (*)());
void LPCIntRegister(unsigned long ulBase, void (*pfnHandler)(void)) {
  DEBUG_ASSERT(ulBase == 0x40080000);
  DEBUG_ASSERT(pfnHandler != 0);
  IntRegister(124, pfnHandler);
  IntEnable(124);
}


x86 assembly (clang, -O0):
<LPCIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40080000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <DEBUG_ASSERT@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rsi
mov    $0x7c,%edi
call   1040 <IntRegister@plt>
mov    $0x7c,%edi
call   1030 <IntEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCIntRegister>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
cmp    $0x40080000,%rdi
sete   %al
mov    %eax,%edi
call   1050 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1050 <DEBUG_ASSERT@plt>
mov    $0x7c,%edi
mov    %rbx,%rsi
call   1040 <IntRegister@plt>
mov    $0x7c,%edi
pop    %rbx
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @LPCIntRegister(i64 %0, void ()* %1) {
%3 = alloca i64
%4 = alloca void ()*
store i64 %0, i64* %3
store void ()* %1, void ()** %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074266112
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load void ()*, void ()** %4
%10 = icmp ne void ()* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @DEBUG_ASSERT(i32 %11)
%13 = load void ()*, void ()** %4
%14 = bitcast void ()* %13 to void (...)*
%15 = call i32 @IntRegister(i32 124, void (...)* %14)
%16 = call i32 @IntEnable(i32 124)
ret void
}

LLVM IR (-O2):
define void @LPCIntRegister(i64 %0, void ()* %1) {
%3 = icmp eq i64 %0, 1074266112
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = icmp ne void ()* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @DEBUG_ASSERT(i32 %7)
%9 = bitcast void ()* %1 to void (...)*
%10 = tail call i32 @IntRegister(i32 124, void (...)* %9)
%11 = tail call i32 @IntEnable(i32 124)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_factor_strings() {
  test_parser_verify_parse(
      test_parser_sourcefile("factor", "\"abc!not a 'comment\""), "factor",
      "\"abc!not a 'comment\"", "", 0);
}


x86 assembly (clang, -O0):
<test_factor_strings>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec0(%rip),%rdx
lea    0xecd(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_factor_strings>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rbx
lea    0xed5(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xed7(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %r8d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"factor\00"
@.str.1 = [21 x i8] c"\22abc!not a 'comment\22\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_factor_strings() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"factor\00"
@.str.1 = [21 x i8] c"\22abc!not a 'comment\22\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_factor_strings() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printScoreboardBuffer();
int /*<<< orphan*/ setScoreboard();
void eraseScoreboard() {
  setScoreboard();
  printScoreboardBuffer();
}


x86 assembly (clang, -O0):
<eraseScoreboard>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <setScoreboard@plt>
mov    $0x0,%al
call   1040 <printScoreboardBuffer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eraseScoreboard>:
push   %rax
xor    %eax,%eax
call   1030 <setScoreboard@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <printScoreboardBuffer@plt>

LLVM IR (-O0):
define void @eraseScoreboard() {
%1 = call i32 (...) @setScoreboard()
%2 = call i32 (...) @printScoreboardBuffer()
ret void
}

LLVM IR (-O2):
define void @eraseScoreboard() {
%1 = tail call i32 (...) @setScoreboard()
%2 = tail call i32 (...) @printScoreboardBuffer()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ personality(int);
int main() {
  personality(0xffffffff);
  personality(0x12345678);
  personality(-1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1030 <personality@plt>
mov    $0x12345678,%edi
call   1030 <personality@plt>
mov    $0xffffffff,%edi
call   1030 <personality@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <personality@plt>
mov    $0x12345678,%edi
call   1030 <personality@plt>
mov    $0xffffffff,%edi
call   1030 <personality@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @personality(i32 -1)
%3 = call i32 @personality(i32 305419896)
%4 = call i32 @personality(i32 -1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @personality(i32 -1)
%2 = tail call i32 @personality(i32 305419896)
%3 = tail call i32 @personality(i32 -1)
ret i32 0
}
void MainWinDisp_mri(ex) int ex;
{
  if (ex == 1) {
    DisplayCurrWinText("MACHINE ");
  } else if (ex == 2) {
    DisplayCurrWinText("REFINEMENT ");
  } else {
    DisplayCurrWinText("IMPLEMENTATION ");
  }
}


x86 assembly (clang, -O0):
<MainWinDisp_mri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1138 <MainWinDisp_mri+0x28>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <DisplayCurrWinText@plt>
jmp    1168 <MainWinDisp_mri+0x58>
cmpl   $0x2,-0x4(%rbp)
jne    1155 <MainWinDisp_mri+0x45>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <DisplayCurrWinText@plt>
jmp    1163 <MainWinDisp_mri+0x53>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <DisplayCurrWinText@plt>
jmp    1168 <MainWinDisp_mri+0x58>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MainWinDisp_mri>:
cmp    $0x2,%edi
lea    0xeef(%rip),%rax
lea    0xef4(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%edi
lea    0xed1(%rip),%rdi
cmovne %rcx,%rdi
xor    %eax,%eax
jmp    1030 <DisplayCurrWinText@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"MACHINE \00"
@.str.1 = [12 x i8] c"REFINEMENT \00"
@.str.2 = [16 x i8] c"IMPLEMENTATION \00"
define void @MainWinDisp_mri(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @DisplayCurrWinText to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %15
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @DisplayCurrWinText to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %7
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @DisplayCurrWinText to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
br label %15
15: ; preds = %14, %5
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"MACHINE \00"
@.str.1 = [12 x i8] c"REFINEMENT \00"
@.str.2 = [16 x i8] c"IMPLEMENTATION \00"
define void @MainWinDisp_mri(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DisplayCurrWinText to i32 (i8*, ...)*)(i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, square, cube;
  scanf("%d", &a);
  square = a * a;
  cube = a * a * a;
  printf("%d\n", square);
  printf("%d\n", cube);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
imul   %esi,%ebx
lea    0xebb(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %2
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
int protected_mode_call(void *func) {
  int (*doit)(void) = func;
  return doit();
}


x86 assembly (clang, -O0):
<protected_mode_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
call   *-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protected_mode_call>:
jmp    *%rdi

LLVM IR (-O0):
define i32 @protected_mode_call(i8* %0) {
%2 = alloca i8*
%3 = alloca i32 ()*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32 ()*
store i32 ()* %5, i32 ()** %3
%6 = load i32 ()*, i32 ()** %3
%7 = call i32 %6()
ret i32 %7
}

LLVM IR (-O2):
define i32 @protected_mode_call(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32 ()*
%3 = tail call i32 %2()
ret i32 %3
}
OP(fd, a7) {
  illegal_1();
  op_a7();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_a7@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_a7@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_a7()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_a7()
ret i32 undef
}
char *_d2r_fetchliteral(char **h) { return *h; }


x86 assembly (clang, -O0):
<_d2r_fetchliteral>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_d2r_fetchliteral>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
define i8* @_d2r_fetchliteral(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
ret i8* %4
}

LLVM IR (-O2):
define i8* @_d2r_fetchliteral(i8** nocapture %0) {
%2 = load i8*, i8** %0
ret i8* %2
}
int test_imm_B5uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xB5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B5uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0xb5,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B5uint64_midword_mem>:
testb  $0xb5,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B5uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 181
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_B5uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11862016
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int tReturn(int, int);
int main() { puts((tReturn(23, 12) == 1) ? "<true>" : "<false>"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
mov    $0xc,%esi
call   1040 <tReturn@plt>
mov    %eax,%ecx
lea    0xecb(%rip),%rdi
lea    0xebd(%rip),%rax
cmp    $0x1,%ecx
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x17,%edi
mov    $0xc,%esi
call   1040 <tReturn@plt>
cmp    $0x1,%eax
lea    0xec6(%rip),%rax
lea    0xec6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"<true>\00"
@.str.1 = [8 x i8] c"<false>\00"
define i32 @main() {
%1 = call i32 @tReturn(i32 23, i32 12)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%5 = call i32 @puts(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"<true>\00"
@.str.1 = [8 x i8] c"<false>\00"
define i32 @main() {
%1 = tail call i32 @tReturn(i32 23, i32 12)
%2 = icmp eq i32 %1, 1
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ right_sign_shfit32();
int main() {
  right_sign_shfit32();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <right_sign_shfit32@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <right_sign_shfit32@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @right_sign_shfit32()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @right_sign_shfit32()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int f465(int *);
int f466(int *p) { return f465(p); }


x86 assembly (clang, -O0):
<f466>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <f465@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f466>:
jmp    1030 <f465@plt>

LLVM IR (-O0):
define i32 @f466(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @f465(i32* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @f466(i32* %0) {
%2 = tail call i32 @f465(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SetOutputEx(unsigned char, int, unsigned char);
void OnEx(unsigned char Outputs, unsigned char reset) {
  SetOutputEx(Outputs, 0x80, reset);
}


x86 assembly (clang, -O0):
<OnEx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    $0x80,%esi
movzbl %al,%edi
movzbl -0x2(%rbp),%edx
call   1030 <SetOutputEx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OnEx>:
mov    %esi,%edx
mov    $0x80,%esi
jmp    1030 <SetOutputEx@plt>

LLVM IR (-O0):
define void @OnEx(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = load i8, i8* %4
%7 = call i32 @SetOutputEx(i8 zeroext %5, i32 128, i8 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @OnEx(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @SetOutputEx(i8 zeroext %0, i32 128, i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_LIGHT0;
int /*<<< orphan*/ MakeObjects();
int /*<<< orphan*/ glClearColor(float, float, float, float);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void Init(void) {
  glClearColor(0.1F, 0.5F, 1.0F, 0.0F);
  glEnable(GL_DEPTH_TEST);
  glEnable(GL_LIGHT0);
  MakeObjects();
}


x86 assembly (clang, -O0):
<Init>:
push   %rbp
mov    %rsp,%rbp
movss  0xec4(%rip),%xmm0
movss  0xec0(%rip),%xmm1
movss  0xebc(%rip),%xmm2
xorps  %xmm3,%xmm3
call   1040 <glClearColor@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    $0x0,%al
call   1050 <MakeObjects@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Init>:
push   %rax
movss  0xec7(%rip),%xmm0
movss  0xec3(%rip),%xmm1
movss  0xebf(%rip),%xmm2
xorps  %xmm3,%xmm3
call   1040 <glClearColor@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <MakeObjects@plt>

LLVM IR (-O0):
@GL_DEPTH_TEST = global i32 0
@GL_LIGHT0 = global i32 0
define void @Init() {
%1 = call i32 @glClearColor(float 0x3FB99999A0000000, float 5.000000e-01, float 1.000000e+00, float 0.000000e+00)
%2 = load i32, i32* @GL_DEPTH_TEST
%3 = call i32 @glEnable(i32 %2)
%4 = load i32, i32* @GL_LIGHT0
%5 = call i32 @glEnable(i32 %4)
%6 = call i32 (...) @MakeObjects()
ret void
}

LLVM IR (-O2):
@GL_DEPTH_TEST = global i32 0
@GL_LIGHT0 = global i32 0
define void @Init() {
%1 = tail call i32 @glClearColor(float 0x3FB99999A0000000, float 5.000000e-01, float 1.000000e+00, float 0.000000e+00)
%2 = load i32, i32* @GL_DEPTH_TEST
%3 = tail call i32 @glEnable(i32 %2)
%4 = load i32, i32* @GL_LIGHT0
%5 = tail call i32 @glEnable(i32 %4)
%6 = tail call i32 (...) @MakeObjects()
ret void
}
long gs_context(long long *display, long long *shell) { return 0; }


x86 assembly (clang, -O0):
<gs_context>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gs_context>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @gs_context(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
ret i64 0
}

LLVM IR (-O2):
define i64 @gs_context(i64* nocapture readnone %0, i64* nocapture readnone %1) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(
      stderr,
      "Usage: fsabfs [-ip d/s] [-op b/s] [-silent] [-v] [-l/-h] [filename]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badusage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badusage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [69 x i8] c"Usage: fsabfs [-ip d/s] [-op b/s] [-silent] [-v] [-l/-h] [filename]\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [69 x i8] c"Usage: fsabfs [-ip d/s] [-op b/s] [-silent] [-v] [-l/-h] [filename]\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void service_mysql(char *ip, int sp, unsigned char options, char *miscptr,
                   FILE *fp, int port) {
  printf("\n");
}


x86 assembly (clang, -O0):
<service_mysql>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<service_mysql>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @service_mysql(i8* %0, i32 %1, i8 zeroext %2, i8* %3, i32* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8
%10 = alloca i8*
%11 = alloca i32*
%12 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8 %2, i8* %9
store i8* %3, i8** %10
store i32* %4, i32** %11
store i32 %5, i32* %12
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @service_mysql(i8* nocapture readnone %0, i32 %1, i8 zeroext %2, i8* nocapture readnone %3, i32* nocapture readnone %4, i32 %5) {
%7 = tail call i32 @putchar(i32 10)
ret void
}
void INT_Excep_TPU0_TGI0A(void) {}


x86 assembly (clang, -O0):
<INT_Excep_TPU0_TGI0A>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INT_Excep_TPU0_TGI0A>:
ret

LLVM IR (-O0):
define void @INT_Excep_TPU0_TGI0A() {
ret void
}

LLVM IR (-O2):
define void @INT_Excep_TPU0_TGI0A() {
ret void
}
/* Variables and functions */
int func3(int);
int func7(int a) { return a + func3(a); }


x86 assembly (clang, -O0):
<func7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <func3@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func7>:
push   %rbx
mov    %edi,%ebx
call   1030 <func3@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @func7(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @func3(i32 %4)
%6 = add nsw i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @func7(i32 %0) {
%2 = tail call i32 @func3(i32 %0)
%3 = add nsw i32 %2, %0
ret i32 %3
}
int next_sword_line(int cur) {
  if (cur < 29)
    return cur + 1;
  return 16;
}


x86 assembly (clang, -O0):
<next_sword_line>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1d,-0x8(%rbp)
jge    111f <next_sword_line+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <next_sword_line+0x26>
movl   $0x10,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_sword_line>:
lea    0x1(%rdi),%ecx
cmp    $0x1d,%edi
mov    $0x10,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @next_sword_line(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 29
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %10
9: ; preds = %1
store i32 16, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @next_sword_line(i32 %0) {
%2 = icmp slt i32 %0, 29
%3 = add nsw i32 %0, 1
%4 = select i1 %2, i32 %3, i32 16
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void QUADSPI_IRQHandler() { default_handler(); }


x86 assembly (clang, -O0):
<QUADSPI_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <default_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<QUADSPI_IRQHandler>:
xor    %eax,%eax
jmp    1030 <default_handler@plt>

LLVM IR (-O0):
define weak void @QUADSPI_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @QUADSPI_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}