xunge/DecIR huggingface dataset:
/* Variables and functions */
int get_line(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int len;
  char line[1000];
  while ((len = get_line(line, 1000)) > 0)
    printf("%s", line);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1167 <main+0x47>
lea    -0x3f0(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
jmp    1132 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jle    116c <main+0x4c>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_line(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0, %5
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = call i32 @get_line(i8* %2, i32 1000)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
scalar_t__ isinf(double);
scalar_t__ isnan(double);
int non_finite(double x) { return (isnan(x) || isinf(x)); }


x86 assembly (clang, -O0):
<non_finite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    115d <non_finite+0x3d>
movsd  -0x8(%rbp),%xmm0
call   1040 <isinf@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<non_finite>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <isnan@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     113a <non_finite+0x1a>
pop    %rcx
ret
movsd  (%rsp),%xmm0
call   1040 <isinf@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @non_finite(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @isnan(double %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load double, double* %2
%8 = call i64 @isinf(double %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @non_finite(double %0) {
%2 = tail call i64 @isnan(double %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isinf(double %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int my_compare_string_ignorecase(const void *objeto1, const void *objeto2) {
  const char *f1 = (const char *)objeto1;
  const char *f2 = (const char *)objeto2;
  return strcasecmp(f1, f2);
}


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

x86 assembly (clang, -O2):
<my_compare_string_ignorecase>:
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @my_compare_string_ignorecase(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
/* Type definitions */
struct stat {
  long long st_size;
};

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int stat(char const *, struct stat *);
long long stat_file(const char *filename) {
  struct stat filestat;
  if (stat(filename, &filestat) == -1) {
    perror("stat:");
    return -1;
  }
  return filestat.st_size;
}


x86 assembly (clang, -O0):
<stat_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    115b <stat_file+0x3b>
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1163 <stat_file+0x43>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1134 <stat_file+0x14>
mov    (%rsp),%rax
pop    %rcx
ret
lea    0xec5(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffffffffffff,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i64 }
@.str = [6 x i8] c"stat:\00"
define i64 @stat_file(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i64, i64* %9
br label %11
11: ; preds = %8, %6
%12 = phi i64 [ -1, %6 ], [ %10, %8 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ ud_receive_long();
void ud_copy_and_exec(void) {
  ud_receive_long();
  ud_receive_long();
  ud_receive_long();
}


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

x86 assembly (clang, -O2):
<ud_copy_and_exec>:
push   %rax
xor    %eax,%eax
call   1030 <ud_receive_long@plt>
xor    %eax,%eax
call   1030 <ud_receive_long@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ud_receive_long@plt>

LLVM IR (-O0):
define void @ud_copy_and_exec() {
%1 = call i32 (...) @ud_receive_long()
%2 = call i32 (...) @ud_receive_long()
%3 = call i32 (...) @ud_receive_long()
ret void
}

LLVM IR (-O2):
define void @ud_copy_and_exec() {
%1 = tail call i32 (...) @ud_receive_long()
%2 = tail call i32 (...) @ud_receive_long()
%3 = tail call i32 (...) @ud_receive_long()
ret void
}
/* Variables and functions */
int addline(int /*<<< orphan*/);
newline(void) { return (addline(0)); }


x86 assembly (clang, -O0):
<newline>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <addline@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<newline>:
xor    %edi,%edi
jmp    1030 <addline@plt>

LLVM IR (-O0):
define i32 @newline() {
%1 = call i32 @addline(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @newline() {
%1 = tail call i32 @addline(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void Panic(char *Reason) {
  fprintf(stderr, "Oops, test for %s failed!?\n", Reason);
  exit(1);
}


x86 assembly (clang, -O0):
<Panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Panic>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Oops, test for %s failed!?\0A\00"
define void @Panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Oops, test for %s failed!?\0A\00"
define void @Panic(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char b_abs(char *);
signed char intr_wrap_088(signed char p1) { return b_abs(&p1); }


x86 assembly (clang, -O0):
<intr_wrap_088>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
call   1030 <b_abs@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_088>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
call   1030 <b_abs@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @intr_wrap_088(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call signext i8 @b_abs(i8* %2)
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @intr_wrap_088(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call signext i8 @b_abs(i8* %2)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, unsigned long long *, unsigned long long *);
int solve(unsigned long long, unsigned long long);
int main() {
  unsigned long long n = 0, m = 0;
  int res = 0;
  res = scanf("%llu %llu", &m, &n);
  printf("%d", solve(m, n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xea3(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <scanf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <solve@plt>
mov    %eax,%esi
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xeb3(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x8(%rsp),%rdi
mov    0x10(%rsp),%rsi
call   1030 <solve@plt>
lea    0xe98(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%llu %llu\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %2, i64* %1)
%6 = load i64, i64* %2
%7 = load i64, i64* %1
%8 = call i32 @solve(i64 %6, i64 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
double et_pot_day(double rnetd, double tempk, double roh_w) {
  double latent, result;
  latent = (2.501 - (0.02361 * (tempk - 273.15))) * 1000000.0;
  result = (rnetd * 86400 * 1000.0) / (latent * roh_w);
  return result;
}


x86 assembly (clang, -O0):
<et_pot_day>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xf08(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee8(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeb3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe9e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<et_pot_day>:
addsd  0xef8(%rip),%xmm1
mulsd  0xef8(%rip),%xmm1
addsd  0xef8(%rip),%xmm1
unpcklpd %xmm1,%xmm0
mulpd  0xefc(%rip),%xmm0
movapd 0xf04(%rip),%xmm1
unpcklpd %xmm2,%xmm1
mulpd  %xmm1,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @et_pot_day(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %5
%10 = fsub double %9, 2.731500e+02
%11 = call double @llvm.fmuladd.f64(double -2.361000e-02, double %10, double 2.501000e+00)
%12 = fmul double %11, 1.000000e+06
store double %12, double* %7
%13 = load double, double* %4
%14 = fmul double %13, 8.640000e+04
%15 = fmul double %14, 1.000000e+03
%16 = load double, double* %7
%17 = load double, double* %6
%18 = fmul double %16, %17
%19 = fdiv double %15, %18
store double %19, double* %8
%20 = load double, double* %8
ret double %20
}

LLVM IR (-O2):
define double @et_pot_day(double %0, double %1, double %2) {
%4 = fadd double %1, -2.731500e+02
%5 = tail call double @llvm.fmuladd.f64(double %4, double -2.361000e-02, double 2.501000e+00)
%6 = insertelement <2 x double> poison, double %0, i64 0
%7 = insertelement <2 x double> %6, double %5, i64 1
%8 = fmul <2 x double> %7, <double 8.640000e+04, double 1.000000e+06>
%9 = insertelement <2 x double> <double 1.000000e+03, double poison>, double %2, i64 1
%10 = fmul <2 x double> %8, %9
%11 = extractelement <2 x double> %10, i64 0
%12 = extractelement <2 x double> %10, i64 1
%13 = fdiv double %11, %12
ret double %13
}
char *ft_strcpy(char *s1, const char *s2) {
  char *save;
  save = s1;
  while (*s2)
    *s1++ = *s2++;
  *s1 = '\0';
  return (save);
}


x86 assembly (clang, -O0):
<ft_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <ft_strcpy+0x48>
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    1114 <ft_strcpy+0x14>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <ft_strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <ft_strcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @ft_strcpy(i8* returned 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* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%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 ]
store i8 0, i8* %14
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *mymalloc(int);
void t() {
  char *f;
  f = mymalloc(3);
  f[2] = '2';
  free(f);
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1040 <mymalloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x32,0x2(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
push   %rax
mov    $0x3,%edi
call   1040 <mymalloc@plt>
movb   $0x32,0x2(%rax)
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @t() {
%1 = alloca i8*
%2 = call i8* @mymalloc(i32 3)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 2
store i8 50, i8* %4
%5 = load i8*, i8** %1
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @t() {
%1 = tail call i8* @mymalloc(i32 3)
%2 = getelementptr inbounds i8, i8* %1, i64 2
store i8 50, i8* %2
%3 = tail call i32 @free(i8* %1)
ret void
}
void mb() { __asm__ volatile("mfence" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @mb() {
tail call void asm sideeffect "mfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
unsigned int rotateRight(unsigned int input) {
  int tmp = input % 2;
  input >>= 1;
  input += tmp * 0x80;
  input &= 0x00ff;
  return input;
}


x86 assembly (clang, -O0):
<rotateRight>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x7,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateRight>:
mov    %edi,%eax
shr    %eax
shl    $0x7,%edi
add    %eax,%edi
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @rotateRight(i32 %0) {
%2 = lshr i32 %0, 1
%3 = shl i32 %0, 7
%4 = add i32 %2, %3
%5 = and i32 %4, 255
ret i32 %5
}
/* Type definitions */
struct ss7 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ss7_message(struct ss7 *, char *, char *);
int((continuity_ind_dump))(struct ss7 *ss7, int messagetype,
                           unsigned char *parm, int len) {
  ss7_message(ss7, "\t\t\tContinuity Check: %s\n",
              (0x01 & parm[0]) ? "successful" : "failed");
  return 1;
}


x86 assembly (clang, -O0):
<continuity_ind_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
movzbl (%rax),%ecx
and    $0x1,%ecx
lea    0xee9(%rip),%rdx
lea    0xed7(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xeb0(%rip),%rsi
call   1030 <ss7_message@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<continuity_ind_dump>:
push   %rax
testb  $0x1,(%rdx)
lea    0xf09(%rip),%rax
lea    0xef7(%rip),%rdx
cmove  %rax,%rdx
lea    0xed3(%rip),%rsi
call   1030 <ss7_message@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ss7 = type { i32 }
@.str = [25 x i8] c"\09\09\09Continuity Check: %s\0A\00"
@.str.1 = [11 x i8] c"successful\00"
@.str.2 = [7 x i8] c"failed\00"
define i32 @continuity_ind_dump(%struct.ss7* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.ss7*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.ss7* %0, %struct.ss7** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.ss7*, %struct.ss7** %5
%10 = load i8*, i8** %7
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = and i32 1, %13
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%18 = call i32 @ss7_message(%struct.ss7* %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %17)
ret i32 1
}

LLVM IR (-O2):
%struct.ss7 = type { i32 }
@.str = [25 x i8] c"\09\09\09Continuity Check: %s\0A\00"
@.str.1 = [11 x i8] c"successful\00"
@.str.2 = [7 x i8] c"failed\00"
define i32 @continuity_ind_dump(%struct.ss7* %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = load i8, i8* %2
%6 = and i8 %5, 1
%7 = icmp eq i8 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0)
%9 = tail call i32 @ss7_message(%struct.ss7* %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 1
}
int test_imm_DAuint16_mem(unsigned short *val) {
  return ((*val) & (0xDA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DAuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xda,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DAuint16_mem>:
testb  $0xda,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DAuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 218
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ DoFoo1();
int /*<<< orphan*/ DoFoo2();
int main(void) {
  DoFoo1();
  DoFoo2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @DoFoo1()
%2 = tail call i32 (...) @DoFoo2()
ret i32 0
}
float __crealf(float _Complex z) { return __real__ z; }


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

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

LLVM IR (-O0):
define float @__crealf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %3
%4 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%5 = load float, float* %4
ret float %5
}

LLVM IR (-O2):
define float @__crealf(<2 x float> %0) {
%2 = extractelement <2 x float> %0, i64 0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ random_bytes(unsigned long *, int);
unsigned long random_ulong(void) {
  unsigned long ul;
  random_bytes(&ul, sizeof ul);
  return ul;
}


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

x86 assembly (clang, -O2):
<random_ulong>:
push   %rax
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <random_bytes@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @random_ulong() {
%1 = alloca i64
%2 = call i32 @random_bytes(i64* %1, i32 8)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @random_ulong() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @random_bytes(i64* %1, i32 8)
%4 = load i64, i64* %1
ret i64 %4
}
void foo688(int p) {}


x86 assembly (clang, -O0):
<foo688>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo688(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ FD_CLOEXEC;
int /*<<< orphan*/ F_SETFD;
int /*<<< orphan*/ errno;
scalar_t__ fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int fd_set_close_on_exec(int fd) {
  if (fd < 0) {
    errno = EINVAL;
    return (-1);
  }
  if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) {
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<fd_set_close_on_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1143 <fd_set_close_on_exec+0x33>
mov    0x2e9c(%rip),%rax
mov    (%rax),%ecx
mov    0x2e9b(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <fd_set_close_on_exec+0x6a>
mov    -0x8(%rbp),%edi
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
mov    0x2e82(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
cmp    $0x0,%rax
jge    1173 <fd_set_close_on_exec+0x63>
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <fd_set_close_on_exec+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_set_close_on_exec>:
push   %rax
test   %edi,%edi
js     1132 <fd_set_close_on_exec+0x22>
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
sar    $0x3f,%rax
pop    %rcx
ret
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
mov    0x2e8e(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
define i32 @fd_set_close_on_exec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* @EINVAL
store i32 %7, i32* @errno
store i32 -1, i32* %2
br label %16
8: ; preds = %1
%9 = load i32, i32* %3
%10 = load i32, i32* @F_SETFD
%11 = load i32, i32* @FD_CLOEXEC
%12 = call i64 @fcntl(i32 %9, i32 %10, i32 %11)
%13 = icmp slt i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %8
store i32 -1, i32* %2
br label %16
15: ; preds = %8
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
define i32 @fd_set_close_on_exec(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load i32, i32* @EINVAL
store i32 %4, i32* @errno
br label %11
5: ; preds = %1
%6 = load i32, i32* @F_SETFD
%7 = load i32, i32* @FD_CLOEXEC
%8 = tail call i64 @fcntl(i32 %0, i32 %6, i32 %7)
%9 = ashr i64 %8, 63
%10 = trunc i64 %9 to i32
br label %11
11: ; preds = %5, %3
%12 = phi i32 [ -1, %3 ], [ %10, %5 ]
ret i32 %12
}
int read_at5(void *fbase) {}


x86 assembly (clang, -O0):
<read_at5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @read_at5(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
int getInfo(char *buf, int bufLen) {
  static const char *INFO = "info { name=Midi }";
  int reqLen = strlen(INFO) + 1;
  if (buf != 0 && reqLen <= bufLen) {
    memcpy(buf, INFO, reqLen);
  }
  return reqLen;
}


x86 assembly (clang, -O0):
<getInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2efa(%rip),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116b <getInfo+0x4b>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     116b <getInfo+0x4b>
mov    -0x8(%rbp),%rdi
mov    0x2ecd(%rip),%rsi
mov    -0x10(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInfo>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
test   %rbx,%rbx
je     1154 <getInfo+0x34>
cmp    %r14d,%eax
jge    1154 <getInfo+0x34>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@getInfo.INFO = internal global i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i32 0, i32 0)
@.str = [19 x i8] c"info { name=Midi }\00"
define i32 @getInfo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** @getInfo.INFO
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %20
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = load i8*, i8** @getInfo.INFO
%18 = load i32, i32* %5
%19 = call i32 @memcpy(i8* %16, i8* %17, i32 %18)
br label %20
20: ; preds = %15, %11, %2
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
@.str = [19 x i8] c"info { name=Midi }\00"
define i32 @getInfo(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = add nsw i32 %3, 1
%5 = icmp ne i8* %0, null
%6 = icmp slt i32 %3, %1
%7 = select i1 %5, i1 %6, i1 false
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %10
10: ; preds = %8, %2
ret i32 %4
}
int execute_epoll_create1() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_epoll_create1() {
ret i32 0
}
/* Variables and functions */
int caller();
int main() { return caller(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @caller()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ lsqrt(long);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, long *);
int main(void) {
  long n;
  scanf("%ld", &n);
  if (n < 0) {
    printf("negative argument\n");
  } else {
    printf("%ld\n", lsqrt(n));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
cmpq   $0x0,-0x10(%rbp)
jge    116d <main+0x3d>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1186 <main+0x56>
mov    -0x10(%rbp),%rdi
call   1030 <lsqrt@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
mov    (%rsp),%rdi
test   %rdi,%rdi
js     1170 <main+0x30>
call   1040 <lsqrt@plt>
lea    0xe9f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    117c <main+0x3c>
lea    0xe92(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [19 x i8] c"negative argument\0A\00"
@.str.2 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
%4 = load i64, i64* %2
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %12
8: ; preds = %0
%9 = load i64, i64* %2
%10 = call i32 @lsqrt(i64 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
@.str.2 = [5 x i8] c"%ld\0A\00"
@str = [18 x i8] c"negative argument\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %11
8: ; preds = %0
%9 = call i32 @lsqrt(i64 %4)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %6
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t bufToUInt32(uint8_t *buf) {
  return (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | (buf[3] << 0);
}


x86 assembly (clang, -O0):
<bufToUInt32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bufToUInt32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @bufToUInt32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = shl i32 %19, 0
%21 = or i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @bufToUInt32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
float fmax(float in1, float in2) {
  if (in1 > in2)
    return in1;
  else
    return in2;
}


x86 assembly (clang, -O0):
<fmax>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    112c <fmax+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <fmax+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmax>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fmax(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp ogt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @fmax(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _bytecode_write(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
uint32_t bytecode_jmp(uint8_t r0) { return _bytecode_write(9, 0, 0, r0, 0, 0); }


x86 assembly (clang, -O0):
<bytecode_jmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x9,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%r8d
call   1030 <_bytecode_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytecode_jmp>:
mov    %edi,%ecx
mov    $0x9,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <_bytecode_write@plt>

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

LLVM IR (-O2):
define i32 @bytecode_jmp(i32 %0) {
%2 = tail call i32 @_bytecode_write(i32 9, i32 0, i32 0, i32 %0, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void qh_exit(int exitcode) { exit(exitcode); }


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

x86 assembly (clang, -O2):
<qh_exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @qh_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *s_exit() {
  exit(1);
  return "";
}


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

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

LLVM IR (-O0):
define i8* @s_exit() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define noalias i8* @s_exit() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
void rop3_201_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | *D;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_201_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_201_0_0>:
or     (%rdi),%dl
xor    %sil,%dl
not    %dl
mov    %dl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_201_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
%6 = xor i8 %5, %1
%7 = xor i8 %6, -1
store i8 %7, i8* %0
ret void
}
void board_traits_recompute(struct board *board) {}


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

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

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

LLVM IR (-O2):
%struct.board = type opaque
define void @board_traits_recompute(%struct.board* nocapture %0) {
ret void
}
char *cbqfn(user)
char *user;
{
  char *x;
  x = cbfn("quotas");
  strcat(x, "/");
  strcat(x, user);
  return (x);
}


x86 assembly (clang, -O0):
<cbqfn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <cbfn@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbqfn>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1040 <cbfn@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
movw   $0x2f,(%rbx,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <strcat@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"quotas\00"
@.str.1 = [2 x i8] c"/\00"
define i8* @cbqfn(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @cbfn to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @strcat(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i8* @strcat(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [7 x i8] c"quotas\00"
define i8* @cbqfn(i8* nocapture %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @cbfn to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
%5 = tail call i64 @strlen(i8* dereferenceable(1) %4)
%6 = getelementptr i8, i8* %4, i64 %5
%7 = bitcast i8* %6 to i16*
store i16 47, i16* %7
%8 = tail call i8* @strcat(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
void param_get_int(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<param_get_int>:
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):
<param_get_int>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

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

LLVM IR (-O2):
@__func__.param_get_int = [14 x i8] c"param_get_int\00"
define void @param_get_int() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.param_get_int, i64 0, i64 0))
ret void
}
double FTtoMI(double FT) { return FT * 0.000189393939; }


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

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

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

LLVM IR (-O2):
define double @FTtoMI(double %0) {
%2 = fmul double %0, 0x3F28D3018C52542D
ret double %2
}