xunge/DecIR huggingface dataset:
int util_dbl_cmp(const void *x, const void *y) {
  if (*(double *)x < *(double *)y) {
    return -1;
  }
  if (*(double *)x > *(double *)y) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<util_dbl_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <util_dbl_cmp+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <util_dbl_cmp+0x5b>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1154 <util_dbl_cmp+0x54>
movl   $0x1,-0x4(%rbp)
jmp    115b <util_dbl_cmp+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_dbl_cmp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @util_dbl_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, float);
void testStruct() {
  struct str {
    float x;
    float y;
  };
  struct str base;
  int index = 0;
  base.x = 10.0;
  struct str *s = &base;
  float *v = &(*s).x;
  float *v2 = &s[index].x;
  printf("testStruct: %g %g %g\n", base.x, *v, *v2);
}


x86 assembly (clang, -O0):
<testStruct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0xc(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
movss  -0x8(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm2
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testStruct>:
lea    0xeed(%rip),%rdi
movss  0xee1(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.str = type { float, float }
@.str = [22 x i8] c"testStruct: %g %g %g\0A\00"
define void @testStruct() {
%1 = alloca %struct.str
%2 = alloca i32
%3 = alloca %struct.str*
%4 = alloca float*
%5 = alloca float*
store i32 0, i32* %2
%6 = getelementptr inbounds %struct.str, %struct.str* %1, i32 0, i32 0
store float 1.000000e+01, float* %6
store %struct.str* %1, %struct.str** %3
%7 = load %struct.str*, %struct.str** %3
%8 = getelementptr inbounds %struct.str, %struct.str* %7, i32 0, i32 0
store float* %8, float** %4
%9 = load %struct.str*, %struct.str** %3
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds %struct.str, %struct.str* %9, i64 %11
%13 = getelementptr inbounds %struct.str, %struct.str* %12, i32 0, i32 0
store float* %13, float** %5
%14 = getelementptr inbounds %struct.str, %struct.str* %1, i32 0, i32 0
%15 = load float, float* %14
%16 = load float*, float** %4
%17 = load float, float* %16
%18 = load float*, float** %5
%19 = load float, float* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float %15, float %17, float %19)
ret void
}

LLVM IR (-O2):
%struct.str = type { float, float }
@.str = [22 x i8] c"testStruct: %g %g %g\0A\00"
define void @testStruct() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float 1.000000e+01, float 1.000000e+01, float 1.000000e+01)
ret void
}
__attribute__((no)) long trampoline_mmap(unsigned long n1, unsigned long n2,
                                         int n3, int n4, int n5, long n6) {
  long ret;
  register int r8 __asm__("r8") = n5;
  register long r9 __asm__("r9") = n6;
  __asm__ __volatile__("leaq 1f(%%rip), %%r11\n\t"
                       "movq %%r11, %%fs:0x20\n\t"
                       "jmpq *%%gs:0x10000+"
                       "0"
                       "\n\t"
                       "1:\n\t"
                       : "=a"(ret)
                       : "D"(n1), "S"(n2), "d"(n3), "c"(n4), "r"(r8), "r"(r9)
                       : "memory");
  return ret;
}


x86 assembly (clang, -O0):
<trampoline_mmap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x34(%rbp),%r8d
mov    -0x40(%rbp),%r9
lea    0x11(%rip),%r11
mov    %r11,%fs:0x20
jmp    *%gs:0x10000
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trampoline_mmap>:
lea    0x11(%rip),%r11
mov    %r11,%fs:0x20
jmp    *%gs:0x10000
ret

LLVM IR (-O0):
define i64 @trampoline_mmap(i64 %0, i64 %1, i32 %2, i32 %3, i32 %4, i64 %5) {
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i64
%13 = alloca i64
%14 = alloca i32
%15 = alloca i64
store i64 %0, i64* %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i64 %5, i64* %12
%16 = load i32, i32* %11
store i32 %16, i32* %14
%17 = load i64, i64* %12
store i64 %17, i64* %15
%18 = load i64, i64* %7
%19 = load i64, i64* %8
%20 = load i32, i32* %9
%21 = load i32, i32* %10
%22 = load i32, i32* %14
%23 = load i64, i64* %15
%24 = call i64 asm sideeffect "leaq 1f(%rip), %r11\0A\09movq %r11, %fs:0x20\0A\09jmpq *%gs:0x10000+0\0A\091:\0A\09", "={ax},{di},{si},{dx},{cx},{r8},{r9},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %18, i64 %19, i32 %20, i32 %21, i32 %22, i64 %23)
store i64 %24, i64* %13
%25 = load i64, i64* %13
ret i64 %25
}

LLVM IR (-O2):
define i64 @trampoline_mmap(i64 %0, i64 %1, i32 %2, i32 %3, i32 %4, i64 %5) {
%7 = tail call i64 asm sideeffect "leaq 1f(%rip), %r11\0A\09movq %r11, %fs:0x20\0A\09jmpq *%gs:0x10000+0\0A\091:\0A\09", "={ax},{di},{si},{dx},{cx},{r8},{r9},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i32 %2, i32 %3, i32 %4, i64 %5)
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int idle_task() {
  int i, ret;
  sleep(5);
  for (i = 0; i < 5; i++)
    sleep(1);
  return (0);
}


x86 assembly (clang, -O0):
<idle_task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
call   1030 <sleep@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    114b <idle_task+0x3b>
mov    $0x1,%edi
call   1030 <sleep@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1129 <idle_task+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idle_task>:
push   %rax
mov    $0x5,%edi
call   1030 <sleep@plt>
mov    $0x1,%edi
call   1030 <sleep@plt>
mov    $0x1,%edi
call   1030 <sleep@plt>
mov    $0x1,%edi
call   1030 <sleep@plt>
mov    $0x1,%edi
call   1030 <sleep@plt>
mov    $0x1,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @idle_task() {
%1 = tail call i32 @sleep(i32 5)
%2 = tail call i32 @sleep(i32 1)
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i32 @sleep(i32 1)
%6 = tail call i32 @sleep(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ display_color_img_aux(int const, int const, int const,
                                         int const, int const);
int /*<<< orphan*/ display_img_wc(int const, int const, int const, int const);
void display_color_img(const int n, const int xp, const int yp, const int color,
                       const int dirty) {
  if (color) {
    display_color_img_aux(n, xp, yp, color, dirty);
  } else {
    display_img_wc(n, xp, yp, dirty);
  }
}


x86 assembly (clang, -O0):
<display_color_img>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     115c <display_color_img+0x3c>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1030 <display_color_img_aux@plt>
jmp    116d <display_color_img+0x4d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <display_img_wc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_color_img>:
test   %ecx,%ecx
je     1129 <display_color_img+0x9>
jmp    1030 <display_color_img_aux@plt>
mov    %r8d,%ecx
jmp    1040 <display_img_wc@plt>

LLVM IR (-O0):
define void @display_color_img(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%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
store i32 %4, i32* %10
%11 = load i32, i32* %9
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %5
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = call i32 @display_color_img_aux(i32 %14, i32 %15, i32 %16, i32 %17, i32 %18)
br label %26
20: ; preds = %5
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = load i32, i32* %10
%25 = call i32 @display_img_wc(i32 %21, i32 %22, i32 %23, i32 %24)
br label %26
26: ; preds = %20, %13
ret void
}

LLVM IR (-O2):
define void @display_color_img(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp eq i32 %3, 0
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @display_color_img_aux(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
br label %11
9: ; preds = %5
%10 = tail call i32 @display_img_wc(i32 %0, i32 %1, i32 %2, i32 %4)
br label %11
11: ; preds = %9, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ touch(char *);
void filecreate(char *path) {
  if (touch(path) < 0) {
    fprintf(stderr, "touch: %s failed to create\n", path);
    return;
  }
}


x86 assembly (clang, -O0):
<filecreate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <touch@plt>
cmp    $0x0,%rax
jge    1158 <filecreate+0x38>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xead(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filecreate>:
push   %rbx
mov    %rdi,%rbx
call   1030 <touch@plt>
test   %rax,%rax
js     1130 <filecreate+0x10>
pop    %rbx
ret
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"touch: %s failed to create\0A\00"
define void @filecreate(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @touch(i8* %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %2
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"touch: %s failed to create\0A\00"
define void @filecreate(i8* %0) {
%2 = tail call i64 @touch(i8* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo2(double);
void foo1(double param1) {
  foo2(param1);
  return;
}


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

x86 assembly (clang, -O2):
<foo1>:
jmp    1030 <foo2@plt>

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

LLVM IR (-O2):
define void @foo1(double %0) {
%2 = tail call i32 @foo2(double %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int thinningIncrement(int);
int main(int argc, char *argv[]) {
  int a = 1;
  printf("Cislo je %i (%i) ", a, thinningIncrement(a));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"Cislo je %i (%i) \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @thinningIncrement(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned int f1(unsigned int x, unsigned int y) {
  unsigned int r = x + y;
  if (r > x)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jbe    113a <f1+0x2a>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rbx
mov    %esi,%ebx
add    %edi,%ebx
cmp    %edi,%ebx
jbe    1120 <f1+0x10>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = icmp ugt i32 %3, %0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
void RTLogCreateEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLogCreateEx() {
ret void
}
int test_imm_CBuint8_reg(unsigned char val) {
  return ((val) & (-0xCB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CBuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff35,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CBuint8_reg>:
test   $0x35,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CBuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 53
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct stat64 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _STAT_VER;
int __fxstat64(int /*<<< orphan*/, int, struct stat64 *);
int fstat64(int fd, struct stat64 *buf) {
  return __fxstat64(_STAT_VER, fd, buf);
}


x86 assembly (clang, -O0):
<fstat64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <__fxstat64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstat64>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <__fxstat64@plt>

LLVM IR (-O0):
%struct.stat64 = type { i32 }
@_STAT_VER = global i32 0
define i32 @fstat64(i32 %0, %struct.stat64* %1) {
%3 = alloca i32
%4 = alloca %struct.stat64*
store i32 %0, i32* %3
store %struct.stat64* %1, %struct.stat64** %4
%5 = load i32, i32* @_STAT_VER
%6 = load i32, i32* %3
%7 = load %struct.stat64*, %struct.stat64** %4
%8 = call i32 @__fxstat64(i32 %5, i32 %6, %struct.stat64* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.stat64 = type { i32 }
@_STAT_VER = global i32 0
define i32 @fstat64(i32 %0, %struct.stat64* %1) {
%3 = load i32, i32* @_STAT_VER
%4 = tail call i32 @__fxstat64(i32 %3, i32 %0, %struct.stat64* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ get_random_bytes(int *, int);
int get_random_int() {
  int i;
  get_random_bytes(&i, sizeof(int));
  return i;
}


x86 assembly (clang, -O0):
<get_random_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1030 <get_random_bytes@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_int>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <get_random_bytes@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_random_int() {
%1 = alloca i32
%2 = call i32 @get_random_bytes(i32* %1, i32 4)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @get_random_int() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @get_random_bytes(i32* %1, i32 4)
%4 = load i32, i32* %1
ret i32 %4
}
void av_format_get_data_codec() {}


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

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

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

LLVM IR (-O2):
define void @av_format_get_data_codec() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fixpt_from_int(int);
int /*<<< orphan*/ fixpt_sub(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ fixpt_to_int(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  assert(fixpt_to_int(fixpt_sub(fixpt_from_int(1), fixpt_from_int(1))) == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1040 <fixpt_from_int@plt>
mov    %eax,-0x14(%rbp)
mov    $0x1,%edi
call   1040 <fixpt_from_int@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <fixpt_sub@plt>
mov    %eax,%edi
call   1060 <fixpt_to_int@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1040 <fixpt_from_int@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1040 <fixpt_from_int@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <fixpt_sub@plt>
mov    %eax,%edi
call   1060 <fixpt_to_int@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rbx
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
%6 = call i32 @fixpt_from_int(i32 1)
%7 = call i32 @fixpt_from_int(i32 1)
%8 = call i32 @fixpt_sub(i32 %6, i32 %7)
%9 = call i64 @fixpt_to_int(i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fixpt_from_int(i32 1)
%4 = tail call i32 @fixpt_from_int(i32 1)
%5 = tail call i32 @fixpt_sub(i32 %3, i32 %4)
%6 = tail call i64 @fixpt_to_int(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lwerror(char *);
void errorIfSRIDMismatch(int srid1, int srid2) {
  if (srid1 != srid2) {
    lwerror("Operation on mixed SRID geometries");
  }
}


x86 assembly (clang, -O0):
<errorIfSRIDMismatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1136 <errorIfSRIDMismatch+0x26>
lea    0xecf(%rip),%rdi
call   1030 <lwerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorIfSRIDMismatch>:
cmp    %esi,%edi
jne    1115 <errorIfSRIDMismatch+0x5>
ret
lea    0xee4(%rip),%rdi
jmp    1030 <lwerror@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Operation on mixed SRID geometries\00"
define void @errorIfSRIDMismatch(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 = icmp ne i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @lwerror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Operation on mixed SRID geometries\00"
define void @errorIfSRIDMismatch(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @lwerror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
ret void
}
double amax1(double arg1, double arg2) {
  double res;
  if (arg1 >= arg2) {
    res = arg1;
  } else {
    res = arg2;
  }
  return res;
}


x86 assembly (clang, -O0):
<amax1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     112d <amax1+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <amax1+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<amax1>:
movapd %xmm1,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @amax1(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Type definitions */
struct useradd_args_info {
  int dummy;
};

/* Variables and functions */
int useradd_cmdline_parser2(int, char **, struct useradd_args_info *,
                            int /*<<< orphan*/, int, int);
int useradd_cmdline_parser(int argc, char **argv,
                           struct useradd_args_info *args_info) {
  return useradd_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<useradd_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <useradd_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<useradd_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <useradd_cmdline_parser2@plt>

LLVM IR (-O0):
%struct.useradd_args_info = type { i32 }
define i32 @useradd_cmdline_parser(i32 %0, i8** %1, %struct.useradd_args_info* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.useradd_args_info*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.useradd_args_info* %2, %struct.useradd_args_info** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load %struct.useradd_args_info*, %struct.useradd_args_info** %6
%10 = call i32 @useradd_cmdline_parser2(i32 %7, i8** %8, %struct.useradd_args_info* %9, i32 0, i32 1, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.useradd_args_info = type { i32 }
define i32 @useradd_cmdline_parser(i32 %0, i8** %1, %struct.useradd_args_info* %2) {
%4 = tail call i32 @useradd_cmdline_parser2(i32 %0, i8** %1, %struct.useradd_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRC8_set(void) { return U_WMRCORENONE_set("U_WMRC8"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRC8\00"
define i8* @U_WMRC8_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRC8\00"
define i8* @U_WMRC8_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ test_aloneBubbleSort();
int main() {
  test_aloneBubbleSort();
  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_aloneBubbleSort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_aloneBubbleSort@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_aloneBubbleSort()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_aloneBubbleSort()
ret i32 0
}
int test_imm_DFint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xDF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_DFint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 223
%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_DFint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14614528
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_metadata_array_destroy_full() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_metadata_array_destroy_full>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_metadata_array_destroy_full>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_metadata_array_destroy_full() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_metadata_array_destroy_full() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
replace(a, v) register char **a;
char *v;
{
  afree(*a);
  *a = make(v);
}


x86 assembly (clang, -O0):
<replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1030 <afree@plt>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <make@plt>
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
xor    %eax,%eax
call   1030 <afree@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <make@plt>
cltq
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @replace(i8** %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
%6 = load i8**, i8*** %4
%7 = load i8*, i8** %6
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @afree to i32 (i8*, ...)*)(i8* %7)
%9 = load i8*, i8** %5
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @make to i32 (i8*, ...)*)(i8* %9)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
%13 = load i8**, i8*** %4
store i8* %12, i8** %13
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @replace(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @afree to i32 (i8*, ...)*)(i8* %3)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @make to i32 (i8*, ...)*)(i8* %1)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %0
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ problem36();
int main(int argc, char **argv) {
  problem36();
  return 1;
}


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)
mov    $0x0,%al
call   1030 <problem36@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <problem36@plt>
mov    $0x1,%eax
pop    %rcx
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
%6 = call i32 (...) @problem36()
ret i32 1
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @problem36()
ret i32 1
}
int qsort_helper(const void *a, const void *b) {
  int *realA = (int *)a;
  int *realB = (int *)b;
  return *realA - *realB;
}


x86 assembly (clang, -O0):
<qsort_helper>:
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
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_helper>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @qsort_helper(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 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @qsort_helper(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 = sub nsw i32 %5, %6
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int hamming_weight(uint32_t data) {
  int i, c = 0;
  for (i = 0; i < 32 && data; i++) {
    c += data & 1;
    data >>= 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<hamming_weight>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jge    112e <hamming_weight+0x2e>
cmpl   $0x0,-0x4(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    113e <hamming_weight+0x3e>
jmp    1161 <hamming_weight+0x61>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <hamming_weight+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hamming_weight>:
xor    %eax,%eax
test   %edi,%edi
je     112c <hamming_weight+0x2c>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %eax,%edx
mov    %edi,%eax
and    $0x1,%eax
add    %edx,%eax
cmp    $0x1e,%ecx
ja     112c <hamming_weight+0x2c>
mov    %edi,%edx
sar    %edx
add    $0x1,%ecx
cmp    $0x1,%edi
mov    %edx,%edi
ja     1110 <hamming_weight+0x10>
ret

LLVM IR (-O0):
define i32 @hamming_weight(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %20, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 32
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
br i1 %12, label %13, label %23
13: ; preds = %11
%14 = load i32, i32* %2
%15 = and i32 %14, 1
%16 = load i32, i32* %4
%17 = add nsw i32 %16, %15
store i32 %17, i32* %4
%18 = load i32, i32* %2
%19 = ashr i32 %18, 1
store i32 %19, i32* %2
br label %20
20: ; preds = %13
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %5
23: ; preds = %11
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @hamming_weight(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %10, %3 ], [ 0, %1 ]
%6 = phi i32 [ %9, %3 ], [ %0, %1 ]
%7 = and i32 %6, 1
%8 = add nuw nsw i32 %4, %7
%9 = ashr i32 %6, 1
%10 = add nuw nsw i32 %5, 1
%11 = icmp ult i32 %5, 31
%12 = icmp ugt i32 %6, 1
%13 = select i1 %11, i1 %12, i1 false
br i1 %13, label %3, label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
char **freea(char **str) {
  char **p = str;
  while (*p != NULL)
    free(*p++);
  free(str);
  return (NULL);
}


x86 assembly (clang, -O0):
<freea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114e <freea+0x3e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rdi
call   1030 <free@plt>
jmp    1124 <freea+0x14>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freea>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <freea+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <freea+0x20>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8** @freea(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %10, %4 ], [ %2, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = bitcast i8* %5 to i8**
%9 = tail call i32 @free(i8** %8)
%10 = load i8*, i8** %7
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 @free(i8** %0)
ret i8** null
}
unsigned xrop3_76_0_1(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 & T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_76_0_1>:
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
and    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_76_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_76_0_1(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* %7
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %6
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = and i32 %30, %31
%33 = load i32, i32* %8
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = or i32 %32, %36
%38 = load i32, i32* %7
%39 = load i32, i32* %6
%40 = xor i32 %39, -1
%41 = and i32 %38, %40
%42 = load i32, i32* %5
%43 = and i32 %41, %42
%44 = or i32 %37, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_76_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = xor i32 %4, %5
ret i32 %6
}
void set_tri_matrix(char matrix[26][26], int i, int j) {
  matrix[i][j] = 1;
  matrix[j][i] = 1;
}


x86 assembly (clang, -O0):
<set_tri_matrix>:
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
imul   $0x1a,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movb   $0x1,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x1a,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movb   $0x1,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_tri_matrix>:
movslq %esi,%rax
movslq %edx,%rcx
lea    (%rax,%rax,4),%rdx
lea    (%rdx,%rdx,4),%rdx
add    %rax,%rdx
add    %rdi,%rdx
movb   $0x1,(%rcx,%rdx,1)
lea    (%rcx,%rcx,4),%rdx
lea    (%rdx,%rdx,4),%rdx
add    %rcx,%rdx
add    %rdi,%rdx
movb   $0x1,(%rax,%rdx,1)
ret

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

LLVM IR (-O2):
define void @set_tri_matrix([26 x i8]* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [26 x i8], [26 x i8]* %0, i64 %4, i64 %5
store i8 1, i8* %6
%7 = getelementptr inbounds [26 x i8], [26 x i8]* %0, i64 %5, i64 %4
store i8 1, i8* %7
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          struct timeval *);
void portable_usleep(uint64_t usec) {
  struct timeval tv;
  tv.tv_sec = usec / 1000000;
  tv.tv_usec = usec % 1000000;
  select(0, NULL, NULL, NULL, &tv);
}


x86 assembly (clang, -O0):
<portable_usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x10(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<portable_usleep>:
push   %rax
movslq %edi,%rax
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
imul   $0xf4240,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @portable_usleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = srem i32 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i32 %8, i32* %9
%10 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %3)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @portable_usleep(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = sdiv i32 %0, 1000000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = srem i32 %0, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i32 %6, i32* %7
%8 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %2)
ret void
}