xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int file___NativeString_file_exists___impl(char *self) {
  FILE *hdl = fopen(self, "r");
  if (hdl != NULL) {
    fclose(hdl);
  }
  return hdl != NULL;
}


x86 assembly (clang, -O0):
<file___NativeString_file_exists___impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1154 <file___NativeString_file_exists___impl+0x34>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file___NativeString_file_exists___impl>:
push   %rbx
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113d <file___NativeString_file_exists___impl+0x1d>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
test   %rbx,%rbx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @file___NativeString_file_exists___impl(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %4, %1
%7 = zext i1 %3 to i32
ret i32 %7
}
void bu_compile_listify(args) struct conscell *args;
{
  int n = bu_compile_arg_list(args);
  if (n != 1)
    goto er;
  EMIT1ATM("LISTIFY");
  EMITEND();
  return;
er:
  cerror("listify: wrong # of args", args);
}


x86 assembly (clang, -O0):
<bu_compile_listify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <bu_compile_arg_list@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1169 <bu_compile_listify+0x29>
jmp    1183 <bu_compile_listify+0x43>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1050 <EMIT1ATM@plt>
mov    $0x0,%al
call   1030 <EMITEND@plt>
jmp    1195 <bu_compile_listify+0x55>
mov    -0x8(%rbp),%rsi
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1060 <cerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bu_compile_listify>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <bu_compile_arg_list@plt>
cmp    $0x1,%eax
jne    1166 <bu_compile_listify+0x26>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1050 <EMIT1ATM@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <EMITEND@plt>
lea    0xe9b(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1060 <cerror@plt>

LLVM IR (-O0):
%struct.conscell = type opaque
@.str = [8 x i8] c"LISTIFY\00"
@.str.1 = [25 x i8] c"listify: wrong # of args\00"
define void @bu_compile_listify(%struct.conscell* %0) {
%2 = alloca %struct.conscell*
%3 = alloca i32
store %struct.conscell* %0, %struct.conscell** %2
%4 = load %struct.conscell*, %struct.conscell** %2
%5 = call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @bu_compile_arg_list to i32 (%struct.conscell*, ...)*)(%struct.conscell* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %1
br label %12
9: ; preds = %1
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @EMITEND()
br label %15
12: ; preds = %8
%13 = load %struct.conscell*, %struct.conscell** %2
%14 = call i32 (i8*, %struct.conscell*, ...) bitcast (i32 (...)* @cerror to i32 (i8*, %struct.conscell*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* %13)
br label %15
15: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
%struct.conscell = type opaque
@.str = [8 x i8] c"LISTIFY\00"
@.str.1 = [25 x i8] c"listify: wrong # of args\00"
define void @bu_compile_listify(%struct.conscell* %0) {
%2 = tail call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @bu_compile_arg_list to i32 (%struct.conscell*, ...)*)(%struct.conscell* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @EMITEND()
br label %9
7: ; preds = %1
%8 = tail call i32 (i8*, %struct.conscell*, ...) bitcast (i32 (...)* @cerror to i32 (i8*, %struct.conscell*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* %0)
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
char *ho_strrchr2(const char *s, int c) {
  const char *p;
  p = NULL;
  for (;; s++) {
    if (*s == '\0')
      return (char *)p;
    if (*s == c)
      p = s;
  }
}


x86 assembly (clang, -O0):
<ho_strrchr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1129 <ho_strrchr2+0x29>
mov    -0x18(%rbp),%rax
pop    %rbp
ret
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1141 <ho_strrchr2+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1146 <ho_strrchr2+0x46>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <ho_strrchr2+0x13>

x86 assembly (clang, -O2):
<ho_strrchr2>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1125 <ho_strrchr2+0x25>
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ho_strrchr2+0x10>
ret

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

LLVM IR (-O2):
define i8* @ho_strrchr2(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %7, %2
%6 = phi i8* [ null, %2 ], [ %13, %7 ]
ret i8* %6
7: ; preds = %2, %7
%8 = phi i8 [ %15, %7 ], [ %3, %2 ]
%9 = phi i8* [ %13, %7 ], [ null, %2 ]
%10 = phi i8* [ %14, %7 ], [ %0, %2 ]
%11 = sext i8 %8 to i32
%12 = icmp eq i32 %11, %1
%13 = select i1 %12, i8* %10, i8* %9
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %5, label %7
}
int signOf(int x) {
  if (x > 0) {
    return 1;
  }
  if (x < 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<signOf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111d <signOf+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    113a <signOf+0x3a>
cmpl   $0x0,-0x8(%rbp)
jge    1133 <signOf+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    113a <signOf+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signOf>:
mov    %edi,%ecx
sar    $0x1f,%ecx
test   %edi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @signOf(i32 %0) {
%2 = ashr i32 %0, 31
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 %2, i32 1
ret i32 %4
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t len = 0;
  while (str[len])
    len++;
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ mtx_t;

/* Variables and functions */
int mtx_lock(int /*<<< orphan*/ *);
int mtx_timedlock(mtx_t *restrict mtx, const struct timespec *restrict ts) {
  return mtx_lock(mtx);
}


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

x86 assembly (clang, -O2):
<mtx_timedlock>:
jmp    1030 <mtx_lock@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @mtx_timedlock(i32* noalias %0, %struct.timespec* noalias %1) {
%3 = alloca i32*
%4 = alloca %struct.timespec*
store i32* %0, i32** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32*, i32** %3
%6 = call i32 @mtx_lock(i32* %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @mtx_timedlock(i32* noalias %0, %struct.timespec* noalias nocapture readnone %1) {
%3 = tail call i32 @mtx_lock(i32* %0)
ret i32 %3
}
double B0(u)
double u;
{
  double tmp = 1.0 - u;
  return (tmp * tmp * tmp);
}


x86 assembly (clang, -O0):
<B0>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<B0>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @B0(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double 1.000000e+00, %4
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = load double, double* %3
%10 = fmul double %8, %9
ret double %10
}

LLVM IR (-O2):
define double @B0(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fmul double %2, %2
%4 = fmul double %2, %3
ret double %4
}
/* Variables and functions */
int precidence(char);
bool isOperator(char c) { return precidence(c) != 6; }


x86 assembly (clang, -O0):
<isOperator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <precidence@plt>
cmp    $0x6,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOperator>:
push   %rax
call   1030 <precidence@plt>
xor    %ecx,%ecx
cmp    $0x6,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @isOperator(i8 signext %0) {
%2 = tail call i32 @precidence(i8 signext %0)
%3 = icmp ne i32 %2, 6
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello\n");
  fork();
  printf("Bye\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"Hello\00"
@str.2 = [4 x i8] c"Bye\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @fork()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double floor(double);
double rangerad(double x) {
  double a, b;
  b = x / 6.28318530717959;
  a = 6.28318530717959 * (b - floor(b));
  if (a < 0)
    a = 6.28318530717959 + a;
  return (a);
}


x86 assembly (clang, -O0):
<rangerad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <floor@plt>
movsd  -0x20(%rbp),%xmm1
subsd  %xmm0,%xmm1
movsd  0xea8(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1181 <rangerad+0x71>
movsd  0xe89(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rangerad>:
sub    $0x18,%rsp
movsd  0xee4(%rip),%xmm1
divsd  %xmm1,%xmm0
movapd %xmm0,(%rsp)
call   1030 <floor@plt>
movapd (%rsp),%xmm3
subsd  %xmm0,%xmm3
movsd  0xec5(%rip),%xmm2
mulsd  %xmm2,%xmm3
addsd  %xmm3,%xmm2
xorpd  %xmm1,%xmm1
movapd %xmm3,%xmm0
cmpltsd %xmm1,%xmm0
andpd  %xmm0,%xmm2
andnpd %xmm3,%xmm0
orpd   %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rangerad(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fdiv double %5, 0x401921FB54442D1C
store double %6, double* %4
%7 = load double, double* %4
%8 = load double, double* %4
%9 = call double @llvm.floor.f64(double %8)
%10 = fsub double %7, %9
%11 = fmul double 0x401921FB54442D1C, %10
store double %11, double* %3
%12 = load double, double* %3
%13 = fcmp olt double %12, 0.000000e+00
br i1 %13, label %14, label %17
14: ; preds = %1
%15 = load double, double* %3
%16 = fadd double 0x401921FB54442D1C, %15
store double %16, double* %3
br label %17
17: ; preds = %14, %1
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
define double @rangerad(double %0) {
%2 = fdiv double %0, 0x401921FB54442D1C
%3 = tail call double @llvm.floor.f64(double %2)
%4 = fsub double %2, %3
%5 = fmul double %4, 0x401921FB54442D1C
%6 = fcmp olt double %5, 0.000000e+00
%7 = fadd double %5, 0x401921FB54442D1C
%8 = select i1 %6, double %7, double %5
ret double %8
}
/* Variables and functions */
int __builtin_arm_rsr(char *);
unsigned rsr() { return __builtin_arm_rsr("cp1:2:c3:c4:5"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"cp1:2:c3:c4:5\00"
define i32 @rsr() {
%1 = call i32 @__builtin_arm_rsr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [14 x i8] c"cp1:2:c3:c4:5\00"
define i32 @rsr() {
%1 = tail call i32 @__builtin_arm_rsr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void memcpy_good3() {
  int arr1[10];
  int arr2[20];
  memcpy(arr2, arr1, 20);
}


x86 assembly (clang, -O0):
<memcpy_good3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x80(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x14,%edx
call   1030 <memcpy@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_good3>:
sub    $0x88,%rsp
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x14,%edx
call   1030 <memcpy@plt>
add    $0x88,%rsp
ret

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

LLVM IR (-O2):
define void @memcpy_good3() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @memcpy(i32* %5, i32* %6, i32 20)
ret void
}
void xfrm_state_insert(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<xfrm_state_insert>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfrm_state_insert>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.xfrm_state_insert = [18 x i8] c"xfrm_state_insert\00"
define void @xfrm_state_insert() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.xfrm_state_insert, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.xfrm_state_insert = [18 x i8] c"xfrm_state_insert\00"
define void @xfrm_state_insert() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.xfrm_state_insert, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
char returnRandCharAlphaNum(char tmp) {
  tmp = (char)((rand() % 62) + 48);
  if (tmp > 57)
    tmp += 7;
  if (tmp > 90)
    tmp += 6;
  return tmp;
}


x86 assembly (clang, -O0):
<returnRandCharAlphaNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3e,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jle    114c <returnRandCharAlphaNum+0x3c>
movsbl -0x1(%rbp),%eax
add    $0x7,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jle    1163 <returnRandCharAlphaNum+0x53>
movsbl -0x1(%rbp),%eax
add    $0x6,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<returnRandCharAlphaNum>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff84210843,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x6,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
cmp    $0xa,%sil
mov    $0x37,%eax
mov    $0x30,%ecx
cmovge %eax,%ecx
add    %sil,%cl
lea    0x6(%rcx),%eax
cmp    $0x5b,%cl
movzbl %cl,%ecx
movzbl %al,%eax
cmovl  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @returnRandCharAlphaNum(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 62
%5 = add nsw i32 %4, 48
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sgt i32 %8, 57
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, 7
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp sgt i32 %17, 90
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = add nsw i32 %21, 6
%23 = trunc i32 %22 to i8
store i8 %23, i8* %2
br label %24
24: ; preds = %19, %15
%25 = load i8, i8* %2
ret i8 %25
}

LLVM IR (-O2):
define signext i8 @returnRandCharAlphaNum(i8 signext %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 62
%4 = trunc i32 %3 to i8
%5 = icmp sgt i8 %4, 9
%6 = select i1 %5, i8 55, i8 48
%7 = add nsw i8 %6, %4
%8 = icmp sgt i8 %7, 90
%9 = add nsw i8 %7, 6
%10 = select i1 %8, i8 %9, i8 %7
ret i8 %10
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = input[0UL] + 1373777115UL;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      local1++;
    }
    output[0UL] = ((state[0UL] >> 13UL) | (state[0UL] << 51UL)) * 269947149UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x51e22cdb,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
cmp    0x8(%rcx),%rax
jae    1148 <RandomFunc+0x48>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1125 <RandomFunc+0x25>
mov    -0x18(%rbp),%rax
shr    $0xd,%rax
mov    -0x18(%rbp),%rcx
shl    $0x33,%rcx
or     %rcx,%rax
imul   $0x1017110d,%rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x51e22cdb,%eax
add    (%rdi),%rax
rol    $0x33,%rax
imul   $0x1017110d,%rax,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add i64 %9, 1373777115
%11 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %10, i64* %11
store i64 0, i64* %6
br label %12
12: ; preds = %18, %2
%13 = load i64, i64* %6
%14 = load i64*, i64** %3
%15 = getelementptr inbounds i64, i64* %14, i64 1
%16 = load i64, i64* %15
%17 = icmp ult i64 %13, %16
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = load i64, i64* %6
%20 = add i64 %19, 1
store i64 %20, i64* %6
br label %12
21: ; preds = %12
%22 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%23 = load i64, i64* %22
%24 = lshr i64 %23, 13
%25 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%26 = load i64, i64* %25
%27 = shl i64 %26, 51
%28 = or i64 %24, %27
%29 = mul i64 %28, 269947149
%30 = load i64*, i64** %4
%31 = getelementptr inbounds i64, i64* %30, i64 0
store i64 %29, i64* %31
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = add i64 %3, 1373777115
%5 = tail call i64 @llvm.fshl.i64(i64 %4, i64 %4, i64 51)
%6 = mul i64 %5, 269947149
store i64 %6, i64* %1
ret void
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_07(int Salt, int Parameter) {
  unsigned b = Salt ^ 0x1D242DA5;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
<yahoo_f01_07>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x1d242da5,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_07>:
xor    $0x1d242da5,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_07(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* %3
%7 = xor i32 %6, 488910245
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @yahoo_M1Common(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @yahoo_f01_07(i32 %0, i32 %1) {
%3 = xor i32 %0, 488910245
%4 = tail call i32 @yahoo_M1Common(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
char *getString();
int /*<<< orphan*/ printf(char *, char *);
void main() { printf("%s", getString()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getString@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getString@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @main() {
%1 = call i8* (...) @getString()
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @main() {
%1 = tail call i8* (...) @getString()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setmode(int);
int /*<<< orphan*/ unshowmouse();
sigma_exit() {
  unshowmouse();
  (void)setmode(3);
  return (1);
}


x86 assembly (clang, -O0):
<sigma_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <unshowmouse@plt>
mov    $0x3,%edi
call   1030 <setmode@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigma_exit>:
push   %rax
xor    %eax,%eax
call   1040 <unshowmouse@plt>
mov    $0x3,%edi
call   1030 <setmode@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sigma_exit() {
%1 = call i32 (...) @unshowmouse()
%2 = call i32 @setmode(i32 3)
ret i32 1
}

LLVM IR (-O2):
define i32 @sigma_exit() {
%1 = tail call i32 (...) @unshowmouse()
%2 = tail call i32 @setmode(i32 3)
ret i32 1
}
void genc_ult_d() {}


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

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

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

LLVM IR (-O2):
define void @genc_ult_d() {
ret void
}
int divide(int a, int b, int *remainder) {
  int quotient = a / b;
  *remainder = a % b;
  return quotient;
}


x86 assembly (clang, -O0):
<divide>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %edx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide>:
mov    %rdx,%rcx
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,(%rcx)
ret

LLVM IR (-O0):
define i32 @divide(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
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = sdiv i32 %8, %9
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = srem i32 %11, %12
%14 = load i32*, i32** %6
store i32 %13, i32* %14
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
define i32 @divide(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = sdiv i32 %0, %1
%5 = srem i32 %0, %1
store i32 %5, i32* %2
ret i32 %4
}
/* Variables and functions */
scalar_t__ mario();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ super_main(int /*<<< orphan*/, char *);
int main() {
  super_main(0, "test");
  printf((char *)mario());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xec3(%rip),%rsi
call   1040 <super_main@plt>
mov    $0x0,%al
call   1050 <mario@plt>
mov    %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rsi
xor    %edi,%edi
call   1040 <super_main@plt>
xor    %eax,%eax
call   1050 <mario@plt>
mov    %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
define i32 @main() {
%1 = call i32 @super_main(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i64 (...) @mario()
%3 = inttoptr i64 %2 to i8*
%4 = call i32 @printf(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
define i32 @main() {
%1 = tail call i32 @super_main(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 (...) @mario()
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret i32 0
}
void fa33(int n) {
  {
    int b[n];
  a:
    goto a;
    {
      int c[n];
      0;
    }
    {
      int d[n];
      0;
    };
    int e[n];
    0;
  };
  {
    int f[n];
    {
      int g[n];
      0;
    };
    {
      int h[n];
      0;
    };
    ;
    int i[n];
    0;
  };
  ;
  int j[n];
  0;
}


x86 assembly (clang, -O0):
<fa33>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
jmp    111c <fa33+0x1c>

x86 assembly (clang, -O2):
<fa33>:
jmp    1100 <fa33>

LLVM IR (-O0):
define void @fa33(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i64
%17 = alloca i8*
%18 = alloca i64
store i32 %0, i32* %2
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %3
%22 = alloca i32, i64 %20
store i64 %20, i64* %4
br label %23
23: ; preds = %23, %1
br label %23
24: ; No predecessors!
%25 = load i32, i32* %2
%26 = zext i32 %25 to i64
%27 = call i8* @llvm.stacksave()
store i8* %27, i8** %5
%28 = alloca i32, i64 %26
store i64 %26, i64* %6
%29 = load i8*, i8** %5
%30 = load i32, i32* %2
%31 = zext i32 %30 to i64
%32 = call i8* @llvm.stacksave()
store i8* %32, i8** %7
%33 = alloca i32, i64 %31
store i64 %31, i64* %8
%34 = load i8*, i8** %7
%35 = load i32, i32* %2
%36 = zext i32 %35 to i64
%37 = alloca i32, i64 %36
store i64 %36, i64* %9
%38 = load i8*, i8** %3
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
%41 = call i8* @llvm.stacksave()
store i8* %41, i8** %10
%42 = alloca i32, i64 %40
store i64 %40, i64* %11
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
%45 = call i8* @llvm.stacksave()
store i8* %45, i8** %12
%46 = alloca i32, i64 %44
store i64 %44, i64* %13
%47 = load i8*, i8** %12
%48 = load i32, i32* %2
%49 = zext i32 %48 to i64
%50 = call i8* @llvm.stacksave()
store i8* %50, i8** %14
%51 = alloca i32, i64 %49
store i64 %49, i64* %15
%52 = load i8*, i8** %14
%53 = load i32, i32* %2
%54 = zext i32 %53 to i64
%55 = alloca i32, i64 %54
store i64 %54, i64* %16
%56 = load i8*, i8** %10
%57 = load i32, i32* %2
%58 = zext i32 %57 to i64
%59 = call i8* @llvm.stacksave()
store i8* %59, i8** %17
%60 = alloca i32, i64 %58
store i64 %58, i64* %18
%61 = load i8*, i8** %17
ret void
}

LLVM IR (-O2):
define void @fa33(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int dlclose(void *);
int g_free_library(long lib) {
  if (lib == 0) {
    return 0;
  }
  return dlclose((void *)lib);
}


x86 assembly (clang, -O0):
<g_free_library>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <g_free_library+0x23>
movl   $0x0,-0x4(%rbp)
jmp    113f <g_free_library+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <dlclose@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g_free_library(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = inttoptr i64 %0 to i8*
%5 = tail call i32 @dlclose(i8* %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ isspace(unsigned char);
int IsBlankLine(const char *p) {
  while (*p) {
    if (!isspace((unsigned char)*p++)) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<IsBlankLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <IsBlankLine+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1155 <IsBlankLine+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1161 <IsBlankLine+0x51>
jmp    111c <IsBlankLine+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsBlankLine>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%eax
test   %al,%al
je     113b <IsBlankLine+0x2b>
add    $0x1,%rbx
movzbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1120 <IsBlankLine+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @IsBlankLine(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = tail call i32 @isspace(i8 zeroext %4)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %2
10: ; preds = %2, %6
%11 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %11
}
int RIFTIMEDOUT(int status) { return (status & 0xff0000) != 0; }


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

x86 assembly (clang, -O2):
<RIFTIMEDOUT>:
xor    %eax,%eax
test   $0xff0000,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @RIFTIMEDOUT(i32 %0) {
%2 = and i32 %0, 16711680
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ malloc(int);
scalar_t__ realloc(char *, int);
char *re_scratch(char *scratch, int size) {
  if (scratch == NULL) {
    scratch = (char *)malloc(size * sizeof(char));
  } else {
    scratch = (char *)realloc(scratch, size * sizeof(char));
  }
  return scratch;
}


x86 assembly (clang, -O0):
<re_scratch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1152 <re_scratch+0x32>
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1169 <re_scratch+0x49>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%esi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_scratch>:
push   %rax
test   %rdi,%rdi
je     112d <re_scratch+0xd>
call   1040 <realloc@plt>
pop    %rcx
ret
mov    %esi,%edi
call   1030 <malloc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @re_scratch(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 1
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %3
br label %22
14: ; preds = %2
%15 = load i8*, i8** %3
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = mul i64 %17, 1
%19 = trunc i64 %18 to i32
%20 = call i64 @realloc(i8* %15, i32 %19)
%21 = inttoptr i64 %20 to i8*
store i8* %21, i8** %3
br label %22
22: ; preds = %14, %7
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define i8* @re_scratch(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i64 @malloc(i32 %1)
br label %8
6: ; preds = %2
%7 = tail call i64 @realloc(i8* %0, i32 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i64 [ %5, %4 ], [ %7, %6 ]
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}
int qrand_r(unsigned *seed) {
  *seed = (214013 * *seed + 2531011);
  return (*seed >> 16) & 0x7FFF;
}


x86 assembly (clang, -O0):
<qrand_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x343fd,(%rax),%ecx
add    $0x269ec3,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shr    $0x10,%eax
and    $0x7fff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qrand_r>:
imul   $0x343fd,(%rdi),%eax
add    $0x269ec3,%eax
mov    %eax,(%rdi)
shr    $0x10,%eax
and    $0x7fff,%eax
ret

LLVM IR (-O0):
define i32 @qrand_r(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = mul i32 214013, %4
%6 = add i32 %5, 2531011
%7 = load i32*, i32** %2
store i32 %6, i32* %7
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = lshr i32 %9, 16
%11 = and i32 %10, 32767
ret i32 %11
}

LLVM IR (-O2):
define i32 @qrand_r(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul i32 %2, 214013
%4 = add i32 %3, 2531011
store i32 %4, i32* %0
%5 = lshr i32 %4, 16
%6 = and i32 %5, 32767
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ mx_set_clear_imap_bit(int, int, int /*<<< orphan*/);
void mx_clear_imap_bit(int device, int i) {
  mx_set_clear_imap_bit(device, i, 0);
}


x86 assembly (clang, -O0):
<mx_clear_imap_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1030 <mx_set_clear_imap_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mx_clear_imap_bit>:
xor    %edx,%edx
jmp    1030 <mx_set_clear_imap_bit@plt>

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

LLVM IR (-O2):
define void @mx_clear_imap_bit(i32 %0, i32 %1) {
%3 = tail call i32 @mx_set_clear_imap_bit(i32 %0, i32 %1, i32 0)
ret void
}
int i_to_b32(int x) { return x + (x < 10 ? 48 : 87); }


x86 assembly (clang, -O0):
<i_to_b32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%esi
mov    $0x57,%ecx
mov    $0x30,%edx
cmp    $0xa,%esi
cmovl  %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_to_b32>:
lea    0x57(%rdi),%ecx
lea    0x30(%rdi),%eax
cmp    $0xa,%edi
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @i_to_b32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 48, i32 87
%8 = add nsw i32 %3, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @i_to_b32(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = select i1 %2, i32 48, i32 87
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello, world\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello, world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int pmp_master_read() {
  while (*(volatile unsigned *)(0xBF800000 + (0x2E010)) & 0x8000)
    ;
  return *(volatile unsigned *)(0xBF800000 + (0x2E040));
}


x86 assembly (clang, -O0):
<pmp_master_read>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <pmp_master_read+0x9>
mov    $0xbf82e010,%eax
mov    (%rax),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     1123 <pmp_master_read+0x23>
jmp    1109 <pmp_master_read+0x9>
mov    $0xbf82e040,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmp_master_read>:
mov    $0xbf82e010,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x8000,(%rax)
jne    1110 <pmp_master_read+0x10>
mov    0x30(%rax),%eax
ret

LLVM IR (-O0):
define i32 @pmp_master_read() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i32, i32* inttoptr (i64 3213025296 to i32*)
%3 = and i32 %2, 32768
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = load volatile i32, i32* inttoptr (i64 3213025344 to i32*)
ret i32 %7
}

LLVM IR (-O2):
define i32 @pmp_master_read() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 3213025296 to i32*)
%3 = and i32 %2, 32768
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 3213025344 to i32*)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ setpwent();
int main(void) {
  setpwent();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <setpwent@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setpwent()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setpwent()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dgemv_(char *, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  dgemv_("A", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rsi
mov    %r9,%rdx
mov    %r9,%rcx
mov    %r9,%r8
movq   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
movq   $0x0,0x18(%rsp)
movq   $0x0,0x20(%rsp)
call   1030 <dgemv_@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rsp)
movups %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
lea    0xed0(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <dgemv_@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @dgemv_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* null, i32* null, i32* null, i32* null, i32* null, i32* null, i32* null, i32* null, i32* null, i32* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ resetvalue(int *, int *);
void fresetvalue_(int *numi, int *inum) { resetvalue(numi, inum); }


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

x86 assembly (clang, -O2):
<fresetvalue_>:
jmp    1030 <resetvalue@plt>

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

LLVM IR (-O2):
define void @fresetvalue_(i32* %0, i32* %1) {
%3 = tail call i32 @resetvalue(i32* %0, i32* %1)
ret void
}