xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ lua_dofile(int /*<<< orphan*/ *);
int /*<<< orphan*/ lua_dostring(char *);
int /*<<< orphan*/ stdin;
void manual_input(void) {
  if ((0 == 0)) {
    char buffer[250];
    while (fgets(buffer, sizeof(buffer), stdin) != 0)
      lua_dostring(buffer);
  } else
    lua_dofile(NULL);
}


x86 assembly (clang, -O0):
<manual_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
mov    $0xfa,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     1160 <manual_input+0x40>
lea    -0x100(%rbp),%rdi
call   1030 <lua_dostring@plt>
jmp    112b <manual_input+0xb>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<manual_input>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    0x2eb7(%rip),%r14
mov    (%r14),%edx
mov    %rsp,%rdi
mov    $0xfa,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     116d <manual_input+0x4d>
mov    %rsp,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <lua_dostring@plt>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0xfa,%esi
call   1040 <fgets@plt>
test   %rax,%rax
jne    1150 <manual_input+0x30>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
define void @manual_input() {
%1 = alloca [250 x i8]
br label %2
2: ; preds = %7, %0
%3 = getelementptr inbounds [250 x i8], [250 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i64 @fgets(i8* %3, i32 250, i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = getelementptr inbounds [250 x i8], [250 x i8]* %1, i64 0, i64 0
%9 = call i32 @lua_dostring(i8* %8)
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @manual_input() {
%1 = alloca [250 x i8]
%2 = getelementptr inbounds [250 x i8], [250 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i64 @fgets(i8* %2, i32 250, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %0, %6
%7 = call i32 @lua_dostring(i8* %2)
%8 = load i32, i32* @stdin
%9 = call i64 @fgets(i8* %2, i32 250, i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %0
ret void
}
long double _Complex mul_long_double_rr(long double a, long double b) {
  return a * b;
}


x86 assembly (clang, -O0):
<mul_long_double_rr>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x30(%rbp)
fstpt  -0x40(%rbp)
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
fmulp  %st,%st(1)
fstpt  -0x20(%rbp)
fldz
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_long_double_rr>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fmulp  %st,%st(1)
fldz
fxch   %st(1)
ret

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @mul_long_double_rr(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca { x86_fp80, x86_fp80 }
%4 = alloca x86_fp80
%5 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
%6 = load x86_fp80, x86_fp80* %4
%7 = load x86_fp80, x86_fp80* %5
%8 = fmul x86_fp80 %6, %7
%9 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 0
%10 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 1
store x86_fp80 %8, x86_fp80* %9
store x86_fp80 0xK00000000000000000000, x86_fp80* %10
%11 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3
ret { x86_fp80, x86_fp80 } %11
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @mul_long_double_rr(x86_fp80 %0, x86_fp80 %1) {
%3 = fmul x86_fp80 %0, %1
%4 = insertvalue { x86_fp80, x86_fp80 } poison, x86_fp80 %3, 0
%5 = insertvalue { x86_fp80, x86_fp80 } %4, x86_fp80 0xK00000000000000000000, 1
ret { x86_fp80, x86_fp80 } %5
}
RX0I1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((p0[x0]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<RX0I1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  0xed4(%rip),%xmm0
ucomisd (%rax,%rcx,8),%xmm0
jb     1143 <RX0I1+0x43>
movl   $0x1,-0x4(%rbp)
jmp    114a <RX0I1+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0I1>:
movslq %edi,%rcx
movsd  0xef5(%rip),%xmm0
xor    %eax,%eax
ucomisd (%rdx,%rcx,8),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @RX0I1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double*, double** %12
%15 = load i32, i32* %10
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
%18 = load double, double* %17
%19 = fcmp ole double %18, 3.300000e+01
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @RX0I1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* %4, i64 %7
%9 = load double, double* %8
%10 = fcmp ole double %9, 3.300000e+01
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int fesetenv(const fenv_t *envp) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fesetenv(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int go(void) {
  int i, j, total = 0;
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 10; j++) {
      total += i * j;
    }
  }
  return (total);
}


x86 assembly (clang, -O0):
<go>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    115b <go+0x5b>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1148 <go+0x48>
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1123 <go+0x23>
jmp    114d <go+0x4d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <go+0x12>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @go() {
ret i32 2025
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
size_t modulo(const ssize_t n, const size_t m) {
  const ssize_t signed_m = (ssize_t)m;
  assert(signed_m > 0);
  const ssize_t result = ((n % signed_m) + signed_m) % signed_m;
  assert(result >= 0);
  return (size_t)result;
}


x86 assembly (clang, -O0):
<modulo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,%rax
add    -0x18(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %rsi,%rsi
setg   %dil
call   1030 <assert@plt>
mov    %r14,%rax
or     %rbx,%rax
shr    $0x20,%rax
je     1141 <modulo+0x31>
mov    %r14,%rax
cqto
idiv   %rbx
mov    %rdx,%rax
jmp    114a <modulo+0x3a>
mov    %r14d,%eax
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    %rbx,%rax
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     1163 <modulo+0x53>
cqto
idiv   %rbx
mov    %rdx,%rbx
jmp    1169 <modulo+0x59>
xor    %edx,%edx
div    %ebx
mov    %edx,%ebx
mov    %rbx,%rdi
shr    $0x3f,%rdi
xor    $0x1,%edi
call   1030 <assert@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @modulo(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = icmp sgt i64 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i64, i64* %3
%13 = load i64, i64* %5
%14 = srem i64 %12, %13
%15 = load i64, i64* %5
%16 = add nsw i64 %14, %15
%17 = load i64, i64* %5
%18 = srem i64 %16, %17
store i64 %18, i64* %6
%19 = load i64, i64* %6
%20 = icmp sge i64 %19, 0
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = load i64, i64* %6
ret i64 %23
}

LLVM IR (-O2):
define i64 @modulo(i64 %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = srem i64 %0, %1
%7 = add nsw i64 %6, %1
%8 = srem i64 %7, %1
%9 = lshr i64 %8, 63
%10 = trunc i64 %9 to i32
%11 = xor i32 %10, 1
%12 = tail call i32 @assert(i32 %11)
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ch8_SCDOWN() { printf("Error: ch8_SCDOWN not yet implemented\n"); }


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"Error: ch8_SCDOWN not yet implemented\0A\00"
define void @ch8_SCDOWN() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"Error: ch8_SCDOWN not yet implemented\00"
define void @ch8_SCDOWN() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *_malloc(size_t, char *, int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t size) {
  void *mem = _malloc((size),
                      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/MasterQ32/trainOS/"
                      "refs/heads/master/include/kstdlib.h",
                      118);
  memset(mem, 0, size);
  return mem;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0x76,%edx
call   1030 <_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xed2(%rip),%rsi
mov    $0x76,%edx
call   1030 <_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/MasterQ32/trainOS/refs/heads/master/include/kstdlib.h\00"
define i8* @calloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @_malloc(i64 %4, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 118)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/MasterQ32/trainOS/refs/heads/master/include/kstdlib.h\00"
define i8* @calloc(i64 %0) {
%2 = tail call i8* @_malloc(i64 %0, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 118)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
void foo628(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo628(i32 %0) {
ret void
}
/* Variables and functions */
int sign(long);
int cmp(const void *x, const void *y) { return sign(*(long *)x - *(long *)y); }


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

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%rdi
sub    (%rsi),%rdi
jmp    1030 <sign@plt>

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = call i32 @sign(i64 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = tail call i32 @sign(i64 %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_reset_priority() {
  printf("NOT IMPLEMENTED:"
         "pa_reset_priority"
         "\n");
}


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

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

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_reset_priority\00"
define i32 @pa_reset_priority() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
double __infer_nondet_double();
double fmax(double x, double y) { return __infer_nondet_double(); }


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

x86 assembly (clang, -O2):
<fmax>:
xor    %eax,%eax
jmp    1030 <__infer_nondet_double@plt>

LLVM IR (-O0):
define double @fmax(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @__infer_nondet_double()
ret double %5
}

LLVM IR (-O2):
define double @fmax(double %0, double %1) {
%3 = tail call double (...) @__infer_nondet_double()
ret double %3
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int multprec_Newton_step(int deci) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(195, &deci, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<multprec_Newton_step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xc3,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multprec_Newton_step>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0xc3,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @multprec_Newton_step(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 195, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @multprec_Newton_step(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 195, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
void ABGRToYRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ABGRToYRow_NEON() {
ret void
}
/* Variables and functions */
int count();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 0; i < 5; i++) {
    printf("%d\n", count());
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1163 <main+0x43>
mov    $0x0,%al
call   1030 <count@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @count()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @count()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @count()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @count()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 (...) @count()
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
int iwl3945_led_register(struct iwl3945_priv *priv) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iwl3945_priv = type opaque
define i32 @iwl3945_led_register(%struct.iwl3945_priv* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int core3_swap(char *, int);
int U_EMRSETLAYOUT_swap(char *record, int torev) {
  return (core3_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRSETLAYOUT_swap>:
jmp    1030 <core3_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSETLAYOUT_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core3_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int iopl(int /*<<< orphan*/);
int main(void) { return iopl(0); }


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

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
jmp    1030 <iopl@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @iopl(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char);
int /*<<< orphan*/ scanf(char *, int *, char *);
int main() {
  int a, b;
  float f;
  char c;
  scanf("%d%c", &a, &c);
  printf("%d %c", a, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x11(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
movsbl -0x11(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
lea    0x3(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
movsbl 0x3(%rsp),%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%c\00"
@.str.1 = [6 x i8] c"%d %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i8* %2)
%5 = load i32, i32* %1
%6 = load i8, i8* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %5, i8 signext %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t,
                           int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void *xmalloc(size_t size) {
  void *ret = malloc(size);
  if (!ret) {
    fprintf(stderr, "\nerror: malloc(%zu) failed: %s", size, strerror(errno));
    exit(1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11a5 <xmalloc+0x65>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
lea    0xe6a(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1157 <xmalloc+0x17>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e82(%rip),%rax
mov    (%rax),%ebp
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe8b(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"\0Aerror: malloc(%zu) failed: %s\00"
@errno = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %15, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = load i32, i32* @errno
%12 = call i32 @strerror(i32 %11)
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %10, i32 %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"\0Aerror: malloc(%zu) failed: %s\00"
@errno = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = tail call i32 @strerror(i32 %6)
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %0, i32 %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret i8* %2
}
void swap_data(void **d1, void **d2) {
  void *t = *d1;
  *d1 = *d2;
  *d2 = t;
}


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

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

LLVM IR (-O0):
define void @swap_data(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @swap_data(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
/* Type definitions */
typedef int int8_t;
typedef int /*<<< orphan*/ input;
typedef int /*<<< orphan*/ expected;

/* Variables and functions */
int /*<<< orphan*/ test_rebase(int, int *, int, int, int *, int);
void test_15_bit_integer(void) {
  int8_t input[] = {3, 46, 60};
  int8_t expected[] = {6, 10, 45};
  test_rebase(97, input, (sizeof(input) / sizeof(input[0])), 73, expected,
              (sizeof(expected) / sizeof(expected[0])));
}


x86 assembly (clang, -O0):
<test_15_bit_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0xed9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed7(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0xc(%rbp),%rsi
lea    -0x18(%rbp),%r8
mov    $0x61,%edi
mov    $0x3,%r9d
mov    $0x49,%ecx
mov    %r9d,%edx
call   1030 <test_rebase@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_15_bit_integer>:
sub    $0x28,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x20(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x18(%rsp)
mov    0xee4(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xed1(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x18(%rsp),%rsi
lea    0x8(%rsp),%r8
mov    $0x61,%edi
mov    $0x3,%edx
mov    $0x49,%ecx
mov    $0x3,%r9d
call   1030 <test_rebase@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_15_bit_integer.input = [3 x i32] [i32 3, i32 46, i32 60]
@__const.test_15_bit_integer.expected = [3 x i32] [i32 6, i32 10, i32 45]
define void @test_15_bit_integer() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = call i32 @test_rebase(i32 97, i32* %5, i32 3, i32 73, i32* %6, i32 3)
ret void
}

LLVM IR (-O2):
@__const.test_15_bit_integer.input = [3 x i32] [i32 3, i32 46, i32 60]
@__const.test_15_bit_integer.expected = [3 x i32] [i32 6, i32 10, i32 45]
define void @test_15_bit_integer() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = call i32 @test_rebase(i32 97, i32* %5, i32 3, i32 73, i32* %6, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void print_usage(char *argv[]) {
  printf("USAGE: %s -p PORT_NUM -i IP\n", argv[0]);
  printf("\tPORT_NUM is the port to listen for incoming UDP msg\n");
  printf("\tIP (or -i IP1 -i IP2 etc.) is the address to relay the msg to\n");
  exit(0);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    (%rdi),%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"USAGE: %s -p PORT_NUM -i IP\0A\00"
@.str.1 = [54 x i8] c"\09PORT_NUM is the port to listen for incoming UDP msg\0A\00"
@.str.2 = [64 x i8] c"\09IP (or -i IP1 -i IP2 etc.) is the address to relay the msg to\0A\00"
define void @print_usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"USAGE: %s -p PORT_NUM -i IP\0A\00"
@str = [53 x i8] c"\09PORT_NUM is the port to listen for incoming UDP msg\00"
@str.3 = [63 x i8] c"\09IP (or -i IP1 -i IP2 etc.) is the address to relay the msg to\00"
define void @print_usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.3, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int dcloadsyscall(int, char const *, char const *);
int link(const char *oldpath, const char *newpath) {
  if (*(unsigned int *)0x8c004004 == 0xdeadbeef)
    return dcloadsyscall(5, oldpath, newpath);
  else
    return -1;
}


x86 assembly (clang, -O0):
<link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    114b <link+0x3b>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x5,%edi
call   1030 <dcloadsyscall@plt>
mov    %eax,-0x4(%rbp)
jmp    1152 <link+0x42>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<link>:
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    112d <link+0x1d>
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x5,%edi
jmp    1030 <dcloadsyscall@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @link(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%7 = icmp eq i32 %6, -559038737
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i32 @dcloadsyscall(i32 5, i8* %9, i8* %10)
store i32 %11, i32* %3
br label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @link(i8* %0, i8* %1) {
%3 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%4 = icmp eq i32 %3, -559038737
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @dcloadsyscall(i32 5, i8* %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ RB_AUTOBOOT;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ reboot(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
__attribute__((noreturn)) void poweroff(void) {
  fflush(stdout);
  fflush(stderr);
  reboot(RB_AUTOBOOT);
  sleep(30);
  fprintf(stderr, "\x1b[37m\x1b[41m\x1b[1mFailed to power off!!!\x1b[0m\n");
  exit(1);
}


x86 assembly (clang, -O0):
<poweroff>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1060 <reboot@plt>
mov    $0x1e,%edi
call   1070 <sleep@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
lea    0xe68(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<poweroff>:
push   %rbx
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e7a(%rip),%rbx
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1060 <reboot@plt>
mov    $0x1e,%edi
call   1070 <sleep@plt>
mov    (%rbx),%edi
lea    0xe72(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@RB_AUTOBOOT = global i32 0
@.str = [42 x i8] c"\1B[37m\1B[41m\1B[1mFailed to power off!!!\1B[0m\0A\00"
define void @poweroff() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
%3 = load i32, i32* @stderr
%4 = call i32 @fflush(i32 %3)
%5 = load i32, i32* @RB_AUTOBOOT
%6 = call i32 @reboot(i32 %5)
%7 = call i32 @sleep(i32 30)
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@RB_AUTOBOOT = global i32 0
@.str = [42 x i8] c"\1B[37m\1B[41m\1B[1mFailed to power off!!!\1B[0m\0A\00"
define void @poweroff() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fflush(i32 %3)
%5 = load i32, i32* @RB_AUTOBOOT
%6 = tail call i32 @reboot(i32 %5)
%7 = tail call i32 @sleep(i32 30)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print(const char *str) { printf("%s", str); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char *memchr(char const *, int /*<<< orphan*/, size_t);
size_t strnlen(const char *str, size_t maxlen) {
  const char *ptr;
  ptr = memchr(str, 0, maxlen);
  if (ptr == NULL)
    return (maxlen);
  return (ptr - str);
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    114b <strnlen+0x3b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115a <strnlen+0x4a>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @memchr(i8* %7, i32 0, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i64, i64* %5
store i64 %13, i64* %3
br label %20
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = load i8*, i8** %4
%17 = ptrtoint i8* %15 to i64
%18 = ptrtoint i8* %16 to i64
%19 = sub i64 %17, %18
store i64 %19, i64* %3
br label %20
20: ; preds = %14, %12
%21 = load i64, i64* %3
ret i64 %21
}

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = tail call i8* @memchr(i8* %0, i32 0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = select i1 %4, i64 %1, i64 %7
ret i64 %8
}
/* Variables and functions */
int O_RDWR;
int O_WRONLY;
int libc_open(char const *, int);
int /*<<< orphan*/ watch_log(char *, char const *);
int __open(const char *path, int flags, ...) {
  if ((flags & O_WRONLY) || (flags & O_RDWR)) {
    watch_log("open %s w\n", path);
  }
  return libc_open(path, flags);
}


x86 assembly (clang, -O0):
<__open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e97(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    1159 <__open+0x39>
mov    -0xc(%rbp),%eax
mov    0x2e9a(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1169 <__open+0x49>
mov    -0x8(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <watch_log@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <libc_open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__open>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    0x2ea0(%rip),%rax
test   %esi,(%rax)
jne    113f <__open+0x1f>
mov    0x2ead(%rip),%rax
test   %ebx,(%rax)
je     114e <__open+0x2e>
lea    0xeba(%rip),%rdi
mov    %r14,%rsi
call   1030 <watch_log@plt>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <libc_open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_RDWR = global i32 0
@.str = [11 x i8] c"open %s w\0A\00"
define i32 @__open(i8* %0, i32 %1, ...) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* @O_WRONLY
%7 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* @O_RDWR
%12 = and i32 %10, %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %9, %2
%15 = load i8*, i8** %3
%16 = call i32 @watch_log(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %14, %9
%18 = load i8*, i8** %3
%19 = load i32, i32* %4
%20 = call i32 @libc_open(i8* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_RDWR = global i32 0
@.str = [11 x i8] c"open %s w\0A\00"
define i32 @__open(i8* %0, i32 %1, ...) {
%3 = load i32, i32* @O_WRONLY
%4 = and i32 %3, %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @O_RDWR
%8 = and i32 %7, %1
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %6, %2
%11 = tail call i32 @watch_log(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %12
12: ; preds = %10, %6
%13 = tail call i32 @libc_open(i8* %0, i32 %1)
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__41__IO__makeInput();
void Msp430Adc12ImplP__Port61__makeInput(void) {
  HplMsp430GeneralIOP__41__IO__makeInput();
}


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

x86 assembly (clang, -O2):
<Msp430Adc12ImplP__Port61__makeInput>:
xor    %eax,%eax
jmp    1030 <HplMsp430GeneralIOP__41__IO__makeInput@plt>

LLVM IR (-O0):
define void @Msp430Adc12ImplP__Port61__makeInput() {
%1 = call i32 (...) @HplMsp430GeneralIOP__41__IO__makeInput()
ret void
}

LLVM IR (-O2):
define void @Msp430Adc12ImplP__Port61__makeInput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__41__IO__makeInput()
ret void
}
double mla(double x, double y, double z) { return x * y + z; }


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

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

LLVM IR (-O0):
define double @mla(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 double @llvm.fmuladd.f64(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @mla(double %0, double %1, double %2) {
%4 = tail call double @llvm.fmuladd.f64(double %0, double %1, double %2)
ret double %4
}
int test_imm_C4uint32_reg(unsigned int val) {
  return ((val) & (0xC4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C4uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xc4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C4uint32_reg>:
test   $0xc4,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C4uint32_reg(i32 %0) {
%2 = and i32 %0, 196
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  int i = 1;
  int j = 0;
  while (i != 1024 || j <= 0) {
    i *= 2;
    ++j;
  }
  if (j != 10)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x400,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jne    1159 <main+0x39>
cmpl   $0x0,-0xc(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1169 <main+0x49>
jmp    1180 <main+0x60>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
cmpl   $0xa,-0xc(%rbp)
je     1191 <main+0x71>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 1024
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 0
br label %10
10: ; preds = %7, %4
%11 = phi i1 [ true, %4 ], [ %9, %7 ]
br i1 %11, label %12, label %17
12: ; preds = %10
%13 = load i32, i32* %2
%14 = mul nsw i32 %13, 2
store i32 %14, i32* %2
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %10
%18 = load i32, i32* %3
%19 = icmp ne i32 %18, 10
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 (...) @abort()
unreachable
22: ; preds = %17
%23 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}