xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ print(float);
int /*<<< orphan*/ printf(char *);
void print1(float *in, int x) {
  for (int i = 0; i < x; i++)
    print(in[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1162 <print1+0x42>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1040 <print@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <print1+0x16>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print1>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1154 <print1+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movss  (%r14,%rbx,4),%xmm0
call   1040 <print@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <print1+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @print1(float* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds float, float* %0, i64 %9
%11 = load float, float* %10
%12 = tail call i32 @print(float %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int __libc_open(char const *, int, int /*<<< orphan*/);
int creat(const char *file, mode_t mode) {
  return __libc_open(file, O_WRONLY | O_CREAT | O_TRUNC, mode);
}


x86 assembly (clang, -O0):
<creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
mov    0x2ec5(%rip),%rax
or     (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <__libc_open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creat>:
mov    0x2eb1(%rip),%rcx
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    %esi,%edx
mov    0x2ec5(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%esi
jmp    1030 <__libc_open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i32 @creat(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 = load i32, i32* @O_WRONLY
%7 = load i32, i32* @O_CREAT
%8 = or i32 %6, %7
%9 = load i32, i32* @O_TRUNC
%10 = or i32 %8, %9
%11 = load i32, i32* %4
%12 = call i32 @__libc_open(i8* %5, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i32 @creat(i8* %0, i32 %1) {
%3 = load i32, i32* @O_WRONLY
%4 = load i32, i32* @O_CREAT
%5 = or i32 %4, %3
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = tail call i32 @__libc_open(i8* %0, i32 %7, i32 %1)
ret i32 %8
}
float div_neg(float x, float y) { return (-x / y) * (x / -y); }


x86 assembly (clang, -O0):
<div_neg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
divss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
divss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_neg>:
movaps 0xef9(%rip),%xmm2
movaps %xmm0,%xmm3
xorps  %xmm2,%xmm3
xorps  %xmm1,%xmm2
unpcklps %xmm0,%xmm3
unpcklps %xmm2,%xmm1
divps  %xmm1,%xmm3
movaps %xmm3,%xmm0
shufps $0x55,%xmm3,%xmm0
mulss  %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @div_neg(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fneg float %5
%7 = load float, float* %4
%8 = fdiv float %6, %7
%9 = load float, float* %3
%10 = load float, float* %4
%11 = fneg float %10
%12 = fdiv float %9, %11
%13 = fmul float %8, %12
ret float %13
}

LLVM IR (-O2):
define float @div_neg(float %0, float %1) {
%3 = fneg float %0
%4 = fneg float %1
%5 = insertelement <2 x float> poison, float %0, i64 1
%6 = insertelement <2 x float> %5, float %3, i64 0
%7 = insertelement <2 x float> poison, float %1, i64 0
%8 = insertelement <2 x float> %7, float %4, i64 1
%9 = fdiv <2 x float> %6, %8
%10 = shufflevector <2 x float> %9, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%11 = fmul <2 x float> %9, %10
%12 = extractelement <2 x float> %11, i64 0
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ delay();
int main(void) {
  volatile unsigned char *led = ((volatile unsigned char *)0xB6020000);
  while (1) {
    *led = 0xFF;
    delay();
    *led = 0x00;
    delay();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xb6020000,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0xff,(%rax)
mov    $0x0,%al
call   1030 <delay@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    $0x0,%al
call   1030 <delay@plt>
jmp    1128 <main+0x18>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xb6020000,%ebx
cs nopw 0x0(%rax,%rax,1)
movb   $0xff,(%rbx)
xor    %eax,%eax
call   1030 <delay@plt>
movb   $0x0,(%rbx)
xor    %eax,%eax
call   1030 <delay@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* inttoptr (i64 3053584384 to i8*), i8** %2
br label %3
3: ; preds = %0, %3
%4 = load i8*, i8** %2
store volatile i8 -1, i8* %4
%5 = call i32 (...) @delay()
%6 = load i8*, i8** %2
store volatile i8 0, i8* %6
%7 = call i32 (...) @delay()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
store volatile i8 -1, i8* inttoptr (i64 3053584384 to i8*)
%2 = tail call i32 (...) @delay()
store volatile i8 0, i8* inttoptr (i64 3053584384 to i8*)
%3 = tail call i32 (...) @delay()
br label %1
}
/* Variables and functions */
long double log1p(double);
long double log1pl(long double x) { return log1p((double)x); }


x86 assembly (clang, -O0):
<log1pl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <log1p@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log1pl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <log1p@plt>

LLVM IR (-O0):
define x86_fp80 @log1pl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @log1p(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @log1pl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @log1p(double %2)
ret x86_fp80 %3
}
float square(s)
int s;
{ return (s * s); }


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

x86 assembly (clang, -O2):
<square>:
imul   %edi,%edi
cvtsi2ss %edi,%xmm0
ret

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

LLVM IR (-O2):
define float @square(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = sitofp i32 %2 to float
ret float %3
}
unsigned short int f14(unsigned short int x, long int y) {
  return (x << y) | (x >> ((-y) & (8 * sizeof(unsigned short) - 1)));
}


x86 assembly (clang, -O0):
<f14>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0xf,%rcx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f14>:
mov    %rsi,%rcx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
and    $0xf,%cl
shr    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f14(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %6, %8
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = load i64, i64* %4
%13 = sub nsw i64 0, %12
%14 = and i64 %13, 15
%15 = trunc i64 %14 to i32
%16 = ashr i32 %11, %15
%17 = or i32 %9, %16
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @f14(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = shl i32 %3, %4
%6 = sub i32 0, %4
%7 = and i32 %6, 15
%8 = lshr i32 %3, %7
%9 = or i32 %8, %5
%10 = trunc i32 %9 to i16
ret i16 %10
}
/* Variables and functions */
int /*<<< orphan*/ xwrite(int, char *, int);
void close_session(int sock) { xwrite(sock, "\x11", 1); }


x86 assembly (clang, -O0):
<close_session>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x1,%edx
call   1030 <xwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_session>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <xwrite@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\11\00"
define void @close_session(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @xwrite(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\11\00"
define void @close_session(i32 %0) {
%2 = tail call i32 @xwrite(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
void Rename_REV_NARR(ii, jj) int ii, jj;
{
  int i, j;
  i = ii;
  j = jj;
  while (i < j) {
    Rename_SWP_NARR(i, j);
    i = i + 1;
    j = j - 1;
  };
}


x86 assembly (clang, -O0):
<Rename_REV_NARR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    115a <Rename_REV_NARR+0x4a>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x0,%al
call   1030 <Rename_SWP_NARR@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <Rename_REV_NARR+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rename_REV_NARR>:
push   %rbp
push   %rbx
push   %rax
cmp    %esi,%edi
jge    1135 <Rename_REV_NARR+0x25>
mov    %esi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <Rename_SWP_NARR@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
cmp    %ebx,%ebp
jl     1120 <Rename_REV_NARR+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @Rename_REV_NARR(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
store i32 %7, i32* %5
%8 = load i32, i32* %4
store i32 %8, i32* %6
br label %9
9: ; preds = %13, %2
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %21
13: ; preds = %9
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 (i32, i32, ...) bitcast (i32 (...)* @Rename_SWP_NARR to i32 (i32, i32, ...)*)(i32 %14, i32 %15)
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
%19 = load i32, i32* %6
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %6
br label %9
21: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @Rename_REV_NARR(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ %1, %2 ]
%6 = phi i32 [ %8, %4 ], [ %0, %2 ]
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @Rename_SWP_NARR to i32 (i32, i32, ...)*)(i32 %6, i32 %5)
%8 = add nsw i32 %6, 1
%9 = add nsw i32 %5, -1
%10 = icmp slt i32 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %4, %2
ret void
}
/* Variables and functions */
int foo(int, double, ...);
int bar() { return foo(1, 'a', 1.1) + foo(2, 2.2, "asdf"); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
movsd  0xee3(%rip),%xmm0
movsd  0xee3(%rip),%xmm1
mov    $0x2,%al
call   1030 <foo@plt>
mov    %eax,-0x4(%rbp)
mov    $0x2,%edi
movsd  0xebc(%rip),%xmm0
lea    0xecd(%rip),%rsi
mov    $0x1,%al
call   1030 <foo@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
movsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
mov    $0x1,%edi
mov    $0x2,%al
call   1030 <foo@plt>
mov    %eax,%ebx
lea    0xee2(%rip),%rsi
movsd  0xed2(%rip),%xmm0
mov    $0x2,%edi
mov    $0x1,%al
call   1030 <foo@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"asdf\00"
define i32 @bar() {
%1 = call i32 (i32, double, ...) @foo(i32 1, double 9.700000e+01, double 1.100000e+00)
%2 = call i32 (i32, double, ...) @foo(i32 2, double 2.200000e+00, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = add nsw i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
@.str = [5 x i8] c"asdf\00"
define i32 @bar() {
%1 = tail call i32 (i32, double, ...) @foo(i32 1, double 9.700000e+01, double 1.100000e+00)
%2 = tail call i32 (i32, double, ...) @foo(i32 2, double 2.200000e+00, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = add nsw i32 %2, %1
ret i32 %3
}
void gtk_notebook_set_menu_label_text() {}


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

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

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

LLVM IR (-O2):
define void @gtk_notebook_set_menu_label_text() {
ret void
}
/* Variables and functions */
double M_PI;
double sin(double);
double wavegen_sine(double time) { return sin(2.0 * M_PI * time); }


x86 assembly (clang, -O0):
<wavegen_sine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mov    0x2ebc(%rip),%rax
mulsd  (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wavegen_sine>:
mov    0x2ed1(%rip),%rax
movsd  (%rax),%xmm1
addsd  %xmm1,%xmm1
mulsd  %xmm1,%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @wavegen_sine(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* @M_PI
%4 = fmul double 2.000000e+00, %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = call double @sin(double %6)
ret double %7
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @wavegen_sine(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, 2.000000e+00
%4 = fmul double %3, %0
%5 = tail call double @sin(double %4)
ret double %5
}
/* Variables and functions */
int wordcount(char *);
char *wordcount_01b() {
  char phrase[] = "  zyzzyvas\t flutings \n mushers octopuses bizones talkier "
                  "evokers coagent "
                  "ringer      neutral antipode omnibus havening whistles "
                  "mistitled  vacuums ";
  do {
    if (!(wordcount(phrase) == 16))
      return "return 16 for a 16 word phrase, ignoring wonky whitespace";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<wordcount_01b>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
lea    -0xa0(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x94,%edx
call   1030 <memcpy@plt>
lea    -0xa0(%rbp),%rdi
call   1040 <wordcount@plt>
cmp    $0x10,%eax
je     1168 <wordcount_01b+0x48>
lea    0xf35(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <wordcount_01b+0x55>
jmp    116d <wordcount_01b+0x4d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wordcount_01b>:
push   %rbx
sub    $0xa0,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    $0x94,%edx
mov    %rbx,%rdi
call   1030 <memcpy@plt>
mov    %rbx,%rdi
call   1040 <wordcount@plt>
xor    %ecx,%ecx
cmp    $0x10,%eax
lea    0xf41(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
add    $0xa0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.wordcount_01b.phrase = [148 x i8] c" zyzzyvas\09 flutings \0A mushers octopuses bizones talkier evokers coagent ringer neutral antipode omnibus havening whistles mistitled vacuums \00"
@.str = [58 x i8] c"return 16 for a 16 word phrase, ignoring wonky whitespace\00"
define i8* @wordcount_01b() {
%1 = alloca i8*
%2 = alloca [148 x i8]
%3 = bitcast [148 x i8]* %2 to i8*
br label %4
4: ; preds = %0
%5 = getelementptr inbounds [148 x i8], [148 x i8]* %2, i64 0, i64 0
%6 = call i32 @wordcount(i8* %5)
%7 = icmp eq i32 %6, 16
br i1 %7, label %9, label %8
8: ; preds = %4
store i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8** %1
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9
store i8* null, i8** %1
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@__const.wordcount_01b.phrase = [148 x i8] c" zyzzyvas\09 flutings \0A mushers octopuses bizones talkier evokers coagent ringer neutral antipode omnibus havening whistles mistitled vacuums \00"
@.str = [58 x i8] c"return 16 for a 16 word phrase, ignoring wonky whitespace\00"
define i8* @wordcount_01b() {
%1 = alloca [148 x i8]
%2 = getelementptr inbounds [148 x i8], [148 x i8]* %1, i64 0, i64 0
%3 = call i32 @wordcount(i8* %2)
%4 = icmp eq i32 %3, 16
%5 = select i1 %4, i8* null, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0)
ret i8* %5
}
char nibbleToHex(int theValue) {
  if ((theValue >= 0) && (theValue <= 9))
    return (char)48 + theValue;
  if ((theValue >= 10) && (theValue <= 15))
    return (char)55 + theValue;
  return '*';
}


x86 assembly (clang, -O0):
<nibbleToHex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1129 <nibbleToHex+0x29>
cmpl   $0x9,-0x8(%rbp)
jg     1129 <nibbleToHex+0x29>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    114f <nibbleToHex+0x4f>
cmpl   $0xa,-0x8(%rbp)
jl     114b <nibbleToHex+0x4b>
cmpl   $0xf,-0x8(%rbp)
jg     114b <nibbleToHex+0x4b>
mov    -0x8(%rbp),%eax
add    $0x37,%eax
mov    %al,-0x1(%rbp)
jmp    114f <nibbleToHex+0x4f>
movb   $0x2a,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibbleToHex>:
cmp    $0x9,%edi
ja     110b <nibbleToHex+0xb>
add    $0x30,%dil
jmp    1119 <nibbleToHex+0x19>
lea    -0xa(%rdi),%ecx
mov    $0x2a,%al
cmp    $0x5,%ecx
ja     111b <nibbleToHex+0x1b>
add    $0x37,%dil
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @nibbleToHex(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 9
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 48, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
br label %24
13: ; preds = %6, %1
%14 = load i32, i32* %3
%15 = icmp sge i32 %14, 10
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %3
%18 = icmp sle i32 %17, 15
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = load i32, i32* %3
%21 = add nsw i32 55, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %2
br label %24
23: ; preds = %16, %13
store i8 42, i8* %2
br label %24
24: ; preds = %23, %19, %9
%25 = load i8, i8* %2
ret i8 %25
}

LLVM IR (-O2):
define signext i8 @nibbleToHex(i32 %0) {
%2 = icmp ult i32 %0, 10
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = trunc i32 %0 to i8
%5 = add nuw nsw i8 %4, 48
br label %12
6: ; preds = %1
%7 = add i32 %0, -10
%8 = icmp ult i32 %7, 6
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = trunc i32 %0 to i8
%11 = add nuw nsw i8 %10, 55
br label %12
12: ; preds = %6, %9, %3
%13 = phi i8 [ %5, %3 ], [ %11, %9 ], [ 42, %6 ]
ret i8 %13
}
void HammingDistance_SSE42() {}


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

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

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

LLVM IR (-O2):
define void @HammingDistance_SSE42() {
ret void
}
extern void ixp2000_reg_wrb(volatile void *reg, unsigned long val) {
  *((volatile unsigned long *)reg) = val;
}


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

x86 assembly (clang, -O2):
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @ixp2000_reg_wrb(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store volatile i64 %5, i64* %7
ret void
}

LLVM IR (-O2):
define void @ixp2000_reg_wrb(i8* %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store volatile i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint16_t;

/* Variables and functions */
uint16_t HostToLittleEndian16(const uint16_t In) { return In; }


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

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

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

LLVM IR (-O2):
define i32 @HostToLittleEndian16(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wifidirect_cfg_presence_req_params_usage(void) {
  printf("Usage : wifidirect_cfg_presence_req_params [<type> <duration> "
         "<interval>]\n");
  printf("      : Type 1: preferred values, 2: acceptable values.\n");
  printf("If presence request parameters are provided, "
         " 'set' is performed otherwise 'get' is performed.\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_wifidirect_cfg_presence_req_params_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf26(%rip),%rdi
call   1030 <puts@plt>
lea    0xf52(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [75 x i8] c"Usage : wifidirect_cfg_presence_req_params [<type> <duration> <interval>]\0A\00"
@.str.1 = [57 x i8] c" : Type 1: preferred values, 2: acceptable values.\0A\00"
@.str.2 = [96 x i8] c"If presence request parameters are provided, 'set' is performed otherwise 'get' is performed.\0A\00"
define void @print_wifidirect_cfg_presence_req_params_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [74 x i8] c"Usage : wifidirect_cfg_presence_req_params [<type> <duration> <interval>]\00"
@str.3 = [56 x i8] c" : Type 1: preferred values, 2: acceptable values.\00"
@str.4 = [95 x i8] c"If presence request parameters are provided, 'set' is performed otherwise 'get' is performed.\00"
define void @print_wifidirect_cfg_presence_req_params_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([95 x i8], [95 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ InitRandom();
int /*<<< orphan*/ printf(char *, int);
int randomNumber(int, int);
int main() {
  InitRandom();
  for (int i = 0; i < 50; i++)
    printf("%i\n", randomNumber(50, 100));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <InitRandom@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jge    1182 <main+0x52>
mov    $0x32,%edi
mov    $0x64,%esi
call   1050 <randomNumber@plt>
mov    %eax,%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <InitRandom@plt>
mov    $0x32,%ebp
lea    0xeba(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    $0x32,%edi
mov    $0x64,%esi
call   1050 <randomNumber@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @InitRandom()
store i32 0, i32* %2
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 50
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = call i32 @randomNumber(i32 50, i32 100)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @InitRandom()
br label %3
2: ; preds = %3
ret i32 0
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %7, %3 ]
%5 = tail call i32 @randomNumber(i32 50, i32 100)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 50
br i1 %8, label %2, label %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: lpf [-c] [-f] [-h host] [-i indent] [-l length] [-n "
                  "name] [-w width] [acctfile]\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [88 x i8] c"usage: lpf [-c] [-f] [-h host] [-i indent] [-l length] [-n name] [-w width] [acctfile]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [88 x i8] c"usage: lpf [-c] [-f] [-h host] [-i indent] [-l length] [-n name] [-w width] [acctfile]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ write_instr(int);
void eval_bit_comp(void) { write_instr(0x23); }


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

x86 assembly (clang, -O2):
<eval_bit_comp>:
mov    $0x23,%edi
jmp    1030 <write_instr@plt>

LLVM IR (-O0):
define void @eval_bit_comp() {
%1 = call i32 @write_instr(i32 35)
ret void
}

LLVM IR (-O2):
define void @eval_bit_comp() {
%1 = tail call i32 @write_instr(i32 35)
ret void
}
/* Variables and functions */
unsigned long cas(unsigned long volatile *, unsigned long, unsigned long);
unsigned long fai(volatile unsigned long *ptr) {
  unsigned long found = *ptr;
  unsigned long expected;
  do {
    expected = found;
  } while ((found = cas(ptr, expected, expected + 1)) != expected);
  return found;
}


x86 assembly (clang, -O0):
<fai>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
call   1030 <cas@plt>
mov    %rax,-0x10(%rbp)
cmp    -0x18(%rbp),%rax
jne    1127 <fai+0x17>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fai>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rax
nopw   0x0(%rax,%rax,1)
mov    %rax,%rbx
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <cas@plt>
cmp    %rbx,%rax
jne    1120 <fai+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @fai(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca i64
store i64* %0, i64** %2
%5 = load i64*, i64** %2
%6 = load volatile i64, i64* %5
store i64 %6, i64* %3
br label %7
7: ; preds = %9, %1
%8 = load i64, i64* %3
store i64 %8, i64* %4
br label %9
9: ; preds = %7
%10 = load i64*, i64** %2
%11 = load i64, i64* %4
%12 = load i64, i64* %4
%13 = add i64 %12, 1
%14 = call i64 @cas(i64* %10, i64 %11, i64 %13)
store i64 %14, i64* %3
%15 = load i64, i64* %4
%16 = icmp ne i64 %14, %15
br i1 %16, label %7, label %17
17: ; preds = %9
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
define i64 @fai(i64* %0) {
%2 = load volatile i64, i64* %0
br label %3
3: ; preds = %3, %1
%4 = phi i64 [ %2, %1 ], [ %6, %3 ]
%5 = add i64 %4, 1
%6 = tail call i64 @cas(i64* %0, i64 %4, i64 %5)
%7 = icmp eq i64 %6, %4
br i1 %7, label %8, label %3
8: ; preds = %3
ret i64 %4
}
/* Type definitions */
typedef void uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ AV_WN32(void *, int /*<<< orphan*/);
void AV_WN64(void *p, uint64_t v) {
  union {
    uint64_t v;
    uint32_t hl[2];
  } vv = {v};
  AV_WN32(p, vv.hl[0]);
  AV_WN32((uint8_t *)p + 4, vv.hl[1]);
}


x86 assembly (clang, -O0):
<AV_WN64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <AV_WN32@plt>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    -0x14(%rbp),%esi
call   1030 <AV_WN32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AV_WN64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <AV_WN32@plt>
add    $0x4,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <AV_WN32@plt>

LLVM IR (-O0):
%union.anon = type { [2 x i32] }
define void @AV_WN64(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %union.anon
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast %union.anon* %5 to i32*
%7 = load i32, i32* %4
store i32 %7, i32* %6
%8 = load i8*, i8** %3
%9 = bitcast %union.anon* %5 to [2 x i32]*
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%11 = load i32, i32* %10
%12 = call i32 @AV_WN32(i8* %8, i32 %11)
%13 = load i8*, i8** %3
%14 = getelementptr i8, i8* %13, i64 4
%15 = bitcast %union.anon* %5 to [2 x i32]*
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %15, i64 0, i64 1
%17 = load i32, i32* %16
%18 = call i32 @AV_WN32(i8* %14, i32 %17)
ret void
}

LLVM IR (-O2):
define void @AV_WN64(i8* %0, i32 %1) {
%3 = tail call i32 @AV_WN32(i8* %0, i32 %1)
%4 = getelementptr i8, i8* %0, i64 4
%5 = tail call i32 @AV_WN32(i8* %4, i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World! It's me, ASS!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Hello World! It's me, ASS!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"Hello World! It's me, ASS!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void foo(int n, int vla_ptr[n]) { return; }


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

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

LLVM IR (-O0):
define void @foo(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 = zext i32 %5 to i64
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *btjpg_gctalloc(char *str, size_t sz) {
  void *ptr;
  ptr = malloc(sz);
  memset(ptr, 0, sz);
  return (ptr);
}


x86 assembly (clang, -O0):
<btjpg_gctalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btjpg_gctalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @btjpg_gctalloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i64, i64* %4
%10 = call i32 @memset(i8* %8, i32 0, i64 %9)
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
define i8* @btjpg_gctalloc(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = tail call i32 @memset(i8* %3, i32 0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Not implemented."); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Not implemented.\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Not implemented.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int write(int file, char *ptr, int len) {
  if (file == 1 || file == 2) {
    asm volatile("call *0x00100028" : : "S"(ptr), "c"(len));
  } else {
    return -1;
  }
  return len;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1122 <write+0x22>
cmpl   $0x2,-0x8(%rbp)
jne    1135 <write+0x35>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
call   *0x100028
jmp    1141 <write+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <write+0x47>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
add    $0xffffffff,%edi
mov    $0xffffffff,%eax
cmp    $0x1,%edi
ja     1118 <write+0x18>
mov    %edx,%ecx
call   *0x100028
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @write(i32 %0, i8* %1, i32 %2) {
%4 = add i32 %0, -1
%5 = icmp ult i32 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %3
tail call void asm sideeffect "call *0x00100028", "{si},{cx},~{dirflag},~{fpsr},~{flags}"(i8* %1, i32 %2)
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ %2, %6 ], [ -1, %3 ]
ret i32 %8
}
unsigned null_CAN_TRANSMIT(const char *devicename) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @null_CAN_TRANSMIT(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ idcTriggerZeroValueThroughCall(int);
int /*<<< orphan*/ idcZero(int);
void idcTrackZeroValueThroughCall(int x) {
  idcZero(x);
  idcTriggerZeroValueThroughCall(x);
}


x86 assembly (clang, -O0):
<idcTrackZeroValueThroughCall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <idcZero@plt>
mov    -0x4(%rbp),%edi
call   1030 <idcTriggerZeroValueThroughCall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idcTrackZeroValueThroughCall>:
push   %rbx
mov    %edi,%ebx
call   1040 <idcZero@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <idcTriggerZeroValueThroughCall@plt>

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

LLVM IR (-O2):
define void @idcTrackZeroValueThroughCall(i32 %0) {
%2 = tail call i32 @idcZero(i32 %0)
%3 = tail call i32 @idcTriggerZeroValueThroughCall(i32 %0)
ret void
}
void event_text(p) char *p;
{}


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

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

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

LLVM IR (-O2):
define void @event_text(i8* nocapture %0) {
ret void
}
void call2c(short s, double d1, int i, float f2, long l, double d2, char c,
            float f1) {
  c = 'a';
  f1 = 0.0;
  s = 5;
  d1 = 0.0;
  i = 6;
  f2 = 0.1;
  l = 7;
  d2 = 0.2;
}


x86 assembly (clang, -O0):
<call2c>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
mov    %al,-0x29(%rbp)
movss  %xmm3,-0x30(%rbp)
movb   $0x61,-0x29(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
movw   $0x5,-0x2(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x6,-0x14(%rbp)
movss  0xeb4(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movq   $0x7,-0x20(%rbp)
movsd  0xe97(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @call2c(i16 signext %0, double %1, i32 %2, float %3, i64 %4, double %5, i8 signext %6, float %7) {
%9 = alloca i16
%10 = alloca double
%11 = alloca i32
%12 = alloca float
%13 = alloca i64
%14 = alloca double
%15 = alloca i8
%16 = alloca float
store i16 %0, i16* %9
store double %1, double* %10
store i32 %2, i32* %11
store float %3, float* %12
store i64 %4, i64* %13
store double %5, double* %14
store i8 %6, i8* %15
store float %7, float* %16
store i8 97, i8* %15
store float 0.000000e+00, float* %16
store i16 5, i16* %9
store double 0.000000e+00, double* %10
store i32 6, i32* %11
store float 0x3FB99999A0000000, float* %12
store i64 7, i64* %13
store double 2.000000e-01, double* %14
ret void
}

LLVM IR (-O2):
define void @call2c(i16 signext %0, double %1, i32 %2, float %3, i64 %4, double %5, i8 signext %6, float %7) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void gravityOnMoon(double gravity) {
  const double gravitationalMoon = 17.0 / 100;
  printf("Gravity on the Moon is %.3lf\n", gravity * gravitationalMoon);
}


x86 assembly (clang, -O0):
<gravityOnMoon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xece(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"Gravity on the Moon is %.3lf\0A\00"
define void @gravityOnMoon(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 1.700000e-01, double* %3
%4 = load double, double* %2
%5 = fmul double %4, 1.700000e-01
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %5)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Gravity on the Moon is %.3lf\0A\00"
define void @gravityOnMoon(double %0) {
%2 = fmul double %0, 1.700000e-01
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *open_file(char const *, char *, char *);
FILE *open_binary_file(const char *file) {
  return open_file(file, "rb", "reading");
}


x86 assembly (clang, -O0):
<open_binary_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xed5(%rip),%rdx
call   1030 <open_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_binary_file>:
lea    0xee9(%rip),%rsi
lea    0xee5(%rip),%rdx
jmp    1030 <open_file@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@.str.1 = [8 x i8] c"reading\00"
define i32* @open_binary_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @open_file(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32* %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@.str.1 = [8 x i8] c"reading\00"
define i32* @open_binary_file(i8* %0) {
%2 = tail call i32* @open_file(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32* %2
}
int test_imm_AAuint16_mem(unsigned short *val) {
  return ((*val) & (0xAA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_AAuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xaa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_AAuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 170
%7 = icmp ne i32 %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_AAuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 170
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Test PASSED\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Test PASSED\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void ff_hevc_put_hevc_bi_epel_hv12_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_hv12_12_sse4() {
ret void
}