xunge/DecIR huggingface dataset:
/* Variables and functions */
float sqrtf(float const);
void glmSqrt3f(float out[3], const float x[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = sqrtf(x[i]);
}


x86 assembly (clang, -O0):
<glmSqrt3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jae    1163 <glmSqrt3f+0x53>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1030 <sqrtf@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <glmSqrt3f+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmSqrt3f>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movss  (%rsi),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     112c <glmSqrt3f+0x1c>
sqrtss %xmm0,%xmm0
jmp    1134 <glmSqrt3f+0x24>
call   1030 <sqrtf@plt>
xorps  %xmm1,%xmm1
movss  %xmm0,(%r14)
movss  0x4(%rbx),%xmm0
ucomiss %xmm1,%xmm0
jb     1149 <glmSqrt3f+0x39>
sqrtss %xmm0,%xmm0
jmp    114e <glmSqrt3f+0x3e>
call   1030 <sqrtf@plt>
movss  %xmm0,0x4(%r14)
movss  0x8(%rbx),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1167 <glmSqrt3f+0x57>
sqrtss %xmm0,%xmm0
jmp    116c <glmSqrt3f+0x5c>
call   1030 <sqrtf@plt>
movss  %xmm0,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @glmSqrt3f(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @sqrtf(float %3)
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = tail call float @sqrtf(float %6)
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = tail call float @sqrtf(float %10)
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clrscr();
int /*<<< orphan*/ printf(char *, int, int);
void main() {
  char banner[] = "Python OS .";
  clrscr();
  printf(banner, 3, 1);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clrscr@plt>
lea    -0xc(%rbp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1040 <printf@plt>
jmp    1156 <main+0x36>

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x4f206e6f68747950,%rax
6e 20 4f
mov    %rax,0x8(%rsp)
movl   $0x2e2053,0x10(%rsp)
xor    %eax,%eax
call   1030 <clrscr@plt>
lea    0x8(%rsp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1040 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1160 <main+0x40>

LLVM IR (-O0):
@__const.main.banner = [12 x i8] c"Python OS .\00"
define void @main() {
%1 = alloca [12 x i8]
%2 = bitcast [12 x i8]* %1 to i8*
%3 = call i32 (...) @clrscr()
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* %4, i32 3, i32 1)
br label %6
6: ; preds = %6, %0
br label %6
}

LLVM IR (-O2):
@__const.main.banner = [12 x i8] c"Python OS .\00"
define void @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @clrscr()
%4 = call i32 @printf(i8* %2, i32 3, i32 1)
br label %5
5: ; preds = %5, %0
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: beeflock [options] lockfile command...\n\n"
         "  -x, --exclusive    acquire an exclusive/write lock (default)\n"
         "  -s, --shared       acquire a shared/read lock\n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [160 x i8] c"Usage: beeflock [options] lockfile command...\0A\0A -x, --exclusive acquire an exclusive/write lock (default)\0A -s, --shared acquire a shared/read lock\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [159 x i8] c"Usage: beeflock [options] lockfile command...\0A\0A -x, --exclusive acquire an exclusive/write lock (default)\0A -s, --shared acquire a shared/read lock\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([159 x i8], [159 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __udivmoddi4(unsigned long long, unsigned long long,
                                unsigned long long *);
unsigned long long __umoddi3(unsigned long long u, unsigned long long v) {
  unsigned long long w;
  __udivmoddi4(u, v, &w);
  return w;
}


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

x86 assembly (clang, -O2):
<__umoddi3>:
push   %rax
mov    %rsp,%rdx
call   1030 <__udivmoddi4@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @__umoddi3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @__udivmoddi4(i64 %0, i64 %1, i64* %3)
%6 = load i64, i64* %3
ret i64 %6
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_initialize_number_of_dobldobl_Laurentials(int length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(553, &length, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_initialize_number_of_dobldobl_Laurentials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x229,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_initialize_number_of_dobldobl_Laurentials>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x229,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_initialize_number_of_dobldobl_Laurentials(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 553, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_initialize_number_of_dobldobl_Laurentials(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 553, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
int createSllNode(void *data, unsigned int flags) { return 0; }


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

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

LLVM IR (-O0):
define i32 @createSllNode(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @createSllNode(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t le24getv(void *p) {
  uint8_t *a;
  uint32_t v;
  a = p;
  v = a[0];
  v |= a[1] << 8;
  v |= a[2] << 16;
  return v;
}


x86 assembly (clang, -O0):
<le24getv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x8,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x10,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le24getv>:
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @le24getv(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 8
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
ret i32 %13
}
/* Variables and functions */
char const *strerror(int);
const char *nn_err_strerror(int errnum) {
  switch (errnum) {
  case (156384712 + 53):
    return "Nanomsg library was terminated";
  case (156384712 + 54):
    return "Operation cannot be performed in this state";
  default:
    return strerror(errnum);
  }
}


x86 assembly (clang, -O0):
<nn_err_strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x9523dfd,%eax
je     1144 <nn_err_strerror+0x34>
jmp    1131 <nn_err_strerror+0x21>
mov    -0x10(%rbp),%eax
sub    $0x9523dfe,%eax
je     1154 <nn_err_strerror+0x44>
jmp    1164 <nn_err_strerror+0x54>
lea    0xeb5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1170 <nn_err_strerror+0x60>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1170 <nn_err_strerror+0x60>
mov    -0xc(%rbp),%edi
call   1030 <strerror@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nn_err_strerror>:
cmp    $0x9523dfd,%edi
je     1128 <nn_err_strerror+0x18>
cmp    $0x9523dfe,%edi
jne    1130 <nn_err_strerror+0x20>
lea    0xef8(%rip),%rax
ret
lea    0xed1(%rip),%rax
ret
jmp    1030 <strerror@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Nanomsg library was terminated\00"
@.str.1 = [44 x i8] c"Operation cannot be performed in this state\00"
define i8* @nn_err_strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 156384765, label %5
i32 156384766, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
6: ; preds = %1
store i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i8* @strerror(i32 %8)
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %6, %5
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [31 x i8] c"Nanomsg library was terminated\00"
@.str.1 = [44 x i8] c"Operation cannot be performed in this state\00"
define i8* @nn_err_strerror(i32 %0) {
switch i32 %0, label %3 [
i32 156384765, label %5
i32 156384766, label %2
]
2: ; preds = %1
br label %5
3: ; preds = %1
%4 = tail call i8* @strerror(i32 %0)
br label %5
5: ; preds = %1, %3, %2
%6 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void ADCIntEnableEx(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000008))) |= ui32IntFlags;
}


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

x86 assembly (clang, -O2):
<ADCIntEnableEx>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
or     %rax,0x8(%rcx)
ret

LLVM IR (-O0):
define void @ADCIntEnableEx(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 8
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @ADCIntEnableEx(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 8
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}
/* Variables and functions */
int rand();
double noise(double dev) {
  double r = (rand() % 10001) / 10000.0;
  return -dev + r * (2 * dev);
}


x86 assembly (clang, -O0):
<noise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x2711,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  0xed0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xe96(%rip),%xmm2
mulsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noise>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffffd1b1b919,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xd,%ecx
add    %edx,%ecx
imul   $0x2711,%ecx,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
divsd  0xeb6(%rip),%xmm1
movsd  (%rsp),%xmm2
movapd %xmm2,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @noise(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 10001
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.000000e+04
store double %7, double* %3
%8 = load double, double* %2
%9 = fneg double %8
%10 = load double, double* %3
%11 = load double, double* %2
%12 = fmul double 2.000000e+00, %11
%13 = call double @llvm.fmuladd.f64(double %10, double %12, double %9)
ret double %13
}

LLVM IR (-O2):
define double @noise(double %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 10001
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.000000e+04
%6 = fneg double %0
%7 = fmul double %0, 2.000000e+00
%8 = tail call double @llvm.fmuladd.f64(double %5, double %7, double %6)
ret double %8
}
int read_data_bzip2(struct archive_read *a, const void **p, int *o1, int *o2) {
  return 0;
}


x86 assembly (clang, -O0):
<read_data_bzip2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.archive_read = type opaque
define i32 @read_data_bzip2(%struct.archive_read* nocapture readnone %0, i8** nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
ret i32 0
}
int main() {
  int x = 54;
  void *p = &x;
  int *p2 = p;
  assert(*p2 == 54);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x36,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x36,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i32 0, i32* %1
store i32 54, i32* %2
%5 = bitcast i32* %2 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 54
%11 = zext i1 %10 to i32
%12 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int socket_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<socket_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @socket_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 undef
}
unsigned int Ran() {
  static unsigned int m_w = 1;
  static unsigned int m_z = 2;
  m_z = 36969 * (m_z & 65535) + (m_z >> 16);
  m_w = 18000 * (m_w & 65535) + (m_w >> 16);
  return (m_z << 16) + m_w;
}


x86 assembly (clang, -O0):
<Ran>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
and    $0xffff,%eax
imul   $0x9069,%eax,%eax
mov    0x2f09(%rip),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,0x2efe(%rip)
mov    0x2ef4(%rip),%eax
and    $0xffff,%eax
imul   $0x4650,%eax,%eax
mov    0x2ee3(%rip),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,0x2ed8(%rip)
mov    0x2ed6(%rip),%eax
shl    $0x10,%eax
add    0x2ec9(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ran>:
mov    0x2f1e(%rip),%eax
movzwl %ax,%ecx
imul   $0x9069,%ecx,%ecx
shr    $0x10,%eax
add    %ecx,%eax
mov    %eax,0x2f0a(%rip)
mov    0x2f00(%rip),%ecx
movzwl %cx,%edx
imul   $0x4650,%edx,%edx
shr    $0x10,%ecx
add    %edx,%ecx
mov    %ecx,0x2eec(%rip)
shl    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
@Ran.m_w = internal global i32 1
@Ran.m_z = internal global i32 2
define i32 @Ran() {
%1 = load i32, i32* @Ran.m_z
%2 = and i32 %1, 65535
%3 = mul i32 36969, %2
%4 = load i32, i32* @Ran.m_z
%5 = lshr i32 %4, 16
%6 = add i32 %3, %5
store i32 %6, i32* @Ran.m_z
%7 = load i32, i32* @Ran.m_w
%8 = and i32 %7, 65535
%9 = mul i32 18000, %8
%10 = load i32, i32* @Ran.m_w
%11 = lshr i32 %10, 16
%12 = add i32 %9, %11
store i32 %12, i32* @Ran.m_w
%13 = load i32, i32* @Ran.m_z
%14 = shl i32 %13, 16
%15 = load i32, i32* @Ran.m_w
%16 = add i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
@Ran.m_w = internal unnamed_addr global i32 1
@Ran.m_z = internal unnamed_addr global i32 2
define i32 @Ran() {
%1 = load i32, i32* @Ran.m_z
%2 = and i32 %1, 65535
%3 = mul nuw i32 %2, 36969
%4 = lshr i32 %1, 16
%5 = add nuw i32 %3, %4
store i32 %5, i32* @Ran.m_z
%6 = load i32, i32* @Ran.m_w
%7 = and i32 %6, 65535
%8 = mul nuw nsw i32 %7, 18000
%9 = lshr i32 %6, 16
%10 = add nuw nsw i32 %8, %9
store i32 %10, i32* @Ran.m_w
%11 = shl i32 %5, 16
%12 = add i32 %10, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ current_view();
int /*<<< orphan*/ cursor_left(int /*<<< orphan*/);
void left_action() { cursor_left(current_view()); }


x86 assembly (clang, -O0):
<left_action>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <current_view@plt>
mov    %eax,%edi
call   1040 <cursor_left@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<left_action>:
push   %rax
xor    %eax,%eax
call   1030 <current_view@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <cursor_left@plt>

LLVM IR (-O0):
define void @left_action() {
%1 = call i32 (...) @current_view()
%2 = call i32 @cursor_left(i32 %1)
ret void
}

LLVM IR (-O2):
define void @left_action() {
%1 = tail call i32 (...) @current_view()
%2 = tail call i32 @cursor_left(i32 %1)
ret void
}
int test_imm_2Duint16_reg(unsigned short val) {
  return ((val) & (0x2D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Duint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x2d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Duint16_reg>:
test   $0x2d,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Duint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 45
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_2Duint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 45
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned short CountDivisibility(unsigned short divisor) {
  unsigned short cnt = 0;
  cnt = (1000 - 1) / divisor;
  return cnt;
}


x86 assembly (clang, -O0):
<CountDivisibility>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movw   $0x0,-0x4(%rbp)
movzwl -0x2(%rbp),%ecx
mov    $0x3e7,%eax
cltd
idiv   %ecx
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CountDivisibility>:
mov    $0x3e7,%ax
xor    %edx,%edx
div    %di
ret

LLVM IR (-O0):
define zeroext i16 @CountDivisibility(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
store i16 0, i16* %3
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = sdiv i32 999, %5
%7 = trunc i32 %6 to i16
store i16 %7, i16* %3
%8 = load i16, i16* %3
ret i16 %8
}

LLVM IR (-O2):
define zeroext i16 @CountDivisibility(i16 zeroext %0) {
%2 = udiv i16 999, %0
ret i16 %2
}
unsigned int f33(unsigned int x, unsigned int y) {
  return (x >> y) | (x << (8 * 4 - y));
}


x86 assembly (clang, -O0):
<f33>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f33>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f33(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 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @f33(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
void f(int h[], char i[]) {}


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

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

LLVM IR (-O0):
define void @f(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @f(i32* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ lksmith_postlock(int /*<<< orphan*/ *, int);
int lksmith_prelock(int /*<<< orphan*/ *, int);
int r_pthread_mutex_lock(int /*<<< orphan*/ *);
int pthread_mutex_lock(pthread_mutex_t *mutex) {
  int ret = lksmith_prelock(mutex, 1);
  if (ret)
    return ret;
  ret = r_pthread_mutex_lock(mutex);
  lksmith_postlock(mutex, ret);
  return ret;
}


x86 assembly (clang, -O0):
<pthread_mutex_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1040 <lksmith_prelock@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1162 <pthread_mutex_lock+0x32>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1180 <pthread_mutex_lock+0x50>
mov    -0x10(%rbp),%rdi
call   1030 <r_pthread_mutex_lock@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <lksmith_postlock@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutex_lock>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x1,%esi
call   1040 <lksmith_prelock@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    115a <pthread_mutex_lock+0x2a>
mov    %rbx,%rdi
call   1030 <r_pthread_mutex_lock@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <lksmith_postlock@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @pthread_mutex_lock(i32* %0) {
%2 = tail call i32 @lksmith_prelock(i32* %0, i32 1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @r_pthread_mutex_lock(i32* %0)
%6 = tail call i32 @lksmith_postlock(i32* %0, i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ %2, %1 ]
ret i32 %8
}
void backupRawTextFile(Selection, Offset) int Selection;
int Offset;
{
  auto int Position;
  Position = getPositionRawTextFile(Selection);
  setPositionRawTextFile(Selection, Position - Offset);
  return;
}


x86 assembly (clang, -O0):
<backupRawTextFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <getPositionRawTextFile@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    -0x8(%rbp),%esi
mov    $0x0,%al
call   1040 <setPositionRawTextFile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backupRawTextFile>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <getPositionRawTextFile@plt>
sub    %ebx,%eax
mov    %ebp,%edi
mov    %eax,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <setPositionRawTextFile@plt>

LLVM IR (-O0):
define void @backupRawTextFile(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 = call i32 (i32, ...) bitcast (i32 (...)* @getPositionRawTextFile to i32 (i32, ...)*)(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = call i32 (i32, i32, ...) bitcast (i32 (...)* @setPositionRawTextFile to i32 (i32, i32, ...)*)(i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
define void @backupRawTextFile(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @getPositionRawTextFile to i32 (i32, ...)*)(i32 %0)
%4 = sub nsw i32 %3, %1
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @setPositionRawTextFile to i32 (i32, i32, ...)*)(i32 %0, i32 %4)
ret void
}
unsigned int nondet_uint() {
  unsigned int ui;
  return ui;
}


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

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

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

LLVM IR (-O2):
define i32 @nondet_uint() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void exit_handler() {
  fflush(stdout);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<exit_handler>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_handler>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @exit_handler() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @exit_handler() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printArr(int *, int);
int /*<<< orphan*/ qsort(int *, int /*<<< orphan*/, int);
int main() {
  int i;
  int v[7] = {4, 3, 1, 7, 9, 6, 2};
  printArr(v, 7);
  qsort(v, 0, 7 - 1);
  printArr(v, 7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x7,%esi
call   1040 <printArr@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <qsort@plt>
lea    -0x30(%rbp),%rdi
mov    $0x7,%esi
call   1040 <printArr@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <printArr@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <qsort@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <printArr@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.v = [7 x i32] [i32 4, i32 3, i32 1, i32 7, i32 9, i32 6, i32 2]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [7 x i32]
store i32 0, i32* %1
%4 = bitcast [7 x i32]* %3 to i8*
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%6 = call i32 @printArr(i32* %5, i32 7)
%7 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%8 = call i32 @qsort(i32* %7, i32 0, i32 6)
%9 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%10 = call i32 @printArr(i32* %9, i32 7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.v = [7 x i32] [i32 4, i32 3, i32 1, i32 7, i32 9, i32 6, i32 2]
define i32 @main() {
%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 @printArr(i32* %3, i32 7)
%5 = call i32 @qsort(i32* %3, i32 0, i32 6)
%6 = call i32 @printArr(i32* %3, i32 7)
ret i32 0
}
/* Type definitions */
struct dnaSeq {
  int dummy;
};

/* Variables and functions */
struct dnaSeq *faReadAllSeq(char *, int);
struct dnaSeq *faReadAllDna(char *fileName) {
  return faReadAllSeq(fileName, 1);
}


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

x86 assembly (clang, -O2):
<faReadAllDna>:
mov    $0x1,%esi
jmp    1030 <faReadAllSeq@plt>

LLVM IR (-O0):
%struct.dnaSeq = type { i32 }
define %struct.dnaSeq* @faReadAllDna(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.dnaSeq* @faReadAllSeq(i8* %3, i32 1)
ret %struct.dnaSeq* %4
}

LLVM IR (-O2):
%struct.dnaSeq = type { i32 }
define %struct.dnaSeq* @faReadAllDna(i8* %0) {
%2 = tail call %struct.dnaSeq* @faReadAllSeq(i8* %0, i32 1)
ret %struct.dnaSeq* %2
}
long isvalidipaddress(char *st) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @isvalidipaddress(i8* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ foo(int, int *);
int main() {
  int x = -1;
  if (1)
    foo(1, &x);
#pragma omp taskwait
  assert(x == 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    $0x1,%edi
lea    -0x4(%rbp),%rsi
call   1040 <foo@plt>
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
call   1040 <foo@plt>
xor    %edi,%edi
cmpl   $0x1,0x4(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i32 @foo(i32 1, i32* %1)
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 -1, i32* %1
%3 = call i32 @foo(i32 1, i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret i32 0
}
long long bswap64(long long x) { return __builtin_bswap64(x); }


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

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

LLVM IR (-O0):
define i64 @bswap64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.bswap.i64(i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @bswap64(i64 %0) {
%2 = tail call i64 @llvm.bswap.i64(i64 %0)
ret i64 %2
}
int dvdcss_libabilities(void) { return 1; }


x86 assembly (clang, -O0):
<dvdcss_libabilities>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @dvdcss_libabilities() {
ret i32 1
}

LLVM IR (-O2):
define i32 @dvdcss_libabilities() {
ret i32 1
}
long GetMaxLong(void) { return ((unsigned long)-1) >> 1; }


x86 assembly (clang, -O0):
<GetMaxLong>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fffffffffffffff,%rax
ff ff 7f
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMaxLong>:
movabs $0x7fffffffffffffff,%rax
ff ff 7f
ret

LLVM IR (-O0):
define i64 @GetMaxLong() {
ret i64 9223372036854775807
}

LLVM IR (-O2):
define i64 @GetMaxLong() {
ret i64 9223372036854775807
}
int SM_finalize(int channel) { return -2; }


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

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

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

LLVM IR (-O2):
define i32 @SM_finalize(i32 %0) {
ret i32 -2
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t pcg_output_rxs_m_xs_32_32(uint32_t state) {
  uint32_t word = ((state >> ((state >> 28u) + 4u)) ^ state) * 277803737u;
  return (word >> 22u) ^ word;
}


x86 assembly (clang, -O0):
<pcg_output_rxs_m_xs_32_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1c,%ecx
add    $0x4,%ecx
shr    %cl,%eax
xor    -0x4(%rbp),%eax
imul   $0x108ef2d9,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x16,%eax
xor    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcg_output_rxs_m_xs_32_32>:
mov    %edi,%ecx
shr    $0x1c,%ecx
add    $0x4,%cl
mov    %edi,%eax
shr    %cl,%eax
xor    %edi,%eax
imul   $0x108ef2d9,%eax,%ecx
mov    %ecx,%eax
shr    $0x16,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @pcg_output_rxs_m_xs_32_32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 28
%7 = add i32 %6, 4
%8 = lshr i32 %4, %7
%9 = load i32, i32* %2
%10 = xor i32 %8, %9
%11 = mul i32 %10, 277803737
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = lshr i32 %12, 22
%14 = load i32, i32* %3
%15 = xor i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @pcg_output_rxs_m_xs_32_32(i32 %0) {
%2 = lshr i32 %0, 28
%3 = add nuw nsw i32 %2, 4
%4 = lshr i32 %0, %3
%5 = xor i32 %4, %0
%6 = mul i32 %5, 277803737
%7 = lshr i32 %6, 22
%8 = xor i32 %7, %6
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
help() {
  printf("trigonometry [-a|-s] [value]");
  printf("\n\t-a arcoseno\n\t-s seno\n");
  printf("\tvalue valor do angulo em RAD, utilize '.' ao invés de ',' Ex.: "
         "0.221\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"trigonometry [-a|-s] [value]\00"
@.str.1 = [24 x i8] c"\0A\09-a arcoseno\0A\09-s seno\0A\00"
@.str.2 = [72 x i8] c"\09value valor do angulo em RAD, utilize '.' ao inv\C3\A9s de ',' Ex.: 0.221\0A\00"
define i32 @help() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [29 x i8] c"trigonometry [-a|-s] [value]\00"
@str = [23 x i8] c"\0A\09-a arcoseno\0A\09-s seno\00"
@str.3 = [71 x i8] c"\09value valor do angulo em RAD, utilize '.' ao inv\C3\A9s de ',' Ex.: 0.221\00"
define i32 @help() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.3, i64 0, i64 0))
ret i32 undef
}
void testClosureDLLDrV(void (*closure)(double, long long, double), double a1,
                       long long a2, double a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureDLLDrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
movsd  -0x20(%rbp),%xmm1
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureDLLDrV>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

LLVM IR (-O0):
define void @testClosureDLLDrV(void (double, i64, double)* %0, double %1, i64 %2, double %3) {
%5 = alloca void (double, i64, double)*
%6 = alloca double
%7 = alloca i64
%8 = alloca double
store void (double, i64, double)* %0, void (double, i64, double)** %5
store double %1, double* %6
store i64 %2, i64* %7
store double %3, double* %8
%9 = load void (double, i64, double)*, void (double, i64, double)** %5
%10 = load double, double* %6
%11 = load i64, i64* %7
%12 = load double, double* %8
ret void
}

LLVM IR (-O2):
define void @testClosureDLLDrV(void (double, i64, double)* nocapture %0, double %1, i64 %2, double %3) {
tail call void %0(double %1, i64 %2, double %3)
ret void
}
__attribute__((always_)) void device_pm_wait_for_dev(struct device *a,
                                                     struct device *b) {}


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

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

LLVM IR (-O0):
%struct.device = type opaque
define void @device_pm_wait_for_dev(%struct.device* %0, %struct.device* %1) {
%3 = alloca %struct.device*
%4 = alloca %struct.device*
store %struct.device* %0, %struct.device** %3
store %struct.device* %1, %struct.device** %4
ret void
}

LLVM IR (-O2):
%struct.device = type opaque
define void @device_pm_wait_for_dev(%struct.device* nocapture %0, %struct.device* nocapture %1) {
ret void
}
/* Variables and functions */
int divisors_exp(int);
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ system(char *);
int main(void) {
  int i, k, sum, divn;
  i = 0;
  k = 0;
  sum = 0;
  while (divn <= 500) {
    k++;
    i++;
    sum += i;
    divn = divisors_exp(sum);
    printf("%dth triangular number is %d and has %d factors.\n", k, sum, divn);
  }
  system("PAUSE");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x1f4,-0x14(%rbp)
jg     11a1 <main+0x71>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <divisors_exp@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe69(%rip),%rdi
call   1050 <printf@plt>
jmp    1154 <main+0x24>
lea    0xe8a(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [50 x i8] c"%dth triangular number is %d and has %d factors.\0A\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %9, %0
%7 = load i32, i32* %5
%8 = icmp sle i32 %7, 500
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %4
%16 = add nsw i32 %15, %14
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = call i32 @divisors_exp(i32 %17)
store i32 %18, i32* %5
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %20, i32 %21)
br label %6
23: ; preds = %6
%24 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int Sscount(char **ss) {
  int i = 0;
  while (ss[i])
    ++i;
  return i;
}


x86 assembly (clang, -O0):
<Sscount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1130 <Sscount+0x30>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <Sscount+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sscount>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <Sscount+0x10>
ret

LLVM IR (-O0):
define i32 @Sscount(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i8**, i8*** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %5, i64 %7
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @Sscount(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fill_structs();
int main() {
  int size, value;
  fill_structs();
  size = (int)sizeof(char);
  size = (int)sizeof(short);
  size = (int)sizeof(int);
  size = (int)sizeof(long);
  size = (int)sizeof(long long);
  size = (int)sizeof(void *);
  size = (int)sizeof(void (*)(void));
  size = (int)sizeof(float);
  size = (int)sizeof(double);
  size = (int)sizeof(long double);
  value = '\377';
  value = (int)(char)-1;
  value = (int)(signed char)-1;
  value = (int)(unsigned char)-1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <fill_structs@plt>
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x8,-0x8(%rbp)
movl   $0x8,-0x8(%rbp)
movl   $0x8,-0x8(%rbp)
movl   $0x8,-0x8(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x8,-0x8(%rbp)
movl   $0x10,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
movl   $0xffffffff,-0xc(%rbp)
movl   $0xffffffff,-0xc(%rbp)
movl   $0xff,-0xc(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @fill_structs()
store i32 1, i32* %2
store i32 2, i32* %2
store i32 4, i32* %2
store i32 8, i32* %2
store i32 8, i32* %2
store i32 8, i32* %2
store i32 8, i32* %2
store i32 4, i32* %2
store i32 8, i32* %2
store i32 16, i32* %2
store i32 -1, i32* %3
store i32 -1, i32* %3
store i32 -1, i32* %3
store i32 255, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fill_structs()
ret i32 0
}