xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ bar();
scalar_t__ foo();
int main() {
  int r = 0;
  r += bar();
  r += foo();
  r += bar();
  r += foo();
  r += bar();
  return r - 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1040 <foo@plt>
mov    %rax,%r15
add    %r14d,%r15d
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rax,%rbx
add    %r15d,%ebx
xor    %eax,%eax
call   1040 <foo@plt>
mov    %rax,%r14
add    %ebx,%r14d
xor    %eax,%eax
call   1030 <bar@plt>
add    %r14d,%eax
add    $0xfffffffe,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i64 (...) @bar()
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
%8 = call i64 (...) @foo()
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
%13 = call i64 (...) @bar()
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = add nsw i64 %15, %13
%17 = trunc i64 %16 to i32
store i32 %17, i32* %2
%18 = call i64 (...) @foo()
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = add nsw i64 %20, %18
%22 = trunc i64 %21 to i32
store i32 %22, i32* %2
%23 = call i64 (...) @bar()
%24 = load i32, i32* %2
%25 = sext i32 %24 to i64
%26 = add nsw i64 %25, %23
%27 = trunc i64 %26 to i32
store i32 %27, i32* %2
%28 = load i32, i32* %2
%29 = sub nsw i32 %28, 2
ret i32 %29
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @bar()
%2 = tail call i64 (...) @foo()
%3 = add i64 %2, %1
%4 = tail call i64 (...) @bar()
%5 = add i64 %3, %4
%6 = tail call i64 (...) @foo()
%7 = add i64 %5, %6
%8 = tail call i64 (...) @bar()
%9 = add i64 %7, %8
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %10, -2
ret i32 %11
}
void quat_ident(float *q) {
  q[0] = q[1] = q[2] = 0;
  q[3] = 1;
}


x86 assembly (clang, -O0):
<quat_ident>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0xec9(%rip),%xmm0
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<quat_ident>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @quat_ident(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 2
store float 0.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
store float 0.000000e+00, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 3
store float 1.000000e+00, float* %10
ret void
}

LLVM IR (-O2):
define void @quat_ident(float* nocapture writeonly %0) {
%2 = bitcast float* %0 to <4 x float>*
store <4 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00>, <4 x float>* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ system(char *);
main() {
  int Somma;
  int I;
  Somma = 0;
  I = 1;
  while (I <= 100) {
    Somma = Somma + I;
    I = I + 1;
  }
  printf("\nil valore della Somma è: %d", Somma);
  system("PAUSE");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jg     115e <main+0x3e>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
lea    0xeaa(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"\0Ail valore della Somma \C3\A8: %d\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
store i32 %10, i32* %2
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [30 x i8] c"\0Ail valore della Somma \C3\A8: %d\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 5050)
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned int state;
};
typedef TYPE_1__ XKeyPressedEvent;

/* Variables and functions */
void set_XKeyPressedEvent_state(void *_p, unsigned _v) {
  ((XKeyPressedEvent *)_p)->state = (unsigned)_v;
}


x86 assembly (clang, -O0):
<set_XKeyPressedEvent_state>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XKeyPressedEvent_state>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XKeyPressedEvent_state(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XKeyPressedEvent_state(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int main(void) {
  int x;
  x = 2;
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Type definitions */
struct virtual_node {
  int dummy;
};
struct virtual_item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ reiserfs_warning(char *);
int errcatch_create_vi(struct virtual_node *vn, struct virtual_item *vi,
                       int is_affected, int insert_size) {
  reiserfs_warning("green-16006: Invalid item type observed, run fsck ASAP\n");
  return 0;
}


x86 assembly (clang, -O0):
<errcatch_create_vi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <reiserfs_warning@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.virtual_node = type { i32 }
%struct.virtual_item = type { i32 }
@.str = [56 x i8] c"green-16006: Invalid item type observed, run fsck ASAP\0A\00"
define i32 @errcatch_create_vi(%struct.virtual_node* %0, %struct.virtual_item* %1, i32 %2, i32 %3) {
%5 = alloca %struct.virtual_node*
%6 = alloca %struct.virtual_item*
%7 = alloca i32
%8 = alloca i32
store %struct.virtual_node* %0, %struct.virtual_node** %5
store %struct.virtual_item* %1, %struct.virtual_item** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = call i32 @reiserfs_warning(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.virtual_node = type { i32 }
%struct.virtual_item = type { i32 }
@.str = [56 x i8] c"green-16006: Invalid item type observed, run fsck ASAP\0A\00"
define i32 @errcatch_create_vi(%struct.virtual_node* nocapture readnone %0, %struct.virtual_item* nocapture readnone %1, i32 %2, i32 %3) {
%5 = tail call i32 @reiserfs_warning(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
void putch_uart(uint8_t c) { putchar(c); }


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

x86 assembly (clang, -O2):
<putch_uart>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @putch_uart(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_log_set_target() {
  printf("NOT IMPLEMENTED:"
         "pa_log_set_target"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_log_set_target\0A\00"
define i32 @pa_log_set_target() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_log_set_target\00"
define i32 @pa_log_set_target() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  struct {
    int i, j;
  } a[] = {{1, 2}, {3, 4}};
  if (a[0].i != 1 || a[0].j != 2 || a[1].i != 3 || a[1].j != 4) {
    abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x20(%rbp)
jne    115d <main+0x4d>
cmpl   $0x2,-0x1c(%rbp)
jne    115d <main+0x4d>
cmpl   $0x3,-0x18(%rbp)
jne    115d <main+0x4d>
cmpl   $0x4,-0x14(%rbp)
je     1164 <main+0x54>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32, i32 }
@__const.main.a = [2 x %struct.anon] [%struct.anon { i32 1, i32 2 }, %struct.anon { i32 3, i32 4 }]
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x %struct.anon]
store i32 0, i32* %1
%3 = bitcast [2 x %struct.anon]* %2 to i8*
%4 = getelementptr inbounds [2 x %struct.anon], [2 x %struct.anon]* %2, i64 0, i64 0
%5 = getelementptr inbounds %struct.anon, %struct.anon* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 1
br i1 %7, label %23, label %8
8: ; preds = %0
%9 = getelementptr inbounds [2 x %struct.anon], [2 x %struct.anon]* %2, i64 0, i64 0
%10 = getelementptr inbounds %struct.anon, %struct.anon* %9, i32 0, i32 1
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 2
br i1 %12, label %23, label %13
13: ; preds = %8
%14 = getelementptr inbounds [2 x %struct.anon], [2 x %struct.anon]* %2, i64 0, i64 1
%15 = getelementptr inbounds %struct.anon, %struct.anon* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, 3
br i1 %17, label %23, label %18
18: ; preds = %13
%19 = getelementptr inbounds [2 x %struct.anon], [2 x %struct.anon]* %2, i64 0, i64 1
%20 = getelementptr inbounds %struct.anon, %struct.anon* %19, i32 0, i32 1
%21 = load i32, i32* %20
%22 = icmp ne i32 %21, 4
br i1 %22, label %23, label %25
23: ; preds = %18, %13, %8, %0
%24 = call i32 (...) @abort()
unreachable
25: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int BadFunc(float Val) {
  int Result;
  if (Val > 12.345)
    Result = 4;
  return Result;
}


x86 assembly (clang, -O0):
<BadFunc>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    112b <BadFunc+0x2b>
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @BadFunc(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 1.234500e+01
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 4, i32* %3
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @BadFunc(float %0) {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
char *strstr(char const *, char const *);
char *string_bypass(const char *s1, const char *s2) {
  char *p = strstr(s1, s2);
  if (p) {
    p += strlen(s2);
  }
  return p;
}


x86 assembly (clang, -O0):
<string_bypass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1165 <string_bypass+0x45>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_bypass>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <strstr@plt>
test   %rax,%rax
je     1143 <string_bypass+0x23>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
add    %rax,%rbx
jmp    1145 <string_bypass+0x25>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @string_bypass(i8* %0, i8* %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %1)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
br label %9
9: ; preds = %5, %2
%10 = phi i8* [ %8, %5 ], [ null, %2 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("I AM AN EVIL H4X0R PRGRAM!!!1!\n");
  return 1;
}


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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"I AM AN EVIL H4X0R PRGRAM!!!1!\0A\00"
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 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [31 x i8] c"I AM AN EVIL H4X0R PRGRAM!!!1!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a, b, c;
  a = 21;
  b = 5;
  c = a + b;
  printf("The sum is %d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x15,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xec0(%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    $0x1a,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"The sum is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 26)
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(unsigned char);
char *lskip(const char *s) {
  while (*s && isspace((unsigned char)(*s)))
    s++;
  return (char *)s;
}


x86 assembly (clang, -O0):
<lskip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <lskip+0x37>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <lskip+0x47>
jmp    1168 <lskip+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <lskip+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lskip>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <lskip+0x29>
nopw   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <lskip+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lskip+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @lskip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @isspace(i8 zeroext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @lskip(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 zeroext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint8_t;

/* Variables and functions */
void volatile_fetch_xor_u8(uint8_t *dest, uint8_t val) {
  *((volatile uint8_t *)dest) ^= val;
}


x86 assembly (clang, -O0):
<volatile_fetch_xor_u8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
xor    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<volatile_fetch_xor_u8>:
mov    %esi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
xor    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @volatile_fetch_xor_u8(i32* %0, i32 %1) {
%3 = alloca i32
store volatile i32 %1, i32* %3
%4 = load volatile i32, i32* %3
%5 = load volatile i32, i32* %0
%6 = xor i32 %5, %4
store volatile i32 %6, i32* %0
ret void
}
/* Variables and functions */
int nrf_read_register(int, char *, char *);
int nrf_write_register(int, char, char *);
int nrf_clear_tx_ds(char *retstatus) {
  int ret;
  char statusreg;
  ret = nrf_read_register(0x07, &statusreg, retstatus);
  if (ret < 0)
    return ret;
  statusreg |= 0x20;
  ret = nrf_write_register(0x07, statusreg, retstatus);
  return ret;
}


x86 assembly (clang, -O0):
<nrf_clear_tx_ds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x7,%edi
lea    -0x15(%rbp),%rsi
call   1040 <nrf_read_register@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1156 <nrf_clear_tx_ds+0x36>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <nrf_clear_tx_ds+0x5d>
movsbl -0x15(%rbp),%eax
or     $0x20,%eax
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
mov    -0x10(%rbp),%rdx
mov    $0x7,%edi
movsbl %al,%esi
call   1030 <nrf_write_register@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_clear_tx_ds>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf(%rsp),%rsi
mov    $0x7,%edi
mov    %rbx,%rdx
call   1040 <nrf_read_register@plt>
test   %eax,%eax
js     1158 <nrf_clear_tx_ds+0x38>
movsbl 0xf(%rsp),%esi
or     $0x20,%esi
mov    %sil,0xf(%rsp)
mov    $0x7,%edi
mov    %rbx,%rdx
call   1030 <nrf_write_register@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nrf_clear_tx_ds(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @nrf_read_register(i32 7, i8* %5, i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %21
12: ; preds = %1
%13 = load i8, i8* %5
%14 = sext i8 %13 to i32
%15 = or i32 %14, 32
%16 = trunc i32 %15 to i8
store i8 %16, i8* %5
%17 = load i8, i8* %5
%18 = load i8*, i8** %3
%19 = call i32 @nrf_write_register(i32 7, i8 signext %17, i8* %18)
store i32 %19, i32* %4
%20 = load i32, i32* %4
store i32 %20, i32* %2
br label %21
21: ; preds = %12, %10
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @nrf_clear_tx_ds(i8* %0) {
%2 = alloca i8
%3 = call i32 @nrf_read_register(i32 7, i8* %2, i8* %0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i8, i8* %2
%7 = or i8 %6, 32
store i8 %7, i8* %2
%8 = call i32 @nrf_write_register(i32 7, i8 signext %7, i8* %0)
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ %3, %1 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int hecmw_write_bin_value(unsigned char *, int, int /*<<< orphan*/ *);
int hecmw_write_bin_int(int x, FILE *fp) {
  long xx = x;
  return hecmw_write_bin_value((unsigned char *)&xx, sizeof(long), fp);
}


x86 assembly (clang, -O0):
<hecmw_write_bin_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x8,%esi
call   1030 <hecmw_write_bin_value@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hecmw_write_bin_int>:
push   %rax
mov    %rsi,%rdx
movslq %edi,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <hecmw_write_bin_value@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hecmw_write_bin_int(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i64
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
store i64 %7, i64* %5
%8 = bitcast i64* %5 to i8*
%9 = load i32*, i32** %4
%10 = call i32 @hecmw_write_bin_value(i8* %8, i32 8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @hecmw_write_bin_int(i32 %0, i32* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = sext i32 %0 to i64
store i64 %5, i64* %3
%6 = call i32 @hecmw_write_bin_value(i8* %4, i32 8, i32* %1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ put16(int, int);
void mcb_set_owner(int mcb, int owner) {
  if (mcb < 0)
    return;
  put16(mcb * 16 + 1, owner);
}


x86 assembly (clang, -O0):
<mcb_set_owner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112d <mcb_set_owner+0x1d>
jmp    113e <mcb_set_owner+0x2e>
mov    -0x4(%rbp),%edi
shl    $0x4,%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1030 <put16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcb_set_owner>:
test   %edi,%edi
js     111f <mcb_set_owner+0xf>
shl    $0x4,%edi
or     $0x1,%edi
jmp    1030 <put16@plt>
ret

LLVM IR (-O0):
define void @mcb_set_owner(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 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %14
8: ; preds = %2
%9 = load i32, i32* %3
%10 = mul nsw i32 %9, 16
%11 = add nsw i32 %10, 1
%12 = load i32, i32* %4
%13 = call i32 @put16(i32 %11, i32 %12)
br label %14
14: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @mcb_set_owner(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = shl nsw i32 %0, 4
%6 = or i32 %5, 1
%7 = tail call i32 @put16(i32 %6, i32 %1)
br label %8
8: ; preds = %2, %4
ret void
}
void foo114(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo114(i32 %0) {
ret void
}
int _write_r(struct _reent *r, int file, char *ptr, int len) {
  r = r;
  file = file;
  ptr = ptr;
  return len;
}


x86 assembly (clang, -O0):
<_write_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct._reent = type opaque
define i32 @_write_r(%struct._reent* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct._reent*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct._reent* %0, %struct._reent** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct._reent*, %struct._reent** %5
store %struct._reent* %9, %struct._reent** %5
%10 = load i32, i32* %6
store i32 %10, i32* %6
%11 = load i8*, i8** %7
store i8* %11, i8** %7
%12 = load i32, i32* %8
ret i32 %12
}

LLVM IR (-O2):
%struct._reent = type opaque
define i32 @_write_r(%struct._reent* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 returned %3) {
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
void *count_times(void *args) {
  int i = 1;
  while (1) {
    sleep(1);
    fprintf(stderr, "second: %d\n", i++);
  }
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<count_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    %eax,-0xc(%rbp)
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1133 <count_times+0x13>

x86 assembly (clang, -O2):
<count_times>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
mov    0x2ead(%rip),%r15
lea    0xec6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    (%r15),%edi
lea    0x1(%rbx),%ebp
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    %ebp,%ebx
jmp    1140 <count_times+0x20>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"second: %d\0A\00"
define i8* @count_times(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %3
br label %4
4: ; preds = %1, %4
%5 = call i32 @sleep(i32 1)
%6 = load i32, i32* @stderr
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
store i32 %8, i32* %3
%9 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %4
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"second: %d\0A\00"
define noalias i8* @count_times(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %6, %2 ]
%4 = tail call i32 @sleep(i32 1)
%5 = load i32, i32* @stderr
%6 = add nuw nsw i32 %3, 1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ read_bmp(char *, unsigned char ***);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  unsigned char ***image;
  if (argc != 2) {
    fprintf(stderr, "Usage:\t %s [input_bmp_file]\n", argv[0]);
    return 7;
  }
  read_bmp(argv[1], image);
  return 0;
}


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)
cmpl   $0x2,-0x8(%rbp)
je     1168 <main+0x48>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x7,-0x4(%rbp)
jmp    1180 <main+0x60>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <read_bmp@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1133 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <read_bmp@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x7,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Usage:\09 %s [input_bmp_file]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8***
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %13)
store i32 7, i32* %3
br label %21
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = load i8***, i8**** %6
%20 = call i32 @read_bmp(i8* %18, i8*** %19)
store i32 0, i32* %3
br label %21
21: ; preds = %15, %9
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Usage:\09 %s [input_bmp_file]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %12
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @read_bmp(i8* %10, i8*** undef)
br label %12
12: ; preds = %8, %4
%13 = phi i32 [ 7, %4 ], [ 0, %8 ]
ret i32 %13
}
int cmd_get_poll_result() { return 1; }


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

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

LLVM IR (-O0):
define i32 @cmd_get_poll_result() {
ret i32 1
}

LLVM IR (-O2):
define i32 @cmd_get_poll_result() {
ret i32 1
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncasecmp(char *, char *, int);
char *parser_check_configitem(char *line, char *config) {
  int len;
  len = strlen(config);
  if (!strncasecmp(line, config, len)) {
    return line + len;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<parser_check_configitem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <strncasecmp@plt>
cmp    $0x0,%eax
jne    1169 <parser_check_configitem+0x49>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <parser_check_configitem+0x51>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_check_configitem>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncasecmp@plt>
movslq %ebp,%rdx
add    %r14,%rdx
xor    %ecx,%ecx
test   %eax,%eax
cmove  %rdx,%rcx
mov    %rcx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @parser_check_configitem(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strncasecmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, 0
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = select i1 %5, i8* %7, i8* null
ret i8* %8
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void USBHostResume(uint32_t ui32Base, bool bStart) {
  ASSERT(ui32Base == 0x40050000);
  if (bStart) {
    (*((volatile uint8_t *)(ui32Base + 0x00000001))) |= 0x00000004;
  } else {
    (*((volatile uint8_t *)(ui32Base + 0x00000001))) &= ~0x00000004;
  }
}


x86 assembly (clang, -O0):
<USBHostResume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x0,-0x8(%rbp)
je     1150 <USBHostResume+0x40>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
mov    (%rax),%ecx
or     $0x4,%ecx
mov    %ecx,(%rax)
jmp    115f <USBHostResume+0x4f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffffb,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostResume>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %ebx,%ebx
test   %esi,%esi
setne  %bl
xor    %edi,%edi
cmp    $0x40050000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
mov    0x1(%rax),%ecx
and    $0xfffffffb,%ecx
lea    (%rcx,%rbx,4),%ecx
mov    %ecx,0x1(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @USBHostResume(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 = icmp eq i32 %5, 1074069504
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = or i32 %16, 4
store volatile i32 %17, i32* %15
br label %25
18: ; preds = %2
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
%23 = load volatile i32, i32* %22
%24 = and i32 %23, -5
store volatile i32 %24, i32* %22
br label %25
25: ; preds = %18, %11
ret void
}

LLVM IR (-O2):
define void @USBHostResume(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1074069504
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = icmp eq i32 %1, 0
%7 = add nsw i32 %0, 1
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, -5
%12 = select i1 %6, i32 0, i32 4
%13 = or i32 %11, %12
store volatile i32 %13, i32* %9
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int const);
int imm(uint16_t pc, const uint8_t *ram, char *buffer) {
  sprintf(buffer, "#%02x", *ram);
  return 1;
}


x86 assembly (clang, -O0):
<imm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xecc(%rip),%rsi
call   1030 <sprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm>:
push   %rax
mov    %rdx,%rdi
mov    (%rsi),%edx
lea    0xee3(%rip),%rsi
call   1030 <sprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"#%02x\00"
define i32 @imm(i32 %0, i32* nocapture %1, i8* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 1
}
int bics_si_test2(int a, int b, int c) {
  int d = a & ~(b << 3);
  if (d == 0)
    return a + c;
  else
    return d;
}


x86 assembly (clang, -O0):
<bics_si_test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1136 <bics_si_test2+0x36>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113c <bics_si_test2+0x3c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bics_si_test2>:
lea    0x0(,%rsi,8),%ecx
not    %ecx
and    %edi,%ecx
lea    (%rdx,%rdi,1),%eax
test   %ecx,%ecx
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bics_si_test2(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 3
%5 = xor i32 %4, -1
%6 = and i32 %5, %0
%7 = icmp eq i32 %6, 0
%8 = add nsw i32 %2, %0
%9 = select i1 %7, i32 %8, i32 %6
ret i32 %9
}
int f1(int dw) { return (32 * ((dw + 1) & 0x1) + dw) >> 1; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
and    $0x1,%eax
shl    $0x5,%eax
add    -0x4(%rbp),%eax
sar    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %edi,%eax
shl    $0x5,%eax
not    %eax
and    $0x20,%eax
add    %edi,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @f1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = and i32 %4, 1
%6 = mul nsw i32 32, %5
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
%9 = ashr i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = shl i32 %0, 5
%3 = and i32 %2, 32
%4 = xor i32 %3, 32
%5 = add nsw i32 %4, %0
%6 = ashr i32 %5, 1
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ print_ophead(int /*<<< orphan*/, char const *, int);
int /*<<< orphan*/ printf(char *);
void print_noarg(uint16_t op, const char *name, int index) {
  print_ophead(op, name, index);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_noarg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <print_ophead@plt>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @print_noarg(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @print_ophead(i32 %0, i8* %1, i32 %2)
%5 = tail call i32 @putchar(i32 10)
ret void
}
float test_01(float a) { return a * a + a; }


x86 assembly (clang, -O0):
<test_01>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_01>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @test_01(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = call float @llvm.fmuladd.f32(float %3, float %4, float %5)
ret float %6
}

LLVM IR (-O2):
define float @test_01(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %0)
ret float %2
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int errno;
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/, int /*<<< orphan*/);
pid_t setsid() {
  int ret = syscall(60, 0, 0, 0, 0, 0);
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<setsid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3c,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <syscall@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1158 <setsid+0x48>
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
mov    0x2e96(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <setsid+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setsid>:
push   %rax
mov    $0x3c,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
test   %eax,%eax
js     112d <setsid+0x1d>
pop    %rcx
ret
neg    %eax
mov    0x2eaa(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @setsid() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @syscall(i32 60, i32 0, i32 0, i32 0, i32 0, i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = sub nsw i32 0, %7
store i32 %8, i32* @errno
store i32 -1, i32* %1
br label %11
9: ; preds = %0
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @setsid() {
%1 = tail call i32 @syscall(i32 60, i32 0, i32 0, i32 0, i32 0, i32 0)
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = sub nsw i32 0, %1
store i32 %4, i32* @errno
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ -1, %3 ], [ %1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void delay(int t) { usleep(t * 1000); }


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
void val_delete_uttfunc(void *v) { (void)v; }


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

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

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

LLVM IR (-O2):
define void @val_delete_uttfunc(i8* nocapture %0) {
ret void
}