xunge/DecIR huggingface dataset:
/* Variables and functions */
int lnewline();
int newline(int f, int n) {
  int s;
  if (n < 0)
    return (0);
  while (n--) {
    if ((s = lnewline()) != 1)
      return (s);
  }
  return (1);
}


x86 assembly (clang, -O0):
<newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1134 <newline+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1177 <newline+0x67>
jmp    1139 <newline+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1170 <newline+0x60>
mov    $0x0,%al
call   1030 <lnewline@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x1,%eax
je     116b <newline+0x5b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <newline+0x67>
jmp    1139 <newline+0x29>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newline>:
push   %rbx
test   %esi,%esi
js     1133 <newline+0x23>
mov    %esi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
add    $0xffffffff,%ebx
je     1137 <newline+0x27>
xor    %eax,%eax
call   1030 <lnewline@plt>
cmp    $0x1,%eax
je     1120 <newline+0x10>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @newline(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %7
%5 = phi i32 [ %8, %7 ], [ %1, %2 ]
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = add nsw i32 %5, -1
%9 = tail call i32 (...) @lnewline()
%10 = icmp eq i32 %9, 1
br i1 %10, label %4, label %11
11: ; preds = %4, %7, %2
%12 = phi i32 [ 0, %2 ], [ 1, %4 ], [ %9, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ matrix_get_rotation(float *, float const, float const,
                                       float const, float const);
int /*<<< orphan*/ matrix_multiply(float *, float *);
float *matrix_rotate(float matrix[4 * 4], const float angle, const float x,
                     const float y, const float z) {
  float matrix_tmp[4 * 4];
  matrix_get_rotation(matrix_tmp, angle, x, y, z);
  matrix_multiply(matrix, matrix_tmp);
  return matrix;
}


x86 assembly (clang, -O0):
<matrix_rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm3
call   1030 <matrix_get_rotation@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1040 <matrix_multiply@plt>
mov    -0x8(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_rotate>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <matrix_get_rotation@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <matrix_multiply@plt>
mov    %rbx,%rax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float* @matrix_rotate(float* %0, float %1, float %2, float %3, float %4) {
%6 = alloca float*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca [16 x float]
store float* %0, float** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%12 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 0
%13 = load float, float* %7
%14 = load float, float* %8
%15 = load float, float* %9
%16 = load float, float* %10
%17 = call i32 @matrix_get_rotation(float* %12, float %13, float %14, float %15, float %16)
%18 = load float*, float** %6
%19 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 0
%20 = call i32 @matrix_multiply(float* %18, float* %19)
%21 = load float*, float** %6
ret float* %21
}

LLVM IR (-O2):
define float* @matrix_rotate(float* returned %0, float %1, float %2, float %3, float %4) {
%6 = alloca [16 x float]
%7 = bitcast [16 x float]* %6 to i8*
%8 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 0
%9 = call i32 @matrix_get_rotation(float* %8, float %1, float %2, float %3, float %4)
%10 = call i32 @matrix_multiply(float* %0, float* %8)
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char, char);
char *byteorder_16(void) {
  static char buf[16 / 4 + 1];
  union {
    short int all;
    struct {
      char a;
      char b;
    };
  } test = {.all = 0x0102};
  sprintf(buf, "%02i%02i", test.a, test.b);
  return buf;
}


x86 assembly (clang, -O0):
<byteorder_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%ax
mov    %ax,-0x8(%rbp)
mov    -0x8(%rbp),%al
lea    0x2efc(%rip),%rdi
lea    0xece(%rip),%rsi
movsbl %al,%edx
movsbl -0x7(%rbp),%ecx
call   1030 <sprintf@plt>
lea    0x2ee2(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteorder_16>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%union.anon = type { i16 }
%struct.anon = type { i8, i8 }
@byteorder_16.buf = internal global [5 x i8] zeroinitializer
@__const.byteorder_16.test = %union.anon { i16 258 }
@.str = [9 x i8] c"%02i%02i\00"
define i8* @byteorder_16() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i8*
%3 = bitcast %union.anon* %1 to %struct.anon*
%4 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 0
%5 = load i8, i8* %4
%6 = bitcast %union.anon* %1 to %struct.anon*
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 1
%8 = load i8, i8* %7
%9 = call i32 @sprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @byteorder_16.buf, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %8)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @byteorder_16.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@byteorder_16.buf = internal global [5 x i8] zeroinitializer
@.str = [9 x i8] c"%02i%02i\00"
define i8* @byteorder_16() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @byteorder_16.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext 2, i8 signext 1)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @byteorder_16.buf, i64 0, i64 0)
}
/* Variables and functions */
bool is_hash_valid(long long int h) {
  if (h <= 7)
    return false;
  return true;
}


x86 assembly (clang, -O0):
<is_hash_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x7,-0x10(%rbp)
jg     111f <is_hash_valid+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1126 <is_hash_valid+0x26>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hash_valid>:
xor    %eax,%eax
cmp    $0x8,%rdi
setge  %al
ret

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

LLVM IR (-O2):
define i32 @is_hash_valid(i64 %0) {
%2 = icmp sgt i64 %0, 7
%3 = zext i1 %2 to i32
ret i32 %3
}
int hugo_hasvideo(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hugo_hasvideo() {
ret i32 0
}
/* Variables and functions */
int whoknows();
int example(void) {
  int y = whoknows();
  return y - y;
}


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

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

LLVM IR (-O0):
define i32 @example() {
%1 = alloca i32
%2 = call i32 (...) @whoknows()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @example() {
%1 = tail call i32 (...) @whoknows()
ret i32 0
}
void gc314StartCollection(int filedes) {
  int retval;
  int status = 0;
  int temp = 0;
}


x86 assembly (clang, -O0):
<gc314StartCollection>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @gc314StartCollection(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ ERR_GET_REASON(int /*<<< orphan*/);
scalar_t__ ERR_R_MALLOC_FAILURE;
int /*<<< orphan*/ ERR_peek_error();
int /*<<< orphan*/ ERR_peek_last_error();
int isMallocFailure(void) {
  if (ERR_GET_REASON(ERR_peek_error()) == ERR_R_MALLOC_FAILURE) {
    return 1;
  }
  if (ERR_GET_REASON(ERR_peek_last_error()) == ERR_R_MALLOC_FAILURE) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isMallocFailure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ERR_peek_error@plt>
mov    %eax,%edi
call   1050 <ERR_GET_REASON@plt>
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%rax
jne    1162 <isMallocFailure+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1193 <isMallocFailure+0x63>
mov    $0x0,%al
call   1030 <ERR_peek_last_error@plt>
mov    %eax,%edi
call   1050 <ERR_GET_REASON@plt>
mov    0x2e71(%rip),%rcx
cmp    (%rcx),%rax
jne    118c <isMallocFailure+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1193 <isMallocFailure+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isMallocFailure>:
push   %rbx
xor    %eax,%eax
call   1040 <ERR_peek_error@plt>
mov    %eax,%edi
call   1050 <ERR_GET_REASON@plt>
mov    %rax,%rcx
mov    0x2e9f(%rip),%rbx
mov    $0x1,%eax
cmp    (%rbx),%rcx
je     116c <isMallocFailure+0x3c>
xor    %eax,%eax
call   1030 <ERR_peek_last_error@plt>
mov    %eax,%edi
call   1050 <ERR_GET_REASON@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    (%rbx),%rcx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@ERR_R_MALLOC_FAILURE = global i64 0
define i32 @isMallocFailure() {
%1 = alloca i32
%2 = call i32 (...) @ERR_peek_error()
%3 = call i64 @ERR_GET_REASON(i32 %2)
%4 = load i64, i64* @ERR_R_MALLOC_FAILURE
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %14
7: ; preds = %0
%8 = call i32 (...) @ERR_peek_last_error()
%9 = call i64 @ERR_GET_REASON(i32 %8)
%10 = load i64, i64* @ERR_R_MALLOC_FAILURE
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %7
store i32 1, i32* %1
br label %14
13: ; preds = %7
store i32 0, i32* %1
br label %14
14: ; preds = %13, %12, %6
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@ERR_R_MALLOC_FAILURE = global i64 0
define i32 @isMallocFailure() {
%1 = tail call i32 (...) @ERR_peek_error()
%2 = tail call i64 @ERR_GET_REASON(i32 %1)
%3 = load i64, i64* @ERR_R_MALLOC_FAILURE
%4 = icmp eq i64 %2, %3
br i1 %4, label %11, label %5
5: ; preds = %0
%6 = tail call i32 (...) @ERR_peek_last_error()
%7 = tail call i64 @ERR_GET_REASON(i32 %6)
%8 = load i64, i64* @ERR_R_MALLOC_FAILURE
%9 = icmp eq i64 %7, %8
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %5, %0
%12 = phi i32 [ 1, %0 ], [ %10, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ system(char *);
void mkdir(char *s) {
  char shellCommand[64];
  sprintf(shellCommand, "mkdir %s", s);
  if (0 != system(shellCommand)) {
    puts("mkdir failed");
    exit(2);
  }
}


x86 assembly (clang, -O0):
<mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xea5(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1040 <system@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     118d <mkdir+0x4d>
lea    0xe8b(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1060 <exit@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdir>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rdx
lea    0xeb1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
test   %rax,%rax
jne    116d <mkdir+0x2d>
add    $0x40,%rsp
pop    %rbx
ret
lea    0xe95(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"mkdir %s\00"
@.str.1 = [13 x i8] c"mkdir failed\00"
define void @mkdir(i8* %0) {
%2 = alloca i8*
%3 = alloca [64 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = call i64 @system(i8* %7)
%9 = icmp ne i64 0, %8
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @exit(i32 2)
unreachable
13: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"mkdir %s\00"
@.str.1 = [13 x i8] c"mkdir failed\00"
define void @mkdir(i8* %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i64 @system(i8* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @exit(i32 2)
unreachable
10: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Emission(char *);
int /*<<< orphan*/ printf(char *);
deconnexion() {
  Emission("disconnect/;");
  printf("***************************\n vous ete maintenant deconnécté ,à "
         "bientot\n***************************\n");
}


x86 assembly (clang, -O0):
<deconnexion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <Emission@plt>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deconnexion>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <Emission@plt>
lea    0xed9(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"disconnect/;\00"
@.str.1 = [103 x i8] c"***************************\0A vous ete maintenant deconn\C3\A9ct\C3\A9 ,\C3\A0 bientot\0A***************************\0A\00"
define i32 @deconnexion() {
%1 = alloca i32
%2 = call i32 @Emission(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [13 x i8] c"disconnect/;\00"
@str = [102 x i8] c"***************************\0A vous ete maintenant deconn\C3\A9ct\C3\A9 ,\C3\A0 bientot\0A***************************\00"
define i32 @deconnexion() {
%1 = tail call i32 @Emission(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([102 x i8], [102 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
void *malloc(size_t);
void *ll_malloc(void *ud, size_t size) { return malloc(size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @ll_malloc(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
void SCB_InvalidateDCache(void) {}


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

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

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

LLVM IR (-O2):
define void @SCB_InvalidateDCache() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _mm_clzero(void *);
void test_mm_clzero(void *__m) { _mm_clzero(__m); }


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

x86 assembly (clang, -O2):
<test_mm_clzero>:
jmp    1030 <_mm_clzero@plt>

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

LLVM IR (-O2):
define void @test_mm_clzero(i8* %0) {
%2 = tail call i32 @_mm_clzero(i8* %0)
ret void
}
void __ZTimerInit(void) {}


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

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

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

LLVM IR (-O2):
define void @__ZTimerInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello");
  printf("small");
  printf("universe!");
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [6 x i8] c"small\00"
@.str.2 = [10 x i8] c"universe!\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [6 x i8] c"small\00"
@.str.2 = [10 x i8] c"universe!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ right(double);
int rotate_right(float degrees) {
  if (degrees < 0.0)
    degrees = degrees * (-1);
  if (degrees < 90.0) {
    right(degrees);
  } else {
    right(45.0);
    right(45.0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<rotate_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1145 <rotate_right+0x35>
movss  0xec5(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1173 <rotate_right+0x63>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <right@plt>
jmp    118d <rotate_right+0x7d>
movsd  0xe95(%rip),%xmm0
call   1030 <right@plt>
movsd  0xe88(%rip),%xmm0
call   1030 <right@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_right>:
push   %rax
movaps 0xee8(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movss  0xed9(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    1145 <rotate_right+0x35>
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
jmp    115a <rotate_right+0x4a>
movsd  0xecb(%rip),%xmm0
call   1030 <right@plt>
movsd  0xebe(%rip),%xmm0
call   1030 <right@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rotate_right(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %2
%8 = fmul float %7, -1.000000e+00
store float %8, float* %2
br label %9
9: ; preds = %6, %1
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = fcmp olt double %11, 9.000000e+01
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load float, float* %2
%15 = fpext float %14 to double
%16 = call i32 @right(double %15)
br label %20
17: ; preds = %9
%18 = call i32 @right(double 4.500000e+01)
%19 = call i32 @right(double 4.500000e+01)
br label %20
20: ; preds = %17, %13
ret i32 0
}

LLVM IR (-O2):
define i32 @rotate_right(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
%5 = fcmp olt float %4, 9.000000e+01
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = fpext float %4 to double
br label %10
8: ; preds = %1
%9 = tail call i32 @right(double 4.500000e+01)
br label %10
10: ; preds = %8, %6
%11 = phi double [ 4.500000e+01, %8 ], [ %7, %6 ]
%12 = tail call i32 @right(double %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hexdump_std(void const *, size_t, int /*<<< orphan*/,
                               int /*<<< orphan*/);
void hexdump(const void *data, size_t len) { hexdump_std(data, len, 0, 0); }


x86 assembly (clang, -O0):
<hexdump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <hexdump_std@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdump>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <hexdump_std@plt>

LLVM IR (-O0):
define void @hexdump(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @hexdump_std(i8* %5, i64 %6, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @hexdump(i8* %0, i64 %1) {
%3 = tail call i32 @hexdump_std(i8* %0, i64 %1, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int toupper(int);
void test_toupper_symbolic(int x) {
  int ret = toupper(x);
  (void)ret;
  clang_analyzer_eval(-1 <= x && x <= 255);
}


x86 assembly (clang, -O0):
<test_toupper_symbolic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x9(%rbp)
jg     1156 <test_toupper_symbolic+0x36>
cmpl   $0xff,-0x4(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_toupper_symbolic>:
add    $0x1,%edi
xor    %eax,%eax
cmp    $0x101,%edi
setb   %al
mov    %eax,%edi
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @test_toupper_symbolic(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @toupper(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp sle i32 -1, %7
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 255
br label %12
12: ; preds = %9, %1
%13 = phi i1 [ false, %1 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
%15 = call i32 @clang_analyzer_eval(i32 %14)
ret void
}

LLVM IR (-O2):
define void @test_toupper_symbolic(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 257
%4 = zext i1 %3 to i32
%5 = tail call i32 @clang_analyzer_eval(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fclose(void *);
void cleanup(void *p) { fclose(p); }


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

x86 assembly (clang, -O2):
<cleanup>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @cleanup(i8* nocapture %0) {
%2 = tail call i32 @fclose(i8* %0)
ret void
}
unsigned myStrlen(char *start) {
  char *cur = start;
  while (*cur) {
    ++cur;
  }
  return (unsigned int)(cur - start);
}


x86 assembly (clang, -O0):
<myStrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <myStrlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <myStrlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myStrlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <myStrlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @myStrlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int);
int time(int /*<<< orphan*/ *);
int main() {
  int sayi = time(NULL);
  srand(sayi);
  for (int i = 0; i < 15; i++) {
    printf("%d\n", rand() % 49 + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <srand@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xf,-0xc(%rbp)
jge    11a2 <main+0x62>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x31,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1,%esi
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116a <main+0x2a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0xf,%ebp
lea    0xea3(%rip),%rbx
nopl   (%rax)
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x5397829d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x31,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1160 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
br label %4
3: ; preds = %4
ret i32 0
4: ; preds = %0, %4
%5 = phi i32 [ 0, %0 ], [ %10, %4 ]
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 49
%8 = add nsw i32 %7, 1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, 15
br i1 %11, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
int BNCkHz() {
  int ii, stat = 99;
  char com1, data;
  BNCIO(11);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCkHz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x63,-0x8(%rbp)
mov    $0xb,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCkHz>:
push   %rax
mov    $0xb,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @BNCkHz() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 99, i32* %2
%5 = call i32 @BNCIO(i32 11)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BNCkHz() {
%1 = tail call i32 @BNCIO(i32 11)
ret i32 99
}
int add512(int a, int *b) {
  int c = a + 512;
  if (c != 0)
    *b = a;
  return c;
}


x86 assembly (clang, -O0):
<add512>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x200,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1129 <add512+0x29>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add512>:
mov    %edi,%eax
add    $0x200,%eax
je     110b <add512+0xb>
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define i32 @add512(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 = add nsw i32 %6, 512
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i32*, i32** %4
store i32 %11, i32* %12
br label %13
13: ; preds = %10, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @add512(i32 %0, i32* nocapture writeonly %1) {
%3 = add nsw i32 %0, 512
%4 = icmp eq i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %2
store i32 %0, i32* %1
br label %6
6: ; preds = %5, %2
ret i32 %3
}
unsigned char baddu4(long long a, long long b) { return a + b; }


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

x86 assembly (clang, -O2):
<baddu4>:
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define zeroext i8 @baddu4(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
%8 = trunc i64 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @baddu4(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
%4 = trunc i64 %3 to i8
ret i8 %4
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main(int argc, const char *argv[]) {
  int c;
  c = getchar();
  while (c != EOF) {
    putchar(c);
    c = getchar();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%eax
je     1169 <main+0x49>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
jmp    1140 <main+0x20>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @getchar()
store i32 %7, i32* %6
br label %8
8: ; preds = %12, %2
%9 = load i32, i32* %6
%10 = load i32, i32* @EOF
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32, i32* %6
%14 = call i32 @putchar(i32 %13)
%15 = call i32 (...) @getchar()
store i32 %15, i32* %6
br label %8
16: ; preds = %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @putchar(i32 %7)
%9 = tail call i32 (...) @getchar()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init();
void main() { init(); }


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

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @init()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @init()
ret void
}
extern void sfvfs_version2string(int version, char str[16]) {}


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

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

LLVM IR (-O0):
define void @sfvfs_version2string(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @sfvfs_version2string(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, int);
int /*<<< orphan*/ stderr;
void p(int x) { fprintf(stderr, "%c%d\n", 'p', x); }


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%ecx
lea    0xed2(%rip),%rsi
mov    $0x70,%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @p(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 112, i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @p(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 112, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
int iintminus(int x, int y) {
  x -= 24;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<iintminus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x18,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <iintminus+0x2a>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iintminus>:
push   %rbx
mov    %edi,%ebx
add    $0xffffffe8,%ebx
jne    111f <iintminus+0xf>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @iintminus(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -24
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
int global_fd_log();
int write(int, char *, int);
int print_cyan(int fd_out, char *str, unsigned long size) {
  write(fd_out, "\033[96m", 5);
  write(fd_out, str, size);
  write(global_fd_log(), str, size);
  return (write(fd_out, "\033[0m", 5));
}


x86 assembly (clang, -O0):
<print_cyan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    0xec3(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
call   1030 <write@plt>
mov    $0x0,%al
call   1040 <global_fd_log@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    0xe8b(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cyan>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecd(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <write@plt>
xor    %eax,%eax
call   1040 <global_fd_log@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <write@plt>
lea    0xea1(%rip),%rsi
mov    %ebp,%edi
mov    $0x5,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[96m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define i32 @print_cyan(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = call i32 @write(i32 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = trunc i64 %11 to i32
%13 = call i32 @write(i32 %9, i8* %10, i32 %12)
%14 = call i32 (...) @global_fd_log()
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = trunc i64 %16 to i32
%18 = call i32 @write(i32 %14, i8* %15, i32 %17)
%19 = load i32, i32* %4
%20 = call i32 @write(i32 %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret i32 %20
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[96m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define i32 @print_cyan(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%5 = trunc i64 %2 to i32
%6 = tail call i32 @write(i32 %0, i8* %1, i32 %5)
%7 = tail call i32 (...) @global_fd_log()
%8 = tail call i32 @write(i32 %7, i8* %1, i32 %5)
%9 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DAEMON;
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void init_log(void) { openlog("application", LOG_PID, LOG_DAEMON); }


x86 assembly (clang, -O0):
<init_log>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edx
lea    0xed3(%rip),%rdi
call   1030 <openlog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_log>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
lea    0xed7(%rip),%rdi
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"application\00"
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @init_log() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_DAEMON
%3 = call i32 @openlog(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"application\00"
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @init_log() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_DAEMON
%3 = tail call i32 @openlog(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(int);
int main() {
  int a = 1, b = 0, c;
  c = a ^ a;
  print("c 0");
  printid(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%edi
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"c 0\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
scalar_t__ malloc(int);
scalar_t__ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ u32toa(int /*<<< orphan*/, char *);
char *oat_get_timestamp() {
  char *out_str;
  out_str = (char *)malloc(16);
  u32toa((uint32_t)time(NULL), out_str);
  return out_str;
}


x86 assembly (clang, -O0):
<oat_get_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <u32toa@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oat_get_timestamp>:
push   %rbx
mov    $0x10,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <u32toa@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @oat_get_timestamp() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 16)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = call i64 @time(i32* null)
%5 = trunc i64 %4 to i32
%6 = load i8*, i8** %1
%7 = call i32 @u32toa(i32 %5, i8* %6)
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
define i8* @oat_get_timestamp() {
%1 = tail call i64 @malloc(i32 16)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @u32toa(i32 %4, i8* %2)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ test_file();
int /*<<< orphan*/ test_fork();
int /*<<< orphan*/ test_shm();
int /*<<< orphan*/ test_signal();
int /*<<< orphan*/ test_socket();
int /*<<< orphan*/ test_time();
int main(int argc, char **argv) {
  test_file();
  test_fork();
  test_time();
  test_socket();
  test_signal();
  test_shm();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <test_file@plt>
mov    $0x0,%al
call   1060 <test_fork@plt>
mov    $0x0,%al
call   1070 <test_time@plt>
mov    $0x0,%al
call   1080 <test_socket@plt>
mov    $0x0,%al
call   1040 <test_signal@plt>
mov    $0x0,%al
call   1030 <test_shm@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_file@plt>
xor    %eax,%eax
call   1060 <test_fork@plt>
xor    %eax,%eax
call   1070 <test_time@plt>
xor    %eax,%eax
call   1080 <test_socket@plt>
xor    %eax,%eax
call   1040 <test_signal@plt>
xor    %eax,%eax
call   1030 <test_shm@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_file()
%7 = call i32 (...) @test_fork()
%8 = call i32 (...) @test_time()
%9 = call i32 (...) @test_socket()
%10 = call i32 (...) @test_signal()
%11 = call i32 (...) @test_shm()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_file()
%4 = tail call i32 (...) @test_fork()
%5 = tail call i32 (...) @test_time()
%6 = tail call i32 (...) @test_socket()
%7 = tail call i32 (...) @test_signal()
%8 = tail call i32 (...) @test_shm()
ret i32 0
}
/* Variables and functions */
size_t min(size_t a, size_t b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}