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

/* Variables and functions */
int /*<<< orphan*/ ASN1_SET_ANY_it;
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
ASN1_SEQUENCE_ANY *d2i_ASN1_SET_ANY(ASN1_SEQUENCE_ANY **a,
                                    const unsigned char **in, long len) {
  return (ASN1_SEQUENCE_ANY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                            &ASN1_SET_ANY_it);
}


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

x86 assembly (clang, -O2):
<d2i_ASN1_SET_ANY>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@ASN1_SET_ANY_it = global i32 0
define i32* @d2i_ASN1_SET_ANY(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @ASN1_SET_ANY_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@ASN1_SET_ANY_it = global i32 0
define i32* @d2i_ASN1_SET_ANY(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @ASN1_SET_ANY_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void generic_cpu_swap32p(uint32_t *outp, uint32_t in) {
  *outp = ((in & 0xFF000000) >> 24) | ((in & 0x00FF0000) >> 8) |
          ((in & 0x0000FF00) << 8) | ((in & 0x000000FF) << 24);
}


x86 assembly (clang, -O0):
<generic_cpu_swap32p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
mov    -0xc(%rbp),%eax
and    $0xff0000,%eax
sar    $0x8,%eax
or     %eax,%ecx
mov    -0xc(%rbp),%eax
and    $0xff00,%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0xc(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @generic_cpu_swap32p(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @llvm.bswap.i32(i32 %1)
store i32 %3, i32* %0
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int os_stat(const char *path, struct stat *sb) { return stat(path, sb); }


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

x86 assembly (clang, -O2):
<os_stat>:
jmp    1030 <stat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @os_stat(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 @stat(i8* %5, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @os_stat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @stat(i8* %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int ReadMesh(char *fname) {
  fprintf(stderr, "Advisory: not configured to read mesh files.\n");
  fprintf(stderr, "Contact your S2PLOT supplier for assistance.\n");
  return 0;
}


x86 assembly (clang, -O0):
<ReadMesh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xeed(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadMesh>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeff(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"Advisory: not configured to read mesh files.\0A\00"
@.str.1 = [46 x i8] c"Contact your S2PLOT supplier for assistance.\0A\00"
define i32 @ReadMesh(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"Advisory: not configured to read mesh files.\0A\00"
@.str.1 = [46 x i8] c"Contact your S2PLOT supplier for assistance.\0A\00"
define i32 @ReadMesh(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ rax;

/* Variables and functions */
int /*<<< orphan*/ cpuid(int, int *, int *, int *, int *);
int cpuid_PMC_num() {
  uint64_t rax, rbx, rcx, rdx;
  int leaf = 10;
  cpuid(leaf, &rax, &rbx, &rcx, &rdx);
  return (((uint64_t)(rax) &
           ((((uint64_t)1 << (((15)) - ((8)) + 1)) - 1) << ((8)))) >>
          (8));
}


x86 assembly (clang, -O0):
<cpuid_PMC_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_PMC_num>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0xa,%edi
call   1030 <cpuid@plt>
movzbl 0x9(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpuid_PMC_num() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 10, i32* %5
%6 = load i32, i32* %5
%7 = call i32 @cpuid(i32 %6, i32* %1, i32* %2, i32* %3, i32* %4)
%8 = load i32, i32* %1
%9 = and i32 %8, 65280
%10 = ashr i32 %9, 8
ret i32 %10
}

LLVM IR (-O2):
define i32 @cpuid_PMC_num() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 10, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ flush();
int /*<<< orphan*/ scanf(char *, double *);
double getDouble() {
  double num;
  scanf("%lf", &num);
  flush();
  return num;
}


x86 assembly (clang, -O0):
<getDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x0,%al
call   1030 <flush@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDouble>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
call   1030 <flush@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define double @getDouble() {
%1 = alloca double
%2 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%3 = call i32 (...) @flush()
%4 = load double, double* %1
ret double %4
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define double @getDouble() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = call i32 (...) @flush()
%5 = load double, double* %1
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
__attribute__((always_)) bool assert_false(bool flag) {
  assert(!flag);
  return flag;
}


x86 assembly (clang, -O0):
<assert_false>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_false>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
sete   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @assert_false(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @assert_false(i32 returned %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ try(char *, int);
int main(void) {
  char bla[100];
  if (try(bla + 50, -1))
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
add    $0x32,%rdi
mov    $0xffffffff,%esi
call   1040 <try@plt>
cmp    $0x0,%rax
je     1152 <main+0x32>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
lea    0x32(%rsp),%rdi
mov    $0xffffffff,%esi
call   1040 <try@plt>
test   %rax,%rax
jne    113f <main+0x1f>
xor    %eax,%eax
add    $0x68,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds i8, i8* %3, i64 50
%5 = call i64 @try(i8* %4, i32 -1)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 50
%4 = call i64 @try(i8* %3, i32 -1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ terminal_writestring(char const *);
void print(const char *data) { terminal_writestring(data); }


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

x86 assembly (clang, -O2):
<print>:
jmp    1030 <terminal_writestring@plt>

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

LLVM IR (-O2):
define void @print(i8* %0) {
%2 = tail call i32 @terminal_writestring(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(
      stderr,
      "Usage: diodcat [OPTIONS] [-s HOST[:PORT]] [-a aname] [file [file...]]\n"
      "   -a,--aname NAME       file system (default ctl)\n"
      "   -s,--server HOST:PORT server (default localhost:564)\n"
      "   -l,--long             show stat information too\n"
      "   -m,--msize            msize (default 65536)\n"
      "   -u,--uid              authenticate as uid (default is your euid)\n"
      "   -t,--timeout SECS     give up after specified seconds\n"
      "   -p,--privport         connect from a privileged port (root user "
      "only)\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [474 x i8] c"Usage: diodcat [OPTIONS] [-s HOST[:PORT]] [-a aname] [file [file...]]\0A -a,--aname NAME file system (default ctl)\0A -s,--server HOST:PORT server (default localhost:564)\0A -l,--long show stat information too\0A -m,--msize msize (default 65536)\0A -u,--uid authenticate as uid (default is your euid)\0A -t,--timeout SECS give up after specified seconds\0A -p,--privport connect from a privileged port (root user only)\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([474 x i8], [474 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [474 x i8] c"Usage: diodcat [OPTIONS] [-s HOST[:PORT]] [-a aname] [file [file...]]\0A -a,--aname NAME file system (default ctl)\0A -s,--server HOST:PORT server (default localhost:564)\0A -l,--long show stat information too\0A -m,--msize msize (default 65536)\0A -u,--uid authenticate as uid (default is your euid)\0A -t,--timeout SECS give up after specified seconds\0A -p,--privport connect from a privileged port (root user only)\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([474 x i8], [474 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t parity(uint32_t x, uint32_t y, uint32_t z) {
  ;
  return ((x ^ y) ^ z);
}


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

x86 assembly (clang, -O2):
<parity>:
mov    %edi,%eax
xor    %esi,%eax
xor    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @parity(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, %0
%5 = xor i32 %4, %2
ret i32 %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int mt_genrand_int32();
uint64_t mtrandom_uint64(uint64_t range) {
  uint64_t r = 0;
  if (range == 0)
    return range;
  r |= mt_genrand_int32();
  r <<= 32;
  r |= mt_genrand_int32();
  return r % range;
}


x86 assembly (clang, -O0):
<mtrandom_uint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1137 <mtrandom_uint64+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <mtrandom_uint64+0x58>
mov    $0x0,%al
call   1030 <mt_genrand_int32@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <mt_genrand_int32@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtrandom_uint64>:
test   %edi,%edi
je     1127 <mtrandom_uint64+0x17>
push   %rax
xor    %eax,%eax
call   1030 <mt_genrand_int32@plt>
xor    %eax,%eax
call   1030 <mt_genrand_int32@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @mtrandom_uint64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %3
store i32 %8, i32* %2
br label %21
9: ; preds = %1
%10 = call i32 (...) @mt_genrand_int32()
%11 = load i32, i32* %4
%12 = or i32 %11, %10
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = shl i32 %13, 32
store i32 %14, i32* %4
%15 = call i32 (...) @mt_genrand_int32()
%16 = load i32, i32* %4
%17 = or i32 %16, %15
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = srem i32 %18, %19
store i32 %20, i32* %2
br label %21
21: ; preds = %9, %7
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @mtrandom_uint64(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 (...) @mt_genrand_int32()
%5 = tail call i32 (...) @mt_genrand_int32()
br label %6
6: ; preds = %1, %3
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t check_bit(uint64_t *number, uint32_t bit_num) {
  uint64_t bit = *number & (1 << bit_num);
  return bit;
}


x86 assembly (clang, -O0):
<check_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_bit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @check_bit(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = shl nuw i32 1, %1
%5 = and i32 %3, %4
ret i32 %5
}
int __atomic_cmpxchg(int old, int _new, volatile int *ptr) {
  return __sync_val_compare_and_swap(ptr, old, _new) != old;
}


x86 assembly (clang, -O0):
<__atomic_cmpxchg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
cmp    -0x4(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_cmpxchg>:
mov    %edi,%eax
lock cmpxchg %esi,(%rdx)
xor    %ecx,%ecx
cmp    %edi,%eax
setne  %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__atomic_cmpxchg(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = cmpxchg i32* %7, i32 %8, i32 %9 seq_cst seq_cst
%11 = extractvalue { i32, i1 } %10, 0
%12 = load i32, i32* %4
%13 = icmp ne i32 %11, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @__atomic_cmpxchg(i32 %0, i32 %1, i32* nocapture %2) {
%4 = cmpxchg i32* %2, i32 %0, i32 %1 seq_cst seq_cst
%5 = extractvalue { i32, i1 } %4, 0
%6 = icmp ne i32 %5, %0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ conio_init();
int caca_conio_gettext(int left, int top, int right, int bottom, void *destin) {
  conio_init();
  return 0;
}


x86 assembly (clang, -O0):
<caca_conio_gettext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    $0x0,%al
call   1030 <conio_init@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @caca_conio_gettext(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = call i32 (...) @conio_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @caca_conio_gettext(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = tail call i32 (...) @conio_init()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bye(void) { printf("test line\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"test line\00"
define void @bye() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
void ExttIPTypeAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttIPTypeAuxTable() {
ret void
}
/* Variables and functions */
int cd(char *);
int changeDir(char *path) { return cd(path); }


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

x86 assembly (clang, -O2):
<changeDir>:
jmp    1030 <cd@plt>

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

LLVM IR (-O2):
define i32 @changeDir(i8* %0) {
%2 = tail call i32 @cd(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void f(int *var, int cnst) { assert(*var == cnst); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    %esi,(%rdi)
sete   %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @f(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* %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret void
}

LLVM IR (-O2):
define void @f(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, %1
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret void
}
/* Variables and functions */
unsigned char tubeCmd(int, unsigned char, int);
unsigned char tubeRead(unsigned char addr) { return tubeCmd(0xC0, addr, 0xff); }


x86 assembly (clang, -O0):
<tubeRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xc0,%edi
mov    $0xff,%edx
movzbl -0x1(%rbp),%esi
call   1030 <tubeCmd@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tubeRead>:
mov    %edi,%esi
mov    $0xc0,%edi
mov    $0xff,%edx
jmp    1030 <tubeCmd@plt>

LLVM IR (-O0):
define zeroext i8 @tubeRead(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i8 @tubeCmd(i32 192, i8 zeroext %3, i32 255)
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @tubeRead(i8 zeroext %0) {
%2 = tail call zeroext i8 @tubeCmd(i32 192, i8 zeroext %0, i32 255)
ret i8 %2
}
int test_imm_F4int16_mem(short *val) {
  return ((*val) & (0xF4 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F4int16_mem>:
testb  $0xf4,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F4int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 244
%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_F4int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 244
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_7Buint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x7B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Buint64_midword_mem>:
testb  $0x7b,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Buint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 123
%7 = icmp ne i64 %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_7Buint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 8060928
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float ans;
  ans = (.000000097 + 2010) / (89000 * 23);
  printf("ans = %e\n", ans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"ans = %e\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float 0x3F50167DC0000000)
ret i32 0
}
int func14() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @func14() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ AT_SYMLINK_NOFOLLOW;
int fchownat(int, char const *, int /*<<< orphan*/, int /*<<< orphan*/,
             int /*<<< orphan*/);
int lchownat(int fd, char const *file, uid_t owner, gid_t group) {
  return fchownat(fd, file, owner, group, AT_SYMLINK_NOFOLLOW);
}


x86 assembly (clang, -O0):
<lchownat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    0x2ea7(%rip),%rax
mov    (%rax),%r8d
call   1030 <fchownat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lchownat>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%r8d
jmp    1030 <fchownat@plt>

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

LLVM IR (-O2):
@AT_SYMLINK_NOFOLLOW = global i32 0
define i32 @lchownat(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = load i32, i32* @AT_SYMLINK_NOFOLLOW
%6 = tail call i32 @fchownat(i32 %0, i8* %1, i32 %2, i32 %3, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f3() { printf("Hello world 2\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello world 2\00"
define void @f3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int16_t;
typedef int /*<<< orphan*/ host;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(char *, int /*<<< orphan*/ *, int);
void htoun16(void *network, u_int16_t host) {
  char *unaligned = (char *)network;
  host = htons(host);
  memcpy(unaligned, &host, sizeof(host));
}


x86 assembly (clang, -O0):
<htoun16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htoun16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htons@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @htoun16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = call i32 @htons(i32 %7)
store i32 %8, i32* %4
%9 = load i8*, i8** %5
%10 = call i32 @memcpy(i8* %9, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @htoun16(i8* %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @htons(i32 %1)
store i32 %4, i32* %3
%5 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, ...);
int /*<<< orphan*/ stderr;
void _test_warn(const char *func, const char *file, int lineno,
                const char *desc) {
  fprintf(stderr, "Warning in %s (%s:%d)\n", func, file, lineno);
  fprintf(stderr, "%s\n", desc);
}


x86 assembly (clang, -O0):
<_test_warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xebd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xeb9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_test_warn>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb9(%rip),%r14
mov    (%r14),%edi
lea    0xecf(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xed5(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Warning in %s (%s:%d)\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @_test_warn(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i32 %12)
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %8
%16 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %15)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Warning in %s (%s:%d)\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @_test_warn(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tests(char *);
int main(int argc, char *argv[]) {
  (void)argc;
  tests(argv[0]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <tests@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @tests(i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void dglTreeNodePri32Cancel(void *pvNodePri32, void *pvParam) {
  free(pvNodePri32);
}


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

x86 assembly (clang, -O2):
<dglTreeNodePri32Cancel>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @dglTreeNodePri32Cancel(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
float atof(char *);
int main(int argc, char **argv) {
  float y = atof(argv[1]);
  float x = y * y;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call float @atof(i8* %10)
store float %11, float* %6
%12 = load float, float* %6
%13 = load float, float* %6
%14 = fmul float %12, %13
store float %14, float* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void ade7754_remove_trigger(struct iio_dev *indio_dev) {}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @ade7754_remove_trigger(%struct.iio_dev* nocapture %0) {
ret void
}
/* Variables and functions */
double exp_inline(double, int /*<<< orphan*/, int /*<<< orphan*/);
double exp(double x) { return exp_inline(x, 0, 0); }


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

x86 assembly (clang, -O2):
<exp>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <exp_inline@plt>

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

LLVM IR (-O2):
define double @exp(double %0) {
%2 = tail call double @exp_inline(double %0, i32 0, i32 0)
ret double %2
}
/* Variables and functions */
double ShareNormalRand(double, double);
void ShareNormalRandVec(double *s, int n, double mean, double dev) {
  int i;
  for (i = 0; i < n; i++)
    s[i] = ShareNormalRand(mean, dev);
  return;
}


x86 assembly (clang, -O0):
<ShareNormalRandVec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1166 <ShareNormalRandVec+0x56>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <ShareNormalRand@plt>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1130 <ShareNormalRandVec+0x20>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShareNormalRandVec>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
test   %esi,%esi
jle    114f <ShareNormalRandVec+0x3f>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <ShareNormalRand@plt>
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <ShareNormalRandVec+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ShareNormalRandVec(double* nocapture writeonly %0, i32 %1, double %2, double %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %14
6: ; preds = %4
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %12, %8 ]
%10 = tail call double @ShareNormalRand(double %2, double %3)
%11 = getelementptr inbounds double, double* %0, i64 %9
store double %10, double* %11
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %7
br i1 %13, label %14, label %8
14: ; preds = %8, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
scalar_t__ hash(int /*<<< orphan*/ *);
scalar_t__ read(int, int /*<<< orphan*/ *, int);
u_int file2hash(int fd) {
  int bytes;
  u_char data[1024];
  u_int h = 0;
  while ((bytes = (int)read(fd, data, 1024)) != 0)
    h += hash(data);
  return h;
}


x86 assembly (clang, -O0):
<file2hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x1014(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x1010(%rbp),%rsi
mov    $0x400,%edx
call   1040 <read@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     117c <file2hash+0x5c>
lea    -0x1010(%rbp),%rdi
call   1030 <hash@plt>
mov    %rax,%rcx
movslq -0x1014(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x1014(%rbp)
jmp    1138 <file2hash+0x18>
mov    -0x1014(%rbp),%eax
add    $0x1020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file2hash>:
push   %rbp
push   %r14
push   %rbx
sub    $0x1000,%rsp
mov    %edi,%r14d
mov    %rsp,%rsi
mov    $0x400,%edx
call   1040 <read@plt>
xor    %ebp,%ebp
test   %eax,%eax
je     116e <file2hash+0x4e>
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <hash@plt>
add    %eax,%ebp
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1040 <read@plt>
test   %eax,%eax
jne    1150 <file2hash+0x30>
mov    %ebp,%eax
add    $0x1000,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @file2hash(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [1024 x i32]
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %5
br label %6
6: ; preds = %12, %1
%7 = load i32, i32* %2
%8 = getelementptr inbounds [1024 x i32], [1024 x i32]* %4, i64 0, i64 0
%9 = call i64 @read(i32 %7, i32* %8, i32 1024)
%10 = trunc i64 %9 to i32
store i32 %10, i32* %3
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %6
%13 = getelementptr inbounds [1024 x i32], [1024 x i32]* %4, i64 0, i64 0
%14 = call i64 @hash(i32* %13)
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = add nsw i64 %16, %14
%18 = trunc i64 %17 to i32
store i32 %18, i32* %5
br label %6
19: ; preds = %6
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @file2hash(i32 %0) {
%2 = alloca [1024 x i32]
%3 = bitcast [1024 x i32]* %2 to i8*
%4 = getelementptr inbounds [1024 x i32], [1024 x i32]* %2, i64 0, i64 0
%5 = call i64 @read(i32 %0, i32* %4, i32 1024)
%6 = trunc i64 %5 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %1, %8
%9 = phi i32 [ %12, %8 ], [ 0, %1 ]
%10 = call i64 @hash(i32* %4)
%11 = trunc i64 %10 to i32
%12 = add i32 %9, %11
%13 = call i64 @read(i32 %0, i32* %4, i32 1024)
%14 = trunc i64 %13 to i32
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %8, %1
%17 = phi i32 [ 0, %1 ], [ %12, %8 ]
ret i32 %17
}
void SysCtrlAonUpdate(void) {
  (*((volatile unsigned long *)(0x40092000 + 0x0000002C))) = 1;
  (*((volatile unsigned long *)(0x40092000 + 0x0000002C)));
}


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

x86 assembly (clang, -O2):
<SysCtrlAonUpdate>:
movq   $0x1,0x4009202c
mov    0x4009202c,%rax
40
ret

LLVM IR (-O0):
define void @SysCtrlAonUpdate() {
store volatile i64 1, i64* inttoptr (i64 1074339884 to i64*)
%1 = load volatile i64, i64* inttoptr (i64 1074339884 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtrlAonUpdate() {
store volatile i64 1, i64* inttoptr (i64 1074339884 to i64*)
%1 = load volatile i64, i64* inttoptr (i64 1074339884 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ configure_port(int);
int open_port();
int /*<<< orphan*/ query_modem(int);
int main(void) {
  int fd = open_port();
  configure_port(fd);
  query_modem(fd);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <open_port@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <configure_port@plt>
mov    %ebx,%edi
call   1030 <query_modem@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @open_port()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @configure_port(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @query_modem(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @open_port()
%2 = tail call i32 @configure_port(i32 %1)
%3 = tail call i32 @query_modem(i32 %1)
ret i32 0
}
unsigned short IPCMtoCFlagBusy(unsigned long ulFlags) {
  unsigned short returnStatus;
  if (((*((volatile unsigned long *)(0x400FB700 + 0x000000010))) & ulFlags) ==
      0) {
    returnStatus = 0U;
  } else {
    returnStatus = 1U;
  }
  return returnStatus;
}


x86 assembly (clang, -O0):
<IPCMtoCFlagBusy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x400fb710,%eax
mov    (%rax),%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
jne    1129 <IPCMtoCFlagBusy+0x29>
movw   $0x0,-0xa(%rbp)
jmp    112f <IPCMtoCFlagBusy+0x2f>
movw   $0x1,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IPCMtoCFlagBusy>:
xor    %eax,%eax
and    0x400fb710,%rdi
40
setne  %al
ret

LLVM IR (-O0):
define zeroext i16 @IPCMtoCFlagBusy(i64 %0) {
%2 = alloca i64
%3 = alloca i16
store i64 %0, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074771728 to i64*)
%5 = load i64, i64* %2
%6 = and i64 %4, %5
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i16 0, i16* %3
br label %10
9: ; preds = %1
store i16 1, i16* %3
br label %10
10: ; preds = %9, %8
%11 = load i16, i16* %3
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @IPCMtoCFlagBusy(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074771728 to i64*)
%3 = and i64 %2, %0
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i16
ret i16 %5
}