xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char c;
  printf("Enter a char: ");
  scanf("%c", &c);
  printf("ASCII-code %c = %d\n", c, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%esi
movsbl -0x5(%rbp),%edx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
movsbl 0x7(%rsp),%edx
lea    0xec6(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter a char: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [20 x i8] c"ASCII-code %c = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter a char: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [20 x i8] c"ASCII-code %c = %d\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %5)
ret i32 0
}
void marker3() {}


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

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

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

LLVM IR (-O2):
define void @marker3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alloc_fail();
void *realloc(void *, size_t);
void *sdb_realloc(void *r, size_t size) {
  void *p;
  p = realloc(r, size);
  if (p == NULL)
    alloc_fail();
  return p;
}


x86 assembly (clang, -O0):
<sdb_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <sdb_realloc+0x33>
mov    $0x0,%al
call   1030 <alloc_fail@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdb_realloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <sdb_realloc+0x15>
xor    %eax,%eax
call   1030 <alloc_fail@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @sdb_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @alloc_fail()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
char *to_unix_path(char *p) {
  if (p != NULL) {
    char *pp = p;
    while (*pp != 0) {
      if (*pp == '\\')
        *pp = '/';
      ++pp;
    }
  }
  return p;
}


x86 assembly (clang, -O0):
<to_unix_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1158 <to_unix_path+0x58>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1153 <to_unix_path+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1142 <to_unix_path+0x42>
mov    -0x10(%rbp),%rax
movb   $0x2f,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111b <to_unix_path+0x1b>
jmp    1158 <to_unix_path+0x58>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_unix_path>:
mov    %rdi,%rax
test   %rdi,%rdi
je     1123 <to_unix_path+0x23>
mov    %rax,%rcx
jmp    1117 <to_unix_path+0x17>
nopl   (%rax)
movb   $0x2f,(%rcx)
add    $0x1,%rcx
movzbl (%rcx),%edx
cmp    $0x5c,%dl
je     1110 <to_unix_path+0x10>
test   %dl,%dl
jne    1113 <to_unix_path+0x13>
ret

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

LLVM IR (-O2):
define i8* @to_unix_path(i8* returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %7
%4 = phi i8* [ %8, %7 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 92, label %6
]
6: ; preds = %3
store i8 47, i8* %4
br label %7
7: ; preds = %3, %6
%8 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
9: ; preds = %3, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ say_good_fellow();
int /*<<< orphan*/ say_nobody_can_deny();
int main(void) {
  say_good_fellow();
  say_good_fellow();
  say_good_fellow();
  say_nobody_can_deny();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @say_good_fellow()
%2 = tail call i32 (...) @say_good_fellow()
%3 = tail call i32 (...) @say_good_fellow()
%4 = tail call i32 (...) @say_nobody_can_deny()
ret i32 0
}
/* Variables and functions */
float truncf(float);
float fmodf(float x, float y) { return x - truncf(x / y) * y; }


x86 assembly (clang, -O0):
<fmodf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
call   1030 <truncf@plt>
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodf>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
divss  %xmm1,%xmm0
call   1030 <truncf@plt>
mulss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fmodf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fdiv float %6, %7
%9 = call float @llvm.trunc.f32(float %8)
%10 = load float, float* %4
%11 = fneg float %9
%12 = call float @llvm.fmuladd.f32(float %11, float %10, float %5)
ret float %12
}

LLVM IR (-O2):
define float @fmodf(float %0, float %1) {
%3 = fdiv float %0, %1
%4 = tail call float @llvm.trunc.f32(float %3)
%5 = fneg float %4
%6 = tail call float @llvm.fmuladd.f32(float %5, float %1, float %0)
ret float %6
}
/* Variables and functions */
char *mem_begin(char *);
int /*<<< orphan*/ memmove(char *, char *, size_t);
size_t str_len(char *);
char *str_erase(char *str, size_t len) {
  size_t len_str = str_len(str);
  char *str_begin = mem_begin(str);
  if (len_str < len)
    len = len_str;
  memmove(str, str + len, len_str + 1);
  return (str_begin);
}


x86 assembly (clang, -O0):
<str_erase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <str_len@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mem_begin@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1170 <str_erase+0x40>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
call   1040 <memmove@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_erase>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1050 <str_len@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <mem_begin@plt>
mov    %rax,%r12
cmp    %rbx,%r15
cmovb  %r15,%rbx
add    %r14,%rbx
add    $0x1,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1040 <memmove@plt>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @str_erase(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = call i64 @str_len(i8* %7)
store i64 %8, i64* %5
%9 = load i8*, i8** %3
%10 = call i8* @mem_begin(i8* %9)
store i8* %10, i8** %6
%11 = load i64, i64* %5
%12 = load i64, i64* %4
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = load i64, i64* %5
store i64 %15, i64* %4
br label %16
16: ; preds = %14, %2
%17 = load i8*, i8** %3
%18 = load i8*, i8** %3
%19 = load i64, i64* %4
%20 = getelementptr inbounds i8, i8* %18, i64 %19
%21 = load i64, i64* %5
%22 = add i64 %21, 1
%23 = call i32 @memmove(i8* %17, i8* %20, i64 %22)
%24 = load i8*, i8** %6
ret i8* %24
}

LLVM IR (-O2):
define i8* @str_erase(i8* %0, i64 %1) {
%3 = tail call i64 @str_len(i8* %0)
%4 = tail call i8* @mem_begin(i8* %0)
%5 = icmp ult i64 %3, %1
%6 = select i1 %5, i64 %3, i64 %1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = add i64 %3, 1
%9 = tail call i32 @memmove(i8* %0, i8* %7, i64 %8)
ret i8* %4
}
char *hash_plugin_detailed(void) {
  return ("mssql-2012 - Microsoft SQL Server 2012 plugin\n"
          "------------------------\n"
          "Use this module to crack MS-SQL 2012 pwdencrypt() hashes\n"
          "Input should be in form: \'user:hash\' or just \'hash\'\n"
          "Known software that uses this password hashing method:\n"
          "Microsoft SQL Server 2012\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


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

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

LLVM IR (-O0):
@.str = [307 x i8] c"mssql-2012 - Microsoft SQL Server 2012 plugin\0A------------------------\0AUse this module to crack MS-SQL 2012 pwdencrypt() hashes\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0AMicrosoft SQL Server 2012\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([307 x i8], [307 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [307 x i8] c"mssql-2012 - Microsoft SQL Server 2012 plugin\0A------------------------\0AUse this module to crack MS-SQL 2012 pwdencrypt() hashes\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0AMicrosoft SQL Server 2012\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([307 x i8], [307 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          size_t);
uint8_t *bytecpy_advance_ptr(uint8_t *restrict to, const uint8_t *restrict from,
                             size_t len) {
  memcpy(to, from, len);
  return (to + len);
}


x86 assembly (clang, -O0):
<bytecpy_advance_ptr>:
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   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytecpy_advance_ptr>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <memcpy@plt>
lea    (%rbx,%r14,4),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @bytecpy_advance_ptr(i32* noalias %0, i32* noalias %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i64, i64* %6
%10 = call i32 @memcpy(i32* %7, i32* %8, i64 %9)
%11 = load i32*, i32** %4
%12 = load i64, i64* %6
%13 = getelementptr inbounds i32, i32* %11, i64 %12
ret i32* %13
}

LLVM IR (-O2):
define i32* @bytecpy_advance_ptr(i32* noalias %0, i32* noalias %1, i64 %2) {
%4 = tail call i32 @memcpy(i32* %0, i32* %1, i64 %2)
%5 = getelementptr inbounds i32, i32* %0, i64 %2
ret i32* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ cwd;

/* Variables and functions */
int /*<<< orphan*/ *getcwd(char *, int);
char *malloc(int);
char *np_get_current_path(void) {
  char *cwd;
  if ((cwd = malloc(1024)) == NULL) {
    return NULL;
  }
  if (getcwd(cwd, sizeof(cwd)) != NULL) {
    return cwd;
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<np_get_current_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114d <np_get_current_path+0x2d>
movq   $0x0,-0x8(%rbp)
jmp    117a <np_get_current_path+0x5a>
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1030 <getcwd@plt>
cmp    $0x0,%rax
je     1172 <np_get_current_path+0x52>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117a <np_get_current_path+0x5a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<np_get_current_path>:
push   %rbx
mov    $0x400,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1149 <np_get_current_path+0x29>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x8,%esi
call   1030 <getcwd@plt>
test   %rax,%rax
cmove  %rax,%rbx
jmp    114b <np_get_current_path+0x2b>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @np_get_current_path() {
%1 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%2 = icmp eq i8* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32* @getcwd(i8* %1, i32 8)
%5 = icmp eq i32* %4, null
%6 = select i1 %5, i8* null, i8* %1
br label %7
7: ; preds = %3, %0
%8 = phi i8* [ null, %0 ], [ %6, %3 ]
ret i8* %8
}
int ld_blt_cr2(long double a1) { return !(__builtin_isless(100, a1)); }


x86 assembly (clang, -O0):
<ld_blt_cr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_blt_cr2>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setbe  %al
ret

LLVM IR (-O0):
define i32 @ld_blt_cr2(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp olt x86_fp80 0xK4005C800000000000000, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ld_blt_cr2(x86_fp80 %0) {
%2 = fcmp ule x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SPUasync(int /*<<< orphan*/);
void SPUupdate(void) { SPUasync(0); }


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

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

LLVM IR (-O0):
define void @SPUupdate() {
%1 = call i32 @SPUasync(i32 0)
ret void
}

LLVM IR (-O2):
define void @SPUupdate() {
%1 = tail call i32 @SPUasync(i32 0)
ret void
}
/* Variables and functions */
int Qmuldiv(unsigned int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ Qval(int);
unsigned DegToRad(unsigned dg) {
  unsigned qV;
  return (Qmuldiv(dg, Qval(71), Qval(4068)));
}


x86 assembly (clang, -O0):
<DegToRad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x47,%edi
call   1040 <Qval@plt>
mov    %eax,-0xc(%rbp)
mov    $0xfe4,%edi
call   1040 <Qval@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    %eax,%edx
call   1030 <Qmuldiv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DegToRad>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x47,%edi
call   1040 <Qval@plt>
mov    %eax,%ebp
mov    $0xfe4,%edi
call   1040 <Qval@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <Qmuldiv@plt>

LLVM IR (-O0):
define i32 @DegToRad(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @Qval(i32 71)
%6 = call i32 @Qval(i32 4068)
%7 = call i32 @Qmuldiv(i32 %4, i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @DegToRad(i32 %0) {
%2 = tail call i32 @Qval(i32 71)
%3 = tail call i32 @Qval(i32 4068)
%4 = tail call i32 @Qmuldiv(i32 %0, i32 %2, i32 %3)
ret i32 %4
}
void evbuffer_free(struct evbuffer *buf) { (void)buf; }


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

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

LLVM IR (-O0):
%struct.evbuffer = type opaque
define void @evbuffer_free(%struct.evbuffer* %0) {
%2 = alloca %struct.evbuffer*
store %struct.evbuffer* %0, %struct.evbuffer** %2
%3 = load %struct.evbuffer*, %struct.evbuffer** %2
ret void
}

LLVM IR (-O2):
%struct.evbuffer = type opaque
define void @evbuffer_free(%struct.evbuffer* nocapture %0) {
ret void
}
void str_find_replace(char *str, char find, char c) {
  char *t = str;
  while (*t != find && *t != '\0')
    t++;
  if (*t != '\0')
    *t = c;
}


x86 assembly (clang, -O0):
<str_find_replace>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x19(%rbp)
je     1143 <str_find_replace+0x43>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1153 <str_find_replace+0x53>
jmp    1164 <str_find_replace+0x64>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111b <str_find_replace+0x1b>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117d <str_find_replace+0x7d>
mov    -0xa(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_find_replace>:
movzbl (%rdi),%eax
add    $0x1,%rdi
cmp    %sil,%al
je     1110 <str_find_replace+0x10>
test   %al,%al
jne    1100 <str_find_replace>
test   %al,%al
je     1117 <str_find_replace+0x17>
mov    %dl,-0x1(%rdi)
ret

LLVM IR (-O0):
define void @str_find_replace(i8* %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8*
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
store i8* %8, i8** %7
br label %9
9: ; preds = %23, %3
%10 = load i8*, i8** %7
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = load i8, i8* %5
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %12, %14
br i1 %15, label %16, label %21
16: ; preds = %9
%17 = load i8*, i8** %7
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br label %21
21: ; preds = %16, %9
%22 = phi i1 [ false, %9 ], [ %20, %16 ]
br i1 %22, label %23, label %26
23: ; preds = %21
%24 = load i8*, i8** %7
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %7
br label %9
26: ; preds = %21
%27 = load i8*, i8** %7
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %26
%32 = load i8, i8* %6
%33 = load i8*, i8** %7
store i8 %32, i8* %33
br label %34
34: ; preds = %31, %26
ret void
}

LLVM IR (-O2):
define void @str_find_replace(i8* nocapture %0, i8 signext %1, i8 signext %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i8* [ %0, %3 ], [ %10, %4 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %1
%8 = icmp eq i8 %6, 0
%9 = or i1 %7, %8
%10 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %9, label %11, label %4
11: ; preds = %4
br i1 %8, label %13, label %12
12: ; preds = %11
store i8 %2, i8* %5
br label %13
13: ; preds = %12, %11
ret void
}
unsigned short int f94(unsigned short int x, unsigned long int y) {
  return (x << (8 * sizeof(unsigned short) - y)) + (x >> y);
}


x86 assembly (clang, -O0):
<f94>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x10,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f94>:
mov    $0x10,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f94(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = sub i64 16, %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %6, %9
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = ashr i32 %12, %14
%16 = add nsw i32 %10, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f94(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 16, %4
%6 = shl i32 %3, %5
%7 = lshr i32 %3, %4
%8 = add nsw i32 %6, %7
%9 = trunc i32 %8 to i16
ret i16 %9
}
float beta2angle(float beta) {
  beta = 20 / 31.125 * beta * -1;
  beta = beta + 130.6747 + 15;
  return beta;
}


x86 assembly (clang, -O0):
<beta2angle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xefe(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec4(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xeb0(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<beta2angle>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xeec(%rip),%xmm0
addsd  0xeec(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @beta2angle(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 0x3FE48FEF8CD9F5B8, %4
%6 = fmul double %5, -1.000000e+00
%7 = fptrunc double %6 to float
store float %7, float* %2
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fadd double %9, 0x406055972474538F
%11 = fadd double %10, 1.500000e+01
%12 = fptrunc double %11 to float
store float %12, float* %2
%13 = load float, float* %2
ret float %13
}

LLVM IR (-O2):
define float @beta2angle(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0xBFE48FEF8CD9F5B8
%4 = fptrunc double %3 to float
%5 = fpext float %4 to double
%6 = fadd double %5, 0x406055972474538F
%7 = fadd double %6, 1.500000e+01
%8 = fptrunc double %7 to float
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ qsort(void *, size_t, size_t,
                         int (*)(void const *, void const *));
void my_qsort(void *base, size_t nmemb, size_t size,
              int (*compar)(const void *, const void *)) {
  qsort(base, nmemb, size, compar);
}


x86 assembly (clang, -O0):
<my_qsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <qsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_qsort>:
jmp    1030 <qsort@plt>

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

LLVM IR (-O2):
define void @my_qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* nocapture %3) {
%5 = tail call i32 @qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3)
ret void
}
int unscramble_mbf(char *mbf) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @unscramble_mbf(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int abs(int);
int Distance(int a, int b) { return abs(a - b); }


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

x86 assembly (clang, -O2):
<Distance>:
sub    %esi,%edi
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @Distance(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
%8 = call i32 @abs(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @Distance(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = tail call i32 @llvm.abs.i32(i32 %3, i1 true)
ret i32 %4
}
/* Variables and functions */
int LNS_Length(unsigned int *);
int /*<<< orphan*/ LNS_Print(unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  unsigned start;
  printf("Дължина на най-дългата ненамаляваща подредица: %u\n",
         LNS_Length(&start));
  printf("Подредицата: ");
  LNS_Print(start);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <LNS_Length@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <LNS_Print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1050 <LNS_Length@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf09(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%edi
call   1040 <LNS_Print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [91 x i8] c"\D0\94\D1\8A\D0\BB\D0\B6\D0\B8\D0\BD\D0\B0 \D0\BD\D0\B0 \D0\BD\D0\B0\D0\B9-\D0\B4\D1\8A\D0\BB\D0\B3\D0\B0\D1\82\D0\B0 \D0\BD\D0\B5\D0\BD\D0\B0\D0\BC\D0\B0\D0\BB\D1\8F\D0\B2\D0\B0\D1\89\D0\B0 \D0\BF\D0\BE\D0\B4\D1\80\D0\B5\D0\B4\D0\B8\D1\86\D0\B0: %u\0A\00"
@.str.1 = [25 x i8] c"\D0\9F\D0\BE\D0\B4\D1\80\D0\B5\D0\B4\D0\B8\D1\86\D0\B0\D1\82\D0\B0: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @LNS_Length(i32* %2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @LNS_Print(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [91 x i8] c"\D0\94\D1\8A\D0\BB\D0\B6\D0\B8\D0\BD\D0\B0 \D0\BD\D0\B0 \D0\BD\D0\B0\D0\B9-\D0\B4\D1\8A\D0\BB\D0\B3\D0\B0\D1\82\D0\B0 \D0\BD\D0\B5\D0\BD\D0\B0\D0\BC\D0\B0\D0\BB\D1\8F\D0\B2\D0\B0\D1\89\D0\B0 \D0\BF\D0\BE\D0\B4\D1\80\D0\B5\D0\B4\D0\B8\D1\86\D0\B0: %u\0A\00"
@.str.1 = [25 x i8] c"\D0\9F\D0\BE\D0\B4\D1\80\D0\B5\D0\B4\D0\B8\D1\86\D0\B0\D1\82\D0\B0: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @LNS_Length(i32* %1)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = call i32 @LNS_Print(i32 %6)
ret i32 0
}
long double sum_long_double(long double a, long double b) { return a + b; }


x86 assembly (clang, -O0):
<sum_long_double>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
faddp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_long_double>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
faddp  %st,%st(1)
ret

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

LLVM IR (-O2):
define x86_fp80 @sum_long_double(x86_fp80 %0, x86_fp80 %1) {
%3 = fadd x86_fp80 %0, %1
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ msort(int *, int, int);
void mergeSort(int *array, int low, int high) { msort(array, low, high); }


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

x86 assembly (clang, -O2):
<mergeSort>:
jmp    1030 <msort@plt>

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

LLVM IR (-O2):
define void @mergeSort(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @msort(i32* %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ AES128_set_hw(int);
int /*<<< orphan*/ AES_CBC_set_hw(int);
int do_testsuite();
int main(void) {
  int rc = do_testsuite();
  if (AES128_set_hw(1) == 0) {
    AES128_set_hw(0);
    AES_CBC_set_hw(0);
    rc |= do_testsuite();
  }
  AES128_set_hw(-1);
  AES_CBC_set_hw(-1);
  return rc;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <do_testsuite@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1050 <AES128_set_hw@plt>
cmp    $0x0,%rax
jne    1178 <main+0x48>
xor    %edi,%edi
call   1050 <AES128_set_hw@plt>
xor    %edi,%edi
call   1030 <AES_CBC_set_hw@plt>
mov    $0x0,%al
call   1040 <do_testsuite@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xffffffff,%edi
call   1050 <AES128_set_hw@plt>
mov    $0xffffffff,%edi
call   1030 <AES_CBC_set_hw@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <do_testsuite@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1050 <AES128_set_hw@plt>
test   %rax,%rax
jne    1160 <main+0x30>
xor    %edi,%edi
call   1050 <AES128_set_hw@plt>
xor    %edi,%edi
call   1030 <AES_CBC_set_hw@plt>
xor    %eax,%eax
call   1040 <do_testsuite@plt>
or     %eax,%ebx
mov    $0xffffffff,%edi
call   1050 <AES128_set_hw@plt>
mov    $0xffffffff,%edi
call   1030 <AES_CBC_set_hw@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @do_testsuite()
store i32 %3, i32* %2
%4 = call i64 @AES128_set_hw(i32 1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = call i64 @AES128_set_hw(i32 0)
%8 = call i32 @AES_CBC_set_hw(i32 0)
%9 = call i32 (...) @do_testsuite()
%10 = load i32, i32* %2
%11 = or i32 %10, %9
store i32 %11, i32* %2
br label %12
12: ; preds = %6, %0
%13 = call i64 @AES128_set_hw(i32 -1)
%14 = call i32 @AES_CBC_set_hw(i32 -1)
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @do_testsuite()
%2 = tail call i64 @AES128_set_hw(i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = tail call i64 @AES128_set_hw(i32 0)
%6 = tail call i32 @AES_CBC_set_hw(i32 0)
%7 = tail call i32 (...) @do_testsuite()
%8 = or i32 %7, %1
br label %9
9: ; preds = %4, %0
%10 = phi i32 [ %8, %4 ], [ %1, %0 ]
%11 = tail call i64 @AES128_set_hw(i32 -1)
%12 = tail call i32 @AES_CBC_set_hw(i32 -1)
ret i32 %10
}
/* Variables and functions */
float acosf(float);
float __glsl_acos(float x) { return acosf(x); }


x86 assembly (clang, -O0):
<__glsl_acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <acosf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glsl_acos>:
jmp    1030 <acosf@plt>

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

LLVM IR (-O2):
define float @__glsl_acos(float %0) {
%2 = tail call float @acosf(float %0)
ret float %2
}
int main() {
  int N, R;
  int u, v, r;
  u = 2 * R + 1;
  v = 1;
  r = R * R - N;
  while (r != 0) {
    if (r > 0) {
      r = r - v;
      v = v + 2;
      u = u;
    } else {
      r = r + u;
      u = u + 2;
      v = v;
    }
  }
  return ((u - v) / 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1179 <main+0x79>
cmpl   $0x0,-0x18(%rbp)
jle    115c <main+0x5c>
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1174 <main+0x74>
mov    -0x18(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112b <main+0x2b>
mov    -0x10(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = load i32, i32* %3
%8 = mul nsw i32 2, %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %4
store i32 1, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %2
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %6
br label %15
15: ; preds = %35, %0
%16 = load i32, i32* %6
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %36
18: ; preds = %15
%19 = load i32, i32* %6
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = load i32, i32* %6
%23 = load i32, i32* %5
%24 = sub nsw i32 %22, %23
store i32 %24, i32* %6
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 2
store i32 %26, i32* %5
%27 = load i32, i32* %4
store i32 %27, i32* %4
br label %35
28: ; preds = %18
%29 = load i32, i32* %6
%30 = load i32, i32* %4
%31 = add nsw i32 %29, %30
store i32 %31, i32* %6
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 2
store i32 %33, i32* %4
%34 = load i32, i32* %5
store i32 %34, i32* %5
br label %35
35: ; preds = %28, %21
br label %15
36: ; preds = %15
%37 = load i32, i32* %4
%38 = load i32, i32* %5
%39 = sub nsw i32 %37, %38
%40 = sdiv i32 %39, 2
ret i32 %40
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ErrorMessage() { printf("That is not a valid choice, please re-enter: "); }


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"That is not a valid choice, please re-enter: \00"
define void @ErrorMessage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"That is not a valid choice, please re-enter: \00"
define void @ErrorMessage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int f_b();
scalar_t__ f_c();
int f_a() {
  int ret = 0, x = f_b();
  for (int i = 0; i < x; ++i) {
    ret += f_c();
  }
  return ret;
}


x86 assembly (clang, -O0):
<f_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f_b@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116e <f_a+0x4e>
mov    $0x0,%al
call   1040 <f_c@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1140 <f_a+0x20>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_a>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <f_b@plt>
test   %eax,%eax
jle    114e <f_a+0x2e>
mov    %eax,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <f_c@plt>
add    %eax,%ebx
add    $0xffffffff,%ebp
jne    1140 <f_a+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @f_a() {
%1 = tail call i32 (...) @f_b()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %5, %0
%4 = phi i32 [ 0, %0 ], [ %10, %5 ]
ret i32 %4
5: ; preds = %0, %5
%6 = phi i32 [ %11, %5 ], [ 0, %0 ]
%7 = phi i32 [ %10, %5 ], [ 0, %0 ]
%8 = tail call i64 (...) @f_c()
%9 = trunc i64 %8 to i32
%10 = add i32 %7, %9
%11 = add nuw nsw i32 %6, 1
%12 = icmp eq i32 %11, %1
br i1 %12, label %3, label %5
}
int cvRound(float value) { return (int)(value + (value >= 0 ? 0.5f : -0.5f)); }


x86 assembly (clang, -O0):
<cvRound>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xee5(%rip),%xmm4
movss  0xee1(%rip),%xmm3
xorps  %xmm1,%xmm1
cmpless %xmm2,%xmm1
movaps %xmm1,%xmm2
andps  %xmm4,%xmm2
andnps %xmm3,%xmm1
orps   %xmm2,%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvRound>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
lea    0xeee(%rip),%rcx
addss  (%rcx,%rax,4),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @cvRound(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fcmp oge float %4, 0.000000e+00
%6 = zext i1 %5 to i64
%7 = select i1 %5, float 5.000000e-01, float -5.000000e-01
%8 = fadd float %3, %7
%9 = fptosi float %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @cvRound(float %0) {
%2 = fcmp oge float %0, 0.000000e+00
%3 = select i1 %2, float 5.000000e-01, float -5.000000e-01
%4 = fadd float %3, %0
%5 = fptosi float %4 to i32
ret i32 %5
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y, oldx;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (4 * x + y > 0) {
    oldx = x;
    x = -2 * oldx + 4 * y;
    y = 4 * oldx;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
add    -0xc(%rbp),%eax
cmp    $0x0,%eax
jle    116b <main+0x5b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
imul   $0xfffffffe,-0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
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 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %2
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %3
br label %7
7: ; preds = %13, %0
%8 = load i32, i32* %2
%9 = mul nsw i32 4, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %22
13: ; preds = %7
%14 = load i32, i32* %2
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = mul nsw i32 -2, %15
%17 = load i32, i32* %3
%18 = mul nsw i32 4, %17
%19 = add nsw i32 %16, %18
store i32 %19, i32* %2
%20 = load i32, i32* %4
%21 = mul nsw i32 4, %20
store i32 %21, i32* %3
br label %7
22: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
unsigned long PAPI_thread_id();
void papif_thread_id__(unsigned long *id) { *id = PAPI_thread_id(); }


x86 assembly (clang, -O0):
<papif_thread_id__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PAPI_thread_id@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_thread_id__>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_thread_id@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_thread_id__(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = call i64 (...) @PAPI_thread_id()
%4 = load i64*, i64** %2
store i64 %3, i64* %4
ret void
}

LLVM IR (-O2):
define void @papif_thread_id__(i64* nocapture writeonly %0) {
%2 = tail call i64 (...) @PAPI_thread_id()
store i64 %2, i64* %0
ret void
}
void foo_2_2_2_1_2_2_2_1_1() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ pthread_noop_access(int /*<<< orphan*/ *);
extern int pthread_mutexattr_destroy(pthread_mutexattr_t *pmutexattr) {
  pthread_noop_access(pmutexattr);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutexattr_destroy(i32* %0) {
%2 = tail call i32 @pthread_noop_access(i32* %0)
ret i32 0
}
/* Type definitions */
struct ptree_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ptree_node_delete(struct ptree_node *x) { free((char *)x); }


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

x86 assembly (clang, -O2):
<ptree_node_delete>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.ptree_node = type { i32 }
define void @ptree_node_delete(%struct.ptree_node* %0) {
%2 = alloca %struct.ptree_node*
store %struct.ptree_node* %0, %struct.ptree_node** %2
%3 = load %struct.ptree_node*, %struct.ptree_node** %2
%4 = bitcast %struct.ptree_node* %3 to i8*
%5 = call i32 @free(i8* %4)
ret void
}

LLVM IR (-O2):
%struct.ptree_node = type { i32 }
define void @ptree_node_delete(%struct.ptree_node* nocapture %0) {
%2 = bitcast %struct.ptree_node* %0 to i8*
%3 = tail call i32 @free(i8* %2)
ret void
}
extern unsigned int vdlGetVersion(void) { return 100; }


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

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

LLVM IR (-O0):
define i32 @vdlGetVersion() {
ret i32 100
}

LLVM IR (-O2):
define i32 @vdlGetVersion() {
ret i32 100
}