xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x6b() {
  Assert_real((isbdigit(107) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              540, ("isbdigit should be 0 for k"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x6b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6b,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x21c,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x6b>:
push   %rax
mov    $0x6b,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x21c,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for k\00"
define void @t_isbdigit_0x6b() {
%1 = call i64 @isbdigit(i32 107)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 540, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for k\00"
define void @t_isbdigit_0x6b() {
%1 = tail call i64 @isbdigit(i32 107)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 540, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ GBA_CPUGetHalted();
int /*<<< orphan*/ GBA_RunFor(int);
void GBA_DebugStep(void) {
  int clockstostop = 1000000;
  do {
    while (!GBA_RunFor(1))
      if (clockstostop-- <= 0)
        return;
  } while ((GBA_CPUGetHalted()));
}


x86 assembly (clang, -O0):
<GBA_DebugStep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xf4240,-0x4(%rbp)
jmp    1134 <GBA_DebugStep+0x14>
mov    $0x1,%edi
call   1040 <GBA_RunFor@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1153 <GBA_DebugStep+0x33>
jmp    1171 <GBA_DebugStep+0x51>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jg     116c <GBA_DebugStep+0x4c>
jmp    1187 <GBA_DebugStep+0x67>
jmp    1134 <GBA_DebugStep+0x14>
jmp    1176 <GBA_DebugStep+0x56>
mov    $0x0,%al
call   1030 <GBA_CPUGetHalted@plt>
cmp    $0x0,%rax
jne    112f <GBA_DebugStep+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GBA_DebugStep>:
push   %rbx
mov    $0xf4240,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1040 <GBA_RunFor@plt>
test   %eax,%eax
je     114c <GBA_DebugStep+0x2c>
xor    %eax,%eax
call   1030 <GBA_CPUGetHalted@plt>
test   %rax,%rax
jne    1130 <GBA_DebugStep+0x10>
jmp    1155 <GBA_DebugStep+0x35>
lea    -0x1(%rbx),%eax
test   %ebx,%ebx
mov    %eax,%ebx
jg     1130 <GBA_DebugStep+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @GBA_DebugStep() {
%1 = alloca i32
store i32 1000000, i32* %1
br label %2
2: ; preds = %14, %0
br label %3
3: ; preds = %12, %2
%4 = call i32 @GBA_RunFor(i32 1)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = icmp sle i32 %8, 0
br i1 %10, label %11, label %12
11: ; preds = %7
br label %17
12: ; preds = %7
br label %3
13: ; preds = %3
br label %14
14: ; preds = %13
%15 = call i64 (...) @GBA_CPUGetHalted()
%16 = icmp ne i64 %15, 0
br i1 %16, label %2, label %17
17: ; preds = %11, %14
ret void
}

LLVM IR (-O2):
define void @GBA_DebugStep() {
br label %1
1: ; preds = %0, %6
%2 = phi i32 [ 1000000, %0 ], [ %7, %6 ]
br label %3
3: ; preds = %1, %9
%4 = tail call i32 @GBA_RunFor(i32 1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = add nsw i32 %2, -1
%8 = icmp slt i32 %2, 1
br i1 %8, label %12, label %1
9: ; preds = %3
%10 = tail call i64 (...) @GBA_CPUGetHalted()
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %6, %9
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
const char *hfp_subevent_ag_indicator_status_changed_get_indicator_name(
    const uint8_t *event) {
  return (const char *)&event[5];
}


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

x86 assembly (clang, -O2):
<hfp_subevent_ag_indicator_status_changed_get_indicator_name>:
lea    0x14(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @hfp_subevent_ag_indicator_status_changed_get_indicator_name(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = bitcast i32* %2 to i8*
ret i8* %3
}
void ARGBToRGB24Row_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToRGB24Row_NEON() {
ret void
}
int dead_state_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @dead_state_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @dead_state_init() {
ret i32 0
}
/* Variables and functions */
double sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ velocitySqVisVia(double, double, double);
double velocityVisVia(double GM, double a, double r) {
  return sqrt(velocitySqVisVia(GM, a, r));
}


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

x86 assembly (clang, -O2):
<velocityVisVia>:
push   %rax
call   1040 <velocitySqVisVia@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @velocityVisVia(double %0, double %1, double %2) {
%4 = tail call i32 @velocitySqVisVia(double %0, double %1, double %2)
%5 = tail call double @sqrt(i32 %4)
ret double %5
}
int count_cr(unsigned char source[], int posn, int length) {
  int c = 0;
  int i = posn;
  int cond = 1;
  do {
    if (source[i] == 13) {
      c++;
    } else {
      cond = 0;
    }
    i++;
  } while ((i < length) && cond);
  return c;
}


x86 assembly (clang, -O0):
<count_cr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0xd,%eax
jne    1145 <count_cr+0x45>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <count_cr+0x4c>
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
xor    %eax,%eax
cmp    -0x10(%rbp),%ecx
mov    %al,-0x1d(%rbp)
jge    1170 <count_cr+0x70>
cmpl   $0x0,-0x1c(%rbp)
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1122 <count_cr+0x22>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_cr>:
movslq %esi,%rcx
movslq %edx,%r8
add    $0x1,%rcx
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%esi
movzbl -0x1(%rdi,%rcx,1),%edx
xor    %eax,%eax
cmp    $0xd,%dl
sete   %al
add    %esi,%eax
cmp    %r8,%rcx
jge    112f <count_cr+0x2f>
add    $0x1,%rcx
cmp    $0xd,%dl
je     1110 <count_cr+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_cr(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = sext i32 %2 to i64
br label %6
6: ; preds = %6, %3
%7 = phi i64 [ %14, %6 ], [ %4, %3 ]
%8 = phi i32 [ %13, %6 ], [ 0, %3 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 13
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %8, %12
%14 = add nsw i64 %7, 1
%15 = icmp slt i64 %14, %5
%16 = select i1 %15, i1 %11, i1 false
br i1 %16, label %6, label %17
17: ; preds = %6
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x[6];
  *x = 3;
  assert(*x == 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
store i32 3, i32* %3
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 3
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ halfdelay(int);
void t_half_delay_start(int tenths) { halfdelay(tenths); }


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

x86 assembly (clang, -O2):
<t_half_delay_start>:
jmp    1030 <halfdelay@plt>

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

LLVM IR (-O2):
define void @t_half_delay_start(i32 %0) {
%2 = tail call i32 @halfdelay(i32 %0)
ret void
}
void fips_handler(struct ssi_drvdata *drvdata) {}


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

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

LLVM IR (-O0):
%struct.ssi_drvdata = type opaque
define void @fips_handler(%struct.ssi_drvdata* %0) {
%2 = alloca %struct.ssi_drvdata*
store %struct.ssi_drvdata* %0, %struct.ssi_drvdata** %2
ret void
}

LLVM IR (-O2):
%struct.ssi_drvdata = type opaque
define void @fips_handler(%struct.ssi_drvdata* nocapture %0) {
ret void
}
int constrain(int low, int value, int high) {
  if (value < low)
    return low;
  else if (value > high)
    return high;
  else
    return value;
}


x86 assembly (clang, -O0):
<constrain>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <constrain+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <constrain+0x41>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <constrain+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <constrain+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<constrain>:
mov    %edx,%eax
cmp    %edx,%esi
cmovle %esi,%eax
cmp    %edi,%esi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @constrain(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* %6
%9 = load i32, i32* %5
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %5
store i32 %12, i32* %4
br label %21
13: ; preds = %3
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i32, i32* %7
store i32 %18, i32* %4
br label %21
19: ; preds = %13
%20 = load i32, i32* %6
store i32 %20, i32* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @constrain(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = icmp sgt i32 %1, %2
%6 = select i1 %5, i32 %2, i32 %1
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
int debug_test(void) {
  static int debug_init = 0;
  static int debug = 0;
  return debug;
}


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

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

LLVM IR (-O0):
@debug_test.debug_init = internal global i32 0
@debug_test.debug = internal global i32 0
define i32 @debug_test() {
%1 = load i32, i32* @debug_test.debug
ret i32 %1
}

LLVM IR (-O2):
define i32 @debug_test() {
ret i32 0
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x, y;
  int r = rand();
  if (0 == r) {
    y = rand();
    x = 7;
  } else {
    rand();
    y = rand();
    x = 42;
  }
  return x;
}


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   1030 <rand@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmp    -0x1c(%rbp),%eax
jne    1151 <main+0x41>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
movl   $0x7,-0x14(%rbp)
jmp    1169 <main+0x59>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
movl   $0x2a,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
test   %ebx,%ebx
je     1133 <main+0x23>
xor    %eax,%eax
call   1030 <rand@plt>
mov    $0x2a,%eax
pop    %rbx
ret
mov    $0x7,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = icmp eq i32 %3, 0
%5 = tail call i32 (...) @rand()
br i1 %4, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @rand()
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 42, %6 ], [ 7, %2 ]
ret i32 %9
}
void ledsWriteRGB(unsigned char rgb) {
  unsigned int *data = ((unsigned int *)0x50023FFC);
  *data = ~(rgb << 9) & ~1;
}


x86 assembly (clang, -O0):
<ledsWriteRGB>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x50023ffc,%eax
mov    %rax,-0x10(%rbp)
movzbl -0x1(%rbp),%ecx
shl    $0x9,%ecx
xor    $0xffffffff,%ecx
and    $0xfffffffe,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ledsWriteRGB>:
shl    $0x9,%edi
xor    $0xfffffffe,%edi
mov    %edi,0x50023ffc
ret

LLVM IR (-O0):
define void @ledsWriteRGB(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32*
store i8 %0, i8* %2
store i32* inttoptr (i64 1342324732 to i32*), i32** %3
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = shl i32 %5, 9
%7 = xor i32 %6, -1
%8 = and i32 %7, -2
%9 = load i32*, i32** %3
store i32 %8, i32* %9
ret void
}

LLVM IR (-O2):
define void @ledsWriteRGB(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = shl nuw nsw i32 %2, 9
%4 = xor i32 %3, -2
store i32 %4, i32* inttoptr (i64 1342324732 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init(char *);
int ok();
int /*<<< orphan*/ test();
int main() {
  init("enumerations");
  test();
  return ok();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <init@plt>
mov    $0x0,%al
call   1050 <test@plt>
mov    $0x0,%al
call   1030 <ok@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <init@plt>
xor    %eax,%eax
call   1050 <test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ok@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"enumerations\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @init(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @test()
%4 = call i32 (...) @ok()
ret i32 %4
}

LLVM IR (-O2):
@.str = [13 x i8] c"enumerations\00"
define i32 @main() {
%1 = tail call i32 @init(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @test()
%3 = tail call i32 (...) @ok()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void helloWorld() { printf("Hello world\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
define void @helloWorld() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define void @helloWorld() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void UARTFIFOEnable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000002C))) |= 0x00000010;
}


x86 assembly (clang, -O0):
<UARTFIFOEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    (%rax),%ecx
or     $0x10,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFOEnable>:
movslq %edi,%rax
orl    $0x10,0x2c(%rax)
ret

LLVM IR (-O0):
define void @UARTFIFOEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 44
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 16
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @UARTFIFOEnable(i32 %0) {
%2 = add nsw i32 %0, 44
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 16
store volatile i32 %6, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ build_max_heap(int *, size_t);
int /*<<< orphan*/ max_heapify(int *, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ swap(int *, int /*<<< orphan*/, size_t);
void heapsort(int arr[], size_t arr_sz) {
  build_max_heap(arr, arr_sz);
  while (arr_sz > 0) {
    swap(arr, 0, arr_sz - 1);
    arr_sz--;
    max_heapify(arr, arr_sz, 0);
  }
}


x86 assembly (clang, -O0):
<heapsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <build_max_heap@plt>
cmpq   $0x0,-0x10(%rbp)
jbe    118b <heapsort+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
sub    $0x1,%rdx
xor    %esi,%esi
call   1050 <swap@plt>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <max_heapify@plt>
jmp    114d <heapsort+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapsort>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <build_max_heap@plt>
test   %rbx,%rbx
je     1170 <heapsort+0x40>
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1050 <swap@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <max_heapify@plt>
add    $0xffffffffffffffff,%rbx
jb     1150 <heapsort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @heapsort(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = call i32 @build_max_heap(i32* %5, i64 %6)
br label %8
8: ; preds = %11, %2
%9 = load i64, i64* %4
%10 = icmp ugt i64 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = load i32*, i32** %3
%13 = load i64, i64* %4
%14 = sub i64 %13, 1
%15 = call i32 @swap(i32* %12, i32 0, i64 %14)
%16 = load i64, i64* %4
%17 = add i64 %16, -1
store i64 %17, i64* %4
%18 = load i32*, i32** %3
%19 = load i64, i64* %4
%20 = call i32 @max_heapify(i32* %18, i64 %19, i32 0)
br label %8
21: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @heapsort(i32* %0, i64 %1) {
%3 = tail call i32 @build_max_heap(i32* %0, i64 %1)
%4 = icmp eq i64 %1, 0
br i1 %4, label %11, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %7, %5 ], [ %1, %2 ]
%7 = add i64 %6, -1
%8 = tail call i32 @swap(i32* %0, i32 0, i64 %7)
%9 = tail call i32 @max_heapify(i32* %0, i64 %7, i32 0)
%10 = icmp eq i64 %7, 0
br i1 %10, label %11, label %5
11: ; preds = %5, %2
ret void
}
int DontChange(int a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @DontChange(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ dprintf2(char *, void *, int, int);
int /*<<< orphan*/ expected_pkey_fault(int);
int read_ptr(void *);
void expect_fault_on_read_execonly_key(void *p1, int pkey) {
  int ptr_contents;
  ptr_contents = read_ptr(p1);
  dprintf2("ptr (%p) contents@%d: %x\n", p1, 172, ptr_contents);
  expected_pkey_fault(pkey);
}


x86 assembly (clang, -O0):
<expect_fault_on_read_execonly_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read_ptr@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%ecx
lea    0xea7(%rip),%rdi
mov    $0xac,%edx
call   1040 <dprintf2@plt>
mov    -0xc(%rbp),%edi
call   1050 <expected_pkey_fault@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_fault_on_read_execonly_key>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <read_ptr@plt>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
mov    $0xac,%edx
mov    %eax,%ecx
call   1040 <dprintf2@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <expected_pkey_fault@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"ptr (%p) contents@%d: %x\0A\00"
define void @expect_fault_on_read_execonly_key(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @read_ptr(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = call i32 @dprintf2(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %8, i32 172, i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @expected_pkey_fault(i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"ptr (%p) contents@%d: %x\0A\00"
define void @expect_fault_on_read_execonly_key(i8* %0, i32 %1) {
%3 = tail call i32 @read_ptr(i8* %0)
%4 = tail call i32 @dprintf2(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i32 172, i32 %3)
%5 = tail call i32 @expected_pkey_fault(i32 %1)
ret void
}
int main(void) {
  unsigned a;
  int b;
  int c;
  for (a = 22; a < 50; a += 1) {
    for (b = 23; b < 50; b += 5) {
      ++a;
      for (c = a; c < 100; c++) {
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x16,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jae    117f <main+0x7f>
movl   $0x17,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    116c <main+0x6c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
jge    1159 <main+0x59>
jmp    114b <main+0x4b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113c <main+0x3c>
jmp    115e <main+0x5e>
mov    -0xc(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <main+0x23>
jmp    1171 <main+0x71>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 22, i32* %2
br label %5
5: ; preds = %28, %0
%6 = load i32, i32* %2
%7 = icmp ult i32 %6, 50
br i1 %7, label %8, label %31
8: ; preds = %5
store i32 23, i32* %3
br label %9
9: ; preds = %24, %8
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 50
br i1 %11, label %12, label %27
12: ; preds = %9
%13 = load i32, i32* %2
%14 = add i32 %13, 1
store i32 %14, i32* %2
%15 = load i32, i32* %2
store i32 %15, i32* %4
br label %16
16: ; preds = %20, %12
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 100
br i1 %18, label %19, label %23
19: ; preds = %16
br label %20
20: ; preds = %19
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %16
23: ; preds = %16
br label %24
24: ; preds = %23
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 5
store i32 %26, i32* %3
br label %9
27: ; preds = %9
br label %28
28: ; preds = %27
%29 = load i32, i32* %2
%30 = add i32 %29, 1
store i32 %30, i32* %2
br label %5
31: ; preds = %5
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age;
  int height = 72;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall.\n", height);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 72, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 72)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *p = strdup(s);
  if (p == NULL)
    err(1, "Out of memory");
  return p;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <xstrdup+0x35>
mov    $0x1,%edi
lea    0xeb0(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xstrdup+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @err(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ UART_writeDecU64(int /*<<< orphan*/, int);
void UART_writeDecU16(uint16_t v) { UART_writeDecU64(v, 5); }


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

x86 assembly (clang, -O2):
<UART_writeDecU16>:
mov    $0x5,%esi
jmp    1030 <UART_writeDecU64@plt>

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

LLVM IR (-O2):
define void @UART_writeDecU16(i32 %0) {
%2 = tail call i32 @UART_writeDecU64(i32 %0, i32 5)
ret void
}
/* Variables and functions */
double log(int);
double log1p(double x) { return log(1 + x); }


x86 assembly (clang, -O0):
<log1p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log1p>:
addsd  0xee8(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @log1p(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double 1.000000e+00, %3
%5 = fptosi double %4 to i32
%6 = call double @log(i32 %5)
ret double %6
}

LLVM IR (-O2):
define double @log1p(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fptosi double %2 to i32
%4 = tail call double @log(i32 %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ mb();
unsigned int readl(unsigned int);
unsigned int dramc_reg_read(unsigned int addr) {
  unsigned int value = readl(addr);
  mb();
  return value;
}


x86 assembly (clang, -O0):
<dramc_reg_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <readl@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <mb@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dramc_reg_read>:
push   %rbx
call   1030 <readl@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <mb@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @dramc_reg_read(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @readl(i32 %4)
store i32 %5, i32* %3
%6 = call i32 (...) @mb()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @dramc_reg_read(i32 %0) {
%2 = tail call i32 @readl(i32 %0)
%3 = tail call i32 (...) @mb()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_log_set_ident() {
  printf("NOT IMPLEMENTED:"
         "pa_log_set_ident"
         "\n");
}


x86 assembly (clang, -O0):
<pa_log_set_ident>:
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_log_set_ident>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_log_set_ident\00"
define i32 @pa_log_set_ident() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
void suspend_wakeup_init(void) {}


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

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

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

LLVM IR (-O2):
define void @suspend_wakeup_init() {
ret void
}
/* Variables and functions */
double pow(double, int);
int rating_change_win(int engine_rating, int opponent_rating) {
  double r;
  r = pow(10.0, (engine_rating - opponent_rating) / 400.0);
  r = 1.0 / (1.0 + r);
  r *= 32.0;
  return (int)(r + 0.5);
}


x86 assembly (clang, -O0):
<rating_change_win>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xef0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xed8(%rip),%xmm0
call   1030 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xebe(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xeb1(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe98(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe7e(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rating_change_win>:
push   %rax
sub    %esi,%edi
cvtsi2sd %edi,%xmm0
divsd  0xee1(%rip),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xedd(%rip),%xmm0
call   1030 <pow@plt>
movsd  0xed8(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
mulsd  0xed0(%rip),%xmm1
addsd  0xed0(%rip),%xmm1
cvttsd2si %xmm1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rating_change_win(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 4.000000e+02
%11 = fptosi double %10 to i32
%12 = call double @pow(double 1.000000e+01, i32 %11)
store double %12, double* %5
%13 = load double, double* %5
%14 = fadd double 1.000000e+00, %13
%15 = fdiv double 1.000000e+00, %14
store double %15, double* %5
%16 = load double, double* %5
%17 = fmul double %16, 3.200000e+01
store double %17, double* %5
%18 = load double, double* %5
%19 = fadd double %18, 5.000000e-01
%20 = fptosi double %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @rating_change_win(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 4.000000e+02
%6 = fptosi double %5 to i32
%7 = tail call double @pow(double 1.000000e+01, i32 %6)
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double 1.000000e+00, %8
%10 = fmul double %9, 3.200000e+01
%11 = fadd double %10, 5.000000e-01
%12 = fptosi double %11 to i32
ret i32 %12
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
void bitvector_set(u_int32_t *b, u_int32_t n, u_int32_t c) {
  if (c)
    b[n >> 5] |= (1 << (n & 31));
  else
    b[n >> 5] &= ~(1 << (n & 31));
}


x86 assembly (clang, -O0):
<bitvector_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     113d <bitvector_set+0x3d>
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x5,%ecx
movslq %ecx,%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
jmp    1160 <bitvector_set+0x60>
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x5,%ecx
movslq %ecx,%rcx
and    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitvector_set>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
test   %edx,%edx
je     1117 <bitvector_set+0x17>
sar    $0x5,%ecx
movslq %ecx,%rcx
or     %eax,(%rdi,%rcx,4)
ret
not    %eax
sar    $0x5,%ecx
movslq %ecx,%rcx
and    %eax,(%rdi,%rcx,4)
ret

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

LLVM IR (-O2):
define void @bitvector_set(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = and i32 %1, 31
%6 = shl nuw i32 1, %5
br i1 %4, label %13, label %7
7: ; preds = %3
%8 = ashr i32 %1, 5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = or i32 %11, %6
store i32 %12, i32* %10
br label %20
13: ; preds = %3
%14 = xor i32 %6, -1
%15 = ashr i32 %1, 5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %0, i64 %16
%18 = load i32, i32* %17
%19 = and i32 %18, %14
store i32 %19, i32* %17
br label %20
20: ; preds = %13, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void SCMemcpy(void *target_memory, void *source_memory, int length) {
  memcpy(target_memory, source_memory, length);
}


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

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

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

LLVM IR (-O2):
define void @SCMemcpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ too_many_args(int /*<<< orphan*/, int, int, int, int, int,
                                 int, int, int, int);
int main(void) {
  too_many_args(0, 1, 2, 4, 8, 16, 32, 64, 128, 256);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x4,%ecx
mov    $0x8,%r8d
mov    $0x10,%r9d
movl   $0x20,(%rsp)
movl   $0x40,0x8(%rsp)
movl   $0x80,0x10(%rsp)
movl   $0x100,0x18(%rsp)
call   1030 <too_many_args@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x4,%ecx
mov    $0x8,%r8d
mov    $0x10,%r9d
push   $0x100
push   $0x80
push   $0x40
push   $0x20
call   1030 <too_many_args@plt>
add    $0x20,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @too_many_args(i32 0, i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 64, i32 128, i32 256)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @too_many_args(i32 0, i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 64, i32 128, i32 256)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ refresh();
int quit(int error) {
  clear();
  refresh();
  endwin();
  exit(error);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <clear@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <clear@plt>
xor    %eax,%eax
call   1030 <refresh@plt>
xor    %eax,%eax
call   1040 <endwin@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @quit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @clear()
%4 = call i32 (...) @refresh()
%5 = call i32 (...) @endwin()
%6 = load i32, i32* %2
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
define i32 @quit(i32 %0) {
%2 = tail call i32 (...) @clear()
%3 = tail call i32 (...) @refresh()
%4 = tail call i32 (...) @endwin()
%5 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ measure_clock_gettime();
int /*<<< orphan*/ measure_gettimeofday();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("granularity:\r\n");
  measure_clock_gettime();
  measure_gettimeofday();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <measure_clock_gettime@plt>
mov    $0x0,%al
call   1050 <measure_gettimeofday@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <measure_clock_gettime@plt>
xor    %eax,%eax
call   1050 <measure_gettimeofday@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"granularity:\0D\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 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @measure_clock_gettime()
%8 = call i32 (...) @measure_gettimeofday()
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"granularity:\0D\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @measure_clock_gettime()
%5 = tail call i32 (...) @measure_gettimeofday()
ret i32 0
}
/* Variables and functions */
double NAN;
double piemathDivide(double a, double b) {
  if (b == 0) {
    return NAN;
  }
  return a / b;
}


x86 assembly (clang, -O0):
<piemathDivide>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    113b <piemathDivide+0x3b>
jp     113b <piemathDivide+0x3b>
mov    0x2ecb(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114a <piemathDivide+0x4a>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<piemathDivide>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jne    1118 <piemathDivide+0x18>
jp     1118 <piemathDivide+0x18>
mov    0x2ee5(%rip),%rax
movsd  (%rax),%xmm0
ret
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@NAN = global double 0.000000e+00
define double @piemathDivide(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* @NAN
store double %9, double* %3
br label %14
10: ; preds = %2
%11 = load double, double* %4
%12 = load double, double* %5
%13 = fdiv double %11, %12
store double %13, double* %3
br label %14
14: ; preds = %10, %8
%15 = load double, double* %3
ret double %15
}

LLVM IR (-O2):
@NAN = global double 0.000000e+00
define double @piemathDivide(double %0, double %1) {
%3 = fcmp oeq double %1, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load double, double* @NAN
br label %8
6: ; preds = %2
%7 = fdiv double %0, %1
br label %8
8: ; preds = %6, %4
%9 = phi double [ %5, %4 ], [ %7, %6 ]
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *agrv[]) {
  printf("hello\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"hello\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 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void deinit6(void) {}


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

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

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

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