xunge/DecIR huggingface dataset:
/* Variables and functions */
int get();
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int);
int main(int argc, char *argv[]) {
  get();
  get();
  get();
  printf("%d %d %d %d %d %d \n", 1, 2, get(), 3, get() + 10, get());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <get@plt>
mov    $0x0,%al
call   1040 <get@plt>
mov    $0x0,%al
call   1040 <get@plt>
mov    $0x0,%al
call   1040 <get@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <get@plt>
add    $0xa,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <get@plt>
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r9d
lea    0xe89(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%r8d
mov    %eax,(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <get@plt>
xor    %eax,%eax
call   1040 <get@plt>
xor    %eax,%eax
call   1040 <get@plt>
xor    %eax,%eax
call   1040 <get@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <get@plt>
lea    0xa(%rax),%ebp
xor    %eax,%eax
call   1040 <get@plt>
mov    %eax,(%rsp)
lea    0xea4(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    %ebx,%ecx
mov    $0x3,%r8d
mov    %ebp,%r9d
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%d %d %d %d %d %d \0A\00"
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 (...) @get()
%7 = call i32 (...) @get()
%8 = call i32 (...) @get()
%9 = call i32 (...) @get()
%10 = call i32 (...) @get()
%11 = add nsw i32 %10, 10
%12 = call i32 (...) @get()
%13 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 %9, i32 3, i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"%d %d %d %d %d %d \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @get()
%4 = tail call i32 (...) @get()
%5 = tail call i32 (...) @get()
%6 = tail call i32 (...) @get()
%7 = tail call i32 (...) @get()
%8 = add nsw i32 %7, 10
%9 = tail call i32 (...) @get()
%10 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 %6, i32 3, i32 %8, i32 %9)
ret i32 0
}
int qvmftolsse(void) {
  int retval;
  __asm__ volatile("movss ("
                   "%%rdi"
                   ", "
                   "%%rbx"
                   ", 4), %%xmm0\n"
                   "cvttss2si %%xmm0, %0\n"
                   : "=r"(retval)
                   :
                   : "%xmm0");
  return retval;
}


x86 assembly (clang, -O0):
<qvmftolsse>:
push   %rbp
mov    %rsp,%rbp
movss  (%rdi,%rbx,4),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qvmftolsse>:
movss  (%rdi,%rbx,4),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @qvmftolsse() {
%1 = alloca i32
%2 = call i32 asm sideeffect "movss (%rdi, %rbx, 4), %xmm0\0Acvttss2si %xmm0, $0\0A", "=r,~{xmm0},~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @qvmftolsse() {
%1 = tail call i32 asm sideeffect "movss (%rdi, %rbx, 4), %xmm0\0Acvttss2si %xmm0, $0\0A", "=r,~{xmm0},~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
int five_product(int digits[5]) {
  return digits[0] * digits[1] * digits[2] * digits[3] * digits[4];
}


x86 assembly (clang, -O0):
<five_product>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
imul   0x4(%rcx),%eax
mov    -0x8(%rbp),%rcx
imul   0x8(%rcx),%eax
mov    -0x8(%rbp),%rcx
imul   0xc(%rcx),%eax
mov    -0x8(%rbp),%rcx
imul   0x10(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<five_product>:
mov    0x4(%rdi),%eax
imul   (%rdi),%eax
imul   0x8(%rdi),%eax
imul   0xc(%rdi),%eax
imul   0x10(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @five_product(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = mul nsw i32 %5, %8
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = load i32, i32* %11
%13 = mul nsw i32 %9, %12
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 3
%16 = load i32, i32* %15
%17 = mul nsw i32 %13, %16
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 4
%20 = load i32, i32* %19
%21 = mul nsw i32 %17, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @five_product(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, %2
%6 = getelementptr inbounds i32, i32* %0, i64 2
%7 = load i32, i32* %6
%8 = mul nsw i32 %5, %7
%9 = getelementptr inbounds i32, i32* %0, i64 3
%10 = load i32, i32* %9
%11 = mul nsw i32 %8, %10
%12 = getelementptr inbounds i32, i32* %0, i64 4
%13 = load i32, i32* %12
%14 = mul nsw i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
int /*<<< orphan*/ glutSwapBuffers();
int /*<<< orphan*/ render();
void display() {
  render();
  glutSwapBuffers();
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <render@plt>
mov    $0x0,%al
call   1030 <glutSwapBuffers@plt>
mov    $0x0,%al
call   1050 <glutPostRedisplay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
xor    %eax,%eax
call   1040 <render@plt>
xor    %eax,%eax
call   1030 <glutSwapBuffers@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glutPostRedisplay@plt>

LLVM IR (-O0):
define void @display() {
%1 = call i32 (...) @render()
%2 = call i32 (...) @glutSwapBuffers()
%3 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @display() {
%1 = tail call i32 (...) @render()
%2 = tail call i32 (...) @glutSwapBuffers()
%3 = tail call i32 (...) @glutPostRedisplay()
ret void
}
void check_and_create_debugfs(void) {}


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

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

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

LLVM IR (-O2):
define void @check_and_create_debugfs() {
ret void
}
/* Variables and functions */
void populate_vector(int (*fun)(int), int (*function_vector[])(int)) {
  static int index = 0;
  function_vector[index++] = fun;
  function_vector[index] = NULL;
  return;
}


x86 assembly (clang, -O0):
<populate_vector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x2f0a(%rip),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,0x2eff(%rip)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq 0x2eed(%rip),%rcx
movq   $0x0,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<populate_vector>:
movslq 0x2f1d(%rip),%rax
lea    0x1(%rax),%rcx
mov    %ecx,0x2f13(%rip)
mov    %rdi,(%rsi,%rax,8)
movq   $0x0,0x8(%rsi,%rax,8)
ret

LLVM IR (-O0):
@populate_vector.index = internal global i32 0
define void @populate_vector(i32 (i32)* %0, i32 (i32)** %1) {
%3 = alloca i32 (i32)*
%4 = alloca i32 (i32)**
store i32 (i32)* %0, i32 (i32)** %3
store i32 (i32)** %1, i32 (i32)*** %4
%5 = load i32 (i32)*, i32 (i32)** %3
%6 = load i32 (i32)**, i32 (i32)*** %4
%7 = load i32, i32* @populate_vector.index
%8 = add nsw i32 %7, 1
store i32 %8, i32* @populate_vector.index
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i32 (i32)*, i32 (i32)** %6, i64 %9
store i32 (i32)* %5, i32 (i32)** %10
%11 = load i32 (i32)**, i32 (i32)*** %4
%12 = load i32, i32* @populate_vector.index
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32 (i32)*, i32 (i32)** %11, i64 %13
store i32 (i32)* null, i32 (i32)** %14
ret void
}

LLVM IR (-O2):
@populate_vector.index = internal unnamed_addr global i32 0
define void @populate_vector(i32 (i32)* %0, i32 (i32)** nocapture writeonly %1) {
%3 = load i32, i32* @populate_vector.index
%4 = add nsw i32 %3, 1
store i32 %4, i32* @populate_vector.index
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i32 (i32)*, i32 (i32)** %1, i64 %5
store i32 (i32)* %0, i32 (i32)** %6
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds i32 (i32)*, i32 (i32)** %1, i64 %7
store i32 (i32)* null, i32 (i32)** %8
ret void
}
/* Type definitions */
typedef unsigned long long u_int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long);
int main(int argc, char *argv[]) {
  u_int64_t mask = 1ULL;
  for (; mask < (1ULL << 54); mask <<= 1) {
    printf("%luULL\n", mask);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movabs $0x40000000000000,%rax
cmp    %rax,-0x18(%rbp)
jae    1163 <main+0x53>
mov    -0x18(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112e <main+0x1e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    (%rbx,%rbx,1),%rax
shr    $0x35,%rbx
mov    %rax,%rbx
je     1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%luULL\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 1, i64* %6
br label %7
7: ; preds = %13, %2
%8 = load i64, i64* %6
%9 = icmp ult i64 %8, 18014398509481984
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i64, i64* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %11)
br label %13
13: ; preds = %10
%14 = load i64, i64* %6
%15 = shl i64 %14, 1
store i64 %15, i64* %6
br label %7
16: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%luULL\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 1, %2 ], [ %6, %3 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = shl nuw nsw i64 %4, 1
%7 = icmp ult i64 %4, 9007199254740992
br i1 %7, label %3, label %8
8: ; preds = %3
ret i32 0
}
int tempConverter(int fahrenheit) { return (5.0 / 9.0) * (fahrenheit - 32.0); }


x86 assembly (clang, -O0):
<tempConverter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xef4(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xee0(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tempConverter>:
cvtsi2sd %edi,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @tempConverter(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fsub double %4, 3.200000e+01
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptosi double %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @tempConverter(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Variables and functions */
size_t strlen(char const *);
int /*<<< orphan*/ strncmp(char const *, char const *, size_t const);
int longCommandWArg(const char **stringPtr, const char *longCommand) {
  size_t const comSize = strlen(longCommand);
  int const result = !strncmp(*stringPtr, longCommand, comSize);
  if (result)
    *stringPtr += comSize;
  return result;
}


x86 assembly (clang, -O0):
<longCommandWArg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1179 <longCommandWArg+0x59>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<longCommandWArg>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %rax,%r15
mov    (%r14),%r12
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1154 <longCommandWArg+0x34>
add    %r15,%r12
mov    %r12,(%r14)
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @longCommandWArg(i8** nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = load i8*, i8** %0
%5 = tail call i32 @strncmp(i8* %4, i8* %1, i64 %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %4, i64 %3
store i8* %8, i8** %0
br label %9
9: ; preds = %7, %2
%10 = zext i1 %6 to i32
ret i32 %10
}
void iswap32(void *p) {
  char *cp = (char *)p;
  char tmp;
  tmp = cp[0];
  cp[0] = cp[3];
  cp[3] = tmp;
  tmp = cp[1];
  cp[1] = cp[2];
  cp[2] = tmp;
}


x86 assembly (clang, -O0):
<iswap32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswap32>:
mov    (%rdi),%al
mov    0x3(%rdi),%cl
mov    %cl,(%rdi)
mov    %al,0x3(%rdi)
rolw   $0x8,0x1(%rdi)
ret

LLVM IR (-O0):
define void @iswap32(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
store i8 %8, i8* %4
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 3
%11 = load i8, i8* %10
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i8, i8* %4
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 3
store i8 %14, i8* %16
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
store i8 %19, i8* %4
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
%22 = load i8, i8* %21
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 1
store i8 %22, i8* %24
%25 = load i8, i8* %4
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 2
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @iswap32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %6, i8* %7
ret void
}
/* Variables and functions */
int RAND_MAX;
int rand();
int generateLimitedRandomNumber(int limit) {
  int divisor = RAND_MAX / (limit + 1);
  int number = 0;
  do {
    number = rand() / divisor;
  } while (number > limit);
  return number;
}


x86 assembly (clang, -O0):
<generateLimitedRandomNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1137 <generateLimitedRandomNumber+0x27>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateLimitedRandomNumber>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ecc(%rip),%rax
mov    (%rax),%eax
lea    0x1(%rbx),%ecx
cltd
idiv   %ecx
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebp
cmp    %ebx,%eax
jg     1130 <generateLimitedRandomNumber+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @generateLimitedRandomNumber(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* @RAND_MAX
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = sdiv i32 %5, %7
store i32 %8, i32* %3
store i32 0, i32* %4
br label %9
9: ; preds = %13, %1
%10 = call i32 (...) @rand()
%11 = load i32, i32* %3
%12 = sdiv i32 %10, %11
store i32 %12, i32* %4
br label %13
13: ; preds = %9
%14 = load i32, i32* %4
%15 = load i32, i32* %2
%16 = icmp sgt i32 %14, %15
br i1 %16, label %9, label %17
17: ; preds = %13
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @generateLimitedRandomNumber(i32 %0) {
%2 = load i32, i32* @RAND_MAX
%3 = add nsw i32 %0, 1
%4 = sdiv i32 %2, %3
br label %5
5: ; preds = %5, %1
%6 = tail call i32 (...) @rand()
%7 = sdiv i32 %6, %4
%8 = icmp sgt i32 %7, %0
br i1 %8, label %5, label %9
9: ; preds = %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ print_esp();
int main() { print_esp(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @print_esp()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print_esp()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char *);
void end_of_file() { fatal("Unexpected EOF", ""); }


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

x86 assembly (clang, -O2):
<end_of_file>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
jmp    1030 <fatal@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Unexpected EOF\00"
@.str.1 = [1 x i8] zeroinitializer
define void @end_of_file() {
%1 = call i32 @fatal(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Unexpected EOF\00"
@.str.1 = [1 x i8] zeroinitializer
define void @end_of_file() {
%1 = tail call i32 @fatal(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double test_inf(void) { return __builtin_inf(); }


x86 assembly (clang, -O0):
<test_inf>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_inf>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @test_inf() {
ret double 0x7FF0000000000000
}

LLVM IR (-O2):
define double @test_inf() {
ret double 0x7FF0000000000000
}
int((carrier_identification_dump))(struct ss7 *ss7, int messagetype,
                                   unsigned char *parm, int len) {
  return len;
}


x86 assembly (clang, -O0):
<carrier_identification_dump>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<carrier_identification_dump>:
mov    %ecx,%eax
ret

LLVM IR (-O0):
%struct.ss7 = type opaque
define i32 @carrier_identification_dump(%struct.ss7* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.ss7*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.ss7* %0, %struct.ss7** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
%struct.ss7 = type opaque
define i32 @carrier_identification_dump(%struct.ss7* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 returned %3) {
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ internal_urcu_lock();
int /*<<< orphan*/ internal_urcu_unlock();
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ urcu_add_reader(int /*<<< orphan*/);
void urcu_register_thread(void) {
  internal_urcu_lock();
  urcu_add_reader(pthread_self());
  internal_urcu_unlock();
}


x86 assembly (clang, -O0):
<urcu_register_thread>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <internal_urcu_lock@plt>
mov    $0x0,%al
call   1060 <pthread_self@plt>
mov    %eax,%edi
call   1050 <urcu_add_reader@plt>
mov    $0x0,%al
call   1040 <internal_urcu_unlock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<urcu_register_thread>:
push   %rax
xor    %eax,%eax
call   1030 <internal_urcu_lock@plt>
xor    %eax,%eax
call   1060 <pthread_self@plt>
mov    %eax,%edi
call   1050 <urcu_add_reader@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <internal_urcu_unlock@plt>

LLVM IR (-O0):
define void @urcu_register_thread() {
%1 = call i32 (...) @internal_urcu_lock()
%2 = call i32 (...) @pthread_self()
%3 = call i32 @urcu_add_reader(i32 %2)
%4 = call i32 (...) @internal_urcu_unlock()
ret void
}

LLVM IR (-O2):
define void @urcu_register_thread() {
%1 = tail call i32 (...) @internal_urcu_lock()
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @urcu_add_reader(i32 %2)
%4 = tail call i32 (...) @internal_urcu_unlock()
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ time;
};
struct TYPE_4__ {
  TYPE_1__ xmotion;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xmotion_time(void *_p) {
  return (unsigned long)((XEvent *)_p)->xmotion.time;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XEvent_xmotion_time(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ unix_error(char *);
int /*<<< orphan*/ wait(int *);
pid_t Wait(int *status) {
  pid_t pid;
  if ((pid = wait(status)) < 0)
    unix_error("Wait error");
  return pid;
}


x86 assembly (clang, -O0):
<Wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <wait@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    114d <Wait+0x2d>
lea    0xeb8(%rip),%rdi
call   1030 <unix_error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Wait>:
push   %rbx
call   1040 <wait@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Wait+0x18>
lea    0xecd(%rip),%rdi
call   1030 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Wait error\00"
define i32 @Wait(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @wait(i32* %4)
store i32 %5, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @unix_error(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str = [11 x i8] c"Wait error\00"
define i32 @Wait(i32* %0) {
%2 = tail call i32 @wait(i32* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @unix_error(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DAEMON;
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void start_log() { openlog("data_daemon", LOG_PID, LOG_DAEMON); }


x86 assembly (clang, -O0):
<start_log>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edx
lea    0xed3(%rip),%rdi
call   1030 <openlog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_log>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
lea    0xed7(%rip),%rdi
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"data_daemon\00"
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @start_log() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_DAEMON
%3 = call i32 @openlog(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"data_daemon\00"
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @start_log() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_DAEMON
%3 = tail call i32 @openlog(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ sched_setaffinity(int /*<<< orphan*/, int,
                                     int /*<<< orphan*/ *);
void nuse_set_affinity(void) {
  cpu_set_t cpuset;
  CPU_ZERO(&cpuset);
  CPU_SET(0, &cpuset);
  sched_setaffinity(getpid(), sizeof(cpu_set_t), &cpuset);
}


x86 assembly (clang, -O0):
<nuse_set_affinity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1050 <CPU_ZERO@plt>
xor    %edi,%edi
lea    -0x4(%rbp),%rsi
call   1060 <CPU_SET@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    $0x4,%esi
lea    -0x4(%rbp),%rdx
call   1040 <sched_setaffinity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nuse_set_affinity>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <CPU_ZERO@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1060 <CPU_SET@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
call   1040 <sched_setaffinity@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @nuse_set_affinity() {
%1 = alloca i32
%2 = call i32 @CPU_ZERO(i32* %1)
%3 = call i32 @CPU_SET(i32 0, i32* %1)
%4 = call i32 (...) @getpid()
%5 = call i32 @sched_setaffinity(i32 %4, i32 4, i32* %1)
ret void
}

LLVM IR (-O2):
define void @nuse_set_affinity() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @CPU_ZERO(i32* %1)
%4 = call i32 @CPU_SET(i32 0, i32* %1)
%5 = call i32 (...) @getpid()
%6 = call i32 @sched_setaffinity(i32 %5, i32 4, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int);
void mc_autoprint(int flag) { do_csi("?%di", flag ? 5 : 4); }


x86 assembly (clang, -O0):
<mc_autoprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x4,%esi
mov    $0x5,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
lea    0xecb(%rip),%rdi
call   1030 <do_csi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mc_autoprint>:
cmp    $0x1,%edi
mov    $0x5,%esi
sbb    $0x0,%esi
lea    0xede(%rip),%rdi
jmp    1030 <do_csi@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"?%di\00"
define void @mc_autoprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 5, i32 4
%7 = call i32 @do_csi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"?%di\00"
define void @mc_autoprint(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 4, i32 5
%4 = tail call i32 @do_csi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
float fma(float x, float y, float z) { return (x * y) + z; }


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

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

LLVM IR (-O0):
define float @fma(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* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @llvm.fmuladd.f32(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @fma(float %0, float %1, float %2) {
%4 = tail call float @llvm.fmuladd.f32(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ gsl_test_rel(double const, double const, double const,
                                char *, char const *, char const *);
void penalty2_checksol(const double x[], const double sumsq,
                       const double epsrel, const char *sname,
                       const char *pname) {
  const double sumsq_exact = 9.37629300735544219e-06;
  gsl_test_rel(sumsq, sumsq_exact, epsrel, "%s/%s sumsq", sname, pname);
}


x86 assembly (clang, -O0):
<penalty2_checksol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
movsd  0xeca(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
movsd  0xeab(%rip),%xmm1
lea    0xeac(%rip),%rdi
call   1030 <gsl_test_rel@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<penalty2_checksol>:
movaps %xmm1,%xmm2
lea    0xeee(%rip),%rdi
movsd  0xede(%rip),%xmm1
jmp    1030 <gsl_test_rel@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s/%s sumsq\00"
define void @penalty2_checksol(double* %0, double %1, double %2, i8* %3, i8* %4) {
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca double
store double* %0, double** %6
store double %1, double* %7
store double %2, double* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
store double 0x3EE3A9DBE5FC15CA, double* %11
%12 = load double, double* %7
%13 = load double, double* %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i32 @gsl_test_rel(double %12, double 0x3EE3A9DBE5FC15CA, double %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s/%s sumsq\00"
define void @penalty2_checksol(double* nocapture readnone %0, double %1, double %2, i8* %3, i8* %4) {
%6 = tail call i32 @gsl_test_rel(double %1, double 0x3EE3A9DBE5FC15CA, double %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}
int test_imm_3Auint16_mem(unsigned short *val) {
  return ((*val) & (0x3A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Auint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 58
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct rng_state {
  int dummy;
};
typedef double int32_t;

/* Variables and functions */
double rng_uniform(struct rng_state *);
double rng_under(struct rng_state *st, int32_t max) {
  return rng_uniform(st) * max;
}


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

x86 assembly (clang, -O2):
<rng_under>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <rng_uniform@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.rng_state = type { i32 }
define double @rng_under(%struct.rng_state* %0, double %1) {
%3 = alloca %struct.rng_state*
%4 = alloca double
store %struct.rng_state* %0, %struct.rng_state** %3
store double %1, double* %4
%5 = load %struct.rng_state*, %struct.rng_state** %3
%6 = call double @rng_uniform(%struct.rng_state* %5)
%7 = load double, double* %4
%8 = fmul double %6, %7
ret double %8
}

LLVM IR (-O2):
%struct.rng_state = type { i32 }
define double @rng_under(%struct.rng_state* %0, double %1) {
%3 = tail call double @rng_uniform(%struct.rng_state* %0)
%4 = fmul double %3, %1
ret double %4
}
/* Variables and functions */
int st103_get_tx_count(int);
int usb_lld_tx_data_len(int ep_num) { return st103_get_tx_count(ep_num); }


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

x86 assembly (clang, -O2):
<usb_lld_tx_data_len>:
jmp    1030 <st103_get_tx_count@plt>

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

LLVM IR (-O2):
define i32 @usb_lld_tx_data_len(i32 %0) {
%2 = tail call i32 @st103_get_tx_count(i32 %0)
ret i32 %2
}
void uDMAChannelEnable(unsigned long ulChannelNum) {
  ;
  (*((volatile unsigned long *)(0x400FF028))) = 1 << ulChannelNum;
}


x86 assembly (clang, -O0):
<uDMAChannelEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    $0x400ff028,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelEnable>:
mov    %rdi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,0x400ff028
40
ret

LLVM IR (-O0):
define void @uDMAChannelEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 1, %4
%6 = sext i32 %5 to i64
store volatile i64 %6, i64* inttoptr (i64 1074786344 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannelEnable(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl nuw i32 1, %2
%4 = sext i32 %3 to i64
store volatile i64 %4, i64* inttoptr (i64 1074786344 to i64*)
ret void
}
/* Variables and functions */
int rom_present(char *);
int s3_bahamas64_available(void) {
  return rom_present(L"roms/video/s3/bahamas64.bin");
}


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

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

LLVM IR (-O0):
@.str = [28 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 115, i32 51, i32 47, i32 98, i32 97, i32 104, i32 97, i32 109, i32 97, i32 115, i32 54, i32 52, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @s3_bahamas64_available() {
%1 = call i32 @rom_present(i8* bitcast ([28 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [28 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 115, i32 51, i32 47, i32 98, i32 97, i32 104, i32 97, i32 109, i32 97, i32 115, i32 54, i32 52, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @s3_bahamas64_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([28 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int main() {
  char c = 'a';
  int i = -1;
  long l;
  l = (c = i);
  printf("%ld\n", l);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0x5(%rbp)
movsbq %al,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 -1)
ret i32 0
}
signed long long int signedlonglongint_ignoring_longint(signed long long int x,
                                                        long int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @signedlonglongint_ignoring_longint(i64 returned %0, i64 %1) {
ret i64 %0
}
unsigned int minimum(unsigned int n) {
  if (n == 0) {
    return 0;
  } else {
    return n - 1;
  }
}


x86 assembly (clang, -O0):
<minimum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <minimum+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1126 <minimum+0x26>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimum>:
xor    %eax,%eax
sub    $0x1,%edi
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @minimum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub i32 %8, 1
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @minimum(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = add i32 %0, -1
%4 = select i1 %2, i32 0, i32 %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ box_unsigned_8(int /*<<< orphan*/);
int /*<<< orphan*/ current_millis();
void primitive_millis_impl(void) { box_unsigned_8(current_millis()); }


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

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

LLVM IR (-O0):
define void @primitive_millis_impl() {
%1 = call i32 (...) @current_millis()
%2 = call i32 @box_unsigned_8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @primitive_millis_impl() {
%1 = tail call i32 (...) @current_millis()
%2 = tail call i32 @box_unsigned_8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wm_debug(char *);
void grow_down() { wm_debug("Growing down."); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Growing down.\00"
define void @grow_down() {
%1 = call i32 @wm_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Growing down.\00"
define void @grow_down() {
%1 = tail call i32 @wm_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ operand(int, int);
memory() { operand(1, (0x08 | 0x10)); }


x86 assembly (clang, -O0):
<memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x18,%esi
call   1030 <operand@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory>:
mov    $0x1,%edi
mov    $0x18,%esi
jmp    1030 <operand@plt>

LLVM IR (-O0):
define i32 @memory() {
%1 = alloca i32
%2 = call i32 @operand(i32 1, i32 24)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @memory() {
%1 = tail call i32 @operand(i32 1, i32 24)
ret i32 undef
}
/* Variables and functions */
double log(double);
double E_to_zs(double E, long entries) {
  double e, z;
  int error;
  e = E / (double)entries;
  z = (log(e) + 0.57721566490153286060) / (-1.28254983016186409554);
  return z * 10.0 + 50.0;
}


x86 assembly (clang, -O0):
<E_to_zs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <log@plt>
movsd  0xed1(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe97(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe93(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<E_to_zs>:
push   %rax
cvtsi2sd %rdi,%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
addsd  0xed9(%rip),%xmm0
divsd  0xed9(%rip),%xmm0
mulsd  0xed9(%rip),%xmm0
addsd  0xed9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @E_to_zs(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
%5 = alloca double
%6 = alloca double
%7 = alloca i32
store double %0, double* %3
store i64 %1, i64* %4
%8 = load double, double* %3
%9 = load i64, i64* %4
%10 = sitofp i64 %9 to double
%11 = fdiv double %8, %10
store double %11, double* %5
%12 = load double, double* %5
%13 = call double @log(double %12)
%14 = fadd double %13, 0x3FE2788CFC6FB619
%15 = fdiv double %14, 0xBFF48552F88091A8
store double %15, double* %6
%16 = load double, double* %6
%17 = call double @llvm.fmuladd.f64(double %16, double 1.000000e+01, double 5.000000e+01)
ret double %17
}

LLVM IR (-O2):
define double @E_to_zs(double %0, i64 %1) {
%3 = sitofp i64 %1 to double
%4 = fdiv double %0, %3
%5 = tail call double @log(double %4)
%6 = fadd double %5, 0x3FE2788CFC6FB619
%7 = fdiv double %6, 0xBFF48552F88091A8
%8 = tail call double @llvm.fmuladd.f64(double %7, double 1.000000e+01, double 5.000000e+01)
ret double %8
}
char *getcurrentdirectory(char *currentdirectory, int buffersize) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @getcurrentdirectory(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int mq_unlink(const char *name) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<mq_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mq_unlink>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @mq_unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @mq_unlink(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
int f(int a, float b) {}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i32 %0, float %1) {
ret i32 undef
}