xunge/DecIR huggingface dataset:
/* Variables and functions */
int is_palindrome_iter(char *);
int is_palindrome_rec(char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Result of iterative function: %d\n", is_palindrome_iter("regninger"));
  printf("Result of recursive function: %d\n", is_palindrome_rec("regninger"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xedc(%rip),%rdi
call   1040 <is_palindrome_iter@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
call   1050 <is_palindrome_rec@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeea(%rip),%rbx
mov    %rbx,%rdi
call   1040 <is_palindrome_iter@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <is_palindrome_rec@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Result of iterative function: %d\0A\00"
@.str.1 = [10 x i8] c"regninger\00"
@.str.2 = [34 x i8] c"Result of recursive function: %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @is_palindrome_iter(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @is_palindrome_rec(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Result of iterative function: %d\0A\00"
@.str.1 = [10 x i8] c"regninger\00"
@.str.2 = [34 x i8] c"Result of recursive function: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @is_palindrome_iter(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @is_palindrome_rec(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret i32 0
}
float floating_point_message2_signal1_encode(double value) {
  return (float)(value);
}


x86 assembly (clang, -O0):
<floating_point_message2_signal1_encode>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floating_point_message2_signal1_encode>:
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @floating_point_message2_signal1_encode(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptrunc double %3 to float
ret float %4
}

LLVM IR (-O2):
define float @floating_point_message2_signal1_encode(double %0) {
%2 = fptrunc double %0 to float
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ foo(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  static int bar = 3;
  foo(0);
  if (bar != 3) {
    printf("Error %d\n", (int)4);
    exit(4);
  };
  foo(1);
  if (bar != 3) {
    printf("Error %d\n", (int)5);
    exit(5);
  };
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <foo@plt>
cmpl   $0x3,0x2eeb(%rip)
je     1170 <main+0x40>
lea    0xea6(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x4,%edi
call   1050 <exit@plt>
mov    $0x1,%edi
call   1040 <foo@plt>
cmpl   $0x3,0x2eb7(%rip)
je     11a4 <main+0x74>
lea    0xe72(%rip),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x5,%edi
call   1050 <exit@plt>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <foo@plt>
mov    $0x1,%edi
call   1040 <foo@plt>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@main.bar = internal global i32 3
@.str = [10 x i8] c"Error %d\0A\00"
@.str.1 = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 0)
%3 = load i32, i32* @main.bar
%4 = icmp ne i32 %3, 3
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = call i32 @exit(i32 4)
unreachable
8: ; preds = %0
%9 = call i32 @foo(i32 1)
%10 = load i32, i32* @main.bar
%11 = icmp ne i32 %10, 3
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 5)
%14 = call i32 @exit(i32 5)
unreachable
15: ; preds = %8
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 @foo(i32 0)
%2 = tail call i32 @foo(i32 1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
unsigned lagrange_size(unsigned n) { return 9 * n; }


x86 assembly (clang, -O0):
<lagrange_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x9,-0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lagrange_size>:
lea    (%rdi,%rdi,8),%eax
ret

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

LLVM IR (-O2):
define i32 @lagrange_size(i32 %0) {
%2 = mul i32 %0, 9
ret i32 %2
}
void delay_us(unsigned int Time) {
  unsigned int i, j;
  for (i = 0; i < Time; i++) {
    for (j = 0; j < 2; j++)
      ;
  }
}


x86 assembly (clang, -O0):
<delay_us>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1151 <delay_us+0x51>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jae    113e <delay_us+0x3e>
jmp    1130 <delay_us+0x30>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1121 <delay_us+0x21>
jmp    1143 <delay_us+0x43>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay_us+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay_us(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ eprintf(char *, char const *);
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *efopen(const char *path, const char *mode) {
  FILE *fp;
  fp = fopen(path, mode);
  if (!fp)
    eprintf("can't open %s\n", path);
  return fp;
}


x86 assembly (clang, -O0):
<efopen>:
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 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115c <efopen+0x3c>
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <eprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efopen>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <efopen+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <eprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"can't open %s\0A\00"
define noalias i32* @efopen(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @eprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ CompileMark(int, int);
void DoQDo(void) { CompileMark(54, 3); }


x86 assembly (clang, -O0):
<DoQDo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x36,%edi
mov    $0x3,%esi
call   1030 <CompileMark@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoQDo>:
mov    $0x36,%edi
mov    $0x3,%esi
jmp    1030 <CompileMark@plt>

LLVM IR (-O0):
define void @DoQDo() {
%1 = call i32 @CompileMark(i32 54, i32 3)
ret void
}

LLVM IR (-O2):
define void @DoQDo() {
%1 = tail call i32 @CompileMark(i32 54, i32 3)
ret void
}
unsigned char iColorQuantize(float value) {
  if (value >= 1.0f)
    return 255;
  if (value <= 0.0f)
    return 0;
  return (unsigned char)(value * 256);
}


x86 assembly (clang, -O0):
<iColorQuantize>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1128 <iColorQuantize+0x28>
movb   $0xff,-0x1(%rbp)
jmp    1156 <iColorQuantize+0x56>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     113e <iColorQuantize+0x3e>
movb   $0x0,-0x1(%rbp)
jmp    1156 <iColorQuantize+0x56>
movss  -0x8(%rbp),%xmm0
movss  0xeb9(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iColorQuantize>:
mov    $0xff,%al
ucomiss 0xef7(%rip),%xmm0
jae    111f <iColorQuantize+0x1f>
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jae    1120 <iColorQuantize+0x20>
mulss  0xee9(%rip),%xmm0
cvttss2si %xmm0,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i8 @iColorQuantize(float %0) {
%2 = alloca i8
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oge float %4, 1.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 -1, i8* %2
br label %15
7: ; preds = %1
%8 = load float, float* %3
%9 = fcmp ole float %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 0, i8* %2
br label %15
11: ; preds = %7
%12 = load float, float* %3
%13 = fmul float %12, 2.560000e+02
%14 = fptoui float %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %11, %10, %6
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @iColorQuantize(float %0) {
%2 = fcmp ult float %0, 1.000000e+00
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = fcmp ugt float %0, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = fmul float %0, 2.560000e+02
%7 = fptoui float %6 to i8
br label %8
8: ; preds = %3, %1, %5
%9 = phi i8 [ %7, %5 ], [ -1, %1 ], [ 0, %3 ]
ret i8 %9
}
void foo445(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo445(i32 %0) {
ret void
}
void console_set_normal_color() {}


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

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

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

LLVM IR (-O2):
define void @console_set_normal_color() {
ret void
}
/* Variables and functions */
int calc(int);
int main(void) {
  int i = -1;
  i = calc(i);
  i = calc(i);
  i = calc(i);
  return i;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <calc@plt>
mov    %eax,%edi
call   1030 <calc@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <calc@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @calc(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @calc(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @calc(i32 %7)
store i32 %8, i32* %2
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @calc(i32 -1)
%2 = tail call i32 @calc(i32 %1)
%3 = tail call i32 @calc(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() {
  printf("hello world\n");
  printf("Yes, this is my first repository!");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
@.str.1 = [34 x i8] c"Yes, this is my first repository!\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [34 x i8] c"Yes, this is my first repository!\00"
@str = [12 x i8] c"hello world\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double matCalcDot(double *v1, double *v2) {
  return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
}


x86 assembly (clang, -O0):
<matCalcDot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<matCalcDot>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @matCalcDot(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 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @matCalcDot(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ insertaDesde(char *, char *, char);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char s1[20] = "manuel";
  char s2[] = "javi";
  insertaDesde(s1, s2, 'j');
  printf("%s\n", s1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec7(%rip),%eax
mov    %eax,-0x25(%rbp)
mov    0xec2(%rip),%al
mov    %al,-0x21(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x25(%rbp),%rsi
mov    $0x6a,%edx
call   1040 <insertaDesde@plt>
lea    -0x20(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
movb   $0x0,0xc(%rsp)
movl   $0x6976616a,0x8(%rsp)
69
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x6a,%edx
call   1040 <insertaDesde@plt>
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s1 = [20 x i8] c"manuel\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.s2 = [5 x i8] c"javi\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [5 x i8]
%3 = bitcast [20 x i8]* %1 to i8*
%4 = bitcast [5 x i8]* %2 to i8*
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%7 = call i32 @insertaDesde(i8* %5, i8* %6, i8 signext 106)
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [20 x i8] c"manuel\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.s2 = [5 x i8] c"javi\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @insertaDesde(i8* %3, i8* %4, i8 signext 106)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
void hb_stack_lock(void) {}


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

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

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

LLVM IR (-O2):
define void @hb_stack_lock() {
ret void
}
int compare_ammo(int slot1, int slot2) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @compare_ammo(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
struct sk_buff {
  int dummy;
};
struct pnpipehdr {
  int dummy;
};

/* Variables and functions */
scalar_t__ skb_transport_header(struct sk_buff *);
struct pnpipehdr *pnp_hdr(struct sk_buff *skb) {
  return (struct pnpipehdr *)skb_transport_header(skb);
}


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

x86 assembly (clang, -O2):
<pnp_hdr>:
jmp    1030 <skb_transport_header@plt>

LLVM IR (-O0):
%struct.pnpipehdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.pnpipehdr* @pnp_hdr(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
%3 = load %struct.sk_buff*, %struct.sk_buff** %2
%4 = call i64 @skb_transport_header(%struct.sk_buff* %3)
%5 = inttoptr i64 %4 to %struct.pnpipehdr*
ret %struct.pnpipehdr* %5
}

LLVM IR (-O2):
%struct.pnpipehdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.pnpipehdr* @pnp_hdr(%struct.sk_buff* %0) {
%2 = tail call i64 @skb_transport_header(%struct.sk_buff* %0)
%3 = inttoptr i64 %2 to %struct.pnpipehdr*
ret %struct.pnpipehdr* %3
}
int color_offset_f3(int x, int y) {
  return ((y << 10) + (((x << 10) * 367) / 84) - (16305 << 10)) >> 10;
}


x86 assembly (clang, -O0):
<color_offset_f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
imul   $0x16f,%eax,%eax
mov    $0x54,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
sub    $0xfec400,%eax
sar    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_offset_f3>:
shl    $0xa,%esi
imul   $0x5bc00,%edi,%eax
cltq
imul   $0x30c30c31,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x24,%rax
add    %ecx,%eax
add    %esi,%eax
add    $0xff013c00,%eax
sar    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @color_offset_f3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 10
%7 = load i32, i32* %3
%8 = shl i32 %7, 10
%9 = mul nsw i32 %8, 367
%10 = sdiv i32 %9, 84
%11 = add nsw i32 %6, %10
%12 = sub nsw i32 %11, 16696320
%13 = ashr i32 %12, 10
ret i32 %13
}

LLVM IR (-O2):
define i32 @color_offset_f3(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = mul i32 %0, 375808
%5 = sdiv i32 %4, 84
%6 = add nsw i32 %5, -16696320
%7 = add i32 %6, %3
%8 = ashr i32 %7, 10
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ nullpo_info_core(char const *, int, char const *, void *,
                                    void *);
int nullpo_chk(const char *file, int line, const char *func,
               const void *target) {
  if (target != (void *)0)
    return 0;
  nullpo_info_core(file, line, func, (void *)0, (void *)0);
  return 1;
}


x86 assembly (clang, -O0):
<nullpo_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     113e <nullpo_chk+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    115d <nullpo_chk+0x4d>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rcx
call   1030 <nullpo_info_core@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullpo_chk>:
xor    %eax,%eax
test   %rcx,%rcx
je     1118 <nullpo_chk+0x8>
ret
push   %rax
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <nullpo_info_core@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @nullpo_chk(i8* %0, i32 %1, i8* %2, i8* readnone %3) {
%5 = icmp eq i8* %3, null
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @nullpo_info_core(i8* %0, i32 %1, i8* %2, i8* null, i8* null)
br label %8
8: ; preds = %4, %6
%9 = phi i32 [ 1, %6 ], [ 0, %4 ]
ret i32 %9
}
char decode(int encoded[]) {
  int i = 0;
  char decoded[sizeof(encoded) / sizeof(encoded[0])];
  while (encoded[i]) {
    decoded[i] = encoded[i];
    i++;
  }
  return decoded;
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1144 <decode+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %al,%cl
movslq -0xc(%rbp),%rax
mov    %cl,-0xe(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <decode+0xf>
lea    -0xe(%rbp),%rax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
mov    (%rdi),%eax
test   %eax,%eax
je     1120 <decode+0x20>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,-0x2(%rsp,%rcx,1)
mov    0x4(%rdi,%rcx,4),%eax
add    $0x1,%rcx
test   %eax,%eax
jne    1110 <decode+0x10>
lea    -0x2(%rsp),%rax
ret

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

LLVM IR (-O2):
define signext i8 @decode(i32* nocapture %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* %0
%5 = icmp eq i32 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %1, %6
%7 = phi i64 [ %11, %6 ], [ 0, %1 ]
%8 = phi i32 [ %13, %6 ], [ %4, %1 ]
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 %7
store i8 %9, i8* %10
%11 = add nuw nsw i64 %7, 1
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %1
%16 = ptrtoint [2 x i8]* %2 to i64
%17 = trunc i64 %16 to i8
ret i8 %17
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, double);
char *numToStr(void *value) {
  static char str[50];
  snprintf(str, 50, "%f", *(double *)value);
  return str;
}


x86 assembly (clang, -O0):
<numToStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0x2f15(%rip),%rdi
mov    $0x32,%esi
lea    0xec9(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2efd(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numToStr>:
push   %rbx
movsd  (%rdi),%xmm0
lea    0x2f24(%rip),%rbx
lea    0xedd(%rip),%rdx
mov    %rbx,%rdi
mov    $0x32,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@numToStr.str = internal global [50 x i8] zeroinitializer
@.str = [3 x i8] c"%f\00"
define i8* @numToStr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to double*
%5 = load double, double* %4
%6 = call i32 @snprintf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @numToStr.str, i64 0, i64 0), i32 50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %5)
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @numToStr.str, i64 0, i64 0)
}

LLVM IR (-O2):
@numToStr.str = internal global [50 x i8] zeroinitializer
@.str = [3 x i8] c"%f\00"
define i8* @numToStr(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
%4 = tail call i32 @snprintf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @numToStr.str, i64 0, i64 0), i32 50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %3)
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @numToStr.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: /usr/lib/heartbeat/tickle_tcp [ -n num ]\n");
  printf("Please note that this program need to read the list of\n");
  printf("{local_ip:port remote_ip:port} from stdin.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
call   1030 <printf@plt>
lea    0xf26(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xf27(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"Usage: /usr/lib/heartbeat/tickle_tcp [ -n num ]\0A\00"
@.str.1 = [56 x i8] c"Please note that this program need to read the list of\0A\00"
@.str.2 = [44 x i8] c"{local_ip:port remote_ip:port} from stdin.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [48 x i8] c"Usage: /usr/lib/heartbeat/tickle_tcp [ -n num ]\00"
@str.3 = [55 x i8] c"Please note that this program need to read the list of\00"
@str.4 = [43 x i8] c"{local_ip:port remote_ip:port} from stdin.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ UART_Transmit(unsigned char);
void UART_Transmit_String(unsigned char string[]) {
  while (*string) {
    UART_Transmit(*string);
    string++;
  }
}


x86 assembly (clang, -O0):
<UART_Transmit_String>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <UART_Transmit_String+0x36>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <UART_Transmit@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <UART_Transmit_String+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART_Transmit_String>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <UART_Transmit_String+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1030 <UART_Transmit@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <UART_Transmit_String+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @UART_Transmit_String(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = call i32 @UART_Transmit(i8 zeroext %9)
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @UART_Transmit_String(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @UART_Transmit(i8 zeroext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
long cube(long x) {
  long x_cubed;
  x_cubed = x * x * x;
  return x_cubed;
}


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

x86 assembly (clang, -O2):
<cube>:
mov    %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
ret

LLVM IR (-O0):
define i64 @cube(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = load i64, i64* %2
%6 = mul nsw i64 %4, %5
%7 = load i64, i64* %2
%8 = mul nsw i64 %6, %7
store i64 %8, i64* %3
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
define i64 @cube(i64 %0) {
%2 = mul nsw i64 %0, %0
%3 = mul nsw i64 %2, %0
ret i64 %3
}
int tracescheck_shutdown(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tracescheck_shutdown() {
ret i32 0
}
void hover_event_init() {}


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

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

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

LLVM IR (-O2):
define void @hover_event_init() {
ret void
}
void clear_jumplist(void) {}


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

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

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

LLVM IR (-O2):
define void @clear_jumplist() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void integer_print(const void *a) { printf("%d", (int)(intptr_t)a); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @integer_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @integer_print(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dec();
int /*<<< orphan*/ hec();
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char dechec;
  scanf("%c", &dechec);
  switch (dechec) {
  case 'd':
    dec();
    break;
  case 'h':
    hec();
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x64,%eax
je     1175 <main+0x45>
jmp    1164 <main+0x34>
mov    -0xc(%rbp),%eax
sub    $0x68,%eax
je     1181 <main+0x51>
jmp    1188 <main+0x58>
mov    $0x0,%al
call   1030 <dec@plt>
jmp    1188 <main+0x58>
mov    $0x0,%al
call   1040 <hec@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
movsbl 0x7(%rsp),%eax
cmp    $0x68,%eax
je     115a <main+0x2a>
cmp    $0x64,%eax
jne    1161 <main+0x31>
xor    %eax,%eax
call   1030 <dec@plt>
jmp    1161 <main+0x31>
xor    %eax,%eax
call   1040 <hec@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 100, label %6
i32 104, label %8
]
6: ; preds = %0
%7 = call i32 (...) @dec()
br label %10
8: ; preds = %0
%9 = call i32 (...) @hec()
br label %10
10: ; preds = %0, %8, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
switch i32 %4, label %9 [
i32 100, label %5
i32 104, label %7
]
5: ; preds = %0
%6 = call i32 (...) @dec()
br label %9
7: ; preds = %0
%8 = call i32 (...) @hec()
br label %9
9: ; preds = %0, %7, %5
ret i32 0
}
/* Variables and functions */
int wheatTcpGenericConnect(char *, char *, int, int /*<<< orphan*/);
int wheatTcpConnect(char *err, char *addr, int port) {
  return wheatTcpGenericConnect(err, addr, port, 0);
}


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

x86 assembly (clang, -O2):
<wheatTcpConnect>:
xor    %ecx,%ecx
jmp    1030 <wheatTcpGenericConnect@plt>

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

LLVM IR (-O2):
define i32 @wheatTcpConnect(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @wheatTcpGenericConnect(i8* %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
void kgsl_core_debugfs_init(void) {}


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

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

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

LLVM IR (-O2):
define void @kgsl_core_debugfs_init() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int uint32cmp(void *o1, void *o2) {
  uint32_t u1, u2;
  u1 = *(uint32_t *)o1;
  u2 = *(uint32_t *)o2;
  if (u1 > u2)
    return -1;
  else if (u1 < u2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<uint32cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    113c <uint32cmp+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <uint32cmp+0x62>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1156 <uint32cmp+0x56>
movl   $0x1,-0x4(%rbp)
jmp    1162 <uint32cmp+0x62>
jmp    115b <uint32cmp+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32cmp>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setl   %cl
mov    $0xffffffff,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @uint32cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = icmp slt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int strlen(char *);
void c_strlen_(char **in_ptr, int *out_ptr) {
  if (*in_ptr == NULL)
    *out_ptr = 0;
  else
    *out_ptr = strlen(*in_ptr);
}


x86 assembly (clang, -O0):
<c_strlen_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    113d <c_strlen_+0x2d>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    1151 <c_strlen_+0x41>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_strlen_>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1123 <c_strlen_+0x13>
call   1030 <strlen@plt>
jmp    1125 <c_strlen_+0x15>
xor    %eax,%eax
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @c_strlen_(i8** %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32*
store i8** %0, i8*** %3
store i32* %1, i32** %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32*, i32** %4
store i32 0, i32* %9
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %3
%12 = load i8*, i8** %11
%13 = call i32 @strlen(i8* %12)
%14 = load i32*, i32** %4
store i32 %13, i32* %14
br label %15
15: ; preds = %10, %8
ret void
}

LLVM IR (-O2):
define void @c_strlen_(i8** nocapture %0, i32* nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
store i32 %8, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void ps(void *s) { printf("  %s\n", (char *)s); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c" %s\0A\00"
define void @ps(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int return_ketjeJrSize(int len) {
  int result = 0;
  if (len % 2 == 0) {
    result = len - 2;
  } else {
    result = len - 1;
  }
  if (result >= 0)
    return result;
  else
    return 0;
}


x86 assembly (clang, -O0):
<return_ketjeJrSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1130 <return_ketjeJrSize+0x30>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <return_ketjeJrSize+0x39>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     114e <return_ketjeJrSize+0x4e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <return_ketjeJrSize+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_ketjeJrSize>:
mov    %edi,%eax
or     $0xfffffffe,%eax
xor    %ecx,%ecx
add    %edi,%eax
cmovs  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @return_ketjeJrSize(i32 %0) {
%2 = or i32 %0, -2
%3 = add nsw i32 %2, %0
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
void ffi_closure_free(void) {}


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

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

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

LLVM IR (-O2):
define void @ffi_closure_free() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvtpd_pi32(int /*<<< orphan*/);
__m64 test_mm_cvtpd_pi32(__m128d a) { return _mm_cvtpd_pi32(a); }


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

x86 assembly (clang, -O2):
<test_mm_cvtpd_pi32>:
jmp    1030 <_mm_cvtpd_pi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cvtpd_pi32(i32 %0) {
%2 = tail call i32 @_mm_cvtpd_pi32(i32 %0)
ret i32 %2
}