xunge/DecIR huggingface dataset:
int compare_y_asc(const void *p1, const void *p2) {
  double y1 = *(*(double **)p1 + 1);
  double y2 = *(*(double **)p2 + 1);
  if (y1 != y2)
    return (y1 < y2) ? -1 : 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare_y_asc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    1149 <compare_y_asc+0x49>
jp     1149 <compare_y_asc+0x49>
jmp    116c <compare_y_asc+0x6c>
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
mov    $0x1,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <compare_y_asc+0x73>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_y_asc>:
mov    (%rdi),%rax
movsd  0x8(%rax),%xmm0
mov    (%rsi),%rax
movsd  0x8(%rax),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
setbe  %cl
xor    %eax,%eax
ucomisd %xmm1,%xmm0
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_y_asc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double**
%4 = load double*, double** %3
%5 = getelementptr inbounds double, double* %4, i64 1
%6 = load double, double* %5
%7 = bitcast i8* %1 to double**
%8 = load double*, double** %7
%9 = getelementptr inbounds double, double* %8, i64 1
%10 = load double, double* %9
%11 = fcmp une double %6, %10
%12 = fcmp olt double %6, %10
%13 = select i1 %12, i32 -1, i32 1
%14 = select i1 %11, i32 %13, i32 0
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ doStuff_arrayOfConstInt(int const *);
void f_9(void) {
  int a[6];
  int const *ptau = a;
  doStuff_arrayOfConstInt(ptau);
}


x86 assembly (clang, -O0):
<f_9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <doStuff_arrayOfConstInt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_9>:
sub    $0x18,%rsp
mov    %rsp,%rdi
call   1030 <doStuff_arrayOfConstInt@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @f_9() {
%1 = alloca [6 x i32]
%2 = alloca i32*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @doStuff_arrayOfConstInt(i32* %4)
ret void
}

LLVM IR (-O2):
define void @f_9() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @doStuff_arrayOfConstInt(i32* %3)
ret void
}
int searchInsert(int *nums, int numsSize, int target) {
  int i;
  for (i = 0; i < numsSize; ++i) {
    if (nums[i] >= target)
      return i;
  }
  return numsSize;
}


x86 assembly (clang, -O0):
<searchInsert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <searchInsert+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jl     1140 <searchInsert+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <searchInsert+0x59>
jmp    1145 <searchInsert+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <searchInsert+0x15>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<searchInsert>:
mov    %esi,%eax
test   %esi,%esi
jle    111e <searchInsert+0x1e>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edx,(%rdi,%rcx,4)
jge    111f <searchInsert+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <searchInsert+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @searchInsert(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp slt i32 %10, %2
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ %1, %3 ], [ %16, %15 ], [ %1, %12 ]
ret i32 %18
}
double(floor)(double x) { return ((long)x); }


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
cvttsd2si %xmm0,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
ret

LLVM IR (-O0):
define double @floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i64
%5 = sitofp i64 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @floor(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
ret double %3
}
/* Variables and functions */
scalar_t__ has5(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int n;
  for (int i = 1; i < 1429; ++i) {
    n = i * 7;
    if (has5(n))
      printf("%d\n", n);
  }
  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,-0x18(%rbp)
cmpl   $0x595,-0x18(%rbp)
jge    1185 <main+0x65>
imul   $0x7,-0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <has5@plt>
cmp    $0x0,%rax
je     1172 <main+0x52>
mov    -0x14(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
jmp    1177 <main+0x57>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x7,%ebx
lea    0xed0(%rip),%r14
jmp    114b <main+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x7,%ebx
cmp    $0x2713,%ebx
je     1163 <main+0x43>
mov    %ebx,%edi
call   1040 <has5@plt>
test   %rax,%rax
je     1140 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
br label %8
8: ; preds = %21, %2
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 1429
br i1 %10, label %11, label %24
11: ; preds = %8
%12 = load i32, i32* %7
%13 = mul nsw i32 %12, 7
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = call i64 @has5(i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %11
%18 = load i32, i32* %6
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %17, %11
br label %21
21: ; preds = %20
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %8
24: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %4
3: ; preds = %11
ret i32 0
4: ; preds = %2, %11
%5 = phi i32 [ 1, %2 ], [ %12, %11 ]
%6 = mul nuw nsw i32 %5, 7
%7 = tail call i64 @has5(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %11
11: ; preds = %4, %9
%12 = add nuw nsw i32 %5, 1
%13 = icmp eq i32 %12, 1429
br i1 %13, label %3, label %4
}
/* Type definitions */
struct route_stream {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct route_stream *);
void route_stream_done(struct route_stream *stream) { free(stream); }


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

x86 assembly (clang, -O2):
<route_stream_done>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.route_stream = type { i32 }
define void @route_stream_done(%struct.route_stream* nocapture %0) {
%2 = tail call i32 @free(%struct.route_stream* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __exit(int);
void __attribute__((noreturn)) exit(int code) {
  __exit(code);
  while (1)
    ;
}


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

x86 assembly (clang, -O2):
<exit>:
push   %rax
call   1030 <__exit@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1120 <exit+0x10>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__exit(i32 %3)
br label %5
5: ; preds = %1, %5
br label %5
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 @__exit(i32 %0)
br label %3
3: ; preds = %1, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printMenu() {
  printf("Press r to read from device\nPress w to write to device\nPress e to "
         "exit from the device\nPress anything else to keep reading or writing "
         "from the device\nEnter command: ");
}


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

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

LLVM IR (-O0):
@.str = [166 x i8] c"Press r to read from device\0APress w to write to device\0APress e to exit from the device\0APress anything else to keep reading or writing from the device\0AEnter command: \00"
define void @printMenu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [166 x i8] c"Press r to read from device\0APress w to write to device\0APress e to exit from the device\0APress anything else to keep reading or writing from the device\0AEnter command: \00"
define void @printMenu() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0))
ret void
}
int findn(int num) {
  if (num <= 10)
    return 1;
  if (num <= 100)
    return 2;
  if (num <= 1000)
    return 3;
  if (num <= 10000)
    return 4;
  if (num <= 100000)
    return 5;
  if (num <= 1000000)
    return 6;
  return 0;
}


x86 assembly (clang, -O0):
<findn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     111d <findn+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    119e <findn+0x9e>
cmpl   $0x64,-0x8(%rbp)
jg     1133 <findn+0x33>
movl   $0x2,-0x4(%rbp)
jmp    119e <findn+0x9e>
cmpl   $0x3e8,-0x8(%rbp)
jg     114c <findn+0x4c>
movl   $0x3,-0x4(%rbp)
jmp    119e <findn+0x9e>
cmpl   $0x2710,-0x8(%rbp)
jg     1165 <findn+0x65>
movl   $0x4,-0x4(%rbp)
jmp    119e <findn+0x9e>
cmpl   $0x186a0,-0x8(%rbp)
jg     117e <findn+0x7e>
movl   $0x5,-0x4(%rbp)
jmp    119e <findn+0x9e>
cmpl   $0xf4240,-0x8(%rbp)
jg     1197 <findn+0x97>
movl   $0x6,-0x4(%rbp)
jmp    119e <findn+0x9e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findn>:
mov    $0x1,%eax
cmp    $0xb,%edi
jl     114b <findn+0x4b>
mov    $0x2,%eax
cmp    $0x65,%edi
jb     114b <findn+0x4b>
mov    $0x3,%eax
cmp    $0x3e9,%edi
jb     114b <findn+0x4b>
mov    $0x4,%eax
cmp    $0x2711,%edi
jb     114b <findn+0x4b>
mov    $0x5,%eax
cmp    $0x186a1,%edi
jb     114b <findn+0x4b>
xor    %ecx,%ecx
cmp    $0xf4241,%edi
mov    $0x6,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @findn(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %28
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 100
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 2, i32* %2
br label %28
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 1000
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 3, i32* %2
br label %28
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 10000
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 4, i32* %2
br label %28
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp sle i32 %20, 100000
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 5, i32* %2
br label %28
23: ; preds = %19
%24 = load i32, i32* %3
%25 = icmp sle i32 %24, 1000000
br i1 %25, label %26, label %27
26: ; preds = %23
store i32 6, i32* %2
br label %28
27: ; preds = %23
store i32 0, i32* %2
br label %28
28: ; preds = %27, %26, %22, %18, %14, %10, %6
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @findn(i32 %0) {
%2 = icmp slt i32 %0, 11
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 101
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 1001
br i1 %6, label %14, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 10001
br i1 %8, label %14, label %9
9: ; preds = %7
%10 = icmp ult i32 %0, 100001
br i1 %10, label %14, label %11
11: ; preds = %9
%12 = icmp ult i32 %0, 1000001
%13 = select i1 %12, i32 6, i32 0
br label %14
14: ; preds = %11, %9, %7, %5, %3, %1
%15 = phi i32 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ 4, %7 ], [ 5, %9 ], [ %13, %11 ]
ret i32 %15
}
/* Type definitions */
struct timeval {
  double tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double timedouble() {
  struct timeval now;
  gettimeofday(&now, NULL);
  double tm = ((double)now.tv_sec * 1000000.0) + now.tv_usec;
  assert(tm > 0);
  return tm / 1000000.0;
}


x86 assembly (clang, -O0):
<timedouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xeb8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xe85(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timedouble>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
mulsd  0xec1(%rip),%xmm1
addsd  0x8(%rsp),%xmm1
movsd  %xmm1,(%rsp)
xorpd  %xmm0,%xmm0
xor    %edi,%edi
ucomisd %xmm0,%xmm1
seta   %dil
call   1040 <assert@plt>
movsd  (%rsp),%xmm0
divsd  0xe96(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define double @timedouble() {
%1 = alloca %struct.timeval
%2 = alloca double
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load double, double* %7
%9 = call double @llvm.fmuladd.f64(double %6, double 1.000000e+06, double %8)
store double %9, double* %2
%10 = load double, double* %2
%11 = fcmp ogt double %10, 0.000000e+00
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load double, double* %2
%15 = fdiv double %14, 1.000000e+06
ret double %15
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
define double @timedouble() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %6, double 1.000000e+06, double %8)
%10 = fcmp ogt double %9, 0.000000e+00
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = fdiv double %9, 1.000000e+06
ret double %13
}
void fc71(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
  a : {
    typedef int(*d)[n];
    goto a;
    0;
  };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc71>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc71+0x7>

x86 assembly (clang, -O2):
<fc71>:
jmp    1100 <fc71>

LLVM IR (-O0):
define void @fc71(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %1
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
br label %7
10: ; No predecessors!
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc71(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void bot_vector_scale_3d(double v[3], double s) {
  v[0] *= s;
  v[1] *= s;
  v[2] *= s;
}


x86 assembly (clang, -O0):
<bot_vector_scale_3d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_vector_scale_3d>:
movupd (%rdi),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm1,%xmm2
movupd %xmm2,(%rdi)
mulsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @bot_vector_scale_3d(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = fmul double %8, %5
store double %9, double* %7
%10 = load double, double* %4
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = fmul double %13, %10
store double %14, double* %12
%15 = load double, double* %4
%16 = load double*, double** %3
%17 = getelementptr inbounds double, double* %16, i64 2
%18 = load double, double* %17
%19 = fmul double %18, %15
store double %19, double* %17
ret void
}

LLVM IR (-O2):
define void @bot_vector_scale_3d(double* nocapture %0, double %1) {
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = insertelement <2 x double> poison, double %1, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = fmul <2 x double> %4, %6
%8 = bitcast double* %0 to <2 x double>*
store <2 x double> %7, <2 x double>* %8
%9 = getelementptr inbounds double, double* %0, i64 2
%10 = load double, double* %9
%11 = fmul double %10, %1
store double %11, double* %9
ret void
}
long int labs(long int num) { return (num < 0 ? -num : num); }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <labs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
void handle_POLL(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_POLL(i32 %0) {
ret void
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ strcat_s(char *, int, char *);
void get_config_path(char *config_path, int config_path_buffer) {
  config_path[0] = 0x00;
  strcat_s(config_path, config_path_buffer, getenv("HOME"));
  strcat_s(config_path, config_path_buffer, "/.retrophone_config.dat");
}


x86 assembly (clang, -O0):
<get_config_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    0xeb5(%rip),%rdi
call   1030 <getenv@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    %rax,%rdx
call   1040 <strcat_s@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xe98(%rip),%rdx
call   1040 <strcat_s@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_config_path>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
movb   $0x0,(%rdi)
lea    0xece(%rip),%rdi
call   1030 <getenv@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %rax,%rdx
call   1040 <strcat_s@plt>
lea    0xeba(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <strcat_s@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [24 x i8] c"/.retrophone_config.dat\00"
define void @get_config_path(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 0, i8* %6
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @strcat_s(i8* %7, i32 %8, i8* %9)
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = call i32 @strcat_s(i8* %11, i32 %12, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [24 x i8] c"/.retrophone_config.dat\00"
define void @get_config_path(i8* %0, i32 %1) {
store i8 0, i8* %0
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strcat_s(i8* %0, i32 %1, i8* %3)
%5 = tail call i32 @strcat_s(i8* %0, i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M913_f(char *s) {
  debug("M913_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M913_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M913_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M913_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M913_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M913_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M913_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ foo(char);
int main() {
  char c;
  for (c = 0;; c++)
    foo(c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <foo@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1123 <main+0x13>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %bl,%ebx
mov    %ebx,%edi
call   1030 <foo@plt>
add    $0x1,%bl
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %2
br label %3
3: ; preds = %6, %0
%4 = load i8, i8* %2
%5 = call i32 @foo(i8 signext %4)
br label %6
6: ; preds = %3
%7 = load i8, i8* %2
%8 = add i8 %7, 1
store i8 %8, i8* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i8 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @foo(i8 signext %2)
%4 = add i8 %2, 1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void channel_usage(void) {
  fprintf(stderr, "Channel: dir error-probability | awgn standard-deviation | "
                  "awln width\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [71 x i8] c"Channel: dir error-probability | awgn standard-deviation | awln width\0A\00"
define void @channel_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [71 x i8] c"Channel: dir error-probability | awgn standard-deviation | awln width\0A\00"
define void @channel_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dberr_exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vista_msg(char *);
void vista_abort(char *location) {
  fputs(vista_msg(location), stderr);
  fflush(stderr);
  dberr_exit(93);
}


x86 assembly (clang, -O0):
<vista_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <vista_msg@plt>
mov    %eax,%edi
mov    0x2e82(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x5d,%edi
call   1040 <dberr_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vista_abort>:
push   %rbx
call   1060 <vista_msg@plt>
mov    0x2e93(%rip),%rbx
mov    (%rbx),%esi
mov    %eax,%edi
call   1030 <fputs@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    $0x5d,%edi
pop    %rbx
jmp    1040 <dberr_exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @vista_abort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @vista_msg(i8* %3)
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i32 %4, i32 %5)
%7 = load i32, i32* @stderr
%8 = call i32 @fflush(i32 %7)
%9 = call i32 @dberr_exit(i32 93)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @vista_abort(i8* %0) {
%2 = tail call i32 @vista_msg(i8* %0)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i32 %2, i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fflush(i32 %5)
%7 = tail call i32 @dberr_exit(i32 93)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ game_reset();
void retro_reset(void) { game_reset(); }


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

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

LLVM IR (-O0):
define void @retro_reset() {
%1 = call i32 (...) @game_reset()
ret void
}

LLVM IR (-O2):
define void @retro_reset() {
%1 = tail call i32 (...) @game_reset()
ret void
}
void cygwin_premain0(int argc __attribute__((unused)),
                     char **argv __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @cygwin_premain0(i32 %0, i8** nocapture %1) {
ret void
}
int b_sc(int a, signed char *b, int *c) {
  int d = a - *b;
  *c = d == 0;
  return d;
}


x86 assembly (clang, -O0):
<b_sc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_sc>:
mov    %edi,%eax
movsbl (%rsi),%ecx
xor    %esi,%esi
sub    %ecx,%eax
sete   %sil
mov    %esi,(%rdx)
ret

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

LLVM IR (-O2):
define i32 @b_sc(i32 %0, i8* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %0, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %2
ret i32 %6
}
/* Variables and functions */
int htoi_eol(char const *, int /*<<< orphan*/);
int htoi(const char *str) { return htoi_eol(str, 0); }


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

x86 assembly (clang, -O2):
<htoi>:
xor    %esi,%esi
jmp    1030 <htoi_eol@plt>

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

LLVM IR (-O2):
define i32 @htoi(i8* %0) {
%2 = tail call i32 @htoi_eol(i8* %0, i32 0)
ret i32 %2
}
int test_imm_BEint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xBE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BEint64_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, 190
%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_BEint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 816043786240
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ allocateFileStreamTable();
int /*<<< orphan*/ allocateMethodLookupCache();
int /*<<< orphan*/ allocateObjectMemory();
void allocateAll() {
  allocateObjectMemory();
  allocateMethodLookupCache();
  allocateFileStreamTable();
}


x86 assembly (clang, -O0):
<allocateAll>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <allocateObjectMemory@plt>
mov    $0x0,%al
call   1030 <allocateMethodLookupCache@plt>
mov    $0x0,%al
call   1040 <allocateFileStreamTable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocateAll>:
push   %rax
xor    %eax,%eax
call   1050 <allocateObjectMemory@plt>
xor    %eax,%eax
call   1030 <allocateMethodLookupCache@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <allocateFileStreamTable@plt>

LLVM IR (-O0):
define void @allocateAll() {
%1 = call i32 (...) @allocateObjectMemory()
%2 = call i32 (...) @allocateMethodLookupCache()
%3 = call i32 (...) @allocateFileStreamTable()
ret void
}

LLVM IR (-O2):
define void @allocateAll() {
%1 = tail call i32 (...) @allocateObjectMemory()
%2 = tail call i32 (...) @allocateMethodLookupCache()
%3 = tail call i32 (...) @allocateFileStreamTable()
ret void
}
void two_branch() {
  int x;
  if (x) {
    x = 0;
  } else {
    x = 1;
  }
}


x86 assembly (clang, -O0):
<two_branch>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,-0x4(%rbp)
je     111a <two_branch+0x1a>
movl   $0x0,-0x4(%rbp)
jmp    1121 <two_branch+0x21>
movl   $0x1,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @two_branch() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %4
ret void
}

LLVM IR (-O2):
define void @two_branch() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__30__IO__clr();
void Msp430GpioC__4__HplGeneralIO__clr(void) {
  HplMsp430GeneralIOP__30__IO__clr();
}


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

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

LLVM IR (-O0):
define void @Msp430GpioC__4__HplGeneralIO__clr() {
%1 = call i32 (...) @HplMsp430GeneralIOP__30__IO__clr()
ret void
}

LLVM IR (-O2):
define void @Msp430GpioC__4__HplGeneralIO__clr() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__30__IO__clr()
ret void
}
int test_imm_A4uint16_reg(unsigned short val) {
  return ((val) & (-0xA4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A4uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff5c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A4uint16_reg>:
test   $0xff5c,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A4uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -164
%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_A4uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -164
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
bool test_psg() { return true; }


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

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

LLVM IR (-O0):
define i32 @test_psg() {
ret i32 1
}

LLVM IR (-O2):
define i32 @test_psg() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ motor(int, int);
void direct() {
  motor(0, 70);
  motor(1, 70);
}


x86 assembly (clang, -O0):
<direct>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x46,%esi
call   1030 <motor@plt>
mov    $0x1,%edi
mov    $0x46,%esi
call   1030 <motor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<direct>:
push   %rax
xor    %edi,%edi
mov    $0x46,%esi
call   1030 <motor@plt>
mov    $0x1,%edi
mov    $0x46,%esi
pop    %rax
jmp    1030 <motor@plt>

LLVM IR (-O0):
define void @direct() {
%1 = call i32 @motor(i32 0, i32 70)
%2 = call i32 @motor(i32 1, i32 70)
ret void
}

LLVM IR (-O2):
define void @direct() {
%1 = tail call i32 @motor(i32 0, i32 70)
%2 = tail call i32 @motor(i32 1, i32 70)
ret void
}
IR0A1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((*p0) <= (*((int *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0A1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    $0xa98ac7,%ecx
cmp    (%rcx),%eax
jg     1137 <IR0A1+0x37>
movl   $0x1,-0x4(%rbp)
jmp    113e <IR0A1+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0A1>:
mov    (%r8),%ecx
xor    %eax,%eax
cmp    0xa98ac7,%ecx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @IR0A1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = load i32, i32* %4
%8 = load i32, i32* inttoptr (i64 11111111 to i32*)
%9 = icmp sle i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ bad_mem();
void *realloc(void *, unsigned int);
void *xrealloc(void *buf, unsigned int size) {
  void *ret = realloc(buf, size);
  if (ret == NULL)
    bad_mem();
  return ret;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1151 <xrealloc+0x31>
mov    $0x0,%al
call   1030 <bad_mem@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xrealloc+0x15>
xor    %eax,%eax
call   1030 <bad_mem@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xrealloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @realloc(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @bad_mem()
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @xrealloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @bad_mem()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
struct proto_conn {
  int dummy;
};

/* Variables and functions */
int proto_common_setup(int /*<<< orphan*/ *, char const *, struct proto_conn **,
                       int);
int proto_server(const char *addr, struct proto_conn **connp) {
  return (proto_common_setup(NULL, addr, connp, 1));
}


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

x86 assembly (clang, -O2):
<proto_server>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
mov    $0x1,%ecx
jmp    1030 <proto_common_setup@plt>

LLVM IR (-O0):
%struct.proto_conn = type { i32 }
define i32 @proto_server(i8* %0, %struct.proto_conn** %1) {
%3 = alloca i8*
%4 = alloca %struct.proto_conn**
store i8* %0, i8** %3
store %struct.proto_conn** %1, %struct.proto_conn*** %4
%5 = load i8*, i8** %3
%6 = load %struct.proto_conn**, %struct.proto_conn*** %4
%7 = call i32 @proto_common_setup(i32* null, i8* %5, %struct.proto_conn** %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct.proto_conn = type { i32 }
define i32 @proto_server(i8* %0, %struct.proto_conn** %1) {
%3 = tail call i32 @proto_common_setup(i32* null, i8* %0, %struct.proto_conn** %1, i32 1)
ret i32 %3
}
int strlenn(char *s) {
  char *p;
  p = s;
  while (*s++ != '\0')
    ;
  return s - p;
}


x86 assembly (clang, -O0):
<strlenn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1130 <strlenn+0x30>
jmp    1110 <strlenn+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlenn>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlenn+0x10>
ret

LLVM IR (-O0):
define i32 @strlenn(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 = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %5
br label %5
12: ; preds = %5
%13 = load i8*, i8** %2
%14 = load i8*, i8** %3
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @strlenn(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ hal_io_apic_write32(int, int);
void hal_io_broadcast_IPI() {
  hal_io_apic_write32(0x00000310, 0xFF000000);
  hal_io_apic_write32(0x00000300, 0x000C0000 | (0x000000FF & 0x20));
  return;
}


x86 assembly (clang, -O0):
<hal_io_broadcast_IPI>:
push   %rbp
mov    %rsp,%rbp
mov    $0x310,%edi
mov    $0xff000000,%esi
call   1030 <hal_io_apic_write32@plt>
mov    $0x300,%edi
mov    $0xc0020,%esi
call   1030 <hal_io_apic_write32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hal_io_broadcast_IPI>:
push   %rax
mov    $0x310,%edi
mov    $0xff000000,%esi
call   1030 <hal_io_apic_write32@plt>
mov    $0x300,%edi
mov    $0xc0020,%esi
pop    %rax
jmp    1030 <hal_io_apic_write32@plt>

LLVM IR (-O0):
define void @hal_io_broadcast_IPI() {
%1 = call i32 @hal_io_apic_write32(i32 784, i32 -16777216)
%2 = call i32 @hal_io_apic_write32(i32 768, i32 786464)
ret void
}

LLVM IR (-O2):
define void @hal_io_broadcast_IPI() {
%1 = tail call i32 @hal_io_apic_write32(i32 784, i32 -16777216)
%2 = tail call i32 @hal_io_apic_write32(i32 768, i32 786464)
ret void
}