xunge/DecIR huggingface dataset:
int EhTriangulo(int a, int b, int c) {
  int result;
  if (a > (b + c) || b > (a + c) || c > (a + b)) {
    result = 0;
  } else {
    result = 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<EhTriangulo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jg     1140 <EhTriangulo+0x40>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jg     1140 <EhTriangulo+0x40>
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jle    114c <EhTriangulo+0x4c>
movl   $0x0,-0x10(%rbp)
jmp    1153 <EhTriangulo+0x53>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EhTriangulo>:
lea    (%rdx,%rsi,1),%eax
cmp    %edi,%eax
setge  %al
lea    (%rdx,%rdi,1),%ecx
cmp    %esi,%ecx
setge  %cl
and    %al,%cl
add    %edi,%esi
cmp    %edx,%esi
setge  %al
and    %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @EhTriangulo(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %1
%5 = icmp sge i32 %4, %0
%6 = add nsw i32 %2, %0
%7 = icmp sge i32 %6, %1
%8 = select i1 %5, i1 %7, i1 false
%9 = add nsw i32 %1, %0
%10 = icmp sge i32 %9, %2
%11 = select i1 %8, i1 %10, i1 false
%12 = zext i1 %11 to i32
ret i32 %12
}
void sighup_handler(x) { log_close(); }


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

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

LLVM IR (-O0):
define void @sighup_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @log_close()
ret void
}

LLVM IR (-O2):
define void @sighup_handler(i32 %0) {
%2 = tail call i32 (...) @log_close()
ret void
}
int CLI_ExecCommand(char *path) {
  (void)path;
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @CLI_ExecCommand(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i32 -1
}

LLVM IR (-O2):
define i32 @CLI_ExecCommand(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ compileExpression3();
int /*<<< orphan*/ compileTerm();
void compileExpression2(void) {
  compileTerm();
  compileExpression3();
}


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

x86 assembly (clang, -O2):
<compileExpression2>:
push   %rax
xor    %eax,%eax
call   1040 <compileTerm@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <compileExpression3@plt>

LLVM IR (-O0):
define void @compileExpression2() {
%1 = call i32 (...) @compileTerm()
%2 = call i32 (...) @compileExpression3()
ret void
}

LLVM IR (-O2):
define void @compileExpression2() {
%1 = tail call i32 (...) @compileTerm()
%2 = tail call i32 (...) @compileExpression3()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ copy_file(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
void copy_file_2(char const *path, FILE *out) {
  FILE *in;
  if (!(in = fopen(path, "r")))
    return;
  copy_file(in, out);
  fclose(in);
}


x86 assembly (clang, -O0):
<copy_file_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1163 <copy_file_2+0x33>
jmp    1179 <copy_file_2+0x49>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <copy_file@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_file_2>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1165 <copy_file_2+0x35>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <copy_file@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define void @copy_file_2(i8* nocapture %0, i32* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @copy_file(i32* %3, i32* %1)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %2, %5
ret void
}
void h(i, c, d) int i;
char *c, *d;
{}


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

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

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

LLVM IR (-O2):
define void @h(i32 %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int toupper(int);
void test_toupper_concrete(int v) {
  int ret = toupper(256);
  (void)ret;
}


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

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

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

LLVM IR (-O2):
define void @test_toupper_concrete(i32 %0) {
ret void
}
long xToY(int x, unsigned y) {
  long i, val = 1;
  for (i = 0; i < y; ++i)
    val *= x;
  return val;
}


x86 assembly (clang, -O0):
<xToY>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
cmp    %rcx,%rax
jge    1148 <xToY+0x48>
movslq -0x4(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111a <xToY+0x1a>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xToY>:
test   %esi,%esi
je     111f <xToY+0x1f>
mov    %esi,%esi
movslq %edi,%rcx
lea    -0x1(%rsi),%rax
mov    %esi,%edx
and    $0x7,%edx
cmp    $0x7,%rax
jae    1125 <xToY+0x25>
mov    $0x1,%eax
jmp    1156 <xToY+0x56>
mov    $0x1,%eax
ret
and    $0xfffffff8,%esi
mov    $0x1,%eax
nopl   (%rax)
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
add    $0xfffffffffffffff8,%rsi
jne    1130 <xToY+0x30>
test   %rdx,%rdx
je     116a <xToY+0x6a>
nopl   0x0(%rax,%rax,1)
imul   %rcx,%rax
add    $0xffffffffffffffff,%rdx
jne    1160 <xToY+0x60>
ret

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

LLVM IR (-O2):
define i64 @xToY(i32 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = icmp eq i32 %1, 0
br i1 %4, label %35, label %5
5: ; preds = %2
%6 = sext i32 %0 to i64
%7 = add nsw i64 %3, -1
%8 = and i64 %3, 7
%9 = icmp ult i64 %7, 7
br i1 %9, label %25, label %10
10: ; preds = %5
%11 = and i64 %3, 4294967288
br label %12
12: ; preds = %12, %10
%13 = phi i64 [ 1, %10 ], [ %22, %12 ]
%14 = phi i64 [ 0, %10 ], [ %23, %12 ]
%15 = mul nsw i64 %13, %6
%16 = mul nsw i64 %15, %6
%17 = mul nsw i64 %16, %6
%18 = mul nsw i64 %17, %6
%19 = mul nsw i64 %18, %6
%20 = mul nsw i64 %19, %6
%21 = mul nsw i64 %20, %6
%22 = mul nsw i64 %21, %6
%23 = add i64 %14, 8
%24 = icmp eq i64 %23, %11
br i1 %24, label %25, label %12
25: ; preds = %12, %5
%26 = phi i64 [ undef, %5 ], [ %22, %12 ]
%27 = phi i64 [ 1, %5 ], [ %22, %12 ]
%28 = icmp eq i64 %8, 0
br i1 %28, label %35, label %29
29: ; preds = %25, %29
%30 = phi i64 [ %32, %29 ], [ %27, %25 ]
%31 = phi i64 [ %33, %29 ], [ 0, %25 ]
%32 = mul nsw i64 %30, %6
%33 = add i64 %31, 1
%34 = icmp eq i64 %33, %8
br i1 %34, label %35, label %29
35: ; preds = %25, %29, %2
%36 = phi i64 [ 1, %2 ], [ %26, %25 ], [ %32, %29 ]
ret i64 %36
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_help_warn_time(const char *def) {
  printf(" -w, --warning=time[d|h|m|s]\n      Return warning if elapsed time "
         "exceeds value. Defaults to %s\n",
         def);
}


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

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

LLVM IR (-O0):
@.str = [97 x i8] c" -w, --warning=time[d|h|m|s]\0A Return warning if elapsed time exceeds value. Defaults to %s\0A\00"
define void @print_help_warn_time(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [97 x i8] c" -w, --warning=time[d|h|m|s]\0A Return warning if elapsed time exceeds value. Defaults to %s\0A\00"
define void @print_help_warn_time(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void marca_ghost(char maze[23][30], int ghost[3]) {
  maze[ghost[0]][ghost[1]] = 'B';
}


x86 assembly (clang, -O0):
<marca_ghost>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
imul   $0x1e,%rcx,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
movslq 0x4(%rcx),%rcx
movb   $0x42,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<marca_ghost>:
movslq (%rsi),%rax
movslq 0x4(%rsi),%rcx
mov    %rax,%rdx
shl    $0x5,%rdx
sub    %rax,%rdx
sub    %rax,%rdx
add    %rdi,%rdx
movb   $0x42,(%rcx,%rdx,1)
ret

LLVM IR (-O0):
define void @marca_ghost([30 x i8]* %0, i32* %1) {
%3 = alloca [30 x i8]*
%4 = alloca i32*
store [30 x i8]* %0, [30 x i8]** %3
store i32* %1, i32** %4
%5 = load [30 x i8]*, [30 x i8]** %3
%6 = load i32*, i32** %4
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 %9
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [30 x i8], [30 x i8]* %10, i64 0, i64 %14
store i8 66, i8* %15
ret void
}

LLVM IR (-O2):
define void @marca_ghost([30 x i8]* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %0, i64 %4, i64 %7
store i8 66, i8* %8
ret void
}
/* Type definitions */
struct vec3i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec3i_lerp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ *, float);
__attribute__((always_)) struct vec3i *
psvec3i_lerp(struct vec3i *result, struct vec3i *a, struct vec3i *b, float p) {
  vec3i_lerp((int32_t *)result, (int32_t *)a, (int32_t *)b, p);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec3i_lerp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3i_lerp@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_lerp(%struct.vec3i* %0, %struct.vec3i* %1, %struct.vec3i* %2, float %3) {
%5 = alloca %struct.vec3i*
%6 = alloca %struct.vec3i*
%7 = alloca %struct.vec3i*
%8 = alloca float
store %struct.vec3i* %0, %struct.vec3i** %5
store %struct.vec3i* %1, %struct.vec3i** %6
store %struct.vec3i* %2, %struct.vec3i** %7
store float %3, float* %8
%9 = load %struct.vec3i*, %struct.vec3i** %5
%10 = bitcast %struct.vec3i* %9 to i32*
%11 = load %struct.vec3i*, %struct.vec3i** %6
%12 = bitcast %struct.vec3i* %11 to i32*
%13 = load %struct.vec3i*, %struct.vec3i** %7
%14 = bitcast %struct.vec3i* %13 to i32*
%15 = load float, float* %8
%16 = call i32 @vec3i_lerp(i32* %10, i32* %12, i32* %14, float %15)
%17 = load %struct.vec3i*, %struct.vec3i** %5
ret %struct.vec3i* %17
}

LLVM IR (-O2):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_lerp(%struct.vec3i* returned %0, %struct.vec3i* %1, %struct.vec3i* %2, float %3) {
%5 = getelementptr %struct.vec3i, %struct.vec3i* %0, i64 0, i32 0
%6 = getelementptr %struct.vec3i, %struct.vec3i* %1, i64 0, i32 0
%7 = getelementptr %struct.vec3i, %struct.vec3i* %2, i64 0, i32 0
%8 = tail call i32 @vec3i_lerp(i32* %5, i32* %6, i32* %7, float %3)
ret %struct.vec3i* %0
}
/* Variables and functions */
void recursive_wait_task(const size_t depth) {
  if (depth < 1000) {
#pragma omp task default(none) firstprivate(depth)
    { recursive_wait_task(depth + 1); }
#pragma omp taskwait
  }
}


x86 assembly (clang, -O0):
<recursive_wait_task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x3e8,-0x8(%rbp)
jae    1137 <recursive_wait_task+0x27>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <recursive_wait_task@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @recursive_wait_task(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ult i64 %3, 1000
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = add i64 %6, 1
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @recursive_wait_task(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 1;
  printf("%d", a << 2 + a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%ecx
add    $0x2,%ecx
shl    %cl,%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int fio_write_32(int /*<<< orphan*/ *, int, int);
scalar_t__ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int fio_abs_write_32(FILE *f, long offset, int is_big_endian, int val) {
  if (fseek(f, offset, SEEK_SET) != 0)
    return -1;
  return (fio_write_32(f, is_big_endian, val));
}


x86 assembly (clang, -O0):
<fio_abs_write_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
cmp    $0x0,%rax
je     1162 <fio_abs_write_32+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <fio_abs_write_32+0x54>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1030 <fio_write_32@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fio_abs_write_32>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %rdi,%rbx
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
test   %rax,%rax
je     1149 <fio_abs_write_32+0x29>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fio_write_32@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @fio_abs_write_32(i32* %0, i64 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %6
store i64 %1, i64* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32*, i32** %6
%11 = load i64, i64* %7
%12 = load i32, i32* @SEEK_SET
%13 = call i64 @fseek(i32* %10, i64 %11, i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %4
store i32 -1, i32* %5
br label %21
16: ; preds = %4
%17 = load i32*, i32** %6
%18 = load i32, i32* %8
%19 = load i32, i32* %9
%20 = call i32 @fio_write_32(i32* %17, i32 %18, i32 %19)
store i32 %20, i32* %5
br label %21
21: ; preds = %16, %15
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @fio_abs_write_32(i32* %0, i64 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @SEEK_SET
%6 = tail call i64 @fseek(i32* %0, i64 %1, i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @fio_write_32(i32* %0, i32 %2, i32 %3)
br label %10
10: ; preds = %4, %8
%11 = phi i32 [ %9, %8 ], [ -1, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
char Get_command(void) {
  char c;
  printf("Please enter a command (u, i, d, q):  ");
  scanf(" %c", &c);
  return c;
}


x86 assembly (clang, -O0):
<Get_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_command>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Please enter a command (u, i, d, q): \00"
@.str.1 = [4 x i8] c" %c\00"
define signext i8 @Get_command() {
%1 = alloca i8
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
@.str = [39 x i8] c"Please enter a command (u, i, d, q): \00"
@.str.1 = [4 x i8] c" %c\00"
define signext i8 @Get_command() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ gln_styled_string(int /*<<< orphan*/, char const *);
void gln_normal_string(const char *message) { gln_styled_string((0), message); }


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

x86 assembly (clang, -O2):
<gln_normal_string>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <gln_styled_string@plt>

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

LLVM IR (-O2):
define void @gln_normal_string(i8* %0) {
%2 = tail call i32 @gln_styled_string(i32 0, i8* %0)
ret void
}
int capable(int cap) {
  int a;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @capable(i32 %0) {
ret i32 undef
}
void fa13(void) {
a:
  goto a;
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa13>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa13+0x4>

x86 assembly (clang, -O2):
<fa13>:
jmp    1100 <fa13>

LLVM IR (-O0):
define void @fa13() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; preds = %8
br label %8
9: ; No predecessors!
br label %10
10: ; preds = %10, %9
br label %10
11: ; No predecessors!
br label %12
12: ; preds = %12, %11
br label %12
13: ; preds = %13
br label %13
14: ; No predecessors!
br label %15
15: ; preds = %15, %14
br label %15
16: ; preds = %16
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
br label %19
19: ; preds = %19, %18
br label %19
20: ; No predecessors!
br label %21
21: ; preds = %21, %20
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
br label %24
24: ; preds = %24, %23
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
27: ; preds = %27
br label %27
}

LLVM IR (-O2):
define void @fa13() {
br label %1
1: ; preds = %1, %0
br label %1
}
void fa153(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        a:
          goto a;
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa153>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa153+0x4>

x86 assembly (clang, -O2):
<fa153>:
jmp    1100 <fa153>

LLVM IR (-O0):
define void @fa153() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
27: ; preds = %27
br label %27
}

LLVM IR (-O2):
define void @fa153() {
br label %1
1: ; preds = %1, %0
br label %1
}
void OS_stopMusic(int id) {}


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

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

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

LLVM IR (-O2):
define void @OS_stopMusic(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned long);
int /*<<< orphan*/ stderr;
void print_address(void *address) {
  fprintf(stderr, "0x%012lx", (unsigned long)address);
}


x86 assembly (clang, -O0):
<print_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_address>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"0x%012lx\00"
define void @print_address(i8* %0) {
%2 = load i32, i32* @stderr
%3 = ptrtoint i8* %0 to i64
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flushline(int);
void print(void) { flushline(1); }


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

x86 assembly (clang, -O2):
<print>:
mov    $0x1,%edi
jmp    1030 <flushline@plt>

LLVM IR (-O0):
define void @print() {
%1 = call i32 @flushline(i32 1)
ret void
}

LLVM IR (-O2):
define void @print() {
%1 = tail call i32 @flushline(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ irc_reconnect(char *);
void child_reconnect(char *p) { irc_reconnect(p); }


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

x86 assembly (clang, -O2):
<child_reconnect>:
jmp    1030 <irc_reconnect@plt>

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

LLVM IR (-O2):
define void @child_reconnect(i8* %0) {
%2 = tail call i32 @irc_reconnect(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CTEST_ERR(char *, char const *, int);
void assert_null(void *real, const char *caller, int line) {
  if ((real) != NULL) {
    CTEST_ERR("%s:%d  should be NULL", caller, line);
  }
}


x86 assembly (clang, -O0):
<assert_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <assert_null+0x31>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xec4(%rip),%rdi
call   1030 <CTEST_ERR@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_null>:
test   %rdi,%rdi
je     1121 <assert_null+0x11>
lea    0xee4(%rip),%rdi
jmp    1030 <CTEST_ERR@plt>
ret

LLVM IR (-O0):
@.str = [22 x i8] c"%s:%d should be NULL\00"
define void @assert_null(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @CTEST_ERR(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11)
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"%s:%d should be NULL\00"
define void @assert_null(i8* readnone %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @CTEST_ERR(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
br label %7
7: ; preds = %5, %3
ret void
}
int _bit_pop(unsigned int x) {
  x = (x & 0x55555555) + ((x >> 1) & 0x55555555);
  x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
  x = (x & 0x0F0F0F0F) + ((x >> 4) & 0x0F0F0F0F);
  x = (x & 0x00FF00FF) + ((x >> 8) & 0x00FF00FF);
  x = (x & 0x0000FFFF) + ((x >> 16) & 0x0000FFFF);
  return x;
}


x86 assembly (clang, -O0):
<_bit_pop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55555555,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0f0f0f,%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
and    $0xf0f0f0f,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00ff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
and    $0xffff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_bit_pop>:
mov    %edi,%eax
and    $0x55555555,%eax
shr    %edi
and    $0x55555555,%edi
add    %edi,%eax
mov    %eax,%ecx
and    $0x33333333,%ecx
shr    $0x2,%eax
and    $0x33333333,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0x7070707,%ecx
shr    $0x4,%eax
and    $0x7070707,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0xf000f,%ecx
shr    $0x8,%eax
and    $0xf000f,%eax
add    %ecx,%eax
movzwl %ax,%ecx
shr    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_bit_pop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1431655765
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = and i32 %6, 1431655765
%8 = add i32 %4, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, 858993459
%11 = load i32, i32* %2
%12 = lshr i32 %11, 2
%13 = and i32 %12, 858993459
%14 = add i32 %10, %13
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = and i32 %15, 252645135
%17 = load i32, i32* %2
%18 = lshr i32 %17, 4
%19 = and i32 %18, 252645135
%20 = add i32 %16, %19
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = and i32 %21, 16711935
%23 = load i32, i32* %2
%24 = lshr i32 %23, 8
%25 = and i32 %24, 16711935
%26 = add i32 %22, %25
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = and i32 %27, 65535
%29 = load i32, i32* %2
%30 = lshr i32 %29, 16
%31 = and i32 %30, 65535
%32 = add i32 %28, %31
store i32 %32, i32* %2
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @_bit_pop(i32 %0) {
%2 = and i32 %0, 1431655765
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1431655765
%5 = add nuw i32 %4, %2
%6 = and i32 %5, 858993459
%7 = lshr i32 %5, 2
%8 = and i32 %7, 858993459
%9 = add nuw nsw i32 %8, %6
%10 = and i32 %9, 117901063
%11 = lshr i32 %9, 4
%12 = and i32 %11, 117901063
%13 = add nuw nsw i32 %12, %10
%14 = and i32 %13, 983055
%15 = lshr i32 %13, 8
%16 = and i32 %15, 983055
%17 = add nuw nsw i32 %16, %14
%18 = and i32 %17, 31
%19 = lshr i32 %17, 16
%20 = add nuw nsw i32 %18, %19
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
void vulnerable_function() {
  char buf[128];
  read(STDIN_FILENO, buf, 512);
}


x86 assembly (clang, -O0):
<vulnerable_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    -0x80(%rbp),%rsi
mov    $0x200,%edx
call   1030 <read@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vulnerable_function>:
sub    $0x88,%rsp
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
mov    $0x200,%edx
call   1030 <read@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define void @vulnerable_function() {
%1 = alloca [128 x i8]
%2 = load i32, i32* @STDIN_FILENO
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%4 = call i32 @read(i32 %2, i8* %3, i32 512)
ret void
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define void @vulnerable_function() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @STDIN_FILENO
%4 = call i32 @read(i32 %3, i8* %2, i32 512)
ret void
}
void tegra_io_dpd_disable(struct tegra_io_dpd *hnd) {}


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

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

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

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

/* Variables and functions */
uint32_t crc32cFinish(uint32_t crc) { return ~crc; }


x86 assembly (clang, -O0):
<crc32cFinish>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32cFinish>:
mov    %edi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @crc32cFinish(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
ret i32 %4
}

LLVM IR (-O2):
define i32 @crc32cFinish(i32 %0) {
%2 = xor i32 %0, -1
ret i32 %2
}
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_disable_back_to_sleep(void) {
  char ctlreg_1 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1B, &ctlreg_1, 1) == 0) {
    ctlreg_1 &= ~0x04;
    KIONIX_ACCEL_write_byte(0x1B, ctlreg_1);
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_disable_back_to_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1b,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
cmp    $0x0,%rax
jne    116d <KIONIX_ACCEL_disable_back_to_sleep+0x4d>
movsbl -0x1(%rbp),%eax
and    $0xfffffffb,%eax
mov    %al,-0x1(%rbp)
mov    $0x1b,%edi
movsbl -0x1(%rbp),%esi
call   1040 <KIONIX_ACCEL_write_byte@plt>
jmp    1174 <KIONIX_ACCEL_disable_back_to_sleep+0x54>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_disable_back_to_sleep>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1b,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
test   %rax,%rax
jne    1161 <KIONIX_ACCEL_disable_back_to_sleep+0x41>
movsbl 0xf(%rsp),%esi
and    $0xfffffffb,%esi
mov    %sil,0xf(%rsp)
mov    $0x1b,%edi
call   1040 <KIONIX_ACCEL_write_byte@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_disable_back_to_sleep() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i64 @KIONIX_ACCEL_read_bytes(i32 27, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = and i32 %7, -5
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = call i32 @KIONIX_ACCEL_write_byte(i32 27, i8 signext %10)
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_disable_back_to_sleep() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 27, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = and i8 %5, -5
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 27, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
/* Variables and functions */
int strlen(char *);
char *strndup(char *, int);
void strndup_1_Good() {
  char s1[] = "Hello Infer!";
  int len = strlen(s1);
  char *s2 = strndup(s1, len);
  for (int i = 0; i < len; i++) {
    s2[i] = 'a';
  }
}


x86 assembly (clang, -O0):
<strndup_1_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xd(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
lea    -0xd(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <strndup@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    118e <strndup_1_Good+0x6e>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x61,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1168 <strndup_1_Good+0x48>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup_1_Good>:
sub    $0x18,%rsp
movabs $0x217265666e4920,%rax
mov    %rax,0xd(%rsp)
movabs $0x6e49206f6c6c6548,%rax
20 49 6e
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <strlen@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.strndup_1_Good.s1 = [13 x i8] c"Hello Infer!\00"
define void @strndup_1_Good() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
ret void
}
unsigned long SDHostCardErrorMaskGet(unsigned long ulBase) {
  return ((*((volatile unsigned long *)(ulBase + 0x00000124))));
}


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

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

LLVM IR (-O0):
define i64 @SDHostCardErrorMaskGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 292
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @SDHostCardErrorMaskGet(i64 %0) {
%2 = add i64 %0, 292
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ list;

/* Variables and functions */
int llistxattr(char *, char *, int);
int main(void) {
  char list[1024];
  return llistxattr("/some/path/to/somewhere", list, sizeof(list));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rsi
lea    0xed0(%rip),%rdi
mov    $0x400,%edx
call   1030 <llistxattr@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x408,%rsp
lea    0xee2(%rip),%rdi
mov    %rsp,%rsi
mov    $0x400,%edx
call   1030 <llistxattr@plt>
add    $0x408,%rsp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"/some/path/to/somewhere\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @llistxattr(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %3, i32 1024)
ret i32 %4
}

LLVM IR (-O2):
@.str = [24 x i8] c"/some/path/to/somewhere\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @llistxattr(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %2, i32 1024)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ slAddHead(void *, void *);
void slSafeAddHead(void *listPt, void *node) { slAddHead(listPt, node); }


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

x86 assembly (clang, -O2):
<slSafeAddHead>:
jmp    1030 <slAddHead@plt>

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

LLVM IR (-O2):
define void @slSafeAddHead(i8* %0, i8* %1) {
%3 = tail call i32 @slAddHead(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *const, char *);
void print_bool(const char *const name, const bool val) {
  printf("   %-46s : constant boolean := %s;\n", name, val ? "true" : "false");
}


x86 assembly (clang, -O0):
<print_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%ecx
lea    0xefc(%rip),%rdx
lea    0xef0(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bool>:
mov    %rdi,%rax
test   %esi,%esi
lea    0xf0d(%rip),%rcx
lea    0xf01(%rip),%rdx
cmove  %rcx,%rdx
lea    0xed2(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c" %-46s : constant boolean := %s;\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define void @print_bool(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%10 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c" %-46s : constant boolean := %s;\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define void @print_bool(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
ret void
}
int range_endpoint_compare(void *i0, void *i1) {
  long *p0 = i0;
  long *p1 = i1;
  if (*p0 == *p1)
    return 0;
  else if (*p0 < *p1)
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<range_endpoint_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jne    113c <range_endpoint_compare+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1163 <range_endpoint_compare+0x63>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jge    115c <range_endpoint_compare+0x5c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <range_endpoint_compare+0x63>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_endpoint_compare>:
mov    (%rdi),%rax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%rax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @range_endpoint_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = icmp slt i64 %5, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ test_tree2list();
void run_tests() { test_tree2list(); }


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

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

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

LLVM IR (-O2):
define void @run_tests() {
%1 = tail call i32 (...) @test_tree2list()
ret void
}