xunge/DecIR huggingface dataset:
int MaxOut(int M) {
  if (M > 50) {
    return 120;
  } else if (M < -50) {
    return -120;
  } else {
    return M;
  }
}


x86 assembly (clang, -O0):
<MaxOut>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jle    111d <MaxOut+0x1d>
movl   $0x78,-0x4(%rbp)
jmp    1139 <MaxOut+0x39>
cmpl   $0xffffffce,-0x8(%rbp)
jge    1133 <MaxOut+0x33>
movl   $0xffffff88,-0x4(%rbp)
jmp    1139 <MaxOut+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MaxOut>:
cmp    $0xffffffce,%edi
mov    $0xffffff88,%ecx
cmovge %edi,%ecx
cmp    $0x33,%edi
mov    $0x78,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @MaxOut(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 50
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 120, i32* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, -50
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 -120, i32* %2
br label %13
11: ; preds = %7
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %10, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @MaxOut(i32 %0) {
%2 = icmp sgt i32 %0, 50
%3 = icmp slt i32 %0, -50
%4 = select i1 %3, i32 -120, i32 %0
%5 = select i1 %2, i32 120, i32 %4
ret i32 %5
}
int test_imm_20int32_reg(int val) { return ((val) & (0x20 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_20int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x20,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_20int32_reg(i32 %0) {
%2 = and i32 %0, 32
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int bit_index(a)
register unsigned int a;
{
  register int i;
  if (a == 0)
    return -1;
  for (i = 0; (a & 1) == 0; a >>= 1, i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<bit_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <bit_index+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <bit_index+0x55>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    114f <bit_index+0x4f>
jmp    1138 <bit_index+0x38>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <bit_index+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_index>:
test   %edi,%edi
je     111e <bit_index+0x1e>
xor    %eax,%eax
test   $0x1,%dil
jne    111d <bit_index+0x1d>
xor    %eax,%eax
mov    %edi,%ecx
shr    %ecx
add    $0x1,%eax
test   $0x2,%dil
mov    %ecx,%edi
je     1110 <bit_index+0x10>
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @bit_index(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %21
8: ; preds = %1
store i32 0, i32* %4
br label %9
9: ; preds = %14, %8
%10 = load i32, i32* %3
%11 = and i32 %10, 1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %9
br label %14
14: ; preds = %13
%15 = load i32, i32* %3
%16 = lshr i32 %15, 1
store i32 %16, i32* %3
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %9
19: ; preds = %9
%20 = load i32, i32* %4
store i32 %20, i32* %2
br label %21
21: ; preds = %19, %7
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @bit_index(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 0, %3 ]
%8 = phi i32 [ %9, %6 ], [ %0, %3 ]
%9 = lshr i32 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = and i32 %8, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ -1, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i32 %14
}
int ILibGetLocalIPv6IndexList(int **indexlist) {}


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

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

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

LLVM IR (-O2):
define i32 @ILibGetLocalIPv6IndexList(i32** nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
long getMaxW();
bool isLastCol(long w) { return (w == getMaxW()); }


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

x86 assembly (clang, -O2):
<isLastCol>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getMaxW@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isLastCol(i64 %0) {
%2 = tail call i64 (...) @getMaxW()
%3 = icmp eq i64 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
void XDrawText16() {}


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

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

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

LLVM IR (-O2):
define void @XDrawText16() {
ret void
}
double multiply_two_doubles(double a, double b) { return a * b; }


x86 assembly (clang, -O0):
<multiply_two_doubles>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply_two_doubles>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @multiply_two_doubles(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @multiply_two_doubles(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ help();
int /*<<< orphan*/ stderr;
int checkOptionValue(char *key, char *value, int limit) {
  int number;
  number = atoi(value);
  if (number < limit) {
    fprintf(stderr, "Number for %s should be integer >= %d\n", key, limit);
    help();
  }
  return number;
}


x86 assembly (clang, -O0):
<checkOptionValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    117e <checkOptionValue+0x4e>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xe8e(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <help@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkOptionValue>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
cmp    %ebp,%eax
jge    1168 <checkOptionValue+0x38>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
mov    %r14,%rdx
mov    %ebp,%ecx
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <help@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Number for %s should be integer >= %d\0A\00"
define i32 @checkOptionValue(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = call i32 @atoi(i8* %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %19
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %4
%16 = load i32, i32* %6
%17 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16)
%18 = call i32 (...) @help()
br label %19
19: ; preds = %13, %3
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Number for %s should be integer >= %d\0A\00"
define i32 @checkOptionValue(i8* %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @atoi(i8* %1)
%5 = icmp slt i32 %4, %2
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
%9 = tail call i32 (...) @help()
br label %10
10: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ indirectxE();
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc8(int /*<<< orphan*/);
void sbcIndirectxE(void) { sbc8(readmem65816(indirectxE())); }


x86 assembly (clang, -O0):
<sbcIndirectxE>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <indirectxE@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1030 <sbc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcIndirectxE>:
push   %rax
xor    %eax,%eax
call   1040 <indirectxE@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sbc8@plt>

LLVM IR (-O0):
define void @sbcIndirectxE() {
%1 = call i32 (...) @indirectxE()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @sbc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcIndirectxE() {
%1 = tail call i32 (...) @indirectxE()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @sbc8(i32 %2)
ret void
}
/* Variables and functions */
void *Bits_memcpyNoDebug(void *restrict out, const void *restrict in,
                         size_t length) {
  void *memcpy(void *restrict out, const void *restrict in, size_t length);
  return memcpy(out, in, length);
}


x86 assembly (clang, -O0):
<Bits_memcpyNoDebug>:
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    %rdi,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bits_memcpyNoDebug>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @Bits_memcpyNoDebug(i8* noalias returned writeonly %0, i8* noalias nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int readUInt8(int /*<<< orphan*/ *);
long readSInt32(FILE *f) {
  return (long)readUInt8(f) + (readUInt8(f) << 8) + (readUInt8(f) << 16) +
         (readUInt8(f) << 24);
}


x86 assembly (clang, -O0):
<readSInt32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <readUInt8@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <readUInt8@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
shl    $0x8,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <readUInt8@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
shl    $0x10,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <readUInt8@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
shl    $0x18,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readSInt32>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <readUInt8@plt>
movslq %eax,%r14
mov    %r15,%rdi
call   1030 <readUInt8@plt>
shl    $0x8,%eax
movslq %eax,%rbx
add    %r14,%rbx
mov    %r15,%rdi
call   1030 <readUInt8@plt>
shl    $0x10,%eax
movslq %eax,%r14
add    %rbx,%r14
mov    %r15,%rdi
call   1030 <readUInt8@plt>
shl    $0x18,%eax
cltq
add    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @readSInt32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @readUInt8(i32* %3)
%5 = sext i32 %4 to i64
%6 = load i32*, i32** %2
%7 = call i32 @readUInt8(i32* %6)
%8 = shl i32 %7, 8
%9 = sext i32 %8 to i64
%10 = add nsw i64 %5, %9
%11 = load i32*, i32** %2
%12 = call i32 @readUInt8(i32* %11)
%13 = shl i32 %12, 16
%14 = sext i32 %13 to i64
%15 = add nsw i64 %10, %14
%16 = load i32*, i32** %2
%17 = call i32 @readUInt8(i32* %16)
%18 = shl i32 %17, 24
%19 = sext i32 %18 to i64
%20 = add nsw i64 %15, %19
ret i64 %20
}

LLVM IR (-O2):
define i64 @readSInt32(i32* %0) {
%2 = tail call i32 @readUInt8(i32* %0)
%3 = sext i32 %2 to i64
%4 = tail call i32 @readUInt8(i32* %0)
%5 = shl i32 %4, 8
%6 = sext i32 %5 to i64
%7 = add nsw i64 %6, %3
%8 = tail call i32 @readUInt8(i32* %0)
%9 = shl i32 %8, 16
%10 = sext i32 %9 to i64
%11 = add nsw i64 %7, %10
%12 = tail call i32 @readUInt8(i32* %0)
%13 = shl i32 %12, 24
%14 = sext i32 %13 to i64
%15 = add nsw i64 %11, %14
ret i64 %15
}
long long llabs(long long x) { return __builtin_llabs(x); }


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
sub    %rax,%rcx
cmp    $0x0,%rax
cmovl  %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @llabs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 0, %3
%5 = icmp slt i64 %3, 0
%6 = select i1 %5, i64 %4, i64 %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ print_version(char const *);
int /*<<< orphan*/ stderr;
void usage(const char *prog) {
  fprintf(stderr,
          "Usage: %s [options] [input]\n"
          "Options:\n"
          "  -o file -- output to file (default is standard output)\n"
          "  -d      -- print equation debugging information\n"
          "  -v      -- print version information\n"
          "  -h      -- print this message\n",
          prog);
  print_version(prog);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <print_version@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <print_version@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [216 x i8] c"Usage: %s [options] [input]\0AOptions:\0A -o file -- output to file (default is standard output)\0A -d -- print equation debugging information\0A -v -- print version information\0A -h -- print this message\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @print_version(i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [216 x i8] c"Usage: %s [options] [input]\0AOptions:\0A -o file -- output to file (default is standard output)\0A -d -- print equation debugging information\0A -v -- print version information\0A -h -- print this message\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @print_version(i8* %0)
ret void
}
const char *Swap_Definition(void) {
  return "struct Swap {\n"
         "  void (*swap)(var, var);\n"
         "};\n";
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"struct Swap {\0A void (*swap)(var, var);\0A};\0A\00"
define i8* @Swap_Definition() {
ret i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [44 x i8] c"struct Swap {\0A void (*swap)(var, var);\0A};\0A\00"
define i8* @Swap_Definition() {
ret i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0)
}
void ff_hevc_put_hevc_uni_w_epel_hv6_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_hv6_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I_Error(char *, char const *, int);
int R_CheckTextureNumForName(char const *);
int R_SafeTextureNumForName(const char *name, int snum) {
  int i = R_CheckTextureNumForName(name);
  if (i == -1) {
    i = 0;
    I_Error("R_SafeTextureNumForName: Bad texture '%s' in sidedef %d\n", name,
            snum);
  }
  return i;
}


x86 assembly (clang, -O0):
<R_SafeTextureNumForName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <R_CheckTextureNumForName@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    115f <R_SafeTextureNumForName+0x3f>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xea6(%rip),%rdi
call   1040 <I_Error@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_SafeTextureNumForName>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <R_CheckTextureNumForName@plt>
cmp    $0xffffffff,%eax
jne    1145 <R_SafeTextureNumForName+0x25>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <I_Error@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [57 x i8] c"R_SafeTextureNumForName: Bad texture '%s' in sidedef %d\0A\00"
define i32 @R_SafeTextureNumForName(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @R_CheckTextureNumForName(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %14
10: ; preds = %2
store i32 0, i32* %5
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = call i32 @I_Error(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12)
br label %14
14: ; preds = %10, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@.str = [57 x i8] c"R_SafeTextureNumForName: Bad texture '%s' in sidedef %d\0A\00"
define i32 @R_SafeTextureNumForName(i8* %0, i32 %1) {
%3 = tail call i32 @R_CheckTextureNumForName(i8* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @I_Error(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
br label %7
7: ; preds = %5, %2
%8 = phi i32 [ 0, %5 ], [ %3, %2 ]
ret i32 %8
}
int f3_b(char *x) {
  int i = 2;
  if (x)
    return x[i - 1];
  return x[i + 1]++;
}


x86 assembly (clang, -O0):
<f3_b>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1133 <f3_b+0x33>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <f3_b+0x54>
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdx
mov    (%rcx,%rdx,1),%al
mov    %al,%sil
add    $0x1,%sil
mov    %sil,(%rcx,%rdx,1)
movsbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3_b>:
test   %rdi,%rdi
je     110c <f3_b+0xc>
mov    0x1(%rdi),%al
movsbl %al,%eax
ret
mov    0x3,%al
lea    0x1(%rax),%ecx
mov    %cl,0x3
movsbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @f3_b(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
br label %9
6: ; preds = %1
%7 = load i8, i8* inttoptr (i64 3 to i8*)
%8 = add i8 %7, 1
store i8 %8, i8* inttoptr (i64 3 to i8*)
br label %9
9: ; preds = %6, %3
%10 = phi i8 [ %5, %3 ], [ %7, %6 ]
%11 = sext i8 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void lfs1_free(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @lfs1_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void put_unaligned_uint16(void *p, unsigned short datum) {
  struct {
    unsigned short d;
  } __attribute__((packed)) *pp = (void *)p;
  pp->d = datum;
}


x86 assembly (clang, -O0):
<put_unaligned_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_unaligned_uint16>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
%struct.anon = type { i16 }
define void @put_unaligned_uint16(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca %struct.anon*
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.anon*
store %struct.anon* %7, %struct.anon** %5
%8 = load i16, i16* %4
%9 = load %struct.anon*, %struct.anon** %5
%10 = getelementptr inbounds %struct.anon, %struct.anon* %9, i32 0, i32 0
store i16 %8, i16* %10
ret void
}

LLVM IR (-O2):
define void @put_unaligned_uint16(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MARun();
int ThingPlug_oneM2M_SDK(int argc, char **argv) {
  MARun();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ThingPlug_oneM2M_SDK(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @MARun()
ret i32 0
}
double julian_ephemeris_day(double jd, double delta_t) {
  return jd + delta_t / 86400.0;
}


x86 assembly (clang, -O0):
<julian_ephemeris_day>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<julian_ephemeris_day>:
divsd  0xef8(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @julian_ephemeris_day(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %6, 8.640000e+04
%8 = fadd double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @julian_ephemeris_day(double %0, double %1) {
%3 = fdiv double %1, 8.640000e+04
%4 = fadd double %3, %0
ret double %4
}
double deq(double x, double y) { return ((double)(x == y)); }


x86 assembly (clang, -O0):
<deq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deq>:
cmpeqsd %xmm1,%xmm0
movsd  0xef3(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @deq(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oeq double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @deq(double %0, double %1) {
%3 = fcmp oeq double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, unsigned long);
void __constant_memcpy_tofs(void *to, const void *from, unsigned long n) {
  memcpy(to, from, n);
}


x86 assembly (clang, -O0):
<__constant_memcpy_tofs>:
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
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__constant_memcpy_tofs>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @__constant_memcpy_tofs(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ usage(char *);
void errorInt(char *format, int var) {
  char errorMsg[1000];
  sprintf(errorMsg, format, var);
  usage(errorMsg);
}


x86 assembly (clang, -O0):
<errorInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <sprintf@plt>
lea    -0x400(%rbp),%rdi
call   1030 <usage@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorInt>:
push   %rbx
sub    $0x3f0,%rsp
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <usage@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @errorInt(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [1000 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @sprintf(i8* %6, i8* %7, i32 %8)
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%11 = call i32 @usage(i8* %10)
ret void
}

LLVM IR (-O2):
define void @errorInt(i8* nocapture %0, i32 %1) {
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %0, i32 %1)
%6 = call i32 @usage(i8* %4)
ret void
}
int test_imm_54uint32_mem(unsigned int *val) {
  return ((*val) & (0x54 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_54uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 84
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct bss_t {
  int dummy;
};

/* Variables and functions */
int sendwait(struct bss_t *, int, unsigned char *, int);
int sendbyte(struct bss_t *bss, int sock, unsigned char byte) {
  unsigned char buffer[1];
  buffer[0] = byte;
  return sendwait(bss, sock, buffer, 1);
}


x86 assembly (clang, -O0):
<sendbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0xe(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <sendwait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendbyte>:
push   %rax
mov    %dl,0x7(%rsp)
lea    0x7(%rsp),%rdx
mov    $0x1,%ecx
call   1030 <sendwait@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.bss_t = type { i32 }
define i32 @sendbyte(%struct.bss_t* %0, i32 %1, i8 zeroext %2) {
%4 = alloca %struct.bss_t*
%5 = alloca i32
%6 = alloca i8
%7 = alloca [1 x i8]
store %struct.bss_t* %0, %struct.bss_t** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%8 = load i8, i8* %6
%9 = getelementptr inbounds [1 x i8], [1 x i8]* %7, i64 0, i64 0
store i8 %8, i8* %9
%10 = load %struct.bss_t*, %struct.bss_t** %4
%11 = load i32, i32* %5
%12 = getelementptr inbounds [1 x i8], [1 x i8]* %7, i64 0, i64 0
%13 = call i32 @sendwait(%struct.bss_t* %10, i32 %11, i8* %12, i32 1)
ret i32 %13
}

LLVM IR (-O2):
%struct.bss_t = type { i32 }
define i32 @sendbyte(%struct.bss_t* %0, i32 %1, i8 zeroext %2) {
%4 = alloca [1 x i8]
%5 = getelementptr inbounds [1 x i8], [1 x i8]* %4, i64 0, i64 0
store i8 %2, i8* %5
%6 = call i32 @sendwait(%struct.bss_t* %0, i32 %1, i8* %5, i32 1)
ret i32 %6
}
int axp_set_pekoff(int pek) {
  int ret = 0;
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @axp_set_pekoff(i32 %0) {
ret i32 0
}
int do_161() { return 161; }


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

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

LLVM IR (-O0):
define i32 @do_161() {
ret i32 161
}

LLVM IR (-O2):
define i32 @do_161() {
ret i32 161
}
/* Variables and functions */
int medusaReceiveInternal(int, unsigned char *, int);
int /*<<< orphan*/ writeError(int, char *, int, unsigned char *);
int medusaReceive(int socket, unsigned char *buf, int length) {
  int ret;
  ret = medusaReceiveInternal(socket, buf, length);
  writeError(7, "Data received (%d): %s", ret, buf);
  return ret;
}


x86 assembly (clang, -O0):
<medusaReceive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <medusaReceiveInternal@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    $0x7,%edi
lea    0xea9(%rip),%rsi
call   1030 <writeError@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<medusaReceive>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <medusaReceiveInternal@plt>
mov    %eax,%ebp
lea    0xecc(%rip),%rsi
mov    $0x7,%edi
mov    %eax,%edx
mov    %rbx,%rcx
call   1030 <writeError@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Data received (%d): %s\00"
define i32 @medusaReceive(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @medusaReceiveInternal(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i8*, i8** %5
%14 = call i32 @writeError(i32 7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %13)
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
@.str = [23 x i8] c"Data received (%d): %s\00"
define i32 @medusaReceive(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @medusaReceiveInternal(i32 %0, i8* %1, i32 %2)
%5 = tail call i32 @writeError(i32 7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %1)
ret i32 %4
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strcmpr(const char **a, const char **b) { return strcmp(*a, *b); }


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

x86 assembly (clang, -O2):
<strcmpr>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @strcmpr(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 = load i8*, i8** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = call i32 @strcmp(i8* %6, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @strcmpr(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
ret i32 %5
}
void rte_prefetch0(const volatile void *p) {
  __asm__ volatile("prefetcht0 %[p]" : : [p] "m"(*(const volatile char *)p));
}


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

x86 assembly (clang, -O2):
<rte_prefetch0>:
prefetcht0 (%rdi)
ret

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

LLVM IR (-O2):
define void @rte_prefetch0(i8* %0) {
tail call void asm sideeffect "prefetcht0 $0", "*m,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, unsigned long);
int printNode(void *key, unsigned long value) {
  printf("%-24s:%lu\n", (char *)key, value);
  return 0;
}


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

x86 assembly (clang, -O2):
<printNode>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%-24s:%lu\0A\00"
define i32 @printNode(i8* %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ turtle_add_action(char *);
void turtle_forward() { turtle_add_action("f()\n"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"f()\0A\00"
define void @turtle_forward() {
%1 = call i32 @turtle_add_action(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"f()\0A\00"
define void @turtle_forward() {
%1 = tail call i32 @turtle_add_action(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ autoupdatesprite(int);
int popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basAutoUpdateSprite() {
  int m;
  m = popNumber();
  pushNumber(autoupdatesprite(m));
}


x86 assembly (clang, -O0):
<basAutoUpdateSprite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <autoupdatesprite@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basAutoUpdateSprite>:
push   %rax
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1030 <autoupdatesprite@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basAutoUpdateSprite() {
%1 = alloca i32
%2 = call i32 (...) @popNumber()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @autoupdatesprite(i32 %3)
%5 = call i32 @pushNumber(i32 %4)
ret void
}

LLVM IR (-O2):
define void @basAutoUpdateSprite() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 @autoupdatesprite(i32 %1)
%3 = tail call i32 @pushNumber(i32 %2)
ret void
}
unsigned xrop3_103_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T | S;
  stk3 = ~stk3;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


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

x86 assembly (clang, -O2):
<xrop3_103_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
shl    $0x8,%esi
or     %esi,%eax
not    %eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_103_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int semaphore_done(int);
int mutex_onde(int m_id) { return semaphore_done(m_id); }


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

x86 assembly (clang, -O2):
<mutex_onde>:
jmp    1030 <semaphore_done@plt>

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

LLVM IR (-O2):
define i32 @mutex_onde(i32 %0) {
%2 = tail call i32 @semaphore_done(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  int j;
  int x, y;
  int a[1];
  x = i;
  y = j;
  while (x != 0) {
    x--;
    y--;
  }
  if (i == j) {
    assert(y == 0);
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     114c <main+0x3c>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <main+0x1b>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1169 <main+0x59>
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [1 x i32]
store i32 0, i32* %1
%7 = load i32, i32* %2
store i32 %7, i32* %4
%8 = load i32, i32* %3
store i32 %8, i32* %5
br label %9
9: ; preds = %12, %0
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i32, i32* %4
%14 = add nsw i32 %13, -1
store i32 %14, i32* %4
%15 = load i32, i32* %5
%16 = add nsw i32 %15, -1
store i32 %16, i32* %5
br label %9
17: ; preds = %9
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load i32, i32* %5
%23 = icmp eq i32 %22, 0
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
br label %26
26: ; preds = %21, %17
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
scalar_t__ cos(double);
float cos2(float x) { return (float)cos((double)x); }


x86 assembly (clang, -O0):
<cos2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <cos@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos2>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @cos2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @cos(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @cos2(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @cos(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int count_array();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void validate(int id, int iteration) {
  int count = (iteration * (500 - (500 % 4)) * 4) + (500 - (500 % 4));
  int real_count = count_array();
  if (count != real_count) {
    fprintf(stderr, "FAILURE\n");
  }
}


x86 assembly (clang, -O0):
<validate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x1f4,-0x8(%rbp),%eax
shl    $0x2,%eax
add    $0x1f4,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <count_array@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     116b <validate+0x4b>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate>:
push   %rbx
imul   $0x7d0,%esi,%ebx
add    $0x1f4,%ebx
xor    %eax,%eax
call   1030 <count_array@plt>
cmp    %eax,%ebx
jne    113a <validate+0x1a>
pop    %rbx
ret
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"FAILURE\0A\00"
define void @validate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 500
%9 = mul nsw i32 %8, 4
%10 = add nsw i32 %9, 500
store i32 %10, i32* %5
%11 = call i32 (...) @count_array()
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %15, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"FAILURE\0A\00"
define void @validate(i32 %0, i32 %1) {
%3 = mul i32 %1, 2000
%4 = add nsw i32 %3, 500
%5 = tail call i32 (...) @count_array()
%6 = icmp eq i32 %4, %5
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %7, %2
ret void
}