xunge/DecIR huggingface dataset:
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createLeqExpression(struct memorycontainer *expression1,
                    struct memorycontainer *expression2) {
  return createExpression(0x08, expression1, expression2);
}


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

x86 assembly (clang, -O2):
<createLeqExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x8,%edi
jmp    1030 <createExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createLeqExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = alloca %struct.memorycontainer*
%4 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %3
store %struct.memorycontainer* %1, %struct.memorycontainer** %4
%5 = load %struct.memorycontainer*, %struct.memorycontainer** %3
%6 = load %struct.memorycontainer*, %struct.memorycontainer** %4
%7 = call %struct.memorycontainer* @createExpression(i32 8, %struct.memorycontainer* %5, %struct.memorycontainer* %6)
ret %struct.memorycontainer* %7
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createLeqExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 8, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
void utest_time_constants(void) {
  ;
  return;
}


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

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

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

LLVM IR (-O2):
define void @utest_time_constants() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ event_base_loopbreak(void *);
void libevent_ctx_break(void *priv) { event_base_loopbreak(priv); }


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

x86 assembly (clang, -O2):
<libevent_ctx_break>:
jmp    1030 <event_base_loopbreak@plt>

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

LLVM IR (-O2):
define void @libevent_ctx_break(i8* %0) {
%2 = tail call i32 @event_base_loopbreak(i8* %0)
ret void
}
int main(void) {
  unsigned i = 15, j = 0;
  while (i > 0) {
    i--;
    j++;
  }
  while (i < j)
    i++;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xf,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    113a <main+0x3a>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
jmp    113f <main+0x3f>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1159 <main+0x59>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <main+0x3f>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *i8086OpenConfig(char const *);
int i8086ConfigExists(const char *filename) {
  FILE *file;
  file = i8086OpenConfig(filename);
  if (file) {
    fclose(file);
    return 0;
  } else
    return -1;
}


x86 assembly (clang, -O0):
<i8086ConfigExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <i8086OpenConfig@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <i8086ConfigExists+0x39>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
jmp    1160 <i8086ConfigExists+0x40>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i8086ConfigExists>:
push   %rax
call   1030 <i8086OpenConfig@plt>
test   %rax,%rax
je     1137 <i8086ConfigExists+0x17>
mov    %rax,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @i8086ConfigExists(i8* %0) {
%2 = tail call i32* @i8086OpenConfig(i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %7
}
int first_two(int n) {
  while (n > 99) {
    n /= 10;
  }
  return n;
}


x86 assembly (clang, -O0):
<first_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x63,-0x4(%rbp)
jle    1124 <first_two+0x24>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1107 <first_two+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_two>:
cmp    $0x64,%edi
jl     1125 <first_two+0x25>
mov    $0xcccccccd,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
imul   %rcx,%rax
shr    $0x23,%rax
cmp    $0x3e7,%edi
mov    %eax,%edi
ja     1110 <first_two+0x10>
ret
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @first_two(i32 %0) {
%2 = icmp sgt i32 %0, 99
br i1 %2, label %3, label %7
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = udiv i32 %4, 10
%6 = icmp ugt i32 %4, 999
br i1 %6, label %3, label %7
7: ; preds = %3, %1
%8 = phi i32 [ %0, %1 ], [ %5, %3 ]
ret i32 %8
}
unsigned int noiseNextInt(long long unsigned int *seed) {
  *seed = 6364136223846793005ULL * *seed + 1;
  unsigned int x = *seed >> 32;
  x ^= x >> 11;
  x ^= (x << 7) & 0x9D2C5680;
  x ^= (x << 15) & 0xEFC60000;
  x ^= x >> 18;
  return (x);
}


x86 assembly (clang, -O0):
<noiseNextInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movabs $0x5851f42d4c957f2d,%rcx
f4 51 58
imul   (%rax),%rcx
add    $0x1,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shr    $0x20,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0xb,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x7,%eax
and    $0x9d2c5680,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0xf,%eax
and    $0xefc60000,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x12,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<noiseNextInt>:
movabs $0x5851f42d4c957f2d,%rax
f4 51 58
imul   (%rdi),%rax
add    $0x1,%rax
mov    %rax,(%rdi)
mov    %rax,%rcx
shr    $0x20,%rcx
shr    $0x2b,%rax
xor    %ecx,%eax
mov    %eax,%ecx
shl    $0x7,%ecx
and    $0x9d2c5680,%ecx
xor    %eax,%ecx
mov    %ecx,%edx
shl    $0xf,%edx
and    $0xefc60000,%edx
xor    %ecx,%edx
mov    %edx,%eax
shr    $0x12,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @noiseNextInt(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = load i64, i64* %4
%6 = mul i64 6364136223846793005, %5
%7 = add i64 %6, 1
%8 = load i64*, i64** %2
store i64 %7, i64* %8
%9 = load i64*, i64** %2
%10 = load i64, i64* %9
%11 = lshr i64 %10, 32
%12 = trunc i64 %11 to i32
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = lshr i32 %13, 11
%15 = load i32, i32* %3
%16 = xor i32 %15, %14
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = shl i32 %17, 7
%19 = and i32 %18, -1658038656
%20 = load i32, i32* %3
%21 = xor i32 %20, %19
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = shl i32 %22, 15
%24 = and i32 %23, -272236544
%25 = load i32, i32* %3
%26 = xor i32 %25, %24
store i32 %26, i32* %3
%27 = load i32, i32* %3
%28 = lshr i32 %27, 18
%29 = load i32, i32* %3
%30 = xor i32 %29, %28
store i32 %30, i32* %3
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @noiseNextInt(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = mul i64 %2, 6364136223846793005
%4 = add i64 %3, 1
store i64 %4, i64* %0
%5 = lshr i64 %4, 32
%6 = trunc i64 %5 to i32
%7 = lshr i32 %6, 11
%8 = xor i32 %7, %6
%9 = shl i32 %8, 7
%10 = and i32 %9, -1658038656
%11 = xor i32 %10, %8
%12 = shl i32 %11, 15
%13 = and i32 %12, -272236544
%14 = xor i32 %13, %11
%15 = lshr i32 %14, 18
%16 = xor i32 %15, %14
ret i32 %16
}
/* Variables and functions */
int primo(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int m, saida;
  scanf("%d", &m);
  saida = primo(m);
  printf("%d\n", saida);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1050 <primo@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @primo(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int syscall(int, int);
int fdatasync(int fd) { return syscall(148, fd); }


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

x86 assembly (clang, -O2):
<fdatasync>:
mov    %edi,%esi
mov    $0x94,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @fdatasync(i32 %0) {
%2 = tail call i32 @syscall(i32 148, i32 %0)
ret i32 %2
}
int copyConfig2Vars() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @copyConfig2Vars() {
ret i32 0
}
void fun(int *a, int *b) {
  int tmp = *a;
  *a = *b;
  *b = tmp;
}


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

x86 assembly (clang, -O2):
<fun>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @fun(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** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @fun(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
scalar_t__ malloc(unsigned long);
void *ioremap(unsigned long offset, unsigned long size) {
  void *memory = (void *)malloc(size);
  return memory;
}


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

x86 assembly (clang, -O2):
<ioremap>:
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @ioremap(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %5
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
define i8* @ioremap(i64 %0, i64 %1) {
%3 = tail call i64 @malloc(i64 %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
short highestSample(int n) { return 0x7fc0; }


x86 assembly (clang, -O0):
<highestSample>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x7fc0,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<highestSample>:
mov    $0x7fc0,%ax
ret

LLVM IR (-O0):
define signext i16 @highestSample(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i16 32704
}

LLVM IR (-O2):
define signext i16 @highestSample(i32 %0) {
ret i16 32704
}
/* Variables and functions */
int /*<<< orphan*/ list_delete(void *);
void list_delete_cb(void *p_list) { list_delete(p_list); }


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

x86 assembly (clang, -O2):
<list_delete_cb>:
jmp    1030 <list_delete@plt>

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

LLVM IR (-O2):
define void @list_delete_cb(i8* %0) {
%2 = tail call i32 @list_delete(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void WritePreProcessors(FILE *out) {
  fputs("#define X )*2+1\n", out);
  fputs("#define _ )*2\n", out);
  fputs("#define s ((((((((0\n", out);
  return;
}


x86 assembly (clang, -O0):
<WritePreProcessors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rsi
lea    0xeda(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WritePreProcessors>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xedd(%rip),%rdi
mov    $0xe,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xed3(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"#define X )*2+1\0A\00"
@.str.1 = [15 x i8] c"#define _ )*2\0A\00"
@.str.2 = [21 x i8] c"#define s ((((((((0\0A\00"
define void @WritePreProcessors(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @fputs(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"#define X )*2+1\0A\00"
@.str.1 = [15 x i8] c"#define _ )*2\0A\00"
@.str.2 = [21 x i8] c"#define s ((((((((0\0A\00"
define void @WritePreProcessors(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 16, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i64 14, i64 1, i32* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i64 20, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int EOF;
int getchar();
void viderBuffer() {
  int c = 0;
  while (c != '\n' && c != EOF) {
    c = getchar();
  }
}


x86 assembly (clang, -O0):
<viderBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1140 <viderBuffer+0x30>
mov    -0x4(%rbp),%eax
mov    0x2eb0(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1150 <viderBuffer+0x40>
jmp    115f <viderBuffer+0x4f>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
jmp    111f <viderBuffer+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<viderBuffer>:
push   %rbx
mov    0x2ed0(%rip),%rbx
cmpl   $0x0,(%rbx)
je     1130 <viderBuffer+0x20>
nopl   (%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <viderBuffer+0x20>
cmp    (%rbx),%eax
jne    1120 <viderBuffer+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @viderBuffer() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %11, %0
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br label %9
9: ; preds = %5, %2
%10 = phi i1 [ false, %2 ], [ %8, %5 ]
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = call i32 (...) @getchar()
store i32 %12, i32* %1
br label %2
13: ; preds = %9
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @viderBuffer() {
%1 = load i32, i32* @EOF
%2 = icmp eq i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @getchar()
%5 = icmp ne i32 %4, 10
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %4, %6
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %3, label %9
9: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int /*<<< orphan*/ f2(int);
void f(int n) {
  if (n < 3)
    return;
  n--;
  f2(n);
  __VERIFIER_error();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    113a <f+0x1a>
jmp    1152 <f+0x32>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f2@plt>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0x3,%edi
jge    1126 <f+0x6>
ret
push   %rax
add    $0xffffffff,%edi
call   1030 <f2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <__VERIFIER_error@plt>

LLVM IR (-O0):
define void @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 3
br i1 %4, label %5, label %6
5: ; preds = %1
br label %12
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @f2(i32 %9)
%11 = call i32 (...) @__VERIFIER_error()
br label %12
12: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @f(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @f2(i32 %4)
%6 = tail call i32 (...) @__VERIFIER_error()
br label %7
7: ; preds = %1, %3
ret void
}
/* Type definitions */
struct chunk {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ text_chunk(struct chunk *);
void text_free(struct chunk *chunk) { free(text_chunk(chunk)); }


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

x86 assembly (clang, -O2):
<text_free>:
push   %rax
call   1040 <text_chunk@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.chunk = type { i32 }
define void @text_free(%struct.chunk* %0) {
%2 = alloca %struct.chunk*
store %struct.chunk* %0, %struct.chunk** %2
%3 = load %struct.chunk*, %struct.chunk** %2
%4 = call i32 @text_chunk(%struct.chunk* %3)
%5 = call i32 @free(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.chunk = type { i32 }
define void @text_free(%struct.chunk* %0) {
%2 = tail call i32 @text_chunk(%struct.chunk* %0)
%3 = tail call i32 @free(i32 %2)
ret void
}
/* Variables and functions */
int bar();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("[BEGIN] dylib-re-export\n");
  if (bar() == 42)
    printf("[PASS] dylib-re-export\n");
  else
    printf("[FAIL] dylib-re-export, wrong value\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <bar@plt>
cmp    $0x2a,%eax
jne    115c <main+0x3c>
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
jmp    1168 <main+0x48>
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <bar@plt>
cmp    $0x2a,%eax
lea    0xefe(%rip),%rax
lea    0xed3(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"[BEGIN] dylib-re-export\0A\00"
@.str.1 = [24 x i8] c"[PASS] dylib-re-export\0A\00"
@.str.2 = [37 x i8] c"[FAIL] dylib-re-export, wrong value\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @bar()
%4 = icmp eq i32 %3, 42
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"[BEGIN] dylib-re-export\00"
@str.3 = [36 x i8] c"[FAIL] dylib-re-export, wrong value\00"
@str.4 = [23 x i8] c"[PASS] dylib-re-export\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @bar()
%3 = icmp eq i32 %2, 42
%4 = select i1 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @str.3, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret i32 0
}
void setservent(int stayopen) {}


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

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

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

LLVM IR (-O2):
define void @setservent(i32 %0) {
ret void
}
long ft_power(long nb, int pow) {
  if (pow == 0)
    return (1);
  return (nb * ft_power(nb, pow - 1));
}


x86 assembly (clang, -O0):
<ft_power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1136 <ft_power+0x26>
movq   $0x1,-0x8(%rbp)
jmp    115c <ft_power+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
call   1030 <ft_power@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_power>:
test   %esi,%esi
je     1118 <ft_power+0x18>
lea    -0x1(%rsi),%eax
mov    %esi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <ft_power+0x1e>
mov    $0x1,%eax
jmp    1155 <ft_power+0x55>
mov    $0x1,%eax
ret
and    $0xfffffff8,%esi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
add    $0xfffffff8,%esi
jne    1130 <ft_power+0x30>
test   %ecx,%ecx
je     1169 <ft_power+0x69>
nopl   0x0(%rax)
imul   %rdi,%rax
add    $0xffffffff,%ecx
jne    1160 <ft_power+0x60>
ret

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

LLVM IR (-O2):
define i64 @ft_power(i64 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %33, label %4
4: ; preds = %2
%5 = add i32 %1, -1
%6 = and i32 %1, 7
%7 = icmp ult i32 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i32 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi i64 [ 1, %8 ], [ %20, %10 ]
%12 = phi i32 [ 0, %8 ], [ %21, %10 ]
%13 = mul nsw i64 %11, %0
%14 = mul nsw i64 %13, %0
%15 = mul nsw i64 %14, %0
%16 = mul nsw i64 %15, %0
%17 = mul nsw i64 %16, %0
%18 = mul nsw i64 %17, %0
%19 = mul nsw i64 %18, %0
%20 = mul nsw i64 %19, %0
%21 = add i32 %12, 8
%22 = icmp eq i32 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi i64 [ undef, %4 ], [ %20, %10 ]
%25 = phi i64 [ 1, %4 ], [ %20, %10 ]
%26 = icmp eq i32 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi i64 [ %30, %27 ], [ %25, %23 ]
%29 = phi i32 [ %31, %27 ], [ 0, %23 ]
%30 = mul nsw i64 %28, %0
%31 = add i32 %29, 1
%32 = icmp eq i32 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi i64 [ 1, %2 ], [ %24, %23 ], [ %30, %27 ]
ret i64 %34
}
/* Type definitions */
struct terminal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ term_prompt(struct terminal *);
void term_start(struct terminal *term) { term_prompt(term); }


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

x86 assembly (clang, -O2):
<term_start>:
jmp    1030 <term_prompt@plt>

LLVM IR (-O0):
%struct.terminal = type { i32 }
define void @term_start(%struct.terminal* %0) {
%2 = alloca %struct.terminal*
store %struct.terminal* %0, %struct.terminal** %2
%3 = load %struct.terminal*, %struct.terminal** %2
%4 = call i32 @term_prompt(%struct.terminal* %3)
ret void
}

LLVM IR (-O2):
%struct.terminal = type { i32 }
define void @term_start(%struct.terminal* %0) {
%2 = tail call i32 @term_prompt(%struct.terminal* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ intenable(int /*<<< orphan*/);
int /*<<< orphan*/ outb(int, int);
void timerinit(void) {
  outb(0x43, (0 << 6) | (0b11 << 4) | (2 << 1));
  outb(0x40, ((1193182 + (50) / 2) / (50)) & 0xFF);
  outb(0x40, ((1193182 + (50) / 2) / (50)) >> 8);
  intenable(0);
}


x86 assembly (clang, -O0):
<timerinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
mov    $0x34,%esi
call   1040 <outb@plt>
mov    $0x40,%edi
mov    $0x38,%esi
call   1040 <outb@plt>
mov    $0x40,%edi
mov    $0x5d,%esi
call   1040 <outb@plt>
xor    %edi,%edi
call   1030 <intenable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timerinit>:
push   %rax
mov    $0x43,%edi
mov    $0x34,%esi
call   1040 <outb@plt>
mov    $0x40,%edi
mov    $0x38,%esi
call   1040 <outb@plt>
mov    $0x40,%edi
mov    $0x5d,%esi
call   1040 <outb@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <intenable@plt>

LLVM IR (-O0):
define void @timerinit() {
%1 = call i32 @outb(i32 67, i32 52)
%2 = call i32 @outb(i32 64, i32 56)
%3 = call i32 @outb(i32 64, i32 93)
%4 = call i32 @intenable(i32 0)
ret void
}

LLVM IR (-O2):
define void @timerinit() {
%1 = tail call i32 @outb(i32 67, i32 52)
%2 = tail call i32 @outb(i32 64, i32 56)
%3 = tail call i32 @outb(i32 64, i32 93)
%4 = tail call i32 @intenable(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ milli_delay(int);
int /*<<< orphan*/ printf(char *);
void TestB() {
  int i = 0x1000;
  while (1) {
    printf("B");
    milli_delay(200);
  }
}


x86 assembly (clang, -O0):
<TestB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1000,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0xc8,%edi
call   1040 <milli_delay@plt>
jmp    112f <TestB+0xf>

x86 assembly (clang, -O2):
<TestB>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0xc8,%edi
call   1040 <milli_delay@plt>
jmp    1130 <TestB+0x10>

LLVM IR (-O0):
@.str = [2 x i8] c"B\00"
define void @TestB() {
%1 = alloca i32
store i32 4096, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @milli_delay(i32 200)
br label %2
}

LLVM IR (-O2):
define void @TestB() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @putchar(i32 66)
%3 = tail call i32 @milli_delay(i32 200)
br label %1
}
int euclidean_gcd_recursive(int first, int second) {
  if (second == 0) {
    return first;
  } else {
    return euclidean_gcd_recursive(second, (first % second));
  }
}


x86 assembly (clang, -O0):
<euclidean_gcd_recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <euclidean_gcd_recursive+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <euclidean_gcd_recursive+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <euclidean_gcd_recursive@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclidean_gcd_recursive>:
mov    %edi,%eax
test   %esi,%esi
je     111d <euclidean_gcd_recursive+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <euclidean_gcd_recursive+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @euclidean_gcd_recursive(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 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = call i32 @euclidean_gcd_recursive(i32 %11, i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @euclidean_gcd_recursive(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printLog(int *s, int n) {
  for (int i = 0; i < n; i++) {
    printf("%d ", s[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printLog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printLog+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printLog+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printLog(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int read_multprec_start_system(int decimals) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(493, &decimals, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<read_multprec_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1ed,%edi
lea    -0x4(%rbp),%rsi
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):
<read_multprec_start_system>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1ed,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @read_multprec_start_system(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 493, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
int arch_finish_suspend(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @arch_finish_suspend() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ flob();
int foo(void) {
  flob();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = call i32 (...) @flob()
ret i32 0
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @flob()
ret i32 0
}
const char *ls_costN_nm9_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_costN_nm9_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <ls_costN_nm9_name_out+0x2b>
jmp    111a <ls_costN_nm9_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <ls_costN_nm9_name_out+0x3b>
jmp    114b <ls_costN_nm9_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_costN_nm9_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_costN_nm9_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm9_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @ls_costN_nm9_name_out(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @ls_costN_nm9_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ regtestNew();
extern int main(void) {
  regtestNew();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @regtestNew()
ret i32 0
}
void unw_prof_frame_dummy(void) {}


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

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

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

LLVM IR (-O2):
define void @unw_prof_frame_dummy() {
ret void
}
/* Variables and functions */
void count_entries(const void *key, size_t klen, const void *val, size_t vlen,
                   void *arg) {
  int *count = (int *)arg;
  (*count)++;
  (void)key;
  (void)klen;
  (void)val;
  (void)vlen;
}


x86 assembly (clang, -O0):
<count_entries>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_entries>:
addl   $0x1,(%r8)
ret

LLVM IR (-O0):
define void @count_entries(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i32*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i8* %4, i8** %10
%12 = load i8*, i8** %10
%13 = bitcast i8* %12 to i32*
store i32* %13, i32** %11
%14 = load i32*, i32** %11
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %14
%17 = load i8*, i8** %6
%18 = load i64, i64* %7
%19 = load i8*, i8** %8
%20 = load i64, i64* %9
ret void
}

LLVM IR (-O2):
define void @count_entries(i8* nocapture readnone %0, i64 %1, i8* nocapture readnone %2, i64 %3, i8* nocapture %4) {
%6 = bitcast i8* %4 to i32*
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
store i32 %8, i32* %6
ret void
}
void shift_envelope(double *envelope, double value) {
  envelope[0] = envelope[1];
  envelope[1] = envelope[2];
  envelope[2] = envelope[3];
  envelope[3] = value;
}


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

x86 assembly (clang, -O2):
<shift_envelope>:
movups 0x8(%rdi),%xmm1
movups %xmm1,(%rdi)
movsd  0x18(%rdi),%xmm1
movsd  %xmm1,0x10(%rdi)
movsd  %xmm0,0x18(%rdi)
ret

LLVM IR (-O0):
define void @shift_envelope(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 = getelementptr inbounds double, double* %5, i64 1
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 2
%12 = load double, double* %11
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 3
%17 = load double, double* %16
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 2
store double %17, double* %19
%20 = load double, double* %4
%21 = load double*, double** %3
%22 = getelementptr inbounds double, double* %21, i64 3
store double %20, double* %22
ret void
}

LLVM IR (-O2):
define void @shift_envelope(double* nocapture %0, double %1) {
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = getelementptr inbounds double, double* %0, i64 2
%5 = bitcast double* %3 to <2 x double>*
%6 = load <2 x double>, <2 x double>* %5
%7 = bitcast double* %0 to <2 x double>*
store <2 x double> %6, <2 x double>* %7
%8 = getelementptr inbounds double, double* %0, i64 3
%9 = load double, double* %8
store double %9, double* %4
store double %1, double* %8
ret void
}
int f(int n) {
  if (n == 0)
    return 1;
  else {
    return f(n - 1) + f(n - 1);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <f+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <f+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
je     1124 <f+0x14>
push   %rax
add    $0xffffffff,%edi
call   1030 <f@plt>
add    %eax,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %8, %5 ], [ 1, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @f(i32 %6)
%8 = shl nsw i32 %7, 1
br label %3
}