xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test_solarsystem_config(char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  int i;
  if (argc < 2)
    usage();
  for (i = 1; i < argc; i++)
    test_solarsystem_config(argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1147 <main+0x27>
mov    $0x0,%al
call   1030 <usage@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1179 <main+0x59>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <test_solarsystem_config@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <main+0x2e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x1,%edi
jg     1133 <main+0x13>
xor    %eax,%eax
call   1030 <usage@plt>
jmp    1152 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
xchg   %ax,%ax
mov    (%r14,%rbx,8),%rdi
call   1040 <test_solarsystem_config@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @usage()
br label %11
11: ; preds = %9, %2
store i32 1, i32* %6
br label %12
12: ; preds = %23, %11
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %26
16: ; preds = %12
%17 = load i8**, i8*** %5
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %17, i64 %19
%21 = load i8*, i8** %20
%22 = call i32 @test_solarsystem_config(i8* %21)
br label %23
23: ; preds = %16
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %12
26: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %15
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 1, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @test_solarsystem_config(i8* %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %4
ret i32 0
}
long write(int fd, void *buf, unsigned long count) {
  long res;
  asm volatile("int $0x85"
               : "=a"(res)
               : "a"(4), "b"(fd), "c"(buf), "d"(count)
               : "memory");
  return res;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0xc(%rbp),%ebx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rdx
mov    $0x4,%eax
int    $0x85
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %rbx
mov    %rsi,%rcx
mov    %edi,%ebx
mov    $0x4,%eax
int    $0x85
pop    %rbx
ret

LLVM IR (-O0):
define i64 @write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 asm sideeffect "int $$0x85", "={ax},{ax},{bx},{cx},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 4, i32 %8, i8* %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
ret i64 %12
}

LLVM IR (-O2):
define i64 @write(i32 %0, i8* %1, i64 %2) {
%4 = tail call i64 asm sideeffect "int $$0x85", "={ax},{ax},{bx},{cx},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 4, i32 %0, i8* %1, i64 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ AllocateImageRGB24(char const *, int, int, int,
                                      unsigned char *);
void rt_define_teximage_rgb24(const char *name, int xs, int ys, int zs,
                              unsigned char *rgb) {
  AllocateImageRGB24(name, xs, ys, zs, rgb);
}


x86 assembly (clang, -O0):
<rt_define_teximage_rgb24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1030 <AllocateImageRGB24@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_define_teximage_rgb24>:
jmp    1030 <AllocateImageRGB24@plt>

LLVM IR (-O0):
define void @rt_define_teximage_rgb24(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
%16 = call i32 @AllocateImageRGB24(i8* %11, i32 %12, i32 %13, i32 %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @rt_define_teximage_rgb24(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = tail call i32 @AllocateImageRGB24(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4)
ret void
}
int fun(const void *a, const void *b) { return *(int *)a - *(int *)b; }


x86 assembly (clang, -O0):
<fun>:
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):
<fun>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @fun(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 @fun(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 foo_1_2_2_1_1_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_1_1_2_1_1_1() {
ret void
}
/* Variables and functions */
scalar_t__ isascii(int);
scalar_t__ isdigit(int);
int utf32_isdigit(int c) { return isascii(c) && isdigit(c); }


x86 assembly (clang, -O0):
<utf32_isdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isascii@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1157 <utf32_isdigit+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf32_isdigit>:
push   %rbx
mov    %edi,%ebx
call   1040 <isascii@plt>
test   %rax,%rax
je     1141 <utf32_isdigit+0x21>
mov    %ebx,%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @utf32_isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isascii(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isdigit(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @utf32_isdigit(i32 %0) {
%2 = tail call i64 @isascii(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @isdigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(int /*<<< orphan*/ *);
int c_fileno(FILE *s) { return fileno(s); }


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

x86 assembly (clang, -O2):
<c_fileno>:
jmp    1030 <fileno@plt>

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

LLVM IR (-O2):
define i32 @c_fileno(i32* nocapture %0) {
%2 = tail call i32 @fileno(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
int main() {
  foo();
  bar();
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @foo()
%2 = call i32 (...) @bar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @bar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void gen(int lo, int hi) {
  if (lo > hi)
    return;
  int mid = (lo + hi) / 2;
  printf("%d\n", mid);
  gen(lo, mid - 1);
  gen(mid + 1, hi);
}


x86 assembly (clang, -O0):
<gen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113f <gen+0x1f>
jmp    117b <gen+0x5b>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <gen@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1040 <gen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    %esi,%edi
jg     116b <gen+0x4b>
mov    %esi,%r15d
mov    %edi,%r12d
lea    0xec7(%rip),%r14
nopl   0x0(%rax)
lea    (%r12,%r15,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    -0x1(%rbx),%esi
mov    %r12d,%edi
call   1040 <gen@plt>
lea    0x1(%rbx),%r12d
cmp    %r15d,%ebx
jl     1140 <gen+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @gen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
br label %23
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = add nsw i32 %11, %12
%14 = sdiv i32 %13, 2
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %3
%18 = load i32, i32* %5
%19 = sub nsw i32 %18, 1
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %4
br label %23
23: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @gen(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ %0, %2 ]
%6 = add nsw i32 %5, %1
%7 = sdiv i32 %6, 2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nsw i32 %7, -1
tail call void @gen(i32 %5, i32 %9)
%10 = add nsw i32 %7, 1
%11 = icmp slt i32 %7, %1
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
int main() { return 012; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
unsigned xrop3_17_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = D | S;
  stk1 = ~stk1;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_17_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_17_0_1>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
not    %edi
mov    %edi,%ecx
shl    $0x8,%ecx
not    %eax
and    %ecx,%eax
and    %esi,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_17_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
store i32 %20, i32* %7
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = or i32 %21, %22
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = xor i32 %24, -1
store i32 %25, i32* %8
%26 = load i32, i32* %8
%27 = load i32, i32* %6
%28 = and i32 %26, %27
%29 = load i32, i32* %8
%30 = load i32, i32* %7
%31 = xor i32 %30, -1
%32 = and i32 %29, %31
%33 = or i32 %28, %32
%34 = load i32, i32* %7
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = and i32 %37, %38
%40 = or i32 %33, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @xrop3_17_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = mul nuw nsw i32 %4, 257
%6 = xor i32 %3, -1
%7 = shl nsw i32 %6, 8
%8 = xor i32 %5, -1
%9 = and i32 %7, %8
%10 = and i32 %6, %4
%11 = or i32 %9, %10
ret i32 %11
}
/* Variables and functions */
size_t FloorPowerOfTwo(const size_t value) {
  size_t x = value;
  x = x | (x >> 1);
  x = x | (x >> 2);
  x = x | (x >> 4);
  x = x | (x >> 8);
  x = x | (x >> 16);
  x = x | (x >> 32);
  return x - (x >> 1);
}


x86 assembly (clang, -O0):
<FloorPowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x1,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x2,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x4,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x8,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x10,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x20,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x1,%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FloorPowerOfTwo>:
mov    %rdi,%rax
shr    %rax
or     %rdi,%rax
mov    %rax,%rcx
shr    $0x2,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x4,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x8,%rcx
or     %rax,%rcx
mov    %rcx,%rdx
shr    $0x10,%rdx
or     %rcx,%rdx
mov    %rdx,%rax
shr    $0x20,%rax
or     %rdx,%rax
mov    %rax,%rcx
shr    %rcx
sub    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @FloorPowerOfTwo(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = load i64, i64* %3
%7 = lshr i64 %6, 1
%8 = or i64 %5, %7
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = load i64, i64* %3
%11 = lshr i64 %10, 2
%12 = or i64 %9, %11
store i64 %12, i64* %3
%13 = load i64, i64* %3
%14 = load i64, i64* %3
%15 = lshr i64 %14, 4
%16 = or i64 %13, %15
store i64 %16, i64* %3
%17 = load i64, i64* %3
%18 = load i64, i64* %3
%19 = lshr i64 %18, 8
%20 = or i64 %17, %19
store i64 %20, i64* %3
%21 = load i64, i64* %3
%22 = load i64, i64* %3
%23 = lshr i64 %22, 16
%24 = or i64 %21, %23
store i64 %24, i64* %3
%25 = load i64, i64* %3
%26 = load i64, i64* %3
%27 = lshr i64 %26, 32
%28 = or i64 %25, %27
store i64 %28, i64* %3
%29 = load i64, i64* %3
%30 = load i64, i64* %3
%31 = lshr i64 %30, 1
%32 = sub i64 %29, %31
ret i64 %32
}

LLVM IR (-O2):
define i64 @FloorPowerOfTwo(i64 %0) {
%2 = lshr i64 %0, 1
%3 = or i64 %2, %0
%4 = lshr i64 %3, 2
%5 = or i64 %4, %3
%6 = lshr i64 %5, 4
%7 = or i64 %6, %5
%8 = lshr i64 %7, 8
%9 = or i64 %8, %7
%10 = lshr i64 %9, 16
%11 = or i64 %10, %9
%12 = lshr i64 %11, 32
%13 = or i64 %12, %11
%14 = lshr i64 %13, 1
%15 = sub i64 %13, %14
ret i64 %15
}
void av_cast5_crypt() {}


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

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

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

LLVM IR (-O2):
define void @av_cast5_crypt() {
ret void
}
int main() {
  int arr[] = {1, 2, 3};
  int *x = arr;
  int *y = &arr[2];
  int diff = y - x;
  x += diff;
  *x = 5;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeec(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x5,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.arr = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [3 x i32]* %2 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32* %7, i32** %3
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
store i32* %8, i32** %4
%9 = load i32*, i32** %4
%10 = load i32*, i32** %3
%11 = ptrtoint i32* %9 to i64
%12 = ptrtoint i32* %10 to i64
%13 = sub i64 %11, %12
%14 = sdiv exact i64 %13, 4
%15 = trunc i64 %14 to i32
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = load i32*, i32** %3
%18 = sext i32 %16 to i64
%19 = getelementptr inbounds i32, i32* %17, i64 %18
store i32* %19, i32** %3
%20 = load i32*, i32** %3
store i32 5, i32* %20
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
double beta_ii(double p) {
  double val = 0.0;
  val = 2.0E-07 + 5.4E-06 * p;
  return val;
}


x86 assembly (clang, -O0):
<beta_ii>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<beta_ii>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @beta_ii(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %3
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double 0x3ED6A634B28F33E5, double %4, double 2.000000e-07)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @beta_ii(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0x3ED6A634B28F33E5, double 2.000000e-07)
ret double %2
}
void __libc_disable_asynccancel(int x) {}


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

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

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

LLVM IR (-O2):
define void @__libc_disable_asynccancel(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void output1(char *s) { printf("%s", s); }


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

x86 assembly (clang, -O2):
<output1>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @output1(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_E5uint8_mem(unsigned char *val) {
  return ((*val) & (-0xE5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E5uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -229
%7 = icmp ne i32 %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_E5uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 27
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ picint_common(int /*<<< orphan*/, int /*<<< orphan*/);
void picint(uint16_t num) { picint_common(num, 0); }


x86 assembly (clang, -O0):
<picint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <picint_common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<picint>:
xor    %esi,%esi
jmp    1030 <picint_common@plt>

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

LLVM IR (-O2):
define void @picint(i32 %0) {
%2 = tail call i32 @picint_common(i32 %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRCA_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRCA_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRCA_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
void print_bytes(unsigned char *ptr, int num) {
  int i;
  for (i = 0; i < num; ++i) {
    do {
    } while (0);
    if (i == num - 1) {
      do {
      } while (0);
    } else {
      do {
      } while (0);
    }
  }
}


x86 assembly (clang, -O0):
<print_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116a <print_bytes+0x6a>
jmp    1123 <print_bytes+0x23>
jmp    1128 <print_bytes+0x28>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1148 <print_bytes+0x48>
jmp    113e <print_bytes+0x3e>
jmp    1143 <print_bytes+0x43>
jmp    1157 <print_bytes+0x57>
jmp    114d <print_bytes+0x4d>
jmp    1152 <print_bytes+0x52>
jmp    1157 <print_bytes+0x57>
jmp    115c <print_bytes+0x5c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <print_bytes+0x12>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @print_bytes(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_header();
int /*<<< orphan*/ read_config();
void config_command() {
  console_header();
  read_config();
}


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

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

LLVM IR (-O0):
define void @config_command() {
%1 = call i32 (...) @console_header()
%2 = call i32 (...) @read_config()
ret void
}

LLVM IR (-O2):
define void @config_command() {
%1 = tail call i32 (...) @console_header()
%2 = tail call i32 (...) @read_config()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void ext_dev_write_double(uint32_t addr, double val, void *ctxt) {}


x86 assembly (clang, -O0):
<ext_dev_write_double>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ext_dev_write_double(i32 %0, double %1, i8* %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca i8*
store i32 %0, i32* %4
store double %1, double* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @ext_dev_write_double(i32 %0, double %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_cstr(char **str) {
  if (*str != NULL) {
    free(*str);
    *str = NULL;
  }
}


x86 assembly (clang, -O0):
<free_cstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1141 <free_cstr+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_cstr>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <free_cstr+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @free_cstr(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *fgets(char *, int, int /*<<< orphan*/ *);
char *fgets_or_exit(char *buffer, int size, FILE *stream) {
  char *buff;
  if ((buff = fgets(buffer, size, stream)) == NULL) {
    exit(1);
  }
  return buff;
}


x86 assembly (clang, -O0):
<fgets_or_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <fgets@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    115b <fgets_or_exit+0x3b>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgets_or_exit>:
push   %rax
call   1030 <fgets@plt>
test   %rax,%rax
je     112d <fgets_or_exit+0xd>
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i8* @fgets_or_exit(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i32*, i32** %6
%11 = call i8* @fgets(i8* %8, i32 %9, i32* %10)
store i8* %11, i8** %7
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %3
%16 = load i8*, i8** %7
ret i8* %16
}

LLVM IR (-O2):
define i8* @fgets_or_exit(i8* %0, i32 %1, i32* nocapture %2) {
%4 = tail call i8* @fgets(i8* %0, i32 %1, i32* %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %3
ret i8* %4
}
/* Variables and functions */
size_t func_d_idx(size_t a, size_t b) {
  enum { xx = 0, yy, zz, xy, xz, yz };
  static const size_t idx[] = {xx, xy, xz, xy, yy, yz, xz, yz, zz};
  return idx[3 * a + b];
}


x86 assembly (clang, -O0):
<func_d_idx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
imul   $0x3,-0x8(%rbp),%rcx
add    -0x10(%rbp),%rcx
lea    0xee4(%rip),%rax
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_d_idx>:
lea    (%rdi,%rdi,2),%rax
add    %rsi,%rax
lea    0xef2(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret

LLVM IR (-O0):
@func_d_idx.idx = internal constant [9 x i64] [i64 0, i64 3, i64 4, i64 3, i64 1, i64 5, i64 4, i64 5, i64 2]
define i64 @func_d_idx(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 = mul i64 3, %5
%7 = load i64, i64* %4
%8 = add i64 %6, %7
%9 = getelementptr inbounds [9 x i64], [9 x i64]* @func_d_idx.idx, i64 0, i64 %8
%10 = load i64, i64* %9
ret i64 %10
}

LLVM IR (-O2):
@func_d_idx.idx = internal unnamed_addr constant [9 x i64] [i64 0, i64 3, i64 4, i64 3, i64 1, i64 5, i64 4, i64 5, i64 2]
define i64 @func_d_idx(i64 %0, i64 %1) {
%3 = mul i64 %0, 3
%4 = add i64 %3, %1
%5 = getelementptr inbounds [9 x i64], [9 x i64]* @func_d_idx.idx, i64 0, i64 %4
%6 = load i64, i64* %5
ret i64 %6
}
/* Type definitions */
struct cdb_make {
  int dummy;
};

/* Variables and functions */
int _cdb_make_add(struct cdb_make *, int /*<<< orphan*/, void const *,
                  unsigned int, void const *, unsigned int);
int /*<<< orphan*/ cdb_hash(void const *, unsigned int);
int cdb_make_add(struct cdb_make *cdbmp, const void *key, unsigned klen,
                 const void *val, unsigned vlen) {
  return _cdb_make_add(cdbmp, cdb_hash(key, klen), key, klen, val, vlen);
}


x86 assembly (clang, -O0):
<cdb_make_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <cdb_hash@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
call   1030 <_cdb_make_add@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdb_make_add>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r12
mov    %rsi,%rdi
mov    %edx,%esi
call   1040 <cdb_hash@plt>
mov    %r12,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
mov    %ebp,%ecx
mov    %r15,%r8
mov    %r14d,%r9d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <_cdb_make_add@plt>

LLVM IR (-O0):
%struct.cdb_make = type { i32 }
define i32 @cdb_make_add(%struct.cdb_make* %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca %struct.cdb_make*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store %struct.cdb_make* %0, %struct.cdb_make** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load %struct.cdb_make*, %struct.cdb_make** %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i32 @cdb_hash(i8* %12, i32 %13)
%15 = load i8*, i8** %7
%16 = load i32, i32* %8
%17 = load i8*, i8** %9
%18 = load i32, i32* %10
%19 = call i32 @_cdb_make_add(%struct.cdb_make* %11, i32 %14, i8* %15, i32 %16, i8* %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.cdb_make = type { i32 }
define i32 @cdb_make_add(%struct.cdb_make* %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @cdb_hash(i8* %1, i32 %2)
%7 = tail call i32 @_cdb_make_add(%struct.cdb_make* %0, i32 %6, i8* %1, i32 %2, i8* %3, i32 %4)
ret i32 %7
}
/* Variables and functions */
void *android_dlopen(char const *, int);
void *hybris_dlopen(const char *filename, int flag) {
  return android_dlopen(filename, flag);
}


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

x86 assembly (clang, -O2):
<hybris_dlopen>:
jmp    1030 <android_dlopen@plt>

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

LLVM IR (-O2):
define i8* @hybris_dlopen(i8* %0, i32 %1) {
%3 = tail call i8* @android_dlopen(i8* %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int dproduct(double *, double *);
int /*<<< orphan*/ memcpy(double *, double *, int);
int sqlen(double *);
int /*<<< orphan*/ vscale(double *, int);
void proj(double a[3], double b[3], double c[3]) {
  memcpy(c, b, sizeof(double) * 3);
  vscale(c, dproduct(a, b) / sqlen(b));
}


x86 assembly (clang, -O0):
<proj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x18,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <dproduct@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sqlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%esi
call   1050 <vscale@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proj>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rdx,%rdi
mov    $0x18,%edx
call   1040 <memcpy@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <dproduct@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <sqlen@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %r14,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <vscale@plt>

LLVM IR (-O0):
define void @proj(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %6
%8 = load double*, double** %5
%9 = call i32 @memcpy(double* %7, double* %8, i32 24)
%10 = load double*, double** %6
%11 = load double*, double** %4
%12 = load double*, double** %5
%13 = call i32 @dproduct(double* %11, double* %12)
%14 = load double*, double** %5
%15 = call i32 @sqlen(double* %14)
%16 = sdiv i32 %13, %15
%17 = call i32 @vscale(double* %10, i32 %16)
ret void
}

LLVM IR (-O2):
define void @proj(double* %0, double* %1, double* %2) {
%4 = tail call i32 @memcpy(double* %2, double* %1, i32 24)
%5 = tail call i32 @dproduct(double* %0, double* %1)
%6 = tail call i32 @sqlen(double* %1)
%7 = sdiv i32 %5, %6
%8 = tail call i32 @vscale(double* %2, i32 %7)
ret void
}
int is_proto_http(int proto) { return (proto & (1 << 1)) == (1 << 1); }


x86 assembly (clang, -O0):
<is_proto_http>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_proto_http>:
mov    %edi,%eax
shr    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_proto_http(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 2
%5 = icmp eq i32 %4, 2
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_proto_http(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ puts(char *);
char *urlsort(char *);
int main(int argc, char *argv[]) {
  char *out;
  out = urlsort(argv[1]);
  puts(out);
  free(out);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <urlsort@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <puts@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
call   1050 <urlsort@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i8* @urlsort(i8* %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call i32 @puts(i8* %10)
%12 = load i8*, i8** %5
%13 = call i32 @free(i8* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i8* @urlsort(i8* %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
%7 = tail call i32 @free(i8* %5)
ret i32 0
}
int main(argc, argv)
int argc;
char *argv[];
{
  char word[257];
  static char prev[257] = "";
  while (!expand(word, prev))
    puts(word);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x120(%rbp),%rdi
lea    0x2ef9(%rip),%rsi
mov    $0x0,%al
call   1040 <expand@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1163 <main+0x43>
jmp    1176 <main+0x56>
lea    -0x120(%rbp),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x108,%rsp
lea    0x2f0f(%rip),%rsi
mov    %rsp,%rdi
xor    %eax,%eax
call   1040 <expand@plt>
test   %eax,%eax
jne    116b <main+0x4b>
mov    %rsp,%rbx
lea    0x2ef7(%rip),%r14
nopl   0x0(%rax)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <expand@plt>
test   %eax,%eax
je     1150 <main+0x30>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@main.prev = internal global [257 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [257 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %12, %2
%8 = getelementptr inbounds [257 x i8], [257 x i8]* %6, i64 0, i64 0
%9 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @expand to i32 (i8*, i8*, ...)*)(i8* %8, i8* getelementptr inbounds ([257 x i8], [257 x i8]* @main.prev, i64 0, i64 0))
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = getelementptr inbounds [257 x i8], [257 x i8]* %6, i64 0, i64 0
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %13)
br label %7
15: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@main.prev = internal global [257 x i8] zeroinitializer
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [257 x i8]
%4 = getelementptr inbounds [257 x i8], [257 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @expand to i32 (i8*, i8*, ...)*)(i8* %4, i8* getelementptr inbounds ([257 x i8], [257 x i8]* @main.prev, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2, %7
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %4)
%9 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @expand to i32 (i8*, i8*, ...)*)(i8* %4, i8* getelementptr inbounds ([257 x i8], [257 x i8]* @main.prev, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %7, label %11
11: ; preds = %7, %2
ret i32 0
}
/* Variables and functions */
int var_ele(size_t n, int a[n][n], size_t i, size_t j) { return a[i][j]; }


x86 assembly (clang, -O0):
<var_ele>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<var_ele>:
imul   %rdx,%rdi
lea    (%rsi,%rdi,4),%rax
mov    (%rax,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @var_ele(i64 %0, i32* %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %5
%11 = load i32*, i32** %6
%12 = load i64, i64* %7
%13 = mul nsw i64 %12, %10
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i64, i64* %8
%16 = getelementptr inbounds i32, i32* %14, i64 %15
%17 = load i32, i32* %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @var_ele(i64 %0, i32* nocapture %1, i64 %2, i64 %3) {
%5 = mul nsw i64 %2, %0
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = getelementptr inbounds i32, i32* %6, i64 %3
%8 = load i32, i32* %7
ret i32 %8
}
char control_rep(const signed char c) {
  if (c == 0x7F)
    return '?';
  else if (c == -97)
    return '=';
  else if (c < 0)
    return c + 224;
  else
    return c + 64;
}


x86 assembly (clang, -O0):
<control_rep>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x7f,%eax
jne    1120 <control_rep+0x20>
movb   $0x3f,-0x1(%rbp)
jmp    115e <control_rep+0x5e>
movsbl -0x2(%rbp),%eax
cmp    $0xffffff9f,%eax
jne    1136 <control_rep+0x36>
movb   $0x3d,-0x1(%rbp)
jmp    115e <control_rep+0x5e>
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jge    1154 <control_rep+0x54>
movsbl -0x2(%rbp),%eax
add    $0xe0,%eax
mov    %al,-0x1(%rbp)
jmp    115e <control_rep+0x5e>
movsbl -0x2(%rbp),%eax
add    $0x40,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<control_rep>:
mov    %edi,%eax
cmp    $0x7f,%al
je     110d <control_rep+0xd>
cmp    $0x9f,%al
jne    1110 <control_rep+0x10>
mov    $0x3d,%al
ret
mov    $0x3f,%al
ret
test   %al,%al
js     1117 <control_rep+0x17>
add    $0x40,%al
ret
add    $0xe0,%al
ret

LLVM IR (-O0):
define signext i8 @control_rep(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 127
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 63, i8* %2
br label %27
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, -97
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 61, i8* %2
br label %27
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = add nsw i32 %19, 224
%21 = trunc i32 %20 to i8
store i8 %21, i8* %2
br label %27
22: ; preds = %13
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = add nsw i32 %24, 64
%26 = trunc i32 %25 to i8
store i8 %26, i8* %2
br label %27
27: ; preds = %22, %17, %12, %7
%28 = load i8, i8* %2
ret i8 %28
}

LLVM IR (-O2):
define signext i8 @control_rep(i8 signext %0) {
switch i8 %0, label %3 [
i8 127, label %9
i8 -97, label %2
]
2: ; preds = %1
br label %9
3: ; preds = %1
%4 = icmp slt i8 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = add i8 %0, -32
br label %9
7: ; preds = %3
%8 = add nuw i8 %0, 64
br label %9
9: ; preds = %1, %7, %5, %2
%10 = phi i8 [ 61, %2 ], [ %6, %5 ], [ %8, %7 ], [ 63, %1 ]
ret i8 %10
}
void XDestroyWindow() {}


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

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

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

LLVM IR (-O2):
define void @XDestroyWindow() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  ((void)argc);
  ((void)argv);
  printf("POLARSSL_BIGNUM_C and/or "
         "POLARSSL_PK_PARSE_C and/or POLARSSL_FS_IO not defined.\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [81 x i8] c"POLARSSL_BIGNUM_C and/or POLARSSL_PK_PARSE_C and/or POLARSSL_FS_IO not defined.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [80 x i8] c"POLARSSL_BIGNUM_C and/or POLARSSL_PK_PARSE_C and/or POLARSSL_FS_IO not defined.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str, i64 0, i64 0))
ret i32 0
}