xunge/DecIR huggingface dataset:
void vadd2(float *v1, float *v2, float *out) {
  out[0] = v1[0] + v2[0];
  out[1] = v1[1] + v2[1];
}


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

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

LLVM IR (-O0):
define void @vadd2(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** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fadd float %9, %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fadd float %18, %21
%23 = load float*, float** %6
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
ret void
}

LLVM IR (-O2):
define void @vadd2(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fadd float %4, %5
store float %6, float* %2
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %2, i64 1
store float %11, float* %12
ret void
}
chkspd(x) int x;
{
  switch (x) {
  case 0:
  case 110:
  case 150:
  case 300:
  case 600:
  case 1200:
  case 1800:
  case 2400:
  case 4800:
  case 9600:
    return (x);
  default:
    return (-1);
  }
}


x86 assembly (clang, -O0):
<chkspd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     11c3 <chkspd+0xc3>
jmp    111a <chkspd+0x1a>
mov    -0xc(%rbp),%eax
sub    $0x6e,%eax
je     11c3 <chkspd+0xc3>
jmp    112b <chkspd+0x2b>
mov    -0xc(%rbp),%eax
sub    $0x96,%eax
je     11c3 <chkspd+0xc3>
jmp    113e <chkspd+0x3e>
mov    -0xc(%rbp),%eax
sub    $0x12c,%eax
je     11c3 <chkspd+0xc3>
jmp    1151 <chkspd+0x51>
mov    -0xc(%rbp),%eax
sub    $0x258,%eax
je     11c3 <chkspd+0xc3>
jmp    1164 <chkspd+0x64>
mov    -0xc(%rbp),%eax
sub    $0x4b0,%eax
je     11c3 <chkspd+0xc3>
jmp    1177 <chkspd+0x77>
mov    -0xc(%rbp),%eax
sub    $0x708,%eax
je     11c3 <chkspd+0xc3>
jmp    118a <chkspd+0x8a>
mov    -0xc(%rbp),%eax
sub    $0x960,%eax
je     11c3 <chkspd+0xc3>
jmp    119d <chkspd+0x9d>
mov    -0xc(%rbp),%eax
sub    $0x12c0,%eax
je     11c3 <chkspd+0xc3>
jmp    11b0 <chkspd+0xb0>
mov    -0xc(%rbp),%eax
sub    $0x2580,%eax
jne    11ce <chkspd+0xce>
jmp    11c3 <chkspd+0xc3>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11d5 <chkspd+0xd5>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chkspd>:
mov    %edi,%eax
cmp    $0x4af,%edi
jg     1127 <chkspd+0x27>
cmp    $0x95,%eax
jle    1145 <chkspd+0x45>
cmp    $0x96,%eax
je     1126 <chkspd+0x26>
cmp    $0x12c,%eax
je     1126 <chkspd+0x26>
cmp    $0x258,%eax
jne    115e <chkspd+0x5e>
ret
cmp    $0x95f,%eax
jle    1150 <chkspd+0x50>
cmp    $0x960,%eax
je     1126 <chkspd+0x26>
cmp    $0x12c0,%eax
je     1126 <chkspd+0x26>
cmp    $0x2580,%eax
je     1126 <chkspd+0x26>
jmp    115e <chkspd+0x5e>
test   %eax,%eax
je     1126 <chkspd+0x26>
cmp    $0x6e,%eax
je     1126 <chkspd+0x26>
jmp    115e <chkspd+0x5e>
cmp    $0x4b0,%eax
je     1126 <chkspd+0x26>
cmp    $0x708,%eax
je     1126 <chkspd+0x26>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @chkspd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 110, label %5
i32 150, label %5
i32 300, label %5
i32 600, label %5
i32 1200, label %5
i32 1800, label %5
i32 2400, label %5
i32 4800, label %5
i32 9600, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
%6 = load i32, i32* %3
store i32 %6, i32* %2
br label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %8
8: ; preds = %7, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @chkspd(i32 %0) {
switch i32 %0, label %2 [
i32 0, label %3
i32 110, label %3
i32 150, label %3
i32 300, label %3
i32 600, label %3
i32 1200, label %3
i32 1800, label %3
i32 2400, label %3
i32 4800, label %3
i32 9600, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ -1, %2 ], [ %0, %1 ], [ %0, %1 ], [ %0, %1 ], [ %0, %1 ], [ %0, %1 ], [ %0, %1 ], [ %0, %1 ], [ %0, %1 ], [ %0, %1 ], [ %0, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
void *malloc(int);
int /*<<< orphan*/ printf(char *, void *);
int /*<<< orphan*/ stdout;
void *AllocateIt() {
  void *p = malloc(1);
  printf("Allocated object at %p\n", p);
  fflush(stdout);
  return p;
}


x86 assembly (clang, -O0):
<AllocateIt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AllocateIt>:
push   %rbx
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Allocated object at %p\0A\00"
@stdout = global i32 0
define i8* @AllocateIt() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [24 x i8] c"Allocated object at %p\0A\00"
@stdout = global i32 0
define i8* @AllocateIt() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret i8* %1
}
void marker3(char *a, char *b) {}


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

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

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

LLVM IR (-O2):
define void @marker3(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ strrev(void *, size_t);
void vrev(void *ptr, size_t s, bool *is_valid, bool *is_little_endian) {
  if (is_valid && *is_little_endian && strrev(ptr, s) != 0)
    is_valid = false;
}


x86 assembly (clang, -O0):
<vrev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115f <vrev+0x4f>
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
je     115f <vrev+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strrev@plt>
cmp    $0x0,%rax
je     115f <vrev+0x4f>
movq   $0x0,-0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vrev>:
test   %rdx,%rdx
je     111f <vrev+0xf>
cmpl   $0x0,(%rcx)
je     111f <vrev+0xf>
jmp    1030 <strrev@plt>
ret

LLVM IR (-O0):
define void @vrev(i8* %0, i64 %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %7
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %21
11: ; preds = %4
%12 = load i32*, i32** %8
%13 = load i32, i32* %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = call i64 @strrev(i8* %16, i64 %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %15
store i32* null, i32** %7
br label %21
21: ; preds = %20, %15, %11, %4
ret void
}

LLVM IR (-O2):
define void @vrev(i8* %0, i64 %1, i32* readnone %2, i32* nocapture %3) {
%5 = icmp eq i32* %2, null
br i1 %5, label %11, label %6
6: ; preds = %4
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i64 @strrev(i8* %0, i64 %1)
br label %11
11: ; preds = %9, %6, %4
ret void
}
int fun542() { return 542; }


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

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

LLVM IR (-O0):
define i32 @fun542() {
ret i32 542
}

LLVM IR (-O2):
define i32 @fun542() {
ret i32 542
}
/* Type definitions */
struct memory {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
scalar_t__ memory_alloc(struct memory *, int);
int strlen(char *);
char *memory_dupstr(struct memory *m, char *str) {
  int sz = strlen(str);
  char *new = (char *)memory_alloc(m, sz + 1);
  memcpy(new, str, sz);
  new[sz] = 0;
  return new;
}


x86 assembly (clang, -O0):
<memory_dupstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
call   1040 <memory_alloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_dupstr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,%r12d
lea    0x1(%r12),%esi
mov    %r14,%rdi
call   1040 <memory_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r12d,%edx
call   1050 <memcpy@plt>
movslq %r12d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.memory = type { i32 }
define i8* @memory_dupstr(%struct.memory* %0, i8* %1) {
%3 = alloca %struct.memory*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store %struct.memory* %0, %struct.memory** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load %struct.memory*, %struct.memory** %3
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
%12 = call i64 @memory_alloc(%struct.memory* %9, i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = call i32 @memcpy(i8* %14, i8* %15, i32 %16)
%18 = load i8*, i8** %6
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 0, i8* %21
%22 = load i8*, i8** %6
ret i8* %22
}

LLVM IR (-O2):
%struct.memory = type { i32 }
define i8* @memory_dupstr(%struct.memory* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = add nsw i32 %3, 1
%5 = tail call i64 @memory_alloc(%struct.memory* %0, i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @memcpy(i8* %6, i8* %1, i32 %3)
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
store i8 0, i8* %9
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ _string_array_push(char ***, char *, int /*<<< orphan*/);
int /*<<< orphan*/ string_array_size(char **);
void string_array_push(char ***array, char *text) {
  _string_array_push(array, text, string_array_size(*array));
}


x86 assembly (clang, -O0):
<string_array_push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <string_array_size@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <_string_array_push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_array_push>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <string_array_size@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <_string_array_push@plt>

LLVM IR (-O0):
define void @string_array_push(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 = load i8***, i8**** %3
%8 = load i8**, i8*** %7
%9 = call i32 @string_array_size(i8** %8)
%10 = call i32 @_string_array_push(i8*** %5, i8* %6, i32 %9)
ret void
}

LLVM IR (-O2):
define void @string_array_push(i8*** %0, i8* %1) {
%3 = load i8**, i8*** %0
%4 = tail call i32 @string_array_size(i8** %3)
%5 = tail call i32 @_string_array_push(i8*** %0, i8* %1, i32 %4)
ret void
}
/* Variables and functions */
unsigned int cp15_read_control();
unsigned int cp15_is_icached_enabled(void) {
  unsigned int control;
  control = cp15_read_control();
  return ((control & (1 << 12)) != 0);
}


x86 assembly (clang, -O0):
<cp15_is_icached_enabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <cp15_read_control@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1000,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cp15_is_icached_enabled>:
push   %rax
xor    %eax,%eax
call   1030 <cp15_read_control@plt>
shr    $0xc,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cp15_is_icached_enabled() {
%1 = alloca i32
%2 = call i32 (...) @cp15_read_control()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, 4096
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @cp15_is_icached_enabled() {
%1 = tail call i32 (...) @cp15_read_control()
%2 = lshr i32 %1, 12
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *x_malloc(size_t size) {
  void *mem = malloc(size);
  if (!mem) {
    fprintf(stderr, "Unable to allocate memory\n");
    exit(EXIT_FAILURE);
  }
  return mem;
}


x86 assembly (clang, -O0):
<x_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <x_malloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <x_malloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Unable to allocate memory\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @x_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Unable to allocate memory\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @x_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
int test_imm_8Cint64_lowword_mem(long long *val) {
  return ((*val) & (0x8C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Cint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 140
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char, int);
int fun_stub_base_6_stub(int a, char b, int c) {
  printf("fun_stub_base_6_stub:a = %d, b = %d, c = %d\n", a, b, c);
  return a + b + c;
}


x86 assembly (clang, -O0):
<fun_stub_base_6_stub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x5(%rbp),%al
mov    -0xc(%rbp),%ecx
lea    0xecc(%rip),%rdi
movsbl %al,%edx
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
movsbl -0x5(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_stub_base_6_stub>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xede(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1030 <printf@plt>
add    %ebx,%ebp
add    %r14d,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [45 x i8] c"fun_stub_base_6_stub:a = %d, b = %d, c = %d\0A\00"
define i32 @fun_stub_base_6_stub(i32 %0, i8 signext %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %0, i8 signext %1, i32 %2)
%5 = sext i8 %1 to i32
%6 = add nsw i32 %5, %0
%7 = add nsw i32 %6, %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void abort() {
  raise(SIGABRT);
  exit(1);
}


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

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

LLVM IR (-O0):
@SIGABRT = global i32 0
define void @abort() {
%1 = load i32, i32* @SIGABRT
%2 = call i32 @raise(i32 %1)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define void @abort() {
%1 = load i32, i32* @SIGABRT
%2 = tail call i32 @raise(i32 %1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void _Unwind_VRS_Interpret() {}


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

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

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

LLVM IR (-O2):
define void @_Unwind_VRS_Interpret() {
ret void
}
/* Variables and functions */
int cg_write(char const *, char *, char *);
int cg_enter_current(const char *cgroup) {
  return cg_write(cgroup, "cgroup.procs", "0");
}


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

x86 assembly (clang, -O2):
<cg_enter_current>:
lea    0xee9(%rip),%rsi
lea    0xeef(%rip),%rdx
jmp    1030 <cg_write@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"cgroup.procs\00"
@.str.1 = [2 x i8] c"0\00"
define i32 @cg_enter_current(i8* %0) {
%2 = tail call i32 @cg_write(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int file_read(char *);
unsigned get_eth() { return file_read("ethernet.stim"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"ethernet.stim\00"
define i32 @get_eth() {
%1 = call i32 @file_read(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [14 x i8] c"ethernet.stim\00"
define i32 @get_eth() {
%1 = tail call i32 @file_read(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int hash(char *key) { return key[0] % 16; }


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%al
mov    %eax,%ecx
sar    $0x7,%cl
shr    $0x4,%cl
add    %al,%cl
and    $0xf0,%cl
sub    %cl,%al
movsbl %al,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = srem i32 %6, 16
ret i32 %7
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = srem i8 %2, 16
%4 = sext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t next_highest_pow_of_2(uint32_t x) {
  x--;
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  x++;
  return x;
}


x86 assembly (clang, -O0):
<next_highest_pow_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_highest_pow_of_2>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @next_highest_pow_of_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @next_highest_pow_of_2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
lt() {
  ol("CMP  BX,AX");
  ol("MOV  AX,1");
  ol("JL   $+5");
  ol("MOV  AX,0");
}


x86 assembly (clang, -O0):
<lt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
lea    0xee0(%rip),%rdi
call   1030 <ol@plt>
lea    0xede(%rip),%rdi
call   1030 <ol@plt>
lea    0xedb(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <ol@plt>
lea    0xee7(%rip),%rdi
call   1030 <ol@plt>
lea    0xee5(%rip),%rdi
call   1030 <ol@plt>
lea    0xee2(%rip),%rdi
pop    %rax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"CMP BX,AX\00"
@.str.1 = [10 x i8] c"MOV AX,1\00"
@.str.2 = [9 x i8] c"JL $+5\00"
@.str.3 = [10 x i8] c"MOV AX,0\00"
define i32 @lt() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @ol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"CMP BX,AX\00"
@.str.1 = [10 x i8] c"MOV AX,1\00"
@.str.2 = [9 x i8] c"JL $+5\00"
@.str.3 = [10 x i8] c"MOV AX,0\00"
define i32 @lt() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @ol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret i32 undef
}
void main() {
  int a[10];
  while (a) {
    return;
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    -0x30(%rbp),%rax
cmp    $0x0,%rax
je     1117 <main+0x17>
jmp    111c <main+0x1c>
jmp    111c <main+0x1c>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca [10 x i32]
br label %2
2: ; preds = %0
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %6
5: ; preds = %2
br label %7
6: ; preds = %2
br label %7
7: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
void i2d_ASN1_ENUMERATED(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_ASN1_ENUMERATED() {
ret void
}
double fsgn(double f) {
  if (f < 0)
    return -1.0;
  else if (f > 0)
    return 1.0;
  else
    return 0.0;
}


x86 assembly (clang, -O0):
<fsgn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1129 <fsgn+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1155 <fsgn+0x55>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <fsgn+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1155 <fsgn+0x55>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsgn>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm3,%xmm1
movsd  0xeda(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fsgn(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double -1.000000e+00, double* %2
br label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store double 1.000000e+00, double* %2
br label %12
11: ; preds = %7
store double 0.000000e+00, double* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
define double @fsgn(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double 0.000000e+00
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ kbd_buf_parse_string(char const *);
int kdb_buf_feed_cmdline(const char *param, void *extra_param) {
  kbd_buf_parse_string(param);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @kdb_buf_feed_cmdline(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 = call i32 @kbd_buf_parse_string(i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @kdb_buf_feed_cmdline(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @kbd_buf_parse_string(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_fail_ext(char const *, int, char const *, char const *,
                                 int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int /*<<< orphan*/ *);
void test_fail(const char *file, int line, const char *fncname,
               const char *reason) {
  test_fail_ext(file, line, fncname, reason, NULL, NULL, NULL);
}


x86 assembly (clang, -O0):
<test_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
movq   $0x0,(%rsp)
call   1030 <test_fail_ext@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fail>:
push   %rax
movq   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <test_fail_ext@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test_fail(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @test_fail_ext(i8* %9, i32 %10, i8* %11, i8* %12, i32* null, i32* null, i32* null)
ret void
}

LLVM IR (-O2):
define void @test_fail(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @test_fail_ext(i8* %0, i32 %1, i8* %2, i8* %3, i32* null, i32* null, i32* null)
ret void
}
__attribute__((no)) int s2(int x) {
  switch (x) {
  case 10:
  case 11:
    return 2;
  case 12:
    return 123;
  default:
    return x + 2;
  }
}


x86 assembly (clang, -O0):
<s2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff6,%eax
sub    $0x2,%eax
jb     112f <s2+0x2f>
jmp    111e <s2+0x1e>
mov    -0xc(%rbp),%eax
sub    $0xc,%eax
je     113b <s2+0x3b>
jmp    1147 <s2+0x47>
movl   $0x2,-0x4(%rbp)
jmp    1150 <s2+0x50>
movl   $0x7b,-0x4(%rbp)
jmp    1150 <s2+0x50>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2>:
mov    %edi,%eax
lea    -0xa(%rax),%ecx
cmp    $0x3,%ecx
jae    1118 <s2+0x18>
movslq %ecx,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @s2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 10, label %5
i32 11, label %5
i32 12, label %6
]
5: ; preds = %1, %1
store i32 2, i32* %2
br label %10
6: ; preds = %1
store i32 123, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 2
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@switch.table.s2 = [3 x i32] [i32 2, i32 2, i32 123]
define i32 @s2(i32 %0) {
%2 = add i32 %0, -10
%3 = icmp ult i32 %2, 3
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add nsw i32 %0, 2
br label %10
6: ; preds = %1
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.s2, i64 0, i64 %7
%9 = load i32, i32* %8
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ %5, %4 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int lace_builtin_execfd_main(unsigned int, char **, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  return lace_builtin_execfd_main((unsigned)argc, argv, NULL, NULL);
}


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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <lace_builtin_execfd_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <lace_builtin_execfd_main@plt>

LLVM IR (-O0):
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 @lace_builtin_execfd_main(i32 %6, i8** %7, i32* null, i32* null)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @lace_builtin_execfd_main(i32 %0, i8** %1, i32* null, i32* null)
ret i32 %3
}
int soma(int n) {
  if (n == 0)
    return 0;
  return n + soma(n - 1);
}


x86 assembly (clang, -O0):
<soma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <soma+0x21>
movl   $0x0,-0x4(%rbp)
jmp    114c <soma+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <soma@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soma>:
test   %edi,%edi
je     1119 <soma+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @soma(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
int hpsa_get_bay_identifier(struct sas_rphy *rphy) { return 0; }


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

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

LLVM IR (-O0):
%struct.sas_rphy = type opaque
define i32 @hpsa_get_bay_identifier(%struct.sas_rphy* %0) {
%2 = alloca %struct.sas_rphy*
store %struct.sas_rphy* %0, %struct.sas_rphy** %2
ret i32 0
}

LLVM IR (-O2):
%struct.sas_rphy = type opaque
define i32 @hpsa_get_bay_identifier(%struct.sas_rphy* nocapture readnone %0) {
ret i32 0
}
void rop3_191_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T & S;
  stk2 = ~stk2;
  stk1 = *D | stk2;
  *D = stk1;
}


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

x86 assembly (clang, -O2):
<rop3_191_0_0>:
and    %edx,%esi
not    %sil
or     %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_191_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = and i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %8
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = load i8*, i8** %4
store i8 %26, i8* %27
ret void
}

LLVM IR (-O2):
define void @rop3_191_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %2, %1
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = or i8 %6, %5
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  struct mystr {
    int x;
    int y;
  } st1, st2;
  st1.x = 10;
  st1.y = 20;
  st2 = st1;
  printf("st1's members is: x=%d, y=%d\n", st1.x, st1.y);
  printf("st2's members is: x=%d, y=%d\n", st2.x, st2.y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x10(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mystr = type { i32, i32 }
@.str = [30 x i8] c"st1's members is: x=%d, y=%d\0A\00"
@.str.1 = [30 x i8] c"st2's members is: x=%d, y=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.mystr
%3 = alloca %struct.mystr
store i32 0, i32* %1
%4 = getelementptr inbounds %struct.mystr, %struct.mystr* %2, i32 0, i32 0
store i32 10, i32* %4
%5 = getelementptr inbounds %struct.mystr, %struct.mystr* %2, i32 0, i32 1
store i32 20, i32* %5
%6 = bitcast %struct.mystr* %3 to i8*
%7 = bitcast %struct.mystr* %2 to i8*
%8 = getelementptr inbounds %struct.mystr, %struct.mystr* %2, i32 0, i32 0
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.mystr, %struct.mystr* %2, i32 0, i32 1
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11)
%13 = getelementptr inbounds %struct.mystr, %struct.mystr* %3, i32 0, i32 0
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.mystr, %struct.mystr* %3, i32 0, i32 1
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"st1's members is: x=%d, y=%d\0A\00"
@.str.1 = [30 x i8] c"st2's members is: x=%d, y=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 10, i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 20)
ret i32 0
}
/* Variables and functions */
int demo_funcA() {
  int *p = NULL;
  int a = 100;
  int b = 1000;
  *p = a + b;
  return 0;
}


x86 assembly (clang, -O0):
<demo_funcA>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
movl   $0x64,-0xc(%rbp)
movl   $0x3e8,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @demo_funcA() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32
store i32* null, i32** %1
store i32 100, i32* %2
store i32 1000, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
%7 = load i32*, i32** %1
store i32 %6, i32* %7
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int proc_set_frequency(unsigned int, unsigned long);
int sysfs_set_frequency(unsigned int, unsigned long);
int cpufreq_set_frequency(unsigned int cpu, unsigned long target_frequency) {
  int ret;
  ret = sysfs_set_frequency(cpu, target_frequency);
  if (ret)
    ret = proc_set_frequency(cpu, target_frequency);
  return (ret);
}


x86 assembly (clang, -O0):
<cpufreq_set_frequency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <sysfs_set_frequency@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1157 <cpufreq_set_frequency+0x37>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <proc_set_frequency@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpufreq_set_frequency>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <sysfs_set_frequency@plt>
test   %eax,%eax
je     1141 <cpufreq_set_frequency+0x21>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <proc_set_frequency@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cpufreq_set_frequency(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = load i64, i64* %4
%8 = call i32 @sysfs_set_frequency(i32 %6, i64 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %3
%13 = load i64, i64* %4
%14 = call i32 @proc_set_frequency(i32 %12, i64 %13)
store i32 %14, i32* %5
br label %15
15: ; preds = %11, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @cpufreq_set_frequency(i32 %0, i64 %1) {
%3 = tail call i32 @sysfs_set_frequency(i32 %0, i64 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @proc_set_frequency(i32 %0, i64 %1)
br label %7
7: ; preds = %5, %2
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int);
void main() { f(1, 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 @f(i32 1, i32 2)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @f(i32 1, i32 2)
ret void
}
/* Type definitions */
struct cdrom_mcn {
  int dummy;
};
typedef int /*<<< orphan*/ mcn;

/* Variables and functions */
int main(void) {
  struct cdrom_mcn mcn;
  (void)mcn;
  return sizeof(mcn);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}