xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void default_cb_info1(const void *data, const void *ip, int length, int port) {
  printf("default_cb_info1\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"default_cb_info1\0A\00"
define void @default_cb_info1(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"default_cb_info1\00"
define void @default_cb_info1(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
int print_game(struct game *fg) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.game = type opaque
define i32 @print_game(%struct.game* nocapture readnone %0) {
ret i32 0
}
int main() { return 0UL >= 1UL; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void test__toupper_macro(void) {
  int i, j;
  for (i = -127; i < 256;)
    j = i, printf("%s: %d -> %d\n", __FUNCTION__, j, _toupper(i++));
}


x86 assembly (clang, -O0):
<test__toupper_macro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffff81,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1179 <test__toupper_macro+0x59>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <_toupper@plt>
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xe9a(%rip),%rdi
lea    0xea1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <test__toupper_macro+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test__toupper_macro>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0xffffff81,%ebx
lea    0xecd(%rip),%r14
lea    0xed4(%rip),%r15
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ebp
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <_toupper@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%ebx
cmp    $0x100,%ebp
jne    1140 <test__toupper_macro+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test__toupper_macro = [20 x i8] c"test__toupper_macro\00"
define void @test__toupper_macro() {
%1 = alloca i32
%2 = alloca i32
store i32 -127, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = call i32 (i32, ...) bitcast (i32 (...)* @_toupper to i32 (i32, ...)*)(i32 %9)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.test__toupper_macro, i64 0, i64 0), i32 %8, i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test__toupper_macro = [20 x i8] c"test__toupper_macro\00"
define void @test__toupper_macro() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -127, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, 1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @_toupper to i32 (i32, ...)*)(i32 %2)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.test__toupper_macro, i64 0, i64 0), i32 %2, i32 %4)
%6 = icmp eq i32 %3, 256
br i1 %6, label %7, label %1
7: ; preds = %1
ret void
}
void FileSpecInit() { ; }


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

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

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

LLVM IR (-O2):
define void @FileSpecInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ updater_unload();
void __attribute__((destructor)) library_unload(void) { updater_unload(); }


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @library_unload, i8* null }]
define void @library_unload() {
%1 = call i32 (...) @updater_unload()
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @library_unload, i8* null }]
define void @library_unload() {
%1 = tail call i32 (...) @updater_unload()
ret void
}
/* Variables and functions */
scalar_t__ strstr(char *, char *);
int BuscarCadena(char *cadena1, char *cadena2) {
  if (strstr(cadena1, cadena2))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<BuscarCadena>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1143 <BuscarCadena+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <BuscarCadena+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BuscarCadena>:
push   %rax
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @BuscarCadena(i8* %0, i8* %1) {
%3 = tail call i64 @strstr(i8* %0, i8* %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void reset(int arr[10]) {
  int i;
  arr[0] = 1;
  for (i = 1; i < 11; i++)
    arr[i] = 0;
  return;
}


x86 assembly (clang, -O0):
<reset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x1,-0xc(%rbp)
cmpl   $0xb,-0xc(%rbp)
jge    1140 <reset+0x40>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <reset+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset>:
movl   $0x1,(%rdi)
xorps  %xmm0,%xmm0
movups %xmm0,0x4(%rdi)
movups %xmm0,0x14(%rdi)
movq   $0x0,0x24(%rdi)
ret

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

LLVM IR (-O2):
define void @reset(i32* nocapture writeonly %0) {
store i32 1, i32* %0
%2 = getelementptr i32, i32* %0, i64 1
%3 = bitcast i32* %2 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("Usage: bcmp file1 file2\n"); }


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

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

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

LLVM IR (-O2):
@str = [24 x i8] c"Usage: bcmp file1 file2\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double cos(double);
int /*<<< orphan*/ printf(char *, double, double);
int main() {
  printf("The cosine of %f is %f.\n", 0.5, cos(0.5));
  printf("The cosine of %f is %f.\n", 1.0, cos(1.0));
  printf("The cosine of %f is %f.\n", -1.0, cos(-1.0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
lea    0xed2(%rip),%rdi
movsd  0xec2(%rip),%xmm0
call   1030 <printf@plt>
movsd  0xead(%rip),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
lea    0xeae(%rip),%rdi
movsd  0xe96(%rip),%xmm0
call   1030 <printf@plt>
movsd  0xe81(%rip),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
lea    0xe8a(%rip),%rdi
movsd  0xe6a(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf10(%rip),%rbx
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xed8(%rip),%xmm0
movsd  0xed8(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xed0(%rip),%xmm0
mov    %rbx,%rdi
movsd  0xebd(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"The cosine of %f is %f.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @cos(double 5.000000e-01)
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double 5.000000e-01, double %2)
%4 = call double @cos(double 1.000000e+00)
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double 1.000000e+00, double %4)
%6 = call double @cos(double -1.000000e+00)
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double -1.000000e+00, double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"The cosine of %f is %f.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double 5.000000e-01, double 0x3FEC1528065B7D50)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double 1.000000e+00, double 0x3FE14A280FB5068C)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double -1.000000e+00, double 0x3FE14A280FB5068C)
ret i32 0
}
/* Variables and functions */
char *getenv(char const *);
int testenv(const char *e) {
  char *c = getenv(e);
  return c && *c && *c != '0' && *c != 'n';
}


x86 assembly (clang, -O0):
<testenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1173 <testenv+0x63>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1173 <testenv+0x63>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x11(%rbp)
je     1173 <testenv+0x63>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6e,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testenv>:
push   %rax
call   1030 <getenv@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     112b <testenv+0x1b>
mov    (%rcx),%cl
test   %cl,%cl
je     112b <testenv+0x1b>
cmp    $0x30,%cl
jne    112d <testenv+0x1d>
pop    %rcx
ret
xor    %eax,%eax
cmp    $0x6e,%cl
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @testenv(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @getenv(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %23
8: ; preds = %1
%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 ne i32 %16, 48
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 110
br label %23
23: ; preds = %18, %13, %8, %1
%24 = phi i1 [ false, %13 ], [ false, %8 ], [ false, %1 ], [ %22, %18 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @testenv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i8, i8* %2
switch i8 %5, label %6 [
i8 0, label %9
i8 48, label %9
]
6: ; preds = %4
%7 = icmp ne i8 %5, 110
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %4, %6, %1
%10 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %8, %6 ], [ 0, %4 ]
ret i32 %10
}
void sum(int1, int2, int3) {
  int total = int1 + int2 + int3;
  printf("The sum of these numbers is %d.\n", total);
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
add    %edi,%esi
add    %edx,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"The sum of these numbers is %d.\0A\00"
define void @sum(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = add nsw i32 %8, %9
%11 = load i32, i32* %6
%12 = add nsw i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"The sum of these numbers is %d.\0A\00"
define void @sum(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
scalar_t__ init_test();
int /*<<< orphan*/ print_pages(int);
int main() {
  assert(init_test() == 0 && "Could not initialize.");
  print_pages(1024);
  print_pages(2048);
  print_pages(4096);
  print_pages(8192);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <init_test@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1162 <main+0x32>
mov    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1162 <main+0x32>
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x400,%edi
call   1030 <print_pages@plt>
mov    $0x800,%edi
call   1030 <print_pages@plt>
mov    $0x1000,%edi
call   1030 <print_pages@plt>
mov    $0x2000,%edi
call   1030 <print_pages@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <init_test@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    $0x400,%edi
call   1030 <print_pages@plt>
mov    $0x800,%edi
call   1030 <print_pages@plt>
mov    $0x1000,%edi
call   1030 <print_pages@plt>
mov    $0x2000,%edi
call   1030 <print_pages@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Could not initialize.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @init_test()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
br label %5
5: ; preds = %4, %0
%6 = phi i1 [ false, %0 ], [ true, %4 ]
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @print_pages(i32 1024)
%10 = call i32 @print_pages(i32 2048)
%11 = call i32 @print_pages(i32 4096)
%12 = call i32 @print_pages(i32 8192)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @init_test()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @print_pages(i32 1024)
%6 = tail call i32 @print_pages(i32 2048)
%7 = tail call i32 @print_pages(i32 4096)
%8 = tail call i32 @print_pages(i32 8192)
ret i32 0
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main() {
  int iam, np, i;
#pragma omp parallel private(iam, np, i)
  {
#pragma omp critical
    {
      iam = omp_get_thread_num();
      printf("Soy el thread %d al inicio de la seccion critica\n", iam);
      sleep(1);
      printf("\t\tSoy el thread %d al final de la seccion critica\n", iam);
    }
  }
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    0xed9(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [50 x i8] c"Soy el thread %d al inicio de la seccion critica\0A\00"
@.str.1 = [51 x i8] c"\09\09Soy el thread %d al final de la seccion critica\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @omp_get_thread_num()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @sleep(i32 1)
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [50 x i8] c"Soy el thread %d al inicio de la seccion critica\0A\00"
@.str.1 = [51 x i8] c"\09\09Soy el thread %d al final de la seccion critica\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct Cyc_List_List {
  int dummy;
};
struct Cyc_IOEffect_Fenv {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_IOEffect___check_access(struct Cyc_IOEffect_Fenv *,
                                               unsigned int,
                                               struct Cyc_List_List *, void *,
                                               int /*<<< orphan*/);
void Cyc_IOEffect_check_access(struct Cyc_IOEffect_Fenv *fe, unsigned loc,
                               struct Cyc_List_List *f, void *t) {
  ({ Cyc_IOEffect___check_access(fe, loc, f, t, 0); });
}


x86 assembly (clang, -O0):
<Cyc_IOEffect_check_access>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <Cyc_IOEffect___check_access@plt>
mov    %eax,-0x24(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_IOEffect_check_access>:
xor    %r8d,%r8d
jmp    1030 <Cyc_IOEffect___check_access@plt>

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

LLVM IR (-O2):
%struct.Cyc_IOEffect_Fenv = type { i32 }
%struct.Cyc_List_List = type { i32 }
define void @Cyc_IOEffect_check_access(%struct.Cyc_IOEffect_Fenv* %0, i32 %1, %struct.Cyc_List_List* %2, i8* %3) {
%5 = tail call i32 @Cyc_IOEffect___check_access(%struct.Cyc_IOEffect_Fenv* %0, i32 %1, %struct.Cyc_List_List* %2, i8* %3, i32 0)
ret void
}
double dtrunc(double x) {
  int k;
  k = (int)x;
  x = (double)k;
  return x;
}


x86 assembly (clang, -O0):
<dtrunc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtrunc>:
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @dtrunc(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
ret double %3
}
void kfd_iommu_suspend(struct kfd_dev *kfd) {}


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

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

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

LLVM IR (-O2):
%struct.kfd_dev = type opaque
define void @kfd_iommu_suspend(%struct.kfd_dev* nocapture %0) {
ret void
}
void pendfunc2(int x) {}


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

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

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

LLVM IR (-O2):
define void @pendfunc2(i32 %0) {
ret void
}
/* Variables and functions */
double cs_strtod(char const *, char **);
void parse_number(const char *s, const char **end, double *num) {
  *num = cs_strtod(s, (char **)end);
}


x86 assembly (clang, -O0):
<parse_number>:
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
call   1030 <cs_strtod@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_number>:
push   %rbx
mov    %rdx,%rbx
call   1030 <cs_strtod@plt>
movsd  %xmm0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @parse_number(i8* %0, i8** %1, double* nocapture writeonly %2) {
%4 = tail call double @cs_strtod(i8* %0, i8** %1)
store double %4, double* %2
ret void
}
int lis3l02dq_configure_ring(struct iio_dev *indio_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @lis3l02dq_configure_ring(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
void rdp_sec_make_40bit(char *key) {
  key[0] = 0xd1;
  key[1] = 0x26;
  key[2] = 0x9e;
}


x86 assembly (clang, -O0):
<rdp_sec_make_40bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0xd1,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x26,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x9e,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdp_sec_make_40bit>:
movw   $0x26d1,(%rdi)
movb   $0x9e,0x2(%rdi)
ret

LLVM IR (-O0):
define void @rdp_sec_make_40bit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 -47, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 38, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
store i8 -98, i8* %8
ret void
}

LLVM IR (-O2):
define void @rdp_sec_make_40bit(i8* nocapture writeonly %0) {
store i8 -47, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 38, i8* %2
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 -98, i8* %3
ret void
}
void ami_ctxmenu_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ami_ctxmenu_init() {
ret void
}
_Complex int cplx3(int r) { return r + 2i; }


x86 assembly (clang, -O0):
<cplx3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x8(%rbp)
movl   $0x2,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cplx3>:
mov    %edi,%ecx
movabs $0x200000000,%rax
or     %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @cplx3(i32 %0) {
%2 = zext i32 %0 to i64
%3 = or i64 %2, 8589934592
ret i64 %3
}
char *langRomTypeObsonet() { return "Obsonet"; }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Obsonet\00"
define i8* @langRomTypeObsonet() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"Obsonet\00"
define i8* @langRomTypeObsonet() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
int am_close_index(int AM_fd) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @am_close_index(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int a[], int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%3d\n", a[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
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
jge    1159 <print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%3d\0A\00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int lmsc_get_mnt_dev(const char *mtpt, char *outbuf, size_t path_max) {
  const char *want_mtpt = mtpt;
  return -1;
}


x86 assembly (clang, -O0):
<lmsc_get_mnt_dev>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @lmsc_get_mnt_dev(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
store i8* %8, i8** %7
ret i32 -1
}

LLVM IR (-O2):
define i32 @lmsc_get_mnt_dev(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *);
char *strdup(char const *);
char *xstrdup(const char *str) {
  char *p;
  if (str == NULL)
    return NULL;
  p = strdup(str);
  if (p == NULL)
    error(EXIT_FAILURE, errno, "strdup");
  return p;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <xstrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1182 <xstrdup+0x62>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117a <xstrdup+0x5a>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
mov    0x2e74(%rip),%rax
mov    (%rax),%esi
lea    0xe8b(%rip),%rdx
call   1030 <error@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
test   %rdi,%rdi
je     1150 <xstrdup+0x30>
call   1040 <strdup@plt>
test   %rax,%rax
je     1132 <xstrdup+0x12>
pop    %rcx
ret
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdx
call   1030 <error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [7 x i8] c"strdup\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %19
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @strdup(i8* %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %8
%14 = load i32, i32* @EXIT_FAILURE
%15 = load i32, i32* @errno
%16 = call i32 @error(i32 %14, i32 %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %13, %8
%18 = load i8*, i8** %4
store i8* %18, i8** %2
br label %19
19: ; preds = %17, %7
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [7 x i8] c"strdup\00"
define noalias i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @EXIT_FAILURE
%8 = load i32, i32* @errno
%9 = tail call i32 @error(i32 %7, i32 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %3, %6, %1
%11 = phi i8* [ null, %1 ], [ null, %6 ], [ %4, %3 ]
ret i8* %11
}
int squashfs_2_0_supported(struct squashfs_sb_info *msblk) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.squashfs_sb_info = type opaque
define i32 @squashfs_2_0_supported(%struct.squashfs_sb_info* nocapture readnone %0) {
ret i32 0
}
void _dl_parse_lazy_relocation_information(struct dyn_elf *rpnt,
                                           unsigned long rel_addr,
                                           unsigned long rel_size) {
  return;
}


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

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

LLVM IR (-O0):
%struct.dyn_elf = type opaque
define void @_dl_parse_lazy_relocation_information(%struct.dyn_elf* %0, i64 %1, i64 %2) {
%4 = alloca %struct.dyn_elf*
%5 = alloca i64
%6 = alloca i64
store %struct.dyn_elf* %0, %struct.dyn_elf** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
%struct.dyn_elf = type opaque
define void @_dl_parse_lazy_relocation_information(%struct.dyn_elf* nocapture %0, i64 %1, i64 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ func(int, int, int, int);
int /*<<< orphan*/ pass(char *);
int /*<<< orphan*/ stdout;
void main() {
  func(2, 1., 2., 3.);
  pass("func [OKI002]");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edx
mov    $0x1,%esi
mov    $0x3,%ecx
mov    %edx,%edi
call   1040 <func@plt>
lea    0xeaf(%rip),%rdi
call   1030 <pass@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1040 <func@plt>
lea    0xeaf(%rip),%rdi
call   1030 <pass@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"func [OKI002]\00"
@stdout = global i32 0
define void @main() {
%1 = call i32 @func(i32 2, i32 1, i32 2, i32 3)
%2 = call i32 @pass(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"func [OKI002]\00"
@stdout = global i32 0
define void @main() {
%1 = tail call i32 @func(i32 2, i32 1, i32 2, i32 3)
%2 = tail call i32 @pass(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main(int argc, char **argv) {
  int i;
  int *a;
  for (i = 0; i < 10; i++) {
    a = malloc(sizeof(int) * 100);
  }
  free(a);
  return 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   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1163 <main+0x43>
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@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**
%6 = alloca i32
%7 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %8
8: ; preds = %13, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = call i32* @malloc(i32 400)
store i32* %12, i32** %7
br label %13
13: ; preds = %11
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
br label %8
16: ; preds = %8
%17 = load i32*, i32** %7
%18 = call i32 @free(i32* %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @malloc(i32 400)
%4 = tail call i32* @malloc(i32 400)
%5 = tail call i32* @malloc(i32 400)
%6 = tail call i32* @malloc(i32 400)
%7 = tail call i32* @malloc(i32 400)
%8 = tail call i32* @malloc(i32 400)
%9 = tail call i32* @malloc(i32 400)
%10 = tail call i32* @malloc(i32 400)
%11 = tail call i32* @malloc(i32 400)
%12 = tail call i32* @malloc(i32 400)
%13 = tail call i32 @free(i32* %12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void handler(int sig) {
  printf("Signal received %d\n", sig);
  _exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Signal received %d\0A\00"
@EXIT_SUCCESS = global i32 0
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @_exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"Signal received %d\0A\00"
@EXIT_SUCCESS = global i32 0
define void @handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @_exit(i32 %3)
unreachable
}
char compare(int i, int j) {
  if (i > j)
    return 1;
  else if (j == i)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    111f <compare+0x1f>
movb   $0x1,-0x1(%rbp)
jmp    1138 <compare+0x38>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1134 <compare+0x34>
movb   $0x0,-0x1(%rbp)
jmp    1138 <compare+0x38>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
cmp    %edi,%esi
setne  %al
neg    %al
cmp    %esi,%edi
movzbl %al,%ecx
mov    $0x1,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @compare(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = icmp ne i32 %1, %0
%5 = sext i1 %4 to i8
%6 = select i1 %3, i8 1, i8 %5
ret i8 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ z_stream;

/* Variables and functions */
int /*<<< orphan*/ Z_DEFAULT_COMPRESSION;
int /*<<< orphan*/ deflateInit(int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  z_stream zs;
  deflateInit(&zs, Z_DEFAULT_COMPRESSION);
  return 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)
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
lea    -0x14(%rbp),%rdi
call   1030 <deflateInit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdi
call   1030 <deflateInit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@Z_DEFAULT_COMPRESSION = global i32 0
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
%7 = load i32, i32* @Z_DEFAULT_COMPRESSION
%8 = call i32 @deflateInit(i32* %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@Z_DEFAULT_COMPRESSION = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* @Z_DEFAULT_COMPRESSION
%6 = call i32 @deflateInit(i32* %3, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
void free_array_of_charptr_excl(char ***arr) { free(*arr); }


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

x86 assembly (clang, -O2):
<free_array_of_charptr_excl>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_array_of_charptr_excl(i8*** %0) {
%2 = alloca i8***
store i8*** %0, i8**** %2
%3 = load i8***, i8**** %2
%4 = load i8**, i8*** %3
%5 = call i32 @free(i8** %4)
ret void
}

LLVM IR (-O2):
define void @free_array_of_charptr_excl(i8*** nocapture %0) {
%2 = load i8**, i8*** %0
%3 = tail call i32 @free(i8** %2)
ret void
}
__attribute__((section(".after_vectors.init_bss"))) void
bss_init(unsigned int start, unsigned int len) {
  unsigned int *pulDest = (unsigned int *)start;
  unsigned int loop;
  for (loop = 0; loop < len; loop = loop + 4)
    *pulDest++ = 0;
}


x86 assembly (clang, -O0):
<bss_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1147 <bss_init+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
movl   $0x0,(%rax)
mov    -0x14(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <bss_init+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bss_init>:
test   %esi,%esi
je     112e <bss_init+0x1e>
push   %rax
mov    %esi,%edx
mov    %edi,%edi
add    $0xffffffff,%edx
and    $0xfffffffc,%edx
add    $0x4,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @bss_init(i32 %0, i32 %1) section ".after_vectors.init_bss" {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
store i32 0, i32* %6
br label %10
10: ; preds = %17, %2
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = icmp ult i32 %11, %12
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i32 1
store i32* %16, i32** %5
store i32 0, i32* %15
br label %17
17: ; preds = %14
%18 = load i32, i32* %6
%19 = add i32 %18, 4
store i32 %19, i32* %6
br label %10
20: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @bss_init(i32 %0, i32 %1) section ".after_vectors.init_bss" {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
%6 = inttoptr i64 %5 to i8*
%7 = add i32 %1, -1
%8 = and i32 %7, -4
%9 = zext i32 %8 to i64
%10 = add nuw nsw i64 %9, 4
br label %11
11: ; preds = %4, %2
ret void
}