xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ get_arrays(unsigned int, int);
int /*<<< orphan*/ nrerror(char *);
int /*<<< orphan*/ update_fold_params();
void initialize_fold(int length, int maxdist) {
  if (length < 1)
    nrerror("initialize_fold: argument must be greater 0");
  get_arrays((unsigned)length, maxdist);
  update_fold_params();
}


x86 assembly (clang, -O0):
<initialize_fold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1154 <initialize_fold+0x24>
lea    0xeb1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <get_arrays@plt>
mov    $0x0,%al
call   1040 <update_fold_params@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_fold>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   %edi,%edi
jg     1147 <initialize_fold+0x17>
lea    0xebe(%rip),%rdi
call   1030 <nrerror@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <get_arrays@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <update_fold_params@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"initialize_fold: argument must be greater 0\00"
define void @initialize_fold(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @nrerror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @get_arrays(i32 %10, i32 %11)
%13 = call i32 (...) @update_fold_params()
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"initialize_fold: argument must be greater 0\00"
define void @initialize_fold(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @nrerror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = tail call i32 @get_arrays(i32 %0, i32 %1)
%8 = tail call i32 (...) @update_fold_params()
ret void
}
unsigned int f65(unsigned int x, int y) {
  return (x << y) + (x >> ((-y) & (8 * 4 - 1)));
}


x86 assembly (clang, -O0):
<f65>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x1f,%ecx
shr    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f65>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f65(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 0, %9
%11 = and i32 %10, 31
%12 = lshr i32 %8, %11
%13 = add i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @f65(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 0, %1
%5 = and i32 %4, 31
%6 = lshr i32 %0, %5
%7 = add i32 %6, %3
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ uid_t;
typedef scalar_t__ gid_t;

/* Variables and functions */
scalar_t__ getegid();
scalar_t__ geteuid();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  uid_t uid = geteuid();
  gid_t gid = getegid();
  printf("uid = %d, gid = %d\n", (int)uid, (int)gid);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <geteuid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getegid@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <geteuid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <getegid@plt>
lea    0xeb7(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"uid = %d, gid = %d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @geteuid()
%2 = tail call i64 (...) @getegid()
%3 = trunc i64 %1 to i32
%4 = trunc i64 %2 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AAAA_CONTROL_LOOP_IMPL();
int /*<<< orphan*/ AAAA_TEMPERATURE_IMPL();
int /*<<< orphan*/ AIBV_plant_IMPL();
int /*<<< orphan*/ AIBV_plant_IMPL2();
int /*<<< orphan*/ omp_set_num_threads(int);
int main(int argc, char *argv[]) {
  omp_set_num_threads(4);
#pragma omp parallel sections
  {
#pragma omp section
    { AAAA_CONTROL_LOOP_IMPL(); }
#pragma omp section
    { AAAA_TEMPERATURE_IMPL(); }
#pragma omp section
    { AIBV_plant_IMPL(); }
#pragma omp section
    { AIBV_plant_IMPL2(); }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1070 <omp_set_num_threads@plt>
mov    $0x0,%al
call   1060 <AAAA_CONTROL_LOOP_IMPL@plt>
mov    $0x0,%al
call   1040 <AAAA_TEMPERATURE_IMPL@plt>
mov    $0x0,%al
call   1030 <AIBV_plant_IMPL@plt>
mov    $0x0,%al
call   1050 <AIBV_plant_IMPL2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1070 <omp_set_num_threads@plt>
xor    %eax,%eax
call   1060 <AAAA_CONTROL_LOOP_IMPL@plt>
xor    %eax,%eax
call   1040 <AAAA_TEMPERATURE_IMPL@plt>
xor    %eax,%eax
call   1030 <AIBV_plant_IMPL@plt>
xor    %eax,%eax
call   1050 <AIBV_plant_IMPL2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @omp_set_num_threads(i32 4)
%6 = call i32 (...) @AAAA_CONTROL_LOOP_IMPL()
%7 = call i32 (...) @AAAA_TEMPERATURE_IMPL()
%8 = call i32 (...) @AIBV_plant_IMPL()
%9 = call i32 (...) @AIBV_plant_IMPL2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @omp_set_num_threads(i32 4)
%4 = tail call i32 (...) @AAAA_CONTROL_LOOP_IMPL()
%5 = tail call i32 (...) @AAAA_TEMPERATURE_IMPL()
%6 = tail call i32 (...) @AIBV_plant_IMPL()
%7 = tail call i32 (...) @AIBV_plant_IMPL2()
ret i32 0
}
/* Type definitions */
typedef long long *__m128d;

/* Variables and functions */
long long __attribute__((__always___, __nodebug__)) _mm_cvttsd_si64(__m128d a) {
  return a[0];
}


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

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

LLVM IR (-O0):
define i64 @_mm_cvttsd_si64(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @_mm_cvttsd_si64(i64* nocapture %0) {
%2 = load i64, i64* %0
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ christmastree(int);
int main() {
  christmastree(4);
  christmastree(7);
  christmastree(11);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <christmastree@plt>
mov    $0x7,%edi
call   1030 <christmastree@plt>
mov    $0xb,%edi
call   1030 <christmastree@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @christmastree(i32 4)
%3 = call i32 @christmastree(i32 7)
%4 = call i32 @christmastree(i32 11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @christmastree(i32 4)
%2 = tail call i32 @christmastree(i32 7)
%3 = tail call i32 @christmastree(i32 11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getchars(char *, int);
char *malloc(int);
int /*<<< orphan*/ putchars(char *, int);
int main() {
  char *array = malloc(100);
  getchars(array, 100);
  putchars(array, 100);
  putchars(array, 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x64,%esi
call   1030 <getchars@plt>
mov    -0x10(%rbp),%rdi
mov    $0x64,%esi
call   1050 <putchars@plt>
mov    -0x10(%rbp),%rdi
mov    $0x64,%esi
call   1050 <putchars@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x64,%esi
call   1030 <getchars@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <putchars@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <putchars@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 100)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @getchars(i8* %4, i32 100)
%6 = load i8*, i8** %2
%7 = call i32 @putchars(i8* %6, i32 100)
%8 = load i8*, i8** %2
%9 = call i32 @putchars(i8* %8, i32 100)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%2 = tail call i32 @getchars(i8* %1, i32 100)
%3 = tail call i32 @putchars(i8* %1, i32 100)
%4 = tail call i32 @putchars(i8* %1, i32 100)
ret i32 0
}
int e_gcd(int a, int b) {
  int x;
  if (b > a) {
    x = a;
    a = b;
    b = x;
  }
  while ((x = a % b) != 0) {
    a = b;
    b = x;
  }
  return b;
}


x86 assembly (clang, -O0):
<e_gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1128 <e_gcd+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <e_gcd+0x2d>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmp    $0x0,%edx
je     1151 <e_gcd+0x51>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <e_gcd+0x2d>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_gcd>:
mov    %esi,%edx
cmp    %edi,%esi
mov    %edi,%eax
cmovg  %esi,%eax
cmovg  %edi,%edx
nopl   0x0(%rax)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <e_gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @e_gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
%5 = select i1 %3, i32 %0, i32 %1
br label %6
6: ; preds = %6, %2
%7 = phi i32 [ %4, %2 ], [ %8, %6 ]
%8 = phi i32 [ %5, %2 ], [ %9, %6 ]
%9 = srem i32 %7, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6
ret i32 %8
}
int compare_int(void *a, void *b) {
  int *a_int = (int *)a;
  int *b_int = (int *)b;
  return (*a_int) == (*b_int);
}


x86 assembly (clang, -O0):
<compare_int>:
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
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @compare_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp eq i32 %12, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *CopyStr(char *dest, const char *src, size_t size) {
  strncpy(dest, src, size);
  dest[size - 1] = 0;
  return dest;
}


x86 assembly (clang, -O0):
<CopyStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyStr>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @CopyStr(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = sub i64 %12, 1
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @CopyStr(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret i8* %0
}
int client_api_val() { return 7; }


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

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

LLVM IR (-O0):
define i32 @client_api_val() {
ret i32 7
}

LLVM IR (-O2):
define i32 @client_api_val() {
ret i32 7
}
void swap(int cards[], int i, int j) {
  int tmp;
  tmp = cards[i];
  cards[i] = cards[j];
  cards[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int test_imm_FCuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xFC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FCuint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0xfc,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_FCuint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 252
%7 = icmp ne i64 %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_FCuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1082331758592
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int32_t WriteUint16Be(uint16_t value, void *out) {
  assert(out != NULL);
  uint8_t *buf = (uint8_t *)out;
  buf[0] = (uint8_t)(value >> 8);
  buf[1] = (uint8_t)(value >> 0);
  return 2;
}


x86 assembly (clang, -O0):
<WriteUint16Be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    $0x2,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteUint16Be>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1030 <assert@plt>
movslq %ebp,%rax
sar    $0x8,%ebp
movslq %ebp,%rcx
mov    %rcx,(%rbx)
mov    %rax,0x8(%rbx)
mov    $0x2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @WriteUint16Be(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
store i64* %11, i64** %5
%12 = load i32, i32* %3
%13 = ashr i32 %12, 8
%14 = sext i32 %13 to i64
%15 = load i64*, i64** %5
%16 = getelementptr inbounds i64, i64* %15, i64 0
store i64 %14, i64* %16
%17 = load i32, i32* %3
%18 = ashr i32 %17, 0
%19 = sext i32 %18 to i64
%20 = load i64*, i64** %5
%21 = getelementptr inbounds i64, i64* %20, i64 1
store i64 %19, i64* %21
ret i32 2
}

LLVM IR (-O2):
define i32 @WriteUint16Be(i32 %0, i8* writeonly %1) {
%3 = icmp ne i8* %1, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = bitcast i8* %1 to i64*
%7 = ashr i32 %0, 8
%8 = sext i32 %7 to i64
store i64 %8, i64* %6
%9 = sext i32 %0 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 8
%11 = bitcast i8* %10 to i64*
store i64 %9, i64* %11
ret i32 2
}
/* Variables and functions */
int strcmp(char *, char *);
int cmpString(void *a, void *b) { return strcmp((char *)a, (char *)b); }


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

x86 assembly (clang, -O2):
<cmpString>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmpString(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
unsigned int f02(unsigned int);
unsigned int f03(unsigned int a) { return f02(f02(a)); }


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

x86 assembly (clang, -O2):
<f03>:
push   %rax
call   1030 <f02@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <f02@plt>

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

LLVM IR (-O2):
define i32 @f03(i32 %0) {
%2 = tail call i32 @f02(i32 %0)
%3 = tail call i32 @f02(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void term_reset_cursor(void) { fprintf(stdout, "\033[?25h"); }


x86 assembly (clang, -O0):
<term_reset_cursor>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_reset_cursor>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"\1B[?25h\00"
define void @term_reset_cursor() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"\1B[?25h\00"
define void @term_reset_cursor() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
int zcache_debugfs_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @zcache_debugfs_init() {
ret i32 0
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_wget_wstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_wget_wstr>:
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_wget_wstr+0x2a>
jmp    1170 <cmd_wget_wstr+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_wget_wstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_wget_wstr+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_wget_wstr(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_wget_wstr(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
}
unsigned xrop3_31_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D | S;
  stk1 = T & stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_31_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_31_0_0>:
shl    $0x8,%edi
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
lea    0xff(%rdi),%eax
and    %ecx,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_31_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %4, 255
%8 = and i32 %6, %7
%9 = xor i32 %8, -1
ret i32 %9
}
void gdk_screen_get_monitor_at_window() {}


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

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

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

LLVM IR (-O2):
define void @gdk_screen_get_monitor_at_window() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void parseRemote(char *arg) { printf("Remote is : %s\n", arg); }


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

x86 assembly (clang, -O2):
<parseRemote>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"Remote is : %s\0A\00"
define void @parseRemote(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void send_addr(unsigned addr) {
  (*(volatile unsigned char *)0x4E00000C) = addr;
}


x86 assembly (clang, -O0):
<send_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0x4e00000c,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_addr>:
mov    %dil,0x4e00000c
4e
ret

LLVM IR (-O0):
define void @send_addr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
store volatile i8 %4, i8* inttoptr (i64 1308622860 to i8*)
ret void
}

LLVM IR (-O2):
define void @send_addr(i32 %0) {
%2 = trunc i32 %0 to i8
store volatile i8 %2, i8* inttoptr (i64 1308622860 to i8*)
ret void
}
/* Variables and functions */
scalar_t__ INT_MAX;
int log(int);
int random();
double gen_pause_exp(int beta) {
  int p = random();
  double f = p / (double)INT_MAX;
  return -1 * beta * log(1 - f);
}


x86 assembly (clang, -O0):
<gen_pause_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
mov    0x2ea7(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsd  0xe9f(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <log@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_pause_exp>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
cvtsi2sd %eax,%xmm0
mov    0x2eb3(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeba(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1040 <log@plt>
imul   %ebx,%eax
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
@INT_MAX = global i64 0
define double @gen_pause_exp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %2
%5 = call i32 (...) @random()
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = load i64, i64* @INT_MAX
%9 = sitofp i64 %8 to double
%10 = fdiv double %7, %9
store double %10, double* %4
%11 = load i32, i32* %2
%12 = mul nsw i32 -1, %11
%13 = load double, double* %4
%14 = fsub double 1.000000e+00, %13
%15 = fptosi double %14 to i32
%16 = call i32 @log(i32 %15)
%17 = mul nsw i32 %12, %16
%18 = sitofp i32 %17 to double
ret double %18
}

LLVM IR (-O2):
@INT_MAX = global i64 0
define double @gen_pause_exp(i32 %0) {
%2 = tail call i32 (...) @random()
%3 = sitofp i32 %2 to double
%4 = load i64, i64* @INT_MAX
%5 = sitofp i64 %4 to double
%6 = fdiv double %3, %5
%7 = fsub double 1.000000e+00, %6
%8 = fptosi double %7 to i32
%9 = tail call i32 @log(i32 %8)
%10 = mul i32 %9, %0
%11 = sub i32 0, %10
%12 = sitofp i32 %11 to double
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ func_no_leaf();
void func3(void) {
  int a = 0;
  func_no_leaf();
}


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

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

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

LLVM IR (-O2):
define void @func3() {
%1 = tail call i32 (...) @func_no_leaf()
ret void
}
/* Variables and functions */
void *fl_ifopen(char const *, char const *, int);
void *fl_fopen(const char *path, const char *mode) {
  return fl_ifopen(path, mode, 1);
}


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

x86 assembly (clang, -O2):
<fl_fopen>:
mov    $0x1,%edx
jmp    1030 <fl_ifopen@plt>

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

LLVM IR (-O2):
define i8* @fl_fopen(i8* %0, i8* %1) {
%3 = tail call i8* @fl_ifopen(i8* %0, i8* %1, i32 1)
ret i8* %3
}
/* Variables and functions */
void TCASM_strcat(char *to, size_t *size, int from) {
  to[(*size)++] = (char)from;
  to[*size] = '\0';
}


x86 assembly (clang, -O0):
<TCASM_strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rsi
mov    (%rsi),%rcx
mov    %rcx,%rdi
add    $0x1,%rdi
mov    %rdi,(%rsi)
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TCASM_strcat>:
mov    (%rsi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rsi)
mov    %dl,(%rdi,%rax,1)
mov    (%rsi),%rax
movb   $0x0,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @TCASM_strcat(i8* %0, i64* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i32
store i8* %0, i8** %4
store i64* %1, i64** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %4
%10 = load i64*, i64** %5
%11 = load i64, i64* %10
%12 = add i64 %11, 1
store i64 %12, i64* %10
%13 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 %8, i8* %13
%14 = load i8*, i8** %4
%15 = load i64*, i64** %5
%16 = load i64, i64* %15
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 0, i8* %17
ret void
}

LLVM IR (-O2):
define void @TCASM_strcat(i8* nocapture writeonly %0, i64* nocapture %1, i32 %2) {
%4 = trunc i32 %2 to i8
%5 = load i64, i64* %1
%6 = add i64 %5, 1
store i64 %6, i64* %1
%7 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %4, i8* %7
%8 = load i64, i64* %1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 0, i8* %9
ret void
}
void trigger_analog_monitor(void) {}


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

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

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

LLVM IR (-O2):
define void @trigger_analog_monitor() {
ret void
}
void spin_lock(struct spinlock *s) {}


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

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

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

LLVM IR (-O2):
%struct.spinlock = type opaque
define void @spin_lock(%struct.spinlock* nocapture %0) {
ret void
}
/* Variables and functions */
double log10(double);
double approxlog2(double x) { return 3.32192809488736234787 * log10(x); }


x86 assembly (clang, -O0):
<approxlog2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<approxlog2>:
push   %rax
call   1030 <log10@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @approxlog2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log10(double %3)
%5 = fmul double 0x400A934F0979A371, %4
ret double %5
}

LLVM IR (-O2):
define double @approxlog2(double %0) {
%2 = tail call double @log10(double %0)
%3 = fmul double %2, 0x400A934F0979A371
ret double %3
}
/* Type definitions */
typedef scalar_t__ uint_least8_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_EQUALS_uint_least8_t(uint_least8_t const k1,
                                            uint_least8_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_EQUALS_uint_least8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_EQUALS_uint_least8_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_EQUALS_uint_least8_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_EQUALS_uint_least8_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *sys_fopen(const char *path, const char *mode) {
  return fopen(path, mode);
}


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

x86 assembly (clang, -O2):
<sys_fopen>:
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
define noalias i32* @sys_fopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
/* Type definitions */
struct aRex {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ constructorARex(struct aRex *);
void destructorARex(struct aRex *obj) { constructorARex(obj); }


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

x86 assembly (clang, -O2):
<destructorARex>:
jmp    1030 <constructorARex@plt>

LLVM IR (-O0):
%struct.aRex = type { i32 }
define void @destructorARex(%struct.aRex* %0) {
%2 = alloca %struct.aRex*
store %struct.aRex* %0, %struct.aRex** %2
%3 = load %struct.aRex*, %struct.aRex** %2
%4 = call i32 @constructorARex(%struct.aRex* %3)
ret void
}

LLVM IR (-O2):
%struct.aRex = type { i32 }
define void @destructorARex(%struct.aRex* %0) {
%2 = tail call i32 @constructorARex(%struct.aRex* %0)
ret void
}
unsigned int length(unsigned char *array) {
  unsigned int count = 0;
  while (array[count])
    count++;
  return count;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     112e <length+0x2e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi,%rax,1)
jne    1110 <length+0x10>
ret

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

LLVM IR (-O2):
define i32 @length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
unsigned int hash_ptrhash(void *x) {
  union {
    void *ptr;
    unsigned int ui;
  } v;
  v.ui = 0;
  v.ptr = x;
  return v.ui;
}


x86 assembly (clang, -O0):
<hash_ptrhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i8* }
define i32 @hash_ptrhash(i8* %0) {
%2 = alloca i8*
%3 = alloca %union.anon
store i8* %0, i8** %2
%4 = bitcast %union.anon* %3 to i32*
store i32 0, i32* %4
%5 = load i8*, i8** %2
%6 = bitcast %union.anon* %3 to i8**
store i8* %5, i8** %6
%7 = bitcast %union.anon* %3 to i32*
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @hash_ptrhash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
char *NodeType_metaClassName(void *const this) { return "NodeType"; }


x86 assembly (clang, -O0):
<NodeType_metaClassName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"NodeType\00"
define i8* @NodeType_metaClassName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"NodeType\00"
define i8* @NodeType_metaClassName(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <gcd+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <gcd+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ startsWithWord(char *, char *);
int stepTypeLine(char *line) {
  return (startsWithWord("variableStep", line) ||
          startsWithWord("fixedStep", line));
}


x86 assembly (clang, -O0):
<stepTypeLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <startsWithWord@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1158 <stepTypeLine+0x48>
mov    -0x8(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1030 <startsWithWord@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):
<stepTypeLine>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <startsWithWord@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1132 <stepTypeLine+0x22>
pop    %rbx
ret
lea    0xed4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <startsWithWord@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"variableStep\00"
@.str.1 = [10 x i8] c"fixedStep\00"
define i32 @stepTypeLine(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @startsWithWord(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @startsWithWord(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %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):
@.str = [13 x i8] c"variableStep\00"
@.str.1 = [10 x i8] c"fixedStep\00"
define i32 @stepTypeLine(i8* %0) {
%2 = tail call i64 @startsWithWord(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @startsWithWord(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %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
}