xunge/DecIR huggingface dataset:
int int_xor(int num1, int num2) {
  int xor_num = 0;
  xor_num = num1 ^ num2;
  return xor_num;
}


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

x86 assembly (clang, -O2):
<int_xor>:
mov    %edi,%eax
xor    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @int_xor(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  for (int i = 0; i < 1; i++)
    printf("in the loop!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"in the loop!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@str = [13 x i8] c"in the loop!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int IPC_CREAT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int msgget(int, int);
int /*<<< orphan*/ perror(char *);
int create_msg_queue(int key) {
  int qID;
  if ((qID = msgget(key, IPC_CREAT | 0640)) == -1) {
    perror("mssget: Error creating msg queue \n");
    exit(EXIT_FAILURE);
  }
  return qID;
}


x86 assembly (clang, -O0):
<create_msg_queue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
or     $0x1a0,%esi
call   1030 <msgget@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    1178 <create_msg_queue+0x48>
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_msg_queue>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    $0x1a0,%esi
or     (%rax),%esi
call   1030 <msgget@plt>
cmp    $0xffffffff,%eax
je     114b <create_msg_queue+0x1b>
pop    %rcx
ret
lea    0xeae(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@.str = [35 x i8] c"mssget: Error creating msg queue \0A\00"
@EXIT_FAILURE = global i32 0
define i32 @create_msg_queue(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @IPC_CREAT
%6 = or i32 %5, 416
%7 = call i32 @msgget(i32 %4, i32 %6)
store i32 %7, i32* %3
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@.str = [35 x i8] c"mssget: Error creating msg queue \0A\00"
@EXIT_FAILURE = global i32 0
define i32 @create_msg_queue(i32 %0) {
%2 = load i32, i32* @IPC_CREAT
%3 = or i32 %2, 416
%4 = tail call i32 @msgget(i32 %0, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _more_error(char const *message, int ret) {
  fputs("more"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_more_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_more_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"more: \00"
@stderr = global i32 0
define i32 @_more_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"more: \00"
@stderr = global i32 0
define i32 @_more_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void noop() { printf("Ooops!\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"Ooops!\00"
define void @noop() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
float findLargest(float *n) {
  float max = 0;
  int i = 0;
  while (*(n + i) != '\0') {
    if (*(n + i) > max) {
      max = *(n + i);
    }
    i++;
  }
  return max;
}


x86 assembly (clang, -O0):
<findLargest>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    113b <findLargest+0x3b>
jp     113b <findLargest+0x3b>
jmp    1172 <findLargest+0x72>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1164 <findLargest+0x64>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1117 <findLargest+0x17>
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<findLargest>:
movss  (%rdi),%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jne    110e <findLargest+0xe>
jnp    1139 <findLargest+0x39>
add    $0x4,%rdi
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
nopl   0x0(%rax,%rax,1)
movaps %xmm1,%xmm0
maxss  %xmm3,%xmm0
movss  (%rdi),%xmm1
add    $0x4,%rdi
ucomiss %xmm2,%xmm1
movaps %xmm0,%xmm3
jne    1120 <findLargest+0x20>
jp     1120 <findLargest+0x20>
ret

LLVM IR (-O0):
define float @findLargest(float* %0) {
%2 = alloca float*
%3 = alloca float
%4 = alloca i32
store float* %0, float** %2
store float 0.000000e+00, float* %3
store i32 0, i32* %4
br label %5
5: ; preds = %26, %1
%6 = load float*, float** %2
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds float, float* %6, i64 %8
%10 = load float, float* %9
%11 = fcmp une float %10, 0.000000e+00
br i1 %11, label %12, label %29
12: ; preds = %5
%13 = load float*, float** %2
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds float, float* %13, i64 %15
%17 = load float, float* %16
%18 = load float, float* %3
%19 = fcmp ogt float %17, %18
br i1 %19, label %20, label %26
20: ; preds = %12
%21 = load float*, float** %2
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds float, float* %21, i64 %23
%25 = load float, float* %24
store float %25, float* %3
br label %26
26: ; preds = %20, %12
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %5
29: ; preds = %5
%30 = load float, float* %3
ret float %30
}

LLVM IR (-O2):
define float @findLargest(float* nocapture %0) {
%2 = load float, float* %0
%3 = fcmp une float %2, 0.000000e+00
br i1 %3, label %4, label %14
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi float [ %12, %4 ], [ %2, %1 ]
%7 = phi float [ %9, %4 ], [ 0.000000e+00, %1 ]
%8 = fcmp ogt float %6, %7
%9 = select i1 %8, float %6, float %7
%10 = add nuw nsw i64 %5, 1
%11 = getelementptr inbounds float, float* %0, i64 %10
%12 = load float, float* %11
%13 = fcmp une float %12, 0.000000e+00
br i1 %13, label %4, label %14
14: ; preds = %4, %1
%15 = phi float [ 0.000000e+00, %1 ], [ %9, %4 ]
ret float %15
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int errno;
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  FILE *fp;
  fp = fopen("test.txt", "r");
  printf("Value of errno: %d\n", errno);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [20 x i8] c"Value of errno: %d\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32, i32* @errno
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [20 x i8] c"Value of errno: %d\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = load i32, i32* @errno
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %2)
ret i32 0
}
int fun112() { return 112; }


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

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

LLVM IR (-O0):
define i32 @fun112() {
ret i32 112
}

LLVM IR (-O2):
define i32 @fun112() {
ret i32 112
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int symlink(const char *path1, const char *path2) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<symlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<symlink>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @symlink(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @symlink(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ init();
int /*<<< orphan*/ initProgram();
int /*<<< orphan*/ introduce();
int /*<<< orphan*/ run();
int main(int argc, char const *argv[]) {
  introduce();
  initProgram();
  init();
  run();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <introduce@plt>
mov    $0x0,%al
call   1030 <initProgram@plt>
mov    $0x0,%al
call   1060 <init@plt>
mov    $0x0,%al
call   1040 <run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <introduce@plt>
xor    %eax,%eax
call   1030 <initProgram@plt>
xor    %eax,%eax
call   1060 <init@plt>
xor    %eax,%eax
call   1040 <run@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @introduce()
%4 = tail call i32 (...) @initProgram()
%5 = tail call i32 (...) @init()
%6 = tail call i32 (...) @run()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xb8() {
  Assert_real((isascii(184) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              925, ("isascii should be 0 for 0xb8"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xb8\00"
define void @t_isascii_0xb8() {
%1 = tail call i64 @isascii(i32 184)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 925, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int get_2_be(const unsigned char *ptr) {
  return ptr[1] | (ptr[0] << 8);
}


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

x86 assembly (clang, -O2):
<get_2_be>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @get_2_be(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @get_2_be(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = load i8, i8* %0
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int bar();
int main() {
  int x = (1) ? bar() : 0;
#pragma omp taskwait
  assert(x == 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = call i32 (...) @bar()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 2
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar()
%2 = icmp eq i32 %1, 2
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Variables and functions */
double my_random_double();
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ srandom(int);
main(int argc, char *argv[]) {
  int i;
  double f;
  double t0, t1;
  int iters = 1000;
  int seed = 17;
  srandom(seed);
  for (i = 0; i < iters; i++) {
    f = my_random_double();
    printf("%f\n", f);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3e8,-0x34(%rbp)
movl   $0x11,-0x38(%rbp)
mov    -0x38(%rbp),%edi
call   1030 <srandom@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    119a <main+0x6a>
mov    $0x0,%al
call   1050 <my_random_double@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1163 <main+0x33>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x11,%edi
call   1030 <srandom@plt>
mov    $0x3e8,%ebp
lea    0xeb7(%rip),%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <my_random_double@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @srandom(i32 17)
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %8, %4 ]
%6 = tail call double (...) @my_random_double()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %6)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, 1000
br i1 %9, label %10, label %4
10: ; preds = %4
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
gid_t getegid() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getegid() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t const);
void *malloc(size_t const);
int /*<<< orphan*/ stderr;
void *xmalloc(const size_t size) {
  void *result = malloc(size);
  if (!result) {
    fprintf(stderr, "No more memory available. Trying to allocate %zu bytes.",
            size);
    exit(1);
  }
  return result;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <xmalloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"No more memory available. Trying to allocate %zu bytes.\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"No more memory available. Trying to allocate %zu bytes.\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, unsigned int);
void repetition_encode(unsigned int _dec_msg_len, unsigned char *_msg_dec,
                       unsigned char *_msg_enc) {
  unsigned int i;
  for (i = 0; i < (3); i++) {
    memcpy(&_msg_enc[i * _dec_msg_len], _msg_dec, _dec_msg_len);
  }
}


x86 assembly (clang, -O0):
<repetition_encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jae    115e <repetition_encode+0x4e>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,%eax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <repetition_encode+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<repetition_encode>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %edi,%ebx
mov    %rdx,%rdi
mov    %ebx,%edx
call   1030 <memcpy@plt>
mov    %ebx,%edi
add    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
lea    (%rbx,%rbx,1),%edi
add    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @repetition_encode(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @memcpy(i8* %2, i8* %1, i32 %0)
%5 = zext i32 %0 to i64
%6 = getelementptr inbounds i8, i8* %2, i64 %5
%7 = tail call i32 @memcpy(i8* %6, i8* %1, i32 %0)
%8 = shl i32 %0, 1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %2, i64 %9
%11 = tail call i32 @memcpy(i8* %10, i8* %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ C_HEAT_Control_Boiler();
int /*<<< orphan*/ C_HEAT_Get_Actual_Temperature();
int /*<<< orphan*/ C_HEAT_Get_Required_Temperature();
int /*<<< orphan*/ C_HEAT_Init();
int /*<<< orphan*/ WATCHDOG_Feed();
void main(void) {
  C_HEAT_Init();
  while (1) {
    C_HEAT_Get_Required_Temperature();
    C_HEAT_Get_Actual_Temperature();
    C_HEAT_Control_Boiler();
    WATCHDOG_Feed();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <C_HEAT_Init@plt>
mov    $0x0,%al
call   1070 <C_HEAT_Get_Required_Temperature@plt>
mov    $0x0,%al
call   1050 <C_HEAT_Get_Actual_Temperature@plt>
mov    $0x0,%al
call   1040 <C_HEAT_Control_Boiler@plt>
mov    $0x0,%al
call   1060 <WATCHDOG_Feed@plt>
jmp    115b <main+0xb>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <C_HEAT_Init@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <C_HEAT_Get_Required_Temperature@plt>
xor    %eax,%eax
call   1050 <C_HEAT_Get_Actual_Temperature@plt>
xor    %eax,%eax
call   1040 <C_HEAT_Control_Boiler@plt>
xor    %eax,%eax
call   1060 <WATCHDOG_Feed@plt>
jmp    1160 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @C_HEAT_Init()
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @C_HEAT_Get_Required_Temperature()
%4 = call i32 (...) @C_HEAT_Get_Actual_Temperature()
%5 = call i32 (...) @C_HEAT_Control_Boiler()
%6 = call i32 (...) @WATCHDOG_Feed()
br label %2
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @C_HEAT_Init()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @C_HEAT_Get_Required_Temperature()
%4 = tail call i32 (...) @C_HEAT_Get_Actual_Temperature()
%5 = tail call i32 (...) @C_HEAT_Control_Boiler()
%6 = tail call i32 (...) @WATCHDOG_Feed()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ core10_print(char *, char const *);
void U_EMRPOLYPOLYGON16_print(const char *contents) {
  core10_print("U_EMRPOLYPOLYGON16", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRPOLYPOLYGON16_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <core10_print@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"U_EMRPOLYPOLYGON16\00"
define void @U_EMRPOLYPOLYGON16_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core10_print(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"U_EMRPOLYPOLYGON16\00"
define void @U_EMRPOLYPOLYGON16_print(i8* %0) {
%2 = tail call i32 @core10_print(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
size_t hash(const char *key) {
  const size_t base = 31;
  size_t h = 0;
  for (size_t coef = 1; *key; ++key) {
    h += *key * coef;
    coef *= base;
  }
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1f,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115c <hash+0x5c>
mov    -0x8(%rbp),%rax
movsbq (%rax),%rax
imul   -0x20(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
imul   $0x1f,-0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <hash+0x20>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%dl
test   %dl,%dl
je     1141 <hash+0x41>
add    $0x1,%rdi
mov    $0x1,%esi
xor    %eax,%eax
mov    %rsi,%rcx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbq %dl,%rdx
imul   %rsi,%rdx
add    %rdx,%rax
shl    $0x5,%rcx
sub    %rsi,%rcx
movzbl (%rdi),%edx
add    $0x1,%rdi
mov    %rcx,%rsi
test   %dl,%dl
jne    1120 <hash+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i64 [ 0, %1 ], [ %13, %6 ]
ret i64 %5
6: ; preds = %1, %6
%7 = phi i8 [ %16, %6 ], [ %2, %1 ]
%8 = phi i64 [ %14, %6 ], [ 1, %1 ]
%9 = phi i64 [ %13, %6 ], [ 0, %1 ]
%10 = phi i8* [ %15, %6 ], [ %0, %1 ]
%11 = sext i8 %7 to i64
%12 = mul i64 %8, %11
%13 = add i64 %12, %9
%14 = mul i64 %8, 31
%15 = getelementptr inbounds i8, i8* %10, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %4, label %6
}
void EmitAddEDI(int inc, unsigned char **storage) {
  if (!(*storage))
    return;
  (*((unsigned short *)*storage)) = 0xC781;
  *storage += 2;
  (*((unsigned int *)*storage)) = inc;
  *storage += 4;
}


x86 assembly (clang, -O0):
<EmitAddEDI>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    111e <EmitAddEDI+0x1e>
jmp    1152 <EmitAddEDI+0x52>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movw   $0xc781,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EmitAddEDI>:
mov    (%rsi),%rax
test   %rax,%rax
je     1117 <EmitAddEDI+0x17>
movw   $0xc781,(%rax)
mov    %edi,0x2(%rax)
add    $0x6,%rax
mov    %rax,(%rsi)
ret

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

LLVM IR (-O2):
define void @EmitAddEDI(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = bitcast i8* %3 to i16*
store i16 -14463, i16* %6
%7 = getelementptr inbounds i8, i8* %3, i64 2
%8 = bitcast i8* %7 to i32*
store i32 %0, i32* %8
%9 = getelementptr inbounds i8, i8* %3, i64 6
store i8* %9, i8** %1
br label %10
10: ; preds = %2, %5
ret void
}
void never_sampler_free(struct htrace_sampler *sampler) {}


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

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

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

LLVM IR (-O2):
%struct.htrace_sampler = type opaque
define void @never_sampler_free(%struct.htrace_sampler* nocapture %0) {
ret void
}
/* Variables and functions */
void *allocate(unsigned long, unsigned int);
void *newarray(unsigned long m, unsigned long n, unsigned a) {
  return allocate(m * n, a);
}


x86 assembly (clang, -O0):
<newarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <allocate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newarray>:
imul   %rsi,%rdi
mov    %edx,%esi
jmp    1030 <allocate@plt>

LLVM IR (-O0):
define i8* @newarray(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = mul i64 %7, %8
%10 = load i32, i32* %6
%11 = call i8* @allocate(i64 %9, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @newarray(i64 %0, i64 %1, i32 %2) {
%4 = mul i64 %1, %0
%5 = tail call i8* @allocate(i64 %4, i32 %2)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void print_indent(int indent) {
  for (int i = 0; i < indent; i++)
    putchar(' ');
}


x86 assembly (clang, -O0):
<print_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1146 <print_indent+0x36>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_indent>:
push   %rbx
test   %edi,%edi
jle    112f <print_indent+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <print_indent+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print_indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @putchar(i8 signext 32)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
void av_aes_ctr_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_aes_ctr_alloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
bool text_convert(const char *src, size_t srclen, char *dst, size_t dstlen) {
  bool ret = false;
  (void)src;
  (void)dst;
  (void)srclen;
  (void)dstlen;
  fprintf(stderr, "Error converting text. libiconv missing\n");
  return ret;
}


x86 assembly (clang, -O0):
<text_convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<text_convert>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"Error converting text. libiconv missing\0A\00"
define i32 @text_convert(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
store i32 0, i32* %9
%10 = load i8*, i8** %5
%11 = load i8*, i8** %7
%12 = load i64, i64* %6
%13 = load i64, i64* %8
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* %9
ret i32 %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Error converting text. libiconv missing\0A\00"
define i32 @text_convert(i8* nocapture readnone %0, i64 %1, i8* nocapture readnone %2, i64 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char *, struct stat *);
int isNotDir(char *d) {
  struct stat stat_buf;
  if (stat(d, &stat_buf) != 0)
    return 1;
  if (!S_ISDIR(stat_buf.st_mode))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isNotDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     114f <isNotDir+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1173 <isNotDir+0x53>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%eax
jne    116c <isNotDir+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1173 <isNotDir+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNotDir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <isNotDir+0x18>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @isNotDir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISDIR(i32 %8)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 1, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Type definitions */
struct parsed_arguments {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ arguments_clean(struct parsed_arguments *);
int /*<<< orphan*/ free(struct parsed_arguments *);
void free_arguments(struct parsed_arguments *args) {
  arguments_clean(args);
  free(args);
}


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

x86 assembly (clang, -O2):
<free_arguments>:
push   %rbx
mov    %rdi,%rbx
call   1040 <arguments_clean@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.parsed_arguments = type { i32 }
define void @free_arguments(%struct.parsed_arguments* %0) {
%2 = tail call i32 @arguments_clean(%struct.parsed_arguments* %0)
%3 = tail call i32 @free(%struct.parsed_arguments* %0)
ret void
}
int read32bit(char *buffer) {
  unsigned char *buf = (unsigned char *)buffer;
  return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24);
}


x86 assembly (clang, -O0):
<read32bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @read32bit(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %8, %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 16
%20 = or i32 %14, %19
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = shl i32 %24, 24
%26 = or i32 %20, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @read32bit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Type definitions */
struct timeval {
  unsigned long long tv_sec;
  unsigned long long tv_usec;
};

/* Variables and functions */
unsigned long __tv_to_jiffies(const struct timeval *tv) {
  unsigned long long jif;
  jif = 1000000ULL * tv->tv_sec + tv->tv_usec;
  return jif / 10000;
}


x86 assembly (clang, -O0):
<__tv_to_jiffies>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xf4240,(%rax),%rax
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x2710,%ecx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__tv_to_jiffies>:
imul   $0xf4240,(%rdi),%rax
add    0x8(%rdi),%rax
movabs $0x346dc5d63886594b,%rcx
c5 6d 34
mul    %rcx
mov    %rdx,%rax
shr    $0xb,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @__tv_to_jiffies(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca i64
store %struct.timeval* %0, %struct.timeval** %2
%4 = load %struct.timeval*, %struct.timeval** %2
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = mul i64 1000000, %6
%8 = load %struct.timeval*, %struct.timeval** %2
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
%10 = load i64, i64* %9
%11 = add i64 %7, %10
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = udiv i64 %12, 10000
ret i64 %13
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @__tv_to_jiffies(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%6 = load i64, i64* %5
%7 = add i64 %4, %6
%8 = udiv i64 %7, 10000
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ bar(unsigned int);
void foo(unsigned j) {
  unsigned i = j;
  bar(i);
  i = 10;
  bar(i);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <bar@plt>
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
call   1030 <bar@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @bar(i32 %5)
store i32 10, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @bar(i32 %7)
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = tail call i32 @bar(i32 %0)
%3 = tail call i32 @bar(i32 10)
ret void
}