xunge/DecIR huggingface dataset:
unsigned long long Maj(unsigned long long x, unsigned long long y,
                       unsigned long long z) {
  return (x & y) ^ (x & z) ^ (y & z);
}


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

x86 assembly (clang, -O2):
<Maj>:
mov    %rdx,%rax
xor    %rsi,%rax
and    %rdi,%rax
and    %rsi,%rdx
xor    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @Maj(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = and i64 %7, %8
%10 = load i64, i64* %4
%11 = load i64, i64* %6
%12 = and i64 %10, %11
%13 = xor i64 %9, %12
%14 = load i64, i64* %5
%15 = load i64, i64* %6
%16 = and i64 %14, %15
%17 = xor i64 %13, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @Maj(i64 %0, i64 %1, i64 %2) {
%4 = xor i64 %2, %1
%5 = and i64 %4, %0
%6 = and i64 %2, %1
%7 = xor i64 %5, %6
ret i64 %7
}
void close_commands(void) {
  ;
  { return; };
}


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

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

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

LLVM IR (-O2):
define void @close_commands() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setup_parent(char *, int, char **);
int main(int argc, char *argv[]) { setup_parent("signal", argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <setup_parent@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
call   1030 <setup_parent@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"signal\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 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @setup_parent(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i8** %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"signal\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @setup_parent(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i8** %1)
ret i32 0
}
void bu_compile_inc(args) struct conscell *args;
{
  int n = bu_compile_arg_list(args);
  if (n != 1)
    goto er;
  EMIT1ATM("INC");
  EMITEND();
  return;
er:
  cerror("1+: wrong # of args", args);
}


x86 assembly (clang, -O0):
<bu_compile_inc>:
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_inc+0x29>
jmp    1183 <bu_compile_inc+0x43>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1050 <EMIT1ATM@plt>
mov    $0x0,%al
call   1030 <EMITEND@plt>
jmp    1195 <bu_compile_inc+0x55>
mov    -0x8(%rbp),%rsi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1060 <cerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.conscell = type opaque
@.str = [4 x i8] c"INC\00"
@.str.1 = [20 x i8] c"1+: wrong # of args\00"
define void @bu_compile_inc(%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 ([4 x i8], [4 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 ([20 x i8], [20 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 = [4 x i8] c"INC\00"
@.str.1 = [20 x i8] c"1+: wrong # of args\00"
define void @bu_compile_inc(%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 ([4 x i8], [4 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 ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* %0)
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void tautologyLE(unsigned a) {
  char *b = malloc(1);
  if (a <= -1U)
    free(b);
  return;
}


x86 assembly (clang, -O0):
<tautologyLE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
ja     114c <tautologyLE+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tautologyLE>:
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @tautologyLE(i32 %0) {
%2 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%3 = tail call i32 @free(i8* %2)
ret void
}
double f_1(double t) {
  const double Limit = (24.0 / 116.0);
  if (t <= Limit) {
    double tmp;
    tmp = (108.0 / 841.0) * (t - (16.0 / 116.0));
    if (tmp <= 0.0)
      return 0.0;
    else
      return tmp;
  }
  return t * t * t;
}


x86 assembly (clang, -O0):
<f_1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xee2(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1175 <f_1+0x75>
movsd  -0x10(%rbp),%xmm1
movsd  0xeda(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     1166 <f_1+0x66>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1189 <f_1+0x89>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1189 <f_1+0x89>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_1>:
movsd  0xef8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    111f <f_1+0x1f>
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret
addsd  0xee1(%rip),%xmm0
mulsd  0xee1(%rip),%xmm0
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm1
cmplesd %xmm2,%xmm1
andnpd %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f_1(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double 0x3FCA7B9611A7B961, double* %4
%6 = load double, double* %3
%7 = fcmp ole double %6, 0x3FCA7B9611A7B961
br i1 %7, label %8, label %17
8: ; preds = %1
%9 = load double, double* %3
%10 = fsub double %9, 0x3FC1A7B9611A7B96
%11 = fmul double 0x3FC07004DED20922, %10
store double %11, double* %5
%12 = load double, double* %5
%13 = fcmp ole double %12, 0.000000e+00
br i1 %13, label %14, label %15
14: ; preds = %8
store double 0.000000e+00, double* %2
br label %23
15: ; preds = %8
%16 = load double, double* %5
store double %16, double* %2
br label %23
17: ; preds = %1
%18 = load double, double* %3
%19 = load double, double* %3
%20 = fmul double %18, %19
%21 = load double, double* %3
%22 = fmul double %20, %21
store double %22, double* %2
br label %23
23: ; preds = %17, %15, %14
%24 = load double, double* %2
ret double %24
}

LLVM IR (-O2):
define double @f_1(double %0) {
%2 = fcmp ugt double %0, 0x3FCA7B9611A7B961
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = fadd double %0, 0xBFC1A7B9611A7B96
%5 = fmul double %4, 0x3FC07004DED20922
%6 = fcmp ole double %5, 0.000000e+00
%7 = select i1 %6, double 0.000000e+00, double %5
br label %11
8: ; preds = %1
%9 = fmul double %0, %0
%10 = fmul double %9, %0
br label %11
11: ; preds = %8, %3
%12 = phi double [ %7, %3 ], [ %10, %8 ]
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ ElSuiteSparse_tic(double *);
double ElSuiteSparse_toc(double tic[2]) {
  double toc[2];
  ElSuiteSparse_tic(toc);
  return ((toc[0] - tic[0]) + 1e-9 * (toc[1] - tic[1]));
}


x86 assembly (clang, -O0):
<ElSuiteSparse_toc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <ElSuiteSparse_tic@plt>
movsd  -0x20(%rbp),%xmm1
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm1
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  0xeb8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ElSuiteSparse_toc>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
call   1030 <ElSuiteSparse_tic@plt>
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
subsd  (%rbx),%xmm1
subsd  0x8(%rbx),%xmm0
mulsd  0xec4(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @ElSuiteSparse_toc(double* %0) {
%2 = alloca double*
%3 = alloca [2 x double]
store double* %0, double** %2
%4 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%5 = call i32 @ElSuiteSparse_tic(double* %4)
%6 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%7 = load double, double* %6
%8 = load double*, double** %2
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fsub double %7, %10
%12 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 1
%13 = load double, double* %12
%14 = load double*, double** %2
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fsub double %13, %16
%18 = call double @llvm.fmuladd.f64(double 1.000000e-09, double %17, double %11)
ret double %18
}

LLVM IR (-O2):
define double @ElSuiteSparse_toc(double* nocapture %0) {
%2 = alloca [2 x double]
%3 = bitcast [2 x double]* %2 to i8*
%4 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 0
%5 = call i32 @ElSuiteSparse_tic(double* %4)
%6 = load double, double* %4
%7 = load double, double* %0
%8 = fsub double %6, %7
%9 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 1
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %0, i64 1
%12 = load double, double* %11
%13 = fsub double %10, %12
%14 = call double @llvm.fmuladd.f64(double %13, double 1.000000e-09, double %8)
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ doSleep();
int /*<<< orphan*/ doTick();
void loop() {
  while (1) {
    doTick();
    for (unsigned char i = 0; i < (10) - 1; i++)
      doSleep();
  }
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <doTick@plt>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x9,%eax
jge    1154 <loop+0x34>
mov    $0x0,%al
call   1040 <doSleep@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    1133 <loop+0x13>
jmp    1128 <loop+0x8>

x86 assembly (clang, -O2):
<loop>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <doTick@plt>
xor    %eax,%eax
call   1040 <doSleep@plt>
xor    %eax,%eax
call   1040 <doSleep@plt>
xor    %eax,%eax
call   1040 <doSleep@plt>
xor    %eax,%eax
call   1040 <doSleep@plt>
xor    %eax,%eax
call   1040 <doSleep@plt>
xor    %eax,%eax
call   1040 <doSleep@plt>
xor    %eax,%eax
call   1040 <doSleep@plt>
xor    %eax,%eax
call   1040 <doSleep@plt>
xor    %eax,%eax
call   1040 <doSleep@plt>
jmp    1130 <loop+0x10>

LLVM IR (-O0):
define void @loop() {
%1 = alloca i8
br label %2
2: ; preds = %0, %13
%3 = call i32 (...) @doTick()
store i8 0, i8* %1
br label %4
4: ; preds = %10, %2
%5 = load i8, i8* %1
%6 = zext i8 %5 to i32
%7 = icmp slt i32 %6, 9
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 (...) @doSleep()
br label %10
10: ; preds = %8
%11 = load i8, i8* %1
%12 = add i8 %11, 1
store i8 %12, i8* %1
br label %4
13: ; preds = %4
br label %2
}

LLVM IR (-O2):
define void @loop() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @doTick()
%3 = tail call i32 (...) @doSleep()
%4 = tail call i32 (...) @doSleep()
%5 = tail call i32 (...) @doSleep()
%6 = tail call i32 (...) @doSleep()
%7 = tail call i32 (...) @doSleep()
%8 = tail call i32 (...) @doSleep()
%9 = tail call i32 (...) @doSleep()
%10 = tail call i32 (...) @doSleep()
%11 = tail call i32 (...) @doSleep()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ japi_print(int);
void j_print(int arg0) { japi_print(arg0); }


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

x86 assembly (clang, -O2):
<j_print>:
jmp    1030 <japi_print@plt>

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

LLVM IR (-O2):
define void @j_print(i32 %0) {
%2 = tail call i32 @japi_print(i32 %0)
ret void
}
/* Variables and functions */
int f17(int *);
int f18(int *p) { return f17(p); }


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

x86 assembly (clang, -O2):
<f18>:
jmp    1030 <f17@plt>

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

LLVM IR (-O2):
define i32 @f18(i32* %0) {
%2 = tail call i32 @f17(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ CySysWdtDisable();
int /*<<< orphan*/ Start_c();
void Reset(void) {
  CySysWdtDisable();
  Start_c();
}


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

x86 assembly (clang, -O2):
<Reset>:
push   %rax
xor    %eax,%eax
call   1040 <CySysWdtDisable@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <Start_c@plt>

LLVM IR (-O0):
define void @Reset() {
%1 = call i32 (...) @CySysWdtDisable()
%2 = call i32 (...) @Start_c()
ret void
}

LLVM IR (-O2):
define void @Reset() {
%1 = tail call i32 (...) @CySysWdtDisable()
%2 = tail call i32 (...) @Start_c()
ret void
}
void avio_write() {}


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

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

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

LLVM IR (-O2):
define void @avio_write() {
ret void
}
/* Variables and functions */
int L_tmpnam;
int tosFilename_tempNameSize(void) { return L_tmpnam; }


x86 assembly (clang, -O0):
<tosFilename_tempNameSize>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosFilename_tempNameSize>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@L_tmpnam = global i32 0
define i32 @tosFilename_tempNameSize() {
%1 = load i32, i32* @L_tmpnam
ret i32 %1
}

LLVM IR (-O2):
@L_tmpnam = global i32 0
define i32 @tosFilename_tempNameSize() {
%1 = load i32, i32* @L_tmpnam
ret i32 %1
}
/* Variables and functions */
double acos(double);
double asec(double x) { return acos(1.0 / x); }


x86 assembly (clang, -O0):
<asec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <acos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asec>:
movsd  0xee8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
jmp    1030 <acos@plt>

LLVM IR (-O0):
define double @asec(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = call double @acos(double %4)
ret double %5
}

LLVM IR (-O2):
define double @asec(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = tail call double @acos(double %2)
ret double %3
}
/* Variables and functions */
scalar_t__ FCGI_Accept();
int /*<<< orphan*/ chl_fcgi_init();
char chl_fcgi_next() {
  chl_fcgi_init();
  if (FCGI_Accept() >= 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<chl_fcgi_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <chl_fcgi_init@plt>
mov    $0x0,%al
call   1030 <FCGI_Accept@plt>
cmp    $0x0,%rax
jl     1149 <chl_fcgi_next+0x29>
movb   $0x1,-0x1(%rbp)
jmp    114d <chl_fcgi_next+0x2d>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chl_fcgi_next>:
push   %rax
xor    %eax,%eax
call   1040 <chl_fcgi_init@plt>
xor    %eax,%eax
call   1030 <FCGI_Accept@plt>
test   %rax,%rax
setns  %al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @chl_fcgi_next() {
%1 = alloca i8
%2 = call i32 (...) @chl_fcgi_init()
%3 = call i64 (...) @FCGI_Accept()
%4 = icmp sge i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i8 1, i8* %1
br label %7
6: ; preds = %0
store i8 0, i8* %1
br label %7
7: ; preds = %6, %5
%8 = load i8, i8* %1
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @chl_fcgi_next() {
%1 = tail call i32 (...) @chl_fcgi_init()
%2 = tail call i64 (...) @FCGI_Accept()
%3 = lshr i64 %2, 63
%4 = trunc i64 %3 to i8
%5 = xor i8 %4, 1
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ print1(int);
void *thread1(void *cmd) {
  while (1) {
    print1(100);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<thread1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   1030 <print1@plt>
jmp    111c <thread1+0xc>

x86 assembly (clang, -O2):
<thread1>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x64,%edi
call   1030 <print1@plt>
jmp    1120 <thread1+0x10>

LLVM IR (-O0):
define i8* @thread1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @print1(i32 100)
br label %3
}

LLVM IR (-O2):
define noalias i8* @thread1(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @print1(i32 100)
br label %2
}
/* Variables and functions */
void *mymalloc(size_t);
extern void *malloc(size_t size) { return mymalloc(size); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ls_cost_nm7_decref() {
ret void
}
__attribute__((no)) double floor(double a) { return a; }


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

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

LLVM IR (-O0):
define double @floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double %3
}

LLVM IR (-O2):
define double @floor(double returned %0) {
ret double %0
}
char *strcpy(char *dest, const char *src) {
  while (*src != '\0')
    *(dest++) = *(src++);
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1143 <strcpy+0x43>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <strcpy+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
ret i8* %14
}
/* Variables and functions */
int lseek(int, int, int);
int lseek_(int *fd, int *offset, int *origin) {
  return (lseek(*fd, *offset, *origin));
}


x86 assembly (clang, -O0):
<lseek_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rdx),%edx
jmp    1030 <lseek@plt>

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

LLVM IR (-O2):
define i32 @lseek_(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = tail call i32 @lseek(i32 %4, i32 %5, i32 %6)
ret i32 %7
}
/* Variables and functions */
char *base64_encode(size_t *, char const *, size_t);
char *base64_encode_to_cstr(const char *src, size_t sz) {
  size_t len;
  return base64_encode(&len, src, sz);
}


x86 assembly (clang, -O0):
<base64_encode_to_cstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
call   1030 <base64_encode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_encode_to_cstr>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <base64_encode@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @base64_encode_to_cstr(i8* %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i8* @base64_encode(i64* %3, i8* %0, i64 %1)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ lib1_func3();
void lib2_func2(void) { lib1_func3(); }


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

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

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

LLVM IR (-O2):
define void @lib2_func2() {
%1 = tail call i32 (...) @lib1_func3()
ret void
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_wadd_wch(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_wadd_wch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_wadd_wch+0x2a>
jmp    1170 <cmd_wadd_wch+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_wadd_wch>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_wadd_wch+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_wadd_wch(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_wadd_wch(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int SyncLST(double newTime) {
  fprintf(stderr,
          "NexStar does not support remote setting of sidereal time.\n");
  return -1;
}


x86 assembly (clang, -O0):
<SyncLST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SyncLST>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"NexStar does not support remote setting of sidereal time.\0A\00"
define i32 @SyncLST(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"NexStar does not support remote setting of sidereal time.\0A\00"
define i32 @SyncLST(double %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int pid = getpid();
  printf("pid is %d\n", pid);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"pid is %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct rpc_err {
  int dummy;
};
typedef int /*<<< orphan*/ CLIENT;

/* Variables and functions */
void clntraw_geterr(CLIENT *cl, struct rpc_err *err) {}


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

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

LLVM IR (-O0):
%struct.rpc_err = type { i32 }
define void @clntraw_geterr(i32* %0, %struct.rpc_err* %1) {
%3 = alloca i32*
%4 = alloca %struct.rpc_err*
store i32* %0, i32** %3
store %struct.rpc_err* %1, %struct.rpc_err** %4
ret void
}

LLVM IR (-O2):
%struct.rpc_err = type { i32 }
define void @clntraw_geterr(i32* nocapture %0, %struct.rpc_err* nocapture %1) {
ret void
}
/* Variables and functions */
double sqrt(double);
double vectorDistance(double x, double y) { return sqrt(x * x + y * y); }


x86 assembly (clang, -O0):
<vectorDistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectorDistance>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <vectorDistance+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @vectorDistance(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = call double @sqrt(double %10)
ret double %11
}

LLVM IR (-O2):
define double @vectorDistance(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}
unsigned long rotateL_fun_ulong(unsigned long x, int i) {
  if ((i %= 40) == 0)
    return x;
  return (x << i) | (x >> (40 - i));
}


x86 assembly (clang, -O0):
<rotateL_fun_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x28,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
cmp    $0x0,%edx
jne    112f <rotateL_fun_ulong+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <rotateL_fun_ulong+0x54>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    %cl,%rax
mov    -0x10(%rbp),%rdx
mov    $0x28,%ecx
sub    -0x14(%rbp),%ecx
mov    %ecx,%ecx
shr    %cl,%rdx
mov    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateL_fun_ulong>:
movslq %esi,%rdx
imul   $0x66666667,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x24,%rax
add    %ecx,%eax
shl    $0x3,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%edx
mov    %rdi,%rsi
mov    %edx,%ecx
shl    %cl,%rsi
mov    $0x28,%cl
sub    %dl,%cl
mov    %rdi,%rax
shr    %cl,%rax
or     %rsi,%rax
test   %edx,%edx
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @rotateL_fun_ulong(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = srem i32 %6, 40
store i32 %7, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i64, i64* %4
store i64 %10, i64* %3
br label %22
11: ; preds = %2
%12 = load i64, i64* %4
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = shl i64 %12, %14
%16 = load i64, i64* %4
%17 = load i32, i32* %5
%18 = sub nsw i32 40, %17
%19 = zext i32 %18 to i64
%20 = lshr i64 %16, %19
%21 = or i64 %15, %20
store i64 %21, i64* %3
br label %22
22: ; preds = %11, %9
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
define i64 @rotateL_fun_ulong(i64 %0, i32 %1) {
%3 = srem i32 %1, 40
%4 = icmp eq i32 %3, 0
%5 = zext i32 %3 to i64
%6 = shl i64 %0, %5
%7 = sub nsw i32 40, %3
%8 = zext i32 %7 to i64
%9 = lshr i64 %0, %8
%10 = or i64 %9, %6
%11 = select i1 %4, i64 %0, i64 %10
ret i64 %11
}
int lg(int x) {
  int r = 0;
  while (x > 1)
    r++, x >>= 1;
  return r;
}


x86 assembly (clang, -O0):
<lg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    112f <lg+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <lg+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lg>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111c <lg+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <lg+0x10>
ret

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

LLVM IR (-O2):
define i32 @lg(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %5, 1
%8 = icmp ugt i32 %5, 3
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
char *str_trim(char *, int /*<<< orphan*/);
char *str_trim_space(char *str) { return str_trim(str, 0); }


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

x86 assembly (clang, -O2):
<str_trim_space>:
xor    %esi,%esi
jmp    1030 <str_trim@plt>

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

LLVM IR (-O2):
define i8* @str_trim_space(i8* %0) {
%2 = tail call i8* @str_trim(i8* %0, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ erg_getcwd(char *, int);
int /*<<< orphan*/ printf(char *, char *);
extern void erg_printcwd() {
  char buffer[1000];
  erg_getcwd(buffer, 1000);
  printf("%s\n", buffer);
}


x86 assembly (clang, -O0):
<erg_printcwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <erg_getcwd@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erg_printcwd>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <erg_getcwd@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @erg_printcwd() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @erg_getcwd(i8* %2, i32 1000)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
int fun927() { return 927; }


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

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

LLVM IR (-O0):
define i32 @fun927() {
ret i32 927
}

LLVM IR (-O2):
define i32 @fun927() {
ret i32 927
}
/* Type definitions */
struct evbuffer {
  int dummy;
};

/* Variables and functions */
int evbuffer_drain(struct evbuffer *buf, size_t len) {
  (void)buf;
  (void)len;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
define i32 @evbuffer_drain(%struct.evbuffer* %0, i64 %1) {
%3 = alloca %struct.evbuffer*
%4 = alloca i64
store %struct.evbuffer* %0, %struct.evbuffer** %3
store i64 %1, i64* %4
%5 = load %struct.evbuffer*, %struct.evbuffer** %3
%6 = load i64, i64* %4
ret i32 0
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
define i32 @evbuffer_drain(%struct.evbuffer* nocapture readnone %0, i64 %1) {
ret i32 0
}
long int labs(long int j) { return j < 0 ? -j : j; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <labs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
__attribute__((always_)) int calc_xsize(int rect_xsz, int padding, int nrect) {
  return rect_xsz * nrect + padding * (nrect + 1) + 2;
}


x86 assembly (clang, -O0):
<calc_xsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_xsize>:
imul   %edx,%edi
add    $0x1,%edx
imul   %esi,%edx
lea    (%rdi,%rdx,1),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @calc_xsize(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 1
%13 = mul nsw i32 %10, %12
%14 = add nsw i32 %9, %13
%15 = add nsw i32 %14, 2
ret i32 %15
}

LLVM IR (-O2):
define i32 @calc_xsize(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %0
%5 = add nsw i32 %2, 1
%6 = mul nsw i32 %5, %1
%7 = add i32 %4, 2
%8 = add i32 %7, %6
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f();
int main() {
  f();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
long strtol(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
long parser_str_to_long(char *string) { return strtol(string, NULL, 0); }


x86 assembly (clang, -O0):
<parser_str_to_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_str_to_long>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i64 @parser_str_to_long(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 0)
ret i64 %2
}
int dropprivs(void) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @dropprivs() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void do_help() {
  printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] file.zip "
         "[files_to_add]\n\n"
         "  -o  Overwrite existing file.zip\n"
         "  -a  Append to existing file.zip\n"
         "  -0  Store only\n"
         "  -1  Compress faster\n"
         "  -9  Compress better\n\n");
}


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

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

LLVM IR (-O0):
@.str = [207 x i8] c"Usage : minizip [-o] [-a] [-0 to -9] [-p password] file.zip [files_to_add]\0A\0A -o Overwrite existing file.zip\0A -a Append to existing file.zip\0A -0 Store only\0A -1 Compress faster\0A -9 Compress better\0A\0A\00"
define void @do_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([207 x i8], [207 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [206 x i8] c"Usage : minizip [-o] [-a] [-0 to -9] [-p password] file.zip [files_to_add]\0A\0A -o Overwrite existing file.zip\0A -a Append to existing file.zip\0A -0 Store only\0A -1 Compress faster\0A -9 Compress better\0A\00"
define void @do_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([206 x i8], [206 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abs(long);
int floor(int /*<<< orphan*/);
int /*<<< orphan*/ log10(int /*<<< orphan*/);
int longlen(long i) { return (i ? floor(log10(abs(i))) + 1 : 1); }


x86 assembly (clang, -O0):
<longlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <longlen+0x39>
mov    -0x8(%rbp),%rdi
call   1030 <abs@plt>
mov    %eax,%edi
call   1040 <log10@plt>
mov    %eax,%edi
call   1050 <floor@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1176 <longlen+0x46>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1176 <longlen+0x46>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<longlen>:
test   %rdi,%rdi
je     1151 <longlen+0x21>
push   %rax
call   1030 <abs@plt>
mov    %eax,%edi
call   1040 <log10@plt>
mov    %eax,%edi
call   1050 <floor@plt>
add    $0x1,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @longlen(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i64, i64* %2
%7 = call i32 @abs(i64 %6)
%8 = call i32 @log10(i32 %7)
%9 = call i32 @floor(i32 %8)
%10 = add nsw i32 %9, 1
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %5
%13 = phi i32 [ %10, %5 ], [ 1, %11 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @longlen(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @abs(i64 %0)
%5 = tail call i32 @log10(i32 %4)
%6 = tail call i32 @floor(i32 %5)
%7 = add nsw i32 %6, 1
br label %8
8: ; preds = %1, %3
%9 = phi i32 [ %7, %3 ], [ 1, %1 ]
ret i32 %9
}
int ceph_osd_op_type_multi(int op) { return (op & 0x0f00) == 0x0600; }


x86 assembly (clang, -O0):
<ceph_osd_op_type_multi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf00,%eax
cmp    $0x600,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceph_osd_op_type_multi>:
and    $0xf00,%edi
xor    %eax,%eax
cmp    $0x600,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @ceph_osd_op_type_multi(i32 %0) {
%2 = and i32 %0, 3840
%3 = icmp eq i32 %2, 1536
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
long DIV_ROUND_CLOSEST(long, int);
long millicelsius_to_milli_kelvin(long);
long celsius_to_deci_kelvin(long t) {
  t = millicelsius_to_milli_kelvin(t * 1000);
  return DIV_ROUND_CLOSEST(t, 100);
}


x86 assembly (clang, -O0):
<celsius_to_deci_kelvin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
imul   $0x3e8,-0x8(%rbp),%rdi
call   1030 <millicelsius_to_milli_kelvin@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x64,%esi
call   1040 <DIV_ROUND_CLOSEST@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celsius_to_deci_kelvin>:
push   %rax
imul   $0x3e8,%rdi,%rdi
call   1030 <millicelsius_to_milli_kelvin@plt>
mov    %rax,%rdi
mov    $0x64,%esi
pop    %rax
jmp    1040 <DIV_ROUND_CLOSEST@plt>

LLVM IR (-O0):
define i64 @celsius_to_deci_kelvin(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 1000
%5 = call i64 @millicelsius_to_milli_kelvin(i64 %4)
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = call i64 @DIV_ROUND_CLOSEST(i64 %6, i32 100)
ret i64 %7
}

LLVM IR (-O2):
define i64 @celsius_to_deci_kelvin(i64 %0) {
%2 = mul nsw i64 %0, 1000
%3 = tail call i64 @millicelsius_to_milli_kelvin(i64 %2)
%4 = tail call i64 @DIV_ROUND_CLOSEST(i64 %3, i32 100)
ret i64 %4
}