xunge/DecIR huggingface dataset:
int main() {
  struct base {
    int basic;
  };
  struct derived {
    struct base common;
    char extra;
  };
  struct derived d;
  struct base *bp;
  bp = (struct base *)&d;
  bp->basic = 10;
  ((struct derived *)bp)->extra = 'x';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x78,0x4(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.derived = type { %struct.base, i8 }
%struct.base = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.derived
%3 = alloca %struct.base*
store i32 0, i32* %1
%4 = bitcast %struct.derived* %2 to %struct.base*
store %struct.base* %4, %struct.base** %3
%5 = load %struct.base*, %struct.base** %3
%6 = getelementptr inbounds %struct.base, %struct.base* %5, i32 0, i32 0
store i32 10, i32* %6
%7 = load %struct.base*, %struct.base** %3
%8 = bitcast %struct.base* %7 to %struct.derived*
%9 = getelementptr inbounds %struct.derived, %struct.derived* %8, i32 0, i32 1
store i8 120, i8* %9
ret i32 0
}

LLVM IR (-O2):
%struct.base = type { i32 }
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ libev_unregister_tcp_unix_sock(int, void *);
void libev_unix_tcp_deinit(void *ctx, int sock) {
  close(sock);
  libev_unregister_tcp_unix_sock(sock, ctx);
}


x86 assembly (clang, -O0):
<libev_unix_tcp_deinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <libev_unregister_tcp_unix_sock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libev_unix_tcp_deinit>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <close@plt>
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <libev_unregister_tcp_unix_sock@plt>

LLVM IR (-O0):
define void @libev_unix_tcp_deinit(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 = call i32 @close(i32 %5)
%7 = load i32, i32* %4
%8 = load i8*, i8** %3
%9 = call i32 @libev_unregister_tcp_unix_sock(i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @libev_unix_tcp_deinit(i8* %0, i32 %1) {
%3 = tail call i32 @close(i32 %1)
%4 = tail call i32 @libev_unregister_tcp_unix_sock(i32 %1, i8* %0)
ret void
}
/* Variables and functions */
float cellNoiseU(float, float, float);
float cellNoise(float x, float y, float z) {
  return (2.0f * cellNoiseU(x, y, z) - 1.0f);
}


x86 assembly (clang, -O0):
<cellNoise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <cellNoiseU@plt>
addss  %xmm0,%xmm0
movss  0xeb9(%rip),%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cellNoise>:
push   %rax
call   1030 <cellNoiseU@plt>
addss  %xmm0,%xmm0
addss  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @cellNoise(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @cellNoiseU(float %7, float %8, float %9)
%11 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %10, float -1.000000e+00)
ret float %11
}

LLVM IR (-O2):
define float @cellNoise(float %0, float %1, float %2) {
%4 = tail call float @cellNoiseU(float %0, float %1, float %2)
%5 = tail call float @llvm.fmuladd.f32(float %4, float 2.000000e+00, float -1.000000e+00)
ret float %5
}
double min_4(const double *ptr) {
  double retval = ptr[0];
  int i;
  for (i = 1; i < 4; ++i) {
    if (ptr[i] < retval) {
      retval = ptr[i];
    }
  }
  return retval;
}


x86 assembly (clang, -O0):
<min_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1167 <min_4+0x67>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1154 <min_4+0x54>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1159 <min_4+0x59>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <min_4+0x1c>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @min_4(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fcmp olt double %4, %2
%6 = select i1 %5, double %4, double %2
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = fcmp olt double %8, %6
%10 = select i1 %9, double %8, double %6
%11 = getelementptr inbounds double, double* %0, i64 3
%12 = load double, double* %11
%13 = fcmp olt double %12, %10
%14 = select i1 %13, double %12, double %10
ret double %14
}
int __svgalib_laguna_ingra(int index) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__svgalib_laguna_ingra(i32 %0) {
ret i32 0
}
/* Type definitions */
struct magic_set {
  int dummy;
};

/* Variables and functions */
char const *file_or_fd(struct magic_set *, char const *, int /*<<< orphan*/);
const char *magic_file(struct magic_set *ms, const char *inname) {
  return file_or_fd(ms, inname, 0);
}


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

x86 assembly (clang, -O2):
<magic_file>:
xor    %edx,%edx
jmp    1030 <file_or_fd@plt>

LLVM IR (-O0):
%struct.magic_set = type { i32 }
define i8* @magic_file(%struct.magic_set* %0, i8* %1) {
%3 = alloca %struct.magic_set*
%4 = alloca i8*
store %struct.magic_set* %0, %struct.magic_set** %3
store i8* %1, i8** %4
%5 = load %struct.magic_set*, %struct.magic_set** %3
%6 = load i8*, i8** %4
%7 = call i8* @file_or_fd(%struct.magic_set* %5, i8* %6, i32 0)
ret i8* %7
}

LLVM IR (-O2):
%struct.magic_set = type { i32 }
define i8* @magic_file(%struct.magic_set* %0, i8* %1) {
%3 = tail call i8* @file_or_fd(%struct.magic_set* %0, i8* %1, i32 0)
ret i8* %3
}
/* Variables and functions */
unsigned int __bswap_32(int);
int __test() {
  unsigned x = __bswap_32(0xFFFF);
  return x;
}


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

x86 assembly (clang, -O2):
<__test>:
mov    $0xffff,%edi
jmp    1030 <__bswap_32@plt>

LLVM IR (-O0):
define i32 @__test() {
%1 = alloca i32
%2 = call i32 @__bswap_32(i32 65535)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @__test() {
%1 = tail call i32 @__bswap_32(i32 65535)
ret i32 %1
}
/* Variables and functions */
int FE_TONEAREST;
int __fesetround(int);
int fesetround(int r) {
  if (r != FE_TONEAREST)
    return -1;
  return __fesetround(r);
}


x86 assembly (clang, -O0):
<fesetround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
je     1139 <fesetround+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    1144 <fesetround+0x34>
mov    -0x8(%rbp),%edi
call   1030 <__fesetround@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fesetround>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1120 <fesetround+0x10>
jmp    1030 <__fesetround@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@FE_TONEAREST = global i32 0
define i32 @fesetround(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @FE_TONEAREST
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @__fesetround(i32 %9)
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@FE_TONEAREST = global i32 0
define i32 @fesetround(i32 %0) {
%2 = load i32, i32* @FE_TONEAREST
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @__fesetround(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ abort();
f() {
  int x[][2] = {1, 2, 3, 4};
  if (x[0][0] != 1 || x[0][1] != 2 || x[1][0] != 3 || x[1][1] != 4)
    abort();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x20(%rbp)
jne    1156 <f+0x46>
cmpl   $0x2,-0x1c(%rbp)
jne    1156 <f+0x46>
cmpl   $0x3,-0x18(%rbp)
jne    1156 <f+0x46>
cmpl   $0x4,-0x14(%rbp)
je     115d <f+0x4d>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.f.x = [2 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4]]
define i32 @f() {
%1 = alloca i32
%2 = alloca [2 x [2 x i32]]
%3 = bitcast [2 x [2 x i32]]* %2 to i8*
%4 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 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 [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 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 [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 1
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %14, i64 0, i64 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 [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 1
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0, i64 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
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
/* Type definitions */
struct ifreq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ifreq *);
void __if_freereq(struct ifreq *ifreqs, int num_ifs) { free(ifreqs); }


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

x86 assembly (clang, -O2):
<__if_freereq>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.ifreq = type { i32 }
define void @__if_freereq(%struct.ifreq* nocapture %0, i32 %1) {
%3 = tail call i32 @free(%struct.ifreq* %0)
ret void
}
__attribute__((no)) void func() {
  asm("func_label: .globl func_label");
  asm("" ::: "memory");
  return;
}


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

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

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

LLVM IR (-O2):
define void @func() {
tail call void asm sideeffect "func_label: .globl func_label", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void Usage(char prog_name[]) {
  fprintf(stderr, "usage: %s ", prog_name);
  fprintf(stderr,
          "<bin_count> <min_meas> <max_meas> <data_count> <thread_count>\n");
  exit(0);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"usage: %s \00"
@.str.1 = [63 x i8] c"<bin_count> <min_meas> <max_meas> <data_count> <thread_count>\0A\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"usage: %s \00"
@.str.1 = [63 x i8] c"<bin_count> <min_meas> <max_meas> <data_count> <thread_count>\0A\00"
define void @Usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ erdl_coeff(double, double, double, double *, double *,
                              double *);
double erdl_pm(double r, double d, double m1) {
  double a0, a1, a2;
  erdl_coeff(r, d, m1, &a0, &a1, &a2);
  return (a0 - a1 + a2);
}


x86 assembly (clang, -O0):
<erdl_pm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1030 <erdl_coeff@plt>
movsd  -0x20(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erdl_pm>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <erdl_coeff@plt>
movsd  0x10(%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @erdl_pm(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%10 = load double, double* %4
%11 = load double, double* %5
%12 = load double, double* %6
%13 = call i32 @erdl_coeff(double %10, double %11, double %12, double* %7, double* %8, double* %9)
%14 = load double, double* %7
%15 = load double, double* %8
%16 = fsub double %14, %15
%17 = load double, double* %9
%18 = fadd double %16, %17
ret double %18
}

LLVM IR (-O2):
define double @erdl_pm(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = bitcast double* %4 to i8*
%8 = bitcast double* %5 to i8*
%9 = bitcast double* %6 to i8*
%10 = call i32 @erdl_coeff(double %0, double %1, double %2, double* %4, double* %5, double* %6)
%11 = load double, double* %4
%12 = load double, double* %5
%13 = fsub double %11, %12
%14 = load double, double* %6
%15 = fadd double %13, %14
ret double %15
}
void gtk_invisible_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_invisible_new() {
ret void
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n = 0;
  scanf("%d", &n);
  printf(" O F(%d) é %d\n", n, fib(n - 1));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xebc(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebx
lea    -0x1(%rbx),%edi
call   1050 <fib@plt>
lea    0xea2(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [16 x i8] c" O F(%d) \C3\A9 %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1
%6 = call i32 @fib(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %6)
ret i32 0
}
void foo_1_1_2_1_1_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_1_1_2_2_1_2() {
ret void
}
void fp(int *y) {
  char x;
  asm(""
      : "=@cc"
        "p"(x));
  if (!x)
    *y = 0;
}


x86 assembly (clang, -O0):
<fp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
setp   %al
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
jne    1122 <fp+0x22>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp>:
jnp    1103 <fp+0x3>
ret
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @fp(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = call i8 asm "", "={@ccp},~{dirflag},~{fpsr},~{flags}"()
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = icmp ne i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = load i32*, i32** %2
store i32 0, i32* %8
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @fp(i32* nocapture writeonly %0) {
%2 = tail call i8 asm "", "={@ccp},~{dirflag},~{fpsr},~{flags}"()
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
store i32 0, i32* %0
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
long strtol(char *, char **, int);
long int t21(char **x) { return strtol("1234", x, 10); }


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

x86 assembly (clang, -O2):
<t21>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"1234\00"
define i64 @t21(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = call i64 @strtol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %3, i32 10)
ret i64 %4
}

LLVM IR (-O2):
@.str = [5 x i8] c"1234\00"
define i64 @t21(i8** nocapture %0) {
%2 = tail call i64 @strtol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %0, i32 10)
ret i64 %2
}
/* Variables and functions */
char *corta_string(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *s = "Campos verdes";
  while (s[0] != ' ') {
    s = corta_string(s);
  }
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     115c <main+0x3c>
mov    -0x10(%rbp),%rdi
call   1040 <corta_string@plt>
mov    %rax,-0x10(%rbp)
jmp    113a <main+0x1a>
mov    -0x10(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rax
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1040 <corta_string@plt>
cmpb   $0x20,(%rax)
jne    1130 <main+0x10>
lea    0xeca(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Campos verdes\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
br label %3
3: ; preds = %9, %0
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 32
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %2
%11 = call i8* @corta_string(i8* %10)
store i8* %11, i8** %2
br label %3
12: ; preds = %3
%13 = load i8*, i8** %2
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Campos verdes\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %0 ], [ %3, %1 ]
%3 = tail call i8* @corta_string(i8* %2)
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: rand-src source-file seed n-bits\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"Usage: rand-src source-file seed n-bits\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Usage: rand-src source-file seed n-bits\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *wceex_setlocale(int category, const char *locale) { return ""; }


x86 assembly (clang, -O0):
<wceex_setlocale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeee(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wceex_setlocale>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @wceex_setlocale(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @wceex_setlocale(i32 %0, i8* nocapture readnone %1) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Terminal_clear_screen(int mode) {
  if (mode == 0) {
    printf("\033[H\033[1J");
  } else if (mode == 1) {
    printf("\033[H\033[2J");
  }
}


x86 assembly (clang, -O0):
<Terminal_clear_screen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1136 <Terminal_clear_screen+0x26>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    1151 <Terminal_clear_screen+0x41>
cmpl   $0x1,-0x4(%rbp)
jne    114c <Terminal_clear_screen+0x3c>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
jmp    1151 <Terminal_clear_screen+0x41>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Terminal_clear_screen>:
test   %edi,%edi
je     1125 <Terminal_clear_screen+0x15>
cmp    $0x1,%edi
jne    1131 <Terminal_clear_screen+0x21>
lea    0xee8(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xed4(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[H\1B[1J\00"
@.str.1 = [8 x i8] c"\1B[H\1B[2J\00"
define void @Terminal_clear_screen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
br label %13
13: ; preds = %12, %5
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[H\1B[1J\00"
@.str.1 = [8 x i8] c"\1B[H\1B[2J\00"
define void @Terminal_clear_screen(i32 %0) {
switch i32 %0, label %6 [
i32 0, label %3
i32 1, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) %4)
br label %6
6: ; preds = %3, %1
ret void
}
void RTStrStripR(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrStripR() {
ret void
}
int main() {
  int i;
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzConstant_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKDOWN_DELAYED(int /*<<< orphan*/, int);
int /*<<< orphan*/ SEND_DATAOFF_DELAYED(int /*<<< orphan*/, int /*<<< orphan*/);
void BrzConstant_reqdown(struct comp *comp, int port) {
  struct BrzConstant_ *c = (struct BrzConstant_ *)comp;
  SEND_ACKDOWN_DELAYED(0, 1);
  SEND_DATAOFF_DELAYED(0, 0);
}


x86 assembly (clang, -O0):
<BrzConstant_reqdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <SEND_DATAOFF_DELAYED@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzConstant_reqdown>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <SEND_DATAOFF_DELAYED@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzConstant_ = type { i32 }
define void @BrzConstant_reqdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzConstant_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzConstant_*
store %struct.BrzConstant_* %7, %struct.BrzConstant_** %5
%8 = call i32 @SEND_ACKDOWN_DELAYED(i32 0, i32 1)
%9 = call i32 @SEND_DATAOFF_DELAYED(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzConstant_reqdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_ACKDOWN_DELAYED(i32 0, i32 1)
%4 = tail call i32 @SEND_DATAOFF_DELAYED(i32 0, i32 0)
ret void
}
/* Variables and functions */
int rand();
int pt_rand(int nbits) {
  int mask;
  if (0 < nbits && nbits < sizeof(int) * 8) {
    mask = ~(~((unsigned int)0) << nbits);
  } else {
    mask = ~((unsigned int)0);
  }
  return rand() & mask;
}


x86 assembly (clang, -O0):
<pt_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jge    1149 <pt_rand+0x39>
movslq -0x4(%rbp),%rax
cmp    $0x20,%rax
jae    1149 <pt_rand+0x39>
mov    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <pt_rand+0x40>
movl   $0xffffffff,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pt_rand>:
push   %rbx
mov    %edi,%ecx
lea    -0x1(%rcx),%eax
mov    $0xffffffff,%edx
mov    $0xffffffff,%ebx
shl    %cl,%ebx
cmp    $0x1f,%eax
not    %ebx
cmovae %edx,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pt_rand(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 0, %4
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = icmp ult i64 %8, 32
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %2
%12 = shl i32 -1, %11
%13 = xor i32 %12, -1
store i32 %13, i32* %3
br label %15
14: ; preds = %6, %1
store i32 -1, i32* %3
br label %15
15: ; preds = %14, %10
%16 = call i32 (...) @rand()
%17 = load i32, i32* %3
%18 = and i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @pt_rand(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 31
%4 = shl nsw i32 -1, %0
%5 = xor i32 %4, -1
%6 = select i1 %3, i32 %5, i32 -1
%7 = tail call i32 (...) @rand()
%8 = and i32 %7, %6
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *s = "what\\nyou\\n\"want\"";
  printf("Res_1: %s\n", s);
  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)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"what\\nyou\\n\22want\22\00"
@.str.1 = [11 x i8] c"Res_1: %s\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
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"what\\nyou\\n\22want\22\00"
@.str.1 = [11 x i8] c"Res_1: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *xrealloc(int /*<<< orphan*/ *, size_t, size_t);
void *xcalloc(size_t nmemb, size_t size) { return xrealloc(NULL, nmemb, size); }


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

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

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

LLVM IR (-O2):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @xrealloc(i32* null, i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memcpy(void *, void *, int);
void *int_cloner(void *y) {
  void *x;
  x = malloc(sizeof(int));
  memcpy(x, y, sizeof(int));
  return x;
}


x86 assembly (clang, -O0):
<int_cloner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_cloner>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @int_cloner(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 4)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 4)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @int_cloner(i8* %0) {
%2 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
%3 = tail call i32 @memcpy(i8* %2, i8* %0, i32 4)
ret i8* %2
}
int main() {
  int x = 0;
start:
  if (x) {
    goto exit;
  } else {
    x = 1;
    goto start;
  }
exit:
  return 5;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1121 <main+0x21>
jmp    112d <main+0x2d>
movl   $0x1,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    $0x5,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
/* Variables and functions */
int __builtin_mips_cabs_ueq_d(double, double);
int test3(double a, double b) { return __builtin_mips_cabs_ueq_d(a, b); }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__builtin_mips_cabs_ueq_d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
jmp    1030 <__builtin_mips_cabs_ueq_d@plt>

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

LLVM IR (-O2):
define i32 @test3(double %0, double %1) {
%3 = tail call i32 @__builtin_mips_cabs_ueq_d(double %0, double %1)
ret i32 %3
}
/* Variables and functions */
int open_max();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("I could have %d open file descriptors.\n", open_max());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"I could have %d open file descriptors.\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 (...) @open_max()
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"I could have %d open file descriptors.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @open_max()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void f195(void) {
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  0;
a:
  goto a;
}


x86 assembly (clang, -O0):
<f195>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
jmp    112e <f195+0x2e>

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

LLVM IR (-O0):
define void @f195() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = load i32, i32* %1
store i32 0, i32* %2
%8 = load i32, i32* %2
store i32 0, i32* %3
%9 = load i32, i32* %3
store i32 0, i32* %4
%10 = load i32, i32* %4
store i32 0, i32* %5
%11 = load i32, i32* %5
store i32 0, i32* %6
%12 = load i32, i32* %6
br label %13
13: ; preds = %13, %0
br label %13
}

LLVM IR (-O2):
define void @f195() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
struct battle_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_status(struct battle_char *, int);
scalar_t__ get_random(int /*<<< orphan*/, int);
scalar_t__ mod6(struct battle_char *, struct battle_char *, int);
void slow(struct battle_char *origin, struct battle_char *target) {
  if (get_random(0, 100) < mod6(origin, target, 180)) {
    add_status(target, 6);
  }
}


x86 assembly (clang, -O0):
<slow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xb4,%edx
call   1040 <mod6@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jge    1180 <slow+0x50>
mov    -0x10(%rbp),%rdi
mov    $0x6,%esi
call   1050 <add_status@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slow>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0xb4,%edx
call   1040 <mod6@plt>
cmp    %rax,%rbx
jge    1171 <slow+0x41>
mov    %r14,%rdi
mov    $0x6,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <add_status@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.battle_char = type { i32 }
define void @slow(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
%5 = call i64 @get_random(i32 0, i32 100)
%6 = load %struct.battle_char*, %struct.battle_char** %3
%7 = load %struct.battle_char*, %struct.battle_char** %4
%8 = call i64 @mod6(%struct.battle_char* %6, %struct.battle_char* %7, i32 180)
%9 = icmp slt i64 %5, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load %struct.battle_char*, %struct.battle_char** %4
%12 = call i32 @add_status(%struct.battle_char* %11, i32 6)
br label %13
13: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @slow(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = tail call i64 @get_random(i32 0, i32 100)
%4 = tail call i64 @mod6(%struct.battle_char* %0, %struct.battle_char* %1, i32 180)
%5 = icmp slt i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @add_status(%struct.battle_char* %1, i32 6)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_MAKE_BOOST_ENABLE_INPUT() { clear_io_bit(0x72, 4); }


x86 assembly (clang, -O0):
<TOSH_MAKE_BOOST_ENABLE_INPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x72,%edi
mov    $0x4,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_BOOST_ENABLE_INPUT>:
mov    $0x72,%edi
mov    $0x4,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_BOOST_ENABLE_INPUT() {
%1 = call i32 @clear_io_bit(i32 114, i32 4)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_BOOST_ENABLE_INPUT() {
%1 = tail call i32 @clear_io_bit(i32 114, i32 4)
ret void
}
/* Variables and functions */
float M_PI;
float kinematicsDegToRad(float deg) { return deg * M_PI / 180.; }


x86 assembly (clang, -O0):
<kinematicsDegToRad>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mulss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedb(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<kinematicsDegToRad>:
mov    0x2ee1(%rip),%rax
mulss  (%rax),%xmm0
divss  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @kinematicsDegToRad(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* @M_PI
%5 = fmul float %3, %4
%6 = fpext float %5 to double
%7 = fdiv double %6, 1.800000e+02
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @kinematicsDegToRad(float %0) {
%2 = load float, float* @M_PI
%3 = fmul float %2, %0
%4 = fdiv float %3, 1.800000e+02
ret float %4
}
void fan_OFF(void *fan_address) { *((volatile int *)fan_address + 3) = 0; }


x86 assembly (clang, -O0):
<fan_OFF>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fan_OFF>:
movl   $0x0,0xc(%rdi)
ret

LLVM IR (-O0):
define void @fan_OFF(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 3
store volatile i32 0, i32* %5
ret void
}

LLVM IR (-O2):
define void @fan_OFF(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 12
%3 = bitcast i8* %2 to i32*
store volatile i32 0, i32* %3
ret void
}