xunge/DecIR huggingface dataset:
unsigned CeilLog2(unsigned uiVal) {
  unsigned uiTmp = uiVal - 1;
  unsigned uiRet = 0;
  while (uiTmp != 0) {
    uiTmp >>= 1;
    uiRet++;
  }
  return uiRet;
}


x86 assembly (clang, -O0):
<CeilLog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1138 <CeilLog2+0x38>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <CeilLog2+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CeilLog2>:
xor    %eax,%eax
add    $0xffffffff,%edi
je     111c <CeilLog2+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax)
shr    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <CeilLog2+0x10>
ret

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

LLVM IR (-O2):
define i32 @CeilLog2(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32 [ %7, %4 ], [ %2, %1 ]
%7 = lshr i32 %6, 1
%8 = add nuw nsw i32 %5, 1
%9 = icmp ult i32 %6, 2
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %11
}
/* Variables and functions */
double cbrt(double);
double piemathCbrt(double a) { return cbrt(a); }


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

x86 assembly (clang, -O2):
<piemathCbrt>:
jmp    1030 <cbrt@plt>

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

LLVM IR (-O2):
define double @piemathCbrt(double %0) {
%2 = tail call double @cbrt(double %0)
ret double %2
}
int ReverseNumbers(int num) {
  int reverseNum = 0;
  while (num > 0) {
    reverseNum = reverseNum * 10 + num % 10;
    num = num / 10;
  }
  return reverseNum;
}


x86 assembly (clang, -O0):
<ReverseNumbers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1145 <ReverseNumbers+0x45>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <ReverseNumbers+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReverseNumbers>:
xor    %eax,%eax
test   %edi,%edi
jle    1131 <ReverseNumbers+0x31>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
lea    (%rcx,%rax,2),%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <ReverseNumbers+0x10>
ret

LLVM IR (-O0):
define i32 @ReverseNumbers(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 10
%10 = load i32, i32* %2
%11 = srem i32 %10, 10
%12 = add nsw i32 %9, %11
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 10
store i32 %14, i32* %2
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @ReverseNumbers(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = urem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = udiv i32 %5, 10
%10 = icmp ult i32 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ foobar(int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("leakfinder C example app\n");
  printf("This application is expected to leak\n");
  foobar(8);
  foobar(16);
  printf("leakfinder C example app all done\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x8,%edi
call   1040 <foobar@plt>
mov    $0x10,%edi
call   1040 <foobar@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"leakfinder C example app\0A\00"
@.str.1 = [38 x i8] c"This application is expected to leak\0A\00"
@.str.2 = [35 x i8] c"leakfinder C example app all done\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @foobar(i32 8)
%5 = call i32 @foobar(i32 16)
%6 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"leakfinder C example app\00"
@str.3 = [37 x i8] c"This application is expected to leak\00"
@str.4 = [34 x i8] c"leakfinder C example app all done\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @foobar(i32 8)
%4 = tail call i32 @foobar(i32 16)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ swap64(int /*<<< orphan*/ const);
void mem_inplace_swap64(void *mem, size_t n) {
  size_t i;
  for (i = 0; i < n; i++) {
    ((uint64_t *)mem)[i] = swap64(((const uint64_t *)mem)[i]);
  }
}


x86 assembly (clang, -O0):
<mem_inplace_swap64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1164 <mem_inplace_swap64+0x54>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <swap64@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <mem_inplace_swap64+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_inplace_swap64>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1146 <mem_inplace_swap64+0x36>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbx,4),%edi
call   1030 <swap64@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <mem_inplace_swap64+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @mem_inplace_swap64(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = bitcast i8* %0 to i32*
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @swap64(i32 %9)
store i32 %10, i32* %8
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int *address(int (*ptr)[4], int num) {
  int *p;
  p = *(ptr + num);
  return p;
}


x86 assembly (clang, -O0):
<address>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<address>:
movslq %esi,%rax
shl    $0x4,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i32* @address([4 x i32]* %0, i32 %1) {
%3 = alloca [4 x i32]*
%4 = alloca i32
%5 = alloca i32*
store [4 x i32]* %0, [4 x i32]** %3
store i32 %1, i32* %4
%6 = load [4 x i32]*, [4 x i32]** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 %8
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
store i32* %10, i32** %5
%11 = load i32*, i32** %5
ret i32* %11
}

LLVM IR (-O2):
define i32* @address([4 x i32]* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 %3, i64 0
ret i32* %4
}
/* Variables and functions */
void *memchr(char const *, char, size_t);
size_t strnlen(const char *str, size_t n) {
  const void *memchr_result;
  size_t len;
  memchr_result = memchr(str, '\0', n);
  if (!memchr_result)
    len = n;
  else
    len = memchr_result - (void *)str;
  return len;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114b <strnlen+0x3b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    115a <strnlen+0x4a>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i8* @memchr(i8* %7, i8 signext 0, i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = load i64, i64* %4
store i64 %13, i64* %6
br label %20
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = ptrtoint i8* %15 to i64
%18 = ptrtoint i8* %16 to i64
%19 = sub i64 %17, %18
store i64 %19, i64* %6
br label %20
20: ; preds = %14, %12
%21 = load i64, i64* %6
ret i64 %21
}

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = tail call i8* @memchr(i8* %0, i8 signext 0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = select i1 %4, i64 %1, i64 %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ _ptrc_glBlendColor(float, float, float, float);
__attribute__((visibility("default"))) void
emu_glBlendColor(float red, float green, float blue, float alpha) {
  _ptrc_glBlendColor(red, green, blue, alpha);
}


x86 assembly (clang, -O0):
<emu_glBlendColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
call   1030 <_ptrc_glBlendColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emu_glBlendColor>:
jmp    1030 <_ptrc_glBlendColor@plt>

LLVM IR (-O0):
define void @emu_glBlendColor(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = load float, float* %7
%12 = load float, float* %8
%13 = call i32 @_ptrc_glBlendColor(float %9, float %10, float %11, float %12)
ret void
}

LLVM IR (-O2):
define void @emu_glBlendColor(float %0, float %1, float %2, float %3) {
%5 = tail call i32 @_ptrc_glBlendColor(float %0, float %1, float %2, float %3)
ret void
}
/* Variables and functions */
int even(int);
int odd(int number) {
  if (number == 0)
    return 0;
  else
    return even(number - 1);
}


x86 assembly (clang, -O0):
<odd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <odd+0x21>
movl   $0x0,-0x4(%rbp)
jmp    113f <odd+0x2f>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <even@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odd>:
test   %edi,%edi
je     111c <odd+0xc>
add    $0xffffffff,%edi
jmp    1030 <even@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @odd(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @even(i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usages(void) { printf("you must input your pdf files at least\n"); }


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"you must input your pdf files at least\0A\00"
define void @usages() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c"you must input your pdf files at least\00"
define void @usages() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct Person {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(struct Person *);
void Person_destroy(struct Person *who) {
  assert(who != NULL);
  free(who);
}


x86 assembly (clang, -O0):
<Person_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Person_destroy>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.Person = type { i32 }
define void @Person_destroy(%struct.Person* %0) {
%2 = alloca %struct.Person*
store %struct.Person* %0, %struct.Person** %2
%3 = load %struct.Person*, %struct.Person** %2
%4 = icmp ne %struct.Person* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.Person*, %struct.Person** %2
%8 = call i32 @free(%struct.Person* %7)
ret void
}

LLVM IR (-O2):
%struct.Person = type { i32 }
define void @Person_destroy(%struct.Person* %0) {
%2 = icmp ne %struct.Person* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @free(%struct.Person* %0)
ret void
}
/* Variables and functions */
size_t flat_dev_length();
size_t flat_length(void) { return flat_dev_length(); }


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

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

LLVM IR (-O0):
define i64 @flat_length() {
%1 = call i64 (...) @flat_dev_length()
ret i64 %1
}

LLVM IR (-O2):
define i64 @flat_length() {
%1 = tail call i64 (...) @flat_dev_length()
ret i64 %1
}
/* Variables and functions */
size_t __ctype_get_mb_cur_max();
__attribute__((__weak__, __always___)) size_t
softboundmpx___ctype_get_mb_cur_max(void) {
  return __ctype_get_mb_cur_max();
}


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

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

LLVM IR (-O0):
define weak i64 @softboundmpx___ctype_get_mb_cur_max() {
%1 = call i64 (...) @__ctype_get_mb_cur_max()
ret i64 %1
}

LLVM IR (-O2):
define weak i64 @softboundmpx___ctype_get_mb_cur_max() {
%1 = tail call i64 (...) @__ctype_get_mb_cur_max()
ret i64 %1
}
void raptor_user_mac_init(void) {}


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

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

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

LLVM IR (-O2):
define void @raptor_user_mac_init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void write32(void *addr, uint32_t val) { *(volatile uint32_t *)addr = val; }


x86 assembly (clang, -O0):
<write32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @write32(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
void ff_hevc_put_hevc_uni_pel_pixels48_8_sse4() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @chain_zero_stats() {
ret void
}
/* Variables and functions */
float cosf(float);
float SDL_cosf(float x) { return cosf(x); }


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

x86 assembly (clang, -O2):
<SDL_cosf>:
jmp    1030 <cosf@plt>

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

LLVM IR (-O2):
define float @SDL_cosf(float %0) {
%2 = tail call float @cosf(float %0)
ret float %2
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *mk_atom(char *);
struct node *mk_none() {
  return mk_atom("<none>");
}


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

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

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [7 x i8] c"<none>\00"
define %struct.node* @mk_none() {
%1 = call %struct.node* @mk_atom(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret %struct.node* %1
}

LLVM IR (-O2):
%struct.node = type { i32 }
@.str = [7 x i8] c"<none>\00"
define %struct.node* @mk_none() {
%1 = tail call %struct.node* @mk_atom(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret %struct.node* %1
}
/* Type definitions */
struct man {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ man_alloc1(struct man *);
int /*<<< orphan*/ man_free1(struct man *);
void man_reset(struct man *man) {
  man_free1(man);
  man_alloc1(man);
}


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

x86 assembly (clang, -O2):
<man_reset>:
push   %rbx
mov    %rdi,%rbx
call   1030 <man_free1@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <man_alloc1@plt>

LLVM IR (-O0):
%struct.man = type { i32 }
define void @man_reset(%struct.man* %0) {
%2 = alloca %struct.man*
store %struct.man* %0, %struct.man** %2
%3 = load %struct.man*, %struct.man** %2
%4 = call i32 @man_free1(%struct.man* %3)
%5 = load %struct.man*, %struct.man** %2
%6 = call i32 @man_alloc1(%struct.man* %5)
ret void
}

LLVM IR (-O2):
%struct.man = type { i32 }
define void @man_reset(%struct.man* %0) {
%2 = tail call i32 @man_free1(%struct.man* %0)
%3 = tail call i32 @man_alloc1(%struct.man* %0)
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ sprintf(char *, char *, int);
char *waypoint_get_temp_filename(void) {
  static char temp_filename[128];
  sprintf(temp_filename, "/tmp/waypoint_%d", getpid());
  return temp_filename;
}


x86 assembly (clang, -O0):
<waypoint_get_temp_filename>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edx
lea    0x2f0c(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2ef9(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<waypoint_get_temp_filename>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0x2f11(%rip),%rbx
lea    0xeca(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@waypoint_get_temp_filename.temp_filename = internal global [128 x i8] zeroinitializer
@.str = [17 x i8] c"/tmp/waypoint_%d\00"
define i8* @waypoint_get_temp_filename() {
%1 = call i32 (...) @getpid()
%2 = call i32 @sprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @waypoint_get_temp_filename.temp_filename, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @waypoint_get_temp_filename.temp_filename, i64 0, i64 0)
}

LLVM IR (-O2):
@waypoint_get_temp_filename.temp_filename = internal global [128 x i8] zeroinitializer
@.str = [17 x i8] c"/tmp/waypoint_%d\00"
define i8* @waypoint_get_temp_filename() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @waypoint_get_temp_filename.temp_filename, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @waypoint_get_temp_filename.temp_filename, i64 0, i64 0)
}
/* Variables and functions */
int new_var();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ push(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
void code_while_begin() {
  int index_1 = new_var();
  char label_1[256];
  sprintf(label_1, ".L%d", index_1);
  push(index_1);
  printf("%s:\n", label_1);
}


x86 assembly (clang, -O0):
<code_while_begin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    $0x0,%al
call   1040 <new_var@plt>
mov    %eax,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe9a(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x4(%rbp),%edi
call   1050 <push@plt>
lea    -0x110(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code_while_begin>:
push   %r14
push   %rbx
sub    $0x108,%rsp
xor    %eax,%eax
call   1040 <new_var@plt>
mov    %eax,%ebx
lea    0xea6(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %eax,%edx
call   1060 <sprintf@plt>
mov    %ebx,%edi
call   1050 <push@plt>
lea    0xe90(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c".L%d\00"
@.str.1 = [5 x i8] c"%s:\0A\00"
define void @code_while_begin() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = call i32 (...) @new_var()
store i32 %3, i32* %1
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* %1
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @push(i32 %7)
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c".L%d\00"
@.str.1 = [5 x i8] c"%s:\0A\00"
define void @code_while_begin() {
%1 = alloca [256 x i8]
%2 = tail call i32 (...) @new_var()
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = tail call i32 @push(i32 %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int e_map(unsigned int, void **, unsigned int *);
int /*<<< orphan*/ e_unmap(char *);
int e_read(unsigned addr, unsigned *data) {
  int ret;
  unsigned offset;
  char *ptr;
  ret = e_map(addr, (void **)&ptr, &offset);
  *data = *((unsigned *)(ptr + offset));
  e_unmap(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<e_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <e_map@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    (%rax,%rcx,1),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rdi
call   1040 <e_unmap@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_read>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1030 <e_map@plt>
mov    0x8(%rsp),%rdi
mov    0x4(%rsp),%eax
mov    (%rdi,%rax,1),%eax
mov    %eax,(%rbx)
call   1040 <e_unmap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @e_read(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %3
store i32* %1, i32** %4
%8 = load i32, i32* %3
%9 = call i32 @e_map(i32 %8, i8** %7, i32* %6)
store i32 %9, i32* %5
%10 = load i8*, i8** %7
%11 = load i32, i32* %6
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = bitcast i8* %13 to i32*
%15 = load i32, i32* %14
%16 = load i32*, i32** %4
store i32 %15, i32* %16
%17 = load i8*, i8** %7
%18 = call i32 @e_unmap(i8* %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @e_read(i32 %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = bitcast i32* %3 to i8*
%6 = bitcast i8** %4 to i8*
%7 = call i32 @e_map(i32 %0, i8** %4, i32* %3)
%8 = load i8*, i8** %4
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %1
%14 = call i32 @e_unmap(i8* %8)
ret i32 0
}
int vink_epp_state_finished(struct vink_epp_state *state) { return 0; }


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

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

LLVM IR (-O0):
%struct.vink_epp_state = type opaque
define i32 @vink_epp_state_finished(%struct.vink_epp_state* %0) {
%2 = alloca %struct.vink_epp_state*
store %struct.vink_epp_state* %0, %struct.vink_epp_state** %2
ret i32 0
}

LLVM IR (-O2):
%struct.vink_epp_state = type opaque
define i32 @vink_epp_state_finished(%struct.vink_epp_state* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct tms {
  int /*<<< orphan*/ tms_utime;
};
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
clock_t get_tms_utime(struct tms *ptms) { return ptms->tms_utime; }


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

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

LLVM IR (-O0):
%struct.tms = type { i32 }
define i32 @get_tms_utime(%struct.tms* %0) {
%2 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %2
%3 = load %struct.tms*, %struct.tms** %2
%4 = getelementptr inbounds %struct.tms, %struct.tms* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.tms = type { i32 }
define i32 @get_tms_utime(%struct.tms* nocapture %0) {
%2 = getelementptr inbounds %struct.tms, %struct.tms* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
int test_imm_CDint64_midword_reg(long long val) {
  return ((val >> 16) & (0xCD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CDint64_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, 205
%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_CDint64_midword_reg(i64 %0) {
%2 = and i64 %0, 13434880
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _start_basename(char *);
char *strpool_add(int /*<<< orphan*/);
char *path_basename(char *filename) {
  return strpool_add(_start_basename(filename));
}


x86 assembly (clang, -O0):
<path_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_start_basename@plt>
mov    %eax,%edi
call   1030 <strpool_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_basename>:
push   %rax
call   1040 <_start_basename@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <strpool_add@plt>

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

LLVM IR (-O2):
define i8* @path_basename(i8* %0) {
%2 = tail call i32 @_start_basename(i8* %0)
%3 = tail call i8* @strpool_add(i32 %2)
ret i8* %3
}
unsigned char clipPixel(const int pixel) {
  int result;
  result = ((pixel < 0) ? 0 : pixel);
  return (unsigned char)((result > 255) ? 255 : result);
}


x86 assembly (clang, -O0):
<clipPixel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111b <clipPixel+0x1b>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1121 <clipPixel+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jle    1141 <clipPixel+0x41>
mov    $0xff,%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <clipPixel+0x47>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clipPixel>:
xor    %ecx,%ecx
test   %edi,%edi
cmovns %edi,%ecx
cmp    $0xff,%ecx
mov    $0xff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @clipPixel(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %9
7: ; preds = %1
%8 = load i32, i32* %2
br label %9
9: ; preds = %7, %6
%10 = phi i32 [ 0, %6 ], [ %8, %7 ]
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp sgt i32 %11, 255
br i1 %12, label %13, label %14
13: ; preds = %9
br label %16
14: ; preds = %9
%15 = load i32, i32* %3
br label %16
16: ; preds = %14, %13
%17 = phi i32 [ 255, %13 ], [ %15, %14 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @clipPixel(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i32 %0, i32 0
%4 = icmp ult i32 %3, 255
%5 = select i1 %4, i32 %3, i32 255
%6 = trunc i32 %5 to i8
ret i8 %6
}
struct cl_node *cl_node_red(struct cl_node *n) {
  return (struct cl_node *)((long)n | 1);
}


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

x86 assembly (clang, -O2):
<cl_node_red>:
mov    %rdi,%rax
or     $0x1,%rax
ret

LLVM IR (-O0):
%struct.cl_node = type opaque
define %struct.cl_node* @cl_node_red(%struct.cl_node* %0) {
%2 = alloca %struct.cl_node*
store %struct.cl_node* %0, %struct.cl_node** %2
%3 = load %struct.cl_node*, %struct.cl_node** %2
%4 = ptrtoint %struct.cl_node* %3 to i64
%5 = or i64 %4, 1
%6 = inttoptr i64 %5 to %struct.cl_node*
ret %struct.cl_node* %6
}

LLVM IR (-O2):
%struct.cl_node = type opaque
define %struct.cl_node* @cl_node_red(%struct.cl_node* %0) {
%2 = ptrtoint %struct.cl_node* %0 to i64
%3 = or i64 %2, 1
%4 = inttoptr i64 %3 to %struct.cl_node*
ret %struct.cl_node* %4
}
void rop3_120_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & S;
  stk1 = T ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_120_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_120_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_120_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = xor i32 %25, -1
%27 = and i32 %23, %26
%28 = load i8, i8* %6
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = and i32 %34, %36
%38 = or i32 %31, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_120_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
void I444ToARGBRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @I444ToARGBRow_Any_NEON() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void hexdump(uint8_t *ptr, int len) {
  while (len--)
    printf("%02x ", *ptr++);
}


x86 assembly (clang, -O0):
<hexdump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1155 <hexdump+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <hexdump+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdump>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1145 <hexdump+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1130 <hexdump+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%02x \00"
define void @hexdump(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = load i32, i32* %6
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = icmp eq i32 %7, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
double atan2(double, double);
double futhark_atan2_64(double x, double y) { return atan2(x, y); }


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

x86 assembly (clang, -O2):
<futhark_atan2_64>:
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define double @futhark_atan2_64(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @atan2(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @futhark_atan2_64(double %0, double %1) {
%3 = tail call double @atan2(double %0, double %1)
ret double %3
}
int test_58_4(int *mem) { return __atomic_xor_fetch(mem + 4, 1, 4); }


x86 assembly (clang, -O0):
<test_58_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x10,%rcx
mov    %rcx,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    0x10(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
xor    %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    1153 <test_58_4+0x53>
jmp    112a <test_58_4+0x2a>
mov    -0x18(%rbp),%ecx
mov    -0x24(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_58_4>:
mov    0x10(%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
xor    $0x1,%ecx
lock cmpxchg %ecx,0x10(%rdi)
jne    1110 <test_58_4+0x10>
xor    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_58_4(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 4
store i32 1, i32* %3
%7 = load i32, i32* %3
%8 = atomicrmw xor i32* %6, i32 %7 acq_rel
%9 = xor i32 %8, %7
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_58_4(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = atomicrmw xor i32* %2, i32 1 acq_rel
%4 = xor i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ PLAL_FS450_i2c_address();
int gfx_i2c_write(int, int /*<<< orphan*/, unsigned char, unsigned char,
                  unsigned char *);
int houston_WriteReg(unsigned int reg, unsigned long value,
                     unsigned int bytes) {
  return gfx_i2c_write(1, PLAL_FS450_i2c_address(), (unsigned char)reg,
                       (unsigned char)bytes, (unsigned char *)&value);
}


x86 assembly (clang, -O0):
<houston_WriteReg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1040 <PLAL_FS450_i2c_address@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x14(%rbp),%eax
lea    -0x10(%rbp),%r8
mov    $0x1,%edi
movzbl %cl,%edx
movzbl %al,%ecx
call   1030 <gfx_i2c_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<houston_WriteReg>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %edi,%ebp
mov    %rsi,(%rsp)
xor    %eax,%eax
call   1040 <PLAL_FS450_i2c_address@plt>
movzbl %bpl,%edx
movzbl %bl,%ecx
mov    %rsp,%r8
mov    $0x1,%edi
mov    %eax,%esi
call   1030 <gfx_i2c_write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @houston_WriteReg(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = call i32 (...) @PLAL_FS450_i2c_address()
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i8
%10 = load i32, i32* %6
%11 = trunc i32 %10 to i8
%12 = bitcast i64* %5 to i8*
%13 = call i32 @gfx_i2c_write(i32 1, i32 %7, i8 zeroext %9, i8 zeroext %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @houston_WriteReg(i32 %0, i64 %1, i32 %2) {
%4 = alloca i64
store i64 %1, i64* %4
%5 = tail call i32 (...) @PLAL_FS450_i2c_address()
%6 = trunc i32 %0 to i8
%7 = trunc i32 %2 to i8
%8 = bitcast i64* %4 to i8*
%9 = call i32 @gfx_i2c_write(i32 1, i32 %5, i8 zeroext %6, i8 zeroext %7, i8* %8)
ret i32 %9
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x = rand();
  return x * 3;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x14(%rbp)
imul   $0x3,-0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 = call i32 (...) @rand()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = mul nsw i32 %8, 3
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = mul nsw i32 %3, 3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  if (1 > 2)
  x:
    printf("yo\n");
  printf("yo shouldn't have been printed\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    112e <main+0x1e>
jmp    113f <main+0x2f>
jmp    1133 <main+0x23>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%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 = [4 x i8] c"yo\0A\00"
@.str.1 = [32 x i8] c"yo shouldn't have been printed\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br i1 false, label %2, label %5
2: ; preds = %0
br label %3
3: ; preds = %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@str = [31 x i8] c"yo shouldn't have been printed\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 0
}