xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ int80(int, int *, int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
int readData() {
  int n;
  int80(15, &n, 0, 0, 0, 0);
  return n;
}


x86 assembly (clang, -O0):
<readData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xf,%edi
lea    -0x4(%rbp),%rsi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <int80@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readData>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0xf,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <int80@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @readData() {
%1 = alloca i32
%2 = call i32 @int80(i32 15, i32* %1, i32 0, i32 0, i32 0, i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @readData() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @int80(i32 15, i32* %1, i32 0, i32 0, i32 0, i32 0)
%4 = load i32, i32* %1
ret i32 %4
}
/* Variables and functions */
scalar_t__ my_malloc(size_t, char *);
char *my_mallocc(size_t n, char *what) {
  return (char *)my_malloc((n ? n : 1) * sizeof(char), what);
}


x86 assembly (clang, -O0):
<my_mallocc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <my_mallocc+0x28>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1146 <my_mallocc+0x36>
mov    $0x1,%eax
mov    %rax,-0x18(%rbp)
jmp    1146 <my_mallocc+0x36>
mov    -0x18(%rbp),%rdi
shl    $0x0,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <my_malloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_mallocc>:
test   %rdi,%rdi
mov    $0x1,%eax
cmove  %rax,%rdi
jmp    1030 <my_malloc@plt>

LLVM IR (-O0):
define i8* @my_mallocc(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i64, i64* %3
br label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %7
%11 = phi i64 [ %8, %7 ], [ 1, %9 ]
%12 = mul i64 %11, 1
%13 = load i8*, i8** %4
%14 = call i64 @my_malloc(i64 %12, i8* %13)
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @my_mallocc(i64 %0, i8* %1) {
%3 = icmp eq i64 %0, 0
%4 = select i1 %3, i64 1, i64 %0
%5 = tail call i64 @my_malloc(i64 %4, i8* %1)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
int main() {
  double a = 55.32;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsd  0xeed(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 5.532000e+01, double* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned int count_ones(unsigned char _x) {
  unsigned int n = 0;
  unsigned int i;
  for (i = 0; i < 8; i++)
    n += (_x >> i) & 0x01;
  return n;
}


x86 assembly (clang, -O0):
<count_ones>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jae    1142 <count_ones+0x42>
movzbl -0x1(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <count_ones+0x18>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_ones>:
mov    %edi,%eax
and    $0x1,%eax
mov    %edi,%ecx
shr    %ecx
and    $0x1,%ecx
add    %eax,%ecx
mov    %edi,%eax
shr    $0x2,%eax
and    $0x1,%eax
add    %ecx,%eax
mov    %edi,%ecx
shr    $0x3,%ecx
and    $0x1,%ecx
add    %eax,%ecx
mov    %edi,%eax
shr    $0x4,%eax
and    $0x1,%eax
add    %ecx,%eax
mov    %edi,%ecx
shr    $0x5,%ecx
and    $0x1,%ecx
add    %eax,%ecx
mov    %edi,%eax
shr    $0x6,%eax
and    $0x1,%eax
add    %ecx,%eax
shr    $0x7,%edi
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @count_ones(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = and i32 %2, 1
%4 = lshr i32 %2, 1
%5 = and i32 %4, 1
%6 = add nuw nsw i32 %5, %3
%7 = lshr i32 %2, 2
%8 = and i32 %7, 1
%9 = add nuw nsw i32 %8, %6
%10 = lshr i32 %2, 3
%11 = and i32 %10, 1
%12 = add nuw nsw i32 %11, %9
%13 = lshr i32 %2, 4
%14 = and i32 %13, 1
%15 = add nuw nsw i32 %14, %12
%16 = lshr i32 %2, 5
%17 = and i32 %16, 1
%18 = add nuw nsw i32 %17, %15
%19 = lshr i32 %2, 6
%20 = and i32 %19, 1
%21 = add nuw nsw i32 %20, %18
%22 = lshr i32 %2, 7
%23 = add nuw nsw i32 %22, %21
ret i32 %23
}
/* Variables and functions */
scalar_t__ get_first_call();
int /*<<< orphan*/ set_first_call(int /*<<< orphan*/);
int /*<<< orphan*/ setup_index();
int /*<<< orphan*/ setup_semaphore();
void setup_state() {
  if (get_first_call()) {
    setup_index();
    setup_semaphore();
    set_first_call(0);
  }
}


x86 assembly (clang, -O0):
<setup_state>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <get_first_call@plt>
cmp    $0x0,%rax
je     116a <setup_state+0x2a>
mov    $0x0,%al
call   1060 <setup_index@plt>
mov    $0x0,%al
call   1030 <setup_semaphore@plt>
xor    %edi,%edi
call   1040 <set_first_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_state>:
push   %rax
xor    %eax,%eax
call   1050 <get_first_call@plt>
test   %rax,%rax
je     1163 <setup_state+0x23>
xor    %eax,%eax
call   1060 <setup_index@plt>
xor    %eax,%eax
call   1030 <setup_semaphore@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <set_first_call@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @setup_state() {
%1 = call i64 (...) @get_first_call()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i32 (...) @setup_index()
%5 = call i32 (...) @setup_semaphore()
%6 = call i32 @set_first_call(i32 0)
br label %7
7: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @setup_state() {
%1 = tail call i64 (...) @get_first_call()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 (...) @setup_index()
%5 = tail call i32 (...) @setup_semaphore()
%6 = tail call i32 @set_first_call(i32 0)
br label %7
7: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ staticVariable(int);
int main() {
  printf("First call to function:\n");
  staticVariable(5);
  printf("\nSecond call to function\n");
  staticVariable(11);
  printf("\nThird call to function\n");
  staticVariable(37);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <staticVariable@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    $0xb,%edi
call   1040 <staticVariable@plt>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x25,%edi
call   1040 <staticVariable@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1040 <staticVariable@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    $0xb,%edi
call   1040 <staticVariable@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x25,%edi
call   1040 <staticVariable@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"First call to function:\0A\00"
@.str.1 = [26 x i8] c"\0ASecond call to function\0A\00"
@.str.2 = [25 x i8] c"\0AThird call to function\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @staticVariable(i32 5)
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @staticVariable(i32 11)
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @staticVariable(i32 37)
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"First call to function:\00"
@str.3 = [25 x i8] c"\0ASecond call to function\00"
@str.4 = [24 x i8] c"\0AThird call to function\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @staticVariable(i32 5)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @staticVariable(i32 11)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.4, i64 0, i64 0))
%6 = tail call i32 @staticVariable(i32 37)
ret i32 0
}
char *hash_plugin_summary(void) {
  return ("django256 \tDjango SHA-256 plugin");
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"django256 \09Django SHA-256 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [33 x i8] c"django256 \09Django SHA-256 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}
double dnorm(double x, double m, double sd, int give_log) { return 0; }


x86 assembly (clang, -O0):
<dnorm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dnorm>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @dnorm(double %0, double %1, double %2, i32 %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store i32 %3, i32* %8
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @dnorm(double %0, double %1, double %2, i32 %3) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, char *);
void Pl_Jump(char *label) {
  Inst_Printf("lda", "$27,%s", label);
  Inst_Printf("jmp", "$31,($27),%s", label);
}


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

x86 assembly (clang, -O2):
<Pl_Jump>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    %rbx,%rdx
call   1030 <Inst_Printf@plt>
lea    0xeda(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"lda\00"
@.str.1 = [7 x i8] c"$27,%s\00"
@.str.2 = [4 x i8] c"jmp\00"
@.str.3 = [13 x i8] c"$31,($27),%s\00"
define void @Pl_Jump(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"lda\00"
@.str.1 = [7 x i8] c"$27,%s\00"
@.str.2 = [4 x i8] c"jmp\00"
@.str.3 = [13 x i8] c"$31,($27),%s\00"
define void @Pl_Jump(i8* %0) {
%2 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%3 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %0)
ret void
}
const char *aeApiName(void) { return "epoll"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"epoll\00"
define i8* @aeApiName() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void sys_bashfilename(const char *from, char *to) {
  char c;
  while ((c = *from++)) {
    *to++ = c;
  }
  *to = 0;
}


x86 assembly (clang, -O0):
<sys_bashfilename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     1141 <sys_bashfilename+0x41>
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <sys_bashfilename+0xc>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_bashfilename>:
mov    (%rdi),%al
test   %al,%al
je     1121 <sys_bashfilename+0x21>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rsi)
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <sys_bashfilename+0x10>
movb   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define void @sys_bashfilename(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i8* [ %10, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %1, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
int execute_setfsgid32() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_setfsgid32() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ work();
int main(void) {
  freopen("project.in", "r", stdin);
  freopen("project.out", "w", stdout);
  work();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
lea    0xec1(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1040 <freopen@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edx
lea    0xeb2(%rip),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <freopen@plt>
mov    $0x0,%al
call   1030 <work@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1040 <freopen@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edx
lea    0xec0(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1040 <freopen@plt>
xor    %eax,%eax
call   1030 <work@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"project.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [12 x i8] c"project.out\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdin
%3 = call i32 @freopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stdout
%5 = call i32 @freopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @work()
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"project.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [12 x i8] c"project.out\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @freopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @freopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @work()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ build_segment_tree(int *, int *, int /*<<< orphan*/, int,
                                      int /*<<< orphan*/);
scalar_t__ calloc(int /*<<< orphan*/, int);
int /*<<< orphan*/ segment_tree_size(int);
int *get_segment_tree(int *input, int size) {
  int *segment_tree = (int *)calloc(segment_tree_size(size), sizeof(int));
  build_segment_tree(segment_tree, input, 0, size - 1, 0);
  return segment_tree;
}


x86 assembly (clang, -O0):
<get_segment_tree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <segment_tree_size@plt>
mov    %eax,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
xor    %r8d,%r8d
mov    %r8d,%edx
call   1040 <build_segment_tree@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_segment_tree>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1050 <segment_tree_size@plt>
mov    %eax,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%r15
add    $0xffffffff,%ebx
mov    %rax,%rdi
mov    %r14,%rsi
xor    %edx,%edx
mov    %ebx,%ecx
xor    %r8d,%r8d
call   1040 <build_segment_tree@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @get_segment_tree(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @segment_tree_size(i32 %6)
%8 = call i64 @calloc(i32 %7, i32 4)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i32*, i32** %3
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
%14 = call i32 @build_segment_tree(i32* %10, i32* %11, i32 0, i32 %13, i32 0)
%15 = load i32*, i32** %5
ret i32* %15
}

LLVM IR (-O2):
define i32* @get_segment_tree(i32* %0, i32 %1) {
%3 = tail call i32 @segment_tree_size(i32 %1)
%4 = tail call i64 @calloc(i32 %3, i32 4)
%5 = inttoptr i64 %4 to i32*
%6 = add nsw i32 %1, -1
%7 = tail call i32 @build_segment_tree(i32* %5, i32* %0, i32 0, i32 %6, i32 0)
ret i32* %5
}
int fn3(signed int x, signed int y) {
  signed int tem1 = x & y;
  signed int tem2 = x | y;
  return tem2 ^ tem1;
}


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

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

LLVM IR (-O0):
define i32 @fn3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = and i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = or i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = xor i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn3(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
int skip_singlestep(struct kprobe *p, struct pt_regs *regs,
                    struct kprobe_ctlblk *kcb) {
  return 0;
}


x86 assembly (clang, -O0):
<skip_singlestep>:
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):
<skip_singlestep>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
%struct.kprobe = type opaque
%struct.pt_regs = type opaque
%struct.kprobe_ctlblk = type opaque
define i32 @skip_singlestep(%struct.kprobe* nocapture readnone %0, %struct.pt_regs* nocapture readnone %1, %struct.kprobe_ctlblk* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Minimum of 1 & 2: %i\n", ((((1) > (2)) ? (2) : (1))));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
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    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Minimum of 1 & 2: %i\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Minimum of 1 & 2: %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ crc64_jones_norm_base(int /*<<< orphan*/,
                                         int /*<<< orphan*/ const *,
                                         int /*<<< orphan*/);
uint64_t crc64_jones_norm(uint64_t seed, const uint8_t *buf, uint64_t len) {
  return crc64_jones_norm_base(seed, buf, len);
}


x86 assembly (clang, -O0):
<crc64_jones_norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <crc64_jones_norm_base@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc64_jones_norm>:
jmp    1030 <crc64_jones_norm_base@plt>

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

LLVM IR (-O2):
define i32 @crc64_jones_norm(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @crc64_jones_norm_base(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
void u32_to_b4r(unsigned char *b, unsigned long l) {
  b[3] = l & 0xff;
  b[2] = (l >> 8) & 0xff;
  b[1] = (l >> 16) & 0xff;
  b[0] = (l >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<u32_to_b4r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @u32_to_b4r(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 255
%7 = trunc i64 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 3
store i8 %7, i8* %9
%10 = load i64, i64* %4
%11 = lshr i64 %10, 8
%12 = and i64 %11, 255
%13 = trunc i64 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 2
store i8 %13, i8* %15
%16 = load i64, i64* %4
%17 = lshr i64 %16, 16
%18 = and i64 %17, 255
%19 = trunc i64 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 1
store i8 %19, i8* %21
%22 = load i64, i64* %4
%23 = lshr i64 %22, 24
%24 = and i64 %23, 255
%25 = trunc i64 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 0
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @u32_to_b4r(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %3, i8* %4
%5 = lshr i64 %1, 8
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %6, i8* %7
%8 = lshr i64 %1, 16
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %9, i8* %10
%11 = lshr i64 %1, 24
%12 = trunc i64 %11 to i8
store i8 %12, i8* %0
ret void
}
main() {
  char *p = __FUNCTION__;
i:
  &&i;
}


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

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

LLVM IR (-O0):
@__FUNCTION__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i8** %2
br label %3
3: ; preds = %5, %0
%4 = load i32, i32* %1
ret i32 %4
5: ; No predecessors!
indirectbr i8* undef, [label %3]
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
double fabs(double);
double elliott_activation(const double x) {
  double temp = x * 1.0;
  return (((0.5 * temp) / (1.0 + fabs(temp))) + 0.5);
}


x86 assembly (clang, -O0):
<elliott_activation>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xedd(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movaps 0xedc(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  0xec8(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb0(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<elliott_activation>:
movsd  0xef8(%rip),%xmm2
movapd %xmm0,%xmm1
mulsd  %xmm2,%xmm1
andpd  0xef8(%rip),%xmm0
addsd  0xee8(%rip),%xmm0
divsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @elliott_activation(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 1.000000e+00
store double %5, double* %3
%6 = load double, double* %3
%7 = fmul double 5.000000e-01, %6
%8 = load double, double* %3
%9 = call double @llvm.fabs.f64(double %8)
%10 = fadd double 1.000000e+00, %9
%11 = fdiv double %7, %10
%12 = fadd double %11, 5.000000e-01
ret double %12
}

LLVM IR (-O2):
define double @elliott_activation(double %0) {
%2 = fmul double %0, 5.000000e-01
%3 = tail call double @llvm.fabs.f64(double %0)
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double %2, %4
%6 = fadd double %5, 5.000000e-01
ret double %6
}
void PublishScore() {}


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

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

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

LLVM IR (-O2):
define void @PublishScore() {
ret void
}
char *hash_plugin_detailed(void) {
  return ("sha1 - A simple sha1 plugin\n"
          "------------------------\n"
          "Use this module to crack simple sha1 hashes\n"
          "Input should be in form: \'user:hash\' or just \'hash\'\n"
          "Known software that uses this password hashing method:\n"
          "PunBB > 1.2.0, Elite CMS, Frog, Serendipity > 1.5.x \n"
          "pecio CMS, Kajona\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


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

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

LLVM IR (-O0):
@.str = [321 x i8] c"sha1 - A simple sha1 plugin\0A------------------------\0AUse this module to crack simple sha1 hashes\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0APunBB > 1.2.0, Elite CMS, Frog, Serendipity > 1.5.x \0Apecio CMS, Kajona\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([321 x i8], [321 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [321 x i8] c"sha1 - A simple sha1 plugin\0A------------------------\0AUse this module to crack simple sha1 hashes\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0APunBB > 1.2.0, Elite CMS, Frog, Serendipity > 1.5.x \0Apecio CMS, Kajona\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([321 x i8], [321 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef scalar_t__ int64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ WriteUint64Be(int /*<<< orphan*/, void *);
int32_t WriteInt64Be(int64_t value, void *out) {
  return WriteUint64Be((uint64_t)value, out);
}


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

x86 assembly (clang, -O2):
<WriteInt64Be>:
jmp    1030 <WriteUint64Be@plt>

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

LLVM IR (-O2):
define i32 @WriteInt64Be(i64 %0, i8* %1) {
%3 = trunc i64 %0 to i32
%4 = tail call i32 @WriteUint64Be(i32 %3, i8* %1)
ret i32 %4
}
/* Variables and functions */
int THDiskFile_isLittleEndianCPU(void) {
  int x = 7;
  char *ptr = (char *)&x;
  if (ptr[0] == 0)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<THDiskFile_isLittleEndianCPU>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    112f <THDiskFile_isLittleEndianCPU+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1136 <THDiskFile_isLittleEndianCPU+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @THDiskFile_isLittleEndianCPU() {
ret i32 1
}
/* Variables and functions */
double eval_A(int, int);
int main() { return (int)(eval_A(3, 5) * 120.3); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
mov    $0x5,%esi
call   1030 <eval_A@plt>
movsd  0xeca(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x5,%esi
call   1030 <eval_A@plt>
mulsd  0xed8(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @eval_A(i32 3, i32 5)
%3 = fmul double %2, 1.203000e+02
%4 = fptosi double %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double @eval_A(i32 3, i32 5)
%2 = fmul double %1, 1.203000e+02
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ x54x_out(int /*<<< orphan*/, int, void *);
void x54x_outl(uint16_t port, uint32_t val, void *priv) {
  x54x_out(port, val & 0xFF, priv);
}


x86 assembly (clang, -O0):
<x54x_outl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
and    $0xff,%esi
mov    -0x10(%rbp),%rdx
call   1030 <x54x_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x54x_outl>:
movzbl %sil,%esi
jmp    1030 <x54x_out@plt>

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

LLVM IR (-O2):
define void @x54x_outl(i32 %0, i32 %1, i8* %2) {
%4 = and i32 %1, 255
%5 = tail call i32 @x54x_out(i32 %0, i32 %4, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void stdclrscr(void) { system("cls"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
define void @stdclrscr() {
%1 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
define void @stdclrscr() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int main() {
  char buf[22];
  char *username = "xx.php";
  snprintf(buf, sizeof(buf), "/data/profiles/%s.txt", username);
  printf("%s\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0x16,%esi
lea    0xeb9(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x20(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xedb(%rip),%rdx
lea    0xecd(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x16,%esi
call   1040 <snprintf@plt>
lea    0xed3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"xx.php\00"
@.str.1 = [22 x i8] c"/data/profiles/%s.txt\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [22 x i8]
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 0
%5 = load i8*, i8** %3
%6 = call i32 @snprintf(i8* %4, i32 22, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"xx.php\00"
@.str.1 = [22 x i8] c"/data/profiles/%s.txt\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [22 x i8]
%2 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 22, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
int fun960() { return 960; }


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

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

LLVM IR (-O0):
define i32 @fun960() {
ret i32 960
}

LLVM IR (-O2):
define i32 @fun960() {
ret i32 960
}
/* Variables and functions */
int /*<<< orphan*/ notimplemented(char *);
void __svgalib_driver8p_putboxmask(int x, int y, int w, int h, void *b) {
  {
    notimplemented("8-bit paged putboxmask");
    return;
  };
}


x86 assembly (clang, -O0):
<__svgalib_driver8p_putboxmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
lea    0xed1(%rip),%rdi
call   1030 <notimplemented@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"8-bit paged putboxmask\00"
define void @__svgalib_driver8p_putboxmask(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = call i32 @notimplemented(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"8-bit paged putboxmask\00"
define void @__svgalib_driver8p_putboxmask(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = tail call i32 @notimplemented(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
int GetCompileMonth(void) {
  int month = ("Mar 16 2022"[2] == 'n'   ? ("Mar 16 2022"[1] == 'a' ? 0 : 5)
               : "Mar 16 2022"[2] == 'b' ? 1
               : "Mar 16 2022"[2] == 'r' ? ("Mar 16 2022"[0] == 'M' ? 2 : 3)
               : "Mar 16 2022"[2] == 'y' ? 4
               : "Mar 16 2022"[2] == 'l' ? 6
               : "Mar 16 2022"[2] == 'g' ? 7
               : "Mar 16 2022"[2] == 'p' ? 8
               : "Mar 16 2022"[2] == 't' ? 9
               : "Mar 16 2022"[2] == 'v' ? 10
                                         : 11);
  return (month + 1);
}


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

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

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

LLVM IR (-O2):
define i32 @GetCompileMonth() {
ret i32 3
}
int freeChar(char *ptr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @freeChar(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int clz64(int /*<<< orphan*/);
int clo64(uint64_t val) { return clz64(~val); }


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

x86 assembly (clang, -O2):
<clo64>:
not    %edi
jmp    1030 <clz64@plt>

LLVM IR (-O0):
define i32 @clo64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = call i32 @clz64(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @clo64(i32 %0) {
%2 = xor i32 %0, -1
%3 = tail call i32 @clz64(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ KVM_HC_MIPS_CONSOLE_OUTPUT;
int /*<<< orphan*/ kvm_hypercall3(int /*<<< orphan*/, int /*<<< orphan*/,
                                  unsigned long, int);
int prom_putchar(char c) {
  kvm_hypercall3(KVM_HC_MIPS_CONSOLE_OUTPUT, 0, (unsigned long)&c, 1);
  return 1;
}


x86 assembly (clang, -O0):
<prom_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    -0x1(%rbp),%rdx
xor    %esi,%esi
mov    $0x1,%ecx
call   1030 <kvm_hypercall3@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prom_putchar>:
push   %rax
mov    %dil,0x7(%rsp)
mov    0x2ecb(%rip),%rax
mov    (%rax),%edi
lea    0x7(%rsp),%rdx
xor    %esi,%esi
mov    $0x1,%ecx
call   1030 <kvm_hypercall3@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@KVM_HC_MIPS_CONSOLE_OUTPUT = global i32 0
define i32 @prom_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i32, i32* @KVM_HC_MIPS_CONSOLE_OUTPUT
%4 = ptrtoint i8* %2 to i64
%5 = call i32 @kvm_hypercall3(i32 %3, i32 0, i64 %4, i32 1)
ret i32 1
}

LLVM IR (-O2):
@KVM_HC_MIPS_CONSOLE_OUTPUT = global i32 0
define i32 @prom_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i32, i32* @KVM_HC_MIPS_CONSOLE_OUTPUT
%4 = ptrtoint i8* %2 to i64
%5 = call i32 @kvm_hypercall3(i32 %3, i32 0, i64 %4, i32 1)
ret i32 1
}
int bin_search(int len, double *tab, double y) {
  int l, m, r;
  l = 0;
  r = len;
  while (l < r) {
    m = (l + r) >> 1;
    if (y < tab[m])
      r = m;
    else
      l = m + 1;
  }
  return (r);
}


x86 assembly (clang, -O0):
<bin_search>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    116a <bin_search+0x6a>
mov    -0x1c(%rbp),%eax
add    -0x24(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    115c <bin_search+0x5c>
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1165 <bin_search+0x65>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111d <bin_search+0x1d>
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin_search>:
mov    %edi,%eax
test   %edi,%edi
jle    1132 <bin_search+0x32>
xor    %ecx,%ecx
jmp    1119 <bin_search+0x19>
nopw   0x0(%rax,%rax,1)
add    $0x1,%edx
mov    %edx,%ecx
cmp    %eax,%ecx
jge    1132 <bin_search+0x32>
lea    (%rax,%rcx,1),%edx
sar    %edx
movslq %edx,%rdi
movsd  (%rsi,%rdi,8),%xmm1
ucomisd %xmm0,%xmm1
jbe    1110 <bin_search+0x10>
mov    %edx,%eax
cmp    %eax,%ecx
jl     1119 <bin_search+0x19>
ret

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

LLVM IR (-O2):
define i32 @bin_search(i32 %0, double* nocapture %1, double %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %18
5: ; preds = %3, %5
%6 = phi i32 [ %16, %5 ], [ %0, %3 ]
%7 = phi i32 [ %15, %5 ], [ 0, %3 ]
%8 = add nsw i32 %6, %7
%9 = ashr i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %1, i64 %10
%12 = load double, double* %11
%13 = fcmp ogt double %12, %2
%14 = add nsw i32 %9, 1
%15 = select i1 %13, i32 %7, i32 %14
%16 = select i1 %13, i32 %9, i32 %6
%17 = icmp slt i32 %15, %16
br i1 %17, label %5, label %18
18: ; preds = %5, %3
%19 = phi i32 [ %0, %3 ], [ %16, %5 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc5(void) {
  printf("Executing exitfunc5.\n");
  exit(0);
}


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

x86 assembly (clang, -O2):
<exitfunc5>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Executing exitfunc5.\0A\00"
define void @exitfunc5() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"Executing exitfunc5.\00"
define void @exitfunc5() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}