xunge/DecIR huggingface dataset:
void WDTimerPrescalerSet(unsigned long ulDivide) {

  ;
  (*((volatile unsigned long *)(0x40002C04))) &= ~0x00000180;
  (*((volatile unsigned long *)(0x40002C04))) |= ulDivide;
}


x86 assembly (clang, -O0):
<WDTimerPrescalerSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x40002c04,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffe7f,%rcx
mov    $0x40002c04,%eax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    $0x40002c04,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x40002c04,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WDTimerPrescalerSet>:
andq   $0xfffffffffffffe7f,0x40002c04
40 7f fe ff ff
or     %rdi,0x40002c04
40
ret

LLVM IR (-O0):
define void @WDTimerPrescalerSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1073753092 to i64*)
%4 = and i64 %3, -385
store volatile i64 %4, i64* inttoptr (i64 1073753092 to i64*)
%5 = load i64, i64* %2
%6 = load volatile i64, i64* inttoptr (i64 1073753092 to i64*)
%7 = or i64 %6, %5
store volatile i64 %7, i64* inttoptr (i64 1073753092 to i64*)
ret void
}

LLVM IR (-O2):
define void @WDTimerPrescalerSet(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1073753092 to i64*)
%3 = and i64 %2, -385
store volatile i64 %3, i64* inttoptr (i64 1073753092 to i64*)
%4 = load volatile i64, i64* inttoptr (i64 1073753092 to i64*)
%5 = or i64 %4, %0
store volatile i64 %5, i64* inttoptr (i64 1073753092 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int main() {
  printf("rand = %d\n", rand());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"rand = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
void *malloc(unsigned int);
void *xalloc2(unsigned n) { return malloc(n); }


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

x86 assembly (clang, -O2):
<xalloc2>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @xalloc2(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int fb_DevPrinterGetOffset(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int fb_LPos(int printer_index) {
  int cur;
  char buffer[32];
  ;
  sprintf(buffer, "LPT%d:", (printer_index + 1));
  cur = fb_DevPrinterGetOffset(buffer);
  ;
  return cur;
}


x86 assembly (clang, -O0):
<fb_LPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%edx
add    $0x1,%edx
lea    0xec4(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <fb_DevPrinterGetOffset@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_LPos>:
push   %rbx
sub    $0x20,%rsp
lea    0x1(%rdi),%edx
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <fb_DevPrinterGetOffset@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"LPT%d:\00"
define i32 @fb_LPos(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [32 x i8]
store i32 %0, i32* %2
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%10 = call i32 @fb_DevPrinterGetOffset(i8* %9)
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [7 x i8] c"LPT%d:\00"
define i32 @fb_LPos(i32 %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = add nsw i32 %0, 1
%5 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @fb_DevPrinterGetOffset(i8* %3)
ret i32 %6
}
int even_ones(unsigned x) {
  x ^= x >> 16;
  x ^= x >> 8;
  x ^= x >> 4;
  x ^= x >> 2;
  x ^= x >> 1;
  return (x & 1) == 0;
}


x86 assembly (clang, -O0):
<even_ones>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<even_ones>:
mov    %edi,%eax
shr    $0x10,%eax
xor    %edi,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
xor    %ecx,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    %eax
xor    %ecx,%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @even_ones(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = lshr i32 %7, 8
%9 = load i32, i32* %2
%10 = xor i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = lshr i32 %11, 4
%13 = load i32, i32* %2
%14 = xor i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 2
%17 = load i32, i32* %2
%18 = xor i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = lshr i32 %19, 1
%21 = load i32, i32* %2
%22 = xor i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = and i32 %23, 1
%25 = icmp eq i32 %24, 0
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @even_ones(i32 %0) {
%2 = lshr i32 %0, 16
%3 = xor i32 %2, %0
%4 = lshr i32 %3, 8
%5 = xor i32 %4, %3
%6 = lshr i32 %5, 4
%7 = xor i32 %6, %5
%8 = lshr i32 %7, 2
%9 = xor i32 %8, %7
%10 = lshr i32 %9, 1
%11 = xor i32 %10, %9
%12 = and i32 %11, 1
%13 = xor i32 %12, 1
ret i32 %13
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int htonl(int);
uint64_t htonll(uint64_t n) {
  return htonl(1) == 1 ? n : ((uint64_t)htonl(n) << 32) | htonl(n >> 32);
}


x86 assembly (clang, -O0):
<htonll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <htonl@plt>
cmp    $0x1,%eax
jne    1139 <htonll+0x29>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1164 <htonll+0x54>
mov    -0x4(%rbp),%edi
call   1030 <htonl@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <htonl@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htonll>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <htonl@plt>
cmp    $0x1,%eax
je     112e <htonll+0x1e>
mov    %ebx,%edi
call   1030 <htonl@plt>
call   1030 <htonl@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @htonll(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @htonl(i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @htonl(i32 %8)
%10 = shl i32 %9, 32
%11 = load i32, i32* %2
%12 = ashr i32 %11, 32
%13 = call i32 @htonl(i32 %12)
%14 = or i32 %10, %13
br label %15
15: ; preds = %7, %5
%16 = phi i32 [ %6, %5 ], [ %14, %7 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @htonll(i32 returned %0) {
%2 = tail call i32 @htonl(i32 1)
%3 = icmp eq i32 %2, 1
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @htonl(i32 %0)
%6 = tail call i32 @htonl(i32 poison)
br label %7
7: ; preds = %1, %4
ret i32 %0
}
int main() {
  int x = 0, y = 0;
  while (1) {
    if (x <= 50) {
      y++;
    } else {
      y--;
    }
    if (y < 0) {
      break;
    }
    x++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0x8(%rbp)
jg     1131 <main+0x31>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <main+0x3a>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1149 <main+0x49>
jmp    1157 <main+0x57>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %edx,%edx
cmp    $0x33,%eax
setb   %dl
lea    (%rcx,%rdx,2),%ecx
add    $0x1,%eax
add    $0xffffffff,%ecx
jns    1110 <main+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %8, %1 ]
%3 = phi i32 [ 0, %0 ], [ %6, %1 ]
%4 = icmp ult i32 %2, 51
%5 = select i1 %4, i32 1, i32 -1
%6 = add nsw i32 %5, %3
%7 = icmp slt i32 %6, 0
%8 = add nuw nsw i32 %2, 1
br i1 %7, label %9, label %1
9: ; preds = %1
ret i32 0
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRD0_set(void) { return U_WMRCORENONE_set("U_WMRD0"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRD0\00"
define i8* @U_WMRD0_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRD0\00"
define i8* @U_WMRD0_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
struct cmd_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int cpu_list(int argc, const char *argv[], const struct cmd_info *info) {
  fprintf(stderr, "Operation not supported by library.\n");
  return -1;
}


x86 assembly (clang, -O0):
<cpu_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_list>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.cmd_info = type { i32 }
@stderr = global i32 0
@.str = [37 x i8] c"Operation not supported by library.\0A\00"
define i32 @cpu_list(i32 %0, i8** %1, %struct.cmd_info* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.cmd_info*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.cmd_info* %2, %struct.cmd_info** %6
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
%struct.cmd_info = type { i32 }
@stderr = global i32 0
@.str = [37 x i8] c"Operation not supported by library.\0A\00"
define i32 @cpu_list(i32 %0, i8** nocapture readnone %1, %struct.cmd_info* nocapture readnone %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
int f_bge_rc1(float a1) { return (__builtin_isgreaterequal(a1, 100)); }


x86 assembly (clang, -O0):
<f_bge_rc1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bge_rc1>:
xor    %eax,%eax
ucomiss 0xef7(%rip),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @f_bge_rc1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 1.000000e+02
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f_bge_rc1(float %0) {
%2 = fcmp oge float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_dblVector(double *v, long nLow) { free((char *)(v + nLow - 1)); }


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

x86 assembly (clang, -O2):
<free_dblVector>:
lea    (%rdi,%rsi,8),%rdi
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_dblVector(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
store double* %0, double** %3
store i64 %1, i64* %4
%5 = load double*, double** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds double, double* %5, i64 %6
%8 = getelementptr inbounds double, double* %7, i64 -1
%9 = bitcast double* %8 to i8*
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @free_dblVector(double* nocapture %0, i64 %1) {
%3 = getelementptr inbounds double, double* %0, i64 %1
%4 = getelementptr inbounds double, double* %3, i64 -1
%5 = bitcast double* %4 to i8*
%6 = tail call i32 @free(i8* %5)
ret void
}
struct s29 {
  struct {
  } a[1];
  char b;
  char c;
} f29(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<f29>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f29+0x9>
jmp    1109 <f29+0x9>

x86 assembly (clang, -O2):
<f29>:
jmp    1100 <f29>

LLVM IR (-O0):
define i16 @f29() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define i16 @f29() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
scalar_t__ random(int);
int dice(int count, int faces) {
  int sum;
  while (count) {
    sum += random(faces) + 1;
    count--;
  }
  return sum;
}


x86 assembly (clang, -O0):
<dice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114f <dice+0x3f>
mov    -0x8(%rbp),%edi
call   1030 <random@plt>
mov    %rax,%rcx
add    $0x1,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111e <dice+0xe>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dice>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
je     1134 <dice+0x24>
mov    %esi,%r14d
mov    %edi,%ebp
nopl   (%rax)
mov    %r14d,%edi
call   1030 <random@plt>
add    %eax,%ebx
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    1120 <dice+0x10>
jmp    1134 <dice+0x24>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @dice(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ undef, %2 ]
%6 = phi i32 [ %11, %4 ], [ %0, %2 ]
%7 = tail call i64 @random(i32 %1)
%8 = trunc i64 %7 to i32
%9 = add i32 %5, 1
%10 = add i32 %9, %8
%11 = add nsw i32 %6, -1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ undef, %2 ], [ %10, %4 ]
ret i32 %14
}
int mscb_semaphore_create(const char *device) {}


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

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

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

LLVM IR (-O2):
define i32 @mscb_semaphore_create(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int get_measurements(float *, float *, float *);
int /*<<< orphan*/ printf(char *, float, float, float);
int /*<<< orphan*/ setup_rpi_gpio();
int /*<<< orphan*/ sleep(int);
int main() {
  float temperature_C, relative_humidity, dew_point_C;
  int status;
  setup_rpi_gpio();
  while (1) {
    status = get_measurements(&temperature_C, &relative_humidity, &dew_point_C);
    printf("Temp: %.3f C, RH: %.3f, DP: %.3f C\n", temperature_C,
           relative_humidity, dew_point_C);
    sleep(600);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <setup_rpi_gpio@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <get_measurements@plt>
mov    %eax,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
mov    $0x258,%edi
call   1060 <sleep@plt>
jmp    1156 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %eax,%eax
call   1050 <setup_rpi_gpio@plt>
lea    0x14(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r12
lea    0xe98(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <get_measurements@plt>
movss  0x14(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0x258,%edi
call   1060 <sleep@plt>
jmp    1170 <main+0x30>

LLVM IR (-O0):
@.str = [36 x i8] c"Temp: %.3f C, RH: %.3f, DP: %.3f C\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (...) @setup_rpi_gpio()
br label %7
7: ; preds = %0, %7
%8 = call i32 @get_measurements(float* %2, float* %3, float* %4)
store i32 %8, i32* %5
%9 = load float, float* %2
%10 = load float, float* %3
%11 = load float, float* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), float %9, float %10, float %11)
%13 = call i32 @sleep(i32 600)
br label %7
}

LLVM IR (-O2):
@.str = [36 x i8] c"Temp: %.3f C, RH: %.3f, DP: %.3f C\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 (...) @setup_rpi_gpio()
br label %8
8: ; preds = %8, %0
%9 = call i32 @get_measurements(float* %1, float* %2, float* %3)
%10 = load float, float* %1
%11 = load float, float* %2
%12 = load float, float* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), float %10, float %11, float %12)
%14 = call i32 @sleep(i32 600)
br label %8
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, int /*<<< orphan*/, int);
void strncpy_null_src(char *x) { strncpy(x, 0, 5); }


x86 assembly (clang, -O0):
<strncpy_null_src>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_null_src>:
xor    %esi,%esi
mov    $0x5,%edx
jmp    1030 <strncpy@plt>

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

LLVM IR (-O2):
define void @strncpy_null_src(i8* %0) {
%2 = tail call i32 @strncpy(i8* %0, i32 0, i32 5)
ret void
}
/* Type definitions */
typedef void uint8_t;
typedef int uint32_t;

/* Variables and functions */
void *OffsetToPointer(void *base, uint32_t offset) {
  if (!offset)
    return NULL;
  return ((uint8_t *)base) + offset;
}


x86 assembly (clang, -O0):
<OffsetToPointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1122 <OffsetToPointer+0x22>
movq   $0x0,-0x8(%rbp)
jmp    1131 <OffsetToPointer+0x31>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<OffsetToPointer>:
movslq %esi,%rcx
lea    (%rdi,%rcx,1),%rdx
xor    %eax,%eax
test   %ecx,%ecx
cmovne %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @OffsetToPointer(i8* readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = sext i32 %1 to i64
%5 = getelementptr i8, i8* %0, i64 %4
%6 = select i1 %3, i8* null, i8* %5
ret i8* %6
}
__attribute__((no, noclone)) int f2(int x, int (*p1)(void), int (*p2)(void)) {
  if (x)
    return p2();
  else
    return p1();
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1128 <f2+0x28>
call   *-0x18(%rbp)
mov    %eax,-0x4(%rbp)
jmp    112e <f2+0x2e>
call   *-0x10(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
test   %edi,%edi
cmovne %rdx,%rsi
jmp    *%rsi

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

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 ()* nocapture %1, i32 ()* nocapture %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 ()* %1, i32 ()* %2
%6 = tail call i32 %5()
ret i32 %6
}
void X509_STORE_free(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_STORE_free() {
ret void
}
int main() {
  int i;
  while (1) {
    (*(volatile unsigned int *)0x7FFCu = (0b00010000000011110000000000000000));
    asm("nop");
    asm("nop");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x7ffc,%eax
movl   $0x100f0000,(%rax)
nop
nop
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
movl   $0x100f0000,0x7ffc
nop
nop
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
store volatile i32 269418496, i32* inttoptr (i64 32764 to i32*)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
store volatile i32 269418496, i32* inttoptr (i64 32764 to i32*)
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
wchar_t utolower(wchar_t c) {
  if (c == L'\0')
    return c;
  if (c >= 'A' && c <= 'Z')
    c += 'a' - 'A';
  return c;
}


x86 assembly (clang, -O0):
<utolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111c <utolower+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113f <utolower+0x3f>
cmpl   $0x41,-0x8(%rbp)
jl     1139 <utolower+0x39>
cmpl   $0x5a,-0x8(%rbp)
jg     1139 <utolower+0x39>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @utolower(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 %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %19
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 90
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 32
store i32 %16, i32* %3
br label %17
17: ; preds = %14, %11, %8
%18 = load i32, i32* %3
store i32 %18, i32* %2
br label %19
19: ; preds = %17, %6
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @utolower(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = add i32 %0, -65
%4 = icmp ult i32 %3, 26
%5 = add nsw i32 %0, 32
%6 = select i1 %4, i32 %5, i32 %0
%7 = select i1 %2, i32 0, i32 %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ ldexp(double, int);
int /*<<< orphan*/ link_failure_ldexp();
void test_ldexp(double d, int x) {
  if (ldexp(d, x) != ldexp(d, x))
    link_failure_ldexp();
}


x86 assembly (clang, -O0):
<test_ldexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <ldexp@plt>
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <ldexp@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1165 <test_ldexp+0x45>
mov    $0x0,%al
call   1040 <link_failure_ldexp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ldexp>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movsd  %xmm0,(%rsp)
call   1030 <ldexp@plt>
mov    %rax,%r14
movsd  (%rsp),%xmm0
mov    %ebx,%edi
call   1030 <ldexp@plt>
cmp    %rax,%r14
jne    114c <test_ldexp+0x2c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <link_failure_ldexp@plt>

LLVM IR (-O0):
define void @test_ldexp(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load i32, i32* %4
%7 = call i64 @ldexp(double %5, i32 %6)
%8 = load double, double* %3
%9 = load i32, i32* %4
%10 = call i64 @ldexp(double %8, i32 %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_ldexp()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_ldexp(double %0, i32 %1) {
%3 = tail call i64 @ldexp(double %0, i32 %1)
%4 = tail call i64 @ldexp(double %0, i32 %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_ldexp()
br label %8
8: ; preds = %6, %2
ret void
}
void exception_handler(unsigned number) {}


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

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

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

LLVM IR (-O2):
define void @exception_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_format_info_from_sample_spec2() {
  printf("NOT IMPLEMENTED:"
         "pa_format_info_from_sample_spec2"
         "\n");
}


x86 assembly (clang, -O0):
<pa_format_info_from_sample_spec2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [50 x i8] c"NOT IMPLEMENTED:pa_format_info_from_sample_spec2\0A\00"
define i32 @pa_format_info_from_sample_spec2() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [49 x i8] c"NOT IMPLEMENTED:pa_format_info_from_sample_spec2\00"
define i32 @pa_format_info_from_sample_spec2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
char *getAuthor();
char *getPageNum();
char *getPub();
char *getPubYear();
char *getTitle();
char *getVolume();
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *, char *,
                          char *);
void articleCitation() {
  printf("%s. \"%s\". %s %s (%s): %s.\n", getAuthor(), getTitle(), getPub(),
         getVolume(), getPubYear(), getPageNum());
}


x86 assembly (clang, -O0):
<articleCitation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1060 <getAuthor@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1050 <getTitle@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <getPub@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1090 <getVolume@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1070 <getPubYear@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1080 <getPageNum@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x8(%rbp),%r9
lea    0xe2f(%rip),%rdi
mov    %rax,(%rsp)
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<articleCitation>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1060 <getAuthor@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1050 <getTitle@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1030 <getPub@plt>
mov    %rax,%r12
xor    %eax,%eax
call   1090 <getVolume@plt>
mov    %rax,%r13
xor    %eax,%eax
call   1070 <getPubYear@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1080 <getPageNum@plt>
mov    %rax,(%rsp)
lea    0xe3f(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %r13,%r8
mov    %rbx,%r9
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [27 x i8] c"%s. \22%s\22. %s %s (%s): %s.\0A\00"
define void @articleCitation() {
%1 = call i8* (...) @getAuthor()
%2 = call i8* (...) @getTitle()
%3 = call i8* (...) @getPub()
%4 = call i8* (...) @getVolume()
%5 = call i8* (...) @getPubYear()
%6 = call i8* (...) @getPageNum()
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s. \22%s\22. %s %s (%s): %s.\0A\00"
define void @articleCitation() {
%1 = tail call i8* (...) @getAuthor()
%2 = tail call i8* (...) @getTitle()
%3 = tail call i8* (...) @getPub()
%4 = tail call i8* (...) @getVolume()
%5 = tail call i8* (...) @getPubYear()
%6 = tail call i8* (...) @getPageNum()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6)
ret void
}
/* Variables and functions */
double tan(double);
double min_caml_tan(void *fv, double f) { return tan(f); }


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

x86 assembly (clang, -O2):
<min_caml_tan>:
jmp    1030 <tan@plt>

LLVM IR (-O0):
define double @min_caml_tan(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = call double @tan(double %5)
ret double %6
}

LLVM IR (-O2):
define double @min_caml_tan(i8* nocapture readnone %0, double %1) {
%3 = tail call double @tan(double %1)
ret double %3
}
/* Variables and functions */
void fb_PrintBufferEx(char const *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strlen(char const *);
void fb_PrintBuffer(const char *buffer, int mask) {
  return fb_PrintBufferEx(buffer, strlen(buffer), mask);
}


x86 assembly (clang, -O0):
<fb_PrintBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
call   1040 <fb_PrintBufferEx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_PrintBuffer>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fb_PrintBufferEx@plt>

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

LLVM IR (-O2):
define void @fb_PrintBuffer(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
tail call void @fb_PrintBufferEx(i8* %0, i32 %3, i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ __builtin_gammal(long double);
int /*<<< orphan*/ link_failure_builtin_gammal();
void test_builtin_gammal(long double ld) {
  if (__builtin_gammal(ld) != __builtin_gammal(ld))
    link_failure_builtin_gammal();
}


x86 assembly (clang, -O0):
<test_builtin_gammal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <__builtin_gammal@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <__builtin_gammal@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_builtin_gammal+0x43>
mov    $0x0,%al
call   1030 <link_failure_builtin_gammal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_gammal>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1040 <__builtin_gammal@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1040 <__builtin_gammal@plt>
cmp    %rax,%rbx
jne    1151 <test_builtin_gammal+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1030 <link_failure_builtin_gammal@plt>

LLVM IR (-O0):
define void @test_builtin_gammal(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @__builtin_gammal(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @__builtin_gammal(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_builtin_gammal()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_gammal(x86_fp80 %0) {
%2 = tail call i64 @__builtin_gammal(x86_fp80 %0)
%3 = tail call i64 @__builtin_gammal(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_gammal()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
size_t backtrace(void **, int);
int /*<<< orphan*/ backtrace_symbols_fd(void **, size_t, int);
int main(void) {
  void *backtrace_fns[10];
  size_t entries;
  entries = backtrace(backtrace_fns, 10);
  backtrace_symbols_fd(backtrace_fns, entries, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0xa,%esi
call   1040 <backtrace@plt>
mov    %rax,-0x68(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    $0x1,%edx
call   1030 <backtrace_symbols_fd@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <backtrace@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x1,%edx
call   1030 <backtrace_symbols_fd@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8*]
%3 = alloca i64
store i32 0, i32* %1
%4 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%5 = call i64 @backtrace(i8** %4, i32 10)
store i64 %5, i64* %3
%6 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%7 = load i64, i64* %3
%8 = call i32 @backtrace_symbols_fd(i8** %6, i64 %7, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i8*]
%2 = bitcast [10 x i8*]* %1 to i8*
%3 = getelementptr inbounds [10 x i8*], [10 x i8*]* %1, i64 0, i64 0
%4 = call i64 @backtrace(i8** %3, i32 10)
%5 = call i32 @backtrace_symbols_fd(i8** %3, i64 %4, i32 1)
ret i32 0
}
extern void pinio_disable_flippers(void) {}


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

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

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

LLVM IR (-O2):
define void @pinio_disable_flippers() {
ret void
}
int linear(int *a, int end, int val) {
  if (a[end] == val)
    return end;
  else if (end == -1)
    return end;
  else
    linear(a, end - 1, val);
}


x86 assembly (clang, -O0):
<linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1141 <linear+0x31>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <linear+0x5d>
cmpl   $0xffffffff,-0x14(%rbp)
jne    1156 <linear+0x46>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <linear+0x5d>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
mov    -0x18(%rbp),%edx
call   1030 <linear@plt>
jmp    116d <linear+0x5d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @linear(i32* nocapture %0, i32 returned %1, i32 %2) {
ret i32 %1
}
/* Variables and functions */
float __nv_ldexpf(float, int);
float ldexpf(float __a, int __b) { return __nv_ldexpf(__a, __b); }


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

x86 assembly (clang, -O2):
<ldexpf>:
jmp    1030 <__nv_ldexpf@plt>

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

LLVM IR (-O2):
define float @ldexpf(float %0, i32 %1) {
%3 = tail call float @__nv_ldexpf(float %0, i32 %1)
ret float %3
}
/* Type definitions */
struct nlattr {
  int /*<<< orphan*/ nla_len;
};

/* Variables and functions */
int NLA_ALIGN(int /*<<< orphan*/);
struct nlattr *nla_next(const struct nlattr *nla, int *remaining) {
  int totlen = NLA_ALIGN(nla->nla_len);
  *remaining -= totlen;
  return (struct nlattr *)((char *)nla + totlen);
}


x86 assembly (clang, -O0):
<nla_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <NLA_ALIGN@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_next>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <NLA_ALIGN@plt>
sub    %eax,(%r14)
cltq
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.nlattr = type { i32 }
define %struct.nlattr* @nla_next(%struct.nlattr* %0, i32* %1) {
%3 = alloca %struct.nlattr*
%4 = alloca i32*
%5 = alloca i32
store %struct.nlattr* %0, %struct.nlattr** %3
store i32* %1, i32** %4
%6 = load %struct.nlattr*, %struct.nlattr** %3
%7 = getelementptr inbounds %struct.nlattr, %struct.nlattr* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @NLA_ALIGN(i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = sub nsw i32 %12, %10
store i32 %13, i32* %11
%14 = load %struct.nlattr*, %struct.nlattr** %3
%15 = bitcast %struct.nlattr* %14 to i8*
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = bitcast i8* %18 to %struct.nlattr*
ret %struct.nlattr* %19
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
define %struct.nlattr* @nla_next(%struct.nlattr* %0, i32* nocapture %1) {
%3 = getelementptr inbounds %struct.nlattr, %struct.nlattr* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i32 @NLA_ALIGN(i32 %4)
%6 = load i32, i32* %1
%7 = sub nsw i32 %6, %5
store i32 %7, i32* %1
%8 = bitcast %struct.nlattr* %0 to i8*
%9 = sext i32 %5 to i64
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = bitcast i8* %10 to %struct.nlattr*
ret %struct.nlattr* %11
}
/* Variables and functions */
int on_ac(void) {}


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

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

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

LLVM IR (-O2):
define i32 @on_ac() {
ret i32 undef
}
int node_time_reached(unsigned long slot_time, unsigned long current_time,
                      unsigned long prev_time) {
  if (current_time < slot_time)
    return 0;
  if (prev_time < current_time && prev_time >= slot_time)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<node_time_reached>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    112a <node_time_reached+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1159 <node_time_reached+0x59>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1152 <node_time_reached+0x52>
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1152 <node_time_reached+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1159 <node_time_reached+0x59>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<node_time_reached>:
cmp    %rdi,%rsi
setae  %al
cmp    %rsi,%rdx
setae  %cl
cmp    %rdi,%rdx
setb   %dl
or     %cl,%dl
and    %al,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
define i32 @node_time_reached(i64 %0, i64 %1, i64 %2) {
%4 = icmp uge i64 %1, %0
%5 = icmp uge i64 %2, %1
%6 = icmp ult i64 %2, %0
%7 = or i1 %5, %6
%8 = and i1 %4, %7
%9 = zext i1 %8 to i32
ret i32 %9
}