xunge/DecIR huggingface dataset:
void vec2_normalize(const float a[2], float out[2]) {
  vec2_mul(a, 1 / vec2_norm(a), out);
}


x86 assembly (clang, -O0):
<vec2_normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <vec2_norm@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <vec2_mul@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_normalize>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <vec2_norm@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
mov    $0x0,%esi
cmovb  %eax,%esi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <vec2_mul@plt>

LLVM IR (-O0):
define void @vec2_normalize(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %3
%7 = call i32 (float*, ...) bitcast (i32 (...)* @vec2_norm to i32 (float*, ...)*)(float* %6)
%8 = sdiv i32 1, %7
%9 = load float*, float** %4
%10 = call i32 (float*, i32, float*, ...) bitcast (i32 (...)* @vec2_mul to i32 (float*, i32, float*, ...)*)(float* %5, i32 %8, float* %9)
ret void
}

LLVM IR (-O2):
define void @vec2_normalize(float* %0, float* %1) {
%3 = tail call i32 (float*, ...) bitcast (i32 (...)* @vec2_norm to i32 (float*, ...)*)(float* %0)
%4 = add i32 %3, 1
%5 = icmp ult i32 %4, 3
%6 = select i1 %5, i32 %3, i32 0
%7 = tail call i32 (float*, i32, float*, ...) bitcast (i32 (...)* @vec2_mul to i32 (float*, i32, float*, ...)*)(float* %0, i32 %6, float* %1)
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void sleepms(int ms) {
  struct timespec t;
  t.tv_sec = ms / 1000;
  t.tv_nsec = (ms % 1000) * 1000000L;
  if (nanosleep(&t, NULL))
    abort();
}


x86 assembly (clang, -O0):
<sleepms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
imul   $0xf4240,%rax,%rax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <nanosleep@plt>
cmp    $0x0,%rax
je     116f <sleepms+0x4f>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleepms>:
push   %rax
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1040 <nanosleep@plt>
test   %rax,%rax
jne    115e <sleepms+0x3e>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @sleepms(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = srem i32 %7, 1000
%9 = sext i32 %8 to i64
%10 = mul nsw i64 %9, 1000000
%11 = trunc i64 %10 to i32
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %11, i32* %12
%13 = call i64 @nanosleep(%struct.timespec* %3, i32* null)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %1
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %1
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @sleepms(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = sdiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = srem i32 %0, 1000
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i64 @nanosleep(%struct.timespec* %2, i32* null)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %1
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ affecterCaracteristiqueRace();
int /*<<< orphan*/ choisirEtVisualiserRaceNouveauPersonnage();
void demanderRaceNouveauPersonnage(void) {
  choisirEtVisualiserRaceNouveauPersonnage();
  affecterCaracteristiqueRace();
}


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

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

LLVM IR (-O0):
define void @demanderRaceNouveauPersonnage() {
%1 = call i32 (...) @choisirEtVisualiserRaceNouveauPersonnage()
%2 = call i32 (...) @affecterCaracteristiqueRace()
ret void
}

LLVM IR (-O2):
define void @demanderRaceNouveauPersonnage() {
%1 = tail call i32 (...) @choisirEtVisualiserRaceNouveauPersonnage()
%2 = tail call i32 (...) @affecterCaracteristiqueRace()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t swap_uint32(uint32_t val) {
  val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF);
  return (val << 16) | (val >> 16);
}


x86 assembly (clang, -O0):
<swap_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff00ff00,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00ff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_uint32>:
bswap  %edi
ror    $0x10,%edi
mov    %edi,%eax
shl    $0x10,%eax
sar    $0x10,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @swap_uint32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, -16711936
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 16711935
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = shl i32 %10, 16
%12 = load i32, i32* %2
%13 = ashr i32 %12, 16
%14 = or i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @swap_uint32(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, -16711936
%4 = lshr i32 %0, 8
%5 = and i32 %4, 16711935
%6 = or i32 %3, %5
%7 = shl i32 %6, 16
%8 = ashr i32 %6, 16
%9 = or i32 %7, %8
ret i32 %9
}
/* Variables and functions */
void gp_get_realtime(long *);
void gp_get_usertime(long *pdt) { return gp_get_realtime(pdt); }


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

x86 assembly (clang, -O2):
<gp_get_usertime>:
jmp    1030 <gp_get_realtime@plt>

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

LLVM IR (-O2):
define void @gp_get_usertime(i64* %0) {
tail call void @gp_get_realtime(i64* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void html_finish() { printf("\n</body></html>\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"\0A</body></html>\0A\00"
define void @html_finish() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"\0A</body></html>\00"
define void @html_finish() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct nlattr {
  int dummy;
};
typedef int /*<<< orphan*/ __be64;

/* Variables and functions */
scalar_t__ nla_data(struct nlattr const *);
__be64 nla_get_be64(const struct nlattr *nla) {
  return *(__be64 *)nla_data(nla);
}


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

x86 assembly (clang, -O2):
<nla_get_be64>:
push   %rax
call   1030 <nla_data@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.nlattr = type { i32 }
define i32 @nla_get_be64(%struct.nlattr* %0) {
%2 = alloca %struct.nlattr*
store %struct.nlattr* %0, %struct.nlattr** %2
%3 = load %struct.nlattr*, %struct.nlattr** %2
%4 = call i64 @nla_data(%struct.nlattr* %3)
%5 = inttoptr i64 %4 to i32*
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
define i32 @nla_get_be64(%struct.nlattr* %0) {
%2 = tail call i64 @nla_data(%struct.nlattr* %0)
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void die(const char *reason) {
  perror(reason);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int mult(int a, int b) {
  int c = 0;
  c = a * b;
  return c;
}


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

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

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

LLVM IR (-O2):
define i32 @mult(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void mp2vseqx_set_vbvbuffer(uint8_t *p_mp2vseqx, uint8_t i_vbvbuffer) {
  p_mp2vseqx[8] = i_vbvbuffer;
}


x86 assembly (clang, -O0):
<mp2vseqx_set_vbvbuffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseqx_set_vbvbuffer>:
mov    %esi,0x20(%rdi)
ret

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

LLVM IR (-O2):
define void @mp2vseqx_set_vbvbuffer(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 8
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void sortit(int *a, int lo, int hi) {
  if (lo >= hi)
    ;
  else {
    int pvt = partition(a, lo, hi);
    sortit(a, lo, pvt - 1);
    sortit(a, pvt + 1, hi);
  }
}


x86 assembly (clang, -O0):
<sortit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1143 <sortit+0x23>
jmp    1179 <sortit+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <sortit@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <sortit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sortit>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <sortit+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <sortit@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <sortit+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @sortit(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @sortit(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
int puts(const char *s __attribute__((unused))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ limitsTest();
int /*<<< orphan*/ stdintTest();
int main() {
  limitsTest();
  stdintTest();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @limitsTest()
%3 = call i32 (...) @stdintTest()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @limitsTest()
%2 = tail call i32 (...) @stdintTest()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int);
int main(void) {
  foo(5, 7);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 5, i32 7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 5, i32 7)
ret i32 0
}
int test(int Num) {
  int Arr[Num];
  Arr[2] = 0;
  return Arr[2];
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
movl   $0x0,0x8(%rax)
mov    0x8(%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i32, i64 %6
store i64 %6, i64* %4
%9 = getelementptr inbounds i32, i32* %8, i64 2
store i32 0, i32* %9
%10 = getelementptr inbounds i32, i32* %8, i64 2
%11 = load i32, i32* %10
%12 = load i8*, i8** %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @test(i32 %0) {
ret i32 0
}
float yparal(float v1, float v2) { return 2 * (v1 + v2); }


x86 assembly (clang, -O0):
<yparal>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
addss  -0x8(%rbp),%xmm1
movss  0xee0(%rip),%xmm0
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<yparal>:
addss  %xmm1,%xmm0
addss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @yparal(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
%8 = fmul float 2.000000e+00, %7
ret float %8
}

LLVM IR (-O2):
define float @yparal(float %0, float %1) {
%3 = fadd float %0, %1
%4 = fmul float %3, 2.000000e+00
ret float %4
}
int loop() {
  int rc = 0;
  char *line;
  while (line = readline()) {
    char **args = splitline(line);
    rc = execute(args);
    memfree(args);
    memfree(line);
  }
  return rc;
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <readline@plt>
cltq
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     11a0 <loop+0x60>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1060 <splitline@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <execute@plt>
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1050 <memfree@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <memfree@plt>
jmp    114f <loop+0xf>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <readline@plt>
test   %eax,%eax
je     118e <loop+0x4e>
movslq %eax,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <splitline@plt>
movslq %eax,%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <execute@plt>
mov    %eax,%r14d
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <memfree@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <memfree@plt>
jmp    1150 <loop+0x10>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @loop() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8**
store i32 0, i32* %1
br label %4
4: ; preds = %9, %0
%5 = call i32 (...) @readline()
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %2
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %20
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @splitline to i32 (i8*, ...)*)(i8* %10)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8**
store i8** %13, i8*** %3
%14 = load i8**, i8*** %3
%15 = call i32 (i8**, ...) bitcast (i32 (...)* @execute to i32 (i8**, ...)*)(i8** %14)
store i32 %15, i32* %1
%16 = load i8**, i8*** %3
%17 = call i32 (i8**, ...) bitcast (i32 (...)* @memfree to i32 (i8**, ...)*)(i8** %16)
%18 = load i8*, i8** %2
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @memfree to i32 (i8*, ...)*)(i8* %18)
br label %4
20: ; preds = %4
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
define i32 @loop() {
%1 = tail call i32 (...) @readline()
%2 = icmp eq i32 %1, 0
br i1 %2, label %15, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %13, %3 ], [ %1, %0 ]
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @splitline to i32 (i8*, ...)*)(i8* %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8**
%10 = tail call i32 (i8**, ...) bitcast (i32 (...)* @execute to i32 (i8**, ...)*)(i8** %9)
%11 = tail call i32 (i8**, ...) bitcast (i32 (...)* @memfree to i32 (i8**, ...)*)(i8** %9)
%12 = tail call i32 (i8*, ...) bitcast (i32 (...)* @memfree to i32 (i8*, ...)*)(i8* %6)
%13 = tail call i32 (...) @readline()
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %3
15: ; preds = %3, %0
%16 = phi i32 [ 0, %0 ], [ %10, %3 ]
ret i32 %16
}
int h() {
  static int i;
  return i++;
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0f(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
ret

LLVM IR (-O0):
@h.i = internal global i32 0
define i32 @h() {
%1 = load i32, i32* @h.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @h.i
ret i32 %1
}

LLVM IR (-O2):
@h.i = internal unnamed_addr global i32 0
define i32 @h() {
%1 = load i32, i32* @h.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @h.i
ret i32 %1
}
float f_clamp(float val, float lo, float hi) {
  return lo > hi ? f_clamp(val, hi, lo)
                 : (val > lo ? (val < hi ? val : hi) : lo);
}


x86 assembly (clang, -O0):
<f_clamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1154 <f_clamp+0x44>
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
call   1030 <f_clamp@plt>
movss  %xmm0,-0x10(%rbp)
jmp    11b2 <f_clamp+0xa2>
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    119e <f_clamp+0x8e>
movss  -0x4(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1185 <f_clamp+0x75>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    118f <f_clamp+0x7f>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    11a8 <f_clamp+0x98>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_clamp>:
movaps %xmm2,%xmm3
movaps %xmm1,%xmm2
ucomiss %xmm3,%xmm1
movaps %xmm3,%xmm1
ja     1100 <f_clamp>
movaps %xmm2,%xmm1
cmpltss %xmm0,%xmm1
minss  %xmm3,%xmm0
andps  %xmm1,%xmm0
andnps %xmm2,%xmm1
orps   %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f_clamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float, float* %6
%9 = fcmp ogt float %7, %8
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load float, float* %4
%12 = load float, float* %6
%13 = load float, float* %5
%14 = call float @f_clamp(float %11, float %12, float %13)
br label %33
15: ; preds = %3
%16 = load float, float* %4
%17 = load float, float* %5
%18 = fcmp ogt float %16, %17
br i1 %18, label %19, label %29
19: ; preds = %15
%20 = load float, float* %4
%21 = load float, float* %6
%22 = fcmp olt float %20, %21
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = load float, float* %4
br label %27
25: ; preds = %19
%26 = load float, float* %6
br label %27
27: ; preds = %25, %23
%28 = phi float [ %24, %23 ], [ %26, %25 ]
br label %31
29: ; preds = %15
%30 = load float, float* %5
br label %31
31: ; preds = %29, %27
%32 = phi float [ %28, %27 ], [ %30, %29 ]
br label %33
33: ; preds = %31, %10
%34 = phi float [ %14, %10 ], [ %32, %31 ]
ret float %34
}

LLVM IR (-O2):
define float @f_clamp(float %0, float %1, float %2) {
br label %4
4: ; preds = %4, %3
%5 = phi float [ %1, %3 ], [ %6, %4 ]
%6 = phi float [ %2, %3 ], [ %5, %4 ]
%7 = fcmp ogt float %5, %6
br i1 %7, label %4, label %8
8: ; preds = %4
%9 = fcmp olt float %5, %0
%10 = fcmp ogt float %6, %0
%11 = select i1 %10, float %0, float %6
%12 = select i1 %9, float %11, float %5
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void cls() {
  printf("\e[1;1H\e[2J");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<cls>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cls>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[1;1H\1B[2J\00"
@stdout = global i32 0
define void @cls() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[1;1H\1B[2J\00"
@stdout = global i32 0
define void @cls() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
void __DELETE_java_io_InterruptedIOException(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_io_InterruptedIOException(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void do_alarm(int sig) {}


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

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

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

LLVM IR (-O2):
define void @do_alarm(i32 %0) {
ret void
}
char *m2mp_client_get_version() { return "0.2.0"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"0.2.0\00"
define i8* @m2mp_client_get_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"0.2.0\00"
define i8* @m2mp_client_get_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int get_tty_length(void) {
  int ret;
  return (80);
}


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

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

LLVM IR (-O0):
define i32 @get_tty_length() {
%1 = alloca i32
ret i32 80
}

LLVM IR (-O2):
define i32 @get_tty_length() {
ret i32 80
}
adoshello() {}


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

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

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

LLVM IR (-O2):
define i32 @adoshello() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ log(double const);
double pnorm(int /*<<< orphan*/, double const, double const);
double plnorm(const double x, const double logmu, const double logsigma) {
  return pnorm(log(x), logmu, logsigma);
}


x86 assembly (clang, -O0):
<plnorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
mov    %eax,%edi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <pnorm@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plnorm>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
call   1040 <log@plt>
mov    %eax,%edi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
add    $0x18,%rsp
jmp    1030 <pnorm@plt>

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

LLVM IR (-O2):
define double @plnorm(double %0, double %1, double %2) {
%4 = tail call i32 @log(double %0)
%5 = tail call double @pnorm(i32 %4, double %1, double %2)
ret double %5
}
int test_imm_E7uint16_reg(unsigned short val) {
  return ((val) & (-0xE7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E7uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -231
%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_E7uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -231
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XVisibilityEvent;

/* Variables and functions */
unsigned long get_XVisibilityEvent_serial(void *_p) {
  return (unsigned long)((XVisibilityEvent *)_p)->serial;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XVisibilityEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
int bootstage_unstash(void *base, int size) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bootstage_unstash(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stk500v2_cleanup();
int /*<<< orphan*/ stk500v2_ok();
void stk500v2_leave_progmode_isp(void) {
  ;
  stk500v2_cleanup();
  stk500v2_ok();
}


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

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

LLVM IR (-O0):
define void @stk500v2_leave_progmode_isp() {
%1 = call i32 (...) @stk500v2_cleanup()
%2 = call i32 (...) @stk500v2_ok()
ret void
}

LLVM IR (-O2):
define void @stk500v2_leave_progmode_isp() {
%1 = tail call i32 (...) @stk500v2_cleanup()
%2 = tail call i32 (...) @stk500v2_ok()
ret void
}
int urecursiveboehmjacopinikernelfunction(void) {
  char c;
  switch (c) {
  case 0x20:
    break;
  case ',':
    break;
  case '*':
    break;
  case ';':
    break;
  default:
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<urecursiveboehmjacopinikernelfunction>:
push   %rbp
mov    %rsp,%rbp
movsbl -0x1(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x1b,%eax
ja     1142 <urecursiveboehmjacopinikernelfunction+0x42>
mov    -0x10(%rbp),%rax
lea    0xedb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1147 <urecursiveboehmjacopinikernelfunction+0x47>
jmp    1147 <urecursiveboehmjacopinikernelfunction+0x47>
jmp    1147 <urecursiveboehmjacopinikernelfunction+0x47>
jmp    1147 <urecursiveboehmjacopinikernelfunction+0x47>
jmp    1147 <urecursiveboehmjacopinikernelfunction+0x47>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @urecursiveboehmjacopinikernelfunction() {
%1 = alloca i8
%2 = load i8, i8* %1
%3 = sext i8 %2 to i32
switch i32 %3, label %8 [
i32 32, label %4
i32 44, label %5
i32 42, label %6
i32 59, label %7
]
4: ; preds = %0
br label %9
5: ; preds = %0
br label %9
6: ; preds = %0
br label %9
7: ; preds = %0
br label %9
8: ; preds = %0
br label %9
9: ; preds = %8, %7, %6, %5, %4
ret i32 0
}

LLVM IR (-O2):
define i32 @urecursiveboehmjacopinikernelfunction() {
ret i32 0
}
void motion_test7(int *data) {
  int i = data[1];
  int j = data[0];
  do {
    if (i & 1)
      data[data[2]] = 21 * j + i;
    i++;
  } while (i < data[3]);
}


x86 assembly (clang, -O0):
<motion_test7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1140 <motion_test7+0x40>
imul   $0x15,-0x10(%rbp),%edx
add    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0xc(%rcx),%eax
jl     111b <motion_test7+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<motion_test7>:
mov    (%rdi),%ecx
mov    0x4(%rdi),%eax
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,4),%ecx
jmp    1118 <motion_test7+0x18>
nopl   (%rax)
add    $0x1,%eax
cmp    0xc(%rdi),%eax
jge    1128 <motion_test7+0x28>
test   $0x1,%al
je     1110 <motion_test7+0x10>
lea    (%rcx,%rax,1),%edx
movslq 0x8(%rdi),%rsi
mov    %edx,(%rdi,%rsi,4)
jmp    1110 <motion_test7+0x10>
ret

LLVM IR (-O0):
define void @motion_test7(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
store i32 %10, i32* %4
br label %11
11: ; preds = %29, %1
%12 = load i32, i32* %3
%13 = and i32 %12, 1
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %26
15: ; preds = %11
%16 = load i32, i32* %4
%17 = mul nsw i32 21, %16
%18 = load i32, i32* %3
%19 = add nsw i32 %17, %18
%20 = load i32*, i32** %2
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 2
%23 = load i32, i32* %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %20, i64 %24
store i32 %19, i32* %25
br label %26
26: ; preds = %15, %11
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %29
29: ; preds = %26
%30 = load i32, i32* %3
%31 = load i32*, i32** %2
%32 = getelementptr inbounds i32, i32* %31, i64 3
%33 = load i32, i32* %32
%34 = icmp slt i32 %30, %33
br i1 %34, label %11, label %35
35: ; preds = %29
ret void
}

LLVM IR (-O2):
define void @motion_test7(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = load i32, i32* %0
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = mul nsw i32 %4, 21
%7 = getelementptr inbounds i32, i32* %0, i64 2
br label %8
8: ; preds = %17, %1
%9 = phi i32 [ %3, %1 ], [ %18, %17 ]
%10 = and i32 %9, 1
%11 = icmp eq i32 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = add nsw i32 %9, %6
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %0, i64 %15
store i32 %13, i32* %16
br label %17
17: ; preds = %12, %8
%18 = add nsw i32 %9, 1
%19 = load i32, i32* %5
%20 = icmp slt i32 %18, %19
br i1 %20, label %8, label %21
21: ; preds = %17
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void doit(float gallon, int size, float cost) {
  printf("Price per gallon: $%.2f\n", gallon);
  printf("Tank size   : %d\n", size);
  printf("Total cost      : $%.2f\n", cost);
}


x86 assembly (clang, -O0):
<doit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x8(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doit>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
mov    %edi,%ebx
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Price per gallon: $%.2f\0A\00"
@.str.1 = [18 x i8] c"Tank size : %d\0A\00"
@.str.2 = [25 x i8] c"Total cost : $%.2f\0A\00"
define void @doit(float %0, i32 %1, float %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca float
store float %0, float* %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), float %7)
%9 = load i32, i32* %5
%10 = sitofp i32 %9 to float
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), float %10)
%12 = load float, float* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), float %12)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Price per gallon: $%.2f\0A\00"
@.str.1 = [18 x i8] c"Tank size : %d\0A\00"
@.str.2 = [25 x i8] c"Total cost : $%.2f\0A\00"
define void @doit(float %0, i32 %1, float %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), float %0)
%5 = sitofp i32 %1 to float
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), float %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), float %2)
ret void
}
double physmem_total() { return 0; }


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

x86 assembly (clang, -O2):
<physmem_total>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @physmem_total() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @physmem_total() {
ret double 0.000000e+00
}
/* Variables and functions */
void OME_memory_free(void *addr, size_t size) {}


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

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

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

LLVM IR (-O2):
define void @OME_memory_free(i8* nocapture %0, i64 %1) {
ret void
}
void RTC_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @RTC_IRQHandler() {
ret void
}
signed short GetLoVolReg(signed short swVol) {
  signed short swRet = 31 + (swVol - 128) / 256;
  if (swVol < (-30 * 256)) {
    swRet = 0;
  }
  if (swRet < 0) {
    swRet = 0;
  }
  if (swRet > 31) {
    swRet = 31;
  }
  return swRet;
}


x86 assembly (clang, -O0):
<GetLoVolReg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
sub    $0x80,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
add    $0x1f,%eax
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0xffffe200,%eax
jge    1138 <GetLoVolReg+0x38>
movw   $0x0,-0x4(%rbp)
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
jge    114b <GetLoVolReg+0x4b>
movw   $0x0,-0x4(%rbp)
movswl -0x4(%rbp),%eax
cmp    $0x1f,%eax
jle    115e <GetLoVolReg+0x5e>
movw   $0x1f,-0x4(%rbp)
movswl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetLoVolReg>:
lea    -0x80(%rdi),%eax
lea    0x7f(%rdi),%ecx
test   %eax,%eax
cmovns %eax,%ecx
shr    $0x8,%ecx
add    $0x1f,%ecx
xor    %eax,%eax
cmp    $0xffffe200,%edi
cmovl  %eax,%ecx
test   %cx,%cx
cmovs  %eax,%ecx
cmp    $0x1f,%cx
mov    $0x1f,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @GetLoVolReg(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = sext i16 %4 to i32
%6 = sub nsw i32 %5, 128
%7 = sdiv i32 %6, 256
%8 = add nsw i32 31, %7
%9 = trunc i32 %8 to i16
store i16 %9, i16* %3
%10 = load i16, i16* %2
%11 = sext i16 %10 to i32
%12 = icmp slt i32 %11, -7680
br i1 %12, label %13, label %14
13: ; preds = %1
store i16 0, i16* %3
br label %14
14: ; preds = %13, %1
%15 = load i16, i16* %3
%16 = sext i16 %15 to i32
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14
store i16 0, i16* %3
br label %19
19: ; preds = %18, %14
%20 = load i16, i16* %3
%21 = sext i16 %20 to i32
%22 = icmp sgt i32 %21, 31
br i1 %22, label %23, label %24
23: ; preds = %19
store i16 31, i16* %3
br label %24
24: ; preds = %23, %19
%25 = load i16, i16* %3
ret i16 %25
}

LLVM IR (-O2):
define signext i16 @GetLoVolReg(i16 signext %0) {
%2 = sext i16 %0 to i32
%3 = add nsw i32 %2, -128
%4 = sdiv i32 %3, 256
%5 = trunc i32 %4 to i16
%6 = add nsw i16 %5, 31
%7 = icmp slt i16 %0, -7680
%8 = select i1 %7, i16 0, i16 %6
%9 = icmp sgt i16 %8, 0
%10 = select i1 %9, i16 %8, i16 0
%11 = icmp ult i16 %10, 31
%12 = select i1 %11, i16 %10, i16 31
ret i16 %12
}
unsigned int f6(int xxx, unsigned yyy, signed char uuu) {
  return xxx ? yyy : uuu;
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1124 <f6+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112b <f6+0x2b>
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
mov    %esi,%eax
test   %edi,%edi
cmove  %edx,%eax
ret

LLVM IR (-O0):
define i32 @f6(i32 %0, i32 %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = load i32, i32* %5
br label %14
11: ; preds = %3
%12 = load i8, i8* %6
%13 = sext i8 %12 to i32
br label %14
14: ; preds = %11, %9
%15 = phi i32 [ %10, %9 ], [ %13, %11 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @f6(i32 %0, i32 %1, i8 signext %2) {
%4 = icmp eq i32 %0, 0
%5 = sext i8 %2 to i32
%6 = select i1 %4, i32 %5, i32 %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void error_exit(int code) {
  fprintf(stderr, "\n\n");
  exit(code);
}


x86 assembly (clang, -O0):
<error_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_exit>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"\0A\0A\00"
define void @error_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"\0A\0A\00"
define void @error_exit(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
double eval_add(double x, double y) { return x + y; }


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

x86 assembly (clang, -O2):
<eval_add>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @eval_add(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 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @eval_add(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(int /*<<< orphan*/);
void ft_putstr(char *str) {
  while (*str != '\0')
    ft_putchar(*(str++));
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <ft_putstr+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <ft_putchar@plt>
jmp    111c <ft_putstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <ft_putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ft_putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @ft_putchar(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void pcp_print_net_icmp6_stats(struct activity *a, int curr) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_net_icmp6_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}