xunge/DecIR huggingface dataset:
int clamp(int clr, int min, int max) {
  if (clr < min)
    return (min);
  if (clr > max)
    return (max);
  return (clr);
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <clamp+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clamp+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <clamp+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clamp+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
int sq(int arg) { return arg * arg; }


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

x86 assembly (clang, -O2):
<sq>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @sq(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
int compare_value_black(const void *move1, const void *move2) {
  if (((int *)move1)[2] > ((int *)move2)[2]) {
    return -1;
  } else if (((int *)move1)[2] < ((int *)move2)[2]) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<compare_value_black>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    0x8(%rcx),%eax
jle    112c <compare_value_black+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <compare_value_black+0x58>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    0x8(%rcx),%eax
jge    114c <compare_value_black+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1158 <compare_value_black+0x58>
jmp    1151 <compare_value_black+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_value_black>:
mov    0x8(%rdi),%eax
xor    %ecx,%ecx
cmp    0x8(%rsi),%eax
setl   %cl
mov    $0xffffffff,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_value_black(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 i32*
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32, i32* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
%14 = icmp sgt i32 %9, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %29
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = bitcast i8* %17 to i32*
%19 = getelementptr inbounds i32, i32* %18, i64 2
%20 = load i32, i32* %19
%21 = load i8*, i8** %5
%22 = bitcast i8* %21 to i32*
%23 = getelementptr inbounds i32, i32* %22, i64 2
%24 = load i32, i32* %23
%25 = icmp slt i32 %20, %24
br i1 %25, label %26, label %27
26: ; preds = %16
store i32 1, i32* %3
br label %29
27: ; preds = %16
br label %28
28: ; preds = %27
store i32 0, i32* %3
br label %29
29: ; preds = %28, %26, %15
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @compare_value_black(i8* nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 8
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = getelementptr inbounds i8, i8* %1, i64 8
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = icmp sgt i32 %5, %8
%10 = icmp slt i32 %5, %8
%11 = zext i1 %10 to i32
%12 = select i1 %9, i32 -1, i32 %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
char *strip_scene(char *str) {
  memmove(str, str + 6, strlen(str));
  return str;
}


x86 assembly (clang, -O0):
<strip_scene>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
call   1040 <memmove@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_scene>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x6(%rdi),%r14
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <memmove@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strip_scene(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 6
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @memmove(i8* %3, i8* %5, i32 %7)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
define i8* @strip_scene(i8* returned %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 6
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @memmove(i8* %0, i8* %2, i32 %3)
ret i8* %0
}
/* Variables and functions */
int getch();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int c;
  c = getch();
  printf("%d\n", c);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getch()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
float __rtand(float);
float intr_wrap_081(float p1) { return __rtand(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_081>:
jmp    1030 <__rtand@plt>

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

LLVM IR (-O2):
define float @intr_wrap_081(float %0) {
%2 = tail call float @__rtand(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int sancus_drzu(size_t v, size_t a, size_t b) {
  assert((v >= a) && (v <= b));
  return (int)v;
}


x86 assembly (clang, -O0):
<sancus_drzu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jb     1145 <sancus_drzu+0x35>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
setbe  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_drzu>:
push   %rbx
mov    %rdi,%rbx
cmp    %rsi,%rdi
setae  %al
cmp    %rdx,%rdi
setbe  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sancus_drzu(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = icmp uge i64 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i64, i64* %4
%12 = load i64, i64* %6
%13 = icmp ule i64 %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i64, i64* %4
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @sancus_drzu(i64 %0, i64 %1, i64 %2) {
%4 = icmp uge i64 %0, %1
%5 = icmp ule i64 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = trunc i64 %0 to i32
ret i32 %9
}
/* Variables and functions */
int strlen(char const *);
int get_web_path_len(const char *trans_type, const char *server,
                     const char *append) {
  return (strlen(trans_type) + strlen(server) + strlen(append) + 1);
}


x86 assembly (clang, -O0):
<get_web_path_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_web_path_len>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %ebp,%ebx
add    %ebx,%eax
add    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @get_web_path_len(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i32 @strlen(i8* %2)
%7 = add i32 %4, 1
%8 = add i32 %7, %5
%9 = add i32 %8, %6
ret i32 %9
}
double clampf(const double mi, const double l, const double ma) {
  return (l < mi ? mi : (l > ma ? ma : l));
}


x86 assembly (clang, -O0):
<clampf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <clampf+0x36>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1169 <clampf+0x69>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1155 <clampf+0x55>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    115f <clampf+0x5f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampf>:
minsd  %xmm1,%xmm2
cmpltsd %xmm0,%xmm1
andpd  %xmm1,%xmm0
andnpd %xmm2,%xmm1
orpd   %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @clampf(double %0, double %1, double %2) {
%4 = fcmp olt double %1, %0
%5 = fcmp ogt double %1, %2
%6 = select i1 %5, double %2, double %1
%7 = select i1 %4, double %0, double %6
ret double %7
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
bool WatchdogRunning(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(ui32Base + 0x00000008))) & 0x00000001);
}


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

x86 assembly (clang, -O2):
<WatchdogRunning>:
mov    0x8(%rdi),%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @WatchdogRunning(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 1
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @WatchdogRunning(i64 %0) {
%2 = add nsw i64 %0, 8
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = and i32 %5, 1
ret i32 %6
}
void SV_Shutdown(char *finalmsg) {}


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

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

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

LLVM IR (-O2):
define void @SV_Shutdown(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ vl_func();
void nouveau_drm_screen_create(void) {
  printf("VDPAU: screen_create\n");
  vl_func();
}


x86 assembly (clang, -O0):
<nouveau_drm_screen_create>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <vl_func@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nouveau_drm_screen_create>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <vl_func@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"VDPAU: screen_create\0A\00"
define void @nouveau_drm_screen_create() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @vl_func()
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"VDPAU: screen_create\00"
define void @nouveau_drm_screen_create() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @vl_func()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ udp_init();
int /*<<< orphan*/ udp_recv_thread();
int main(int argc, char **argv) {
  udp_init();
  udp_recv_thread();
  return 0;
}


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   1040 <udp_init@plt>
mov    $0x0,%al
call   1030 <udp_recv_thread@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <udp_init@plt>
xor    %eax,%eax
call   1030 <udp_recv_thread@plt>
xor    %eax,%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 (...) @udp_init()
%7 = call i32 (...) @udp_recv_thread()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @udp_init()
%4 = tail call i32 (...) @udp_recv_thread()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ start_stop_trace(int /*<<< orphan*/);
void stop_trace(void) { start_stop_trace('0'); }


x86 assembly (clang, -O0):
<stop_trace>:
push   %rbp
mov    %rsp,%rbp
mov    $0x30,%edi
call   1030 <start_stop_trace@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_trace>:
mov    $0x30,%edi
jmp    1030 <start_stop_trace@plt>

LLVM IR (-O0):
define void @stop_trace() {
%1 = call i32 @start_stop_trace(i32 48)
ret void
}

LLVM IR (-O2):
define void @stop_trace() {
%1 = tail call i32 @start_stop_trace(i32 48)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int mean(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int i, j;
  int answer;
  i = 7;
  j = 9;
  answer = mean(i, j);
  printf("The mean of %d and %d is %d\n", i, j, answer);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
movl   $0x9,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <mean@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
mov    $0x9,%esi
call   1040 <mean@plt>
lea    0xeb9(%rip),%rdi
mov    $0x7,%esi
mov    $0x9,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"The mean of %d and %d is %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 7, i32* %2
store i32 9, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @mean(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
%12 = load i32, i32* @EXIT_SUCCESS
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"The mean of %d and %d is %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @mean(i32 7, i32 9)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 7, i32 9, i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int test_imm_CBint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xCB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CBint64_highword_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, 32
%6 = and i64 %5, 203
%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_CBint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 871878361088
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ dirname;

/* Variables and functions */
scalar_t__ conf_basename(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
const char *conf_dirname(char *fn) {
  static char dirname[128];
  strncpy(dirname, fn, sizeof(dirname));
  *((char *)conf_basename(dirname)) = (char)0;
  return dirname;
}


x86 assembly (clang, -O0):
<conf_dirname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x2f09(%rip),%rdi
mov    $0x80,%edx
call   1030 <strncpy@plt>
lea    0x2ef8(%rip),%rdi
call   1040 <conf_basename@plt>
movb   $0x0,(%rax)
lea    0x2ee9(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conf_dirname>:
push   %rbx
mov    %rdi,%rsi
lea    0x2f15(%rip),%rbx
mov    %rbx,%rdi
mov    $0x80,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rdi
call   1040 <conf_basename@plt>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@conf_dirname.dirname = internal global [128 x i8] zeroinitializer
define i8* @conf_dirname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strncpy(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @conf_dirname.dirname, i64 0, i64 0), i8* %3, i32 128)
%5 = call i64 @conf_basename(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @conf_dirname.dirname, i64 0, i64 0))
%6 = inttoptr i64 %5 to i8*
store i8 0, i8* %6
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @conf_dirname.dirname, i64 0, i64 0)
}

LLVM IR (-O2):
@conf_dirname.dirname = internal global [128 x i8] zeroinitializer
define i8* @conf_dirname(i8* %0) {
%2 = tail call i32 @strncpy(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @conf_dirname.dirname, i64 0, i64 0), i8* %0, i32 128)
%3 = tail call i64 @conf_basename(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @conf_dirname.dirname, i64 0, i64 0))
%4 = inttoptr i64 %3 to i8*
store i8 0, i8* %4
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @conf_dirname.dirname, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ ofp_fatal(int /*<<< orphan*/, char *);
void out_of_memory(void) { ofp_fatal(0, "virtual memory exhausted"); }


x86 assembly (clang, -O0):
<out_of_memory>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
call   1030 <ofp_fatal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_of_memory>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
jmp    1030 <ofp_fatal@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"virtual memory exhausted\00"
define void @out_of_memory() {
%1 = call i32 @ofp_fatal(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define void @out_of_memory() {
%1 = tail call i32 @ofp_fatal(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MAP_SHARED;
int PROT_READ;
int PROT_WRITE;
void *mmap(int /*<<< orphan*/, int, int, int /*<<< orphan*/, int, int);
void *msvd_map_intmem(int fd) {
  return mmap(0, (256 * 1024), PROT_READ | PROT_WRITE, MAP_SHARED, fd,
              0x10000000);
}


x86 assembly (clang, -O0):
<msvd_map_intmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%edx
mov    0x2ea5(%rip),%rax
or     (%rax),%edx
mov    0x2eb4(%rip),%rax
mov    (%rax),%ecx
mov    -0x4(%rbp),%r8d
xor    %edi,%edi
mov    $0x40000,%esi
mov    $0x10000000,%r9d
call   1030 <mmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msvd_map_intmem>:
mov    %edi,%r8d
mov    0x2ede(%rip),%rax
mov    0x2eaf(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2ebc(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    $0x40000,%esi
mov    $0x10000000,%r9d
jmp    1030 <mmap@plt>

LLVM IR (-O0):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
define i8* @msvd_map_intmem(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @PROT_READ
%4 = load i32, i32* @PROT_WRITE
%5 = or i32 %3, %4
%6 = load i32, i32* @MAP_SHARED
%7 = load i32, i32* %2
%8 = call i8* @mmap(i32 0, i32 262144, i32 %5, i32 %6, i32 %7, i32 268435456)
ret i8* %8
}

LLVM IR (-O2):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
define i8* @msvd_map_intmem(i32 %0) {
%2 = load i32, i32* @PROT_READ
%3 = load i32, i32* @PROT_WRITE
%4 = or i32 %3, %2
%5 = load i32, i32* @MAP_SHARED
%6 = tail call i8* @mmap(i32 0, i32 262144, i32 %4, i32 %5, i32 %0, i32 268435456)
ret i8* %6
}
int main(void) {
  char *p;
  p = "hello"
      " is better than bye";
  return *p;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"hello is better than bye\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 104
}
int _falwcDefaultDrawString() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_falwcDefaultDrawString() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ childinfo_sync();
void sigusr1(int num) { childinfo_sync(); }


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

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

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

LLVM IR (-O2):
define void @sigusr1(i32 %0) {
%2 = tail call i32 (...) @childinfo_sync()
ret void
}
void null_func(void *a) { ; }


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

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

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

LLVM IR (-O2):
define void @null_func(i8* nocapture %0) {
ret void
}
/* Variables and functions */
float *stbir__get_ring_buffer_entry(float *, int, int);
float *stbir__get_ring_buffer_scanline(int get_scanline, float *ring_buffer,
                                       int begin_index, int first_scanline,
                                       int ring_buffer_num_entries,
                                       int ring_buffer_length) {
  int ring_buffer_index =
      (begin_index + (get_scanline - first_scanline)) % ring_buffer_num_entries;
  return stbir__get_ring_buffer_entry(ring_buffer, ring_buffer_index,
                                      ring_buffer_length);
}


x86 assembly (clang, -O0):
<stbir__get_ring_buffer_scanline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x18(%rbp),%ecx
add    %ecx,%eax
cltd
idivl  -0x1c(%rbp)
mov    %edx,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1030 <stbir__get_ring_buffer_entry@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbir__get_ring_buffer_scanline>:
lea    (%rdi,%rdx,1),%eax
sub    %ecx,%eax
cltd
idiv   %r8d
mov    %rsi,%rdi
mov    %edx,%esi
mov    %r9d,%edx
jmp    1030 <stbir__get_ring_buffer_entry@plt>

LLVM IR (-O0):
define float* @stbir__get_ring_buffer_scanline(i32 %0, float* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca float*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %7
store float* %1, float** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%14 = load i32, i32* %9
%15 = load i32, i32* %7
%16 = load i32, i32* %10
%17 = sub nsw i32 %15, %16
%18 = add nsw i32 %14, %17
%19 = load i32, i32* %11
%20 = srem i32 %18, %19
store i32 %20, i32* %13
%21 = load float*, float** %8
%22 = load i32, i32* %13
%23 = load i32, i32* %12
%24 = call float* @stbir__get_ring_buffer_entry(float* %21, i32 %22, i32 %23)
ret float* %24
}

LLVM IR (-O2):
define float* @stbir__get_ring_buffer_scanline(i32 %0, float* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = add i32 %2, %0
%8 = sub i32 %7, %3
%9 = srem i32 %8, %4
%10 = tail call float* @stbir__get_ring_buffer_entry(float* %1, i32 %9, i32 %5)
ret float* %10
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
int main() {
  foo();
  foo();
  foo();
  bar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x0,%al
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @foo()
%2 = call i32 (...) @foo()
%3 = call i32 (...) @foo()
%4 = call i32 (...) @bar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @bar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void geo_rd_init(const char *fname) {
  fatal("geo"
        ": This build excluded GEO support because expat was not installed.\n");
}


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

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

LLVM IR (-O0):
@.str = [71 x i8] c"geo: This build excluded GEO support because expat was not installed.\0A\00"
define void @geo_rd_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @fatal(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"geo: This build excluded GEO support because expat was not installed.\0A\00"
define void @geo_rd_init(i8* nocapture readnone %0) {
%2 = tail call i32 @fatal(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hello world! 3333333\n"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Hello world! 3333333\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"Hello world! 3333333\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ psense_dowork();
int /*<<< orphan*/ timer_dowork();
void timer_isr(void) {
  psense_dowork();
  timer_dowork();
}


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

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

LLVM IR (-O0):
define void @timer_isr() {
%1 = call i32 (...) @psense_dowork()
%2 = call i32 (...) @timer_dowork()
ret void
}

LLVM IR (-O2):
define void @timer_isr() {
%1 = tail call i32 (...) @psense_dowork()
%2 = tail call i32 (...) @timer_dowork()
ret void
}
int testFloatEquality(double number1, double number2, double accuracy) {
  if ((number1 > (number2 - accuracy)) && (number1 < (number2 + accuracy)))
    return 1;
  else
    return 0;
  return 0;
}


x86 assembly (clang, -O0):
<testFloatEquality>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    1151 <testFloatEquality+0x51>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1151 <testFloatEquality+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1158 <testFloatEquality+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFloatEquality>:
movapd %xmm1,%xmm3
subsd  %xmm2,%xmm3
ucomisd %xmm3,%xmm0
seta   %al
addsd  %xmm2,%xmm1
ucomisd %xmm0,%xmm1
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @testFloatEquality(double %0, double %1, double %2) {
%4 = fsub double %1, %2
%5 = fcmp olt double %4, %0
%6 = fadd double %1, %2
%7 = fcmp ogt double %6, %0
%8 = and i1 %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int uint64_t;
typedef int original;

/* Variables and functions */
uint64_t byte_swap8(uint64_t original) {
  uint64_t swapped;
  swapped = (((original)&0xff00ff00ff00ff00ULL) >> 8) |
            (((original)&0x00ff00ff00ff00ffULL) << 8);
  swapped = ((swapped & 0xffff0000ffff0000ULL) >> 16) |
            ((swapped & 0x0000ffff0000ffffULL) << 16);
  swapped = ((swapped & 0xffffffff00000000ULL) >> 32) |
            ((swapped & 0x00000000ffffffffULL) << 32);
  return swapped;
}


x86 assembly (clang, -O0):
<byte_swap8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xff00ff00ff00ff00,%rcx
and    %rcx,%rax
shr    $0x8,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff00ff00ff00ff,%rdx
and    %rdx,%rcx
shl    $0x8,%rcx
or     %rcx,%rax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movabs $0xffff0000ffff0000,%rcx
and    %rcx,%rax
shr    $0x10,%rax
movslq -0x8(%rbp),%rcx
movabs $0xffff0000ffff,%rdx
and    %rdx,%rcx
shl    $0x10,%rcx
or     %rcx,%rax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movabs $0xffffffff00000000,%rcx
ff ff ff
and    %rcx,%rax
shr    $0x20,%rax
movslq -0x8(%rbp),%rcx
movabs $0xffffffff,%rdx
and    %rdx,%rcx
shl    $0x20,%rcx
or     %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_swap8>:
mov    %edi,%eax
bswap  %rax
sar    $0x20,%rax
shr    $0x20,%rax
ret

LLVM IR (-O0):
define i32 @byte_swap8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = and i64 %5, -71777214294589696
%7 = lshr i64 %6, 8
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = and i64 %9, 71777214294589695
%11 = shl i64 %10, 8
%12 = or i64 %7, %11
%13 = trunc i64 %12 to i32
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = and i64 %15, -281470681808896
%17 = lshr i64 %16, 16
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = and i64 %19, 281470681808895
%21 = shl i64 %20, 16
%22 = or i64 %17, %21
%23 = trunc i64 %22 to i32
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = and i64 %25, -4294967296
%27 = lshr i64 %26, 32
%28 = load i32, i32* %3
%29 = sext i32 %28 to i64
%30 = and i64 %29, 4294967295
%31 = shl i64 %30, 32
%32 = or i64 %27, %31
%33 = trunc i64 %32 to i32
store i32 %33, i32* %3
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @byte_swap8(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i64 @llvm.bswap.i64(i64 %2)
%4 = ashr exact i64 %3, 32
%5 = lshr i64 %4, 32
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ *foo();
int bar() { return (foo() == NULL); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <foo@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bar() {
%1 = call i32* (...) @foo()
%2 = icmp eq i32* %1, null
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32* (...) @foo()
%2 = icmp eq i32* %1, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct yamc_sub_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ yamc_sub_cmd_parser_release(struct yamc_sub_args_info *);
void yamc_sub_cmd_parser_free(struct yamc_sub_args_info *args_info) {
  yamc_sub_cmd_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<yamc_sub_cmd_parser_free>:
jmp    1030 <yamc_sub_cmd_parser_release@plt>

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

LLVM IR (-O2):
%struct.yamc_sub_args_info = type { i32 }
define void @yamc_sub_cmd_parser_free(%struct.yamc_sub_args_info* %0) {
%2 = tail call i32 @yamc_sub_cmd_parser_release(%struct.yamc_sub_args_info* %0)
ret void
}
/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (fork())
    printf("This is parent process.\n");
  else
    printf("This is child process.\n");
  return 0;
}


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   1040 <fork@plt>
cmp    $0x0,%rax
je     1158 <main+0x38>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1164 <main+0x44>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
lea    0xece(%rip),%rax
lea    0xede(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"This is parent process.\0A\00"
@.str.1 = [24 x i8] c"This is child process.\0A\00"
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 i64 (...) @fork()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"This is child process.\00"
@str.2 = [24 x i8] c"This is parent process.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @fork()
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.2, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void fpatan() {
  db(0xD9);
  db(0xF3);
}


x86 assembly (clang, -O0):
<fpatan>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xf3,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpatan>:
push   %rax
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xf3,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @fpatan() {
%1 = call i32 @db(i32 217)
%2 = call i32 @db(i32 243)
ret void
}

LLVM IR (-O2):
define void @fpatan() {
%1 = tail call i32 @db(i32 217)
%2 = tail call i32 @db(i32 243)
ret void
}
void RGBColorMatrix() {}


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

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

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

LLVM IR (-O2):
define void @RGBColorMatrix() {
ret void
}
int do_583() { return 583; }


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

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

LLVM IR (-O0):
define i32 @do_583() {
ret i32 583
}

LLVM IR (-O2):
define i32 @do_583() {
ret i32 583
}
void reglas(int array_ganadores[][2]) {}


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

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

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

LLVM IR (-O2):
define void @reglas([2 x i32]* nocapture %0) {
ret void
}
/* Variables and functions */
double randomDouble(int, int);
void seedArray(double d[], int size, int point, int max) {
  for (int i = 0; i < size; i++)
    d[i] = randomDouble(point, max);
}


x86 assembly (clang, -O0):
<seedArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <seedArray+0x4e>
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <randomDouble@plt>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112c <seedArray+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seedArray>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %esi,%esi
jle    114a <seedArray+0x3a>
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rdi,%r12
mov    %esi,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r15d,%edi
mov    %r14d,%esi
call   1030 <randomDouble@plt>
movsd  %xmm0,(%r12,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <seedArray+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @seedArray(double* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store double* %0, double** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %9
br label %10
10: ; preds = %22, %4
%11 = load i32, i32* %9
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %25
14: ; preds = %10
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = call double @randomDouble(i32 %15, i32 %16)
%18 = load double*, double** %5
%19 = load i32, i32* %9
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %18, i64 %20
store double %17, double* %21
br label %22
22: ; preds = %14
%23 = load i32, i32* %9
%24 = add nsw i32 %23, 1
store i32 %24, i32* %9
br label %10
25: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @seedArray(double* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = zext i32 %1 to i64
br label %9
8: ; preds = %9, %4
ret void
9: ; preds = %6, %9
%10 = phi i64 [ 0, %6 ], [ %13, %9 ]
%11 = tail call double @randomDouble(i32 %2, i32 %3)
%12 = getelementptr inbounds double, double* %0, i64 %10
store double %11, double* %12
%13 = add nuw nsw i64 %10, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %8, label %9
}
int abs_val(int x) { return (x < 0) ? -x : x; }


x86 assembly (clang, -O0):
<abs_val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs_val+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs_val+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_val>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @abs_val(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int emitter_printf_init(void) {
  (void)(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @emitter_printf_init() {
ret i32 0
}