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

/* Variables and functions */
int fls(unsigned long);
int fls64(unsigned long);
unsigned fls_long(unsigned long l) {
  if (sizeof(l) == 4)
    return fls(l);
  return fls64(l);
}


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

x86 assembly (clang, -O2):
<fls_long>:
jmp    1030 <fls64@plt>

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

LLVM IR (-O2):
define i32 @fls_long(i64 %0) {
%2 = tail call i32 @fls64(i64 %0)
ret i32 %2
}
int avl_abs(int n) {
  int mask = n >> ((sizeof(int) * 8) - 1);
  return (mask + n) ^ mask;
}


x86 assembly (clang, -O0):
<avl_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @avl_abs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 31
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = xor i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @avl_abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
unsigned short int lendianReadShort(unsigned char b[]) {
  unsigned short int i;
  i = ((b[1] << 8) | b[0]);
  return i;
}


x86 assembly (clang, -O0):
<lendianReadShort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lendianReadShort>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i16 @lendianReadShort(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %8, %12
%14 = trunc i32 %13 to i16
store i16 %14, i16* %3
%15 = load i16, i16* %3
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @lendianReadShort(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i16
%5 = shl nuw i16 %4, 8
%6 = load i8, i8* %0
%7 = zext i8 %6 to i16
%8 = or i16 %5, %7
ret i16 %8
}
int jsfdigit(unsigned int a, unsigned int b) {
  int u = 2 - (a & 0x03);
  if (u == 2)
    return 0;
  if (((a & 0x07) == 3 || (a & 0x07) == 5) && (b & 0x03) == 2)
    return -u;
  return u;
}


x86 assembly (clang, -O0):
<jsfdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
and    $0x3,%ecx
mov    $0x2,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jne    1130 <jsfdigit+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1170 <jsfdigit+0x70>
mov    -0x8(%rbp),%eax
and    $0x7,%eax
cmp    $0x3,%eax
je     114e <jsfdigit+0x4e>
mov    -0x8(%rbp),%eax
and    $0x7,%eax
cmp    $0x5,%eax
jne    116a <jsfdigit+0x6a>
mov    -0xc(%rbp),%eax
and    $0x3,%eax
cmp    $0x2,%eax
jne    116a <jsfdigit+0x6a>
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <jsfdigit+0x70>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsfdigit>:
mov    %edi,%ecx
and    $0x3,%ecx
je     112a <jsfdigit+0x2a>
and    $0x7,%edi
cmp    $0x5,%edi
je     1114 <jsfdigit+0x14>
cmp    $0x3,%edi
jne    1122 <jsfdigit+0x22>
and    $0x3,%esi
cmp    $0x2,%esi
jne    1122 <jsfdigit+0x22>
add    $0xfffffffe,%ecx
mov    %ecx,%eax
ret
mov    $0x2,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @jsfdigit(i32 %0, i32 %1) {
%3 = and i32 %0, 3
%4 = add nsw i32 %3, -2
%5 = sub nsw i32 2, %3
%6 = icmp eq i32 %3, 0
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = and i32 %0, 7
switch i32 %8, label %12 [
i32 3, label %9
i32 5, label %9
]
9: ; preds = %7, %7
%10 = and i32 %1, 3
%11 = icmp eq i32 %10, 2
br i1 %11, label %13, label %12
12: ; preds = %7, %9
br label %13
13: ; preds = %9, %2, %12
%14 = phi i32 [ %5, %12 ], [ 0, %2 ], [ %4, %9 ]
ret i32 %14
}
void v_fltrev(float *vec, int n) {
  float t;
  while (--n > 0) {
    t = vec[n];
    vec[n--] = vec[0];
    *vec++ = t;
  }
}


x86 assembly (clang, -O0):
<v_fltrev>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jle    116b <v_fltrev+0x6b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0xffffffff,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movss  %xmm0,(%rax)
jmp    110b <v_fltrev+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_fltrev>:
cmp    $0x2,%esi
jl     1130 <v_fltrev+0x30>
lea    -0x1(%rsi),%eax
lea    (%rdi,%rax,4),%rax
add    $0x2,%esi
nop
movss  (%rax),%xmm0
movss  (%rdi),%xmm1
movss  %xmm1,(%rax)
movss  %xmm0,(%rdi)
add    $0x4,%rdi
add    $0xfffffffffffffffc,%rax
add    $0xfffffffe,%esi
cmp    $0x3,%esi
ja     1110 <v_fltrev+0x10>
ret

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

LLVM IR (-O2):
define void @v_fltrev(float* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %15
4: ; preds = %2, %4
%5 = phi float* [ %13, %4 ], [ %0, %2 ]
%6 = phi i32 [ %12, %4 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds float, float* %5, i64 %8
%10 = load float, float* %9
%11 = load float, float* %5
%12 = add nsw i32 %6, -2
store float %11, float* %9
%13 = getelementptr inbounds float, float* %5, i64 1
store float %10, float* %5
%14 = icmp ugt i32 %6, 3
br i1 %14, label %4, label %15
15: ; preds = %4, %2
ret void
}
void internal_design_filter_cg_terminate(void) {}


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

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

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

LLVM IR (-O2):
define void @internal_design_filter_cg_terminate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 0 * 1;
  printf("%d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%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
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
int *fk_sleep_return_value() {
  static int value = 0;
  return &value;
}


x86 assembly (clang, -O0):
<fk_sleep_return_value>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f19(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fk_sleep_return_value>:
lea    0x2f1d(%rip),%rax
ret

LLVM IR (-O0):
@fk_sleep_return_value.value = internal global i32 0
define i32* @fk_sleep_return_value() {
ret i32* @fk_sleep_return_value.value
}

LLVM IR (-O2):
@fk_sleep_return_value.value = internal global i32 0
define i32* @fk_sleep_return_value() {
ret i32* @fk_sleep_return_value.value
}
void memindex(void *ad) {
  void *ptr = 0;
  __asm__ __volatile__("movl $0,(%0,%1,1)" ::"r"(ptr), "r"(ad));
}


x86 assembly (clang, -O0):
<memindex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movl   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<memindex>:
xor    %eax,%eax
movl   $0x0,(%rax,%rdi,1)
ret

LLVM IR (-O0):
define void @memindex(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @memindex(i8* %0) {
tail call void asm sideeffect "movl $$0,($0,$1,1)", "r,r,~{dirflag},~{fpsr},~{flags}"(i8* null, i8* %0)
ret void
}
/* Variables and functions */
double **doberes_dreieck_zeiger_alloc(double *, long);
double *dvector_alloc(long);
double **doberes_dreieck_all_alloc(long n) {
  double **m;
  double *a;
  long ges_laenge;
  ges_laenge = n * (n + 1) / 2;
  a = dvector_alloc(ges_laenge);
  if (a == NULL)
    return NULL;
  m = doberes_dreieck_zeiger_alloc(a, n);
  return m;
}


x86 assembly (clang, -O0):
<doberes_dreieck_all_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x1,%rcx
imul   %rcx,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <dvector_alloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116f <doberes_dreieck_all_alloc+0x4f>
movq   $0x0,-0x8(%rbp)
jmp    1188 <doberes_dreieck_all_alloc+0x68>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <doberes_dreieck_zeiger_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doberes_dreieck_all_alloc>:
push   %rbx
mov    %rdi,%rbx
lea    0x1(%rdi),%rax
imul   %rdi,%rax
mov    %rax,%rdi
shr    $0x3f,%rdi
add    %rax,%rdi
sar    %rdi
call   1030 <dvector_alloc@plt>
test   %rax,%rax
je     114f <doberes_dreieck_all_alloc+0x2f>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <doberes_dreieck_zeiger_alloc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define double** @doberes_dreieck_all_alloc(i64 %0) {
%2 = alloca double**
%3 = alloca i64
%4 = alloca double**
%5 = alloca double*
%6 = alloca i64
store i64 %0, i64* %3
%7 = load i64, i64* %3
%8 = load i64, i64* %3
%9 = add nsw i64 %8, 1
%10 = mul nsw i64 %7, %9
%11 = sdiv i64 %10, 2
store i64 %11, i64* %6
%12 = load i64, i64* %6
%13 = call double* @dvector_alloc(i64 %12)
store double* %13, double** %5
%14 = load double*, double** %5
%15 = icmp eq double* %14, null
br i1 %15, label %16, label %17
16: ; preds = %1
store double** null, double*** %2
br label %22
17: ; preds = %1
%18 = load double*, double** %5
%19 = load i64, i64* %3
%20 = call double** @doberes_dreieck_zeiger_alloc(double* %18, i64 %19)
store double** %20, double*** %4
%21 = load double**, double*** %4
store double** %21, double*** %2
br label %22
22: ; preds = %17, %16
%23 = load double**, double*** %2
ret double** %23
}

LLVM IR (-O2):
define double** @doberes_dreieck_all_alloc(i64 %0) {
%2 = add nsw i64 %0, 1
%3 = mul nsw i64 %2, %0
%4 = sdiv i64 %3, 2
%5 = tail call double* @dvector_alloc(i64 %4)
%6 = icmp eq double* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call double** @doberes_dreieck_zeiger_alloc(double* %5, i64 %0)
br label %9
9: ; preds = %1, %7
%10 = phi double** [ %8, %7 ], [ null, %1 ]
ret double** %10
}
void IMGbltWTransBlacken(short *imageBuf, int pitch, int x, int y,
                         short *bitmapWBuf) {}


x86 assembly (clang, -O0):
<IMGbltWTransBlacken>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @IMGbltWTransBlacken(i16* %0, i32 %1, i32 %2, i32 %3, i16* %4) {
%6 = alloca i16*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i16*
store i16* %0, i16** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i16* %4, i16** %10
ret void
}

LLVM IR (-O2):
define void @IMGbltWTransBlacken(i16* nocapture %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4) {
ret void
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct buffer *);
void buf_free(struct buffer *b) {
  if (b) {
    free(b);
  }
}


x86 assembly (clang, -O0):
<buf_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <buf_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_free>:
test   %rdi,%rdi
je     111a <buf_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.buffer = type { i32 }
define void @buf_free(%struct.buffer* %0) {
%2 = alloca %struct.buffer*
store %struct.buffer* %0, %struct.buffer** %2
%3 = load %struct.buffer*, %struct.buffer** %2
%4 = icmp ne %struct.buffer* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.buffer*, %struct.buffer** %2
%7 = call i32 @free(%struct.buffer* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @buf_free(%struct.buffer* %0) {
%2 = icmp eq %struct.buffer* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.buffer* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ towersHelper(int, int, int);
void towers(int n) { towersHelper(n, 1, 3); }


x86 assembly (clang, -O0):
<towers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
mov    $0x3,%edx
call   1030 <towersHelper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<towers>:
mov    $0x1,%esi
mov    $0x3,%edx
jmp    1030 <towersHelper@plt>

LLVM IR (-O0):
define void @towers(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @towersHelper(i32 %3, i32 1, i32 3)
ret void
}

LLVM IR (-O2):
define void @towers(i32 %0) {
%2 = tail call i32 @towersHelper(i32 %0, i32 1, i32 3)
ret void
}
/* Variables and functions */
char *strchr(const char *s, int c) {
  for (; *s != '\0'; s++) {
    if (*s == c)
      return (char *)s;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114e <strchr+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1138 <strchr+0x38>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <strchr+0x56>
jmp    113d <strchr+0x3d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ PAPI_Errors();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char **argv) { exit(PAPI_Errors()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <PAPI_Errors@plt>
mov    %eax,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <PAPI_Errors@plt>
mov    %eax,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @PAPI_Errors()
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @PAPI_Errors()
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Dump();
int /*<<< orphan*/ log_info(char *, char *);
void n32016_dumpregs(char *pMessage) {
  log_info("%s", pMessage);
  Dump();
}


x86 assembly (clang, -O0):
<n32016_dumpregs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <log_info@plt>
mov    $0x0,%al
call   1030 <Dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n32016_dumpregs>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <log_info@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <Dump@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @n32016_dumpregs(i8* %0) {
%2 = tail call i32 @log_info(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @Dump()
ret void
}
void free_dvector(v, nl, nh) double *v;
long nh, nl;
{ free((char *)(v + nl - 1)); }


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

x86 assembly (clang, -O2):
<free_dvector>:
lea    (%rdi,%rsi,8),%rdi
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_dvector(double* %0, i64 %1, i64 %2) {
%4 = alloca double*
%5 = alloca i64
%6 = alloca i64
store double* %0, double** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load double*, double** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds double, double* %7, i64 %8
%10 = getelementptr inbounds double, double* %9, i64 -1
%11 = bitcast double* %10 to i8*
ret void
}

LLVM IR (-O2):
define void @free_dvector(double* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds double, double* %0, i64 %1
%5 = getelementptr inbounds double, double* %4, i64 -1
%6 = bitcast double* %5 to i8*
tail call void @free(i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ end();
int /*<<< orphan*/ popfile();
void end_module(void) {
  end();
  popfile();
}


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

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

LLVM IR (-O0):
define void @end_module() {
%1 = call i32 (...) @end()
%2 = call i32 (...) @popfile()
ret void
}

LLVM IR (-O2):
define void @end_module() {
%1 = tail call i32 (...) @end()
%2 = tail call i32 (...) @popfile()
ret void
}
_Complex double foo(_Complex double z) { return ~z; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm1
movaps 0xee6(%rip),%xmm2
movsd  -0x18(%rbp),%xmm0
pxor   %xmm2,%xmm0
movsd  %xmm1,-0x10(%rbp)
movlpd %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xorps  0xef9(%rip),%xmm1
ret

LLVM IR (-O0):
define { double, double } @foo(double %0, double %1) {
%3 = alloca { double, double }
%4 = alloca { double, double }
%5 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
store double %0, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %1, double* %6
%7 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%10 = load double, double* %9
%11 = fneg double %10
%12 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%13 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %8, double* %12
store double %11, double* %13
%14 = load { double, double }, { double, double }* %3
ret { double, double } %14
}

LLVM IR (-O2):
define { double, double } @foo(double %0, double %1) {
%3 = fneg double %1
%4 = insertvalue { double, double } poison, double %0, 0
%5 = insertvalue { double, double } %4, double %3, 1
ret { double, double } %5
}
/* Variables and functions */
int tolower(char const);
int parseRankChar(const char c) {
  switch (tolower(c)) {
  case '1':
    return 0;
  case '2':
    return 1;
  case '3':
    return 2;
  case '4':
    return 3;
  case '5':
    return 4;
  case '6':
    return 5;
  case '7':
    return 6;
  case '8':
    return 7;
  default:
    return 8;
  }
}


x86 assembly (clang, -O0):
<parseRankChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <tolower@plt>
add    $0xffffffcf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7,%eax
ja     11ad <parseRankChar+0x9d>
mov    -0x10(%rbp),%rax
lea    0xebc(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    11b4 <parseRankChar+0xa4>
movl   $0x1,-0x4(%rbp)
jmp    11b4 <parseRankChar+0xa4>
movl   $0x2,-0x4(%rbp)
jmp    11b4 <parseRankChar+0xa4>
movl   $0x3,-0x4(%rbp)
jmp    11b4 <parseRankChar+0xa4>
movl   $0x4,-0x4(%rbp)
jmp    11b4 <parseRankChar+0xa4>
movl   $0x5,-0x4(%rbp)
jmp    11b4 <parseRankChar+0xa4>
movl   $0x6,-0x4(%rbp)
jmp    11b4 <parseRankChar+0xa4>
movl   $0x7,-0x4(%rbp)
jmp    11b4 <parseRankChar+0xa4>
movl   $0x8,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseRankChar>:
push   %rax
call   1030 <tolower@plt>
add    $0xffffffcf,%eax
cmp    $0x8,%eax
mov    $0x8,%ecx
cmovae %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @parseRankChar(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i32 @tolower(i8 signext %4)
switch i32 %5, label %14 [
i32 49, label %6
i32 50, label %7
i32 51, label %8
i32 52, label %9
i32 53, label %10
i32 54, label %11
i32 55, label %12
i32 56, label %13
]
6: ; preds = %1
store i32 0, i32* %2
br label %15
7: ; preds = %1
store i32 1, i32* %2
br label %15
8: ; preds = %1
store i32 2, i32* %2
br label %15
9: ; preds = %1
store i32 3, i32* %2
br label %15
10: ; preds = %1
store i32 4, i32* %2
br label %15
11: ; preds = %1
store i32 5, i32* %2
br label %15
12: ; preds = %1
store i32 6, i32* %2
br label %15
13: ; preds = %1
store i32 7, i32* %2
br label %15
14: ; preds = %1
store i32 8, i32* %2
br label %15
15: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @parseRankChar(i8 signext %0) {
%2 = tail call i32 @tolower(i8 signext %0)
%3 = add i32 %2, -49
%4 = icmp ult i32 %3, 8
%5 = select i1 %4, i32 %3, i32 8
ret i32 %5
}
/* Variables and functions */
double rand();
void sort_of_random(int *r) {
  *r = (int)(rand() / (rand() * .25));
  if (*r == 0) {
    sort_of_random(r);
  } else {
    return;
  }
}


x86 assembly (clang, -O0):
<sort_of_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jne    117c <sort_of_random+0x5c>
mov    -0x8(%rbp),%rdi
call   1030 <sort_of_random@plt>
jmp    1181 <sort_of_random+0x61>
jmp    1181 <sort_of_random+0x61>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_of_random>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mulsd  0xec4(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
mov    %eax,(%rbx)
test   %eax,%eax
je     1120 <sort_of_random+0x10>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @sort_of_random(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call double (...) @rand()
%4 = call double (...) @rand()
%5 = fmul double %4, 2.500000e-01
%6 = fdiv double %3, %5
%7 = fptosi double %6 to i32
%8 = load i32*, i32** %2
store i32 %7, i32* %8
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = load i32*, i32** %2
br label %15
14: ; preds = %1
br label %15
15: ; preds = %14, %12
ret void
}

LLVM IR (-O2):
define void @sort_of_random(i32* nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call double (...) @rand()
%4 = tail call double (...) @rand()
%5 = fmul double %4, 2.500000e-01
%6 = fdiv double %3, %5
%7 = fptosi double %6 to i32
store i32 %7, i32* %0
%8 = icmp eq i32 %7, 0
br i1 %8, label %2, label %9
9: ; preds = %2
ret void
}
/* Variables and functions */
int configz_readLKV(char const *, char const *, char const *, char *, int);
int configz_readSLKV(const char *configfile, const char *label, const char *key,
                     char *value) {
  return configz_readLKV(configfile, label, key, value, 1);
}


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

x86 assembly (clang, -O2):
<configz_readSLKV>:
mov    $0x1,%r8d
jmp    1030 <configz_readLKV@plt>

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

LLVM IR (-O2):
define i32 @configz_readSLKV(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @configz_readLKV(i8* %0, i8* %1, i8* %2, i8* %3, i32 1)
ret i32 %5
}
/* Variables and functions */
double rnd_normal();
double rnd_normal_param(double mu, double sigma) {
  return rnd_normal() * sigma + mu;
}


x86 assembly (clang, -O0):
<rnd_normal_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rnd_normal@plt>
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd_normal_param>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <rnd_normal@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rnd_normal_param(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @rnd_normal()
%6 = load double, double* %4
%7 = load double, double* %3
%8 = call double @llvm.fmuladd.f64(double %5, double %6, double %7)
ret double %8
}

LLVM IR (-O2):
define double @rnd_normal_param(double %0, double %1) {
%3 = tail call double (...) @rnd_normal()
%4 = tail call double @llvm.fmuladd.f64(double %3, double %1, double %0)
ret double %4
}
void gtk_tree_row_reference_new() {}


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

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

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

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

/* Variables and functions */
int getopt_x_prepare0(struct getopt_x *, int, char **, char const *,
                      struct pure_option *, char const *, int /*<<< orphan*/);
int getopt_x_prepare(struct getopt_x *state, int argc, char **argv,
                     const char *optstring, struct pure_option *longopts,
                     const char *optreq) {
  return getopt_x_prepare0(state, argc, argv, optstring, longopts, optreq, 0);
}


x86 assembly (clang, -O0):
<getopt_x_prepare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <getopt_x_prepare0@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_x_prepare>:
push   %rax
movl   $0x0,(%rsp)
call   1030 <getopt_x_prepare0@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.getopt_x = type { i32 }
%struct.pure_option = type { i32 }
define i32 @getopt_x_prepare(%struct.getopt_x* %0, i32 %1, i8** %2, i8* %3, %struct.pure_option* %4, i8* %5) {
%7 = alloca %struct.getopt_x*
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i8*
%11 = alloca %struct.pure_option*
%12 = alloca i8*
store %struct.getopt_x* %0, %struct.getopt_x** %7
store i32 %1, i32* %8
store i8** %2, i8*** %9
store i8* %3, i8** %10
store %struct.pure_option* %4, %struct.pure_option** %11
store i8* %5, i8** %12
%13 = load %struct.getopt_x*, %struct.getopt_x** %7
%14 = load i32, i32* %8
%15 = load i8**, i8*** %9
%16 = load i8*, i8** %10
%17 = load %struct.pure_option*, %struct.pure_option** %11
%18 = load i8*, i8** %12
%19 = call i32 @getopt_x_prepare0(%struct.getopt_x* %13, i32 %14, i8** %15, i8* %16, %struct.pure_option* %17, i8* %18, i32 0)
ret i32 %19
}

LLVM IR (-O2):
%struct.getopt_x = type { i32 }
%struct.pure_option = type { i32 }
define i32 @getopt_x_prepare(%struct.getopt_x* %0, i32 %1, i8** %2, i8* %3, %struct.pure_option* %4, i8* %5) {
%7 = tail call i32 @getopt_x_prepare0(%struct.getopt_x* %0, i32 %1, i8** %2, i8* %3, %struct.pure_option* %4, i8* %5, i32 0)
ret i32 %7
}
/* Variables and functions */
unsigned short ntohs(unsigned short);
int prefilter(void *workspace, char *packet, int size) {
  unsigned short protocol = ntohs(*(unsigned short *)packet);
  if ((protocol == 0x809) || (protocol == 0x810)) {
    return 2;
  }
  if (protocol == 0x811) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<prefilter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movzwl (%rax),%edi
call   1030 <ntohs@plt>
mov    %ax,-0x1e(%rbp)
movzwl -0x1e(%rbp),%eax
cmp    $0x809,%eax
je     1151 <prefilter+0x41>
movzwl -0x1e(%rbp),%eax
cmp    $0x810,%eax
jne    115d <prefilter+0x4d>
movl   $0x2,-0x4(%rbp)
jmp    117f <prefilter+0x6f>
movzwl -0x1e(%rbp),%eax
cmp    $0x811,%eax
jne    1178 <prefilter+0x68>
movl   $0x1,-0x4(%rbp)
jmp    117f <prefilter+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefilter>:
push   %rax
movzwl (%rsi),%edi
call   1030 <ntohs@plt>
mov    %eax,%ecx
mov    $0x2,%eax
movzwl %cx,%ecx
cmp    $0x809,%ecx
je     1144 <prefilter+0x34>
cmp    $0x810,%ecx
je     1144 <prefilter+0x34>
cmp    $0x811,%ecx
jne    1142 <prefilter+0x32>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @prefilter(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i16
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to i16*
%11 = load i16, i16* %10
%12 = call zeroext i16 @ntohs(i16 zeroext %11)
store i16 %12, i16* %8
%13 = load i16, i16* %8
%14 = zext i16 %13 to i32
%15 = icmp eq i32 %14, 2057
br i1 %15, label %20, label %16
16: ; preds = %3
%17 = load i16, i16* %8
%18 = zext i16 %17 to i32
%19 = icmp eq i32 %18, 2064
br i1 %19, label %20, label %21
20: ; preds = %16, %3
store i32 2, i32* %4
br label %27
21: ; preds = %16
%22 = load i16, i16* %8
%23 = zext i16 %22 to i32
%24 = icmp eq i32 %23, 2065
br i1 %24, label %25, label %26
25: ; preds = %21
store i32 1, i32* %4
br label %27
26: ; preds = %21
store i32 0, i32* %4
br label %27
27: ; preds = %26, %25, %20
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @prefilter(i8* nocapture readnone %0, i8* nocapture %1, i32 %2) {
%4 = bitcast i8* %1 to i16*
%5 = load i16, i16* %4
%6 = tail call zeroext i16 @ntohs(i16 zeroext %5)
switch i16 %6, label %8 [
i16 2064, label %9
i16 2057, label %9
i16 2065, label %7
]
7: ; preds = %3
br label %9
8: ; preds = %3
br label %9
9: ; preds = %3, %3, %8, %7
%10 = phi i32 [ 1, %7 ], [ 0, %8 ], [ 2, %3 ], [ 2, %3 ]
ret i32 %10
}
__attribute__((vector_size(16))) float fc(void) {
  return (__attribute__((vector_size(16))) float){0.0, 1.0, 0.0, 1.0};
}


x86 assembly (clang, -O0):
<fc>:
push   %rbp
mov    %rsp,%rbp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,-0x10(%rbp)
movaps -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc>:
movaps 0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define <4 x float> @fc() {
%1 = alloca <4 x float>
store <4 x float> <float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00>, <4 x float>* %1
%2 = load <4 x float>, <4 x float>* %1
ret <4 x float> %2
}

LLVM IR (-O2):
define <4 x float> @fc() {
ret <4 x float> <float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00>
}
void ASN1_item_pack(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_item_pack() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ futex_wake(int *, int);
int wake_single(unsigned int *lock) {
  futex_wake((int *)lock, (int)1);
  return 0;
}


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

x86 assembly (clang, -O2):
<wake_single>:
push   %rax
mov    $0x1,%esi
call   1030 <futex_wake@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @wake_single(i32* %0) {
%2 = tail call i32 @futex_wake(i32* %0, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int i;
  for (i = 0; i < 65536; ++i)
    printf("int foo%04x (void) { return %d; }\n", i, (i & 31) == 0 ? 0 : i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x10000,-0x8(%rbp)
jge    1178 <main+0x68>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1f,%eax
cmp    $0x0,%eax
jne    1152 <main+0x42>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1158 <main+0x48>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edx
and    $0x1f,%edx
cmovne %ebx,%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x10000,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [35 x i8] c"int foo%04x (void) { return %d; }\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = and i32 %2, 31
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 0, i32 %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %5)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 65536
br i1 %8, label %9, label %1
9: ; preds = %1
ret i32 0
}
void gdk_display_list_devices() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_list_devices() {
ret void
}
/* Type definitions */
typedef unsigned char __u32;

/* Variables and functions */
__u32 __le32_to_cpup(unsigned char *p) {
  return (p[3] << 24) + (p[2] << 16) + (p[1] << 8) + p[0];
}


x86 assembly (clang, -O0):
<__le32_to_cpup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__le32_to_cpup>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @__le32_to_cpup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = add nsw i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = add nsw i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = add nsw i32 %19, %23
%25 = trunc i32 %24 to i8
ret i8 %25
}

LLVM IR (-O2):
define zeroext i8 @__le32_to_cpup(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void minstack_print_message(void *message) {
  char *char_message = message;
  printf("%s\n", char_message);
}


x86 assembly (clang, -O0):
<minstack_print_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minstack_print_message>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @minstack_print_message(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
unsigned long rand();
unsigned long get_rand(unsigned long min, unsigned long max) {
  if (min == 0 && max == 0)
    return 0;
  return min + ((rand() % max) - min);
}


x86 assembly (clang, -O0):
<get_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <get_rand+0x33>
cmpq   $0x0,-0x18(%rbp)
jne    1143 <get_rand+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1169 <get_rand+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x10(%rbp),%rdx
add    %rdx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand>:
push   %rbx
or     %rsi,%rdi
je     1136 <get_rand+0x26>
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     113a <get_rand+0x2a>
xor    %edx,%edx
div    %rbx
mov    %rdx,%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @get_rand(i64 %0, i64 %1) {
%3 = or i64 %1, %0
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i64 (...) @rand()
%7 = urem i64 %6, %1
br label %8
8: ; preds = %2, %5
%9 = phi i64 [ %7, %5 ], [ 0, %2 ]
ret i64 %9
}
/* Variables and functions */
double tan(double);
double prewarp(double val) {
  return tan(val * 3.14159265358979323846) / 3.14159265358979323846;
}


x86 assembly (clang, -O0):
<prewarp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <tan@plt>
movsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prewarp>:
push   %rax
mulsd  0xee7(%rip),%xmm0
call   1030 <tan@plt>
divsd  0xeda(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @prewarp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FB54442D18
%5 = call double @tan(double %4)
%6 = fdiv double %5, 0x400921FB54442D18
ret double %6
}

LLVM IR (-O2):
define double @prewarp(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = tail call double @tan(double %2)
%4 = fdiv double %3, 0x400921FB54442D18
ret double %4
}