xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ rotr(int *, int *, int *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  int b;
  int c;
  scanf("%d", &a);
  scanf("%d", &b);
  scanf("%d", &c);
  rotr(&a, &b, &c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <scanf@plt>
lea    0xeaa(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <scanf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <rotr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xece(%rip),%rbx
lea    0x14(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <scanf@plt>
lea    0x10(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <scanf@plt>
lea    0xc(%rsp),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <scanf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <rotr@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = call i32 @rotr(i32* %1, i32* %2, i32* %3)
ret i32 0
}
signed short int signedshortint_ignoring_signedshortint(signed short int x,
                                                        signed short int y) {
  return x;
}


x86 assembly (clang, -O0):
<signedshortint_ignoring_signedshortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @signedshortint_ignoring_signedshortint(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @signedshortint_ignoring_signedshortint(i16 returned signext %0, i16 signext %1) {
ret i16 %0
}
void *test(void) {
  unsigned long long tamaire;
  if (tamaire != 'TOTO') {
    return ((void *)0);
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
cmpq   $0x544f544f,-0x10(%rbp)
54
je     111a <test+0x1a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @test() {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
pid_t getppid(void) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @getppid() {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ rax;

/* Variables and functions */
int /*<<< orphan*/ cpuid(int, int *, int *, int *, int *);
bool cpuid_pkg_therm_Stat_AND_Interrupt() {
  uint64_t rax, rbx, rcx, rdx;
  int leaf = 6;
  cpuid(leaf, &rax, &rbx, &rcx, &rdx);
  if ((((uint64_t)(rax) &
        ((((uint64_t)1 << (((6)) - ((6)) + 1)) - 1) << ((6)))) >>
       (6)) == 1) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<cpuid_pkg_therm_Stat_AND_Interrupt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x6,-0x18(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x8(%rbp),%eax
and    $0x40,%eax
sar    $0x6,%eax
cmp    $0x1,%eax
jne    1155 <cpuid_pkg_therm_Stat_AND_Interrupt+0x45>
movl   $0x1,-0x4(%rbp)
jmp    115c <cpuid_pkg_therm_Stat_AND_Interrupt+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_pkg_therm_Stat_AND_Interrupt>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x6,%edi
call   1030 <cpuid@plt>
mov    0x8(%rsp),%eax
shr    $0x6,%eax
and    $0x1,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @cpuid_pkg_therm_Stat_AND_Interrupt() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 6, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
%11 = lshr i32 %10, 6
%12 = and i32 %11, 1
ret i32 %12
}
/* Type definitions */
struct arg_xxx {
  int dummy;
};

/* Variables and functions */
struct arg_xxx *arg_xxxn(char const *, char const *, char const *, int, int,
                         double, double, char const *);
struct arg_xxx *arg_xxx1(const char *shortopts, const char *longopts,
                         const char *datatype, double minvalue, double maxvalue,
                         const char *glossary) {
  return arg_xxxn(shortopts, longopts, datatype, 1, 1, minvalue, maxvalue,
                  glossary);
}


x86 assembly (clang, -O0):
<arg_xxx1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x30(%rbp),%r9
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1030 <arg_xxxn@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_xxx1>:
mov    %rcx,%r9
mov    $0x1,%ecx
mov    $0x1,%r8d
jmp    1030 <arg_xxxn@plt>

LLVM IR (-O0):
%struct.arg_xxx = type { i32 }
define %struct.arg_xxx* @arg_xxx1(i8* %0, i8* %1, i8* %2, double %3, double %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca double
%11 = alloca double
%12 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store double %3, double* %10
store double %4, double* %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load double, double* %10
%17 = load double, double* %11
%18 = load i8*, i8** %12
%19 = call %struct.arg_xxx* @arg_xxxn(i8* %13, i8* %14, i8* %15, i32 1, i32 1, double %16, double %17, i8* %18)
ret %struct.arg_xxx* %19
}

LLVM IR (-O2):
%struct.arg_xxx = type { i32 }
define %struct.arg_xxx* @arg_xxx1(i8* %0, i8* %1, i8* %2, double %3, double %4, i8* %5) {
%7 = tail call %struct.arg_xxx* @arg_xxxn(i8* %0, i8* %1, i8* %2, i32 1, i32 1, double %3, double %4, i8* %5)
ret %struct.arg_xxx* %7
}
unsigned xrop3_133_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = ~T;
  stk3 = S | stk4;
  stk2 = D & stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_133_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_133_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
xor    $0xff,%esi
or     %edi,%esi
xor    %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_133_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %5, 255
%8 = or i32 %7, %3
%9 = xor i32 %6, %8
%10 = or i32 %9, %4
%11 = xor i32 %10, -1
%12 = or i32 %11, %3
ret i32 %12
}
int menor(const void *a, const void *b) { return *(int *)a - *(int *)b; }


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

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

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

LLVM IR (-O2):
define i32 @menor(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void kasan_free_shadow(const struct vm_struct *vm) {}


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

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

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

LLVM IR (-O2):
%struct.vm_struct = type opaque
define void @kasan_free_shadow(%struct.vm_struct* nocapture %0) {
ret void
}
void gacir_(scan_no, feed_no, phase_no, rec_no, record,
            return_code) int *scan_no,
    phase_no, rec_no;
int *feed_no;
float *record;
int *return_code;
{}


x86 assembly (clang, -O0):
<gacir_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gacir_(i32* %0, i32* %1, i32 %2, i32 %3, float* %4, i32* %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca float*
%12 = alloca i32*
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store float* %4, float** %11
store i32* %5, i32** %12
ret void
}

LLVM IR (-O2):
define void @gacir_(i32* nocapture %0, i32* nocapture %1, i32 %2, i32 %3, float* nocapture %4, i32* nocapture %5) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_INTERRUPT;
int /*<<< orphan*/ ptrace(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void pause_pid(pid_t pid) { ptrace(PTRACE_INTERRUPT, pid, NULL, NULL); }


x86 assembly (clang, -O0):
<pause_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <ptrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause_pid>:
mov    %edi,%esi
mov    0x2ecf(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <ptrace@plt>

LLVM IR (-O0):
@PTRACE_INTERRUPT = global i32 0
define void @pause_pid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @PTRACE_INTERRUPT
%4 = load i32, i32* %2
%5 = call i32 @ptrace(i32 %3, i32 %4, i32* null, i32* null)
ret void
}

LLVM IR (-O2):
@PTRACE_INTERRUPT = global i32 0
define void @pause_pid(i32 %0) {
%2 = load i32, i32* @PTRACE_INTERRUPT
%3 = tail call i32 @ptrace(i32 %2, i32 %0, i32* null, i32* null)
ret void
}
/* Type definitions */
struct shash_node {
  int dummy;
};
struct shash {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ shash_steal(struct shash *, struct shash_node *);
void shash_delete(struct shash *sh, struct shash_node *node) {
  free(shash_steal(sh, node));
}


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

x86 assembly (clang, -O2):
<shash_delete>:
push   %rax
call   1040 <shash_steal@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.shash = type { i32 }
%struct.shash_node = type { i32 }
define void @shash_delete(%struct.shash* %0, %struct.shash_node* %1) {
%3 = tail call i32 @shash_steal(%struct.shash* %0, %struct.shash_node* %1)
%4 = tail call i32 @free(i32 %3)
ret void
}
int *fibonacci(int *number) {
  int x = 0, y = 1, z = 1, i;
  int *fibo_ptr;
  for (i = 1; i <= *number; i++) {
    x = y;
    y = z;
    z = x + y;
  }
  fibo_ptr = &x;
  return fibo_ptr;
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jg     1156 <fibonacci+0x56>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1124 <fibonacci+0x24>
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
lea    -0x4(%rsp),%rax
ret

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

LLVM IR (-O2):
define noalias i32* @fibonacci(i32* nocapture %0) {
%2 = alloca i32
ret i32* %2
}
unsigned int roundUpToNextPowerOfTwo(unsigned int x) {
  x--;
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  x++;
  return x;
}


x86 assembly (clang, -O0):
<roundUpToNextPowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundUpToNextPowerOfTwo>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
shr    %ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @roundUpToNextPowerOfTwo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = lshr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = lshr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = lshr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = lshr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @roundUpToNextPowerOfTwo(i32 %0) {
%2 = add i32 %0, -1
%3 = lshr i32 %2, 1
%4 = or i32 %3, %2
%5 = lshr i32 %4, 2
%6 = or i32 %5, %4
%7 = lshr i32 %6, 4
%8 = or i32 %7, %6
%9 = lshr i32 %8, 8
%10 = or i32 %9, %8
%11 = lshr i32 %10, 16
%12 = or i32 %11, %10
%13 = add i32 %12, 1
ret i32 %13
}
void engine_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @engine_cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int usage(void) {
  fprintf(stderr, "\nUsage: strassen [<cilk-options>] [-n #] [-c]\n\n");
  fprintf(stderr,
          "Multiplies two randomly generated n x n matrices. To check for\n");
  fprintf(stderr, "correctness use -c.\n\n");
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xef7(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xf22(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf01(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf33(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"\0AUsage: strassen [<cilk-options>] [-n #] [-c]\0A\0A\00"
@.str.1 = [64 x i8] c"Multiplies two randomly generated n x n matrices. To check for\0A\00"
@.str.2 = [22 x i8] c"correctness use -c.\0A\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"\0AUsage: strassen [<cilk-options>] [-n #] [-c]\0A\0A\00"
@.str.1 = [64 x i8] c"Multiplies two randomly generated n x n matrices. To check for\0A\00"
@.str.2 = [22 x i8] c"correctness use -c.\0A\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void ret(void) { put8(0xC3); }


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

x86 assembly (clang, -O2):
<ret>:
mov    $0xc3,%edi
jmp    1030 <put8@plt>

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

LLVM IR (-O2):
define void @ret() {
%1 = tail call i32 @put8(i32 195)
ret void
}
int my_strlen(const char *str) {
  int len = 0;
  while (str[len] != '\0') {
    len++;
  }
  return len;
}


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

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double fb_Timer(void) {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return (((double)tv.tv_sec * 1000000.0) + (double)tv.tv_usec) * 0.000001;
}


x86 assembly (clang, -O0):
<fb_Timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xed1(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeb9(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_Timer>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm0
cvtsi2sdq 0x8(%rsp),%xmm1
mulsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
mulsd  0xec6(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @fb_Timer() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = call double @llvm.fmuladd.f64(double %5, double 1.000000e+06, double %8)
%10 = fmul double %9, 0x3EB0C6F7A0B5ED8D
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @fb_Timer() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = call double @llvm.fmuladd.f64(double %6, double 1.000000e+06, double %9)
%11 = fmul double %10, 0x3EB0C6F7A0B5ED8D
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int i = 4;
  printf("\n%d", i * i + i);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 20)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F1(int **);
void test1() {
  int *X;
  F1(&X);
  *X = 1;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <F1@plt>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rax
mov    %rsp,%rdi
call   1030 <F1@plt>
mov    (%rsp),%rax
movl   $0x1,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @test1() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = call i32 @F1(i32** %1)
%4 = load i32*, i32** %1
store i32 1, i32* %4
ret void
}
void bar() {
  int i;
  int array[5];
  for (i = 0; i < 5; i++) {
    array[i] = i;
  }
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    112e <bar+0x2e>
mov    -0x4(%rbp),%ecx
movslq -0x4(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <bar+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @bar() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_free(int *);
scalar_t__ my_malloc(int);
int *realloc(int *, int);
void test_config_options_2_ok() {
  int *p = (int *)my_malloc(sizeof(int));
  int *q = realloc(p, sizeof(int));
  my_free(q);
}


x86 assembly (clang, -O0):
<test_config_options_2_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <my_malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1040 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <my_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_config_options_2_ok>:
push   %rax
mov    $0x4,%edi
call   1030 <my_malloc@plt>
mov    %rax,%rdi
mov    $0x4,%esi
call   1040 <realloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1050 <my_free@plt>

LLVM IR (-O0):
define void @test_config_options_2_ok() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i64 @my_malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %1
%5 = load i32*, i32** %1
%6 = call i32* @realloc(i32* %5, i32 4)
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = call i32 @my_free(i32* %7)
ret void
}

LLVM IR (-O2):
define void @test_config_options_2_ok() {
%1 = tail call i64 @my_malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32* @realloc(i32* %2, i32 4)
%4 = tail call i32 @my_free(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
char *strerror(int /*<<< orphan*/);
void err_quit(char *str) {
  puts(str);
  puts(strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<err_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_quit>:
push   %rax
call   1030 <puts@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
define void @err_quit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* %3)
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @puts(i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
define void @err_quit(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ FRGL_CodecCRAM_Init();
int /*<<< orphan*/ FRGL_CodecVFW_Init();
int FRGL_Codec_Init() {
  static int init;
  if (init)
    return (0);
  init = 1;
  FRGL_CodecVFW_Init();
  FRGL_CodecCRAM_Init();
  return (1);
}


x86 assembly (clang, -O0):
<FRGL_Codec_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f05(%rip)
je     1141 <FRGL_Codec_Init+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1160 <FRGL_Codec_Init+0x40>
movl   $0x1,0x2ee9(%rip)
mov    $0x0,%al
call   1030 <FRGL_CodecVFW_Init@plt>
mov    $0x0,%al
call   1040 <FRGL_CodecCRAM_Init@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FRGL_Codec_Init>:
push   %rax
xor    %eax,%eax
cmpb   $0x0,0x2f0a(%rip)
jne    1146 <FRGL_Codec_Init+0x26>
movb   $0x1,0x2f01(%rip)
xor    %eax,%eax
call   1030 <FRGL_CodecVFW_Init@plt>
xor    %eax,%eax
call   1040 <FRGL_CodecCRAM_Init@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FRGL_Codec_Init.init = internal global i32 0
define i32 @FRGL_Codec_Init() {
%1 = alloca i32
%2 = load i32, i32* @FRGL_Codec_Init.init
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %8
5: ; preds = %0
store i32 1, i32* @FRGL_Codec_Init.init
%6 = call i32 (...) @FRGL_CodecVFW_Init()
%7 = call i32 (...) @FRGL_CodecCRAM_Init()
store i32 1, i32* %1
br label %8
8: ; preds = %5, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@FRGL_Codec_Init.init = internal unnamed_addr global i1 false
define i32 @FRGL_Codec_Init() {
%1 = load i1, i1* @FRGL_Codec_Init.init
br i1 %1, label %5, label %2
2: ; preds = %0
store i1 true, i1* @FRGL_Codec_Init.init
%3 = tail call i32 (...) @FRGL_CodecVFW_Init()
%4 = tail call i32 (...) @FRGL_CodecCRAM_Init()
br label %5
5: ; preds = %0, %2
%6 = phi i32 [ 1, %2 ], [ 0, %0 ]
ret i32 %6
}
int get_jump_address(int target, int curr) { return target - 1; }


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

x86 assembly (clang, -O2):
<get_jump_address>:
lea    -0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_jump_address(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = sub nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_jump_address(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int birth_year = 0, age = 0;
  printf("input the birth year:");
  scanf("%d", &birth_year);
  age = 2017 - birth_year;
  printf("your age is %d\n", age);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0x7e1,%esi
sub    0x4(%rsp),%esi
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"input the birth year:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"your age is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = sub nsw i32 2017, %5
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"input the birth year:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"your age is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = sub nsw i32 2017, %5
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
typedef int u_int;

/* Variables and functions */
int RNDUP(int);
u_int fix_buf_size(u_int s) {
  if (s < 100)
    s = 4000;
  return (RNDUP(s));
}


x86 assembly (clang, -O0):
<fix_buf_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    112c <fix_buf_size+0x1c>
movl   $0xfa0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <RNDUP@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_buf_size>:
cmp    $0x64,%edi
mov    $0xfa0,%eax
cmovl  %eax,%edi
jmp    1030 <RNDUP@plt>

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

LLVM IR (-O2):
define i32 @fix_buf_size(i32 %0) {
%2 = icmp slt i32 %0, 100
%3 = select i1 %2, i32 4000, i32 %0
%4 = tail call i32 @RNDUP(i32 %3)
ret i32 %4
}
int status_is_failure(int status) { return status != 0; }


x86 assembly (clang, -O0):
<status_is_failure>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<status_is_failure>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @status_is_failure(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @status_is_failure(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ window;
};
struct TYPE_4__ {
  TYPE_1__ xreparent;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xreparent_window(void *_p) {
  return (unsigned long)((XEvent *)_p)->xreparent.window;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xreparent_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xreparent_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
int omap_msdi_reset(struct omap_hwmod *oh) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.omap_hwmod = type opaque
define i32 @omap_msdi_reset(%struct.omap_hwmod* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help(void) {
  fprintf(stderr, "ndpi_flow_dump [-v] [-m mode] [-i input_binary_file] [-s] "
                  "[-S output_biary_file]\n"
                  "  -v             Verbose + 1\n"
                  "  -m closed|flows Set read mode. Default 'read_all'\n"
                  "  -s             Human readable output (stdout)\n"
                  "  -S file        Write binary data to 'file'\n"
                  "  -i file        Read binary data from the 'file' instead "
                  "/proc/net/xt_ndpi/flows\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [338 x i8] c"ndpi_flow_dump [-v] [-m mode] [-i input_binary_file] [-s] [-S output_biary_file]\0A -v Verbose + 1\0A -m closed|flows Set read mode. Default 'read_all'\0A -s Human readable output (stdout)\0A -S file Write binary data to 'file'\0A -i file Read binary data from the 'file' instead /proc/net/xt_ndpi/flows\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([338 x i8], [338 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [338 x i8] c"ndpi_flow_dump [-v] [-m mode] [-i input_binary_file] [-s] [-S output_biary_file]\0A -v Verbose + 1\0A -m closed|flows Set read mode. Default 'read_all'\0A -s Human readable output (stdout)\0A -S file Write binary data to 'file'\0A -i file Read binary data from the 'file' instead /proc/net/xt_ndpi/flows\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([338 x i8], [338 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int f(int (*sum)(void)) { return fprintf(stderr, "%d\n", sum()); }


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

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    0x2ec8(%rip),%rax
mov    (%rax),%ebx
call   *%rdi
lea    0xedd(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @f(i32 ()* nocapture %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 %0()
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
int main(void) {
  remove("haha");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <remove@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"haha\00"
define i32 @main() {
%1 = tail call i32 @remove(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ DSA;
typedef int /*<<< orphan*/ BN_CTX;
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int dsa_sign_setup(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ **, int /*<<< orphan*/ **,
                   int /*<<< orphan*/ *, int /*<<< orphan*/);
int dsa_sign_setup_no_digest(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,
                             BIGNUM **rp) {
  return dsa_sign_setup(dsa, ctx_in, kinvp, rp, NULL, 0);
}


x86 assembly (clang, -O0):
<dsa_sign_setup_no_digest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <dsa_sign_setup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsa_sign_setup_no_digest>:
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <dsa_sign_setup@plt>

LLVM IR (-O0):
define i32 @dsa_sign_setup_no_digest(i32* %0, i32* %1, i32** %2, i32** %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32**
%8 = alloca i32**
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32** %2, i32*** %7
store i32** %3, i32*** %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32**, i32*** %7
%12 = load i32**, i32*** %8
%13 = call i32 @dsa_sign_setup(i32* %9, i32* %10, i32** %11, i32** %12, i32* null, i32 0)
ret i32 %13
}

LLVM IR (-O2):
define i32 @dsa_sign_setup_no_digest(i32* %0, i32* %1, i32** %2, i32** %3) {
%5 = tail call i32 @dsa_sign_setup(i32* %0, i32* %1, i32** %2, i32** %3, i32* null, i32 0)
ret i32 %5
}
/* Variables and functions */
void *malloc(size_t);
void *rbtree_prv_memAlloc_default(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<rbtree_prv_memAlloc_default>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @rbtree_prv_memAlloc_default(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @rbtree_prv_memAlloc_default(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}