xunge/DecIR huggingface dataset:
/* Variables and functions */
void *realloc(void *, size_t);
int /*<<< orphan*/ xalloc_fail();
void *xrealloc(void *p, size_t n) {
  p = realloc(p, n);
  if (p == 0)
    xalloc_fail();
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1153 <xrealloc+0x33>
mov    $0x0,%al
call   1030 <xalloc_fail@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @xalloc_fail()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
int scard_function_is_context_valid_return(void *user_data, struct stream *in_s,
                                           int len, int status) {
  return 0;
}


x86 assembly (clang, -O0):
<scard_function_is_context_valid_return>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.stream = type opaque
define i32 @scard_function_is_context_valid_return(i8* nocapture readnone %0, %struct.stream* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 0
}
unsigned xrop3_96_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ S;
  stk1 = T & stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_96_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_96_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
not    %eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
and    %eax,%ecx
movzbl %cl,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_96_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = and i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %5
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = or i32 %31, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @xrop3_96_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = and i32 %4, 255
%8 = xor i32 %7, 255
%9 = and i32 %8, %6
%10 = or i32 %9, %3
ret i32 %10
}
void XSecurityQueryExtension() {}


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

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

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

LLVM IR (-O2):
define void @XSecurityQueryExtension() {
ret void
}
int C_Utils_compare_double_ptr(const double *item1, const double *item2) {
  double i1 = *item1;
  double i2 = *item2;
  if (i1 == i2)
    return 0;
  return i1 < i2 ? -1 : 1;
}


x86 assembly (clang, -O0):
<C_Utils_compare_double_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    1148 <C_Utils_compare_double_ptr+0x48>
jp     1148 <C_Utils_compare_double_ptr+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1166 <C_Utils_compare_double_ptr+0x66>
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
mov    $0x1,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @C_Utils_compare_double_ptr(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp oeq double %3, %4
%6 = fcmp olt double %3, %4
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
void debug_dminfo() {
  unsigned int t[0x100];
  unsigned int t2[7];
  int (*get_maxdrivers)(unsigned int *) = (void *)0xFF07348c;
  int (*drivers_suspend_maybe)() = (void *)0xFF073770;
  int (*drivers_resume_maybe)() = (void *)0xFF07379c;
  int (*get_drivers_info)(unsigned int *) = (void *)0xFF0737bc;
  int i;
  unsigned int r;
  for (i = 0; i < 0x100; i++)
    t[i] = 0xdeadbeef;
  {};
  {};
  r = get_maxdrivers(t2);
  {};
  {};
  {};
  return;
  r = drivers_suspend_maybe();
  {};
  r = get_drivers_info(t);
  {};
  while (r == 0) {
    for (i = 0; i < 0x100; i++) {
    };
    {};
    r = get_drivers_info(t);
    {};
  }
  {};
}


x86 assembly (clang, -O0):
<debug_dminfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
mov    $0xff07348c,%eax
mov    %rax,-0x428(%rbp)
mov    $0xff073770,%eax
mov    %rax,-0x430(%rbp)
mov    $0xff07379c,%eax
mov    %rax,-0x438(%rbp)
mov    $0xff0737bc,%eax
mov    %rax,-0x440(%rbp)
movl   $0x0,-0x444(%rbp)
cmpl   $0x100,-0x444(%rbp)
jge    117b <debug_dminfo+0x7b>
movslq -0x444(%rbp),%rax
movl   $0xdeadbeef,-0x400(%rbp,%rax,4)
ef be ad de
mov    -0x444(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x444(%rbp)
jmp    1145 <debug_dminfo+0x45>
mov    -0x428(%rbp),%rax
lea    -0x420(%rbp),%rdi
call   *%rax
mov    %eax,-0x448(%rbp)
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_dminfo>:
sub    $0x28,%rsp
mov    %rsp,%rdi
mov    $0xff07348c,%eax
call   *%rax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @debug_dminfo() {
%1 = alloca [256 x i32]
%2 = alloca [7 x i32]
%3 = alloca i32 (i32*)*
%4 = alloca i32 (...)*
%5 = alloca i32 (...)*
%6 = alloca i32 (i32*)*
%7 = alloca i32
%8 = alloca i32
store i32 (i32*)* inttoptr (i64 4278662284 to i32 (i32*)*), i32 (i32*)** %3
store i32 (...)* inttoptr (i64 4278663024 to i32 (...)*), i32 (...)** %4
store i32 (...)* inttoptr (i64 4278663068 to i32 (...)*), i32 (...)** %5
store i32 (i32*)* inttoptr (i64 4278663100 to i32 (i32*)*), i32 (i32*)** %6
store i32 0, i32* %7
br label %9
9: ; preds = %16, %0
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 256
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 %14
store i32 -559038737, i32* %15
br label %16
16: ; preds = %12
%17 = load i32, i32* %7
%18 = add nsw i32 %17, 1
store i32 %18, i32* %7
br label %9
19: ; preds = %9
%20 = load i32 (i32*)*, i32 (i32*)** %3
%21 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%22 = call i32 %20(i32* %21)
store i32 %22, i32* %8
ret void
}

LLVM IR (-O2):
define void @debug_dminfo() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 inttoptr (i64 4278662284 to i32 (i32*)*)(i32* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vprintf(char *, int /*<<< orphan*/);
void uninivar_vprintf(void) {
  char *format;
  va_list arg;
  (void)vprintf(format, arg);
}


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

x86 assembly (clang, -O2):
<uninivar_vprintf>:
jmp    1030 <vprintf@plt>

LLVM IR (-O0):
define void @uninivar_vprintf() {
%1 = alloca i8*
%2 = alloca i32
%3 = load i8*, i8** %1
%4 = load i32, i32* %2
%5 = call i32 @vprintf(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @uninivar_vprintf() {
%1 = tail call i32 @vprintf(i8* undef, i32 undef)
ret void
}
int metal_bitmap_is_bit_set(unsigned long *bitmap, int bit) {
  return bitmap[bit / (8 * sizeof(unsigned long))] &
         (1UL << (bit & ((8 * sizeof(unsigned long)) - 1)));
}


x86 assembly (clang, -O0):
<metal_bitmap_is_bit_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shr    $0x6,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
and    $0x3f,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<metal_bitmap_is_bit_set>:
movslq %esi,%rcx
mov    $0x1,%eax
shl    %cl,%rax
shr    $0x6,%rcx
and    (%rdi,%rcx,8),%eax
ret

LLVM IR (-O0):
define i32 @metal_bitmap_is_bit_set(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = udiv i64 %7, 64
%9 = getelementptr inbounds i64, i64* %5, i64 %8
%10 = load i64, i64* %9
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = and i64 %12, 63
%14 = shl i64 1, %13
%15 = and i64 %10, %14
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @metal_bitmap_is_bit_set(i64* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = lshr i64 %3, 6
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = and i64 %3, 63
%8 = shl nuw i64 1, %7
%9 = and i64 %6, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}
int registerFn() {
  register int x = 0;
  x++;
  return x;
}


x86 assembly (clang, -O0):
<registerFn>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @registerFn() {
ret i32 1
}
int vector_dimension(float *r, float *a, int n) {
  (void)a;
  *r = n;
  return 1;
}


x86 assembly (clang, -O0):
<vector_dimension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cvtsi2ssl -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_dimension>:
cvtsi2ss %edx,%xmm0
movss  %xmm0,(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @vector_dimension(float* %0, float* %1, i32 %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i32
store float* %0, float** %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load float*, float** %5
%8 = load i32, i32* %6
%9 = sitofp i32 %8 to float
%10 = load float*, float** %4
store float %9, float* %10
ret i32 1
}

LLVM IR (-O2):
define i32 @vector_dimension(float* nocapture writeonly %0, float* nocapture readnone %1, i32 %2) {
%4 = sitofp i32 %2 to float
store float %4, float* %0
ret i32 1
}
/* Variables and functions */
float fmaf(float, float, float);
float fma32(float x, float y, float z) { return fmaf(x, y, z); }


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

x86 assembly (clang, -O2):
<fma32>:
jmp    1030 <fmaf@plt>

LLVM IR (-O0):
define float @fma32(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @llvm.fma.f32(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @fma32(float %0, float %1, float %2) {
%4 = tail call float @llvm.fma.f32(float %0, float %1, float %2)
ret float %4
}
void *map_pre_func_1(void *msg) { return msg; }


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

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

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

LLVM IR (-O2):
define i8* @map_pre_func_1(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
struct timespec {
  int tv_sec;
  unsigned long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
size_t now_millis(void) {
  struct timespec ts;
  clock_gettime(CLOCK_REALTIME, &ts);
  return ts.tv_sec * 1000 + ts.tv_nsec / 1000000ul;
}


x86 assembly (clang, -O0):
<now_millis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,-0x10(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now_millis>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
movabs $0x431bde82d7b634db,%rax
de 1b 43
mulq   0x10(%rsp)
movslq 0x8(%rsp),%rax
imul   $0x3e8,%rax,%rax
shr    $0x12,%rdx
add    %rdx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @now_millis() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = udiv i64 %9, 1000000
%11 = add i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @now_millis() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%10 = load i64, i64* %9
%11 = udiv i64 %10, 1000000
%12 = add nsw i64 %11, %8
ret i64 %12
}
/* Variables and functions */
double mysin();
double bar(double x) { return mysin(); }


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

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

LLVM IR (-O0):
define double @bar(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @mysin()
ret double %3
}

LLVM IR (-O2):
define double @bar(double %0) {
%2 = tail call double (...) @mysin()
ret double %2
}
unsigned int swab32(unsigned int ui) {
  return ((ui << 24) & 0xFF000000) | ((ui << 8) & 0x00FF0000) |
         ((ui >> 8) & 0x0000FF00) | ((ui >> 24) & 0x000000FF);
}


x86 assembly (clang, -O0):
<swab32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
and    $0xff000000,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x18,%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swab32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = and i32 %4, -16777216
%6 = load i32, i32* %2
%7 = shl i32 %6, 8
%8 = and i32 %7, 16711680
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = lshr i32 %10, 8
%12 = and i32 %11, 65280
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = lshr i32 %14, 24
%16 = and i32 %15, 255
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @swab32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int test_xcrypt_ctr(char *);
int test_decrypt_ctr(void) { return test_xcrypt_ctr("decrypt"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"decrypt\00"
define i32 @test_decrypt_ctr() {
%1 = call i32 @test_xcrypt_ctr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"decrypt\00"
define i32 @test_decrypt_ctr() {
%1 = tail call i32 @test_xcrypt_ctr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
void Selective_FdZero(fd_set *s) { FD_ZERO(s); }


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

x86 assembly (clang, -O2):
<Selective_FdZero>:
jmp    1030 <FD_ZERO@plt>

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

LLVM IR (-O2):
define void @Selective_FdZero(i32* %0) {
%2 = tail call i32 @FD_ZERO(i32* %0)
ret void
}
void save_prefs() {}


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

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

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

LLVM IR (-O2):
define void @save_prefs() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delayMicroseconds(int);
void one() { delayMicroseconds(688); }


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

x86 assembly (clang, -O2):
<one>:
mov    $0x2b0,%edi
jmp    1030 <delayMicroseconds@plt>

LLVM IR (-O0):
define void @one() {
%1 = call i32 @delayMicroseconds(i32 688)
ret void
}

LLVM IR (-O2):
define void @one() {
%1 = tail call i32 @delayMicroseconds(i32 688)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ libc();
int /*<<< orphan*/ libx();
int main() {
  libc();
  libx();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @libc()
%2 = tail call i32 (...) @libx()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
pid_t setsid() {
  errno = ENOSYS;
  return (pid_t)-1;
}


x86 assembly (clang, -O0):
<setsid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setsid>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @setsid() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @setsid() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}
char *dlerror() {}


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

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

LLVM IR (-O0):
define i8* @dlerror() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @dlerror() {
ret i8* undef
}
int tmul_ok_32(int x, int y) {
  int p = x * y;
  return !x || p / x == y;
}


x86 assembly (clang, -O0):
<tmul_ok_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xd(%rbp)
je     1133 <tmul_ok_32+0x33>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x4(%rbp)
cmp    -0x8(%rbp),%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @tmul_ok_32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i32, i32* %3
%14 = sdiv i32 %12, %13
%15 = load i32, i32* %4
%16 = icmp eq i32 %14, %15
br label %17
17: ; preds = %11, %2
%18 = phi i1 [ true, %2 ], [ %16, %11 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @tmul_ok_32(i32 %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ japi_setxor(int, int);
void j_setxor(int arg0, int arg1) { japi_setxor(arg0, arg1); }


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

x86 assembly (clang, -O2):
<j_setxor>:
jmp    1030 <japi_setxor@plt>

LLVM IR (-O0):
define void @j_setxor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @japi_setxor(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @j_setxor(i32 %0, i32 %1) {
%3 = tail call i32 @japi_setxor(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int errno;
int setErrno(int val) {
  errno = val;
  return val;
}


x86 assembly (clang, -O0):
<setErrno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ecf(%rip),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setErrno>:
mov    %edi,%eax
mov    0x2ed7(%rip),%rcx
mov    %edi,(%rcx)
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @setErrno(i32 returned %0) {
store i32 %0, i32* @errno
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
void readstr(FILE *f, char *string) {
  do {
    fgets(string, 255, f);
  } while ((string[0] == '/') || (string[0] == '\n'));
  return;
}


x86 assembly (clang, -O0):
<readstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0xff,%esi
call   1030 <fgets@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0x11(%rbp)
je     1157 <readstr+0x47>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1120 <readstr+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readstr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0xff,%esi
mov    %r14,%rdx
call   1030 <fgets@plt>
movzbl (%rbx),%eax
cmp    $0xa,%al
je     1120 <readstr+0x10>
cmp    $0x2f,%al
je     1120 <readstr+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @readstr(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %21, %2
%6 = load i8*, i8** %4
%7 = load i32*, i32** %3
%8 = call i32 @fgets(i8* %6, i32 255, i32* %7)
br label %9
9: ; preds = %5
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 47
br i1 %14, label %21, label %15
15: ; preds = %9
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 10
br label %21
21: ; preds = %15, %9
%22 = phi i1 [ true, %9 ], [ %20, %15 ]
br i1 %22, label %5, label %23
23: ; preds = %21
ret void
}

LLVM IR (-O2):
define void @readstr(i32* nocapture %0, i8* %1) {
br label %3
3: ; preds = %6, %2
%4 = tail call i32 @fgets(i8* %1, i32 255, i32* %0)
%5 = load i8, i8* %1
switch i8 %5, label %7 [
i8 47, label %6
i8 10, label %6
]
6: ; preds = %3, %3
br label %3
7: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _printf_putll(unsigned long long, int, int /*<<< orphan*/,
                                 int /*<<< orphan*/, char, char *);
void putludec(unsigned long long x) {
  _printf_putll(x, 10, 0, 0, ' ', ((char *)0x3000000));
}


x86 assembly (clang, -O0):
<putludec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
xor    %ecx,%ecx
mov    $0x20,%r8d
mov    $0x3000000,%r9d
mov    %ecx,%edx
call   1030 <_printf_putll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putludec>:
mov    $0x3000000,%r9d
mov    $0xa,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x20,%r8d
jmp    1030 <_printf_putll@plt>

LLVM IR (-O0):
define void @putludec(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_printf_putll(i64 %3, i32 10, i32 0, i32 0, i8 signext 32, i8* inttoptr (i64 50331648 to i8*))
ret void
}

LLVM IR (-O2):
define void @putludec(i64 %0) {
%2 = tail call i32 @_printf_putll(i64 %0, i32 10, i32 0, i32 0, i8 signext 32, i8* inttoptr (i64 50331648 to i8*))
ret void
}
void ff_hevc_put_hevc_bi_epel_h48_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_h48_10_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ sleep(int);
void *thr_fun(void *arg) {
  printf("this is thread %lu (0x%x)\n", pthread_self(), pthread_self());
  sleep(1);
  sleep(1);
  printf("exit from child thread\n");
  return (void *)24;
}


x86 assembly (clang, -O0):
<thr_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x18,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr_fun>:
push   %rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
mov    $0x18,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"this is thread %lu (0x%x)\0A\00"
@.str.1 = [24 x i8] c"exit from child thread\0A\00"
define i8* @thr_fun(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @pthread_self()
%4 = call i32 (...) @pthread_self()
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = call i32 @sleep(i32 1)
%7 = call i32 @sleep(i32 1)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i8* inttoptr (i64 24 to i8*)
}

LLVM IR (-O2):
@.str = [27 x i8] c"this is thread %lu (0x%x)\0A\00"
@str = [23 x i8] c"exit from child thread\00"
define i8* @thr_fun(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 (...) @pthread_self()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = tail call i32 @sleep(i32 1)
%6 = tail call i32 @sleep(i32 1)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i8* inttoptr (i64 24 to i8*)
}
/* Variables and functions */
int ENODEV;
int sci_adi_p2v(unsigned long paddr, unsigned long *vaddr) { return -ENODEV; }


x86 assembly (clang, -O0):
<sci_adi_p2v>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sci_adi_p2v>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @sci_adi_p2v(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
%5 = load i32, i32* @ENODEV
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @sci_adi_p2v(i64 %0, i64* nocapture readnone %1) {
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
unsigned short icrc(int /*<<< orphan*/, unsigned long, short, int);
int main(void) {
  unsigned short i1, i2;
  unsigned long n;
  n = 40;
  i1 = icrc(0, n, (short)0, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x28,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
mov    $0x1,%ecx
mov    %edx,%edi
call   1030 <icrc@plt>
mov    %ax,-0x6(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x28,%esi
xor    %edi,%edi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <icrc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
%4 = alloca i64
store i32 0, i32* %1
store i64 40, i64* %4
%5 = load i64, i64* %4
%6 = call zeroext i16 @icrc(i32 0, i64 %5, i16 signext 0, i32 1)
store i16 %6, i16* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call zeroext i16 @icrc(i32 0, i64 40, i16 signext 0, i32 1)
ret i32 0
}
/* Type definitions */
struct dm_verity_sig_opts {
  int dummy;
};

/* Variables and functions */
void verity_verify_sig_opts_cleanup(struct dm_verity_sig_opts *sig_opts) {}


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

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

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

LLVM IR (-O2):
%struct.dm_verity_sig_opts = type { i32 }
define void @verity_verify_sig_opts_cleanup(%struct.dm_verity_sig_opts* nocapture %0) {
ret void
}
void fa180(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
p0C:
  goto p0C;
  goto a;
a:
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa180>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa180+0x4>

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

LLVM IR (-O0):
define void @fa180() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; No predecessors!
br label %27
27: ; preds = %27, %26
br label %27
}

LLVM IR (-O2):
define void @fa180() {
br label %1
1: ; preds = %1, %0
br label %1
}
char ToLower(char a) {
  switch (a) {
  case 'A':
    return 'a';
    break;
  case 'C':
    return 'c';
    break;
  case 'G':
    return 'g';
    break;
  case 'T':
    return 't';
    break;
  case 'N':
    return 'n';
    break;
  default:
    return a;
  }
}


x86 assembly (clang, -O0):
<ToLower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x13,%eax
ja     1161 <ToLower+0x61>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x61,-0x1(%rbp)
jmp    1167 <ToLower+0x67>
movb   $0x63,-0x1(%rbp)
jmp    1167 <ToLower+0x67>
movb   $0x67,-0x1(%rbp)
jmp    1167 <ToLower+0x67>
movb   $0x74,-0x1(%rbp)
jmp    1167 <ToLower+0x67>
movb   $0x6e,-0x1(%rbp)
jmp    1167 <ToLower+0x67>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToLower>:
lea    -0x41(%rdi),%ecx
cmp    $0x13,%ecx
ja     111d <ToLower+0x1d>
mov    $0x61,%al
lea    0xeef(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x63,%al
ret
mov    %edi,%eax
ret
mov    $0x67,%al
ret
mov    $0x6e,%al
ret
mov    $0x74,%al
ret

LLVM IR (-O0):
define signext i8 @ToLower(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %11 [
i32 65, label %6
i32 67, label %7
i32 71, label %8
i32 84, label %9
i32 78, label %10
]
6: ; preds = %1
store i8 97, i8* %2
br label %13
7: ; preds = %1
store i8 99, i8* %2
br label %13
8: ; preds = %1
store i8 103, i8* %2
br label %13
9: ; preds = %1
store i8 116, i8* %2
br label %13
10: ; preds = %1
store i8 110, i8* %2
br label %13
11: ; preds = %1
%12 = load i8, i8* %3
store i8 %12, i8* %2
br label %13
13: ; preds = %11, %10, %9, %8, %7, %6
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @ToLower(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %7 [
i32 65, label %8
i32 67, label %3
i32 71, label %4
i32 84, label %5
i32 78, label %6
]
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3
%9 = phi i8 [ %0, %7 ], [ 110, %6 ], [ 116, %5 ], [ 103, %4 ], [ 99, %3 ], [ 97, %1 ]
ret i8 %9
}
void gtk_tree_model_get_string_from_iter() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_model_get_string_from_iter() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ conf_init();
int /*<<< orphan*/ garray_init();
int /*<<< orphan*/ glob_init();
int /*<<< orphan*/ mess_init();
int /*<<< orphan*/ obj_init();
void pd_init(void) {
  mess_init();
  obj_init();
  conf_init();
  glob_init();
  garray_init();
}


x86 assembly (clang, -O0):
<pd_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <mess_init@plt>
mov    $0x0,%al
call   1060 <obj_init@plt>
mov    $0x0,%al
call   1070 <conf_init@plt>
mov    $0x0,%al
call   1030 <glob_init@plt>
mov    $0x0,%al
call   1050 <garray_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd_init>:
push   %rax
xor    %eax,%eax
call   1040 <mess_init@plt>
xor    %eax,%eax
call   1060 <obj_init@plt>
xor    %eax,%eax
call   1070 <conf_init@plt>
xor    %eax,%eax
call   1030 <glob_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <garray_init@plt>

LLVM IR (-O0):
define void @pd_init() {
%1 = call i32 (...) @mess_init()
%2 = call i32 (...) @obj_init()
%3 = call i32 (...) @conf_init()
%4 = call i32 (...) @glob_init()
%5 = call i32 (...) @garray_init()
ret void
}

LLVM IR (-O2):
define void @pd_init() {
%1 = tail call i32 (...) @mess_init()
%2 = tail call i32 (...) @obj_init()
%3 = tail call i32 (...) @conf_init()
%4 = tail call i32 (...) @glob_init()
%5 = tail call i32 (...) @garray_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printMessage(void) { printf("Programming is fun. \n"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Programming is fun. \0A\00"
define void @printMessage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Programming is fun. \00"
define void @printMessage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
void gtk_text_iter_get_visible_line_offset() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_get_visible_line_offset() {
ret void
}
void foo823(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo823(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void sar_reg32_imm8(unsigned int reg32, unsigned char imm8) {
  put8(0xC1);
  put8(0xF8 + reg32);
  put8(imm8);
}


x86 assembly (clang, -O0):
<sar_reg32_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    $0xc1,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%eax
add    $0xf8,%eax
movzbl %al,%edi
call   1030 <put8@plt>
movzbl -0x5(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sar_reg32_imm8>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xc1,%edi
call   1030 <put8@plt>
add    $0xf8,%bpl
movzbl %bpl,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @sar_reg32_imm8(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = call i32 @put8(i8 zeroext -63)
%6 = load i32, i32* %3
%7 = add i32 248, %6
%8 = trunc i32 %7 to i8
%9 = call i32 @put8(i8 zeroext %8)
%10 = load i8, i8* %4
%11 = call i32 @put8(i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @sar_reg32_imm8(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @put8(i8 zeroext -63)
%4 = trunc i32 %0 to i8
%5 = add i8 %4, -8
%6 = tail call i32 @put8(i8 zeroext %5)
%7 = tail call i32 @put8(i8 zeroext %1)
ret void
}
void rop3_68_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~*D;
  stk1 = S & stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_68_0_0>:
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
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_68_0_0>:
mov    (%rdi),%al
not    %al
and    %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_68_0_0(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 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %8
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = and i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %7
%20 = load i8, i8* %7
%21 = load i8*, i8** %4
store i8 %20, i8* %21
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @XDisplayName() {
ret void
}
void test_signed() {
  signed char a;
  signed short b;
  signed int c;
  signed long d;
  signed long long e;
  signed short int f;
  signed long int g;
  signed long long int h;
}


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

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

LLVM IR (-O0):
define void @test_signed() {
%1 = alloca i8
%2 = alloca i16
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i16
%7 = alloca i64
%8 = alloca i64
ret void
}

LLVM IR (-O2):
define void @test_signed() {
ret void
}
void test_ulong_cst(void) {
  const unsigned long max = (0x7fffffffffffffffL * 2LU + 1);
  sink(f_ulong_1(0));
  sink(f_ulong_1(1));
  (void)&max;
}


x86 assembly (clang, -O0):
<test_ulong_cst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
xor    %edi,%edi
mov    $0x0,%al
call   1030 <f_ulong_1@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <sink@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <f_ulong_1@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <sink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ulong_cst>:
push   %rax
xor    %edi,%edi
xor    %eax,%eax
call   1030 <f_ulong_1@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <sink@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <f_ulong_1@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <sink@plt>

LLVM IR (-O0):
define void @test_ulong_cst() {
%1 = alloca i64
store i64 -1, i64* %1
%2 = call i32 (i32, ...) bitcast (i32 (...)* @f_ulong_1 to i32 (i32, ...)*)(i32 0)
%3 = call i32 (i32, ...) bitcast (i32 (...)* @sink to i32 (i32, ...)*)(i32 %2)
%4 = call i32 (i32, ...) bitcast (i32 (...)* @f_ulong_1 to i32 (i32, ...)*)(i32 1)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @sink to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @test_ulong_cst() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @f_ulong_1 to i32 (i32, ...)*)(i32 0)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @sink to i32 (i32, ...)*)(i32 %1)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @f_ulong_1 to i32 (i32, ...)*)(i32 1)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @sink to i32 (i32, ...)*)(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OPM_err(int);
void OPB_err(int n) { OPM_err(n); }


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

x86 assembly (clang, -O2):
<OPB_err>:
jmp    1030 <OPM_err@plt>

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

LLVM IR (-O2):
define void @OPB_err(i32 %0) {
%2 = tail call i32 @OPM_err(i32 %0)
ret void
}