xunge/DecIR huggingface dataset:
__attribute__((no)) int rec(int i) {
  if (i == 0)
    return 0;
  if (i == 1)
    return 1;
  if (i < 1024) {
    return rec(i - 1) + rec(i / 2);
  } else {
    return 5;
  }
}


x86 assembly (clang, -O0):
<rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <rec+0x21>
movl   $0x0,-0x4(%rbp)
jmp    118a <rec+0x7a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <rec+0x37>
movl   $0x1,-0x4(%rbp)
jmp    118a <rec+0x7a>
cmpl   $0x400,-0x8(%rbp)
jge    1183 <rec+0x73>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <rec@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <rec@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    118a <rec+0x7a>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
test   %ebx,%ebx
je     1154 <rec+0x44>
nopl   0x0(%rax,%rax,1)
cmp    $0x1,%ebx
je     1148 <rec+0x38>
cmp    $0x3ff,%ebx
jg     114f <rec+0x3f>
lea    -0x1(%rbx),%edi
call   1030 <rec@plt>
mov    %ebx,%ecx
shr    $0x1f,%ecx
add    %ebx,%ecx
sar    %ecx
add    %eax,%ebp
mov    %ecx,%ebx
test   %ebx,%ebx
jne    1120 <rec+0x10>
jmp    1154 <rec+0x44>
mov    $0x1,%ebx
jmp    1154 <rec+0x44>
mov    $0x5,%ebx
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %23
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %2
br label %23
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 1024
br i1 %13, label %14, label %22
14: ; preds = %11
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 1
%17 = call i32 @rec(i32 %16)
%18 = load i32, i32* %3
%19 = sdiv i32 %18, 2
%20 = call i32 @rec(i32 %19)
%21 = add nsw i32 %17, %20
store i32 %21, i32* %2
br label %23
22: ; preds = %11
store i32 5, i32* %2
br label %23
23: ; preds = %22, %14, %10, %6
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @rec(i32 %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i32 [ 0, %1 ], [ %11, %7 ]
%4 = phi i32 [ %0, %1 ], [ %10, %7 ]
switch i32 %4, label %5 [
i32 0, label %12
i32 1, label %14
]
5: ; preds = %2
%6 = icmp slt i32 %4, 1024
br i1 %6, label %7, label %12
7: ; preds = %5
%8 = add nsw i32 %4, -1
%9 = tail call i32 @rec(i32 %8)
%10 = sdiv i32 %4, 2
%11 = add nsw i32 %9, %3
br label %2
12: ; preds = %2, %5
%13 = phi i32 [ 5, %5 ], [ %4, %2 ]
br label %14
14: ; preds = %2, %12
%15 = phi i32 [ %13, %12 ], [ 1, %2 ]
%16 = add nsw i32 %15, %3
ret i32 %16
}
int unescape(char **dest_string, const char *src) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @unescape(i8** nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void prnum(int n) { printf("%d", n); }


x86 assembly (clang, -O0):
<prnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prnum>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @prnum(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void g_signal_handlers_destroy() {}


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

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

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

LLVM IR (-O2):
define void @g_signal_handlers_destroy() {
ret void
}
void p0(void) { printf((void *)0); }


x86 assembly (clang, -O0):
<p0>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<p0>:
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
define void @p0() {
%1 = call i32 (i8*, ...) @printf(i8* null)
ret void
}

LLVM IR (-O2):
define void @p0() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rbkts_emit_kv(void *, void *);
void kvst_reduce_put(void *key, void *val) { rbkts_emit_kv(key, val); }


x86 assembly (clang, -O0):
<kvst_reduce_put>:
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 <rbkts_emit_kv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kvst_reduce_put>:
jmp    1030 <rbkts_emit_kv@plt>

LLVM IR (-O0):
define void @kvst_reduce_put(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 = load i8*, i8** %4
%7 = call i32 @rbkts_emit_kv(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @kvst_reduce_put(i8* %0, i8* %1) {
%3 = tail call i32 @rbkts_emit_kv(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int funk();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int hjemvegen123 = 2;
  printf("%d %d", hjemvegen123, funk());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <funk@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <funk@plt>
lea    0xed1(%rip),%rdi
mov    $0x2,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = tail call i32 (...) @funk()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 2, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
main() {
  char a[] = "kripa ";
  char b[20] = "shanker";
  strcat(b, a);
  printf("%s", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb8(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0xb(%rbp),%rsi
call   1040 <strcat@plt>
lea    -0x20(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movl   $0x206170,0xb(%rsp)
movl   $0x7069726b,0x8(%rsp)
70
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xea5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [7 x i8] c"kripa \00"
@__const.main.b = [20 x i8] c"shanker\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = alloca [20 x i8]
store i32 0, i32* %1
%4 = bitcast [7 x i8]* %2 to i8*
%5 = bitcast [20 x i8]* %3 to i8*
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%8 = call i32 @strcat(i8* %6, i8* %7)
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [7 x i8] c"kripa \00"
@__const.main.b = [20 x i8] c"shanker\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcat(i8* %4, i8* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
int cmpfunc_simple(const void *a, const void *b) {
  return (*(int *)a - *(int *)b);
}


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

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

LLVM IR (-O0):
define i32 @cmpfunc_simple(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 i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmpfunc_simple(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void ff_hevc_put_hevc_bi_w_epel_h8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_h8_8_sse4() {
ret void
}
int test_imm_71int64_lowword_mem(long long *val) {
  return ((*val) & (0x71 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_71int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 113
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void f7(unsigned int s) {
  if ((unsigned short int)s == 0)
    return;
  if (s == 0)
    link_error();
}


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzwl %ax,%eax
cmp    $0x0,%eax
jne    112f <f7+0x1f>
jmp    1140 <f7+0x30>
cmpl   $0x0,-0x4(%rbp)
jne    1140 <f7+0x30>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f7(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i16
%5 = zext i16 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %13
8: ; preds = %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (...) @link_error()
br label %13
13: ; preds = %7, %11, %8
ret void
}

LLVM IR (-O2):
define void @f7(i32 %0) {
ret void
}
/* Variables and functions */
int SecMain();
int TestMain() {
  int ReturnValue;
  ReturnValue = SecMain();
  return ReturnValue;
}


x86 assembly (clang, -O0):
<TestMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <SecMain@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @TestMain() {
%1 = alloca i32
%2 = call i32 (...) @SecMain()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @TestMain() {
%1 = tail call i32 (...) @SecMain()
ret i32 %1
}
void plat_midi_input_close(void) {}


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

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

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

LLVM IR (-O2):
define void @plat_midi_input_close() {
ret void
}
void basicLift(int power) {}


x86 assembly (clang, -O0):
<basicLift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @basicLift(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @basicLift(i32 %0) {
ret void
}
double dpow(double n, int e) {
  double result = 1.0;
  while (e > 0) {
    result *= n;
    e--;
  }
  return result;
}


x86 assembly (clang, -O0):
<dpow>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1140 <dpow+0x40>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <dpow+0x19>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dpow>:
test   %edi,%edi
jle    1134 <dpow+0x34>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
je     113d <dpow+0x3d>
xor    %edx,%edx
movsd  0xee8(%rip),%xmm1
nopl   0x0(%rax,%rax,1)
mulsd  %xmm0,%xmm1
add    $0x1,%edx
cmp    %edx,%ecx
jne    1120 <dpow+0x20>
sub    %edx,%edi
cmp    $0x7,%eax
jae    114a <dpow+0x4a>
jmp    1178 <dpow+0x78>
movsd  0xec4(%rip),%xmm0
ret
movsd  0xebb(%rip),%xmm1
cmp    $0x7,%eax
jb     1178 <dpow+0x78>
add    $0xffffffff,%edi
nopl   (%rax)
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
add    $0xfffffff8,%edi
cmp    $0xfffffffe,%edi
jb     1150 <dpow+0x50>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dpow(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
store double 1.000000e+00, double* %5
br label %6
6: ; preds = %9, %2
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load double, double* %3
%11 = load double, double* %5
%12 = fmul double %11, %10
store double %12, double* %5
%13 = load i32, i32* %4
%14 = add nsw i32 %13, -1
store i32 %14, i32* %4
br label %6
15: ; preds = %6
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @dpow(double %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %35
4: ; preds = %2
%5 = add i32 %1, -1
%6 = and i32 %1, 7
%7 = icmp eq i32 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %4, %8
%9 = phi double [ %12, %8 ], [ 1.000000e+00, %4 ]
%10 = phi i32 [ %13, %8 ], [ %1, %4 ]
%11 = phi i32 [ %14, %8 ], [ 0, %4 ]
%12 = fmul double %9, %0
%13 = add nsw i32 %10, -1
%14 = add i32 %11, 1
%15 = icmp eq i32 %14, %6
br i1 %15, label %16, label %8
16: ; preds = %8, %4
%17 = phi double [ 1.000000e+00, %4 ], [ %12, %8 ]
%18 = phi i32 [ %1, %4 ], [ %13, %8 ]
%19 = phi double [ undef, %4 ], [ %12, %8 ]
%20 = icmp ult i32 %5, 7
br i1 %20, label %35, label %21
21: ; preds = %16, %21
%22 = phi double [ %31, %21 ], [ %17, %16 ]
%23 = phi i32 [ %32, %21 ], [ %18, %16 ]
%24 = fmul double %22, %0
%25 = fmul double %24, %0
%26 = fmul double %25, %0
%27 = fmul double %26, %0
%28 = fmul double %27, %0
%29 = fmul double %28, %0
%30 = fmul double %29, %0
%31 = fmul double %30, %0
%32 = add nsw i32 %23, -8
%33 = add i32 %23, -9
%34 = icmp ult i32 %33, -2
br i1 %34, label %21, label %35
35: ; preds = %16, %21, %2
%36 = phi double [ 1.000000e+00, %2 ], [ %19, %16 ], [ %31, %21 ]
ret double %36
}
int max_from_two(int x, int y) { return ((x >= y) ? x : y); }


x86 assembly (clang, -O0):
<max_from_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1121 <max_from_two+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max_from_two+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_from_two>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @max_from_two(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void f6() {
  char a[2];
  int *b = (int *)a;
  b[1] = 3;
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x3,0x4(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f6() {
%1 = alloca [2 x i8]
%2 = alloca i32*
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%4 = bitcast i8* %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 3, i32* %6
ret void
}

LLVM IR (-O2):
define void @f6() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *die_if_null(void *p) {
  if (!p) {
    exit(ENOMEM);
  }
  return p;
}


x86 assembly (clang, -O0):
<die_if_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1135 <die_if_null+0x25>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<die_if_null>:
test   %rdi,%rdi
je     1119 <die_if_null+0x9>
mov    %rdi,%rax
ret
push   %rax
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@ENOMEM = global i32 0
define i8* @die_if_null(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* @ENOMEM
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@ENOMEM = global i32 0
define i8* @die_if_null(i8* readnone returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @ENOMEM
%5 = tail call i32 @exit(i32 %4)
unreachable
6: ; preds = %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int raise(int sig) {
  exit(-1);
  return 0;
}


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<raise>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @raise(i32 %0) {
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, long *);
char *foo_str(long i, long j) {
  printf("foo_str: i: %ld, address: %p\n", i, &i);
  printf("foo_str: j: %ld, address: %p\n", j, &j);
  return "abcdefg";
}


x86 assembly (clang, -O0):
<foo_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
lea    -0x8(%rbp),%rdx
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xedf(%rip),%rdi
lea    -0x10(%rbp),%rdx
call   1030 <printf@plt>
lea    0xeed(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_str>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rdi,0x8(%rsp)
mov    %rbx,(%rsp)
lea    0xed5(%rip),%rdi
lea    0x8(%rsp),%rdx
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    %rsp,%rdx
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xeee(%rip),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"foo_str: i: %ld, address: %p\0A\00"
@.str.1 = [30 x i8] c"foo_str: j: %ld, address: %p\0A\00"
@.str.2 = [8 x i8] c"abcdefg\00"
define i8* @foo_str(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 %5, i64* %3)
%7 = load i64, i64* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i64 %7, i64* %4)
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [30 x i8] c"foo_str: i: %ld, address: %p\0A\00"
@.str.1 = [30 x i8] c"foo_str: j: %ld, address: %p\0A\00"
@.str.2 = [8 x i8] c"abcdefg\00"
define i8* @foo_str(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 %0, i64* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i64 %1, i64* %4)
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
}
signed char sbr_log2(const signed char val) {
  signed char log2tab[] = {0, 0, 1, 2, 2, 3, 3, 3, 3, 4};
  if (val < 10 && val >= 0)
    return log2tab[val];
  else
    return 0;
}


x86 assembly (clang, -O0):
<sbr_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xeec(%rip),%ax
mov    %ax,-0x4(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    114b <sbr_log2+0x4b>
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jl     114b <sbr_log2+0x4b>
movsbq -0x2(%rbp),%rax
mov    -0xc(%rbp,%rax,1),%al
mov    %al,-0x1(%rbp)
jmp    114f <sbr_log2+0x4f>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbr_log2>:
cmp    $0x9,%dil
ja     1115 <sbr_log2+0x15>
movzbl %dil,%eax
lea    0xeef(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@__const.sbr_log2.log2tab = [10 x i8] c"\00\00\01\02\02\03\03\03\03\04"
define signext i8 @sbr_log2(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca [10 x i8]
store i8 %0, i8* %3
%5 = bitcast [10 x i8]* %4 to i8*
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %18
9: ; preds = %1
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i8, i8* %3
%15 = sext i8 %14 to i64
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %15
%17 = load i8, i8* %16
store i8 %17, i8* %2
br label %19
18: ; preds = %9, %1
store i8 0, i8* %2
br label %19
19: ; preds = %18, %13
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
@__const.sbr_log2.log2tab = [10 x i8] c"\00\00\01\02\02\03\03\03\03\04"
define signext i8 @sbr_log2(i8 signext %0) {
%2 = icmp ult i8 %0, 10
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = zext i8 %0 to i64
%5 = getelementptr inbounds [10 x i8], [10 x i8]* @__const.sbr_log2.log2tab, i64 0, i64 %4
%6 = load i8, i8* %5
br label %7
7: ; preds = %1, %3
%8 = phi i8 [ %6, %3 ], [ 0, %1 ]
ret i8 %8
}
/* Variables and functions */
__attribute__((always_)) bool bj_isprint(char cc) {
  return ((cc >= ' ' && cc <= '~') ? true : false);
}


x86 assembly (clang, -O0):
<bj_isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <bj_isprint+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x7e,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bj_isprint>:
add    $0xe0,%dil
xor    %eax,%eax
cmp    $0x5f,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @bj_isprint(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 32
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 126
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @bj_isprint(i8 signext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
char *getString() {
  char str[] = "print it";
  return str;
}


x86 assembly (clang, -O0):
<getString>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x9(%rbp)
mov    0xef3(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x9(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getString>:
lea    -0x9(%rsp),%rax
ret

LLVM IR (-O0):
@__const.getString.str = [9 x i8] c"print it\00"
define i8* @getString() {
%1 = alloca [9 x i8]
%2 = bitcast [9 x i8]* %1 to i8*
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @getString() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
ret i8* %2
}
/* Variables and functions */
int strlen(char const *);
char rightcharof(const char *p, int index) {
  int l = strlen(p);
  return p[l - 1 - index];
}


x86 assembly (clang, -O0):
<rightcharof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightcharof>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <strlen@plt>
not    %ebx
add    %eax,%ebx
movslq %ebx,%rax
mov    (%r14,%rax,1),%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define signext i8 @rightcharof(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = load i32, i32* %4
%12 = sub nsw i32 %10, %11
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %8, i64 %13
%15 = load i8, i8* %14
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @rightcharof(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = xor i32 %1, -1
%5 = add i32 %3, %4
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char str[25], res[25];
  printf("Input string for Caesar-encoding: ");
  scanf(" %s", str);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xedd(%rip),%rdi
call   1040 <scanf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Input string for Caesar-encoding: \00"
@.str.1 = [4 x i8] c" %s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [25 x i8]
%3 = alloca [25 x i8]
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@.str = [35 x i8] c"Input string for Caesar-encoding: \00"
@.str.1 = [4 x i8] c" %s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [25 x i8]
%2 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void myproc(int n) {
  int p;
  p = 2 * n;
  printf("Teo times %d is %d\n", n, p);
}


x86 assembly (clang, -O0):
<myproc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myproc>:
mov    %edi,%esi
lea    (%rsi,%rsi,1),%edx
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Teo times %d is %d\0A\00"
define void @myproc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 2, %4
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Teo times %d is %d\0A\00"
define void @myproc(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret void
}
reg0adrreg1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if (r0 <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0adrreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movzwl -0x6(%rbp),%eax
mov    -0x20(%rbp),%rcx
movzwl 0x87a22(%rcx),%ecx
cmp    %ecx,%eax
jg     1142 <reg0adrreg1+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1149 <reg0adrreg1+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0adrreg1>:
movzwl %di,%ecx
movzwl 0x87a22(%r9),%edx
xor    %eax,%eax
cmp    %edx,%ecx
setbe  %al
ret

LLVM IR (-O0):
define i32 @reg0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* %8
%17 = zext i16 %16 to i32
%18 = load i16*, i16** %13
%19 = getelementptr inbounds i16, i16* %18, i64 277777
%20 = load i16, i16* %19
%21 = zext i16 %20 to i32
%22 = icmp sle i32 %17, %21
br i1 %22, label %23, label %24
23: ; preds = %6
store i32 1, i32* %7
br label %25
24: ; preds = %6
store i32 0, i32* %7
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @reg0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = and i32 %0, 65535
%8 = getelementptr inbounds i16, i16* %5, i64 277777
%9 = load i16, i16* %8
%10 = zext i16 %9 to i32
%11 = icmp ule i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
unsigned long long powull(unsigned long long const base,
                          unsigned long long const exponent) {
  unsigned long long result = 1;
  int i;
  for (i = 0; i < exponent; i++) {
    result *= base;
  }
  return (result);
}


x86 assembly (clang, -O0):
<powull>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1144 <powull+0x44>
mov    -0x8(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <powull+0x1b>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<powull>:
test   %rsi,%rsi
je     111b <powull+0x1b>
lea    -0x1(%rsi),%rax
mov    %esi,%ecx
and    $0x7,%ecx
cmp    $0x7,%rax
jae    1121 <powull+0x21>
mov    $0x1,%eax
jmp    1156 <powull+0x56>
mov    $0x1,%eax
ret
and    $0xfffffffffffffff8,%rsi
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
add    $0xfffffffffffffff8,%rsi
jne    1130 <powull+0x30>
test   %rcx,%rcx
je     116a <powull+0x6a>
nopl   0x0(%rax,%rax,1)
imul   %rdi,%rax
add    $0xffffffffffffffff,%rcx
jne    1160 <powull+0x60>
ret

LLVM IR (-O0):
define i64 @powull(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 1, i64* %5
store i32 0, i32* %6
br label %7
7: ; preds = %16, %2
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %7
%13 = load i64, i64* %3
%14 = load i64, i64* %5
%15 = mul i64 %14, %13
store i64 %15, i64* %5
br label %16
16: ; preds = %12
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %7
19: ; preds = %7
%20 = load i64, i64* %5
ret i64 %20
}

LLVM IR (-O2):
define i64 @powull(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %33, label %4
4: ; preds = %2
%5 = add i64 %1, -1
%6 = and i64 %1, 7
%7 = icmp ult i64 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i64 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi i64 [ 1, %8 ], [ %20, %10 ]
%12 = phi i64 [ 0, %8 ], [ %21, %10 ]
%13 = mul i64 %11, %0
%14 = mul i64 %13, %0
%15 = mul i64 %14, %0
%16 = mul i64 %15, %0
%17 = mul i64 %16, %0
%18 = mul i64 %17, %0
%19 = mul i64 %18, %0
%20 = mul i64 %19, %0
%21 = add i64 %12, 8
%22 = icmp eq i64 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi i64 [ undef, %4 ], [ %20, %10 ]
%25 = phi i64 [ 1, %4 ], [ %20, %10 ]
%26 = icmp eq i64 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi i64 [ %30, %27 ], [ %25, %23 ]
%29 = phi i64 [ %31, %27 ], [ 0, %23 ]
%30 = mul i64 %28, %0
%31 = add i64 %29, 1
%32 = icmp eq i64 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi i64 [ 1, %2 ], [ %24, %23 ], [ %30, %27 ]
ret i64 %34
}
void foo(void) { *(int *)0 = 1; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @foo() {
store i32 1, i32* null
ret void
}

LLVM IR (-O2):
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
unsigned int le8put(void *p, uint8_t v) {
  uint8_t *a;
  a = p;
  a[0] = v;
  return 1;
}


x86 assembly (clang, -O0):
<le8put>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le8put>:
mov    %esi,(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @le8put(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %8, i32* %10
ret i32 1
}

LLVM IR (-O2):
define i32 @le8put(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ IntEnable(int);
int /*<<< orphan*/ IntRegister(int, void (*)());
void LPCIntRegister(unsigned long ulBase, void (*pfnHandler)(void)) {
  ;
  ;
  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)
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   %rax
mov    $0x7c,%edi
call   1040 <IntRegister@plt>
mov    $0x7c,%edi
pop    %rax
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 void ()*, void ()** %4
%6 = bitcast void ()* %5 to void (...)*
%7 = call i32 @IntRegister(i32 124, void (...)* %6)
%8 = call i32 @IntEnable(i32 124)
ret void
}

LLVM IR (-O2):
define void @LPCIntRegister(i64 %0, void ()* %1) {
%3 = bitcast void ()* %1 to void (...)*
%4 = tail call i32 @IntRegister(i32 124, void (...)* %3)
%5 = tail call i32 @IntEnable(i32 124)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TakeSample_ISR_Disable();
void TakeSample_ISR_Stop(void) { TakeSample_ISR_Disable(); }


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

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

LLVM IR (-O0):
define void @TakeSample_ISR_Stop() {
%1 = call i32 (...) @TakeSample_ISR_Disable()
ret void
}

LLVM IR (-O2):
define void @TakeSample_ISR_Stop() {
%1 = tail call i32 (...) @TakeSample_ISR_Disable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ libc_exit(int);
int /*<<< orphan*/ libc_printf(char *, int);
void Assert(unsigned int b) {
  if (!b) {
    libc_printf((char *)"assert failed\\n", 15);
    libc_exit(1);
  }
}


x86 assembly (clang, -O0):
<Assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1150 <Assert+0x30>
lea    0xec4(%rip),%rdi
mov    $0xf,%esi
call   1030 <libc_printf@plt>
mov    $0x1,%edi
call   1040 <libc_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Assert>:
test   %edi,%edi
je     1125 <Assert+0x5>
ret
push   %rax
lea    0xed3(%rip),%rdi
mov    $0xf,%esi
call   1030 <libc_printf@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <libc_exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"assert failed\\n\00"
define void @Assert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = call i32 @libc_printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 15)
%7 = call i32 @libc_exit(i32 1)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"assert failed\\n\00"
define void @Assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @libc_printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 15)
%5 = tail call i32 @libc_exit(i32 1)
br label %6
6: ; preds = %3, %1
ret void
}
int ptr_to_int(int *a) { return (int)a; }


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

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

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

LLVM IR (-O2):
define i32 @ptr_to_int(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
long Long_abs(long x) { return x > 0 ? x : -x; }


x86 assembly (clang, -O0):
<Long_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1120 <Long_abs+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <Long_abs+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @Long_abs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i64, i64* %2
br label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = sub nsw i64 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i64 [ %6, %5 ], [ %9, %7 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @Long_abs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
char *numeric_bin_to_hex(char value[]) { return ""; }


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

x86 assembly (clang, -O2):
<numeric_bin_to_hex>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @numeric_bin_to_hex(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @numeric_bin_to_hex(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ Interpolate_3(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int, int /*<<< orphan*/, int, int);
u_int32_t Interp6(u_int32_t c1, u_int32_t c2, u_int32_t c3) {
  return Interpolate_3(c1, 5, c2, 2, c3, 1, 3);
}


x86 assembly (clang, -O0):
<Interp6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%r8d
mov    $0x5,%esi
mov    $0x2,%ecx
mov    $0x1,%r9d
movl   $0x3,(%rsp)
call   1030 <Interpolate_3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp6>:
push   %rax
mov    %edx,%r8d
mov    %esi,%edx
movl   $0x3,(%rsp)
mov    $0x5,%esi
mov    $0x2,%ecx
mov    $0x1,%r9d
call   1030 <Interpolate_3@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Interp6(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @Interpolate_3(i32 %7, i32 5, i32 %8, i32 2, i32 %9, i32 1, i32 3)
ret i32 %10
}

LLVM IR (-O2):
define i32 @Interp6(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @Interpolate_3(i32 %0, i32 5, i32 %1, i32 2, i32 %2, i32 1, i32 3)
ret i32 %4
}
/* Type definitions */
struct tipc_msg {
  int dummy;
};

/* Variables and functions */
int msg_bits(struct tipc_msg *, int /*<<< orphan*/, int, int);
int msg_src_droppable(struct tipc_msg *m) { return msg_bits(m, 0, 18, 1); }


x86 assembly (clang, -O0):
<msg_src_droppable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x12,%edx
mov    $0x1,%ecx
call   1030 <msg_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_src_droppable>:
xor    %esi,%esi
mov    $0x12,%edx
mov    $0x1,%ecx
jmp    1030 <msg_bits@plt>

LLVM IR (-O0):
%struct.tipc_msg = type { i32 }
define i32 @msg_src_droppable(%struct.tipc_msg* %0) {
%2 = alloca %struct.tipc_msg*
store %struct.tipc_msg* %0, %struct.tipc_msg** %2
%3 = load %struct.tipc_msg*, %struct.tipc_msg** %2
%4 = call i32 @msg_bits(%struct.tipc_msg* %3, i32 0, i32 18, i32 1)
ret i32 %4
}

LLVM IR (-O2):
%struct.tipc_msg = type { i32 }
define i32 @msg_src_droppable(%struct.tipc_msg* %0) {
%2 = tail call i32 @msg_bits(%struct.tipc_msg* %0, i32 0, i32 18, i32 1)
ret i32 %2
}
/* Variables and functions */
float stress_funccall_float_1(float const);
float stress_funcdeep_float_2(float const, float const);
float __attribute__((no))
stress_funcdeep_float_3(const float a, const float b, const float c) {
  return stress_funcdeep_float_2(c, b) + stress_funccall_float_1(a);
}


x86 assembly (clang, -O0):
<stress_funcdeep_float_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <stress_funcdeep_float_2@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <stress_funccall_float_1@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_funcdeep_float_3>:
push   %rax
movss  %xmm0,0x4(%rsp)
movaps %xmm2,%xmm0
call   1030 <stress_funcdeep_float_2@plt>
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
call   1040 <stress_funccall_float_1@plt>
addss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @stress_funcdeep_float_3(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %5
%9 = call float @stress_funcdeep_float_2(float %7, float %8)
%10 = load float, float* %4
%11 = call float @stress_funccall_float_1(float %10)
%12 = fadd float %9, %11
ret float %12
}

LLVM IR (-O2):
define float @stress_funcdeep_float_3(float %0, float %1, float %2) {
%4 = tail call float @stress_funcdeep_float_2(float %2, float %1)
%5 = tail call float @stress_funccall_float_1(float %0)
%6 = fadd float %4, %5
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ F_UNLCK;
int dolock(int, int /*<<< orphan*/);
int releaselock(int fd) { return dolock(fd, F_UNLCK); }


x86 assembly (clang, -O0):
<releaselock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
call   1030 <dolock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<releaselock>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <dolock@plt>

LLVM IR (-O0):
@F_UNLCK = global i32 0
define i32 @releaselock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_UNLCK
%5 = call i32 @dolock(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@F_UNLCK = global i32 0
define i32 @releaselock(i32 %0) {
%2 = load i32, i32* @F_UNLCK
%3 = tail call i32 @dolock(i32 %0, i32 %2)
ret i32 %3
}