xunge/DecIR huggingface dataset:
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_append_dobldobl_solution(int n, int m, double *sol) {
  int *a, fail;
  int b[2];
  b[0] = n;
  b[1] = m;
  fail = _ada_use_c2phc4c(346, a, b, sol, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_append_dobldobl_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x24(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x15a,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_append_dobldobl_solution>:
push   %rax
mov    %rdx,%rcx
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rdx
mov    $0x15a,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solcon_append_dobldobl_solution(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca [2 x i32]
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
%10 = load i32, i32* %4
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %10, i32* %11
%12 = load i32, i32* %5
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 %12, i32* %13
%14 = load i32*, i32** %7
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%16 = load double*, double** %6
%17 = call i32 @_ada_use_c2phc4c(i32 346, i32* %14, i32* %15, double* %16, i32 0)
store i32 %17, i32* %8
%18 = load i32, i32* %8
ret i32 %18
}

LLVM IR (-O2):
define i32 @solcon_append_dobldobl_solution(i32 %0, i32 %1, double* %2) {
%4 = alloca [2 x i32]
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 %0, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %1, i32* %7
%8 = call i32 @_ada_use_c2phc4c(i32 346, i32* undef, i32* %6, double* %2, i32 0)
ret i32 %8
}
int DRV_ABB_SELFCHECK(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @DRV_ABB_SELFCHECK() {
ret i32 0
}

LLVM IR (-O2):
define i32 @DRV_ABB_SELFCHECK() {
ret i32 0
}
int main() {
  int x = 4;
  printf("Main: &x:%d\tx:%d\n", &x, x);
  f1(x);
  f1(3);
  f1(5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <f1@plt>
mov    $0x3,%edi
mov    $0x0,%al
call   1040 <f1@plt>
mov    $0x5,%edi
mov    $0x0,%al
call   1040 <f1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x4,0x4(%rsp)
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%edi
xor    %eax,%eax
call   1040 <f1@plt>
mov    $0x3,%edi
xor    %eax,%eax
call   1040 <f1@plt>
mov    $0x5,%edi
xor    %eax,%eax
call   1040 <f1@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"Main: &x:%d\09x:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 4, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %1, i32 4)
%4 = load i32, i32* %1
%5 = call i32 (i32, ...) bitcast (i32 (...)* @f1 to i32 (i32, ...)*)(i32 %4)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @f1 to i32 (i32, ...)*)(i32 3)
%7 = call i32 (i32, ...) bitcast (i32 (...)* @f1 to i32 (i32, ...)*)(i32 5)
ret i32 0
}
int my_lstat(name, buf)
char *name;
struct stat *buf;
{
  return lstat(name, buf);
}


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

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

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @my_lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i8*, i8** %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 (i8*, %struct.stat*, ...) bitcast (i32 (...)* @lstat to i32 (i8*, %struct.stat*, ...)*)(i8* %5, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @my_lstat(i8* %0, %struct.stat* %1) {
%3 = tail call i32 (i8*, %struct.stat*, ...) bitcast (i32 (...)* @lstat to i32 (i8*, %struct.stat*, ...)*)(i8* %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
double mySqrt(int);
int /*<<< orphan*/ printf(char *, int, double);
void test(int x) { printf("sqrt(%d) = %f\n", x, mySqrt(x)); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <mySqrt@plt>
mov    -0x8(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
call   1030 <mySqrt@plt>
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"sqrt(%d) = %f\0A\00"
define void @test(i32 %0) {
%2 = tail call double @mySqrt(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, double %2)
ret void
}
/* Type definitions */
typedef unsigned long long __u64;

/* Variables and functions */
__u64 chunk_to_extended(__u64 flags) {
  if ((flags & ((1ULL << 3) | (1ULL << 4) | (1ULL << 9) | (1ULL << 10) |
                (1ULL << 7) | (1ULL << 8) | (1ULL << 5) | (1ULL << 6))) == 0)
    flags |= (1ULL << 48);
  return flags;
}


x86 assembly (clang, -O0):
<chunk_to_extended>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7f8,%rax
cmp    $0x0,%rax
jne    112e <chunk_to_extended+0x2e>
movabs $0x1000000000000,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chunk_to_extended>:
movabs $0x1000000000000,%rax
or     %rdi,%rax
test   $0x7f8,%edi
cmovne %rdi,%rax
ret

LLVM IR (-O0):
define i64 @chunk_to_extended(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 2040
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %2
%8 = or i64 %7, 281474976710656
store i64 %8, i64* %2
br label %9
9: ; preds = %6, %1
%10 = load i64, i64* %2
ret i64 %10
}

LLVM IR (-O2):
define i64 @chunk_to_extended(i64 %0) {
%2 = and i64 %0, 2040
%3 = icmp eq i64 %2, 0
%4 = or i64 %0, 281474976710656
%5 = select i1 %3, i64 %4, i64 %0
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int printf_strings(int argc, char **argv) {
  char *s1 = "//This comment is a quoted string";
  char *s2 = "/* This is another quoted string */";
  printf("%s\n", s1);
  printf("%s\n", s2);
  return 0;
}


x86 assembly (clang, -O0):
<printf_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xef1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xf06(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xef6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_strings>:
push   %rbx
lea    0xf2e(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xef4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"//This comment is a quoted string\00"
@.str.1 = [36 x i8] c"/* This is another quoted string */\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @printf_strings(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"//This comment is a quoted string\00"
@.str.1 = [36 x i8] c"/* This is another quoted string */\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @printf_strings(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ root;
};
typedef TYPE_1__ XButtonReleasedEvent;

/* Variables and functions */
unsigned long get_XButtonReleasedEvent_root(void *_p) {
  return (unsigned long)((XButtonReleasedEvent *)_p)->root;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XButtonReleasedEvent_root(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XButtonReleasedEvent_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sticky() { printf("sticky, bread.so\n"); }


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"sticky, bread.so\00"
define void @sticky() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_FEint8_mem(signed char *val) {
  return ((*val) & (0xFE << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FEint8_mem>:
cmpb   $0x2,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FEint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ult i8 %2, 2
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void *Bits_memset(void *location, int byte, size_t count) {
  void *memset(void *location, int byte, size_t count);
  return memset(location, byte, count);
}


x86 assembly (clang, -O0):
<Bits_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rdx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bits_memset>:
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define i8* @Bits_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %4, i64 %2, i1 false)
ret i8* %0
}
int vfs_dq_quota_on_remount(struct super_block *sb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.super_block = type opaque
define i32 @vfs_dq_quota_on_remount(%struct.super_block* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
double sqrt(double);
double mySqrt(double value) { return sqrt(value); }


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

x86 assembly (clang, -O2):
<mySqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <mySqrt+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @mySqrt(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void fatal(const char *location, const char *message) {
  fprintf(stderr, "FATAL: %s: %s\n", location, message);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"FATAL: %s: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @fatal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"FATAL: %s: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @fatal(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
double addTwo(double volatile, int);
int /*<<< orphan*/ printf(char *, double volatile, double volatile);
int main() {
  volatile double x, y, z;
  z = 3;
  x = addTwo(z + 2, 4);
  y = addTwo(5, 7);
  printf("%e\n%e\n", x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    $0x4,%edi
call   1040 <addTwo@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  0xea3(%rip),%xmm0
mov    $0x7,%edi
call   1040 <addTwo@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x4008000000000000,%rax
mov    %rax,(%rsp)
movsd  (%rsp),%xmm0
addsd  0xec1(%rip),%xmm0
mov    $0x4,%edi
call   1040 <addTwo@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0xeb1(%rip),%xmm0
mov    $0x7,%edi
call   1040 <addTwo@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%e\0A%e\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
store volatile double 3.000000e+00, double* %3
%4 = load volatile double, double* %3
%5 = fadd double %4, 2.000000e+00
%6 = call double @addTwo(double %5, i32 4)
store volatile double %6, double* %1
%7 = call double @addTwo(double 5.000000e+00, i32 7)
store volatile double %7, double* %2
%8 = load volatile double, double* %1
%9 = load volatile double, double* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %8, double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%e\0A%e\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
store volatile double 3.000000e+00, double* %3
%7 = load volatile double, double* %3
%8 = fadd double %7, 2.000000e+00
%9 = tail call double @addTwo(double %8, i32 4)
store volatile double %9, double* %1
%10 = tail call double @addTwo(double 5.000000e+00, i32 7)
store volatile double %10, double* %2
%11 = load volatile double, double* %1
%12 = load volatile double, double* %2
%13 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %11, double %12)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(void *, int, int, int /*<<< orphan*/ *);
void *luaI_realloc(int /*<<< orphan*/, int);
void *LoadBlock(int size, FILE *D) {
  void *b = luaI_realloc(0, (size));
  fread(b, size, 1, D);
  return b;
}


x86 assembly (clang, -O0):
<LoadBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1040 <luaI_realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LoadBlock>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %edi,%edi
mov    %ebp,%esi
call   1040 <luaI_realloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1030 <fread@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @LoadBlock(i32 %0, i32* nocapture %1) {
%3 = tail call i8* @luaI_realloc(i32 0, i32 %0)
%4 = tail call i32 @fread(i8* %3, i32 %0, i32 1, i32* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void sevenWeapons(int number) {
  char *str = "Hello,LiBieGou!";
  printf("%s %d\n", str, number);
}


x86 assembly (clang, -O0):
<sevenWeapons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sevenWeapons>:
mov    %edi,%edx
lea    0xef7(%rip),%rdi
lea    0xee0(%rip),%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"Hello,LiBieGou!\00"
@.str.1 = [7 x i8] c"%s %d\0A\00"
define void @sevenWeapons(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OPER_AY_AI_16();
int /*<<< orphan*/ m68ki_set_ccr(int /*<<< orphan*/);
void m68k_op_move_16_toc_ai(void) { m68ki_set_ccr(OPER_AY_AI_16()); }


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

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

LLVM IR (-O0):
define void @m68k_op_move_16_toc_ai() {
%1 = call i32 (...) @OPER_AY_AI_16()
%2 = call i32 @m68ki_set_ccr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @m68k_op_move_16_toc_ai() {
%1 = tail call i32 (...) @OPER_AY_AI_16()
%2 = tail call i32 @m68ki_set_ccr(i32 %1)
ret void
}
/* Type definitions */
struct book {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_book(struct book *);
int /*<<< orphan*/ printf(char *);
void cleanup_new_book(struct book *x) {
  printf("Got CTRL-D, returning to menu...\n");
  free_book(x);
}


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

x86 assembly (clang, -O2):
<cleanup_new_book>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <free_book@plt>

LLVM IR (-O0):
%struct.book = type { i32 }
@.str = [34 x i8] c"Got CTRL-D, returning to menu...\0A\00"
define void @cleanup_new_book(%struct.book* %0) {
%2 = alloca %struct.book*
store %struct.book* %0, %struct.book** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = load %struct.book*, %struct.book** %2
%5 = call i32 @free_book(%struct.book* %4)
ret void
}

LLVM IR (-O2):
%struct.book = type { i32 }
@str = [33 x i8] c"Got CTRL-D, returning to menu...\00"
define void @cleanup_new_book(%struct.book* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @free_book(%struct.book* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ redecl3();
void use117() { redecl3(); }


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

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

LLVM IR (-O0):
define void @use117() {
%1 = call i32 (...) @redecl3()
ret void
}

LLVM IR (-O2):
define void @use117() {
%1 = tail call i32 (...) @redecl3()
ret void
}
/* Variables and functions */
unsigned short dxl_read_word(unsigned char, int);
unsigned short getPresentPosition(unsigned char id) {
  return dxl_read_word(id, (36));
}


x86 assembly (clang, -O0):
<getPresentPosition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x24,%esi
movzbl -0x1(%rbp),%edi
call   1030 <dxl_read_word@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPresentPosition>:
mov    $0x24,%esi
jmp    1030 <dxl_read_word@plt>

LLVM IR (-O0):
define zeroext i16 @getPresentPosition(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i16 @dxl_read_word(i8 zeroext %3, i32 36)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @getPresentPosition(i8 zeroext %0) {
%2 = tail call zeroext i16 @dxl_read_word(i8 zeroext %0, i32 36)
ret i16 %2
}
unsigned int has_zero32(unsigned int x) {
  unsigned int y;
  y = x - 0x01010101;
  x = ~x & y;
  return x & 0x80808080;
}


x86 assembly (clang, -O0):
<has_zero32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1010101,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80808080,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_zero32>:
lea    -0x1010101(%rdi),%eax
mov    %edi,%ecx
not    %ecx
and    %ecx,%eax
and    $0x80808080,%eax
ret

LLVM IR (-O0):
define i32 @has_zero32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub i32 %4, 16843009
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = xor i32 %6, -1
%8 = load i32, i32* %3
%9 = and i32 %7, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = and i32 %10, -2139062144
ret i32 %11
}

LLVM IR (-O2):
define i32 @has_zero32(i32 %0) {
%2 = add i32 %0, -16843009
%3 = and i32 %0, -2139062144
%4 = xor i32 %3, -2139062144
%5 = and i32 %4, %2
ret i32 %5
}
__typeof__(sscanf(1, 1)) test_sscanf_224(void) { return sscanf(1, 1); }


x86 assembly (clang, -O0):
<test_sscanf_224>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %rsi,%rdi
mov    $0x0,%al
call   1030 <sscanf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sscanf_224>:
mov    $0x1,%edi
mov    $0x1,%esi
xor    %eax,%eax
jmp    1030 <sscanf@plt>

LLVM IR (-O0):
define i32 @test_sscanf_224() {
%1 = call i32 (i8*, i8*, ...) @sscanf(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_sscanf_224() {
%1 = tail call i32 (i8*, i8*, ...) @sscanf(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ pr_inf_skip(char *, char const *);
int stress_tsc_supported(const char *name) {
  pr_inf_skip("%s stressor will be skipped, CPU "
              "does not support the rdtsc instruction.\n",
              name);
  return -1;
}


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

x86 assembly (clang, -O2):
<stress_tsc_supported>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <pr_inf_skip@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [74 x i8] c"%s stressor will be skipped, CPU does not support the rdtsc instruction.\0A\00"
define i32 @stress_tsc_supported(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @pr_inf_skip(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 -1
}

LLVM IR (-O2):
@.str = [74 x i8] c"%s stressor will be skipped, CPU does not support the rdtsc instruction.\0A\00"
define i32 @stress_tsc_supported(i8* %0) {
%2 = tail call i32 @pr_inf_skip(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
uid_t getuid(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @getuid() {
ret i32 0
}

LLVM IR (-O2):
define i32 @getuid() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outside(short *);
void test1(int n, int *x) {
  short i;
  for (i = 0; i < n; i++) {
    outside(&i);
  }
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movw   $0x0,-0x12(%rbp)
movswl -0x12(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114c <test1+0x3c>
lea    -0x12(%rbp),%rdi
call   1030 <outside@plt>
mov    -0x12(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x12(%rbp)
jmp    1125 <test1+0x15>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %r14
push   %rbx
push   %rax
movw   $0x0,0x6(%rsp)
test   %edi,%edi
jle    114a <test1+0x3a>
mov    %edi,%ebx
lea    0x6(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <outside@plt>
movzwl 0x6(%rsp),%eax
add    $0x1,%eax
mov    %ax,0x6(%rsp)
cwtl
cmp    %ebx,%eax
jl     1130 <test1+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @test1(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i16
store i32 %0, i32* %3
store i32* %1, i32** %4
store i16 0, i16* %5
br label %6
6: ; preds = %13, %2
%7 = load i16, i16* %5
%8 = sext i16 %7 to i32
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = call i32 @outside(i16* %5)
br label %13
13: ; preds = %11
%14 = load i16, i16* %5
%15 = add i16 %14, 1
store i16 %15, i16* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @test1(i32 %0, i32* nocapture readnone %1) {
%3 = alloca i16
%4 = bitcast i16* %3 to i8*
store i16 0, i16* %3
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %12
6: ; preds = %2, %6
%7 = call i32 @outside(i16* %3)
%8 = load i16, i16* %3
%9 = add i16 %8, 1
store i16 %9, i16* %3
%10 = sext i16 %9 to i32
%11 = icmp slt i32 %10, %0
br i1 %11, label %6, label %12
12: ; preds = %6, %2
ret void
}
void foo519(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo519(i32 %0) {
ret void
}
int *geta() {
  int a = 0;
  return &a;
}


x86 assembly (clang, -O0):
<geta>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<geta>:
lea    -0x4(%rsp),%rax
ret

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

LLVM IR (-O2):
define noalias i32* @geta() {
%1 = alloca i32
ret i32* %1
}
int bitMask(int highbit, int lowbit) {
  return ~(((~0 << highbit) & (~(1 << highbit))) | (~(~0 << lowbit)));
}


x86 assembly (clang, -O0):
<bitMask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    -0x4(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
or     %ecx,%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitMask>:
mov    %edi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
bts    %edi,%eax
mov    %esi,%ecx
shr    %cl,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @bitMask(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 = shl i32 -1, %5
%7 = load i32, i32* %3
%8 = shl i32 1, %7
%9 = xor i32 %8, -1
%10 = and i32 %6, %9
%11 = load i32, i32* %4
%12 = shl i32 -1, %11
%13 = xor i32 %12, -1
%14 = or i32 %10, %13
%15 = xor i32 %14, -1
ret i32 %15
}

LLVM IR (-O2):
define i32 @bitMask(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %0
%4 = shl nuw i32 1, %0
%5 = shl nsw i32 -1, %1
%6 = xor i32 %3, -1
%7 = or i32 %4, %6
%8 = and i32 %5, %7
ret i32 %8
}
int ini__is_empty(const char *str) { return *str == '\0'; }


x86 assembly (clang, -O0):
<ini__is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ini__is_empty>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @ini__is_empty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @ini__is_empty(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_emit_properties_changed_strv(void *bus, const char *path,
                                    const char *interface, char **names) {
  return -EINVAL;
}


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

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

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_emit_properties_changed_strv(i8* %0, i8* %1, i8* %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8**
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8** %3, i8*** %8
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_emit_properties_changed_strv(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8** nocapture readnone %3) {
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage:\n"
         "flocksplit path len\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Usage:\0Aflocksplit path len\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [27 x i8] c"Usage:\0Aflocksplit path len\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
long numa_node_size(int node, long *freep) { return -1; }


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

x86 assembly (clang, -O2):
<numa_node_size>:
mov    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @numa_node_size(i32 %0, i64* nocapture readnone %1) {
ret i64 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ rearrange(char *, int, int);
int strlen(char *);
void main() {
  char str[] = "aabbcc";
  int len = strlen(str);
  rearrange(str, len, 1);
  printf("%s\n", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xeb4(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x7(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
lea    -0x7(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1050 <rearrange@plt>
lea    -0x7(%rbp),%rsi
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x636362,0xb(%rsp)
movl   $0x62626161,0x8(%rsp)
62
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1050 <rearrange@plt>
lea    0xe9f(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [7 x i8] c"aabbcc\00"
@.str = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [7 x i8]
%2 = alloca i32
%3 = bitcast [7 x i8]* %1 to i8*
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %2
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 @rearrange(i8* %6, i32 %7, i32 1)
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@__const.main.str = [7 x i8] c"aabbcc\00"
@.str = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = call i32 @rearrange(i8* %2, i32 %3, i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
void free_mem(char *search_words[], int *search_words_cnt) {
  for (int i = 0; i < *search_words_cnt; i++) {
    free(search_words[i]);
  }
  free(search_words);
}


x86 assembly (clang, -O0):
<free_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    1155 <free_mem+0x45>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <free_mem+0x17>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_mem>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
cmpl   $0x0,(%rsi)
jle    1145 <free_mem+0x35>
mov    %rsi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
movslq (%r15),%rax
cmp    %rax,%rbx
jl     1130 <free_mem+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_mem(i8** nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp sgt i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %7, %2
%6 = bitcast i8** %0 to i8*
tail call void @free(i8* %6)
ret void
7: ; preds = %2, %7
%8 = phi i64 [ %11, %7 ], [ 0, %2 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %8, 1
%12 = load i32, i32* %1
%13 = sext i32 %12 to i64
%14 = icmp slt i64 %11, %13
br i1 %14, label %7, label %5
}
int hxd_v_abi(void) { return 0x20130210; }


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

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

LLVM IR (-O0):
define i32 @hxd_v_abi() {
ret i32 538116624
}

LLVM IR (-O2):
define i32 @hxd_v_abi() {
ret i32 538116624
}
/* Variables and functions */
int /*<<< orphan*/ hstcp_register();
int /*<<< orphan*/ set_linux_file_name(char *);
void module_register(void) {
  hstcp_register();
  set_linux_file_name("tcp_highspeed.c");
}


x86 assembly (clang, -O0):
<module_register>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <hstcp_register@plt>
lea    0xece(%rip),%rdi
call   1040 <set_linux_file_name@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_register>:
push   %rax
xor    %eax,%eax
call   1030 <hstcp_register@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <set_linux_file_name@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"tcp_highspeed.c\00"
define void @module_register() {
%1 = call i32 (...) @hstcp_register()
%2 = call i32 @set_linux_file_name(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"tcp_highspeed.c\00"
define void @module_register() {
%1 = tail call i32 (...) @hstcp_register()
%2 = tail call i32 @set_linux_file_name(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int get_mtd_start(char *);
int get_cs_offset() {
  int ret;
  ret = get_mtd_start("CS");
  return ret;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"CS\00"
define i32 @get_cs_offset() {
%1 = tail call i32 @get_mtd_start(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void dump_queue(struct queue *qp) {}


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

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

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

LLVM IR (-O2):
%struct.queue = type opaque
define void @dump_queue(%struct.queue* nocapture %0) {
ret void
}
/* Variables and functions */
int atoi(char const *);
int chess_square(int, int);
int chess_square_index(const char *square) {
  int rank, file;
  file = square[0] - 97;
  rank = atoi(++square) - 1;
  return chess_square(rank, file);
}


x86 assembly (clang, -O0):
<chess_square_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x61,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x8(%rbp)
call   1040 <atoi@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <chess_square@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chess_square_index>:
push   %rbx
movsbl (%rdi),%ebx
add    $0xffffff9f,%ebx
add    $0x1,%rdi
call   1040 <atoi@plt>
lea    -0x1(%rax),%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <chess_square@plt>

LLVM IR (-O0):
define i32 @chess_square_index(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 97
store i32 %9, i32* %4
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
%12 = call i32 @atoi(i8* %11)
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @chess_square(i32 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @chess_square_index(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = add nsw i32 %3, -97
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = tail call i32 @atoi(i8* %5)
%7 = add nsw i32 %6, -1
%8 = tail call i32 @chess_square(i32 %7, i32 %4)
ret i32 %8
}
/* Variables and functions */
double cos(double);
double sin(double);
double sincos(double x, double *sinx, double *cosx) {
  *sinx = sin(x);
  *cosx = cos(x);
}


x86 assembly (clang, -O0):
<sincos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sincos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,(%rbx)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @sincos(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
store double %0, double* %5
store double* %1, double** %6
store double* %2, double** %7
%8 = load double, double* %5
%9 = call double @sin(double %8)
%10 = load double*, double** %6
store double %9, double* %10
%11 = load double, double* %5
%12 = call double @cos(double %11)
%13 = load double*, double** %7
store double %12, double* %13
%14 = load double, double* %4
ret double %14
}

LLVM IR (-O2):
define double @sincos(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = tail call double @sin(double %0)
store double %4, double* %1
%5 = tail call double @cos(double %0)
store double %5, double* %2
ret double undef
}