xunge/DecIR huggingface dataset:
void file_error(file, mode) char *file;
char *mode;
{
  printf("\n  BMotif: can't open %s for %s\n\n", file, mode);
  Kill_bplatform_and_exit(1, 0);
}


x86 assembly (clang, -O0):
<file_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <Kill_bplatform_and_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_error>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
xor    %esi,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <Kill_bplatform_and_exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"\0A BMotif: can't open %s for %s\0A\0A\00"
define void @file_error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = call i32 (i32, i32, ...) bitcast (i32 (...)* @Kill_bplatform_and_exit to i32 (i32, i32, ...)*)(i32 1, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"\0A BMotif: can't open %s for %s\0A\0A\00"
define void @file_error(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @Kill_bplatform_and_exit to i32 (i32, i32, ...)*)(i32 1, i32 0)
ret void
}
/* Variables and functions */
int can_size_mult(const size_t x, const size_t y) {
  return (y <= 1) || (x <= (~((size_t)0)) / y);
}


x86 assembly (clang, -O0):
<can_size_mult>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x1,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jbe    1143 <can_size_mult+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
setbe  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_size_mult>:
mov    %rsi,%rax
cmp    $0x2,%rsi
setb   %cl
mul    %rdi
setno  %al
or     %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @can_size_mult(i64 %0, i64 %1) {
%3 = icmp ult i64 %1, 2
%4 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %1, i64 %0)
%5 = extractvalue { i64, i1 } %4, 1
%6 = xor i1 %5, true
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ random_init();
void poison_init() { random_init(); }


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

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

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

LLVM IR (-O2):
define void @poison_init() {
%1 = tail call i32 (...) @random_init()
ret void
}
/* Variables and functions */
int strlen(char *);
__attribute__((always_)) char *strarray_get_next(char *current) {
  return current + strlen(current) + 1;
}


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

x86 assembly (clang, -O2):
<strarray_get_next>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
add    $0x1,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strarray_get_next(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 1
ret i8* %5
}
test02(const char *s1, const char *s2, int n) {
  return __builtin_strncmp(s1, "abcdefghi", 8);
}


x86 assembly (clang, -O0):
<test02>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test02>:
lea    0xee9(%rip),%rsi
mov    $0x8,%edx
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"abcdefghi\00"
define i32 @test02(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 8)
ret i32 %8
}

LLVM IR (-O2):
@.str = [10 x i8] c"abcdefghi\00"
define i32 @test02(i8* nocapture %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @strncmp(i8* dereferenceable(1) %0, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 8)
ret i32 %4
}
int main() {
  int a, b, c;
  a = b + 34;
  c = a / 8 * 3;
  if (a > b) {
    a = 5 + 6;
    b = c + 4 * a;
  }
  a = c + 8;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x22,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
imul   $0x3,%eax,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1146 <main+0x46>
movl   $0xb,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
char *start_of_text() {
  extern int _start();
  return ((char *)_start);
}


x86 assembly (clang, -O0):
<start_of_text>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_of_text>:
mov    0x2ee1(%rip),%rax
ret

LLVM IR (-O0):
define i8* @start_of_text() {
ret i8* bitcast (i32 (...)* @_start to i8*)
}

LLVM IR (-O2):
define i8* @start_of_text() {
ret i8* bitcast (i32 (...)* @_start to i8*)
}
void XESetFreeFont() {}


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

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

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

LLVM IR (-O2):
define void @XESetFreeFont() {
ret void
}
/* Type definitions */
typedef int const uint16_t;

/* Variables and functions */
int is_pattern(uint16_t x) {
  const uint16_t n = -x;
  return (n ^ x) < x;
}


x86 assembly (clang, -O0):
<is_pattern>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
cmp    -0x4(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pattern>:
mov    %edi,%ecx
neg    %ecx
xor    %edi,%ecx
xor    %eax,%eax
cmp    %edi,%ecx
setl   %al
ret

LLVM IR (-O0):
define i32 @is_pattern(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = xor i32 %6, %7
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_pattern(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = xor i32 %2, %0
%4 = icmp slt i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
void clear_timing() {}


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

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

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

LLVM IR (-O2):
define void @clear_timing() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t pack_get_u16(uint8_t *buffer, int byteNr) {
  uint16_t retVal;
  uint8_t *ptr;
  ptr = (uint8_t *)&retVal;
  *(ptr + 1) = *(buffer + byteNr + 1);
  *(ptr + 0) = *(buffer + byteNr + 0);
  return (retVal);
}


x86 assembly (clang, -O0):
<pack_get_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    0x4(%rax,%rcx,4),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_get_u16>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @pack_get_u16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32* %5, i32** %6
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32*, i32** %3
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = getelementptr inbounds i32, i32* %18, i64 0
%20 = load i32, i32* %19
%21 = load i32*, i32** %6
%22 = getelementptr inbounds i32, i32* %21, i64 0
store i32 %20, i32* %22
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @pack_get_u16(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
void unsetenv(name) char *name;
{
  char **envp;
  if ((envp = findenv(name, namelength(name))) != 0)
    while (envp[0] = envp[1])
      envp++;
}


x86 assembly (clang, -O0):
<unsetenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <namelength@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    $0x0,%al
call   1030 <findenv@plt>
cltq
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1190 <unsetenv+0x70>
jmp    1161 <unsetenv+0x41>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
je     118b <unsetenv+0x6b>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1161 <unsetenv+0x41>
jmp    1190 <unsetenv+0x70>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsetenv>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <namelength@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <findenv@plt>
test   %eax,%eax
je     1160 <unsetenv+0x40>
cltq
add    $0x8,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rax),%rcx
mov    %rcx,-0x8(%rax)
add    $0x8,%rax
test   %rcx,%rcx
jne    1150 <unsetenv+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @unsetenv(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @namelength to i32 (i8*, ...)*)(i8* %5)
%7 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @findenv to i32 (i8*, i32, ...)*)(i8* %4, i32 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8**
store i8** %9, i8*** %3
%10 = icmp ne i8** %9, null
br i1 %10, label %11, label %23
11: ; preds = %1
br label %12
12: ; preds = %19, %11
%13 = load i8**, i8*** %3
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = load i8**, i8*** %3
%17 = getelementptr inbounds i8*, i8** %16, i64 0
store i8* %15, i8** %17
%18 = icmp ne i8* %15, null
br i1 %18, label %19, label %22
19: ; preds = %12
%20 = load i8**, i8*** %3
%21 = getelementptr inbounds i8*, i8** %20, i32 1
store i8** %21, i8*** %3
br label %12
22: ; preds = %12
br label %23
23: ; preds = %22, %1
ret void
}

LLVM IR (-O2):
define void @unsetenv(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @namelength to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @findenv to i32 (i8*, i32, ...)*)(i8* %0, i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = inttoptr i64 %6 to i8**
br label %8
8: ; preds = %5, %8
%9 = phi i8** [ %10, %8 ], [ %7, %5 ]
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
store i8* %11, i8** %9
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %8
13: ; preds = %8, %1
ret void
}
/* Variables and functions */
int lace_main_elastic_pthread(unsigned int, char **);
int lace_main_elastic(unsigned argc, char **argv) {
  return lace_main_elastic_pthread(argc, argv);
}


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

x86 assembly (clang, -O2):
<lace_main_elastic>:
jmp    1030 <lace_main_elastic_pthread@plt>

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

LLVM IR (-O2):
define i32 @lace_main_elastic(i32 %0, i8** %1) {
%3 = tail call i32 @lace_main_elastic_pthread(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int mhvtl_fifo_count(int /*<<< orphan*/);
int get_fifo_count(void) { return mhvtl_fifo_count(0); }


x86 assembly (clang, -O0):
<get_fifo_count>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <mhvtl_fifo_count@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fifo_count>:
xor    %edi,%edi
jmp    1030 <mhvtl_fifo_count@plt>

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

LLVM IR (-O2):
define i32 @get_fifo_count() {
%1 = tail call i32 @mhvtl_fifo_count(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
size_t strlcpy(char *, char const *, size_t);
size_t estrlcpy(char *dst, const char *src, size_t siz) {
  size_t r;
  r = strlcpy(dst, src, siz);
  if (r >= siz) {
    fprintf(stderr, "destination buffer too small\n");
    exit(EXIT_FAILURE);
  }
  return r;
}


x86 assembly (clang, -O0):
<estrlcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <strlcpy@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     118a <estrlcpy+0x5a>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estrlcpy>:
push   %rbx
mov    %rdx,%rbx
call   1040 <strlcpy@plt>
cmp    %rbx,%rax
jae    1140 <estrlcpy+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"destination buffer too small\0A\00"
@EXIT_FAILURE = global i32 0
define i64 @estrlcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @strlcpy(i8* %8, i8* %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = load i64, i64* %6
%14 = icmp uge i64 %12, %13
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* @EXIT_FAILURE
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %3
%21 = load i64, i64* %7
ret i64 %21
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"destination buffer too small\0A\00"
@EXIT_FAILURE = global i32 0
define i64 @estrlcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @strlcpy(i8* %0, i8* %1, i64 %2)
%5 = icmp ult i64 %4, %2
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %3
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
float determ_float_to(uint32_t a) { return *(float *)&a; }


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

x86 assembly (clang, -O2):
<determ_float_to>:
movd   %edi,%xmm0
ret

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

LLVM IR (-O2):
define float @determ_float_to(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
int test_imm_42uint16_reg(unsigned short val) {
  return ((val) & (-0x42 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_42uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffbe,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_42uint16_reg>:
test   $0xffbe,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_42uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -66
%6 = icmp ne i32 %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_42uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -66
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct clause_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_copy(struct genlist const *);
struct clause_list *clause_list_copy(const struct clause_list *tthis) {
  return (struct clause_list *)genlist_copy((const struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<clause_list_copy>:
jmp    1030 <genlist_copy@plt>

LLVM IR (-O0):
%struct.clause_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.clause_list* @clause_list_copy(%struct.clause_list* %0) {
%2 = alloca %struct.clause_list*
store %struct.clause_list* %0, %struct.clause_list** %2
%3 = load %struct.clause_list*, %struct.clause_list** %2
%4 = bitcast %struct.clause_list* %3 to %struct.genlist*
%5 = call i64 @genlist_copy(%struct.genlist* %4)
%6 = inttoptr i64 %5 to %struct.clause_list*
ret %struct.clause_list* %6
}

LLVM IR (-O2):
%struct.clause_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.clause_list* @clause_list_copy(%struct.clause_list* %0) {
%2 = bitcast %struct.clause_list* %0 to %struct.genlist*
%3 = tail call i64 @genlist_copy(%struct.genlist* %2)
%4 = inttoptr i64 %3 to %struct.clause_list*
ret %struct.clause_list* %4
}
void ECDSA_SIG_free(void) {}


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

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

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

LLVM IR (-O2):
define void @ECDSA_SIG_free() {
ret void
}
int main() {
  int x;
  (x = 0) + (x = 1);
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *func0(void *arg) {
  printf("Eu sou a thread ID0 imprimindo %d\n", *((int *)arg));
  return 0;
}


x86 assembly (clang, -O0):
<func0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func0>:
push   %rax
mov    (%rdi),%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Eu sou a thread ID0 imprimindo %d\0A\00"
define i8* @func0(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i8* null
}

LLVM IR (-O2):
@.str = [35 x i8] c"Eu sou a thread ID0 imprimindo %d\0A\00"
define noalias i8* @func0(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* null
}
double f4_sum_cb_int(int (*cb)()) {
  int v = cb();
  return ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_cb_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_cb_int>:
push   %rax
xor    %eax,%eax
call   *%rdi
cvtsi2sd %eax,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @f4_sum_cb_int(i32 (...)* nocapture %0) {
%2 = tail call i32 (...) %0()
%3 = sitofp i32 %2 to double
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ stop_tcp_server();
void stop_main() { stop_tcp_server(); }


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

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

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

LLVM IR (-O2):
define void @stop_main() {
%1 = tail call i32 (...) @stop_tcp_server()
ret void
}
int Calc_InterpolateFrom3Ints(int index, int count, int range) {
  return (index * range + count / 2) / count;
}


x86 assembly (clang, -O0):
<Calc_InterpolateFrom3Ints>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Calc_InterpolateFrom3Ints>:
imul   %edx,%edi
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
add    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @Calc_InterpolateFrom3Ints(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %5
%11 = sdiv i32 %10, 2
%12 = add nsw i32 %9, %11
%13 = load i32, i32* %5
%14 = sdiv i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @Calc_InterpolateFrom3Ints(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %0
%5 = sdiv i32 %1, 2
%6 = add nsw i32 %4, %5
%7 = sdiv i32 %6, %1
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ fclose(int /*<<< orphan*/ *);
void FCLOSE(FILE *f) { assert(fclose(f) == 0); }


x86 assembly (clang, -O0):
<FCLOSE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FCLOSE>:
push   %rax
call   1030 <fclose@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @FCLOSE(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @fclose(i32* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}

LLVM IR (-O2):
define void @FCLOSE(i32* nocapture %0) {
%2 = tail call i64 @fclose(i32* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret void
}
/* Variables and functions */
int rand();
char *hind_addr(void) {
  int bits = 48 + rand() % 15;
  return (char *)(1UL << bits);
}


x86 assembly (clang, -O0):
<hind_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xf,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hind_addr>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffff88888889,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
shr    $0x3,%eax
add    %edx,%eax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ecx
add    $0x30,%cl
mov    $0x1,%eax
shl    %cl,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @hind_addr() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 15
%4 = add nsw i32 48, %3
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = zext i32 %5 to i64
%7 = shl i64 1, %6
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @hind_addr() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 15
%3 = add nsw i32 %2, 48
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 1, %4
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Type definitions */
typedef int uint8_t;
typedef int int16_t;

/* Variables and functions */
int16_t get_16bitLE(uint8_t *p) { return (p[0]) | (p[1] << 8); }


x86 assembly (clang, -O0):
<get_16bitLE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_16bitLE>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_16bitLE(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
ret i32 %6
}
int lxc_caps_reset(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @lxc_caps_reset() {
ret i32 0
}

LLVM IR (-O2):
define i32 @lxc_caps_reset() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ closelog();
void close_fds_except(int keep) {
  int i;
  closelog();
  for (i = 3; i <= 100; ++i) {
    if (i != keep)
      close(i);
  }
}


x86 assembly (clang, -O0):
<close_fds_except>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <closelog@plt>
movl   $0x3,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     116a <close_fds_except+0x4a>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1157 <close_fds_except+0x37>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
jmp    115c <close_fds_except+0x3c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <close_fds_except+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_fds_except>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <closelog@plt>
mov    $0x3,%ebp
jmp    1148 <close_fds_except+0x28>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebp
cmp    $0x65,%ebp
je     1155 <close_fds_except+0x35>
cmp    %ebp,%ebx
je     1140 <close_fds_except+0x20>
mov    %ebp,%edi
call   1040 <close@plt>
jmp    1140 <close_fds_except+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @close_fds_except(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @closelog()
store i32 3, i32* %3
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 100
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %3
%14 = call i32 @close(i32 %13)
br label %15
15: ; preds = %12, %8
br label %16
16: ; preds = %15
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %5
19: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @close_fds_except(i32 %0) {
%2 = tail call i32 (...) @closelog()
br label %3
3: ; preds = %1, %8
%4 = phi i32 [ 3, %1 ], [ %9, %8 ]
%5 = icmp eq i32 %4, %0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @close(i32 %4)
br label %8
8: ; preds = %3, %6
%9 = add nuw nsw i32 %4, 1
%10 = icmp eq i32 %9, 101
br i1 %10, label %11, label %3
11: ; preds = %8
ret void
}
/* Variables and functions */
char *mapping_getcwd(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
void pwd(void) {
  int canary = 7;
  char path[10 + 1];
  if (mapping_getcwd((path), (10)) == (char *)NULL) {
    if (0)
      printf("wu-ftpd: Illegal path supplied!\n");
  }
  {
    if (0)
      printf("path = %s\n", path);
    if (0)
      printf("Current directory = %s\n", path);
    if (0)
      printf("max len of path is %d, strlen(path) = %d\n", 10, strlen(path));
    if (0)
      printf("Canary should be 7.  Canary = %d\n", canary);
    if (canary != 7)
      if (0)
        printf("ALERT: path[MAXPATHLEN + 1] has been overflowed!\n");
  }
}


x86 assembly (clang, -O0):
<pwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7,-0x4(%rbp)
lea    -0xf(%rbp),%rdi
mov    $0xa,%esi
call   1030 <mapping_getcwd@plt>
cmp    $0x0,%rax
jne    113c <pwd+0x2c>
jmp    113c <pwd+0x2c>
cmpl   $0x7,-0x4(%rbp)
je     114b <pwd+0x3b>
jmp    114b <pwd+0x3b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwd>:
sub    $0x18,%rsp
lea    0xd(%rsp),%rdi
mov    $0xa,%esi
call   1030 <mapping_getcwd@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @pwd() {
%1 = alloca i32
%2 = alloca [11 x i8]
store i32 7, i32* %1
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%4 = call i8* @mapping_getcwd(i8* %3, i32 10)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %0
br label %7
7: ; preds = %6, %0
%8 = load i32, i32* %1
%9 = icmp ne i32 %8, 7
br i1 %9, label %10, label %11
10: ; preds = %7
br label %11
11: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
define void @pwd() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = call i8* @mapping_getcwd(i8* %2, i32 10)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int iso_8859_1_read(char *string, uint32_t *code_point) {
  code_point[0] = ((uint32_t)string[0]) & 0xFF;
  return 1;
}


x86 assembly (clang, -O0):
<iso_8859_1_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_8859_1_read>:
movzbl (%rdi),%eax
mov    %eax,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @iso_8859_1_read(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 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = and i32 %8, 255
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
ret i32 1
}

LLVM IR (-O2):
define i32 @iso_8859_1_read(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
store i32 %4, i32* %1
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ bzero(void *, size_t);
void *malloc(size_t);
void *calloc(size_t nmem, size_t size) {
  if (nmem == 0) {
    return NULL;
  } else {
    void *user_ptr = malloc(nmem * size);
    bzero(user_ptr, nmem * size);
    return user_ptr;
  }
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1148 <calloc+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1174 <calloc+0x54>
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
imul   -0x18(%rbp),%rsi
call   1040 <bzero@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1148 <calloc+0x28>
mov    %rsi,%rbx
imul   %rdi,%rbx
mov    %rbx,%rdi
call   1030 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <bzero@plt>
jmp    114b <calloc+0x2b>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @calloc(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = mul i64 %1, %0
%6 = tail call i8* @malloc(i64 %5)
%7 = tail call i32 @bzero(i8* %6, i64 %5)
br label %8
8: ; preds = %2, %4
%9 = phi i8* [ %6, %4 ], [ null, %2 ]
ret i8* %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_136(void) {
  if (*(uint32_t *)0x10000130ul == 0xEul) {
    if (*(uint32_t *)0x10000134ul == 0x0ul) {
      return true;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<errata_136>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0xe,%rax
jne    1139 <errata_136+0x39>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x0,%rax
jne    1134 <errata_136+0x34>
movl   $0x1,-0x4(%rbp)
jmp    1140 <errata_136+0x40>
jmp    1139 <errata_136+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @errata_136() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 268435760 to i32*)
%3 = sext i32 %2 to i64
%4 = icmp eq i64 %3, 14
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 268435764 to i32*)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %1
br label %12
10: ; preds = %5
br label %11
11: ; preds = %10, %0
store i32 1, i32* %1
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @errata_136() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t swapf(uint32_t inFloat) {
  uint32_t retVal;
  unsigned char *floatToConvert = (unsigned char *)&inFloat;
  unsigned char *returnFloat = (unsigned char *)&retVal;
  returnFloat[0] = floatToConvert[3];
  returnFloat[1] = floatToConvert[2];
  returnFloat[2] = floatToConvert[1];
  returnFloat[3] = floatToConvert[0];
  return retVal;
}


x86 assembly (clang, -O0):
<swapf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapf>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @swapf(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %2
%6 = bitcast i32* %2 to i8*
store i8* %6, i8** %4
%7 = bitcast i32* %3 to i8*
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 3
%10 = load i8, i8* %9
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = load i8*, i8** %5
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @swapf(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_count_cover(char *, int);
float HMM_ToRadians(float Degrees) {
  { _hmt_count_cover("HMM_ToRadians", 577); };
  float Result = Degrees * (3.14159265359f / 180.0f);
  return (Result);
}


x86 assembly (clang, -O0):
<HMM_ToRadians>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
lea    0xee0(%rip),%rdi
mov    $0x241,%esi
call   1030 <_hmt_count_cover@plt>
movss  0xeca(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HMM_ToRadians>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0xee6(%rip),%rdi
mov    $0x241,%esi
call   1030 <_hmt_count_cover@plt>
movss  0x4(%rsp),%xmm0
mulss  0xeca(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"HMM_ToRadians\00"
define float @HMM_ToRadians(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = call i32 @_hmt_count_cover(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 577)
%5 = load float, float* %2
%6 = fmul float %5, 0x3F91DF46A0000000
store float %6, float* %3
%7 = load float, float* %3
ret float %7
}

LLVM IR (-O2):
@.str = [14 x i8] c"HMM_ToRadians\00"
define float @HMM_ToRadians(float %0) {
%2 = tail call i32 @_hmt_count_cover(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 577)
%3 = fmul float %0, 0x3F91DF46A0000000
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  int n1, n2;
  float n3;
  n1 = 5 + 3 * 8 / 2 - 3;
  n2 = 2 % 2 + 2 * 2 - 2 / 2;
  n3 = 2 * 4 * (5 + 9.00 / 2.00);
  printf("n1 = %d\n", n1);
  printf("n2 = %d\n", n2);
  printf("n3 = %f\n", n3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xe,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x8(%rbp),%xmm0
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef4(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
movss  0xec0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"n1 = %d\0A\00"
@.str.1 = [9 x i8] c"n2 = %d\0A\00"
@.str.2 = [9 x i8] c"n3 = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 14, i32* %1
store i32 3, i32* %2
store float 7.600000e+01, float* %3
%4 = load i32, i32* %1
%5 = sitofp i32 %4 to float
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %5)
%7 = load i32, i32* %2
%8 = sitofp i32 %7 to float
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float %8)
%10 = load float, float* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"n1 = %d\0A\00"
@.str.1 = [9 x i8] c"n2 = %d\0A\00"
@.str.2 = [9 x i8] c"n3 = %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float 1.400000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float 3.000000e+00)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), float 7.600000e+01)
ret i32 0
}
void neg_d(double *source, double *target) { *target = -(*source); }


x86 assembly (clang, -O0):
<neg_d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg_d>:
movsd  (%rdi),%xmm0
xorps  0xef5(%rip),%xmm0
movlps %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @neg_d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = fneg double %6
%8 = load double*, double** %4
store double %7, double* %8
ret void
}

LLVM IR (-O2):
define void @neg_d(double* nocapture %0, double* nocapture writeonly %1) {
%3 = load double, double* %0
%4 = fneg double %3
store double %4, double* %1
ret void
}
/* Variables and functions */
int Pnl_GetPlatform();
void Pnl_RestorePanelState(void) {
  int Platform;
  Platform = Pnl_GetPlatform();
}


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

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

LLVM IR (-O0):
define void @Pnl_RestorePanelState() {
%1 = alloca i32
%2 = call i32 (...) @Pnl_GetPlatform()
store i32 %2, i32* %1
ret void
}

LLVM IR (-O2):
define void @Pnl_RestorePanelState() {
%1 = tail call i32 (...) @Pnl_GetPlatform()
ret void
}
int hash_name(char *label) {
  unsigned accum = 0;
  while (*label)
    accum = (accum << 1) ^ *label++;
  accum %= 1023;
  return accum;
}


x86 assembly (clang, -O0):
<hash_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <hash_name+0x3e>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash_name+0xf>
mov    -0xc(%rbp),%eax
mov    $0x3ff,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_name>:
mov    (%rdi),%al
test   %al,%al
je     1146 <hash_name+0x46>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %ecx,%edx
add    %ecx,%edx
movsbl %al,%ecx
xor    %edx,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash_name+0x10>
mov    %ecx,%eax
imul   $0x401005,%rax,%rdx
shr    $0x20,%rdx
mov    %ecx,%eax
sub    %edx,%eax
shr    %eax
add    %edx,%eax
shr    $0x9,%eax
mov    %eax,%edx
shl    $0xa,%edx
sub    %edx,%eax
add    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_name(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = xor i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %11, 1023
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}