xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ _library_ident(char *);
int /*<<< orphan*/ _library_task(char *);
extern void _start(void) {
  _library_ident("MPT I/O Library");
  _library_task("connect/bind to sockets");
  _library_task("wait for input events");
  _exit(0);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <_library_ident@plt>
lea    0xec9(%rip),%rdi
call   1040 <_library_task@plt>
lea    0xed5(%rip),%rdi
call   1040 <_library_task@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <_library_ident@plt>
lea    0xecc(%rip),%rdi
call   1040 <_library_task@plt>
lea    0xed8(%rip),%rdi
call   1040 <_library_task@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"MPT I/O Library\00"
@.str.1 = [24 x i8] c"connect/bind to sockets\00"
@.str.2 = [22 x i8] c"wait for input events\00"
define void @_start() {
%1 = call i32 @_library_ident(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @_library_task(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @_library_task(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"MPT I/O Library\00"
@.str.1 = [24 x i8] c"connect/bind to sockets\00"
@.str.2 = [22 x i8] c"wait for input events\00"
define void @_start() {
%1 = tail call i32 @_library_ident(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @_library_task(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @_library_task(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @_exit(i32 0)
unreachable
}
void specks_lock(struct stuff *st) {}


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

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

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

LLVM IR (-O2):
%struct.stuff = type opaque
define void @specks_lock(%struct.stuff* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(unsigned char **, int, int, int /*<<< orphan*/ *);
void buff(FILE *infile, int length, unsigned char buffer[][length]) {
  fread(buffer, sizeof(char), length, infile);
}


x86 assembly (clang, -O0):
<buff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buff>:
mov    %rdx,%rax
mov    %esi,%edx
mov    %rdi,%rcx
mov    %rax,%rdi
mov    $0x1,%esi
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define void @buff(i32* nocapture %0, i32 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i8**
%5 = tail call i32 @fread(i8** %4, i32 1, i32 %1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i2cmaster_ClearAckErr(int /*<<< orphan*/);
void i2c0master_ClearAckErr(void) { i2cmaster_ClearAckErr(0); }


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

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

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

LLVM IR (-O2):
define void @i2c0master_ClearAckErr() {
%1 = tail call i32 @i2cmaster_ClearAckErr(i32 0)
ret void
}
/* Type definitions */
struct evbuffer {
  int dummy;
};

/* Variables and functions */
size_t evbuffer_get_contiguous_space(const struct evbuffer *buf) {
  (void)buf;
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
define i64 @evbuffer_get_contiguous_space(%struct.evbuffer* nocapture readnone %0) {
ret i64 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ add_pixel;
};
struct TYPE_4__ {
  TYPE_1__ f;
};
typedef TYPE_2__ XImage;

/* Variables and functions */
void *get_XImage_f_add_pixel(void *_p) {
  return (void *)((XImage *)_p)->f.add_pixel;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i8* @get_XImage_f_add_pixel(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @get_XImage_f_add_pixel(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int array[5] = {1, 2, 3, 4, 5};
  int i, sum = 0;
  for (i = 0; i < 5; i++)
    sum += array[i];
  printf("%d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x5,-0x34(%rbp)
jge    1179 <main+0x69>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1153 <main+0x43>
mov    -0x38(%rbp),%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 15)
ret i32 0
}
char *strcpy(to, from)
register char *to, *from;
{
  register char *ret = to;
  while ((*to++ = *from++) != 0)
    ;
  return ret;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ literal_string_parameter(char *);
void call_literal_string_parameter2_Good() {
  literal_string_parameter("hello");
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define void @call_literal_string_parameter2_Good() {
%1 = tail call i32 @literal_string_parameter(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MergeSort(int *, int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ free(int *);
int *malloc(int);
void sort(int array[], int size) {
  int *tmp;
  if (size < 2)
    return;
  else {
    tmp = malloc(sizeof(int) * size);
    MergeSort(array, tmp, 0, size - 1);
    free(tmp);
  }
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    114e <sort+0x1e>
jmp    117f <sort+0x4f>
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1050 <MergeSort@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
cmp    $0x2,%esi
jge    1136 <sort+0x6>
ret
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x0(,%rbx,4),%edi
call   1040 <malloc@plt>
mov    %rax,%r15
add    $0xffffffff,%ebx
mov    %r14,%rdi
mov    %rax,%rsi
xor    %edx,%edx
mov    %ebx,%ecx
call   1050 <MergeSort@plt>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
br label %22
9: ; preds = %2
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = mul i64 4, %11
%13 = trunc i64 %12 to i32
%14 = call i32* @malloc(i32 %13)
store i32* %14, i32** %5
%15 = load i32*, i32** %3
%16 = load i32*, i32** %5
%17 = load i32, i32* %4
%18 = sub nsw i32 %17, 1
%19 = call i32 @MergeSort(i32* %15, i32* %16, i32 0, i32 %18)
%20 = load i32*, i32** %5
%21 = call i32 @free(i32* %20)
br label %22
22: ; preds = %8, %9
ret void
}

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = shl i32 %1, 2
%6 = tail call i32* @malloc(i32 %5)
%7 = add nsw i32 %1, -1
%8 = tail call i32 @MergeSort(i32* %0, i32* %6, i32 0, i32 %7)
%9 = tail call i32 @free(i32* %6)
br label %10
10: ; preds = %2, %4
ret void
}
int foo(int i) {
  if (((unsigned)(i + 1)) * 4 == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
shl    $0x2,%eax
cmp    $0x0,%eax
jne    1125 <foo+0x25>
movl   $0x1,-0x4(%rbp)
jmp    112c <foo+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
not    %edi
xor    %eax,%eax
test   $0x3fffffff,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = and i32 %0, 1073741823
%3 = icmp eq i32 %2, 1073741823
%4 = zext i1 %3 to i32
ret i32 %4
}
void fun(int *arr1, unsigned int index, int *arr2) {
  arr1[index * 3 + 1] = 10;
  arr2[index * 3 + 2] = 10;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3,-0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
movl   $0xa,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
imul   $0x3,-0xc(%rbp),%ecx
add    $0x2,%ecx
mov    %ecx,%ecx
movl   $0xa,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
lea    (%rsi,%rsi,2),%eax
add    $0x1,%eax
movl   $0xa,(%rdi,%rax,4)
lea    (%rsi,%rsi,2),%eax
add    $0x2,%eax
movl   $0xa,(%rdx,%rax,4)
ret

LLVM IR (-O0):
define void @fun(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = mul i32 %8, 3
%10 = add i32 %9, 1
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %7, i64 %11
store i32 10, i32* %12
%13 = load i32*, i32** %6
%14 = load i32, i32* %5
%15 = mul i32 %14, 3
%16 = add i32 %15, 2
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %13, i64 %17
store i32 10, i32* %18
ret void
}

LLVM IR (-O2):
define void @fun(i32* nocapture writeonly %0, i32 %1, i32* nocapture writeonly %2) {
%4 = mul i32 %1, 3
%5 = add i32 %4, 1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 10, i32* %7
%8 = add i32 %4, 2
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %2, i64 %9
store i32 10, i32* %10
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_write_dobldobl_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(341, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_write_dobldobl_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x155,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_write_dobldobl_solutions>:
mov    $0x155,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @solcon_write_dobldobl_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 341, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_write_dobldobl_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 341, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int eigenvalue_comp(const double *one, const double *two) {
  if (*one < *two)
    return -1;
  else if (*one > *two)
    return +1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<eigenvalue_comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <eigenvalue_comp+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <eigenvalue_comp+0x5b>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1154 <eigenvalue_comp+0x54>
movl   $0x1,-0x4(%rbp)
jmp    115b <eigenvalue_comp+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eigenvalue_comp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @eigenvalue_comp(double* %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
%6 = load double*, double** %4
%7 = load double, double* %6
%8 = load double*, double** %5
%9 = load double, double* %8
%10 = fcmp olt double %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %20
12: ; preds = %2
%13 = load double*, double** %4
%14 = load double, double* %13
%15 = load double*, double** %5
%16 = load double, double* %15
%17 = fcmp ogt double %14, %16
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 1, i32* %3
br label %20
19: ; preds = %12
store i32 0, i32* %3
br label %20
20: ; preds = %19, %18, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @eigenvalue_comp(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp olt double %3, %4
%6 = fcmp ogt double %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Type definitions */
struct array_s {
  int dummy;
};

/* Variables and functions */
int array_reserve_with_ratio_and_clean(struct array_s *, unsigned long, double);
int array_reserve_and_clean(struct array_s *a, unsigned long count) {
  return array_reserve_with_ratio_and_clean(a, count, 2.0);
}


x86 assembly (clang, -O0):
<array_reserve_and_clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  0xed0(%rip),%xmm0
call   1030 <array_reserve_with_ratio_and_clean@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_reserve_and_clean>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <array_reserve_with_ratio_and_clean@plt>

LLVM IR (-O0):
%struct.array_s = type { i32 }
define i32 @array_reserve_and_clean(%struct.array_s* %0, i64 %1) {
%3 = alloca %struct.array_s*
%4 = alloca i64
store %struct.array_s* %0, %struct.array_s** %3
store i64 %1, i64* %4
%5 = load %struct.array_s*, %struct.array_s** %3
%6 = load i64, i64* %4
%7 = call i32 @array_reserve_with_ratio_and_clean(%struct.array_s* %5, i64 %6, double 2.000000e+00)
ret i32 %7
}

LLVM IR (-O2):
%struct.array_s = type { i32 }
define i32 @array_reserve_and_clean(%struct.array_s* %0, i64 %1) {
%3 = tail call i32 @array_reserve_with_ratio_and_clean(%struct.array_s* %0, i64 %1, double 2.000000e+00)
ret i32 %3
}
int atomic_dec_and_test_int(volatile int *var) {
  char ret;
  asm volatile("lock ;"
               " "
               "decl %0"
               "\n\t"
               "setz %1 \n\t"
               : "=m"(*var), "=qm"(ret)
               : "m"(*var)
               : "cc", "memory");
  return ret;
}


x86 assembly (clang, -O0):
<atomic_dec_and_test_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
lock decl (%rax)
sete   -0x9(%rbp)
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_dec_and_test_int>:
lock decl (%rdi)
sete   -0x1(%rsp)
movsbl -0x1(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @atomic_dec_and_test_int(i32* %0) {
%2 = alloca i8
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef char const uint16_t;

/* Variables and functions */
uint16_t get_uint16(const char *buf) {
  return (buf[1] & 0xff) << 8 | (buf[0] & 0xff);
}


x86 assembly (clang, -O0):
<get_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
and    $0xff,%ecx
or     %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint16>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define signext i8 @get_uint16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = and i32 %6, 255
%8 = shl i32 %7, 8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = and i32 %12, 255
%14 = or i32 %8, %13
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @get_uint16(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
long int longint_ignoring_signedlonglongint(long int x,
                                            signed long long int y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @longint_ignoring_signedlonglongint(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @longint_ignoring_signedlonglongint(i64 returned %0, i64 %1) {
ret i64 %0
}
int test_imm_CBuint32_reg(unsigned int val) {
  return ((val) & (0xCB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CBuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xcb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_CBuint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 203
%5 = icmp ne i32 %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_CBuint32_reg(i32 %0) {
%2 = and i32 %0, 203
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int maxInt(const int a, const int b) {
  if (b > a)
    return b;
  return a;
}


x86 assembly (clang, -O0):
<maxInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <maxInt+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <maxInt+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxInt>:
mov    %edi,%eax
cmp    %edi,%esi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @maxInt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ runMathAddTests();
int /*<<< orphan*/ runMathCoerceTests();
int /*<<< orphan*/ runMathDivTests();
int /*<<< orphan*/ runMathMulDoubleTests();
int /*<<< orphan*/ runMathMulTests();
int /*<<< orphan*/ runMathParseTests();
int /*<<< orphan*/ runMathSubTests();
extern void runUtilTests(void) {
  runMathParseTests();
  runMathCoerceTests();
  runMathAddTests();
  runMathSubTests();
  runMathMulTests();
  runMathMulDoubleTests();
  runMathDivTests();
}


x86 assembly (clang, -O0):
<runUtilTests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <runMathParseTests@plt>
mov    $0x0,%al
call   1090 <runMathCoerceTests@plt>
mov    $0x0,%al
call   1050 <runMathAddTests@plt>
mov    $0x0,%al
call   1060 <runMathSubTests@plt>
mov    $0x0,%al
call   1030 <runMathMulTests@plt>
mov    $0x0,%al
call   1070 <runMathMulDoubleTests@plt>
mov    $0x0,%al
call   1080 <runMathDivTests@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<runUtilTests>:
push   %rax
xor    %eax,%eax
call   1040 <runMathParseTests@plt>
xor    %eax,%eax
call   1090 <runMathCoerceTests@plt>
xor    %eax,%eax
call   1050 <runMathAddTests@plt>
xor    %eax,%eax
call   1060 <runMathSubTests@plt>
xor    %eax,%eax
call   1030 <runMathMulTests@plt>
xor    %eax,%eax
call   1070 <runMathMulDoubleTests@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <runMathDivTests@plt>

LLVM IR (-O0):
define void @runUtilTests() {
%1 = call i32 (...) @runMathParseTests()
%2 = call i32 (...) @runMathCoerceTests()
%3 = call i32 (...) @runMathAddTests()
%4 = call i32 (...) @runMathSubTests()
%5 = call i32 (...) @runMathMulTests()
%6 = call i32 (...) @runMathMulDoubleTests()
%7 = call i32 (...) @runMathDivTests()
ret void
}

LLVM IR (-O2):
define void @runUtilTests() {
%1 = tail call i32 (...) @runMathParseTests()
%2 = tail call i32 (...) @runMathCoerceTests()
%3 = tail call i32 (...) @runMathAddTests()
%4 = tail call i32 (...) @runMathSubTests()
%5 = tail call i32 (...) @runMathMulTests()
%6 = tail call i32 (...) @runMathMulDoubleTests()
%7 = tail call i32 (...) @runMathDivTests()
ret void
}
/* Variables and functions */
double gsl_cdf_ugaussian_Q(double const);
double gsl_cdf_gaussian_Q(const double x, const double sigma) {
  return gsl_cdf_ugaussian_Q(x / sigma);
}


x86 assembly (clang, -O0):
<gsl_cdf_gaussian_Q>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <gsl_cdf_ugaussian_Q@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsl_cdf_gaussian_Q>:
divsd  %xmm1,%xmm0
jmp    1030 <gsl_cdf_ugaussian_Q@plt>

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

LLVM IR (-O2):
define double @gsl_cdf_gaussian_Q(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @gsl_cdf_ugaussian_Q(double %3)
ret double %4
}
void foo_2_1_1_2_1_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_2_1_2_2_2_1() {
ret void
}
void get_qos_level(void) { return; }


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

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

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

LLVM IR (-O2):
define void @get_qos_level() {
ret void
}
void gtk_text_mark_get_buffer() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_mark_get_buffer() {
ret void
}
int slight_delay() {
  int a = 0;
  int i = 0;
  for (i = 0; i < 10; i++) {
    a += i * 2;
  }
  return a;
}


x86 assembly (clang, -O0):
<slight_delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    113d <slight_delay+0x3d>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <slight_delay+0x19>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @slight_delay() {
ret i32 90
}
/* Type definitions */
typedef unsigned char const uint8_t;

/* Variables and functions */
uint8_t ata_get_ata_smart_read_data_checksum(const unsigned char *buf) {
  return buf[511];
}


x86 assembly (clang, -O0):
<ata_get_ata_smart_read_data_checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1ff(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ata_get_ata_smart_read_data_checksum>:
mov    0x1ff(%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @ata_get_ata_smart_read_data_checksum(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 511
%5 = load i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @ata_get_ata_smart_read_data_checksum(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 511
%3 = load i8, i8* %2
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ nrf_read(int, unsigned char *, unsigned int);
void __attribute__((unused))
nrf_get_payload(unsigned char *buf, unsigned int len) {
  nrf_read(0x61, buf, len);
}


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

x86 assembly (clang, -O2):
<nrf_get_payload>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x61,%edi
jmp    1030 <nrf_read@plt>

LLVM IR (-O0):
define void @nrf_get_payload(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 @nrf_read(i32 97, i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @nrf_get_payload(i8* %0, i32 %1) {
%3 = tail call i32 @nrf_read(i32 97, i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int negate(int);
int abs(int n) { return n < 0 ? negate(n) : n; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1135 <abs+0x25>
mov    -0x4(%rbp),%edi
call   1030 <negate@plt>
mov    %eax,-0x8(%rbp)
jmp    113b <abs+0x2b>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
test   %edi,%edi
js     1117 <abs+0x7>
mov    %edi,%eax
ret
jmp    1030 <negate@plt>

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @negate(i32 %6)
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @negate(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ %0, %1 ]
ret i32 %6
}
void sci_handler() {}


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

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

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

LLVM IR (-O2):
define void @sci_handler() {
ret void
}
/* Type definitions */
struct timespec {
  double tv_sec;
  int tv_nsec;
};

/* Variables and functions */
double tdiff(struct timespec *start, struct timespec *end) {
  return end->tv_sec - start->tv_sec + 1e-9 * (end->tv_nsec - start->tv_nsec);
}


x86 assembly (clang, -O0):
<tdiff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x8(%rbp),%rcx
sub    0x8(%rcx),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeca(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tdiff>:
movsd  (%rsi),%xmm1
subsd  (%rdi),%xmm1
mov    0x8(%rsi),%eax
sub    0x8(%rdi),%eax
cvtsi2sd %eax,%xmm0
mulsd  0xee6(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { double, i32 }
define double @tdiff(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%7 = load double, double* %6
%8 = load %struct.timespec*, %struct.timespec** %3
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load double, double* %9
%11 = fsub double %7, %10
%12 = load %struct.timespec*, %struct.timespec** %4
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %12, i32 0, i32 1
%14 = load i32, i32* %13
%15 = load %struct.timespec*, %struct.timespec** %3
%16 = getelementptr inbounds %struct.timespec, %struct.timespec* %15, i32 0, i32 1
%17 = load i32, i32* %16
%18 = sub nsw i32 %14, %17
%19 = sitofp i32 %18 to double
%20 = call double @llvm.fmuladd.f64(double 1.000000e-09, double %19, double %11)
ret double %20
}

LLVM IR (-O2):
%struct.timespec = type { double, i32 }
define double @tdiff(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load double, double* %5
%7 = fsub double %4, %6
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%11 = load i32, i32* %10
%12 = sub nsw i32 %9, %11
%13 = sitofp i32 %12 to double
%14 = tail call double @llvm.fmuladd.f64(double %13, double 1.000000e-09, double %7)
ret double %14
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int opt_portals(char *opt) {
  if (strcmp(opt, "-a") == 0)
    return 1;
  if (strcmp(opt, "--aperture") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<opt_portals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <opt_portals+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116f <opt_portals+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <opt_portals+0x58>
movl   $0x1,-0x4(%rbp)
jmp    116f <opt_portals+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_portals>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1141 <opt_portals+0x31>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-a\00"
@.str.1 = [11 x i8] c"--aperture\00"
define i32 @opt_portals(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %14
13: ; preds = %8
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [3 x i8] c"-a\00"
@.str.1 = [11 x i8] c"--aperture\00"
define i32 @opt_portals(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int fun921() { return 921; }


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

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

LLVM IR (-O0):
define i32 @fun921() {
ret i32 921
}

LLVM IR (-O2):
define i32 @fun921() {
ret i32 921
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int main() {
  pid_t pid;
  pid = fork();
  if (pid < 0) {
    printf("\nError !! Process not created successfully.\n");
  } else {
    printf("\nHere I AM !!\n\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1156 <main+0x36>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    1162 <main+0x42>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
lea    0xedd(%rip),%rax
lea    0xec7(%rip),%rdi
cmovs  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"\0AError !! Process not created successfully.\0A\00"
@.str.1 = [16 x i8] c"\0AHere I AM !!\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 (...) @fork()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"\0AHere I AM !!\0A\00"
@str.2 = [44 x i8] c"\0AError !! Process not created successfully.\00"
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp slt i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
int lan2_send_sol(unsigned char *payload, int len, void *rsp) { return (-8); }


x86 assembly (clang, -O0):
<lan2_send_sol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xfffffff8,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @lan2_send_sol(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 -8
}
/* Variables and functions */
char *c_leaks();
int main(void) {
  char *l = c_leaks();
  l[3] = l[-5];
  l[100] = 4;
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <c_leaks@plt>
mov    -0x5(%rax),%cl
mov    %cl,0x3(%rax)
movb   $0x4,0x64(%rax)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* (...) @c_leaks()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 -5
%6 = load i8, i8* %5
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 3
store i8 %6, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 100
store i8 4, i8* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* (...) @c_leaks()
%2 = getelementptr inbounds i8, i8* %1, i64 -5
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %3, i8* %4
%5 = getelementptr inbounds i8, i8* %1, i64 100
store i8 4, i8* %5
ret i32 0
}
int numColumns(char **row) {
  int ncols = 0;
  if (!row)
    return -1;
  while (row[ncols++])
    ;
  return --ncols;
}


x86 assembly (clang, -O0):
<numColumns>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <numColumns+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <numColumns+0x59>
jmp    112b <numColumns+0x2b>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     114d <numColumns+0x4d>
jmp    112b <numColumns+0x2b>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numColumns>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     111d <numColumns+0x1d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <numColumns+0x10>
ret

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

LLVM IR (-O2):
define i32 @numColumns(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ 0, %1 ]
%5 = add nuw i64 %4, 1
%6 = getelementptr inbounds i8*, i8** %0, i64 %4
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ -1, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ isa_write8(int, int);
int init_serial(void) {
  isa_write8(0x2fb, 0x80);
  isa_write8(0x2f8, 1);
  isa_write8(0x2f9, 0);
  isa_write8(0x2fb, 0x3);
  return 0;
}


x86 assembly (clang, -O0):
<init_serial>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2fb,%edi
mov    $0x80,%esi
call   1030 <isa_write8@plt>
mov    $0x2f8,%edi
mov    $0x1,%esi
call   1030 <isa_write8@plt>
mov    $0x2f9,%edi
xor    %esi,%esi
call   1030 <isa_write8@plt>
mov    $0x2fb,%edi
mov    $0x3,%esi
call   1030 <isa_write8@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_serial>:
push   %rax
mov    $0x2fb,%edi
mov    $0x80,%esi
call   1030 <isa_write8@plt>
mov    $0x2f8,%edi
mov    $0x1,%esi
call   1030 <isa_write8@plt>
mov    $0x2f9,%edi
xor    %esi,%esi
call   1030 <isa_write8@plt>
mov    $0x2fb,%edi
mov    $0x3,%esi
call   1030 <isa_write8@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @init_serial() {
%1 = call i32 @isa_write8(i32 763, i32 128)
%2 = call i32 @isa_write8(i32 760, i32 1)
%3 = call i32 @isa_write8(i32 761, i32 0)
%4 = call i32 @isa_write8(i32 763, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @init_serial() {
%1 = tail call i32 @isa_write8(i32 763, i32 128)
%2 = tail call i32 @isa_write8(i32 760, i32 1)
%3 = tail call i32 @isa_write8(i32 761, i32 0)
%4 = tail call i32 @isa_write8(i32 763, i32 3)
ret i32 0
}