xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(unsigned short *, int, int, int /*<<< orphan*/ *);
int a3dsReadShort(FILE *f, unsigned short *us) {
  return fread(us, 2, 1, f) == 1;
}


x86 assembly (clang, -O0):
<a3dsReadShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a3dsReadShort>:
push   %rax
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @a3dsReadShort(i32* nocapture %0, i16* nocapture %1) {
%3 = tail call i32 @fread(i16* %1, i32 2, i32 1, i32* %0)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
int indice(int a_value, int a_max, int *a_table) {
  int i = 0;
  while (i < a_max)
    if (a_table[i] == a_value)
      return i;
    else
      i++;
  return i;
}


x86 assembly (clang, -O0):
<indice>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114e <indice+0x4e>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1140 <indice+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <indice+0x54>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <indice+0x15>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indice>:
test   %esi,%esi
jle    1121 <indice+0x21>
mov    %esi,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmp    %edi,(%rdx,%rax,4)
je     1120 <indice+0x20>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <indice+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @indice(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 = %26, %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** %7
%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* %5
%20 = icmp eq 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
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
br label %26
26: ; preds = %23
br label %9
27: ; preds = %9
%28 = load i32, i32* %8
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 @indice(i32 %0, i32 %1, i32* nocapture %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* %2, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %0
br i1 %11, label %15, label %12
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 [ 0, %3 ], [ %16, %15 ], [ %1, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(long *, long *, short);
void matrixCopyL(long *source, short numRows, short numCols,
                 long *destination) {
  memcpy(destination, source, numRows * numCols * sizeof(long));
}


x86 assembly (clang, -O0):
<matrixCopyL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %si,%dx
mov    %rdi,-0x8(%rbp)
mov    %dx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movswl -0xa(%rbp),%eax
movswl -0xc(%rbp),%ecx
imul   %ecx,%eax
cltq
shl    $0x3,%rax
movswl %ax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrixCopyL>:
mov    %rdi,%rax
imul   %edx,%esi
shl    $0x3,%esi
movswl %si,%edx
mov    %rcx,%rdi
mov    %rax,%rsi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @matrixCopyL(i64* %0, i16 signext %1, i16 signext %2, i64* %3) {
%5 = alloca i64*
%6 = alloca i16
%7 = alloca i16
%8 = alloca i64*
store i64* %0, i64** %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i64* %3, i64** %8
%9 = load i64*, i64** %8
%10 = load i64*, i64** %5
%11 = load i16, i16* %6
%12 = sext i16 %11 to i32
%13 = load i16, i16* %7
%14 = sext i16 %13 to i32
%15 = mul nsw i32 %12, %14
%16 = sext i32 %15 to i64
%17 = mul i64 %16, 8
%18 = trunc i64 %17 to i16
%19 = call i32 @memcpy(i64* %9, i64* %10, i16 signext %18)
ret void
}

LLVM IR (-O2):
define void @matrixCopyL(i64* %0, i16 signext %1, i16 signext %2, i64* %3) {
%5 = shl i16 %1, 3
%6 = mul i16 %5, %2
%7 = tail call i32 @memcpy(i64* %3, i64* %0, i16 signext %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b;
  scanf("%d%d", &a, &b);
  printf("%d", a + b);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
void scheduler_show_queue() {}


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

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

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

LLVM IR (-O2):
define void @scheduler_show_queue() {
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_unlink(struct list *);
void list_free(struct list *node) { list_unlink(node); }


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

x86 assembly (clang, -O2):
<list_free>:
jmp    1030 <list_unlink@plt>

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

LLVM IR (-O2):
%struct.list = type { i32 }
define void @list_free(%struct.list* %0) {
%2 = tail call i32 @list_unlink(%struct.list* %0)
ret void
}
int e_x_sys_ini() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @e_x_sys_ini() {
ret i32 0
}
int test2(double px, double py, double m, double b) {
  if (py < m * px + b) {
    return -1;
  } else if (py == m * px + b) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    114a <test2+0x4a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1189 <test2+0x89>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jne    1182 <test2+0x82>
jp     1182 <test2+0x82>
movl   $0x0,-0x4(%rbp)
jmp    1189 <test2+0x89>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
movapd %xmm0,%xmm2
cmpneqsd %xmm1,%xmm2
movq   %xmm2,%rcx
and    $0x1,%ecx
ucomisd %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test2(double %0, double %1, double %2, double %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
%10 = load double, double* %7
%11 = load double, double* %8
%12 = load double, double* %6
%13 = load double, double* %9
%14 = call double @llvm.fmuladd.f64(double %11, double %12, double %13)
%15 = fcmp olt double %10, %14
br i1 %15, label %16, label %17
16: ; preds = %4
store i32 -1, i32* %5
br label %26
17: ; preds = %4
%18 = load double, double* %7
%19 = load double, double* %8
%20 = load double, double* %6
%21 = load double, double* %9
%22 = call double @llvm.fmuladd.f64(double %19, double %20, double %21)
%23 = fcmp oeq double %18, %22
br i1 %23, label %24, label %25
24: ; preds = %17
store i32 0, i32* %5
br label %26
25: ; preds = %17
store i32 1, i32* %5
br label %26
26: ; preds = %25, %24, %16
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
define i32 @test2(double %0, double %1, double %2, double %3) {
%5 = tail call double @llvm.fmuladd.f64(double %2, double %0, double %3)
%6 = fcmp ogt double %5, %1
%7 = fcmp une double %5, %1
%8 = zext i1 %7 to i32
%9 = select i1 %6, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
size_t debinarise(size_t num) {
  return (num == 0 || num == 1 ? num : ((num % 10) + 2 * debinarise(num / 10)));
}


x86 assembly (clang, -O0):
<debinarise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1132 <debinarise+0x22>
cmpq   $0x1,-0x8(%rbp)
jne    113f <debinarise+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1179 <debinarise+0x69>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rdi
call   1030 <debinarise@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
shl    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debinarise>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x1,%rdi
jbe    1145 <debinarise+0x35>
movabs $0xcccccccccccccccd,%rcx
cc cc cc
mov    %rbx,%rax
mul    %rcx
mov    %rdx,%rdi
shr    $0x3,%rdi
lea    (%rdi,%rdi,1),%rax
lea    (%rax,%rax,4),%rax
sub    %rax,%rbx
call   1030 <debinarise@plt>
lea    (%rbx,%rax,2),%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @debinarise(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %5, %1
%9 = load i64, i64* %2
br label %18
10: ; preds = %5
%11 = load i64, i64* %2
%12 = urem i64 %11, 10
%13 = load i64, i64* %2
%14 = udiv i64 %13, 10
%15 = call i64 @debinarise(i64 %14)
%16 = mul i64 2, %15
%17 = add i64 %12, %16
br label %18
18: ; preds = %10, %8
%19 = phi i64 [ %9, %8 ], [ %17, %10 ]
ret i64 %19
}

LLVM IR (-O2):
define i64 @debinarise(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i64 [ %10, %5 ], [ %0, %1 ]
ret i64 %4
5: ; preds = %1
%6 = urem i64 %0, 10
%7 = udiv i64 %0, 10
%8 = tail call i64 @debinarise(i64 %7)
%9 = shl i64 %8, 1
%10 = add i64 %9, %6
br label %3
}
/* Variables and functions */
int _xdg_mime_mime_type_subclass(char const *, char const *);
int /*<<< orphan*/ xdg_mime_init();
int xdg_mime_mime_type_subclass(const char *mime, const char *base) {
  xdg_mime_init();
  return _xdg_mime_mime_type_subclass(mime, base);
}


x86 assembly (clang, -O0):
<xdg_mime_mime_type_subclass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <xdg_mime_init@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <_xdg_mime_mime_type_subclass@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdg_mime_mime_type_subclass>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <xdg_mime_init@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <_xdg_mime_mime_type_subclass@plt>

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

LLVM IR (-O2):
define i32 @xdg_mime_mime_type_subclass(i8* %0, i8* %1) {
%3 = tail call i32 (...) @xdg_mime_init()
%4 = tail call i32 @_xdg_mime_mime_type_subclass(i8* %0, i8* %1)
ret i32 %4
}
/* Variables and functions */
void *SEXP_rawptr_merge(void *ptr, uintptr_t bits) {
  return (void *)(((uintptr_t)(ptr) | bits));
}


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

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

LLVM IR (-O0):
define i8* @SEXP_rawptr_merge(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = load i64, i64* %4
%8 = or i64 %6, %7
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @SEXP_rawptr_merge(i8* %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = or i64 %3, %1
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
double tan_82s(double x) {
  static const double c1 = 211.849369664121;
  static const double c2 = -12.5288887278448;
  static const double c3 = 269.7350131214121;
  static const double c4 = -71.4145309347748;
  double x2;
  x2 = x * x;
  return (x * (c1 + c2 * x2) / (c3 + x2 * (c4 + x2)));
}


x86 assembly (clang, -O0):
<tan_82s>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xee6(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xee2(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xebd(%rip),%xmm2
addsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xea4(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tan_82s>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xef0(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xeec(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xee8(%rip),%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
@tan_82s.c1 = internal constant double 0x406A7B2E094A33A8
@tan_82s.c2 = internal constant double 0xC0290ECA80DAA207
@tan_82s.c3 = internal constant double 0x4070DBC29D1E6989
@tan_82s.c4 = internal constant double 0xC051DA87ACC20270
define double @tan_82s(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %4, %5
store double %6, double* %3
%7 = load double, double* %2
%8 = load double, double* %3
%9 = call double @llvm.fmuladd.f64(double 0xC0290ECA80DAA207, double %8, double 0x406A7B2E094A33A8)
%10 = fmul double %7, %9
%11 = load double, double* %3
%12 = load double, double* %3
%13 = fadd double 0xC051DA87ACC20270, %12
%14 = call double @llvm.fmuladd.f64(double %11, double %13, double 0x4070DBC29D1E6989)
%15 = fdiv double %10, %14
ret double %15
}

LLVM IR (-O2):
define double @tan_82s(double %0) {
%2 = fmul double %0, %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0xC0290ECA80DAA207, double 0x406A7B2E094A33A8)
%4 = fmul double %3, %0
%5 = fadd double %2, 0xC051DA87ACC20270
%6 = tail call double @llvm.fmuladd.f64(double %2, double %5, double 0x4070DBC29D1E6989)
%7 = fdiv double %4, %6
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ from;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *const, int /*<<< orphan*/ const *, int);
size_t store_serialize_int64(void *const to, int64_t const from) {
  memcpy(to, &from, sizeof(from));
  return sizeof(from);
}


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

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

LLVM IR (-O0):
define i64 @store_serialize_int64(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 = call i32 @memcpy(i8* %5, i32* %4, i32 4)
ret i64 4
}

LLVM IR (-O2):
define i64 @store_serialize_int64(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
ret i64 4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int myAtoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("Usage: ./atoi 123\n");
    exit(-1);
  }
  int n = myAtoi(argv[1]);
  printf("n = %d %x\n", 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)
cmpl   $0x2,-0x8(%rbp)
je     1168 <main+0x38>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <myAtoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1165 <main+0x25>
mov    0x8(%rsi),%rdi
call   1060 <myAtoi@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Usage: ./atoi 123\0A\00"
@.str.1 = [11 x i8] c"n = %d %x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @myAtoi(i8* %15)
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = load i32, i32* %6
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %17, i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"n = %d %x\0A\00"
@str = [18 x i8] c"Usage: ./atoi 123\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @myAtoi(i8* %9)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %10)
ret i32 0
}
int test3(int x, int y, int z, int weight, int w1, int w2, int w3) {
  int wtmp1 = w1 * weight;
  int wtmp2 = w2 * weight;
  int wtmp3 = w3 * weight;
  int tmp1 = x * wtmp1;
  int tmp2 = y * wtmp2;
  int tmp3 = z * wtmp3;
  return tmp1 + tmp2 + tmp3;
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x24(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%eax
add    -0x2c(%rbp),%eax
add    -0x30(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
imul   %r8d,%edi
imul   %r9d,%esi
lea    (%rsi,%rdi,1),%eax
imul   0x8(%rsp),%edx
add    %edx,%eax
imul   %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test3(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = 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
store i32 %6, i32* %14
%21 = load i32, i32* %12
%22 = load i32, i32* %11
%23 = mul nsw i32 %21, %22
store i32 %23, i32* %15
%24 = load i32, i32* %13
%25 = load i32, i32* %11
%26 = mul nsw i32 %24, %25
store i32 %26, i32* %16
%27 = load i32, i32* %14
%28 = load i32, i32* %11
%29 = mul nsw i32 %27, %28
store i32 %29, i32* %17
%30 = load i32, i32* %8
%31 = load i32, i32* %15
%32 = mul nsw i32 %30, %31
store i32 %32, i32* %18
%33 = load i32, i32* %9
%34 = load i32, i32* %16
%35 = mul nsw i32 %33, %34
store i32 %35, i32* %19
%36 = load i32, i32* %10
%37 = load i32, i32* %17
%38 = mul nsw i32 %36, %37
store i32 %38, i32* %20
%39 = load i32, i32* %18
%40 = load i32, i32* %19
%41 = add nsw i32 %39, %40
%42 = load i32, i32* %20
%43 = add nsw i32 %41, %42
ret i32 %43
}

LLVM IR (-O2):
define i32 @test3(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = mul i32 %4, %0
%9 = mul i32 %5, %1
%10 = mul i32 %6, %2
%11 = add i32 %9, %8
%12 = add i32 %11, %10
%13 = mul i32 %12, %3
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_secp256k1_mul(uintptr_t, uintptr_t, uintptr_t);
void fiat_secp256k1_mul(uint64_t out1[4], const uint64_t arg1[4],
                        const uint64_t arg2[4]) {
  internal_fiat_secp256k1_mul((uintptr_t)out1, (uintptr_t)arg1,
                              (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_secp256k1_mul>:
jmp    1030 <internal_fiat_secp256k1_mul@plt>

LLVM IR (-O0):
define void @fiat_secp256k1_mul(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_secp256k1_mul(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_secp256k1_mul(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_secp256k1_mul(i64 %4, i64 %5, i64 %6)
ret void
}
/* Variables and functions */
unsigned int strlen(char *str) {
  unsigned int i;
  if (str == 0 || *str == '\0')
    return 0;
  for (i = 0; *str++; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1123 <strlen+0x23>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    112f <strlen+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1167 <strlen+0x67>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     1161 <strlen+0x61>
jmp    1153 <strlen+0x53>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <strlen+0x36>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <strlen+0x1b>
cmpb   $0x0,(%rdi)
je     111b <strlen+0x1b>
xor    %eax,%eax
xchg   %ax,%ax
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 0, %3 ]
%8 = phi i8* [ %9, %6 ], [ %0, %3 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = add i32 %7, 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %1, %3
%14 = phi i32 [ 0, %3 ], [ 0, %1 ], [ %10, %6 ]
ret i32 %14
}
/* Type definitions */
typedef double GLfloat;

/* Variables and functions */
double turbulence(double, double, double, double, double);
GLfloat marble(GLfloat x, GLfloat y, GLfloat z) {
  GLfloat m;
  m = turbulence(x, y, z, 0.3, 400.0);
  if (m > 1.0)
    m = 1.0;
  if (m < 0.0)
    m = 0.0;
  return m;
}


x86 assembly (clang, -O0):
<marble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  0xeca(%rip),%xmm3
movsd  0xeca(%rip),%xmm4
call   1030 <turbulence@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xea3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1174 <marble+0x64>
movsd  0xe91(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    118a <marble+0x7a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<marble>:
push   %rax
movsd  0xee7(%rip),%xmm3
movsd  0xee7(%rip),%xmm4
call   1030 <turbulence@plt>
movsd  0xee2(%rip),%xmm1
minsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
maxsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @marble(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = load double, double* %6
%11 = call double @turbulence(double %8, double %9, double %10, double 3.000000e-01, double 4.000000e+02)
store double %11, double* %7
%12 = load double, double* %7
%13 = fcmp ogt double %12, 1.000000e+00
br i1 %13, label %14, label %15
14: ; preds = %3
store double 1.000000e+00, double* %7
br label %15
15: ; preds = %14, %3
%16 = load double, double* %7
%17 = fcmp olt double %16, 0.000000e+00
br i1 %17, label %18, label %19
18: ; preds = %15
store double 0.000000e+00, double* %7
br label %19
19: ; preds = %18, %15
%20 = load double, double* %7
ret double %20
}

LLVM IR (-O2):
define double @marble(double %0, double %1, double %2) {
%4 = tail call double @turbulence(double %0, double %1, double %2, double 3.000000e-01, double 4.000000e+02)
%5 = fcmp ogt double %4, 1.000000e+00
%6 = select i1 %5, double 1.000000e+00, double %4
%7 = fcmp olt double %6, 0.000000e+00
%8 = select i1 %7, double 0.000000e+00, double %6
ret double %8
}
int test_imm_8Cint64_midword_reg(long long val) {
  return ((val >> 16) & (0x8C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_8Cint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 140
%6 = icmp ne i64 %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_8Cint64_midword_reg(i64 %0) {
%2 = and i64 %0, 9175040
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void gc_collect() {}


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

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

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

LLVM IR (-O2):
define void @gc_collect() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void infoSetQuiet(void) {
  printf("Quiet mode.  Only print words found in the dictionary.%s", "\n");
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c"Quiet mode. Only print words found in the dictionary.%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @infoSetQuiet() {
%1 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"Quiet mode. Only print words found in the dictionary.%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @infoSetQuiet() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_and_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_xor_si128(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i funct_Ch(__m128i *x, __m128i *y, __m128i *z) {
  __m128i _calc = _mm_xor_si128(*y, *z);
  _calc = _mm_and_si128(_calc, *x);
  _calc = _mm_xor_si128(_calc, *z);
  return _calc;
}


x86 assembly (clang, -O0):
<funct_Ch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
call   1040 <_mm_and_si128@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funct_Ch>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
mov    (%rsi),%edi
mov    (%rdx),%esi
call   1030 <_mm_xor_si128@plt>
mov    (%r14),%esi
mov    %eax,%edi
call   1040 <_mm_and_si128@plt>
mov    (%rbx),%esi
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <_mm_xor_si128@plt>

LLVM IR (-O0):
define i32 @funct_Ch(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = call i32 @_mm_xor_si128(i32 %9, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = call i32 @_mm_and_si128(i32 %13, i32 %15)
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = load i32*, i32** %6
%19 = load i32, i32* %18
%20 = call i32 @_mm_xor_si128(i32 %17, i32 %19)
store i32 %20, i32* %7
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @funct_Ch(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = tail call i32 @_mm_xor_si128(i32 %4, i32 %5)
%7 = load i32, i32* %0
%8 = tail call i32 @_mm_and_si128(i32 %6, i32 %7)
%9 = load i32, i32* %2
%10 = tail call i32 @_mm_xor_si128(i32 %8, i32 %9)
ret i32 %10
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test_proc_fort_v1();
int main() {
  test_proc_fort_v1();
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @test_proc_fort_v1()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpeq_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_min_epu8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i _mm_cmple_epu8(__m128i x, __m128i y) {
  return _mm_cmpeq_epi8(_mm_min_epu8(x, y), x);
}


x86 assembly (clang, -O0):
<_mm_cmple_epu8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_min_epu8@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1040 <_mm_cmpeq_epi8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_cmple_epu8>:
push   %rbx
mov    %edi,%ebx
call   1030 <_mm_min_epu8@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <_mm_cmpeq_epi8@plt>

LLVM IR (-O0):
define i32 @_mm_cmple_epu8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @_mm_min_epu8(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @_mm_cmpeq_epi8(i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @_mm_cmple_epu8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_min_epu8(i32 %0, i32 %1)
%4 = tail call i32 @_mm_cmpeq_epi8(i32 %3, i32 %0)
ret i32 %4
}
char *val(char *s) { return s ? s : (char *)""; }


x86 assembly (clang, -O0):
<val>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <val+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <val+0x30>
lea    0xed9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <val+0x30>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<val>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @val(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %7 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @val(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
void areaOfTriangle(int base, int height, int *pArea) {
  *pArea = 0.5 * base * height;
}


x86 assembly (clang, -O0):
<areaOfTriangle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xee5(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<areaOfTriangle>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsi2sd %esi,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @areaOfTriangle(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = fmul double 5.000000e-01, %8
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to double
%12 = fmul double %9, %11
%13 = fptosi double %12 to i32
%14 = load i32*, i32** %6
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @areaOfTriangle(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = sitofp i32 %0 to double
%5 = fmul double %4, 5.000000e-01
%6 = sitofp i32 %1 to double
%7 = fmul double %5, %6
%8 = fptosi double %7 to i32
store i32 %8, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void myhandler(int sigtype) { printf("got signal %d\n", sigtype); }


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

x86 assembly (clang, -O2):
<myhandler>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"got signal %d\0A\00"
define void @myhandler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _XlcInitCTInfo();
__attribute__((visibility("default"))) void xcb_compound_text_init() {
  _XlcInitCTInfo();
}


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

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

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

LLVM IR (-O2):
define void @xcb_compound_text_init() {
%1 = tail call i32 (...) @_XlcInitCTInfo()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void testInc() {
  int a, b;
  a = 3;
  b = a++;
  printf("3++ = %d %d\n", b, a);
}


x86 assembly (clang, -O0):
<testInc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testInc>:
lea    0xee9(%rip),%rdi
mov    $0x3,%esi
mov    $0x4,%edx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"3++ = %d %d\0A\00"
define void @testInc() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rmd160_finish(char *);
int /*<<< orphan*/ rmd160_init();
int /*<<< orphan*/ rmd160_process(char const *);
void rmd160_hash(char output[20], const char input[64]) {
  rmd160_init();
  rmd160_process(input);
  rmd160_finish(output);
}


x86 assembly (clang, -O0):
<rmd160_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <rmd160_init@plt>
mov    -0x10(%rbp),%rdi
call   1040 <rmd160_process@plt>
mov    -0x8(%rbp),%rdi
call   1030 <rmd160_finish@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmd160_hash>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1050 <rmd160_init@plt>
mov    %rbx,%rdi
call   1040 <rmd160_process@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <rmd160_finish@plt>

LLVM IR (-O0):
define void @rmd160_hash(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (...) @rmd160_init()
%6 = load i8*, i8** %4
%7 = call i32 @rmd160_process(i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @rmd160_finish(i8* %8)
ret void
}

LLVM IR (-O2):
define void @rmd160_hash(i8* %0, i8* %1) {
%3 = tail call i32 (...) @rmd160_init()
%4 = tail call i32 @rmd160_process(i8* %1)
%5 = tail call i32 @rmd160_finish(i8* %0)
ret void
}
void cc3000_deassert_cs(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @cc3000_deassert_cs() {
ret void
}
int SDL_imageFilterAbsDiffMMX(unsigned char *Src1, unsigned char *Src2,
                              unsigned char *Dest, unsigned int SrcLength) {
  return (-1);
}


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

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

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

LLVM IR (-O2):
define i32 @SDL_imageFilterAbsDiffMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ myfoo(int *);
void mallocEscapeFree() {
  int *p = malloc(12);
  myfoo(p);
  free(p);
}


x86 assembly (clang, -O0):
<mallocEscapeFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <myfoo@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocEscapeFree>:
push   %rbx
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <myfoo@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @mallocEscapeFree() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 12)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @myfoo(i32* %3)
%5 = load i32*, i32** %1
%6 = call i32 @free(i32* %5)
ret void
}

LLVM IR (-O2):
define void @mallocEscapeFree() {
%1 = tail call i32* @malloc(i32 12)
%2 = tail call i32 @myfoo(i32* %1)
%3 = tail call i32 @free(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ show_float(float);
int /*<<< orphan*/ show_int(int);
int /*<<< orphan*/ show_pointer(int *);
void test_show_bytes(int val) {
  int ival = val;
  float fval = (float)ival;
  int *pval = &ival;
  show_int(ival);
  show_float(fval);
  show_pointer(pval);
}


x86 assembly (clang, -O0):
<test_show_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <show_int@plt>
movss  -0xc(%rbp),%xmm0
call   1030 <show_float@plt>
mov    -0x18(%rbp),%rdi
call   1050 <show_pointer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_show_bytes>:
push   %rax
mov    %edi,0x4(%rsp)
cvtsi2ss %edi,%xmm0
movss  %xmm0,(%rsp)
call   1040 <show_int@plt>
movss  (%rsp),%xmm0
call   1030 <show_float@plt>
lea    0x4(%rsp),%rdi
call   1050 <show_pointer@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test_show_bytes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca i32*
store i32 %0, i32* %2
%6 = load i32, i32* %2
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to float
store float %8, float* %4
store i32* %3, i32** %5
%9 = load i32, i32* %3
%10 = call i32 @show_int(i32 %9)
%11 = load float, float* %4
%12 = call i32 @show_float(float %11)
%13 = load i32*, i32** %5
%14 = call i32 @show_pointer(i32* %13)
ret void
}

LLVM IR (-O2):
define void @test_show_bytes(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 %0, i32* %2
%4 = sitofp i32 %0 to float
%5 = tail call i32 @show_int(i32 %0)
%6 = tail call i32 @show_float(float %4)
%7 = call i32 @show_pointer(i32* %2)
ret void
}