xunge/DecIR huggingface dataset:
/* Variables and functions */
int charset_more_init();
int module_charset_more_init(void) { return charset_more_init(); }


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

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

LLVM IR (-O0):
define i32 @module_charset_more_init() {
%1 = call i32 (...) @charset_more_init()
ret i32 %1
}

LLVM IR (-O2):
define i32 @module_charset_more_init() {
%1 = tail call i32 (...) @charset_more_init()
ret i32 %1
}
/* Type definitions */
struct object {
  int dummy;
};
struct expr {
  int dummy;
};
struct double_expr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ double_expr_class_get();
int /*<<< orphan*/ double_expr_init(struct double_expr *, double);
struct object *object_new(int /*<<< orphan*/);
struct expr *double_expr_new(double value) {
  struct object *expr = object_new(double_expr_class_get());
  double_expr_init(((struct double_expr *)(expr)), value);
  return ((struct expr *)(expr));
}


x86 assembly (clang, -O0):
<double_expr_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <double_expr_class_get@plt>
mov    %eax,%edi
call   1040 <object_new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
call   1050 <double_expr_init@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_expr_new>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <double_expr_class_get@plt>
mov    %eax,%edi
call   1040 <object_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
movsd  0x8(%rsp),%xmm0
call   1050 <double_expr_init@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.expr = type { i32 }
%struct.object = type { i32 }
%struct.double_expr = type { i32 }
define %struct.expr* @double_expr_new(double %0) {
%2 = alloca double
%3 = alloca %struct.object*
store double %0, double* %2
%4 = call i32 (...) @double_expr_class_get()
%5 = call %struct.object* @object_new(i32 %4)
store %struct.object* %5, %struct.object** %3
%6 = load %struct.object*, %struct.object** %3
%7 = bitcast %struct.object* %6 to %struct.double_expr*
%8 = load double, double* %2
%9 = call i32 @double_expr_init(%struct.double_expr* %7, double %8)
%10 = load %struct.object*, %struct.object** %3
%11 = bitcast %struct.object* %10 to %struct.expr*
ret %struct.expr* %11
}

LLVM IR (-O2):
%struct.expr = type { i32 }
%struct.object = type { i32 }
%struct.double_expr = type { i32 }
define %struct.expr* @double_expr_new(double %0) {
%2 = tail call i32 (...) @double_expr_class_get()
%3 = tail call %struct.object* @object_new(i32 %2)
%4 = bitcast %struct.object* %3 to %struct.double_expr*
%5 = tail call i32 @double_expr_init(%struct.double_expr* %4, double %0)
%6 = bitcast %struct.object* %3 to %struct.expr*
ret %struct.expr* %6
}
const char *TA_GetVersionString(void) {
  if (sizeof("dev") > 1) {
    return "0"
           "."
           "6"
           "."
           "0"
           "-"
           "dev"
           " "
           "("
           "Mar 18 2022"
           " "
           "17:24:07"
           ")";
  } else {
    return "0"
           "."
           "6"
           "."
           "0"
           " "
           "("
           "Mar 18 2022"
           " "
           "17:24:07"
           ")";
  }
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"0.6.0-dev (Mar 18 2022 17:24:07)\00"
define i8* @TA_GetVersionString() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [33 x i8] c"0.6.0-dev (Mar 18 2022 17:24:07)\00"
define i8* @TA_GetVersionString() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x8f() {
  Assert_real((isupper(143) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              720, ("isupper should be 0 for 0x8f"));
}


x86 assembly (clang, -O0):
<t_isupper_0x8f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8f,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2d0,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x8f>:
push   %rax
mov    $0x8f,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2d0,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x8f\00"
define void @t_isupper_0x8f() {
%1 = call i64 @isupper(i32 143)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 720, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x8f\00"
define void @t_isupper_0x8f() {
%1 = tail call i64 @isupper(i32 143)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 720, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned firm_fnv_hash_str(const char *data) {
  unsigned i;
  unsigned hash = 2166136261U;
  for (i = 0; data[i] != '\0'; ++i) {
    hash = ((hash)*16777619U);
    hash ^= data[i];
  }
  return hash;
}


x86 assembly (clang, -O0):
<firm_fnv_hash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x811c9dc5,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1153 <firm_fnv_hash_str+0x53>
imul   $0x1000193,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <firm_fnv_hash_str+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<firm_fnv_hash_str>:
mov    (%rdi),%dl
mov    $0x811c9dc5,%eax
test   %dl,%dl
je     1128 <firm_fnv_hash_str+0x28>
mov    $0x1,%ecx
movsbl %dl,%edx
imul   $0x1000193,%eax,%eax
xor    %edx,%eax
mov    %ecx,%edx
movzbl (%rdi,%rdx,1),%edx
add    $0x1,%ecx
test   %dl,%dl
jne    1110 <firm_fnv_hash_str+0x10>
ret

LLVM IR (-O0):
define i32 @firm_fnv_hash_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 -2128831035, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %24, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %27
13: ; preds = %5
%14 = load i32, i32* %4
%15 = mul i32 %14, 16777619
store i32 %15, i32* %4
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i32, i32* %4
%23 = xor i32 %22, %21
store i32 %23, i32* %4
br label %24
24: ; preds = %13
%25 = load i32, i32* %3
%26 = add i32 %25, 1
store i32 %26, i32* %3
br label %5
27: ; preds = %5
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @firm_fnv_hash_str(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 [ %14, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ -2128831035, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 16777619
%10 = xor i32 %9, %8
%11 = add i32 %7, 1
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ -2128831035, %1 ], [ %10, %4 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
extern void CLEAR(void *p, int n) { memset(p, 0, n); }


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

x86 assembly (clang, -O2):
<CLEAR>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @CLEAR(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
void account_user_time_scaled(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<account_user_time_scaled>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<account_user_time_scaled>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.account_user_time_scaled = [25 x i8] c"account_user_time_scaled\00"
define void @account_user_time_scaled() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__func__.account_user_time_scaled, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.account_user_time_scaled = [25 x i8] c"account_user_time_scaled\00"
define void @account_user_time_scaled() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__func__.account_user_time_scaled, i64 0, i64 0))
ret void
}
int dbg_check_lprops(struct ubifs_info *c) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define i32 @dbg_check_lprops(%struct.ubifs_info* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int __mulsi3(int, int);
int __mulhi3(int op1, int op2) { return __mulsi3(op1, op2); }


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

x86 assembly (clang, -O2):
<__mulhi3>:
jmp    1030 <__mulsi3@plt>

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

LLVM IR (-O2):
define i32 @__mulhi3(i32 %0, i32 %1) {
%3 = tail call i32 @__mulsi3(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_where_to_parameter_dictionary();
int main() {
  test_where_to_parameter_dictionary();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_where_to_parameter_dictionary()
ret i32 0
}
unsigned long http_parser_version(void) {
  return 2 * 0x10000 | 6 * 0x00100 | 2 * 0x00001;
}


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

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

LLVM IR (-O0):
define i64 @http_parser_version() {
ret i64 132610
}

LLVM IR (-O2):
define i64 @http_parser_version() {
ret i64 132610
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f6(long j) {
  if ((j & ((1UL << (6)) - 1)) >= ((1UL << ((6) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3f,%rax
cmp    $0x22,%rax
jb     1135 <f6+0x25>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
and    $0x3e,%edi
cmp    $0x22,%edi
jae    1119 <f6+0x9>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f6(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 63
%5 = icmp uge i64 %4, 34
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f6(i64 %0) {
%2 = and i64 %0, 62
%3 = icmp ugt i64 %2, 33
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
char *strchr(char *, char);
int gopal_check_line(char *line) {
  char *c = line;
  int i = 0;
  while ((c = strchr(c, ','))) {
    c++;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<gopal_check_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1161 <gopal_check_line+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <gopal_check_line+0x1b>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gopal_check_line>:
push   %rbx
mov    $0x2c,%esi
call   1030 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1149 <gopal_check_line+0x39>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rax
add    $0x1,%ebx
mov    %rax,%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <gopal_check_line+0x20>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @gopal_check_line(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 44)
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %9, %4 ], [ %2, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add nuw nsw i32 %6, 1
%9 = tail call i8* @strchr(i8* dereferenceable(1) %7, i8 signext 44)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void rop3_63_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = T & S;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


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

x86 assembly (clang, -O2):
<rop3_63_1_0>:
not    %sil
or     %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_63_1_0(i8* %0, i8 zeroext %1, i8 zeroext %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* %6
%9 = zext i8 %8 to i32
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = and i32 %9, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %7
%14 = load i8, i8* %7
%15 = zext i8 %14 to i32
%16 = xor i32 %15, -1
%17 = trunc i32 %16 to i8
store i8 %17, i8* %7
%18 = load i8, i8* %7
%19 = zext i8 %18 to i32
%20 = load i8, i8* %5
%21 = zext i8 %20 to i32
%22 = xor i32 %21, -1
%23 = and i32 %19, %22
%24 = load i8*, i8** %4
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = load i8, i8* %5
%28 = zext i8 %27 to i32
%29 = and i32 %26, %28
%30 = or i32 %23, %29
%31 = trunc i32 %30 to i8
%32 = load i8*, i8** %4
store i8 %31, i8* %32
ret void
}

LLVM IR (-O2):
define void @rop3_63_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void stop(void) { printf("\n"); }


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

x86 assembly (clang, -O2):
<stop>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @stop() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
void foo(volatile int *p) { p[0] = 0; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @foo(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store volatile i32 0, i32* %4
ret void
}

LLVM IR (-O2):
define void @foo(i32* %0) {
store volatile i32 0, i32* %0
ret void
}
int hexVal(char symbol) {
  if (symbol >= 'a' && symbol <= 'f') {
    switch (symbol) {
    case 'a':
      return 10;
      break;
    case 'b':
      return 11;
      break;
    case 'c':
      return 12;
      break;
    case 'd':
      return 13;
      break;
    case 'e':
      return 14;
      break;
    case 'f':
      return 15;
      break;
    }
  } else {
    return symbol - '0';
  }
  return 1;
}


x86 assembly (clang, -O0):
<hexVal>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     119b <hexVal+0x9b>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     119b <hexVal+0x9b>
movsbl -0x5(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1196 <hexVal+0x96>
mov    -0x10(%rbp),%rax
lea    0xebb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xa,-0x4(%rbp)
jmp    11b1 <hexVal+0xb1>
movl   $0xb,-0x4(%rbp)
jmp    11b1 <hexVal+0xb1>
movl   $0xc,-0x4(%rbp)
jmp    11b1 <hexVal+0xb1>
movl   $0xd,-0x4(%rbp)
jmp    11b1 <hexVal+0xb1>
movl   $0xe,-0x4(%rbp)
jmp    11b1 <hexVal+0xb1>
movl   $0xf,-0x4(%rbp)
jmp    11b1 <hexVal+0xb1>
jmp    11aa <hexVal+0xaa>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    11b1 <hexVal+0xb1>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexVal>:
lea    -0x61(%rdi),%eax
cmp    $0x5,%al
ja     1119 <hexVal+0x19>
lea    -0x61(%rdi),%eax
add    $0xffffffa9,%edi
cmp    $0x6,%eax
mov    $0x1,%eax
cmovb  %edi,%eax
ret
add    $0xffffffd0,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @hexVal(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %21
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 102
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
switch i32 %13, label %20 [
i32 97, label %14
i32 98, label %15
i32 99, label %16
i32 100, label %17
i32 101, label %18
i32 102, label %19
]
14: ; preds = %11
store i32 10, i32* %2
br label %26
15: ; preds = %11
store i32 11, i32* %2
br label %26
16: ; preds = %11
store i32 12, i32* %2
br label %26
17: ; preds = %11
store i32 13, i32* %2
br label %26
18: ; preds = %11
store i32 14, i32* %2
br label %26
19: ; preds = %11
store i32 15, i32* %2
br label %26
20: ; preds = %11
br label %25
21: ; preds = %7, %1
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, 48
store i32 %24, i32* %2
br label %26
25: ; preds = %20
store i32 1, i32* %2
br label %26
26: ; preds = %25, %21, %19, %18, %17, %16, %15, %14
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @hexVal(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -97
%4 = icmp ult i8 %3, 6
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = add nsw i32 %2, -97
%7 = icmp ult i32 %6, 6
%8 = add nsw i32 %2, -87
%9 = select i1 %7, i32 %8, i32 1
br label %12
10: ; preds = %1
%11 = add nsw i32 %2, -48
br label %12
12: ; preds = %5, %10
%13 = phi i32 [ %11, %10 ], [ %9, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned char const);
int /*<<< orphan*/ stderr;
void dump_hex(const unsigned char *buf, unsigned int len) {
  unsigned int i;
  for (i = 0; i < len; i++) {
    fprintf(stderr, "%02x ", buf[i]);
  }
}


x86 assembly (clang, -O0):
<dump_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1160 <dump_hex+0x50>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
lea    0xeb7(%rip),%rsi
movzbl (%rax,%rcx,1),%edx
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <dump_hex+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_hex>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %esi,%esi
je     115a <dump_hex+0x4a>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
mov    0x2eb4(%rip),%r13
lea    0xecd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x0(%r13),%edi
movzbl (%r15,%rbx,1),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <dump_hex+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%02x \00"
define void @dump_hex(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%02x \00"
define void @dump_hex(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = load i32, i32* @stderr
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ menu();
int main(int argc, char const *argv[]) {
  menu();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @menu()
ret i32 0
}
unsigned long long counter_diff(unsigned long long new,
                                unsigned long long old) {
  return new - old;
}


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

x86 assembly (clang, -O2):
<counter_diff>:
mov    %rdi,%rax
sub    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @counter_diff(i64 %0, i64 %1) {
%3 = sub i64 %0, %1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void maintenance() { printf(" :: M A I N T E N A N C E :: \n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c" :: M A I N T E N A N C E :: \0A\00"
define void @maintenance() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c" :: M A I N T E N A N C E :: \00"
define void @maintenance() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, char *, char *);
int main(void) {
  syscall(548, "dragoncopy.c", "dragoncopy.copy");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xeee(%rip),%rdx
mov    $0x224,%edi
call   1030 <syscall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"dragoncopy.c\00"
@.str.1 = [16 x i8] c"dragoncopy.copy\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @syscall(i32 548, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"dragoncopy.c\00"
@.str.1 = [16 x i8] c"dragoncopy.copy\00"
define i32 @main() {
%1 = tail call i32 @syscall(i32 548, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int vperfctr_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @vperfctr_init() {
ret i32 0
}
void f1(char *p) { __builtin_memcpy(p, "123", 3); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xeed(%rip),%cx
mov    %cx,(%rax)
mov    0xee6(%rip),%cl
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
movb   $0x33,0x2(%rdi)
movw   $0x3231,(%rdi)
ret

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
define void @f1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
define void @f1(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %0, i8* align 1 dereferenceable(3) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i1 false)
ret void
}
/* Variables and functions */
int drand48();
int getRandWord() { return (int)(drand48() * 65535); }


x86 assembly (clang, -O0):
<getRandWord>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <drand48@plt>
imul   $0xffff,%eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandWord>:
push   %rax
xor    %eax,%eax
call   1030 <drand48@plt>
mov    %eax,%ecx
shl    $0x10,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getRandWord() {
%1 = call i32 (...) @drand48()
%2 = mul nsw i32 %1, 65535
ret i32 %2
}

LLVM IR (-O2):
define i32 @getRandWord() {
%1 = tail call i32 (...) @drand48()
%2 = mul nsw i32 %1, 65535
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
char *realloc(char *, int /*<<< orphan*/);
void reallocSizeZero1() {
  char *p = malloc(12);
  char *r = realloc(p, 0);
  if (!r) {
    free(p);
  } else {
    free(r);
  }
}


x86 assembly (clang, -O0):
<reallocSizeZero1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1050 <realloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <reallocSizeZero1+0x3e>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
jmp    1177 <reallocSizeZero1+0x47>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocSizeZero1>:
push   %rbx
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   1050 <realloc@plt>
test   %rax,%rax
je     1156 <reallocSizeZero1+0x26>
mov    %rax,%rdi
pop    %rbx
jmp    1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @reallocSizeZero1() {
%1 = tail call dereferenceable_or_null(12) i8* @malloc(i32 12)
%2 = tail call i8* @realloc(i8* %1, i32 0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @free(i8* %1)
br label %8
6: ; preds = %0
%7 = tail call i32 @free(i8* %2)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR71_get(void) { return U_WMRCORENONE_get("U_WMR71"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR71\00"
define i32 @U_WMR71_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR71\00"
define i32 @U_WMR71_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
BOOST_AUTO_TEST_CASE(sec) { TESTCASE1(sec, 0, 1); }


x86 assembly (clang, -O0):
<BOOST_AUTO_TEST_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <TESTCASE1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
xor    %esi,%esi
mov    $0x1,%edx
xor    %eax,%eax
jmp    1030 <TESTCASE1@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %4, i32 0, i32 1)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 0, i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ test01(unsigned int, unsigned int);
int /*<<< orphan*/ test02(int, int);
int main(int argc, char *argv[]) {
  unsigned x = 0x80000000;
  test01(x + 5, x);
  test02(14, 16);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x80000000,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x5,%edi
mov    -0x14(%rbp),%esi
call   1030 <test01@plt>
mov    $0xe,%edi
mov    $0x10,%esi
call   1040 <test02@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x80000005,%edi
mov    $0x80000000,%esi
call   1030 <test01@plt>
mov    $0xe,%edi
mov    $0x10,%esi
call   1040 <test02@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -2147483648, i32* %6
%7 = load i32, i32* %6
%8 = add i32 %7, 5
%9 = load i32, i32* %6
%10 = call i32 @test01(i32 %8, i32 %9)
%11 = call i32 @test02(i32 14, i32 16)
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test01(i32 -2147483643, i32 -2147483648)
%4 = tail call i32 @test02(i32 14, i32 16)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct libjte_env {
  int dummy;
};

/* Variables and functions */
int jtwrite(struct libjte_env *, void *, int, int);
int libjte_write_unmatched(struct libjte_env *o, void *buffer, int size,
                           int count) {
  int ret;
  ret = jtwrite(o, buffer, size, count);
  return ret;
}


x86 assembly (clang, -O0):
<libjte_write_unmatched>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <jtwrite@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libjte_write_unmatched>:
jmp    1030 <jtwrite@plt>

LLVM IR (-O0):
%struct.libjte_env = type { i32 }
define i32 @libjte_write_unmatched(%struct.libjte_env* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca %struct.libjte_env*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store %struct.libjte_env* %0, %struct.libjte_env** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load %struct.libjte_env*, %struct.libjte_env** %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @jtwrite(%struct.libjte_env* %10, i8* %11, i32 %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
%struct.libjte_env = type { i32 }
define i32 @libjte_write_unmatched(%struct.libjte_env* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @jtwrite(%struct.libjte_env* %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
int test_imm_8Fint64_lowword_reg(long long val) {
  return ((val) & (0x8F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_8Fint64_lowword_reg>:
test   $0x8f,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Fint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 143
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int create_ll_flag(int favor) { return ((favor << 1) & ((1 << 1) | (1 << 2))); }


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

x86 assembly (clang, -O2):
<create_ll_flag>:
lea    (%rdi,%rdi,1),%eax
and    $0x6,%eax
ret

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

LLVM IR (-O2):
define i32 @create_ll_flag(i32 %0) {
%2 = shl i32 %0, 1
%3 = and i32 %2, 6
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage() {
  fprintf(stderr, "Lindeberg convolution  \n");
  fprintf(stderr,
          "     gaussconv_lindeberg in sigma gamma(laplacian scheme) out  \n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeea(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Lindeberg convolution \0A\00"
@.str.1 = [65 x i8] c" gaussconv_lindeberg in sigma gamma(laplacian scheme) out \0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Lindeberg convolution \0A\00"
@.str.1 = [65 x i8] c" gaussconv_lindeberg in sigma gamma(laplacian scheme) out \0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long __raw_local_save_flags();
int /*<<< orphan*/ trace_hardirqs_fixup_flags(unsigned long);
void trace_hardirqs_fixup(void) {
  unsigned long flags = __raw_local_save_flags();
  trace_hardirqs_fixup_flags(flags);
}


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

x86 assembly (clang, -O2):
<trace_hardirqs_fixup>:
push   %rax
xor    %eax,%eax
call   1030 <__raw_local_save_flags@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <trace_hardirqs_fixup_flags@plt>

LLVM IR (-O0):
define void @trace_hardirqs_fixup() {
%1 = alloca i64
%2 = call i64 (...) @__raw_local_save_flags()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = call i32 @trace_hardirqs_fixup_flags(i64 %3)
ret void
}

LLVM IR (-O2):
define void @trace_hardirqs_fixup() {
%1 = tail call i64 (...) @__raw_local_save_flags()
%2 = tail call i32 @trace_hardirqs_fixup_flags(i64 %1)
ret void
}
/* Variables and functions */
double sin(int);
double sin_x_plus_sin_2x(double x) { return sin(x) + sin(2 * x); }


x86 assembly (clang, -O0):
<sin_x_plus_sin_2x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%edi
call   1030 <sin@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin_x_plus_sin_2x>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @sin_x_plus_sin_2x(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = call double @sin(i32 %4)
%6 = load double, double* %2
%7 = fmul double 2.000000e+00, %6
%8 = fptosi double %7 to i32
%9 = call double @sin(i32 %8)
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
define double @sin_x_plus_sin_2x(double %0) {
%2 = fptosi double %0 to i32
%3 = tail call double @sin(i32 %2)
%4 = fmul double %0, 2.000000e+00
%5 = fptosi double %4 to i32
%6 = tail call double @sin(i32 %5)
%7 = fadd double %3, %6
ret double %7
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t int_to_bcd2(unsigned int x) {
  return (((x / 10) << 4) & 0xf0) | (x % 10);
}


x86 assembly (clang, -O0):
<int_to_bcd2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
shl    $0x4,%eax
and    $0xf0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    -0x8(%rbp),%eax
or     %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_bcd2>:
mov    %edi,%eax
mov    $0xcccccccd,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
mov    %ecx,%eax
shl    $0x4,%eax
movzbl %al,%eax
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @int_to_bcd2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = udiv i32 %3, 10
%5 = shl i32 %4, 4
%6 = and i32 %5, 240
%7 = load i32, i32* %2
%8 = urem i32 %7, 10
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @int_to_bcd2(i32 %0) {
%2 = udiv i32 %0, 10
%3 = shl i32 %2, 4
%4 = and i32 %3, 240
%5 = urem i32 %0, 10
%6 = or i32 %4, %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int feof(int /*<<< orphan*/ *);
int fileEOF(void *h) {
  FILE *f = (FILE *)h;
  return feof(f);
}


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

x86 assembly (clang, -O2):
<fileEOF>:
jmp    1030 <feof@plt>

LLVM IR (-O0):
define i32 @fileEOF(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @feof(i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @fileEOF(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @feof(i32* %2)
ret i32 %3
}
/* Variables and functions */
int mem_get_be16_as_int(unsigned char const *);
signed int mem_get_sbe16_as_int(const void *vmem) {
  const unsigned char *mem = (const unsigned char *)vmem;
  signed int val = mem_get_be16_as_int(mem);
  return (val << ((sizeof(int) << 3) - 16)) >> ((sizeof(int) << 3) - 16);
}


x86 assembly (clang, -O0):
<mem_get_sbe16_as_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <mem_get_be16_as_int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x10,%eax
sar    $0x10,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_get_sbe16_as_int>:
push   %rax
call   1030 <mem_get_be16_as_int@plt>
cwtl
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mem_get_sbe16_as_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @mem_get_be16_as_int(i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = shl i32 %8, 16
%10 = ashr i32 %9, 16
ret i32 %10
}

LLVM IR (-O2):
define i32 @mem_get_sbe16_as_int(i8* %0) {
%2 = tail call i32 @mem_get_be16_as_int(i8* %0)
%3 = shl i32 %2, 16
%4 = ashr exact i32 %3, 16
ret i32 %4
}
int Isleap(int year) {
  if (((year % 4) == 0 && (year % 100) != 0) || (year % 400 == 0)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<Isleap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112f <Isleap+0x2f>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1143 <Isleap+0x43>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <Isleap+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <Isleap+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Isleap>:
test   $0x3,%dil
sete   %al
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
cmp    $0x28f5c29,%edx
setae  %dl
and    %al,%dl
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
setb   %al
or     %dl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @Isleap(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 100
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7, %1
%12 = load i32, i32* %3
%13 = srem i32 %12, 400
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11, %7
store i32 1, i32* %2
br label %17
16: ; preds = %11
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @Isleap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp ne i32 %4, 0
%6 = and i1 %3, %5
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}