xunge/DecIR huggingface dataset:
/* Variables and functions */
int mark_get_idx(int /*<<< orphan*/, int *, int *);
int /*<<< orphan*/ mark_idx(int);
int mark_get(int c, int *y, int *x) { return mark_get_idx(mark_idx(c), y, x); }


x86 assembly (clang, -O0):
<mark_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <mark_idx@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <mark_get_idx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mark_get>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <mark_idx@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <mark_get_idx@plt>

LLVM IR (-O0):
define i32 @mark_get(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 = call i32 @mark_idx(i32 %7)
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = call i32 @mark_get_idx(i32 %8, i32* %9, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @mark_get(i32 %0, i32* %1, i32* %2) {
%4 = tail call i32 @mark_idx(i32 %0)
%5 = tail call i32 @mark_get_idx(i32 %4, i32* %1, i32* %2)
ret i32 %5
}
void dwgps_term(void) {}


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

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

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

LLVM IR (-O2):
define void @dwgps_term() {
ret void
}
int racine(int nb) {
  int a;
  int res;
  res = 0;
  a = 1;
  while (nb > 0 && res < nb && a <= 46340) {
    res = a * a;
    a++;
  }
  return (a);
}


x86 assembly (clang, -O0):
<racine>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xd(%rbp)
jle    1142 <racine+0x42>
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0xd(%rbp)
jge    1142 <racine+0x42>
cmpl   $0xb504,-0x8(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1152 <racine+0x52>
jmp    116a <racine+0x6a>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <racine+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<racine>:
test   %edi,%edi
jle    1127 <racine+0x27>
mov    $0x1,%ecx
nopl   0x0(%rax)
mov    %ecx,%edx
imul   %ecx,%edx
lea    0x1(%rcx),%eax
cmp    %edi,%edx
jae    1126 <racine+0x26>
cmp    $0xb504,%ecx
mov    %eax,%ecx
jb     1110 <racine+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @racine(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 1, i32* %3
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %4
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 46340
br label %15
15: ; preds = %12, %8, %5
%16 = phi i1 [ false, %8 ], [ false, %5 ], [ %14, %12 ]
br i1 %16, label %17, label %23
17: ; preds = %15
%18 = load i32, i32* %3
%19 = load i32, i32* %3
%20 = mul nsw i32 %18, %19
store i32 %20, i32* %4
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %5
23: ; preds = %15
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @racine(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = mul nuw nsw i32 %4, %4
%6 = add nuw nsw i32 %4, 1
%7 = icmp ult i32 %5, %0
%8 = icmp ult i32 %4, 46340
%9 = and i1 %7, %8
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
char *month_name(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i = 0;
  char *n = 0;
  i = 5;
  n = month_name(i);
  printf("123\n");
  printf("month name = %s;\n", n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <month_name@plt>
mov    %rax,-0x10(%rbp)
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
call   1050 <month_name@plt>
mov    %rax,%rbx
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"123\0A\00"
@.str.1 = [18 x i8] c"month name = %s;\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
store i32 5, i32* %1
%3 = load i32, i32* %1
%4 = call i8* @month_name(i32 %3)
store i8* %4, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"month name = %s;\0A\00"
@str = [4 x i8] c"123\00"
define i32 @main() {
%1 = tail call i8* @month_name(i32 5)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
unsigned long ul_addlim(unsigned long augend, unsigned long addend,
                        unsigned long limit) {
  unsigned long x;
  if (augend > limit)
    return limit;
  if (addend > limit)
    return limit;
  x = augend + addend;
  if (x < addend)
    return limit;
  if (x < limit)
    return x;
  else
    return limit;
}


x86 assembly (clang, -O0):
<ul_addlim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    112b <ul_addlim+0x2b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1190 <ul_addlim+0x90>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    1146 <ul_addlim+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1190 <ul_addlim+0x90>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    116d <ul_addlim+0x6d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1190 <ul_addlim+0x90>
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1188 <ul_addlim+0x88>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1190 <ul_addlim+0x90>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ul_addlim>:
mov    %rdx,%rax
cmp    %rdx,%rdi
ja     1119 <ul_addlim+0x19>
cmp    %rax,%rsi
ja     1119 <ul_addlim+0x19>
add    %rdi,%rsi
jb     1119 <ul_addlim+0x19>
cmp    %rax,%rsi
cmovb  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @ul_addlim(i64 %0, i64 %1, i64 %2) {
%4 = icmp ugt i64 %0, %2
%5 = icmp ugt i64 %1, %2
%6 = or i1 %4, %5
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = add i64 %1, %0
%9 = icmp ult i64 %8, %1
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = icmp ult i64 %8, %2
%12 = select i1 %11, i64 %8, i64 %2
br label %13
13: ; preds = %10, %7, %3
%14 = phi i64 [ %2, %3 ], [ %2, %7 ], [ %12, %10 ]
ret i64 %14
}
/* Variables and functions */
int _exit() { return -1; }


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @_exit() {
%1 = alloca i32
store i32 -1, i32* %1
unreachable
}

LLVM IR (-O2):
short tf_h(short c) { return c / 3; }


x86 assembly (clang, -O0):
<tf_h>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<tf_h>:
imul   $0x5556,%edi,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
shr    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @tf_h(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = sdiv i32 %4, 3
%6 = trunc i32 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define signext i16 @tf_h(i16 signext %0) {
%2 = sdiv i16 %0, 3
ret i16 %2
}
/* Type definitions */
struct RingBuffer {
  int dummy;
};

/* Variables and functions */
struct RingBuffer *InitCharRingBufferCustomSize(int);
struct RingBuffer *InitCharRingBuffer() {
  return (InitCharRingBufferCustomSize(65000));
}


x86 assembly (clang, -O0):
<InitCharRingBuffer>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfde8,%edi
call   1030 <InitCharRingBufferCustomSize@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitCharRingBuffer>:
mov    $0xfde8,%edi
jmp    1030 <InitCharRingBufferCustomSize@plt>

LLVM IR (-O0):
%struct.RingBuffer = type { i32 }
define %struct.RingBuffer* @InitCharRingBuffer() {
%1 = call %struct.RingBuffer* @InitCharRingBufferCustomSize(i32 65000)
ret %struct.RingBuffer* %1
}

LLVM IR (-O2):
%struct.RingBuffer = type { i32 }
define %struct.RingBuffer* @InitCharRingBuffer() {
%1 = tail call %struct.RingBuffer* @InitCharRingBufferCustomSize(i32 65000)
ret %struct.RingBuffer* %1
}
void handle_61(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_61(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int /*<<< orphan*/);
void C67_STH_PTR(int r, int r2) { C67_asm("STH.D *", r, r2, 0); }


x86 assembly (clang, -O0):
<C67_STH_PTR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
xor    %ecx,%ecx
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_STH_PTR>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %ecx,%ecx
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"STH.D *\00"
define void @C67_STH_PTR(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @C67_asm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"STH.D *\00"
define void @C67_STH_PTR(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 0)
ret void
}
char *sbrk(incr)
int incr;
{
  static void *some_memory[64];
  register char *new_brk;
  static char *old_brk = (char *)some_memory;
  register char *result;
  new_brk = old_brk + incr;
  if (new_brk > (char *)some_memory + sizeof(some_memory) ||
      new_brk < (char *)some_memory)
    return ((char *)-1);
  result = old_brk;
  old_brk = new_brk;
  return (result);
}


x86 assembly (clang, -O0):
<sbrk>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    0x2f12(%rip),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
lea    0x2f20(%rip),%rax
add    $0x200,%rax
cmp    %rax,-0x18(%rbp)
ja     1141 <sbrk+0x41>
lea    0x2f09(%rip),%rax
cmp    %rax,-0x18(%rbp)
jae    1151 <sbrk+0x51>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    116f <sbrk+0x6f>
mov    0x2ec8(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,0x2eb9(%rip)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbrk>:
mov    0x2f19(%rip),%rcx
movslq %edi,%rdx
add    %rcx,%rdx
lea    0x312c(%rip),%rsi
mov    $0xffffffffffffffff,%rax
cmp    %rsi,%rdx
ja     1136 <sbrk+0x36>
lea    0x2f19(%rip),%rsi
cmp    %rsi,%rdx
jb     1136 <sbrk+0x36>
mov    %rdx,0x2eed(%rip)
mov    %rcx,%rax
ret

LLVM IR (-O0):
@sbrk.some_memory = internal global [64 x i8*] zeroinitializer
@sbrk.old_brk = internal global i8* bitcast ([64 x i8*]* @sbrk.some_memory to i8*)
define i8* @sbrk(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
%6 = load i8*, i8** @sbrk.old_brk
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp ugt i8* %10, getelementptr inbounds (i8, i8* bitcast ([64 x i8*]* @sbrk.some_memory to i8*), i64 512)
br i1 %11, label %15, label %12
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = icmp ult i8* %13, bitcast ([64 x i8*]* @sbrk.some_memory to i8*)
br i1 %14, label %15, label %16
15: ; preds = %12, %1
store i8* inttoptr (i64 -1 to i8*), i8** %2
br label %20
16: ; preds = %12
%17 = load i8*, i8** @sbrk.old_brk
store i8* %17, i8** %5
%18 = load i8*, i8** %4
store i8* %18, i8** @sbrk.old_brk
%19 = load i8*, i8** %5
store i8* %19, i8** %2
br label %20
20: ; preds = %16, %15
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
@sbrk.some_memory = internal global [64 x i8*] zeroinitializer
@sbrk.old_brk = internal unnamed_addr global i8* bitcast ([64 x i8*]* @sbrk.some_memory to i8*)
define i8* @sbrk(i32 %0) {
%2 = load i8*, i8** @sbrk.old_brk
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i8, i8* %2, i64 %3
%5 = icmp ugt i8* %4, bitcast (i8** getelementptr inbounds ([64 x i8*], [64 x i8*]* @sbrk.some_memory, i64 1, i64 0) to i8*)
%6 = icmp ult i8* %4, bitcast ([64 x i8*]* @sbrk.some_memory to i8*)
%7 = or i1 %5, %6
br i1 %7, label %9, label %8
8: ; preds = %1
store i8* %4, i8** @sbrk.old_brk
br label %9
9: ; preds = %1, %8
%10 = phi i8* [ %2, %8 ], [ inttoptr (i64 -1 to i8*), %1 ]
ret i8* %10
}
void BN_BLINDING_update(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_BLINDING_update() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void sha1hash_version(void) {
  printf(("%s (%s) %s\n"
          "Written by David M. Syzdek.\n"
          "\n"
          "Copyright 2011 David M. Syzdek <david@syzdek.net>.\n"
          "This is free software; see the source for copying conditions.  "
          "There is NO\n"
          "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
          "PURPOSE.\n"),
         "sha1hash", "Simple Programming Examples And References", "0.1");
  return;
}


x86 assembly (clang, -O0):
<sha1hash_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xfd1(%rip),%rsi
lea    0xfd3(%rip),%rdx
lea    0xff7(%rip),%rcx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha1hash_version>:
lea    0xee9(%rip),%rdi
lea    0xfd5(%rip),%rsi
lea    0xfd7(%rip),%rdx
lea    0xffb(%rip),%rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [243 x i8] c"%s (%s) %s\0AWritten by David M. Syzdek.\0A\0ACopyright 2011 David M. Syzdek <david@syzdek.net>.\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\0A\00"
@.str.1 = [9 x i8] c"sha1hash\00"
@.str.2 = [43 x i8] c"Simple Programming Examples And References\00"
@.str.3 = [4 x i8] c"0.1\00"
define void @sha1hash_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([243 x i8], [243 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [243 x i8] c"%s (%s) %s\0AWritten by David M. Syzdek.\0A\0ACopyright 2011 David M. Syzdek <david@syzdek.net>.\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\0A\00"
@.str.1 = [9 x i8] c"sha1hash\00"
@.str.2 = [43 x i8] c"Simple Programming Examples And References\00"
@.str.3 = [4 x i8] c"0.1\00"
define void @sha1hash_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([243 x i8], [243 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret void
}
double r2(void *x) { return *(double *)(x + 32766); }


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

x86 assembly (clang, -O2):
<r2>:
movsd  0x7ffe(%rdi),%xmm0
ret

LLVM IR (-O0):
define double @r2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32766
%5 = bitcast i8* %4 to double*
%6 = load double, double* %5
ret double %6
}

LLVM IR (-O2):
define double @r2(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32766
%3 = bitcast i8* %2 to double*
%4 = load double, double* %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo(int *);
int main() {
  int a;
  if (&a == 0)
    abort();
  else {
    foo(&a);
    exit(0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @foo(i32* %2)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @foo(i32* %1)
%4 = call i32 @exit(i32 0)
unreachable
}
int fun1052() { return 1052; }


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

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

LLVM IR (-O0):
define i32 @fun1052() {
ret i32 1052
}

LLVM IR (-O2):
define i32 @fun1052() {
ret i32 1052
}
/* Variables and functions */
double pow(double, double);
double find_stage_pressure_ratio(int num_stages, double total_desired_rp) {
  double rp = pow(total_desired_rp, 1.0 / num_stages);
  return rp;
}


x86 assembly (clang, -O0):
<find_stage_pressure_ratio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm2
movsd  0xece(%rip),%xmm1
divsd  %xmm2,%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_stage_pressure_ratio>:
cvtsi2sd %edi,%xmm2
movsd  0xee4(%rip),%xmm1
divsd  %xmm2,%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @find_stage_pressure_ratio(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
%9 = fdiv double 1.000000e+00, %8
%10 = call double @pow(double %6, double %9)
store double %10, double* %5
%11 = load double, double* %5
ret double %11
}

LLVM IR (-O2):
define double @find_stage_pressure_ratio(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = fdiv double 1.000000e+00, %3
%5 = tail call double @pow(double %1, double %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int help2() {
  printf("Usage: readInput <Input-file> <Labels-file> <Sequence-file>\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<help2>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [61 x i8] c"Usage: readInput <Input-file> <Labels-file> <Sequence-file>\0A\00"
define i32 @help2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [60 x i8] c"Usage: readInput <Input-file> <Labels-file> <Sequence-file>\00"
define i32 @help2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
ret i32 1
}
struct my_struct *return_cumbersome_my_struct_ptr() {
  return (struct my_struct *)1234;
}


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

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

LLVM IR (-O0):
%struct.my_struct = type opaque
define %struct.my_struct* @return_cumbersome_my_struct_ptr() {
ret %struct.my_struct* inttoptr (i64 1234 to %struct.my_struct*)
}

LLVM IR (-O2):
%struct.my_struct = type opaque
define %struct.my_struct* @return_cumbersome_my_struct_ptr() {
ret %struct.my_struct* inttoptr (i64 1234 to %struct.my_struct*)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a, b;
  a = 5;
  b = 6;
  printf("%d %d %d", a & b, a | b, a ^ b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0x8(%rbp),%esi
and    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
or     -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 6, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = and i32 %4, %5
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = or i32 %7, %8
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = xor i32 %10, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %9, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 4, i32 7, i32 3)
ret i32 0
}
/* Variables and functions */
int lop1();
int /*<<< orphan*/ printf(char *, int);
int main(void) { printf("%d\n", lop1()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <lop1@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @lop1()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(size_t);
char *char_buffer_malloc(size_t size) {
  char *x = (char *)malloc((size + 1) * sizeof(char));
  if (x) {
    x[size] = '\0';
  }
  return x;
}


x86 assembly (clang, -O0):
<char_buffer_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
shl    $0x0,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1148 <char_buffer_malloc+0x38>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_buffer_malloc>:
push   %rbx
mov    %rdi,%rbx
add    $0x1,%rdi
call   1030 <malloc@plt>
test   %rax,%rax
je     1126 <char_buffer_malloc+0x16>
movb   $0x0,(%rax,%rbx,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @char_buffer_malloc(i64 %0) {
%2 = add i64 %0, 1
%3 = tail call i64 @malloc(i64 %2)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i64 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %4, i64 %0
store i8 0, i8* %7
br label %8
8: ; preds = %6, %1
ret i8* %4
}
int fun265() { return 265; }


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

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

LLVM IR (-O0):
define i32 @fun265() {
ret i32 265
}

LLVM IR (-O2):
define i32 @fun265() {
ret i32 265
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void set_seed(void) { srand((unsigned)time(NULL)); }


x86 assembly (clang, -O0):
<set_seed>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_seed>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @set_seed() {
%1 = call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = call i32 @srand(i32 %2)
ret void
}

LLVM IR (-O2):
define void @set_seed() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
ret void
}
int f_i15(int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7,
          int i8, int i9, int i10, int i11, int i12, int i13, int i14) {
  return i14;
}


x86 assembly (clang, -O0):
<f_i15>:
push   %rbp
mov    %rsp,%rbp
mov    0x50(%rbp),%eax
mov    0x48(%rbp),%eax
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    0x50(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_i15>:
mov    0x48(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @f_i15(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13, i32 returned %14) {
ret i32 %14
}
/* Variables and functions */
long rand();
long random_numberC(long n) { return (rand() % n + 1); }


x86 assembly (clang, -O0):
<random_numberC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cqto
idivq  -0x8(%rbp)
mov    %rdx,%rax
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_numberC>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     1131 <random_numberC+0x21>
cqto
idiv   %rbx
mov    %rdx,%rax
jmp    1137 <random_numberC+0x27>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    $0x1,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @random_numberC(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 (...) @rand()
%4 = load i64, i64* %2
%5 = srem i64 %3, %4
%6 = add nsw i64 %5, 1
ret i64 %6
}

LLVM IR (-O2):
define i64 @random_numberC(i64 %0) {
%2 = tail call i64 (...) @rand()
%3 = srem i64 %2, %0
%4 = add nsw i64 %3, 1
ret i64 %4
}
int main(int argc, char **argv) {
  int *__attribute__((type_annotate("nullable"))) foo = 0;
  return *foo;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 undef
}
void *fileresult_get(struct _gfxresult *gfx, const char *name) { return 0; }


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

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

LLVM IR (-O0):
%struct._gfxresult = type opaque
define i8* @fileresult_get(%struct._gfxresult* %0, i8* %1) {
%3 = alloca %struct._gfxresult*
%4 = alloca i8*
store %struct._gfxresult* %0, %struct._gfxresult** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
%struct._gfxresult = type opaque
define noalias i8* @fileresult_get(%struct._gfxresult* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ pidCalculatePitch();
int /*<<< orphan*/ pidCalculatePulses();
int /*<<< orphan*/ pidCalculateRoll();
int /*<<< orphan*/ pidCalculateYaw();
int /*<<< orphan*/ pidSetGyroValues(double, double, double);
void pidCalculate(double gyroX, double gyroY, double gyroZ) {
  pidSetGyroValues(gyroX, gyroY, gyroZ);
  pidCalculateRoll();
  pidCalculateYaw();
  pidCalculatePitch();
  pidCalculatePulses();
}


x86 assembly (clang, -O0):
<pidCalculate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <pidSetGyroValues@plt>
mov    $0x0,%al
call   1050 <pidCalculateRoll@plt>
mov    $0x0,%al
call   1030 <pidCalculateYaw@plt>
mov    $0x0,%al
call   1070 <pidCalculatePitch@plt>
mov    $0x0,%al
call   1060 <pidCalculatePulses@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pidCalculate>:
push   %rax
call   1040 <pidSetGyroValues@plt>
xor    %eax,%eax
call   1050 <pidCalculateRoll@plt>
xor    %eax,%eax
call   1030 <pidCalculateYaw@plt>
xor    %eax,%eax
call   1070 <pidCalculatePitch@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <pidCalculatePulses@plt>

LLVM IR (-O0):
define void @pidCalculate(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call i32 @pidSetGyroValues(double %7, double %8, double %9)
%11 = call i32 (...) @pidCalculateRoll()
%12 = call i32 (...) @pidCalculateYaw()
%13 = call i32 (...) @pidCalculatePitch()
%14 = call i32 (...) @pidCalculatePulses()
ret void
}

LLVM IR (-O2):
define void @pidCalculate(double %0, double %1, double %2) {
%4 = tail call i32 @pidSetGyroValues(double %0, double %1, double %2)
%5 = tail call i32 (...) @pidCalculateRoll()
%6 = tail call i32 (...) @pidCalculateYaw()
%7 = tail call i32 (...) @pidCalculatePitch()
%8 = tail call i32 (...) @pidCalculatePulses()
ret void
}
int always_true(const struct dirent *file) { return (1); }


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

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

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

LLVM IR (-O2):
%struct.dirent = type opaque
define i32 @always_true(%struct.dirent* nocapture readnone %0) {
ret i32 1
}
void subr1(int *a) {
  int f[8];
#pragma acc declare copy(f)
#pragma acc parallel copy(a [0:N])
  {
    int i;
    for (i = 0; i < 8; i++) {
      f[i] = a[i];
      a[i] = f[i] + f[i];
    }
  }
}


x86 assembly (clang, -O0):
<subr1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x8,-0x34(%rbp)
jge    1155 <subr1+0x55>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edx
movslq -0x34(%rbp),%rax
add    -0x30(%rbp,%rax,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    110f <subr1+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<subr1>:
movdqu (%rdi),%xmm0
movdqu 0x10(%rdi),%xmm1
paddd  %xmm0,%xmm0
movdqu %xmm0,(%rdi)
paddd  %xmm1,%xmm1
movdqu %xmm1,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @subr1(i32* nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = shl nsw <4 x i32> %3, <i32 1, i32 1, i32 1, i32 1>
%5 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %0, i64 4
%7 = bitcast i32* %6 to <4 x i32>*
%8 = load <4 x i32>, <4 x i32>* %7
%9 = shl nsw <4 x i32> %8, <i32 1, i32 1, i32 1, i32 1>
%10 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> %9, <4 x i32>* %10
ret void
}
/* Type definitions */
struct qnode {
  int dummy;
};

/* Variables and functions */
struct qnode *get_front(struct qnode **front_ref) {
  if (*front_ref == NULL) {
    return NULL;
  }
  return *front_ref;
}


x86 assembly (clang, -O0):
<get_front>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1123 <get_front+0x23>
movq   $0x0,-0x8(%rbp)
jmp    112e <get_front+0x2e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.qnode = type { i32 }
define %struct.qnode* @get_front(%struct.qnode** %0) {
%2 = alloca %struct.qnode*
%3 = alloca %struct.qnode**
store %struct.qnode** %0, %struct.qnode*** %3
%4 = load %struct.qnode**, %struct.qnode*** %3
%5 = load %struct.qnode*, %struct.qnode** %4
%6 = icmp eq %struct.qnode* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store %struct.qnode* null, %struct.qnode** %2
br label %11
8: ; preds = %1
%9 = load %struct.qnode**, %struct.qnode*** %3
%10 = load %struct.qnode*, %struct.qnode** %9
store %struct.qnode* %10, %struct.qnode** %2
br label %11
11: ; preds = %8, %7
%12 = load %struct.qnode*, %struct.qnode** %2
ret %struct.qnode* %12
}

LLVM IR (-O2):
%struct.qnode = type { i32 }
define %struct.qnode* @get_front(%struct.qnode** nocapture %0) {
%2 = load %struct.qnode*, %struct.qnode** %0
ret %struct.qnode* %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
int /*<<< orphan*/ stdout;
void tracer_vmid(void *t, unsigned int VMID) {
  fprintf(stdout, "VMID sets to 0x%x\n", VMID);
}


x86 assembly (clang, -O0):
<tracer_vmid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tracer_vmid>:
mov    %esi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [19 x i8] c"VMID sets to 0x%x\0A\00"
define void @tracer_vmid(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [19 x i8] c"VMID sets to 0x%x\0A\00"
define void @tracer_vmid(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
struct defglobal {
  int dummy;
};
struct constructHeader {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DestroyDefglobal(void *, struct defglobal *);
void DestroyDefglobalAction(void *theEnv, struct constructHeader *theConstruct,
                            void *buffer) {
  struct defglobal *theDefglobal = (struct defglobal *)theConstruct;
  if (theDefglobal == NULL)
    return;
  DestroyDefglobal(theEnv, theDefglobal);
}


x86 assembly (clang, -O0):
<DestroyDefglobalAction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    113c <DestroyDefglobalAction+0x2c>
jmp    1149 <DestroyDefglobalAction+0x39>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <DestroyDefglobal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DestroyDefglobalAction>:
test   %rsi,%rsi
je     111a <DestroyDefglobalAction+0xa>
jmp    1030 <DestroyDefglobal@plt>
ret

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
%struct.defglobal = type { i32 }
define void @DestroyDefglobalAction(i8* %0, %struct.constructHeader* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.constructHeader*
%6 = alloca i8*
%7 = alloca %struct.defglobal*
store i8* %0, i8** %4
store %struct.constructHeader* %1, %struct.constructHeader** %5
store i8* %2, i8** %6
%8 = load %struct.constructHeader*, %struct.constructHeader** %5
%9 = bitcast %struct.constructHeader* %8 to %struct.defglobal*
store %struct.defglobal* %9, %struct.defglobal** %7
%10 = load %struct.defglobal*, %struct.defglobal** %7
%11 = icmp eq %struct.defglobal* %10, null
br i1 %11, label %12, label %13
12: ; preds = %3
br label %17
13: ; preds = %3
%14 = load i8*, i8** %4
%15 = load %struct.defglobal*, %struct.defglobal** %7
%16 = call i32 @DestroyDefglobal(i8* %14, %struct.defglobal* %15)
br label %17
17: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
%struct.defglobal = type { i32 }
define void @DestroyDefglobalAction(i8* %0, %struct.constructHeader* %1, i8* nocapture readnone %2) {
%4 = icmp eq %struct.constructHeader* %1, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = bitcast %struct.constructHeader* %1 to %struct.defglobal*
%7 = tail call i32 @DestroyDefglobal(i8* %0, %struct.defglobal* %6)
br label %8
8: ; preds = %3, %5
ret void
}
/* Variables and functions */
bool argumentsOutOfRange(int length, int offset, int count) {
  if (offset < 0) {
    return true;
  }
  if (count < 0) {
    return true;
  }
  if (length - offset < count) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<argumentsOutOfRange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1123 <argumentsOutOfRange+0x23>
movl   $0x1,-0x4(%rbp)
jmp    115b <argumentsOutOfRange+0x5b>
cmpl   $0x0,-0x10(%rbp)
jge    1139 <argumentsOutOfRange+0x39>
movl   $0x1,-0x4(%rbp)
jmp    115b <argumentsOutOfRange+0x5b>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1154 <argumentsOutOfRange+0x54>
movl   $0x1,-0x4(%rbp)
jmp    115b <argumentsOutOfRange+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<argumentsOutOfRange>:
mov    %edx,%eax
or     %esi,%eax
sets   %al
sub    %esi,%edi
cmp    %edx,%edi
setl   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @argumentsOutOfRange(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 1, i32* %4
br label %23
11: ; preds = %3
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 1, i32* %4
br label %23
15: ; preds = %11
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = sub nsw i32 %16, %17
%19 = load i32, i32* %7
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %15
store i32 1, i32* %4
br label %23
22: ; preds = %15
store i32 0, i32* %4
br label %23
23: ; preds = %22, %21, %14, %10
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @argumentsOutOfRange(i32 %0, i32 %1, i32 %2) {
%4 = or i32 %2, %1
%5 = icmp slt i32 %4, 0
%6 = sub nsw i32 %0, %1
%7 = icmp slt i32 %6, %2
%8 = select i1 %5, i1 true, i1 %7
%9 = zext i1 %8 to i32
ret i32 %9
}
void destroyArgs(char **str, int size) {
  if (str) {
    for (int i = 0; i < size; i++)
      free(str[i]);
    free(str);
  }
}


x86 assembly (clang, -O0):
<destroyArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1165 <destroyArgs+0x55>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <destroyArgs+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1131 <destroyArgs+0x21>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroyArgs>:
test   %rdi,%rdi
je     114f <destroyArgs+0x3f>
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <destroyArgs+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <destroyArgs+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @destroyArgs(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = zext i32 %1 to i64
br label %10
8: ; preds = %10, %4
%9 = bitcast i8** %0 to i8*
tail call void @free(i8* %9)
br label %16
10: ; preds = %6, %10
%11 = phi i64 [ 0, %6 ], [ %14, %10 ]
%12 = getelementptr inbounds i8*, i8** %0, i64 %11
%13 = load i8*, i8** %12
tail call void @free(i8* %13)
%14 = add nuw nsw i64 %11, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %8, label %10
16: ; preds = %8, %2
ret void
}