xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __builtin_arc_mul64(int, int);
void foo(int x, int y) { __builtin_arc_mul64(x, y); }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <__builtin_arc_mul64@plt>

LLVM IR (-O0):
define void @foo(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 = call i32 @__builtin_arc_mul64(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
%3 = tail call i32 @__builtin_arc_mul64(i32 %0, i32 %1)
ret void
}
void test50() { char c[1 ?: 2]; }


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

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

LLVM IR (-O0):
define void @test50() {
%1 = alloca [1 x i8]
ret void
}

LLVM IR (-O2):
define void @test50() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int main(void) {
  bar();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ system(char const *);
int mgrShutdown(int code, void *arg1, void *arg2) {
  static const char *cmd = "/sbin/shutdown now -h";
  ;
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<mgrShutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2efe(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@mgrShutdown.cmd = internal global i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i32 0, i32 0)
@.str = [22 x i8] c"/sbin/shutdown now -h\00"
define i32 @mgrShutdown(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** @mgrShutdown.cmd
%8 = call i32 @system(i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"/sbin/shutdown now -h\00"
define i32 @mgrShutdown(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @system(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int pred_fun(void *a, void *b) { return a < b; }


x86 assembly (clang, -O0):
<pred_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pred_fun>:
xor    %eax,%eax
cmp    %rsi,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @pred_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 = load i8*, i8** %4
%7 = icmp ult i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @pred_fun(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
int /*<<< orphan*/ g(int *);
int /*<<< orphan*/ init();
int *malloc(int);
int main() {
  int *a;
  int *b;
  init();
  a = malloc(sizeof(int));
  b = malloc(sizeof(int));
  if (a == 0 || b == 0)
    return -1;
  f(a);
  f(b);
  g(a);
  g(b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1188 <main+0x48>
cmpq   $0x0,-0x18(%rbp)
jne    1194 <main+0x54>
movl   $0xffffffff,-0x4(%rbp)
jmp    11bf <main+0x7f>
mov    -0x10(%rbp),%rdi
call   1030 <f@plt>
mov    -0x18(%rbp),%rdi
call   1030 <f@plt>
mov    -0x10(%rbp),%rdi
call   1060 <g@plt>
mov    -0x18(%rbp),%rdi
call   1060 <g@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <init@plt>
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    $0xffffffff,%eax
test   %rbx,%rbx
je     1196 <main+0x56>
test   %r14,%r14
je     1196 <main+0x56>
mov    %rbx,%rdi
call   1030 <f@plt>
mov    %r14,%rdi
call   1030 <f@plt>
mov    %rbx,%rdi
call   1060 <g@plt>
mov    %r14,%rdi
call   1060 <g@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32 (...) @init()
%5 = call i32* @malloc(i32 4)
store i32* %5, i32** %2
%6 = call i32* @malloc(i32 4)
store i32* %6, i32** %3
%7 = load i32*, i32** %2
%8 = icmp eq i32* %7, null
br i1 %8, label %12, label %9
9: ; preds = %0
%10 = load i32*, i32** %3
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %13
12: ; preds = %9, %0
store i32 -1, i32* %1
br label %22
13: ; preds = %9
%14 = load i32*, i32** %2
%15 = call i32 @f(i32* %14)
%16 = load i32*, i32** %3
%17 = call i32 @f(i32* %16)
%18 = load i32*, i32** %2
%19 = call i32 @g(i32* %18)
%20 = load i32*, i32** %3
%21 = call i32 @g(i32* %20)
store i32 0, i32* %1
br label %22
22: ; preds = %13, %12
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32* @malloc(i32 4)
%3 = tail call i32* @malloc(i32 4)
%4 = icmp eq i32* %2, null
%5 = icmp eq i32* %3, null
%6 = or i1 %4, %5
br i1 %6, label %12, label %7
7: ; preds = %0
%8 = tail call i32 @f(i32* %2)
%9 = tail call i32 @f(i32* %3)
%10 = tail call i32 @g(i32* %2)
%11 = tail call i32 @g(i32* %3)
br label %12
12: ; preds = %0, %7
%13 = phi i32 [ 0, %7 ], [ -1, %0 ]
ret i32 %13
}
pstrlen(string) char *string;
{
  register char *rstring;
  register int rlength;
  rstring = string;
  for (rlength = 0; *rstring++ != 0; ++rlength)
    ;
  return (rlength);
}


x86 assembly (clang, -O0):
<pstrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1145 <pstrlen+0x45>
jmp    1137 <pstrlen+0x37>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <pstrlen+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pstrlen>:
cmpb   $0x0,(%rdi)
je     111c <pstrlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <pstrlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @pstrlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
float *vec3_add(float *result, float *a, float *b) {
  result[0] = a[0] + b[0];
  result[1] = a[1] + b[1];
  result[2] = a[2] + b[2];
  return result;
}


x86 assembly (clang, -O0):
<vec3_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_add>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
addss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
addss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
addss  0x8(%rdx),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define float* @vec3_add(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** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %6
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fadd float %9, %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fadd float %18, %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %5
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %6
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fadd float %27, %30
%32 = load float*, float** %4
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
%34 = load float*, float** %4
ret float* %34
}

LLVM IR (-O2):
define float* @vec3_add(float* returned writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fadd float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fadd float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret float* %0
}
int funcmenos(int input) { return (input - 1); }


x86 assembly (clang, -O0):
<funcmenos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcmenos>:
lea    -0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @funcmenos(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @funcmenos(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void set_write_planes(int mask) {
  outb(2, 0x3c4);
  outb(mask, 0x3c5);
}


x86 assembly (clang, -O0):
<set_write_planes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x3c4,%esi
call   1030 <outb@plt>
mov    -0x4(%rbp),%edi
mov    $0x3c5,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_write_planes>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
mov    $0x3c4,%esi
call   1030 <outb@plt>
mov    %ebx,%edi
mov    $0x3c5,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @set_write_planes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @outb(i32 2, i32 964)
%4 = load i32, i32* %2
%5 = call i32 @outb(i32 %4, i32 965)
ret void
}

LLVM IR (-O2):
define void @set_write_planes(i32 %0) {
%2 = tail call i32 @outb(i32 2, i32 964)
%3 = tail call i32 @outb(i32 %0, i32 965)
ret void
}
int isspace(int c) {
  return (c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\v' ||
          c == '\f');
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xb,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
cmpl   $0xc,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
ja     111d <isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100002e00,%rdx
bt     %rcx,%rdx
jae    111d <isspace+0x1d>
ret
xor    %eax,%eax
cmp    $0xc,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 13
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 10
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 11
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 12
br label %20
20: ; preds = %17, %14, %11, %8, %5, %1
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 11, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 12
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
const char *find_slash(const char *s) {
  while (*s) {
    if (((*s) == '\\' || (*s) == '/'))
      return s;
    s++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<find_slash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <find_slash+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     1135 <find_slash+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1142 <find_slash+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <find_slash+0x5b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <find_slash+0x8>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_slash>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1127 <find_slash+0x27>
cmp    $0x2f,%cl
je     1129 <find_slash+0x29>
cmp    $0x5c,%cl
je     1129 <find_slash+0x29>
add    $0x1,%rax
jmp    1110 <find_slash+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @find_slash(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %20, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 92
br i1 %12, label %18, label %13
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 47
br i1 %17, label %18, label %20
18: ; preds = %13, %8
%19 = load i8*, i8** %3
store i8* %19, i8** %2
br label %24
20: ; preds = %13
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
br label %4
23: ; preds = %4
store i8* null, i8** %2
br label %24
24: ; preds = %23, %18
%25 = load i8*, i8** %2
ret i8* %25
}

LLVM IR (-O2):
define i8* @find_slash(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 92, label %7
i8 47, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
br label %8
8: ; preds = %2, %7
%9 = phi i8* [ %3, %7 ], [ null, %2 ]
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ size_to_str(double const, char *, char *, int);
const char *double_to_str(const double val) {
  static char buf[64];
  size_to_str(val, "%.2f %s", buf, sizeof(buf));
  return buf;
}


x86 assembly (clang, -O0):
<double_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xed7(%rip),%rdi
lea    0x2f10(%rip),%rsi
mov    $0x40,%edx
call   1030 <size_to_str@plt>
lea    0x2eff(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_str>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0x2f21(%rip),%rbx
mov    %rbx,%rsi
mov    $0x40,%edx
call   1030 <size_to_str@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@double_to_str.buf = internal global [64 x i8] zeroinitializer
@.str = [8 x i8] c"%.2f %s\00"
define i8* @double_to_str(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @size_to_str(double %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([64 x i8], [64 x i8]* @double_to_str.buf, i64 0, i64 0), i32 64)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @double_to_str.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@double_to_str.buf = internal global [64 x i8] zeroinitializer
@.str = [8 x i8] c"%.2f %s\00"
define i8* @double_to_str(double %0) {
%2 = tail call i32 @size_to_str(double %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([64 x i8], [64 x i8]* @double_to_str.buf, i64 0, i64 0), i32 64)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @double_to_str.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int __bail(int for_realz) {
  if (for_realz)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<__bail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112c <__bail+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bail>:
test   %edi,%edi
jne    1117 <__bail+0x7>
xor    %eax,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @__bail(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 %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
ret i32 0
}

LLVM IR (-O2):
define i32 @__bail(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret i32 0
}
/* Variables and functions */
double exp_rn(double);
double exp_rz(double x) { return exp_rn(x); }


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

x86 assembly (clang, -O2):
<exp_rz>:
jmp    1030 <exp_rn@plt>

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

LLVM IR (-O2):
define double @exp_rz(double %0) {
%2 = tail call double @exp_rn(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
void main() {
  int i, j, k;
  i = 0;
  k = 9;
  j = -100;
  while (i <= 100) {
    i = i + 1;
    while (j < 20) {
      j = i + j;
    }
    k = 4;
    while (k <= 3) {
      k = k + 1;
    }
  }
  __VERIFIER_assert(k == 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0xc(%rbp)
movl   $0xffffff9c,-0x8(%rbp)
cmpl   $0x64,-0x4(%rbp)
jg     117c <main+0x6c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    1158 <main+0x48>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <main+0x30>
movl   $0x4,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jg     1177 <main+0x67>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115f <main+0x4f>
jmp    112d <main+0x1d>
cmpl   $0x4,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
jmp    1030 <__VERIFIER_assert@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 1)
ret void
}
void debug_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
                                  int nelems, int direction) {}


x86 assembly (clang, -O0):
<debug_dma_sync_sg_for_device>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.device = type opaque
%struct.scatterlist = type opaque
define void @debug_dma_sync_sg_for_device(%struct.device* %0, %struct.scatterlist* %1, i32 %2, i32 %3) {
%5 = alloca %struct.device*
%6 = alloca %struct.scatterlist*
%7 = alloca i32
%8 = alloca i32
store %struct.device* %0, %struct.device** %5
store %struct.scatterlist* %1, %struct.scatterlist** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.device = type opaque
%struct.scatterlist = type opaque
define void @debug_dma_sync_sg_for_device(%struct.device* nocapture %0, %struct.scatterlist* nocapture %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ proz_debug_delete_log();
void debug_init() {
  proz_debug_delete_log();
  return;
}


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

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

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

LLVM IR (-O2):
define void @debug_init() {
%1 = tail call i32 (...) @proz_debug_delete_log()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_status_led_tir(int);
int start_camera_tir();
bool ltr_int_resume_tir() {
  bool res = start_camera_tir();
  set_status_led_tir(true);
  return res;
}


x86 assembly (clang, -O0):
<ltr_int_resume_tir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <start_camera_tir@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <set_status_led_tir@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltr_int_resume_tir>:
push   %rbx
xor    %eax,%eax
call   1040 <start_camera_tir@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <set_status_led_tir@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ltr_int_resume_tir() {
%1 = tail call i32 (...) @start_camera_tir()
%2 = tail call i32 @set_status_led_tir(i32 1)
ret i32 %1
}
/* Variables and functions */
scalar_t__ floor(scalar_t__);
scalar_t__ sqrt(long);
long npix2nside(long npix) {
  long res = (long)floor(sqrt(npix / 12.) + 0.5);
  return (res * res * 12 == npix) ? res : -1;
}


x86 assembly (clang, -O0):
<npix2nside>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <sqrt@plt>
cvtsi2sd %rax,%xmm0
movsd  0xeab(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <floor@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x10(%rbp),%rax
imul   $0xc,%rax,%rax
cmp    -0x8(%rbp),%rax
jne    118b <npix2nside+0x6b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    119b <npix2nside+0x7b>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    119b <npix2nside+0x7b>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<npix2nside>:
push   %rbx
mov    %rdi,%rbx
cvtsi2sd %rdi,%xmm0
divsd  0xecf(%rip),%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xebd(%rip),%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <floor@plt>
mov    %rax,%rcx
imul   %rax,%rcx
shl    $0x2,%rcx
lea    (%rcx,%rcx,2),%rcx
cmp    %rbx,%rcx
mov    $0xffffffffffffffff,%rcx
cmovne %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @npix2nside(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sitofp i64 %4 to double
%6 = fdiv double %5, 1.200000e+01
%7 = fptosi double %6 to i64
%8 = call i64 @sqrt(i64 %7)
%9 = sitofp i64 %8 to double
%10 = fadd double %9, 5.000000e-01
%11 = fptosi double %10 to i64
%12 = call i64 @floor(i64 %11)
store i64 %12, i64* %3
%13 = load i64, i64* %3
%14 = load i64, i64* %3
%15 = mul nsw i64 %13, %14
%16 = mul nsw i64 %15, 12
%17 = load i64, i64* %2
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %1
%20 = load i64, i64* %3
br label %22
21: ; preds = %1
br label %22
22: ; preds = %21, %19
%23 = phi i64 [ %20, %19 ], [ -1, %21 ]
ret i64 %23
}

LLVM IR (-O2):
define i64 @npix2nside(i64 %0) {
%2 = sitofp i64 %0 to double
%3 = fdiv double %2, 1.200000e+01
%4 = fptosi double %3 to i64
%5 = tail call i64 @sqrt(i64 %4)
%6 = sitofp i64 %5 to double
%7 = fadd double %6, 5.000000e-01
%8 = fptosi double %7 to i64
%9 = tail call i64 @floor(i64 %8)
%10 = mul i64 %9, 12
%11 = mul i64 %10, %9
%12 = icmp eq i64 %11, %0
%13 = select i1 %12, i64 %9, i64 -1
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ halt();
int /*<<< orphan*/ printString(char *);
void Stage2CMain() {
  char str[12] = "Hello World";
  printString(str);
  halt();
}


x86 assembly (clang, -O0):
<Stage2CMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <printString@plt>
mov    $0x0,%al
call   1040 <halt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Stage2CMain>:
sub    $0x18,%rsp
movabs $0x6f57206f6c6c6548,%rax
20 57 6f
mov    %rax,0x8(%rsp)
movl   $0x646c72,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <printString@plt>
xor    %eax,%eax
call   1040 <halt@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.Stage2CMain.str = [12 x i8] c"Hello World\00"
define void @Stage2CMain() {
%1 = alloca [12 x i8]
%2 = bitcast [12 x i8]* %1 to i8*
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = call i32 @printString(i8* %3)
%5 = call i32 (...) @halt()
ret void
}

LLVM IR (-O2):
@__const.Stage2CMain.str = [12 x i8] c"Hello World\00"
define void @Stage2CMain() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @printString(i8* %2)
%4 = call i32 (...) @halt()
ret void
}
float fp_sub(float a, float b) { return a - b; }


x86 assembly (clang, -O0):
<fp_sub>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_sub>:
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fp_sub(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @fp_sub(float %0, float %1) {
%3 = fsub float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ OS_TaskRegister();
void task_16(void) {
  OS_TaskRegister();
  while (1)
    ;
  return;
}


x86 assembly (clang, -O0):
<task_16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OS_TaskRegister@plt>
jmp    111b <task_16+0xb>

x86 assembly (clang, -O2):
<task_16>:
push   %rax
xor    %eax,%eax
call   1030 <OS_TaskRegister@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <task_16+0x10>

LLVM IR (-O0):
define void @task_16() {
%1 = call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @task_16() {
%1 = tail call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ SA1Direct(int);
int /*<<< orphan*/ TSB8(int /*<<< orphan*/);
void Op04M1(void) { TSB8(SA1Direct(3)); }


x86 assembly (clang, -O0):
<Op04M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <SA1Direct@plt>
mov    %eax,%edi
call   1030 <TSB8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op04M1>:
push   %rax
mov    $0x3,%edi
call   1040 <SA1Direct@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <TSB8@plt>

LLVM IR (-O0):
define void @Op04M1() {
%1 = call i32 @SA1Direct(i32 3)
%2 = call i32 @TSB8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op04M1() {
%1 = tail call i32 @SA1Direct(i32 3)
%2 = tail call i32 @TSB8(i32 %1)
ret void
}
void ath9k_hw_ar9300_set_addac(struct ath_hw *ah, struct ath9k_channel *chan) {}


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

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
%struct.ath_hw = type opaque
%struct.ath9k_channel = type opaque
define void @ath9k_hw_ar9300_set_addac(%struct.ath_hw* %0, %struct.ath9k_channel* %1) {
%3 = alloca %struct.ath_hw*
%4 = alloca %struct.ath9k_channel*
store %struct.ath_hw* %0, %struct.ath_hw** %3
store %struct.ath9k_channel* %1, %struct.ath9k_channel** %4
ret void
}

LLVM IR (-O2):
%struct.ath_hw = type opaque
%struct.ath9k_channel = type opaque
define void @ath9k_hw_ar9300_set_addac(%struct.ath_hw* nocapture %0, %struct.ath9k_channel* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func();
main() { func(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @func()
ret i32 0
}
/* Variables and functions */
int hash_open_search(int *, int);
void hash_open_delete(int table[], int value) {
  int d = hash_open_search(table, value);
  if (d >= 0)
    table[d] = -1;
}


x86 assembly (clang, -O0):
<hash_open_delete>:
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 <hash_open_search@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1147 <hash_open_delete+0x37>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_open_delete>:
push   %rbx
mov    %rdi,%rbx
call   1030 <hash_open_search@plt>
test   %eax,%eax
js     1126 <hash_open_delete+0x16>
mov    %eax,%eax
movl   $0xffffffff,(%rbx,%rax,4)
pop    %rbx
ret

LLVM IR (-O0):
define void @hash_open_delete(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 = call i32 @hash_open_search(i32* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 -1, i32* %15
br label %16
16: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
define void @hash_open_delete(i32* %0, i32 %1) {
%3 = tail call i32 @hash_open_search(i32* %0, i32 %1)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = zext i32 %3 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 -1, i32* %7
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ index_add_arg(char *);
void cm_vindex(void) { index_add_arg("vr"); }


x86 assembly (clang, -O0):
<cm_vindex>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <index_add_arg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cm_vindex>:
lea    0xee9(%rip),%rdi
jmp    1030 <index_add_arg@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"vr\00"
define void @cm_vindex() {
%1 = call i32 @index_add_arg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"vr\00"
define void @cm_vindex() {
%1 = tail call i32 @index_add_arg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ window_buffer_swap();
void R_EndFrame(void) { window_buffer_swap(); }


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

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

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

LLVM IR (-O2):
define void @R_EndFrame() {
%1 = tail call i32 (...) @window_buffer_swap()
ret void
}
void rop3_57_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_57_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_57_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
not    %cl
or     %dl,%cl
xor    %cl,%al
and    %sil,%al
xor    %cl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_57_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = or i8 %5, %2
%7 = xor i8 %1, -1
%8 = and i8 %6, %7
%9 = and i8 %4, %1
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
unsigned int lcm_getpwm(unsigned int divider) {
  unsigned int pwm_clk = 23706 / (1 << divider);
  return pwm_clk;
}


x86 assembly (clang, -O0):
<lcm_getpwm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x5c9a,%eax
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm_getpwm>:
mov    %edi,%ecx
mov    $0x5c9a,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @lcm_getpwm(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 1, %4
%6 = sdiv i32 23706, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @lcm_getpwm(i32 %0) {
%2 = lshr i32 23706, %0
ret i32 %2
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char c;
  while (1) {
    c = getchar();
    if (c == '4')
      continue;
    if (c == '0')
      break;
    printf("%c", c);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x34,%eax
jne    114b <main+0x2b>
jmp    112f <main+0xf>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jne    115d <main+0x3d>
jmp    1174 <main+0x54>
movsbl -0x5(%rbp),%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <main+0xf>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x34,%al
je     1130 <main+0x10>
cmp    $0x30,%al
je     1149 <main+0x29>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1130 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %0, %8, %14
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 52
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 48
br i1 %12, label %13, label %14
13: ; preds = %9
br label %18
14: ; preds = %9
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %3
18: ; preds = %13
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %6, %0
%2 = tail call signext i8 (...) @getchar()
switch i8 %2, label %3 [
i8 52, label %6
i8 48, label %7
]
3: ; preds = %1
%4 = sext i8 %2 to i32
%5 = tail call i32 @putchar(i32 %4)
br label %6
6: ; preds = %3, %1
br label %1
7: ; preds = %1
%8 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Write_LCD(int, char *, int);
void Enable_Wrap(int fd) {
  char cmd[] = {254, 67, 253};
  Write_LCD(fd, cmd, 3);
}


x86 assembly (clang, -O0):
<Enable_Wrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x7(%rbp),%rsi
mov    $0x3,%edx
call   1030 <Write_LCD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Enable_Wrap>:
push   %rax
movb   $0xfd,0x6(%rsp)
movw   $0x43fe,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x3,%edx
call   1030 <Write_LCD@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.Enable_Wrap.cmd = [3 x i8] c"\FEC\FD"
define void @Enable_Wrap(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x i8]
store i32 %0, i32* %2
%4 = bitcast [3 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%7 = call i32 @Write_LCD(i32 %5, i8* %6, i32 3)
ret void
}

LLVM IR (-O2):
@__const.Enable_Wrap.cmd = [3 x i8] c"\FEC\FD"
define void @Enable_Wrap(i32 %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = call i32 @Write_LCD(i32 %0, i8* %3, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
char *WpeStringBlank(char *s, int len) {
  memset(s, ' ', len);
  s[len] = '\0';
  return (s);
}


x86 assembly (clang, -O0):
<WpeStringBlank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x20,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WpeStringBlank>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x20,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
movslq %ebp,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @WpeStringBlank(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 @memset(i8* %5, i8 signext 32, i32 %6)
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 0, i8* %11
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @WpeStringBlank(i8* returned %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i8 signext 32, i32 %1)
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
ret i8* %0
}
void intel_unregister_dsm_handler(void) { return; }


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

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

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

LLVM IR (-O2):
define void @intel_unregister_dsm_handler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *xmalloc(scalar_t__);
char *xstrcpy(char *src) {
  char *tmp;
  if (src == NULL)
    return (NULL);
  tmp = xmalloc(strlen(src) + 1);
  strcpy(tmp, src);
  return tmp;
}


x86 assembly (clang, -O0):
<xstrcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xstrcpy+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1182 <xstrcpy+0x52>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrcpy>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115a <xstrcpy+0x2a>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    115d <xstrcpy+0x2d>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrcpy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %17
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 %10, 1
%12 = call i8* @xmalloc(i64 %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %8, %7
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define i8* @xstrcpy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @xmalloc(i64 %5)
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %9
}
unsigned int f4(int xxx, unsigned yyy, short uuu) { return xxx ? yyy : uuu; }


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1126 <f4+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112d <f4+0x2d>
movswl -0xa(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
mov    %esi,%eax
test   %edi,%edi
cmove  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @f4(i32 %0, i32 %1, i16 signext %2) {
%4 = icmp eq i32 %0, 0
%5 = sext i16 %2 to i32
%6 = select i1 %4, i32 %5, i32 %1
ret i32 %6
}
unsigned int I2CMasterIntRawStatus(unsigned int baseAdd) {
  return (((*((volatile unsigned int *)(baseAdd + (0x24))))));
}


x86 assembly (clang, -O0):
<I2CMasterIntRawStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x24,%eax
mov    %eax,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntRawStatus>:
add    $0x24,%edi
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @I2CMasterIntRawStatus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 36
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @I2CMasterIntRawStatus(i32 %0) {
%2 = add i32 %0, 36
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}