xunge/DecIR huggingface dataset:
int HSIround(double d) {
  int n = (int)d;
  return (d - (double)n) > 0.5 ? (int)(n + 1) : (int)n;
}


x86 assembly (clang, -O0):
<HSIround>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xed9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    113f <HSIround+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1145 <HSIround+0x45>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HSIround>:
cvttsd2si %xmm0,%ecx
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
xor    %eax,%eax
ucomisd 0xee6(%rip),%xmm0
seta   %al
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @HSIround(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
store i32 %5, i32* %3
%6 = load double, double* %2
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
%9 = fsub double %6, %8
%10 = fcmp ogt double %9, 5.000000e-01
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
br label %16
14: ; preds = %1
%15 = load i32, i32* %3
br label %16
16: ; preds = %14, %11
%17 = phi i32 [ %13, %11 ], [ %15, %14 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @HSIround(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fsub double %0, %3
%5 = fcmp ogt double %4, 5.000000e-01
%6 = zext i1 %5 to i32
%7 = add nsw i32 %6, %2
ret i32 %7
}
/* Variables and functions */
int LOG_DEBUG;
scalar_t__ strcmp(char const *, char *);
int syslog_name_to_pri(char const *);
int syslogd_level(const char *name) {
  int pri;
  if (strcmp(name, "none") == 0) {
    return -1;
  }
  pri = syslog_name_to_pri(name);
  if (pri < 0) {
    ;
    pri = LOG_DEBUG;
  }
  return pri;
}


x86 assembly (clang, -O0):
<syslogd_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1152 <syslogd_level+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <syslogd_level+0x5a>
mov    -0x10(%rbp),%rdi
call   1040 <syslog_name_to_pri@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1174 <syslogd_level+0x54>
mov    0x2e71(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syslogd_level>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     114c <syslogd_level+0x2c>
mov    %rbx,%rdi
call   1040 <syslog_name_to_pri@plt>
test   %eax,%eax
jns    114a <syslogd_level+0x2a>
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"none\00"
@LOG_DEBUG = global i32 0
define i32 @syslogd_level(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %18
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @syslog_name_to_pri(i8* %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = load i32, i32* @LOG_DEBUG
store i32 %15, i32* %4
br label %16
16: ; preds = %14, %9
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %18
18: ; preds = %16, %8
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@.str = [5 x i8] c"none\00"
@LOG_DEBUG = global i32 0
define i32 @syslogd_level(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @syslog_name_to_pri(i8* %0)
%6 = icmp slt i32 %5, 0
%7 = load i32, i32* @LOG_DEBUG
%8 = select i1 %6, i32 %7, i32 %5
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ -1, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void dieWithMessage(char *msg) {
  printf("%s\n", msg);
  exit(0);
}


x86 assembly (clang, -O0):
<dieWithMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<dieWithMessage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @dieWithMessage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double rand_normal_r();
void create_rp(double *X, int M, int Mp) {
  int j;
  for (j = 0; j < M * Mp; j++)
    X[j] = rand_normal_r();
}


x86 assembly (clang, -O0):
<create_rp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
cmp    %ecx,%eax
jge    115d <create_rp+0x4d>
mov    $0x0,%al
call   1030 <rand_normal_r@plt>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <create_rp+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_rp>:
push   %r15
push   %r14
push   %rbx
imul   %edx,%esi
test   %esi,%esi
jle    1146 <create_rp+0x36>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <rand_normal_r@plt>
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <create_rp+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @create_rp(double* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = mul i32 %2, %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = zext i32 %4 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %12, %8 ]
%10 = tail call double (...) @rand_normal_r()
%11 = getelementptr inbounds double, double* %0, i64 %9
store double %10, double* %11
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %7
br i1 %13, label %14, label %8
14: ; preds = %8, %3
ret void
}
int is_sbn_valid(const unsigned char *buffer) {
  return !buffer[0] && !buffer[1];
}


x86 assembly (clang, -O0):
<is_sbn_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
mov    %al,-0x9(%rbp)
jne    112a <is_sbn_valid+0x2a>
mov    -0x8(%rbp),%rax
cmpb   $0x0,0x1(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_sbn_valid>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
je     1108 <is_sbn_valid+0x8>
ret
xor    %eax,%eax
cmpb   $0x0,0x1(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_sbn_valid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
%12 = xor i1 %11, true
br label %13
13: ; preds = %7, %1
%14 = phi i1 [ false, %1 ], [ %12, %7 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @is_sbn_valid(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
char *basename(char *);
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int strlen(char *);
char *ext(char *path, char *extension) {
  char *file = basename(path);
  char *temp = malloc((strlen(file) + strlen(extension) + 1) * sizeof(char));
  sprintf(temp, "%s%s", file, extension);
  return (temp);
}


x86 assembly (clang, -O0):
<ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <basename@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe60(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <basename@plt>
mov    %rax,%r12
mov    %rax,%rdi
call   1030 <strlen@plt>
mov    %eax,%r15d
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xe84(%rip),%rsi
mov    %rax,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
call   1060 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define i8* @ext(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i8* @basename(i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @strlen(i8* %9)
%11 = load i8*, i8** %4
%12 = call i32 @strlen(i8* %11)
%13 = add nsw i32 %10, %12
%14 = add nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = mul i64 %15, 1
%17 = trunc i64 %16 to i32
%18 = call i8* @malloc(i32 %17)
store i8* %18, i8** %6
%19 = load i8*, i8** %6
%20 = load i8*, i8** %5
%21 = load i8*, i8** %4
%22 = call i32 @sprintf(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %20, i8* %21)
%23 = load i8*, i8** %6
ret i8* %23
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define noalias i8* @ext(i8* %0, i8* %1) {
%3 = tail call i8* @basename(i8* %0)
%4 = tail call i32 @strlen(i8* %3)
%5 = tail call i32 @strlen(i8* %1)
%6 = add i32 %4, 1
%7 = add i32 %6, %5
%8 = tail call i8* @malloc(i32 %7)
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %8, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %1)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ permute(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char *a;
  scanf("%s", a);
  printf("%s,Length =%d", a, strlen(a));
  permute(a, 0, strlen(a) - 1);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1070 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xe76(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <permute@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1070 <scanf@plt>
call   1040 <strlen@plt>
lea    0xe9a(%rip),%rdi
mov    %eax,%edx
call   1050 <printf@plt>
call   1040 <strlen@plt>
lea    -0x1(%rax),%edx
xor    %esi,%esi
call   1030 <permute@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [14 x i8] c"%s,Length =%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = load i8*, i8** %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 %7)
%9 = load i8*, i8** %2
%10 = load i8*, i8** %2
%11 = call i32 @strlen(i8* %10)
%12 = sub nsw i32 %11, 1
%13 = call i32 @permute(i8* %9, i32 0, i32 %12)
%14 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [14 x i8] c"%s,Length =%d\00"
define i32 @main() {
%1 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* undef)
%2 = tail call i32 @strlen(i8* undef)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* undef, i32 %2)
%4 = tail call i32 @strlen(i8* undef)
%5 = add nsw i32 %4, -1
%6 = tail call i32 @permute(i8* undef, i32 0, i32 %5)
%7 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ twoSum(int *, int, int /*<<< orphan*/);
int main(int argc, char const *argv[]) {
  int nums[] = {-3, 4, 3, 90};
  twoSum(nums, 4, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <twoSum@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <twoSum@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.nums = [4 x i32] [i32 -3, i32 4, i32 3, i32 90]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [4 x i32]* %6 to i8*
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%9 = call i32 @twoSum(i32* %8, i32 4, i32 0)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [4 x i32] [i32 -3, i32 4, i32 3, i32 90]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 @twoSum(i32* %5, i32 4, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bgnclosedline();
void bgnclosedline_() { bgnclosedline(); }


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

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

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

LLVM IR (-O2):
define void @bgnclosedline_() {
%1 = tail call i32 (...) @bgnclosedline()
ret void
}
int test_imm_C4int8_reg(signed char val) {
  return ((val) & (0xC4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C4int8_reg(i8 signext %0) {
%2 = and i8 %0, -60
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int read_quaddobl_start_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(767, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<read_quaddobl_start_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2ff,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_quaddobl_start_Laurent_system>:
mov    $0x2ff,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @read_quaddobl_start_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 767, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void compute_coupling_ocean_cuda_(long *Mesh_pointer) {}


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

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

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

LLVM IR (-O2):
define void @compute_coupling_ocean_cuda_(i64* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __cpuid(int *, int);
int CPUSupportsAVX() {
  int info[4];
  __cpuid(info, 1);
  return (info[2] & (1 << 28));
}


x86 assembly (clang, -O0):
<CPUSupportsAVX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <__cpuid@plt>
mov    -0x8(%rbp),%eax
and    $0x10000000,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CPUSupportsAVX>:
sub    $0x18,%rsp
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <__cpuid@plt>
mov    $0x10000000,%eax
and    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @CPUSupportsAVX() {
%1 = alloca [4 x i32]
%2 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%3 = call i32 @__cpuid(i32* %2, i32 1)
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
%5 = load i32, i32* %4
%6 = and i32 %5, 268435456
ret i32 %6
}

LLVM IR (-O2):
define i32 @CPUSupportsAVX() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @__cpuid(i32* %3, i32 1)
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
%6 = load i32, i32* %5
%7 = and i32 %6, 268435456
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ atag_enqueue_addr(int /*<<< orphan*/, int);
void atag_flush(void) { atag_enqueue_addr(0, 1); }


x86 assembly (clang, -O0):
<atag_flush>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <atag_enqueue_addr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<atag_flush>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <atag_enqueue_addr@plt>

LLVM IR (-O0):
define void @atag_flush() {
%1 = call i32 @atag_enqueue_addr(i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @atag_flush() {
%1 = tail call i32 @atag_enqueue_addr(i32 0, i32 1)
ret void
}
/* Variables and functions */
int event_poll_once();
void event_poll() {
  int err = 0;
  do {
    err = event_poll_once();
  } while (!err);
}


x86 assembly (clang, -O0):
<event_poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <event_poll_once@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    111f <event_poll+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_poll>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <event_poll_once@plt>
test   %eax,%eax
je     1120 <event_poll+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @event_poll() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @event_poll_once()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
ret void
}
int do_552() { return 552; }


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

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

LLVM IR (-O0):
define i32 @do_552() {
ret i32 552
}

LLVM IR (-O2):
define i32 @do_552() {
ret i32 552
}
/* Type definitions */
typedef int volatile uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_initialize();
uint8_t eeprom_read_byte(const uint8_t *addr) {
  uint32_t offset = (uint32_t)addr;
  if (offset >= 2048)
    return 0;
  if (!((*(volatile uint8_t *)0x40020001) & ((uint8_t)0x01)))
    eeprom_initialize();
  return ((uint8_t *)0x14000000)[offset];
}


x86 assembly (clang, -O0):
<eeprom_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
cmpl   $0x800,-0x14(%rbp)
jl     113c <eeprom_read_byte+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1165 <eeprom_read_byte+0x55>
mov    $0x40020001,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1156 <eeprom_read_byte+0x46>
mov    $0x0,%al
call   1030 <eeprom_initialize@plt>
movslq -0x14(%rbp),%rcx
mov    $0x14000000,%eax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeprom_read_byte>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
cmp    $0x7ff,%ebx
jg     113a <eeprom_read_byte+0x2a>
mov    0x40020001,%eax
test   $0x1,%al
jne    1130 <eeprom_read_byte+0x20>
xor    %eax,%eax
call   1030 <eeprom_initialize@plt>
movslq %ebx,%rax
mov    0x14000000(,%rax,4),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @eeprom_read_byte(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = ptrtoint i32* %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 2048
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %21
10: ; preds = %1
%11 = load volatile i32, i32* inttoptr (i64 1073872897 to i32*)
%12 = and i32 %11, 1
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = call i32 (...) @eeprom_initialize()
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* inttoptr (i64 335544320 to i32*), i64 %18
%20 = load volatile i32, i32* %19
store i32 %20, i32* %2
br label %21
21: ; preds = %16, %9
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @eeprom_read_byte(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = trunc i64 %2 to i32
%4 = icmp sgt i32 %3, 2047
br i1 %4, label %16, label %5
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 1073872897 to i32*)
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 (...) @eeprom_initialize()
br label %11
11: ; preds = %9, %5
%12 = shl i64 %2, 32
%13 = ashr exact i64 %12, 32
%14 = getelementptr inbounds i32, i32* inttoptr (i64 335544320 to i32*), i64 %13
%15 = load volatile i32, i32* %14
br label %16
16: ; preds = %1, %11
%17 = phi i32 [ %15, %11 ], [ 0, %1 ]
ret i32 %17
}
/* Variables and functions */
scalar_t__ config_WITH_CARDREADER();
int config_READER_IRDETO(void) { return config_WITH_CARDREADER() ? 1 : 0; }


x86 assembly (clang, -O0):
<config_READER_IRDETO>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <config_WITH_CARDREADER@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_READER_IRDETO>:
push   %rax
xor    %eax,%eax
call   1030 <config_WITH_CARDREADER@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @config_READER_IRDETO() {
%1 = call i64 (...) @config_WITH_CARDREADER()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 1, i32 0
ret i32 %4
}

LLVM IR (-O2):
define i32 @config_READER_IRDETO() {
%1 = tail call i64 (...) @config_WITH_CARDREADER()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned long DJBX33A(const char *str) {
  unsigned long seed = 33;
  unsigned long hash = 5381;
  while (*str) {
    hash = hash * seed + (*str);
    str++;
  }
  return hash;
}


x86 assembly (clang, -O0):
<DJBX33A>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x21,-0x10(%rbp)
movq   $0x1505,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <DJBX33A+0x4e>
mov    -0x18(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1118 <DJBX33A+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DJBX33A>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <DJBX33A+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <DJBX33A+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @DJBX33A(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %10, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i64 %6, 33
%9 = sext i8 %5 to i64
%10 = add i64 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %10, %4 ]
ret i64 %15
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ syscall(int);
main() {
  int i;
  int SIZE = 8888;
  for (i = 0; i < 100; i++) {
    int *p = (int *)malloc(sizeof(int) * SIZE);
    memset(p, 0, sizeof(int) * SIZE);
  }
  syscall(316);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x22b8,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    118d <main+0x5d>
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x1d>
mov    $0x13c,%edi
call   1040 <syscall@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x8ae0,%edi
call   1050 <malloc@plt>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x8ae0,%edx
call   1030 <memset@plt>
add    $0xffffffff,%ebx
jne    1140 <main+0x10>
mov    $0x13c,%edi
call   1040 <syscall@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
store i32 8888, i32* %3
store i32 0, i32* %2
br label %5
5: ; preds = %21, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = mul i64 4, %10
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %4
%15 = load i32*, i32** %4
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = mul i64 4, %17
%19 = trunc i64 %18 to i32
%20 = call i32 @memset(i32* %15, i32 0, i32 %19)
br label %21
21: ; preds = %8
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %5
24: ; preds = %5
%25 = call i32 @syscall(i32 316)
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i64 @malloc(i32 35552)
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @memset(i32* %4, i32 0, i32 35552)
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 100
br i1 %7, label %8, label %1
8: ; preds = %1
%9 = tail call i32 @syscall(i32 316)
ret i32 0
}
void freeRankCurves(int **rankcurve, int numDistDirs, int numGalleryImages) {
  int j;
  for (j = 0; j < numDistDirs; j++) {
    free(rankcurve[j]);
  }
  free(rankcurve);
}


x86 assembly (clang, -O0):
<freeRankCurves>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <freeRankCurves+0x44>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <freeRankCurves+0x19>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeRankCurves>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <freeRankCurves+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freeRankCurves+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeRankCurves(i32** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32*, i32** %0, i64 %8
%10 = bitcast i32** %9 to i8**
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
%15 = bitcast i32** %0 to i8*
tail call void @free(i8* %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: head [-n] [file ...]\n");
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: head [-n] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct tcphdr {
  int /*<<< orphan*/ dest;
};

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t _tcphdr_dest_ntohs(struct tcphdr *h) { return ntohs(h->dest); }


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

x86 assembly (clang, -O2):
<_tcphdr_dest_ntohs>:
mov    (%rdi),%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
%struct.tcphdr = type { i32 }
define i32 @_tcphdr_dest_ntohs(%struct.tcphdr* %0) {
%2 = alloca %struct.tcphdr*
store %struct.tcphdr* %0, %struct.tcphdr** %2
%3 = load %struct.tcphdr*, %struct.tcphdr** %2
%4 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @ntohs(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.tcphdr = type { i32 }
define i32 @_tcphdr_dest_ntohs(%struct.tcphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @ntohs(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ atomic_add(unsigned short volatile *, short);
void atomic_add_short(volatile unsigned short *target, short delta) {
  atomic_add(target, delta);
}


x86 assembly (clang, -O0):
<atomic_add_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movswl -0xa(%rbp),%esi
call   1030 <atomic_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_add_short>:
jmp    1030 <atomic_add@plt>

LLVM IR (-O0):
define void @atomic_add_short(i16* %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
%6 = load i16, i16* %4
%7 = call i32 @atomic_add(i16* %5, i16 signext %6)
ret void
}

LLVM IR (-O2):
define void @atomic_add_short(i16* %0, i16 signext %1) {
%3 = tail call i32 @atomic_add(i16* %0, i16 signext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_MAKE_FLASH_OUT_INPUT() { clear_io_bit(0x36, 7); }


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

x86 assembly (clang, -O2):
<TOSH_MAKE_FLASH_OUT_INPUT>:
mov    $0x36,%edi
mov    $0x7,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_FLASH_OUT_INPUT() {
%1 = call i32 @clear_io_bit(i32 54, i32 7)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_FLASH_OUT_INPUT() {
%1 = tail call i32 @clear_io_bit(i32 54, i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
int /*<<< orphan*/ scanf(char *, int const *);
main() {
  const int x = 7;
  int y;
  printf("%d\n", x);
  scanf("%d\n", &x);
  printf("%d\n", x);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x7,0xc(%rsp)
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 7, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
ret i32 0
}
void test1() {}


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

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

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

LLVM IR (-O2):
define void @test1() {
ret void
}
int checkCPUendian() {
  union {
    unsigned int a;
    unsigned char b;
  } c;
  c.a = 1;
  return (1 == c.b);
}


x86 assembly (clang, -O0):
<checkCPUendian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movzbl -0x8(%rbp),%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @checkCPUendian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store i32 1, i32* %2
%3 = bitcast %union.anon* %1 to i8*
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp eq i32 1, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @checkCPUendian() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_js_params() { exit(1); }


x86 assembly (clang, -O0):
<caml_js_params>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_js_params>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_js_params() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_js_params() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ eMalloc(size_t);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
extern char *eStrdup(const char *str) {
  char *result = (char *)eMalloc((size_t)(strlen(str) + 1) * sizeof(char));
  strcpy(result, str);
  return result;
}


x86 assembly (clang, -O0):
<eStrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
shl    $0x0,%rdi
call   1050 <eMalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eStrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <eMalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @eStrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = mul i64 %6, 1
%8 = call i64 @eMalloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @eStrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @eMalloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
scalar_t__ nre_strcasestr(char const *, char const *);
int http_check_header_field(const char *data, const char *field) {
  if (nre_strcasestr(data, field))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<http_check_header_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <nre_strcasestr@plt>
cmp    $0x0,%rax
je     1143 <http_check_header_field+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <http_check_header_field+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_check_header_field>:
push   %rax
call   1030 <nre_strcasestr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @http_check_header_field(i8* %0, i8* %1) {
%3 = tail call i64 @nre_strcasestr(i8* %0, i8* %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_62int8_reg(signed char val) {
  return ((val) & (0x62 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_62int8_reg(i8 signext %0) {
%2 = and i8 %0, 98
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int sigsend(int /*<<< orphan*/, int);
int raise(int signo) { return sigsend(getpid(), signo); }


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1040 <sigsend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raise>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <sigsend@plt>

LLVM IR (-O0):
define i32 @raise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = load i32, i32* %2
%5 = call i32 @sigsend(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @raise(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @sigsend(i32 %2, i32 %0)
ret i32 %3
}
float mi_to_km(float value) { return value * 1.609344f; }


x86 assembly (clang, -O0):
<mi_to_km>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mi_to_km>:
mulss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @mi_to_km(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x3FF9BFDF80000000
ret float %4
}

LLVM IR (-O2):
define float @mi_to_km(float %0) {
%2 = fmul float %0, 0x3FF9BFDF80000000
ret float %2
}
/* Variables and functions */
size_t plus_linear_min(int);
void plus_linear_min2_Good_FP() {
  int a[10];
  a[plus_linear_min(4)] = 1;
}


x86 assembly (clang, -O0):
<plus_linear_min2_Good_FP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x4,%edi
call   1030 <plus_linear_min@plt>
movl   $0x1,-0x30(%rbp,%rax,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plus_linear_min2_Good_FP>:
mov    $0x4,%edi
jmp    1030 <plus_linear_min@plt>

LLVM IR (-O0):
define void @plus_linear_min2_Good_FP() {
%1 = alloca [10 x i32]
%2 = call i64 @plus_linear_min(i32 4)
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %2
store i32 1, i32* %3
ret void
}

LLVM IR (-O2):
define void @plus_linear_min2_Good_FP() {
%1 = tail call i64 @plus_linear_min(i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex32(unsigned int);
void print_spew_hex32(unsigned int value) { __console_tx_hex32(value); }


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

x86 assembly (clang, -O2):
<print_spew_hex32>:
jmp    1030 <__console_tx_hex32@plt>

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

LLVM IR (-O2):
define void @print_spew_hex32(i32 %0) {
%2 = tail call i32 @__console_tx_hex32(i32 %0)
ret void
}
int test_imm_D0int16_reg(short val) {
  return ((val) & (0xD0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D0int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xd0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_D0int16_reg(i16 signext %0) {
%2 = and i16 %0, 208
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}