xunge/DecIR huggingface dataset:
int Sample_compare_doubles(const void *a, const void *b) {
  const double *da = (const double *)a;
  const double *db = (const double *)b;
  return (*da > *db) - (*da < *db);
}


x86 assembly (clang, -O0):
<Sample_compare_doubles>:
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
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
movsd  (%rcx),%xmm1
mov    -0x20(%rbp),%rcx
movsd  (%rcx),%xmm0
ucomisd %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sample_compare_doubles>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Sample_compare_doubles(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double*
%6 = alloca double*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to double*
store double* %8, double** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to double*
store double* %10, double** %6
%11 = load double*, double** %5
%12 = load double, double* %11
%13 = load double*, double** %6
%14 = load double, double* %13
%15 = fcmp ogt double %12, %14
%16 = zext i1 %15 to i32
%17 = load double*, double** %5
%18 = load double, double* %17
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = fcmp olt double %18, %20
%22 = zext i1 %21 to i32
%23 = sub nsw i32 %16, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @Sample_compare_doubles(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = zext i1 %7 to i32
%9 = fcmp olt double %5, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ width;
};
struct TYPE_4__ {
  TYPE_1__ max_bounds;
};
typedef TYPE_2__ XFontStruct;

/* Variables and functions */
short get_XFontStruct_max_bounds_width(void *_p) {
  return (short)((XFontStruct *)_p)->max_bounds.width;
}


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

x86 assembly (clang, -O2):
<get_XFontStruct_max_bounds_width>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define signext i16 @get_XFontStruct_max_bounds_width(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i16
ret i16 %8
}

LLVM IR (-O2):
define signext i16 @get_XFontStruct_max_bounds_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ value;
typedef uintptr_t uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htole16(int /*<<< orphan*/);
int /*<<< orphan*/ rgph_murmur32_finalise(int, uintptr_t *);
int /*<<< orphan*/ rgph_murmur32_mix0(int /*<<< orphan*/, uintptr_t *);
void rgph_u32x4_murmur32v_u16(uint16_t value, uintptr_t seed, uint32_t *h) {
  h[0] = h[1] = h[2] = h[3] = seed;
  rgph_murmur32_mix0(htole16(value), h);
  rgph_murmur32_finalise(sizeof(value), h);
}


x86 assembly (clang, -O0):
<rgph_u32x4_murmur32v_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    -0x18(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%edi
call   1040 <htole16@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
call   1050 <rgph_murmur32_mix0@plt>
mov    -0x18(%rbp),%rsi
mov    $0x4,%edi
call   1030 <rgph_murmur32_finalise@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u32x4_murmur32v_u16>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,0x18(%rdx)
mov    %rsi,0x10(%rdx)
mov    %rsi,0x8(%rdx)
mov    %rsi,(%rdx)
call   1040 <htole16@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <rgph_murmur32_mix0@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <rgph_murmur32_finalise@plt>

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

LLVM IR (-O2):
define void @rgph_u32x4_murmur32v_u16(i32 %0, i64 %1, i64* %2) {
%4 = getelementptr inbounds i64, i64* %2, i64 3
store i64 %1, i64* %4
%5 = getelementptr inbounds i64, i64* %2, i64 2
store i64 %1, i64* %5
%6 = getelementptr inbounds i64, i64* %2, i64 1
store i64 %1, i64* %6
store i64 %1, i64* %2
%7 = tail call i32 @htole16(i32 %0)
%8 = tail call i32 @rgph_murmur32_mix0(i32 %7, i64* %2)
%9 = tail call i32 @rgph_murmur32_finalise(i32 4, i64* %2)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ mainMenu();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  srand(time(NULL));
  mainMenu();
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1040 <mainMenu@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1040 <mainMenu@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @time(i32* null)
%7 = call i32 @srand(i32 %6)
%8 = call i32 (...) @mainMenu()
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 (...) @mainMenu()
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ deref_deref();
int /*<<< orphan*/ deref_idx_0();
int /*<<< orphan*/ deref_idx_0_x();
int /*<<< orphan*/ deref_idx_1();
int /*<<< orphan*/ deref_idx_1_x();
int /*<<< orphan*/ deref_idx_2();
int /*<<< orphan*/ deref_idx_2_x();
int /*<<< orphan*/ deref_idx_3();
int /*<<< orphan*/ deref_idx_3_x();
int /*<<< orphan*/ deref_idx_4();
int /*<<< orphan*/ deref_idx_4_x();
int main(void) {
  deref_deref();
  deref_idx_0();
  deref_idx_1();
  deref_idx_2();
  deref_idx_3();
  deref_idx_4();
  deref_idx_4_x();
  deref_idx_3_x();
  deref_idx_2_x();
  deref_idx_1_x();
  deref_idx_0_x();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1090 <deref_deref@plt>
mov    $0x0,%al
call   1060 <deref_idx_0@plt>
mov    $0x0,%al
call   10c0 <deref_idx_1@plt>
mov    $0x0,%al
call   1050 <deref_idx_2@plt>
mov    $0x0,%al
call   10b0 <deref_idx_3@plt>
mov    $0x0,%al
call   1040 <deref_idx_4@plt>
mov    $0x0,%al
call   10d0 <deref_idx_4_x@plt>
mov    $0x0,%al
call   1030 <deref_idx_3_x@plt>
mov    $0x0,%al
call   1080 <deref_idx_2_x@plt>
mov    $0x0,%al
call   10a0 <deref_idx_1_x@plt>
mov    $0x0,%al
call   1070 <deref_idx_0_x@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1090 <deref_deref@plt>
xor    %eax,%eax
call   1060 <deref_idx_0@plt>
xor    %eax,%eax
call   10c0 <deref_idx_1@plt>
xor    %eax,%eax
call   1050 <deref_idx_2@plt>
xor    %eax,%eax
call   10b0 <deref_idx_3@plt>
xor    %eax,%eax
call   1040 <deref_idx_4@plt>
xor    %eax,%eax
call   10d0 <deref_idx_4_x@plt>
xor    %eax,%eax
call   1030 <deref_idx_3_x@plt>
xor    %eax,%eax
call   1080 <deref_idx_2_x@plt>
xor    %eax,%eax
call   10a0 <deref_idx_1_x@plt>
xor    %eax,%eax
call   1070 <deref_idx_0_x@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @deref_deref()
%2 = call i32 (...) @deref_idx_0()
%3 = call i32 (...) @deref_idx_1()
%4 = call i32 (...) @deref_idx_2()
%5 = call i32 (...) @deref_idx_3()
%6 = call i32 (...) @deref_idx_4()
%7 = call i32 (...) @deref_idx_4_x()
%8 = call i32 (...) @deref_idx_3_x()
%9 = call i32 (...) @deref_idx_2_x()
%10 = call i32 (...) @deref_idx_1_x()
%11 = call i32 (...) @deref_idx_0_x()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @deref_deref()
%2 = tail call i32 (...) @deref_idx_0()
%3 = tail call i32 (...) @deref_idx_1()
%4 = tail call i32 (...) @deref_idx_2()
%5 = tail call i32 (...) @deref_idx_3()
%6 = tail call i32 (...) @deref_idx_4()
%7 = tail call i32 (...) @deref_idx_4_x()
%8 = tail call i32 (...) @deref_idx_3_x()
%9 = tail call i32 (...) @deref_idx_2_x()
%10 = tail call i32 (...) @deref_idx_1_x()
%11 = tail call i32 (...) @deref_idx_0_x()
ret i32 0
}
int main(int arfc, char **arfv) { return 0; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
print_string(char str[]) { printf("%s", str); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @print_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
int util_strlen(char *str) {
  int i;
  for (i = 0; str[i] != '\0'; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<util_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <util_strlen+0x37>
jmp    1129 <util_strlen+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <util_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @util_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
struct tokens {
  int dummy;
};

/* Variables and functions */
scalar_t__ strcmp(int /*<<< orphan*/, char *);
scalar_t__ tokens_get_length(struct tokens *);
int /*<<< orphan*/ tokens_get_token(struct tokens *, scalar_t__);
bool detect_background_proce(struct tokens *tokens) {
  if (strcmp(tokens_get_token(tokens, tokens_get_length(tokens) - 1), "&") ==
      0) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<detect_background_proce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <tokens_get_length@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
sub    $0x1,%rsi
call   1030 <tokens_get_token@plt>
mov    %eax,%edi
lea    0xe9a(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1181 <detect_background_proce+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1188 <detect_background_proce+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detect_background_proce>:
push   %rbx
mov    %rdi,%rbx
call   1040 <tokens_get_length@plt>
lea    -0x1(%rax),%rsi
mov    %rbx,%rdi
call   1030 <tokens_get_token@plt>
lea    0xeb4(%rip),%rsi
mov    %eax,%edi
call   1050 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.tokens = type { i32 }
@.str = [2 x i8] c"&\00"
define i32 @detect_background_proce(%struct.tokens* %0) {
%2 = tail call i64 @tokens_get_length(%struct.tokens* %0)
%3 = add nsw i64 %2, -1
%4 = tail call i32 @tokens_get_token(%struct.tokens* %0, i64 %3)
%5 = tail call i64 @strcmp(i32 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
int q2(void) { return 9; }


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

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

LLVM IR (-O0):
define i32 @q2() {
ret i32 9
}

LLVM IR (-O2):
define i32 @q2() {
ret i32 9
}
int edg_valid(int md, int i, int x, const int *hx) {
  int d;
  i *= md;
  d = 0;
  while (hx[i] != x) {
    i++;
    d++;
    if (d >= md)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<edg_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
je     1165 <edg_valid+0x65>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1160 <edg_valid+0x60>
movl   $0x0,-0x4(%rbp)
jmp    116c <edg_valid+0x6c>
jmp    1122 <edg_valid+0x22>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<edg_valid>:
imul   %edi,%esi
movslq %esi,%rsi
cmp    $0x2,%edi
mov    $0x1,%eax
cmovl  %eax,%edi
lea    (%rcx,%rsi,4),%rcx
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
cmp    %edx,(%rcx,%rsi,4)
je     112f <edg_valid+0x2f>
add    $0x1,%rsi
cmp    %esi,%edi
jne    1120 <edg_valid+0x20>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @edg_valid(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = mul nsw i32 %12, %11
store i32 %13, i32* %7
store i32 0, i32* %10
br label %14
14: ; preds = %31, %4
%15 = load i32*, i32** %9
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %8
%21 = icmp ne i32 %19, %20
br i1 %21, label %22, label %32
22: ; preds = %14
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
%25 = load i32, i32* %10
%26 = add nsw i32 %25, 1
store i32 %26, i32* %10
%27 = load i32, i32* %10
%28 = load i32, i32* %6
%29 = icmp sge i32 %27, %28
br i1 %29, label %30, label %31
30: ; preds = %22
store i32 0, i32* %5
br label %33
31: ; preds = %22
br label %14
32: ; preds = %14
store i32 1, i32* %5
br label %33
33: ; preds = %32, %30
%34 = load i32, i32* %5
ret i32 %34
}

LLVM IR (-O2):
define i32 @edg_valid(i32 %0, i32 %1, i32 %2, i32* nocapture %3) {
%5 = mul i32 %1, %0
%6 = sext i32 %5 to i64
%7 = call i32 @llvm.smax.i32(i32 %0, i32 1)
br label %8
8: ; preds = %14, %4
%9 = phi i64 [ %15, %14 ], [ %6, %4 ]
%10 = phi i32 [ %16, %14 ], [ 0, %4 ]
%11 = getelementptr inbounds i32, i32* %3, i64 %9
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %2
br i1 %13, label %18, label %14
14: ; preds = %8
%15 = add nsw i64 %9, 1
%16 = add nuw nsw i32 %10, 1
%17 = icmp eq i32 %16, %7
br i1 %17, label %18, label %8
18: ; preds = %8, %14
%19 = phi i32 [ 0, %14 ], [ 1, %8 ]
ret i32 %19
}
long ipow(long base, long exp) {
  long result;
  result = 1;
  while (exp) {
    if ((exp & 1) == 1)
      result = result * base;
    exp = exp / 2;
    base = base * base;
  }
  return result;
}


x86 assembly (clang, -O0):
<ipow>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1162 <ipow+0x62>
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x1,%rax
jne    113e <ipow+0x3e>
mov    -0x18(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <ipow+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipow>:
test   %rsi,%rsi
je     114b <ipow+0x4b>
mov    $0x1,%r8d
mov    $0x1,%eax
mov    %rsi,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   $0x1,%sil
mov    %rdi,%rcx
cmove  %r8,%rcx
imul   %rcx,%rax
shr    $0x3f,%rdx
add    %rsi,%rdx
sar    %rdx
imul   %rdi,%rdi
add    $0x1,%rsi
cmp    $0x2,%rsi
mov    %rdx,%rsi
ja     1120 <ipow+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i64 @ipow(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %16, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %11, %4 ], [ 1, %2 ]
%6 = phi i64 [ %12, %4 ], [ %1, %2 ]
%7 = phi i64 [ %13, %4 ], [ %0, %2 ]
%8 = and i64 %6, 1
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i64 1, i64 %7
%11 = mul nsw i64 %10, %5
%12 = sdiv i64 %6, 2
%13 = mul nsw i64 %7, %7
%14 = add i64 %6, 1
%15 = icmp ult i64 %14, 3
br i1 %15, label %16, label %4
16: ; preds = %4, %2
%17 = phi i64 [ 1, %2 ], [ %11, %4 ]
ret i64 %17
}
/* Variables and functions */
int /*<<< orphan*/ Ahead();
int /*<<< orphan*/ Then();
int /*<<< orphan*/ swap_forward();
void Else() {
  Ahead();
  swap_forward();
  Then();
}


x86 assembly (clang, -O0):
<Else>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <Ahead@plt>
mov    $0x0,%al
call   1050 <swap_forward@plt>
mov    $0x0,%al
call   1030 <Then@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Else>:
push   %rax
xor    %eax,%eax
call   1040 <Ahead@plt>
xor    %eax,%eax
call   1050 <swap_forward@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <Then@plt>

LLVM IR (-O0):
define void @Else() {
%1 = call i32 (...) @Ahead()
%2 = call i32 (...) @swap_forward()
%3 = call i32 (...) @Then()
ret void
}

LLVM IR (-O2):
define void @Else() {
%1 = tail call i32 (...) @Ahead()
%2 = tail call i32 (...) @swap_forward()
%3 = tail call i32 (...) @Then()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test();
int main() {
  test();
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test()
ret i32 0
}
int base64_len(int len) { return ((len + 2) / 3) * 4; }


x86 assembly (clang, -O0):
<base64_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_len>:
add    $0x2,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
shl    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @base64_len(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
%5 = sdiv i32 %4, 3
%6 = mul nsw i32 %5, 4
ret i32 %6
}

LLVM IR (-O2):
define i32 @base64_len(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = shl nsw i32 %3, 2
ret i32 %4
}
void fb(int *y) {
  char x;
  asm(""
      : "=@cc"
        "b"(x));
  if (!x)
    *y = 0;
}


x86 assembly (clang, -O0):
<fb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
setb   %al
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
jne    1122 <fb+0x22>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb>:
jae    1103 <fb+0x3>
ret
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @fb(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = call i8 asm "", "={@ccb},~{dirflag},~{fpsr},~{flags}"()
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = icmp ne i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = load i32*, i32** %2
store i32 0, i32* %8
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @fb(i32* nocapture writeonly %0) {
%2 = tail call i8 asm "", "={@ccb},~{dirflag},~{fpsr},~{flags}"()
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
store i32 0, i32* %0
br label %5
5: ; preds = %4, %1
ret void
}
double f(double t, double y) { return -y; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movaps %xmm1,%xmm0
xorps  0xef6(%rip),%xmm0
ret

LLVM IR (-O0):
define double @f(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fneg double %5
ret double %6
}

LLVM IR (-O2):
define double @f(double %0, double %1) {
%3 = fneg double %1
ret double %3
}
void codegen_timing_486_block_end() {}


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

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

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

LLVM IR (-O2):
define void @codegen_timing_486_block_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ipod_exit_input();
int /*<<< orphan*/ ipod_exit_sound();
void ipod_exit() {
  ipod_exit_sound();
  ipod_exit_input();
}


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

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

LLVM IR (-O0):
define void @ipod_exit() {
%1 = call i32 (...) @ipod_exit_sound()
%2 = call i32 (...) @ipod_exit_input()
ret void
}

LLVM IR (-O2):
define void @ipod_exit() {
%1 = tail call i32 (...) @ipod_exit_sound()
%2 = tail call i32 (...) @ipod_exit_input()
ret void
}
void exit_thread(struct task_struct *tsk) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @exit_thread(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
double atan(double);
int /*<<< orphan*/ getNumber(double *);
double atangente(double a) {
  getNumber(&a);
  return atan(a);
}


x86 assembly (clang, -O0):
<atangente>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <getNumber@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <atan@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atangente>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1040 <getNumber@plt>
movsd  (%rsp),%xmm0
call   1030 <atan@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define double @atangente(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @getNumber(double* %2)
%4 = load double, double* %2
%5 = call double @atan(double %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ redecl(void *, void *);
void redecl_test(void *p) {
  redecl(p, 0);
  redecl(0, p);
}


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

x86 assembly (clang, -O2):
<redecl_test>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <redecl@plt>
xor    %edi,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <redecl@plt>

LLVM IR (-O0):
define void @redecl_test(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @redecl(i8* %3, i8* null)
%5 = load i8*, i8** %2
%6 = call i32 @redecl(i8* null, i8* %5)
ret void
}

LLVM IR (-O2):
define void @redecl_test(i8* %0) {
%2 = tail call i32 @redecl(i8* %0, i8* null)
%3 = tail call i32 @redecl(i8* null, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int entier = 5;
  int *p1;
  int **p2;
  p1 = &entier;
  p2 = &p1;
  printf("entier : %d\n", entier);
  printf("*p1 : %d\n", *p1);
  printf("**p2 : %d\n", **p2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"entier : %d\0A\00"
@.str.1 = [10 x i8] c"*p1 : %d\0A\00"
@.str.2 = [11 x i8] c"**p2 : %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
store i32* %6, i32** %7
store i32** %7, i32*** %8
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32*, i32** %7
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32**, i32*** %8
%15 = load i32*, i32** %14
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"entier : %d\0A\00"
@.str.1 = [10 x i8] c"*p1 : %d\0A\00"
@.str.2 = [11 x i8] c"**p2 : %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 5)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int compress_none(const unsigned char *old, uint32_t old_size,
                  unsigned char *new, uint32_t new_size) {
  return -1;
}


x86 assembly (clang, -O0):
<compress_none>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compress_none(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @compress_none(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
ret i32 -1
}
void IntSoftwareIntSet(unsigned int intrNum) {
  (*((volatile unsigned int *)((0x48200000) +
                               (0x90 + ((intrNum >> (0x05)) * 0x20))))) =
      (0x01 << (intrNum & (0x1F)));
}


x86 assembly (clang, -O0):
<IntSoftwareIntSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
shr    $0x5,%eax
shl    $0x5,%eax
add    $0x90,%eax
add    $0x48200000,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntSoftwareIntSet>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    $0xffffffe0,%ecx
add    $0x48200090,%ecx
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @IntSoftwareIntSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 31
%5 = shl i32 1, %4
%6 = load i32, i32* %2
%7 = lshr i32 %6, 5
%8 = mul i32 %7, 32
%9 = add i32 144, %8
%10 = add i32 1210056704, %9
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 %5, i32* %12
ret void
}

LLVM IR (-O2):
define void @IntSoftwareIntSet(i32 %0) {
%2 = and i32 %0, 31
%3 = shl nuw i32 1, %2
%4 = and i32 %0, -32
%5 = add i32 %4, 1210056848
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 %3, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void shell_reset(void) {
  printf("\033[?25h");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<shell_reset>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell_reset>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25h\00"
@stdout = global i32 0
define void @shell_reset() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
void gf8mul_01010101(void) {
  __asm__ __volatile__("\tpxor    %xmm7, %xmm0\n"
                       "\tpxor    %xmm6, %xmm7\n"
                       "\tpxor    %xmm6, %xmm3\n"
                       "\tpxor    %xmm6, %xmm2\n"
                       "\tpxor    %xmm6, %xmm1\n"
                       "\tpxor    %xmm6, %xmm0\n"
                       "\tpxor    %xmm5, %xmm7\n"
                       "\tpxor    %xmm5, %xmm6\n"
                       "\tpxor    %xmm5, %xmm3\n"
                       "\tpxor    %xmm4, %xmm6\n"
                       "\tpxor    %xmm4, %xmm5\n"
                       "\tpxor    %xmm4, %xmm2\n"
                       "\tpxor    %xmm3, %xmm5\n"
                       "\tpxor    %xmm3, %xmm4\n"
                       "\tpxor    %xmm3, %xmm1\n"
                       "\tpxor    %xmm2, %xmm4\n"
                       "\tpxor    %xmm2, %xmm3\n"
                       "\tpxor    %xmm2, %xmm0\n"
                       "\tpxor    %xmm1, %xmm7\n"
                       "\tpxor    %xmm1, %xmm5\n"
                       "\tpxor    %xmm1, %xmm3\n"
                       "\tpxor    %xmm0, %xmm6\n"
                       "\tpxor    %xmm0, %xmm4\n"
                       "\tpxor    %xmm0, %xmm2\n");
}


x86 assembly (clang, -O0):
<gf8mul_01010101>:
push   %rbp
mov    %rsp,%rbp
pxor   %xmm7,%xmm0
pxor   %xmm6,%xmm7
pxor   %xmm6,%xmm3
pxor   %xmm6,%xmm2
pxor   %xmm6,%xmm1
pxor   %xmm6,%xmm0
pxor   %xmm5,%xmm7
pxor   %xmm5,%xmm6
pxor   %xmm5,%xmm3
pxor   %xmm4,%xmm6
pxor   %xmm4,%xmm5
pxor   %xmm4,%xmm2
pxor   %xmm3,%xmm5
pxor   %xmm3,%xmm4
pxor   %xmm3,%xmm1
pxor   %xmm2,%xmm4
pxor   %xmm2,%xmm3
pxor   %xmm2,%xmm0
pxor   %xmm1,%xmm7
pxor   %xmm1,%xmm5
pxor   %xmm1,%xmm3
pxor   %xmm0,%xmm6
pxor   %xmm0,%xmm4
pxor   %xmm0,%xmm2
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf8mul_01010101>:
pxor   %xmm7,%xmm0
pxor   %xmm6,%xmm7
pxor   %xmm6,%xmm3
pxor   %xmm6,%xmm2
pxor   %xmm6,%xmm1
pxor   %xmm6,%xmm0
pxor   %xmm5,%xmm7
pxor   %xmm5,%xmm6
pxor   %xmm5,%xmm3
pxor   %xmm4,%xmm6
pxor   %xmm4,%xmm5
pxor   %xmm4,%xmm2
pxor   %xmm3,%xmm5
pxor   %xmm3,%xmm4
pxor   %xmm3,%xmm1
pxor   %xmm2,%xmm4
pxor   %xmm2,%xmm3
pxor   %xmm2,%xmm0
pxor   %xmm1,%xmm7
pxor   %xmm1,%xmm5
pxor   %xmm1,%xmm3
pxor   %xmm0,%xmm6
pxor   %xmm0,%xmm4
pxor   %xmm0,%xmm2
ret

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

LLVM IR (-O2):
define void @gf8mul_01010101() {
tail call void asm sideeffect "\09pxor %xmm7, %xmm0\0A\09pxor %xmm6, %xmm7\0A\09pxor %xmm6, %xmm3\0A\09pxor %xmm6, %xmm2\0A\09pxor %xmm6, %xmm1\0A\09pxor %xmm6, %xmm0\0A\09pxor %xmm5, %xmm7\0A\09pxor %xmm5, %xmm6\0A\09pxor %xmm5, %xmm3\0A\09pxor %xmm4, %xmm6\0A\09pxor %xmm4, %xmm5\0A\09pxor %xmm4, %xmm2\0A\09pxor %xmm3, %xmm5\0A\09pxor %xmm3, %xmm4\0A\09pxor %xmm3, %xmm1\0A\09pxor %xmm2, %xmm4\0A\09pxor %xmm2, %xmm3\0A\09pxor %xmm2, %xmm0\0A\09pxor %xmm1, %xmm7\0A\09pxor %xmm1, %xmm5\0A\09pxor %xmm1, %xmm3\0A\09pxor %xmm0, %xmm6\0A\09pxor %xmm0, %xmm4\0A\09pxor %xmm0, %xmm2\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ GL_POINTS;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glPointSize(float);
int /*<<< orphan*/ glVertex2f(float, float);
void point_display(void) {
  glClear(GL_COLOR_BUFFER_BIT);
  glPointSize(5.0f);
  glBegin(GL_POINTS);
  glVertex2f(0.0f, 0.0f);
  glVertex2f(0.5f, 0.5f);
  glEnd();
  glFlush();
}


x86 assembly (clang, -O0):
<point_display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
movss  0xe8a(%rip),%xmm0
call   1070 <glPointSize@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1080 <glBegin@plt>
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1060 <glVertex2f@plt>
movss  0xe60(%rip),%xmm1
movaps %xmm1,%xmm0
call   1060 <glVertex2f@plt>
mov    $0x0,%al
call   1040 <glEnd@plt>
mov    $0x0,%al
call   1050 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<point_display>:
push   %rax
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
movss  0xe89(%rip),%xmm0
call   1070 <glPointSize@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1080 <glBegin@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   1060 <glVertex2f@plt>
movss  0xe67(%rip),%xmm0
movaps %xmm0,%xmm1
call   1060 <glVertex2f@plt>
xor    %eax,%eax
call   1040 <glEnd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_POINTS = global i32 0
define void @point_display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = call i32 @glPointSize(float 5.000000e+00)
%4 = load i32, i32* @GL_POINTS
%5 = call i32 @glBegin(i32 %4)
%6 = call i32 @glVertex2f(float 0.000000e+00, float 0.000000e+00)
%7 = call i32 @glVertex2f(float 5.000000e-01, float 5.000000e-01)
%8 = call i32 (...) @glEnd()
%9 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_POINTS = global i32 0
define void @point_display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = tail call i32 @glPointSize(float 5.000000e+00)
%4 = load i32, i32* @GL_POINTS
%5 = tail call i32 @glBegin(i32 %4)
%6 = tail call i32 @glVertex2f(float 0.000000e+00, float 0.000000e+00)
%7 = tail call i32 @glVertex2f(float 5.000000e-01, float 5.000000e-01)
%8 = tail call i32 (...) @glEnd()
%9 = tail call i32 (...) @glFlush()
ret void
}
/* Variables and functions */
int skip_directory_part(char *);
char *xstrdup(char *);
char *filename_non_directory(char *name) {
  return xstrdup(name + skip_directory_part(name));
}


x86 assembly (clang, -O0):
<filename_non_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <skip_directory_part@plt>
mov    -0x10(%rbp),%rdi
cltq
add    %rax,%rdi
call   1030 <xstrdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filename_non_directory>:
push   %rbx
mov    %rdi,%rbx
call   1040 <skip_directory_part@plt>
movslq %eax,%rdi
add    %rbx,%rdi
pop    %rbx
jmp    1030 <xstrdup@plt>

LLVM IR (-O0):
define i8* @filename_non_directory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @skip_directory_part(i8* %4)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
%8 = call i8* @xstrdup(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @filename_non_directory(i8* %0) {
%2 = tail call i32 @skip_directory_part(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i8* @xstrdup(i8* %4)
ret i8* %5
}
/* Variables and functions */
float strtof(char const *, char **);
int to_float(const char *str, float *v) {
  char *endptr;
  *v = strtof(str, &endptr);
  return endptr - str == 0 ? -1 : 0;
}


x86 assembly (clang, -O0):
<to_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <strtof@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
sub    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_float>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
call   1030 <strtof@plt>
movss  %xmm0,(%r14)
xor    %eax,%eax
cmp    %rbx,(%rsp)
sete   %al
neg    %eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @to_float(i8* %0, float* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call float @strtof(i8* %0, i8** %3)
store float %5, float* %1
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %0
%8 = sext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
double log(int);
double expinv(double p, double lambda) {
  if (lambda < 0)
    error("Parameter lambda is smaller than 0.");
  return -log(1 - p) / lambda;
}


x86 assembly (clang, -O0):
<expinv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    114c <expinv+0x2c>
lea    0xec1(%rip),%rdi
call   1030 <error@plt>
movsd  0xeac(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expinv>:
sub    $0x18,%rsp
xorpd  %xmm2,%xmm2
movsd  %xmm1,0x10(%rsp)
ucomisd %xmm1,%xmm2
jbe    114c <expinv+0x2c>
lea    0xee5(%rip),%rdi
movsd  %xmm0,0x8(%rsp)
call   1030 <error@plt>
movsd  0x8(%rsp),%xmm0
movsd  0xeac(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1040 <log@plt>
xorpd  0xea7(%rip),%xmm0
divsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Parameter lambda is smaller than 0.\00"
define double @expinv(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = load double, double* %3
%11 = fsub double 1.000000e+00, %10
%12 = fptosi double %11 to i32
%13 = call double @log(i32 %12)
%14 = fneg double %13
%15 = load double, double* %4
%16 = fdiv double %14, %15
ret double %16
}

LLVM IR (-O2):
@.str = [36 x i8] c"Parameter lambda is smaller than 0.\00"
define double @expinv(double %0, double %1) {
%3 = fcmp olt double %1, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = fsub double 1.000000e+00, %0
%8 = fptosi double %7 to i32
%9 = tail call double @log(i32 %8)
%10 = fneg double %9
%11 = fdiv double %10, %1
ret double %11
}
/* Variables and functions */
short int px_get_short_be(const char *cp) {
  short int ret;
  unsigned char *source = (unsigned char *)cp;
  if (NULL == cp)
    return 0;
  ret = ((*source++) << 8);
  ret += *source++;
  return ret;
}


x86 assembly (clang, -O0):
<px_get_short_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1127 <px_get_short_be+0x27>
movw   $0x0,-0x2(%rbp)
jmp    1164 <px_get_short_be+0x64>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movzbl (%rax),%eax
shl    $0x8,%eax
mov    %ax,-0x12(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movzbl (%rax),%ecx
movswl -0x12(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0x12(%rbp)
mov    -0x12(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<px_get_short_be>:
test   %rdi,%rdi
je     110d <px_get_short_be+0xd>
movzwl (%rdi),%eax
rol    $0x8,%ax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i16 @px_get_short_be(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %0
%6 = zext i8 %5 to i16
%7 = shl nuw i16 %6, 8
%8 = load i8, i8* %4
%9 = zext i8 %8 to i16
%10 = or i16 %7, %9
br label %11
11: ; preds = %1, %3
%12 = phi i16 [ %10, %3 ], [ 0, %1 ]
ret i16 %12
}