xunge/DecIR huggingface dataset:
int getppid(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @getppid() {
ret i32 1
}
void setError(int code) {}


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

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

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

LLVM IR (-O2):
define void @setError(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int xh_uint64_t_hash(const void *key, void *data) {
  (void)data;
  return *(uint64_t *)key;
}


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

x86 assembly (clang, -O2):
<xh_uint64_t_hash>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @xh_uint64_t_hash(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @xh_uint64_t_hash(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
void insl(int port, void *addr, unsigned long count) {
  __asm__ __volatile__("rep; insl" : "+D"(addr), "+c"(count) : "d"(port));
}


x86 assembly (clang, -O0):
<insl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x4(%rbp),%edx
rep insl (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insl>:
mov    %rdx,%rcx
mov    %edi,%edx
mov    %rsi,%rdi
rep insl (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insl(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i32, i32* %4
%10 = call { i8*, i64 } asm sideeffect "rep; insl", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %9, i8* %7, i64 %8)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @insl(i32 %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep; insl", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
scalar_t__ memmove(char *, char const *, int);
char *strncpy(char *dest, const char *src, int n) {
  return (char *)memmove(dest, src, n);
}


x86 assembly (clang, -O0):
<strncpy>:
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
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define i8* @strncpy(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 i64 @memmove(i8* %7, i8* %8, i32 %9)
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define i8* @strncpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @memmove(i8* %0, i8* %1, i32 %2)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ jump(int /*<<< orphan*/);
int /*<<< orphan*/ pfq_fetchw();
uint16_t jump_near(void) { return jump(pfq_fetchw()); }


x86 assembly (clang, -O0):
<jump_near>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pfq_fetchw@plt>
mov    %eax,%edi
call   1040 <jump@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jump_near>:
push   %rax
xor    %eax,%eax
call   1030 <pfq_fetchw@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <jump@plt>

LLVM IR (-O0):
define i32 @jump_near() {
%1 = call i32 (...) @pfq_fetchw()
%2 = call i32 @jump(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @jump_near() {
%1 = tail call i32 (...) @pfq_fetchw()
%2 = tail call i32 @jump(i32 %1)
ret i32 %2
}
int fib(int c) {
  if (c <= 0)
    return 0;
  else if (c < 2)
    return 1;
  else
    return fib(c - 1) + fib(c - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <fib+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fib+0x5a>
cmpl   $0x2,-0x8(%rbp)
jge    1147 <fib+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fib+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1140 <fib+0x30>
mov    %edi,%ebx
lea    -0x1(%rbx),%ebp
xor    %r14d,%r14d
test   %ebp,%ebp
je     1145 <fib+0x35>
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%r14d
add    $0xfffffffe,%ebp
cmp    $0x2,%ebx
mov    %ecx,%ebx
ja     1120 <fib+0x10>
xor    %eax,%eax
jmp    114a <fib+0x3a>
xor    %r14d,%r14d
jmp    114d <fib+0x3d>
mov    $0x1,%eax
add    %eax,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %10, %7 ], [ %0, %1 ]
%5 = phi i32 [ %11, %7 ], [ 0, %1 ]
%6 = icmp eq i32 %4, 1
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = tail call i32 @fib(i32 %8)
%10 = add nsw i32 %4, -2
%11 = add nsw i32 %9, %5
%12 = icmp ult i32 %4, 3
br i1 %12, label %13, label %3
13: ; preds = %3, %7
%14 = phi i32 [ %11, %7 ], [ %5, %3 ]
%15 = phi i32 [ 0, %7 ], [ 1, %3 ]
%16 = add nsw i32 %15, %14
br label %17
17: ; preds = %13, %1
%18 = phi i32 [ %16, %13 ], [ 0, %1 ]
ret i32 %18
}
void rtsx_trace(struct rtsx_chip *chip) {}


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

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

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

LLVM IR (-O2):
%struct.rtsx_chip = type opaque
define void @rtsx_trace(%struct.rtsx_chip* nocapture %0) {
ret void
}
void rop3_158_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = *D & S;
  stk3 = T | stk4;
  stk2 = S ^ stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_158_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xe(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xe(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_158_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
and    %sil,%cl
or     %cl,%dl
xor    %sil,%al
xor    %dl,%al
not    %sil
and    %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_158_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = and i32 %13, %15
%17 = trunc i32 %16 to i8
store i8 %17, i8* %10
%18 = load i8, i8* %6
%19 = zext i8 %18 to i32
%20 = load i8, i8* %10
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
%23 = trunc i32 %22 to i8
store i8 %23, i8* %9
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = load i8, i8* %9
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %8
%30 = load i8*, i8** %4
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = load i8, i8* %8
%34 = zext i8 %33 to i32
%35 = xor i32 %32, %34
%36 = trunc i32 %35 to i8
store i8 %36, i8* %7
%37 = load i8, i8* %7
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = xor i32 %40, -1
%42 = and i32 %38, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %5
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_158_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = or i8 %5, %2
%7 = xor i8 %4, %1
%8 = xor i8 %7, %6
%9 = xor i8 %1, -1
%10 = and i8 %8, %9
%11 = or i8 %10, %5
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
double pow(double, int);
double HarmonicPotential2D(double *coordinates) {
  double k = 1;
  double Energy = 0.0;
  for (int i = 0; i < 2; i++) {
    Energy += k * pow(coordinates[i], 2);
  }
  return Energy;
}


x86 assembly (clang, -O0):
<HarmonicPotential2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xedc(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jge    118b <HarmonicPotential2D+0x7b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1138 <HarmonicPotential2D+0x28>
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HarmonicPotential2D>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
xorpd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rbx),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @HarmonicPotential2D(double* %0) {
%2 = alloca double*
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double* %0, double** %2
store double 1.000000e+00, double* %3
store double 0.000000e+00, double* %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %1
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load double, double* %3
%11 = load double*, double** %2
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = call double @pow(double %15, i32 2)
%17 = load double, double* %4
%18 = call double @llvm.fmuladd.f64(double %10, double %16, double %17)
store double %18, double* %4
br label %19
19: ; preds = %9
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
%23 = load double, double* %4
ret double %23
}

LLVM IR (-O2):
define double @HarmonicPotential2D(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @pow(double %2, i32 2)
%4 = fadd double %3, 0.000000e+00
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = tail call double @pow(double %6, i32 2)
%8 = fadd double %4, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("UDP client for test purpose\n");
  printf("client <ip_to_use> <port_to_use>\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"UDP client for test purpose\0A\00"
@.str.1 = [34 x i8] c"client <ip_to_use> <port_to_use>\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 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 = [28 x i8] c"UDP client for test purpose\00"
@str.2 = [33 x i8] c"client <ip_to_use> <port_to_use>\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.2, i64 0, i64 0))
ret void
}
int psp_vdp1_reset(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @psp_vdp1_reset() {
ret i32 0
}
char *module_name() { return "kernalloc"; }


x86 assembly (clang, -O0):
<module_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"kernalloc\00"
define i8* @module_name() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"kernalloc\00"
define i8* @module_name() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
int test_imm_B9int8_reg(signed char val) {
  return ((val) & (0xB9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B9int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xb9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B9int8_reg>:
test   $0xb9,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B9int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 185
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_B9int8_reg(i8 signext %0) {
%2 = and i8 %0, -71
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int rs(int instruction) { return (instruction >> 21) & 0x0000001f; }


x86 assembly (clang, -O0):
<rs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x15,%eax
and    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rs>:
mov    %edi,%eax
shr    $0x15,%eax
and    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @rs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 21
%5 = and i32 %4, 31
ret i32 %5
}

LLVM IR (-O2):
define i32 @rs(i32 %0) {
%2 = lshr i32 %0, 21
%3 = and i32 %2, 31
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ testByte(int);
int /*<<< orphan*/ testCastOps(int);
int /*<<< orphan*/ testInt(int);
int /*<<< orphan*/ testLong(int);
int /*<<< orphan*/ testShort(int);
int main() {
  testByte(0);
  testByte(123);
  testShort(0);
  testShort(1234);
  testInt(0);
  testInt(1234);
  testLong(0);
  testLong(123121231231231LL);
  testLong(0x1112300000000000LL);
  testLong(0x11120LL);
  testCastOps(2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1070 <testByte@plt>
mov    $0x7b,%edi
call   1070 <testByte@plt>
xor    %edi,%edi
call   1050 <testShort@plt>
mov    $0x4d2,%edi
call   1050 <testShort@plt>
xor    %edi,%edi
call   1040 <testInt@plt>
mov    $0x4d2,%edi
call   1040 <testInt@plt>
xor    %edi,%edi
call   1030 <testLong@plt>
mov    $0x654078ff,%edi
call   1030 <testLong@plt>
xor    %edi,%edi
call   1030 <testLong@plt>
mov    $0x11120,%edi
call   1030 <testLong@plt>
mov    $0x2,%edi
call   1060 <testCastOps@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1070 <testByte@plt>
mov    $0x7b,%edi
call   1070 <testByte@plt>
xor    %edi,%edi
call   1050 <testShort@plt>
mov    $0x4d2,%edi
call   1050 <testShort@plt>
xor    %edi,%edi
call   1040 <testInt@plt>
mov    $0x4d2,%edi
call   1040 <testInt@plt>
xor    %edi,%edi
call   1030 <testLong@plt>
mov    $0x654078ff,%edi
call   1030 <testLong@plt>
xor    %edi,%edi
call   1030 <testLong@plt>
mov    $0x11120,%edi
call   1030 <testLong@plt>
mov    $0x2,%edi
call   1060 <testCastOps@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @testByte(i32 0)
%3 = call i32 @testByte(i32 123)
%4 = call i32 @testShort(i32 0)
%5 = call i32 @testShort(i32 1234)
%6 = call i32 @testInt(i32 0)
%7 = call i32 @testInt(i32 1234)
%8 = call i32 @testLong(i32 0)
%9 = call i32 @testLong(i32 1698724095)
%10 = call i32 @testLong(i32 0)
%11 = call i32 @testLong(i32 69920)
%12 = call i32 @testCastOps(i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @testByte(i32 0)
%2 = tail call i32 @testByte(i32 123)
%3 = tail call i32 @testShort(i32 0)
%4 = tail call i32 @testShort(i32 1234)
%5 = tail call i32 @testInt(i32 0)
%6 = tail call i32 @testInt(i32 1234)
%7 = tail call i32 @testLong(i32 0)
%8 = tail call i32 @testLong(i32 1698724095)
%9 = tail call i32 @testLong(i32 0)
%10 = tail call i32 @testLong(i32 69920)
%11 = tail call i32 @testCastOps(i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRA1_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRA1_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRA1_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
int abs(int a) {
  int b;
  if (a < 0) {
    b = -a;
  } else {
    b = a;
  }
  return b;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int au_br_cmoo(int brperm) {
  return brperm & (((1 << 3) | (1 << 4)) | (1 << 14));
}


x86 assembly (clang, -O0):
<au_br_cmoo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4018,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<au_br_cmoo>:
mov    %edi,%eax
and    $0x4018,%eax
ret

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

LLVM IR (-O2):
define i32 @au_br_cmoo(i32 %0) {
%2 = and i32 %0, 16408
ret i32 %2
}
void strip_leading(char **startp, char *end) {
  char *start;
  start = *startp;
  while (start < end && start[0] == ' ')
    ++start;
  *startp = start;
}


x86 assembly (clang, -O0):
<strip_leading>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    113a <strip_leading+0x3a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114a <strip_leading+0x4a>
jmp    115b <strip_leading+0x5b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <strip_leading+0x17>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_leading>:
mov    (%rdi),%rax
cmp    %rsi,%rax
jae    1122 <strip_leading+0x22>
mov    %rsi,%rcx
sub    %rax,%rcx
xchg   %ax,%ax
cmpb   $0x20,(%rax)
jne    1122 <strip_leading+0x22>
add    $0x1,%rax
add    $0xffffffffffffffff,%rcx
jne    1110 <strip_leading+0x10>
mov    %rsi,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @strip_leading(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
br label %8
8: ; preds = %20, %2
%9 = load i8*, i8** %5
%10 = load i8*, i8** %4
%11 = icmp ult i8* %9, %10
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 32
br label %18
18: ; preds = %12, %8
%19 = phi i1 [ false, %8 ], [ %17, %12 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %5
br label %8
23: ; preds = %18
%24 = load i8*, i8** %5
%25 = load i8**, i8*** %3
store i8* %24, i8** %25
ret void
}

LLVM IR (-O2):
define void @strip_leading(i8** nocapture %0, i8* readnone %1) {
%3 = load i8*, i8** %0
%4 = icmp ult i8* %3, %1
br i1 %4, label %5, label %17
5: ; preds = %2
%6 = ptrtoint i8* %3 to i64
%7 = ptrtoint i8* %1 to i64
%8 = sub i64 %7, %6
%9 = getelementptr i8, i8* %3, i64 %8
br label %10
10: ; preds = %5, %14
%11 = phi i8* [ %15, %14 ], [ %3, %5 ]
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 32
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = getelementptr inbounds i8, i8* %11, i64 1
%16 = icmp eq i8* %15, %9
br i1 %16, label %17, label %10
17: ; preds = %10, %14, %2
%18 = phi i8* [ %3, %2 ], [ %9, %14 ], [ %11, %10 ]
store i8* %18, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void pvector(int *v, int N) {
  for (int i = 0; i < N; i++) {
    printf("%d ", v[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<pvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <pvector+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <pvector+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pvector>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <pvector+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <pvector+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @pvector(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvGetDLLVersionString(char *lpVersion, int nMaxChars) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvGetDLLVersionString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvGetDLLVersionString(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int main(int argc, char **argv) {
  register int MEM_SIZE = 10 * 1024 * 1024;
  register int DURATION = 60 * 1000 * 1000;
  register int DELAY_OPS = 1;
  register int count = 0;
  int *mem = (int *)malloc(sizeof(int) * MEM_SIZE);
  register int tmp = 0;
  while (1) {
    register int read_addr = count % MEM_SIZE;
    tmp = mem[read_addr];
    count += 16;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa00000,-0x14(%rbp)
movl   $0x3938700,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x20(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %edx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x34(%rbp)
mov    %eax,-0x20(%rbp)
jmp    115c <main+0x4c>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2800000,%edi
call   1030 <malloc@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10485760, i32* %6
store i32 60000000, i32* %7
store i32 1, i32* %8
store i32 0, i32* %9
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = mul i64 4, %14
%16 = trunc i64 %15 to i32
%17 = call i64 @malloc(i32 %16)
%18 = inttoptr i64 %17 to i32*
store i32* %18, i32** %10
store i32 0, i32* %11
br label %19
19: ; preds = %2, %19
%20 = load i32, i32* %9
%21 = load i32, i32* %6
%22 = srem i32 %20, %21
store i32 %22, i32* %12
%23 = load i32*, i32** %10
%24 = load i32, i32* %12
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
%27 = load i32, i32* %26
store i32 %27, i32* %11
%28 = load i32, i32* %9
%29 = add nsw i32 %28, 16
store i32 %29, i32* %9
br label %19
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 41943040)
br label %4
4: ; preds = %4, %2
br label %4
}
int js_AlertOKCancel(const char *title, const char *message) { return 0; }


x86 assembly (clang, -O0):
<js_AlertOKCancel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @js_AlertOKCancel(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int gmx_idle_send(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gmx_idle_send() {
ret i32 0
}
/* Variables and functions */
void *malloc(int);
void *twoCharFill(void) { return malloc(sizeof(char) * 2); }


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

x86 assembly (clang, -O2):
<twoCharFill>:
mov    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @twoCharFill() {
%1 = call i8* @malloc(i32 2)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @twoCharFill() {
%1 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
ret i8* %1
}
int fibonacci(int n) {
  int result = 1;
  if (n > 0) {
    result = fibonacci(n - 1) + fibonacci(n - 2);
  }
  return result;
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114f <fibonacci+0x3f>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1137 <fibonacci+0x27>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fibonacci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
ja     1120 <fibonacci+0x10>
add    $0x1,%ebp
jmp    113c <fibonacci+0x2c>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fibonacci(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = call i32 @fibonacci(i32 %8)
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 2
%12 = call i32 @fibonacci(i32 %11)
%13 = add nsw i32 %9, %12
store i32 %13, i32* %3
br label %14
14: ; preds = %6, %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fibonacci(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ugt i32 %4, 2
br i1 %10, label %3, label %11
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ die(int /*<<< orphan*/);
int do_quit(char *inputfilename, int lineno, int argc, char **argv) {
  die(0);
  return -1;
}


x86 assembly (clang, -O0):
<do_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
xor    %edi,%edi
call   1030 <die@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_quit>:
push   %rax
xor    %edi,%edi
call   1030 <die@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @do_quit(i8* nocapture readnone %0, i32 %1, i32 %2, i8** nocapture readnone %3) {
%5 = tail call i32 @die(i32 0)
ret i32 -1
}
/* Variables and functions */
char *ft_itoa_base(long, int, char *);
char *ft_itoa(long n) { return (ft_itoa_base(n, 10, "0123456789")); }


x86 assembly (clang, -O0):
<ft_itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
lea    0xed4(%rip),%rdx
call   1030 <ft_itoa_base@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_itoa>:
lea    0xee9(%rip),%rdx
mov    $0xa,%esi
jmp    1030 <ft_itoa_base@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"0123456789\00"
define i8* @ft_itoa(i64 %0) {
%2 = tail call i8* @ft_itoa_base(i64 %0, i32 10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
void giveup_altivec(struct task_struct *t) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @giveup_altivec(%struct.task_struct* nocapture %0) {
ret void
}
int xfuse_file_contents_range(int stream_id, const char *data, int data_bytes) {
  return 0;
}


x86 assembly (clang, -O0):
<xfuse_file_contents_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xfuse_file_contents_range(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int log(float);
float AmplitudeRatioToDecibels(float amplitude_ratio) {
  return (20 / 2.30258509299404568) * log(amplitude_ratio);
}


x86 assembly (clang, -O0):
<AmplitudeRatioToDecibels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <log@plt>
cvtsi2sd %eax,%xmm1
movsd  0xecd(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AmplitudeRatioToDecibels>:
push   %rax
call   1030 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xedb(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @AmplitudeRatioToDecibels(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @log(float %3)
%5 = sitofp i32 %4 to double
%6 = fmul double 0x40215F2CED384F28, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @AmplitudeRatioToDecibels(float %0) {
%2 = tail call i32 @log(float %0)
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x40215F2CED384F28
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("Hello world!");
  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)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world!\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 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void slow() {
  int i;
  long a;
  for (i = 1; i < 100000000; i++)
    a = 2000 * 4000 / 23;
}


x86 assembly (clang, -O0):
<slow>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
cmpl   $0x5f5e100,-0x4(%rbp)
jge    112e <slow+0x2e>
movq   $0x54eb2,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <slow+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @slow() {
%1 = alloca i32
%2 = alloca i64
store i32 1, i32* %1
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 100000000
br i1 %5, label %6, label %10
6: ; preds = %3
store i64 347826, i64* %2
br label %7
7: ; preds = %6
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @slow() {
ret void
}
int security_file_mmap(struct file *file, unsigned long prot,
                       unsigned long flags) {
  return 0;
}


x86 assembly (clang, -O0):
<security_file_mmap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.file = type opaque
define i32 @security_file_mmap(%struct.file* %0, i64 %1, i64 %2) {
%4 = alloca %struct.file*
%5 = alloca i64
%6 = alloca i64
store %struct.file* %0, %struct.file** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
%struct.file = type opaque
define i32 @security_file_mmap(%struct.file* nocapture readnone %0, i64 %1, i64 %2) {
ret i32 0
}
int longitud_string(char *s) {
  int i;
  i = 0;
  while (*(s++) != '\0')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<longitud_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <longitud_string+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <longitud_string+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<longitud_string>:
cmpb   $0x0,(%rdi)
je     111c <longitud_string+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <longitud_string+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @longitud_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 i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ rtv_StreamEnable();
void rtvISDBT_EnableStreamOut(void) {
  ((void)0);
  rtv_StreamEnable();
  ((void)0);
}


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

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

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

LLVM IR (-O2):
define void @rtvISDBT_EnableStreamOut() {
%1 = tail call i32 (...) @rtv_StreamEnable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void delete (void *p) {
  if (p != NULL)
    free(p);
}


x86 assembly (clang, -O0):
<delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <delete+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete>:
test   %rdi,%rdi
je     111a <delete+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @delete(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void glUniformMatrix2fv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUniformMatrix2fv() {
ret void
}
double calcMeanObliquityOfEcliptic(double t) {
  double seconds = 21.448 - t * (46.8150 + t * (0.00059 - t * (0.001813)));
  double e0 = 23.0 + (26.0 + (seconds / 60.0)) / 60.0;
  return e0;
}


x86 assembly (clang, -O0):
<calcMeanObliquityOfEcliptic>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  0xef1(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xeed(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xecd(%rip),%xmm2
addsd  %xmm2,%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe9e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe78(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe74(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe60(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe4c(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcMeanObliquityOfEcliptic>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xeec(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xee8(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  0xee4(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  0xee0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calcMeanObliquityOfEcliptic(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = load double, double* %2
%7 = load double, double* %2
%8 = fneg double %7
%9 = call double @llvm.fmuladd.f64(double %8, double 1.813000e-03, double 5.900000e-04)
%10 = call double @llvm.fmuladd.f64(double %6, double %9, double 4.681500e+01)
%11 = fneg double %5
%12 = call double @llvm.fmuladd.f64(double %11, double %10, double 2.144800e+01)
store double %12, double* %3
%13 = load double, double* %3
%14 = fdiv double %13, 6.000000e+01
%15 = fadd double 2.600000e+01, %14
%16 = fdiv double %15, 6.000000e+01
%17 = fadd double 2.300000e+01, %16
store double %17, double* %4
%18 = load double, double* %4
ret double %18
}

LLVM IR (-O2):
define double @calcMeanObliquityOfEcliptic(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.813000e-03, double 5.900000e-04)
%4 = tail call double @llvm.fmuladd.f64(double %0, double %3, double 4.681500e+01)
%5 = tail call double @llvm.fmuladd.f64(double %2, double %4, double 2.144800e+01)
%6 = fdiv double %5, 6.000000e+01
%7 = fadd double %6, 2.600000e+01
%8 = fdiv double %7, 6.000000e+01
%9 = fadd double %8, 2.300000e+01
ret double %9
}