xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ THArgCheck(int, int, char *);
double __uniform__();
unsigned THRandom_bernoulli(double p) {
  THArgCheck(p > 0 && p < 1, 1, "must be > 0 and < 1");
  return (__uniform__() <= p);
}


x86 assembly (clang, -O0):
<THRandom_bernoulli>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jbe    1157 <THRandom_bernoulli+0x37>
movsd  0xeb4(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x1,%esi
lea    0xe9d(%rip),%rdx
call   1040 <THArgCheck@plt>
mov    $0x0,%al
call   1030 <__uniform__@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<THRandom_bernoulli>:
push   %rax
movsd  %xmm0,(%rsp)
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
movsd  0xec7(%rip),%xmm1
ucomisd %xmm0,%xmm1
seta   %cl
and    %al,%cl
movzbl %cl,%edi
lea    0xebc(%rip),%rdx
mov    $0x1,%esi
call   1040 <THArgCheck@plt>
xor    %eax,%eax
call   1030 <__uniform__@plt>
xor    %eax,%eax
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"must be > 0 and < 1\00"
define i32 @THRandom_bernoulli(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fcmp olt double %6, 1.000000e+00
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @THArgCheck(i32 %10, i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%12 = call double (...) @__uniform__()
%13 = load double, double* %2
%14 = fcmp ole double %12, %13
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@.str = [20 x i8] c"must be > 0 and < 1\00"
define i32 @THRandom_bernoulli(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fcmp olt double %0, 1.000000e+00
%4 = and i1 %2, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 @THArgCheck(i32 %5, i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = tail call double (...) @__uniform__()
%8 = fcmp ole double %7, %0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int tracepoint_probe_unregister(char *, void *);
__attribute__((always_)) int unregister_trace_kmem_cache_free(
    void (*probe)(unsigned long call_site, const void *ptr)) {
  return tracepoint_probe_unregister("kmem_cache_free", (void *)probe);
}


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

x86 assembly (clang, -O2):
<unregister_trace_kmem_cache_free>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <tracepoint_probe_unregister@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"kmem_cache_free\00"
define i32 @unregister_trace_kmem_cache_free(void (i64, i8*)* %0) {
%2 = alloca void (i64, i8*)*
store void (i64, i8*)* %0, void (i64, i8*)** %2
%3 = load void (i64, i8*)*, void (i64, i8*)** %2
%4 = bitcast void (i64, i8*)* %3 to i8*
%5 = call i32 @tracepoint_probe_unregister(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 %5
}

LLVM IR (-O2):
@.str = [16 x i8] c"kmem_cache_free\00"
define i32 @unregister_trace_kmem_cache_free(void (i64, i8*)* %0) {
%2 = bitcast void (i64, i8*)* %0 to i8*
%3 = tail call i32 @tracepoint_probe_unregister(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %3
}
__attribute__((no, noclone)) signed __int128 t123_5mul(signed __int128 x) {
  signed __int128 r;
  if (__builtin_mul_overflow(x, (signed __int128)(0), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t123_5mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
xor    %eax,%eax
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
test   $0x1,%al
jne    114f <t123_5mul+0x3f>
jmp    1156 <t123_5mul+0x46>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define { i64, i64 } @t123_5mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.smul.with.overflow.i128(i128 %11, i128 0)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t123_5mul(i64 %0, i64 %1) {
ret { i64, i64 } zeroinitializer
}
do_calc(s, v) char *s;
double *v;
{ return (1); }


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

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

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

LLVM IR (-O2):
define i32 @do_calc(i8* nocapture readnone %0, double* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int conf_get_int(char *, char *, int);
int pi_conf_get_int(char *section, char *key, int dflt) {
  return conf_get_int(section, key, dflt);
}


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

x86 assembly (clang, -O2):
<pi_conf_get_int>:
jmp    1030 <conf_get_int@plt>

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

LLVM IR (-O2):
define i32 @pi_conf_get_int(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @conf_get_int(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void jmp_m32(void *_m32) {
  unsigned long *m32 = (unsigned long *)_m32;
  put8(0xFF);
  put8(0x25);
  put32((unsigned long)(m32));
}


x86 assembly (clang, -O0):
<jmp_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0xff,%edi
call   1030 <put8@plt>
mov    $0x25,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rdi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jmp_m32>:
push   %rbx
mov    %rdi,%rbx
mov    $0xff,%edi
call   1030 <put8@plt>
mov    $0x25,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @jmp_m32(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = call i32 @put8(i32 255)
%7 = call i32 @put8(i32 37)
%8 = load i64*, i64** %3
%9 = ptrtoint i64* %8 to i64
%10 = call i32 @put32(i64 %9)
ret void
}

LLVM IR (-O2):
define void @jmp_m32(i8* %0) {
%2 = tail call i32 @put8(i32 255)
%3 = tail call i32 @put8(i32 37)
%4 = ptrtoint i8* %0 to i64
%5 = tail call i32 @put32(i64 %4)
ret void
}
/* Type definitions */
struct db_query {
  int dummy;
};
typedef int /*<<< orphan*/ sqlite3_stmt;

/* Variables and functions */
int sqlite3_column_int(int /*<<< orphan*/ *, int);
int db_column_int(struct db_query *query, int i) {
  if (query == NULL)
    return -1;
  return sqlite3_column_int((sqlite3_stmt *)query, i);
}


x86 assembly (clang, -O0):
<db_column_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1136 <db_column_int+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <db_column_int+0x35>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <sqlite3_column_int@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_column_int>:
test   %rdi,%rdi
je     111a <db_column_int+0xa>
jmp    1030 <sqlite3_column_int@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.db_query = type { i32 }
define i32 @db_column_int(%struct.db_query* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.db_query*
%5 = alloca i32
store %struct.db_query* %0, %struct.db_query** %4
store i32 %1, i32* %5
%6 = load %struct.db_query*, %struct.db_query** %4
%7 = icmp eq %struct.db_query* %6, null
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -1, i32* %3
br label %14
9: ; preds = %2
%10 = load %struct.db_query*, %struct.db_query** %4
%11 = bitcast %struct.db_query* %10 to i32*
%12 = load i32, i32* %5
%13 = call i32 @sqlite3_column_int(i32* %11, i32 %12)
store i32 %13, i32* %3
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.db_query = type { i32 }
define i32 @db_column_int(%struct.db_query* %0, i32 %1) {
%3 = icmp eq %struct.db_query* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = getelementptr %struct.db_query, %struct.db_query* %0, i64 0, i32 0
%6 = tail call i32 @sqlite3_column_int(i32* %5, i32 %1)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
double sqrt(double);
double SquareRoot(double x) { return sqrt(x); }


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

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

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

LLVM IR (-O2):
define double @SquareRoot(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
/* Variables and functions */
scalar_t__ ceil(int /*<<< orphan*/);
int /*<<< orphan*/ log10(unsigned long);
unsigned lineNumberChars(unsigned long num) {
  return (unsigned)((ceil(log10(num)) + 1));
}


x86 assembly (clang, -O0):
<lineNumberChars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <log10@plt>
mov    %eax,%edi
call   1030 <ceil@plt>
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lineNumberChars>:
push   %rax
call   1040 <log10@plt>
mov    %eax,%edi
call   1030 <ceil@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lineNumberChars(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @log10(i64 %3)
%5 = call i64 @ceil(i32 %4)
%6 = add nsw i64 %5, 1
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @lineNumberChars(i64 %0) {
%2 = tail call i32 @log10(i64 %0)
%3 = tail call i64 @ceil(i32 %2)
%4 = trunc i64 %3 to i32
%5 = add i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
scalar_t__ unlink(char const *);
int unlinkit(const char *path) {
  if (unlink(path) != 0) {
    perror(path);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<unlinkit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
je     1154 <unlinkit+0x34>
mov    -0x10(%rbp),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <unlinkit+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlinkit>:
push   %rbx
mov    %rdi,%rbx
call   1030 <unlink@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1135 <unlinkit+0x15>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @unlinkit(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @unlink(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @perror(i8* %8)
store i32 -1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @unlinkit(i8* nocapture %0) {
%2 = tail call i64 @unlink(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t a52_get_crc(const uint8_t *p_a52) {
  return (p_a52[2] << 8 | p_a52[3]);
}


x86 assembly (clang, -O0):
<a52_get_crc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52_get_crc>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @a52_get_crc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 3
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @a52_get_crc(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}
void test_agile_geometry() {}


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

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

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

LLVM IR (-O2):
define void @test_agile_geometry() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256;

/* Variables and functions */
float *mediocre_chunk_ptr(__m256 *chunks, size_t combine_count,
                          size_t combine_axis, size_t width_axis) {
  __m256 *chunk_ptr = chunks + ((width_axis / 8) * combine_count);
  __m256 *vector_ptr = chunk_ptr + combine_axis;
  return ((float *)vector_ptr) + (width_axis % 8);
}


x86 assembly (clang, -O0):
<mediocre_chunk_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
shr    $0x3,%rcx
imul   -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x20(%rbp),%rcx
and    $0x7,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mediocre_chunk_ptr>:
mov    %rcx,%rax
shr    $0x3,%rax
imul   %rsi,%rax
lea    (%rdi,%rax,4),%rax
lea    (%rax,%rdx,4),%rax
and    $0x7,%ecx
lea    (%rax,%rcx,4),%rax
ret

LLVM IR (-O0):
define float* @mediocre_chunk_ptr(i32* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i32*
store i32* %0, i32** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%11 = load i32*, i32** %5
%12 = load i64, i64* %8
%13 = udiv i64 %12, 8
%14 = load i64, i64* %6
%15 = mul i64 %13, %14
%16 = getelementptr inbounds i32, i32* %11, i64 %15
store i32* %16, i32** %9
%17 = load i32*, i32** %9
%18 = load i64, i64* %7
%19 = getelementptr inbounds i32, i32* %17, i64 %18
store i32* %19, i32** %10
%20 = load i32*, i32** %10
%21 = bitcast i32* %20 to float*
%22 = load i64, i64* %8
%23 = urem i64 %22, 8
%24 = getelementptr inbounds float, float* %21, i64 %23
ret float* %24
}

LLVM IR (-O2):
define float* @mediocre_chunk_ptr(i32* readnone %0, i64 %1, i64 %2, i64 %3) {
%5 = lshr i64 %3, 3
%6 = mul i64 %5, %1
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = getelementptr inbounds i32, i32* %7, i64 %2
%9 = and i64 %3, 7
%10 = getelementptr inbounds i32, i32* %8, i64 %9
%11 = bitcast i32* %10 to float*
ret float* %11
}
/* Variables and functions */
int /*<<< orphan*/ asm_exit(int);
void __attribute__((section("libgloss_epiphany"))) _exit(int rc) {
  asm_exit(rc);
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <asm_exit@plt>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
call   1030 <asm_exit@plt>

LLVM IR (-O0):
define void @_exit(i32 %0) section "libgloss_epiphany" {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @asm_exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @_exit(i32 %0) section "libgloss_epiphany" {
%2 = tail call i32 @asm_exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
int /*<<< orphan*/ _mm256_loadu_si256(int /*<<< orphan*/ const *);
__m256i yy_loadu_256(const void *a) {
  return _mm256_loadu_si256((const __m256i *)a);
}


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

x86 assembly (clang, -O2):
<yy_loadu_256>:
jmp    1030 <_mm256_loadu_si256@plt>

LLVM IR (-O0):
define i32 @yy_loadu_256(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @_mm256_loadu_si256(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @yy_loadu_256(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @_mm256_loadu_si256(i32* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ RTP_set_extension(unsigned char *, int);
int /*<<< orphan*/ RTP_set_extension_len(unsigned char *, int);
int /*<<< orphan*/ RTP_set_extension_type(unsigned char *, int);
int /*<<< orphan*/ RTP_set_version(unsigned char *, int);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
void RTP_init_header_v2_ext_faros_polito_IMG(unsigned char *p, int len) {
  memset(p, 0, len);
  RTP_set_version(p, 0x2);
  RTP_set_extension(p, 0x1);
  RTP_set_extension_type(p, 0xEEEE);
  RTP_set_extension_len(p, 1);
}


x86 assembly (clang, -O0):
<RTP_init_header_v2_ext_faros_polito_IMG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1050 <RTP_set_version@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1060 <RTP_set_extension@plt>
mov    -0x8(%rbp),%rdi
mov    $0xeeee,%esi
call   1070 <RTP_set_extension_type@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <RTP_set_extension_len@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTP_init_header_v2_ext_faros_polito_IMG>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1050 <RTP_set_version@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1060 <RTP_set_extension@plt>
mov    %rbx,%rdi
mov    $0xeeee,%esi
call   1070 <RTP_set_extension_type@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1040 <RTP_set_extension_len@plt>

LLVM IR (-O0):
define void @RTP_init_header_v2_ext_faros_polito_IMG(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @memset(i8* %5, i32 0, i32 %6)
%8 = load i8*, i8** %3
%9 = call i32 @RTP_set_version(i8* %8, i32 2)
%10 = load i8*, i8** %3
%11 = call i32 @RTP_set_extension(i8* %10, i32 1)
%12 = load i8*, i8** %3
%13 = call i32 @RTP_set_extension_type(i8* %12, i32 61166)
%14 = load i8*, i8** %3
%15 = call i32 @RTP_set_extension_len(i8* %14, i32 1)
ret void
}

LLVM IR (-O2):
define void @RTP_init_header_v2_ext_faros_polito_IMG(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
%4 = tail call i32 @RTP_set_version(i8* %0, i32 2)
%5 = tail call i32 @RTP_set_extension(i8* %0, i32 1)
%6 = tail call i32 @RTP_set_extension_type(i8* %0, i32 61166)
%7 = tail call i32 @RTP_set_extension_len(i8* %0, i32 1)
ret void
}
/* Variables and functions */
int sha256_file(char const *, unsigned char *, int);
int sha2_file(const char *path, unsigned char output[32], int is224) {
  return sha256_file(path, output, is224);
}


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

x86 assembly (clang, -O2):
<sha2_file>:
jmp    1030 <sha256_file@plt>

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

LLVM IR (-O2):
define i32 @sha2_file(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @sha256_file(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
int test_imm_9Fint8_reg(signed char val) {
  return ((val) & (-0x9F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Fint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff61,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Fint8_reg>:
test   $0xffffff61,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Fint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -159
%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_9Fint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -159
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t htonl(uint32_t x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @htonl(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *checked_malloc(size_t size) {
  void *p;
  p = malloc(size);
  if (!p)
    abort();
  return p;
}


x86 assembly (clang, -O0):
<checked_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <checked_malloc+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112d <checked_malloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @checked_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @checked_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t PeResolveExportHash(uint64_t base, uint64_t hash) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @PeResolveExportHash(i32 %0, i32 %1) {
ret i32 0
}
int main() {
  unsigned long t1 = -1;
  return (t1 | t1 == t1) + 1 | 2 | 4;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    -0x10(%rbp),%rcx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
add    $0x1,%rax
or     $0x2,%rax
or     $0x4,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 -1, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = load i64, i64* %2
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
%8 = sext i32 %7 to i64
%9 = or i64 %3, %8
%10 = add i64 %9, 1
%11 = or i64 %10, 2
%12 = or i64 %11, 4
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
ret i32 6
}
void CRYPTO_dbg_free(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_dbg_free() {
ret void
}
void ls_costN_nm3_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @ls_costN_nm3_incref() {
ret void
}
/* Variables and functions */
void *checkPointerError(int /*<<< orphan*/, char *, char *, int, int);
int /*<<< orphan*/ realloc(void *, size_t);
void *reallocate(void *self, size_t size, char *file, int line) {
  return checkPointerError(realloc(self, size), "Can't reallocate memory", file,
                           line, -1);
}


x86 assembly (clang, -O0):
<reallocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xeac(%rip),%rsi
mov    $0xffffffff,%r8d
call   1040 <checkPointerError@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocate>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
call   1030 <realloc@plt>
lea    0xecc(%rip),%rsi
mov    %eax,%edi
mov    %rbx,%rdx
mov    %ebp,%ecx
mov    $0xffffffff,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <checkPointerError@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Can't reallocate memory\00"
define i8* @reallocate(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @realloc(i8* %9, i64 %10)
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i8* @checkPointerError(i32 %11, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13, i32 -1)
ret i8* %14
}

LLVM IR (-O2):
@.str = [24 x i8] c"Can't reallocate memory\00"
define i8* @reallocate(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 @realloc(i8* %0, i64 %1)
%6 = tail call i8* @checkPointerError(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i32 -1)
ret i8* %6
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ memcpy(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
char const *get_terminal(void) {
  static char ret[255];
  char *env;
  env = getenv("TERM");
  memcpy(ret, env, strlen(env));
  return ret;
}


x86 assembly (clang, -O0):
<get_terminal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0x2eea(%rip),%rdi
call   1050 <memcpy@plt>
lea    0x2ede(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_terminal>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
lea    0x2efe(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <memcpy@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@get_terminal.ret = internal global [255 x i8] zeroinitializer
@.str = [5 x i8] c"TERM\00"
define i8* @get_terminal() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @memcpy(i8* getelementptr inbounds ([255 x i8], [255 x i8]* @get_terminal.ret, i64 0, i64 0), i8* %3, i32 %5)
ret i8* getelementptr inbounds ([255 x i8], [255 x i8]* @get_terminal.ret, i64 0, i64 0)
}

LLVM IR (-O2):
@get_terminal.ret = internal global [255 x i8] zeroinitializer
@.str = [5 x i8] c"TERM\00"
define i8* @get_terminal() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @strlen(i8* %1)
%3 = tail call i32 @memcpy(i8* getelementptr inbounds ([255 x i8], [255 x i8]* @get_terminal.ret, i64 0, i64 0), i8* %1, i32 %2)
ret i8* getelementptr inbounds ([255 x i8], [255 x i8]* @get_terminal.ret, i64 0, i64 0)
}
int m3_tolower(ch)
int ch;
{ return (ch >= 'A' && ch <= 'Z') ? ch | 0x20 : ch; }


x86 assembly (clang, -O0):
<m3_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1129 <m3_tolower+0x29>
cmpl   $0x5a,-0x4(%rbp)
jg     1129 <m3_tolower+0x29>
mov    -0x4(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <m3_tolower+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m3_tolower>:
lea    -0x41(%rdi),%ecx
mov    %edi,%eax
or     $0x20,%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @m3_tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = or i32 %9, 32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @m3_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = or i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
foo(a, c) {
  int b;
  if (a + c >= 0)
    return a | 0x80000000;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    $0x0,%eax
jl     1129 <foo+0x29>
mov    -0x8(%rbp),%eax
or     $0x80000000,%eax
mov    %eax,-0x4(%rbp)
jmp    1130 <foo+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%ecx
or     $0x80000000,%ecx
xor    %eax,%eax
add    %edi,%esi
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %4
%13 = or i32 %12, -2147483648
store i32 %13, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = or i32 %0, -2147483648
%5 = icmp slt i32 %3, 0
%6 = select i1 %5, i32 0, i32 %4
ret i32 %6
}
/* Variables and functions */
int hide_a(int);
int show_b(int);
int main() {
  return hide_a(1) + show_b(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <hide_a@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <show_b@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1040 <hide_a@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <show_b@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @hide_a(i32 1)
%2 = tail call i32 @show_b(i32 1)
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ put(char *);
int /*<<< orphan*/ puts(int);
int main() {
  put("Hello");
  put("Hello");
  puts(12);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <put@plt>
lea    0xebe(%rip),%rdi
call   1040 <put@plt>
mov    $0xc,%edi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <put@plt>
mov    %rbx,%rdi
call   1040 <put@plt>
mov    $0xc,%edi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @put(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @put(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @puts(i32 12)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 @put(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @put(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i32 12)
ret i32 0
}
int show_results(char *text) {}


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

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

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

LLVM IR (-O2):
define i32 @show_results(i8* nocapture readnone %0) {
ret i32 undef
}
int bar(int y, int z) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
ret i32 0
}
void pause_or_input(void) {}


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

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

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

LLVM IR (-O2):
define void @pause_or_input() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_clr(int);
int /*<<< orphan*/ gpio_output_pin(int);
void reg_setup() {
  gpio_output_pin(17);
  gpio_output_pin(7);
  gpio_output_pin(4);
  gpio_clr(1 << 17);
  gpio_clr(1 << 7);
}


x86 assembly (clang, -O0):
<reg_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%edi
call   1040 <gpio_output_pin@plt>
mov    $0x7,%edi
call   1040 <gpio_output_pin@plt>
mov    $0x4,%edi
call   1040 <gpio_output_pin@plt>
mov    $0x20000,%edi
call   1030 <gpio_clr@plt>
mov    $0x80,%edi
call   1030 <gpio_clr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_setup>:
push   %rax
mov    $0x11,%edi
call   1040 <gpio_output_pin@plt>
mov    $0x7,%edi
call   1040 <gpio_output_pin@plt>
mov    $0x4,%edi
call   1040 <gpio_output_pin@plt>
mov    $0x20000,%edi
call   1030 <gpio_clr@plt>
mov    $0x80,%edi
pop    %rax
jmp    1030 <gpio_clr@plt>

LLVM IR (-O0):
define void @reg_setup() {
%1 = call i32 @gpio_output_pin(i32 17)
%2 = call i32 @gpio_output_pin(i32 7)
%3 = call i32 @gpio_output_pin(i32 4)
%4 = call i32 @gpio_clr(i32 131072)
%5 = call i32 @gpio_clr(i32 128)
ret void
}

LLVM IR (-O2):
define void @reg_setup() {
%1 = tail call i32 @gpio_output_pin(i32 17)
%2 = tail call i32 @gpio_output_pin(i32 7)
%3 = tail call i32 @gpio_output_pin(i32 4)
%4 = tail call i32 @gpio_clr(i32 131072)
%5 = tail call i32 @gpio_clr(i32 128)
ret void
}
int __add3(int d, int m, int c) { return d + m + c; }


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

x86 assembly (clang, -O2):
<__add3>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @__add3(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 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @__add3(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ check_stdout_buf_size();
int main(int argc, char *argv[]) {
  check_stdout_buf_size();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @check_stdout_buf_size()
ret i32 0
}
/* Variables and functions */
unsigned int test(int, int /*<<< orphan*/);
int main(int argc, char *argv[] __attribute__((unused))) {
  unsigned int x = test(argc, 0);
  x |= test(argc + 1, 0);
  x |= test(argc + 2, 0);
  return !(x & (64 - 1));
}


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    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <test@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
add    $0x1,%edi
xor    %esi,%esi
call   1030 <test@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
add    $0x2,%edi
xor    %esi,%esi
call   1030 <test@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x3f,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
call   1030 <test@plt>
mov    %eax,%r14d
lea    0x1(%rbx),%edi
xor    %esi,%esi
call   1030 <test@plt>
mov    %eax,%ebp
or     %r14d,%ebp
add    $0x2,%ebx
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <test@plt>
or     %ebp,%eax
xor    %ecx,%ecx
test   $0x3f,%al
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = call i32 @test(i32 %7, i32 0)
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
%11 = call i32 @test(i32 %10, i32 0)
%12 = load i32, i32* %6
%13 = or i32 %12, %11
store i32 %13, i32* %6
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 2
%16 = call i32 @test(i32 %15, i32 0)
%17 = load i32, i32* %6
%18 = or i32 %17, %16
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = and i32 %19, 63
%21 = icmp ne i32 %20, 0
%22 = xor i1 %21, true
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test(i32 %0, i32 0)
%4 = add nsw i32 %0, 1
%5 = tail call i32 @test(i32 %4, i32 0)
%6 = or i32 %5, %3
%7 = add nsw i32 %0, 2
%8 = tail call i32 @test(i32 %7, i32 0)
%9 = or i32 %6, %8
%10 = and i32 %9, 63
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ cap_user_header_t;
typedef int /*<<< orphan*/ cap_user_data_t;

/* Variables and functions */
int capGet(cap_user_header_t hdr, cap_user_data_t data) {
  int capget(cap_user_header_t hdr, cap_user_data_t data);
  return capget(hdr, data);
}


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

x86 assembly (clang, -O2):
<capGet>:
jmp    1030 <capget@plt>

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

LLVM IR (-O2):
define i32 @capGet(i32 %0, i32 %1) {
%3 = tail call i32 @capget(i32 %0, i32 %1)
ret i32 %3
}
int test_imm_2Bint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x2B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Bint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 43
%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_2Bint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 184683593728
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ OpenAudio();
int /*<<< orphan*/ StartMixer();
void InitMixer() {
  OpenAudio();
  StartMixer();
}


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

x86 assembly (clang, -O2):
<InitMixer>:
push   %rax
xor    %eax,%eax
call   1030 <OpenAudio@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <StartMixer@plt>

LLVM IR (-O0):
define void @InitMixer() {
%1 = call i32 (...) @OpenAudio()
%2 = call i32 (...) @StartMixer()
ret void
}

LLVM IR (-O2):
define void @InitMixer() {
%1 = tail call i32 (...) @OpenAudio()
%2 = tail call i32 (...) @StartMixer()
ret void
}
/* Type definitions */
struct in6_addr {
  int *s6_addr32;
};

/* Variables and functions */
int htonl(int);
int ipv6_addr_v4mapped(const struct in6_addr *a) {
  return ((a->s6_addr32[0] | a->s6_addr32[1] |
           (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0);
}


x86 assembly (clang, -O0):
<ipv6_addr_v4mapped>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
or     0x4(%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    $0xffff,%edi
call   1030 <htonl@plt>
mov    -0x10(%rbp),%ecx
mov    %eax,%edx
mov    -0xc(%rbp),%eax
xor    %edx,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv6_addr_v4mapped>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%rax
mov    0x4(%rax),%ebx
mov    0x8(%rax),%ebp
or     (%rax),%ebx
mov    $0xffff,%edi
call   1030 <htonl@plt>
xor    %ebp,%eax
xor    %ecx,%ecx
or     %ebx,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.in6_addr = type { i32* }
define i32 @ipv6_addr_v4mapped(%struct.in6_addr* %0) {
%2 = alloca %struct.in6_addr*
store %struct.in6_addr* %0, %struct.in6_addr** %2
%3 = load %struct.in6_addr*, %struct.in6_addr** %2
%4 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %3, i32 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load %struct.in6_addr*, %struct.in6_addr** %2
%9 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %8, i32 0, i32 0
%10 = load i32*, i32** %9
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = or i32 %7, %12
%14 = load %struct.in6_addr*, %struct.in6_addr** %2
%15 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %14, i32 0, i32 0
%16 = load i32*, i32** %15
%17 = getelementptr inbounds i32, i32* %16, i64 2
%18 = load i32, i32* %17
%19 = call i32 @htonl(i32 65535)
%20 = xor i32 %18, %19
%21 = or i32 %13, %20
%22 = icmp eq i32 %21, 0
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
%struct.in6_addr = type { i32* }
define i32 @ipv6_addr_v4mapped(%struct.in6_addr* nocapture %0) {
%2 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %0, i64 0, i32 0
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %3, i64 1
%6 = load i32, i32* %5
%7 = or i32 %6, %4
%8 = getelementptr inbounds i32, i32* %3, i64 2
%9 = load i32, i32* %8
%10 = tail call i32 @htonl(i32 65535)
%11 = xor i32 %10, %9
%12 = or i32 %7, %11
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}