xunge/DecIR huggingface dataset:
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y;
  while (x >= 0 && y >= 0) {
    y = y - 1;
    if (y < 0) {
      x = x - 1;
      y = __VERIFIER_nondet_int();
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jl     1138 <main+0x28>
cmpl   $0x0,-0xc(%rbp)
setge  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1148 <main+0x38>
jmp    1173 <main+0x63>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    116e <main+0x5e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
jmp    111f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
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
store i32 0, i32* %1
br label %4
4: ; preds = %21, %0
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 0
br label %10
10: ; preds = %7, %4
%11 = phi i1 [ false, %4 ], [ %9, %7 ]
br i1 %11, label %12, label %22
12: ; preds = %10
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %12
%18 = load i32, i32* %2
%19 = sub nsw i32 %18, 1
store i32 %19, i32* %2
%20 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %20, i32* %3
br label %21
21: ; preds = %17, %12
br label %4
22: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void compat_le32enc(void *pp, uint32_t x) {
  uint8_t *p = (uint8_t *)pp;
  p[0] = x & 0xff;
  p[1] = (x >> 8) & 0xff;
  p[2] = (x >> 16) & 0xff;
  p[3] = (x >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<compat_le32enc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<compat_le32enc>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,(%rdi)
movzbl %ah,%ecx
mov    %ecx,0x4(%rdi)
mov    %esi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x8(%rdi)
shr    $0x18,%eax
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @compat_le32enc(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 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32, i32* %4
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 1
store i32 %14, i32* %16
%17 = load i32, i32* %4
%18 = ashr i32 %17, 16
%19 = and i32 %18, 255
%20 = load i32*, i32** %5
%21 = getelementptr inbounds i32, i32* %20, i64 2
store i32 %19, i32* %21
%22 = load i32, i32* %4
%23 = ashr i32 %22, 24
%24 = and i32 %23, 255
%25 = load i32*, i32** %5
%26 = getelementptr inbounds i32, i32* %25, i64 3
store i32 %24, i32* %26
ret void
}

LLVM IR (-O2):
define void @compat_le32enc(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = and i32 %1, 255
store i32 %4, i32* %3
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
%9 = lshr i32 %1, 16
%10 = and i32 %9, 255
%11 = getelementptr inbounds i8, i8* %0, i64 8
%12 = bitcast i8* %11 to i32*
store i32 %10, i32* %12
%13 = lshr i32 %1, 24
%14 = getelementptr inbounds i8, i8* %0, i64 12
%15 = bitcast i8* %14 to i32*
store i32 %13, i32* %15
ret void
}
void ptrace_sandbox_permit_sendfile(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

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

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_sendfile(%struct.pt_sandbox* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int);
int main() {
  printf("%d ", sum(55));
  printf("%d ", sum(45));
  printf("%d ", sum(50));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x37,%edi
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2d,%edi
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x32,%edi
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x37,%edi
call   1040 <sum@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2d,%edi
call   1040 <sum@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x32,%edi
call   1040 <sum@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = tail call i32 @sum(i32 55)
%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 @sum(i32 45)
%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 @sum(i32 50)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(long);
void outd2(long n) {
  if (n > 9) {
    outd2(n / 10);
    n %= 10;
  }
  outbyte('0' + n);
}


x86 assembly (clang, -O0):
<outd2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x9,-0x8(%rbp)
jle    115f <outd2+0x3f>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
call   1030 <outd2@plt>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x30,%rdi
call   1040 <outbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outd2>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
cmp    $0xa,%rdi
jl     1156 <outd2+0x36>
movabs $0xcccccccccccccccd,%rcx
cc cc cc
mov    %rbx,%rax
mul    %rcx
mov    %rdx,%r14
shr    $0x3,%r14
mov    %r14,%rdi
call   1030 <outd2@plt>
add    %r14,%r14
lea    (%r14,%r14,4),%rax
sub    %rax,%rbx
add    $0x30,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <outbyte@plt>

LLVM IR (-O0):
define void @outd2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sgt i64 %3, 9
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sdiv i64 %6, 10
%8 = load i64, i64* %2
%9 = srem i64 %8, 10
store i64 %9, i64* %2
br label %10
10: ; preds = %5, %1
%11 = load i64, i64* %2
%12 = add nsw i64 48, %11
%13 = call i32 @outbyte(i64 %12)
ret void
}

LLVM IR (-O2):
define void @outd2(i64 %0) {
%2 = icmp sgt i64 %0, 9
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = udiv i64 %0, 10
tail call void @outd2(i64 %4)
%5 = urem i64 %0, 10
br label %6
6: ; preds = %3, %1
%7 = phi i64 [ %5, %3 ], [ %0, %1 ]
%8 = add nsw i64 %7, 48
%9 = tail call i32 @outbyte(i64 %8)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
float rand();
float frand(void) {
  return (rand() + rand() / (float)(RAND_MAX + 1.0)) / (float)(RAND_MAX + 1.0);
}


x86 assembly (clang, -O0):
<frand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
mov    0x2eae(%rip),%rax
cvtsi2sdq (%rax),%xmm2
movsd  0xeb9(%rip),%xmm3
addsd  %xmm3,%xmm2
cvtsd2ss %xmm2,%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
mov    0x2e8a(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xe95(%rip),%xmm2
addsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ebc(%rip),%rax
cvtsi2sdq (%rax),%xmm1
addsd  0xec7(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
divss  %xmm1,%xmm0
addss  0x4(%rsp),%xmm0
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @frand() {
%1 = call float (...) @rand()
%2 = call float (...) @rand()
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fadd double %4, 1.000000e+00
%6 = fptrunc double %5 to float
%7 = fdiv float %2, %6
%8 = fadd float %1, %7
%9 = load i64, i64* @RAND_MAX
%10 = sitofp i64 %9 to double
%11 = fadd double %10, 1.000000e+00
%12 = fptrunc double %11 to float
%13 = fdiv float %8, %12
ret float %13
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @frand() {
%1 = tail call float (...) @rand()
%2 = tail call float (...) @rand()
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fadd double %4, 1.000000e+00
%6 = fptrunc double %5 to float
%7 = fdiv float %2, %6
%8 = fadd float %1, %7
%9 = fdiv float %8, %6
ret float %9
}
/* Variables and functions */
double abs(double value) {
  if (value >= 0.0)
    return value;
  else
    return (0.0 - value);
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112a <abs+0x2a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <abs+0x37>
xorps  %xmm0,%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
subsd  %xmm0,%xmm2
cmpnlesd %xmm0,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @abs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load double, double* %3
store double %7, double* %2
br label %11
8: ; preds = %1
%9 = load double, double* %3
%10 = fsub double 0.000000e+00, %9
store double %10, double* %2
br label %11
11: ; preds = %8, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @abs(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = fsub double 0.000000e+00, %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
int remove(const char *filename) {}


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

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

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

LLVM IR (-O2):
define i32 @remove(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
void *compare_ushort_context(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @compare_ushort_context() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @compare_ushort_context() {
ret i8* null
}
int add_stuff(int stdlib, int foreign, int heap) {
  return stdlib + foreign + heap;
}


x86 assembly (clang, -O0):
<add_stuff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_stuff>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @add_stuff(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* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @add_stuff(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ func_11(int, char *, unsigned long);
void func_10(int a, char *b, unsigned long c) { func_11(a, b, c); }


x86 assembly (clang, -O0):
<func_10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <func_11@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_10>:
jmp    1030 <func_11@plt>

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

LLVM IR (-O2):
define void @func_10(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @func_11(i32 %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *,
                           char const *, char const *);
int usage(FILE *pOut, const char *argv0) {
  fprintf(pOut,
          "usage: %s [-l=c] -o <output> -t <target> [-f] [-s] < - | <filename> "
          "| -e <cmdline> >\n"
          "   or: %s --help\n"
          "   or: %s --version\n",
          argv0, argv0, argv0);
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rsi,%rcx
lea    0xee5(%rip),%rsi
mov    %rcx,%rdx
mov    %rcx,%r8
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [123 x i8] c"usage: %s [-l=c] -o <output> -t <target> [-f] [-s] < - | <filename> | -e <cmdline> >\0A or: %s --help\0A or: %s --version\0A\00"
define i32 @usage(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([123 x i8], [123 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7, i8* %8)
ret i32 1
}

LLVM IR (-O2):
@.str = [123 x i8] c"usage: %s [-l=c] -o <output> -t <target> [-f] [-s] < - | <filename> | -e <cmdline> >\0A or: %s --help\0A or: %s --version\0A\00"
define i32 @usage(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([123 x i8], [123 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %1, i8* %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__18__IO__makeOutput();
void LedsP__Led0__makeOutput(void) {
  HplAtm128GeneralIOPinP__18__IO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @LedsP__Led0__makeOutput() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__18__IO__makeOutput()
ret void
}
void hstoba(unsigned char *dest, unsigned short src) {
  dest[0] = src % 0x100;
  dest[1] = src / 0x100;
}


x86 assembly (clang, -O0):
<hstoba>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<hstoba>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @hstoba(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = srem i32 %6, 256
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = sdiv i32 %12, 256
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @hstoba(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
store i8 %3, i8* %0
%4 = lshr i16 %1, 8
%5 = trunc i16 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
int ft_strncmp(char *s1, char *s2, unsigned int n) {
  unsigned int i;
  int cmp;
  cmp = 0;
  i = 0;
  while (i <= n) {
    cmp += s2[i] - s1[i];
    i++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_strncmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
ja     1155 <ft_strncmp+0x55>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%edx
movsbl (%rcx,%rdx,1),%ecx
sub    %ecx,%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111d <ft_strncmp+0x1d>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strncmp>:
lea    0x1(%rdx),%eax
ret

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

LLVM IR (-O2):
define i32 @ft_strncmp(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = add nuw i32 %2, 1
ret i32 %4
}
const char *recall_prompt(int oid) {
  (void)oid;
  return ", 'r' to recall";
}


x86 assembly (clang, -O0):
<recall_prompt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c", 'r' to recall\00"
define i8* @recall_prompt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [16 x i8] c", 'r' to recall\00"
define i8* @recall_prompt(i32 %0) {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
int mod(int i, int j) { return (i %= j) >= 0 ? i : j < 0 ? i - j : i + j; }


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
cmp    $0x0,%edx
jl     112a <mod+0x2a>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1151 <mod+0x51>
cmpl   $0x0,-0x8(%rbp)
jge    1142 <mod+0x42>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114b <mod+0x4b>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
test   %edx,%edx
js     110c <mod+0xc>
ret
test   %esi,%esi
js     1113 <mod+0x13>
add    %esi,%eax
ret
sub    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp sgt i32 %3, -1
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = icmp slt i32 %1, 0
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = sub nsw i32 %3, %1
br label %11
9: ; preds = %5
%10 = add nsw i32 %3, %1
br label %11
11: ; preds = %2, %7, %9
%12 = phi i32 [ %8, %7 ], [ %10, %9 ], [ %3, %2 ]
ret i32 %12
}
/* Variables and functions */
int _pb_print_bits(long *, int);
int _pb_print_bits_l(long value) {
  return _pb_print_bits(&value, sizeof(long));
}


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

x86 assembly (clang, -O2):
<_pb_print_bits_l>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <_pb_print_bits@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_pb_print_bits_l(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @_pb_print_bits(i64* %2, i32 8)
ret i32 %3
}

LLVM IR (-O2):
define i32 @_pb_print_bits_l(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @_pb_print_bits(i64* %2, i32 8)
ret i32 %3
}
char *BN_GetVersion(void) { return "1.6.4-beirdobot"; }


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"1.6.4-beirdobot\00"
define i8* @BN_GetVersion() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
int test_imm_E5uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xE5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E5uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0xe5,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_E5uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 983547510784
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int mvupwind(int, int);
mvdnwind(int f, int n) { return (mvupwind(f, -n)); }


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

x86 assembly (clang, -O2):
<mvdnwind>:
neg    %esi
jmp    1030 <mvupwind@plt>

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

LLVM IR (-O2):
define i32 @mvdnwind(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %1
%4 = tail call i32 @mvupwind(i32 %0, i32 %3)
ret i32 %4
}
/* Type definitions */
struct buff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ btcmsg_craft_msgheader(struct buff **, char *,
                                          struct buff *);
int /*<<< orphan*/ btcmsg_prepare_version(struct buff *);
struct buff *buff_alloc();
int /*<<< orphan*/ buff_free(struct buff *);
int btcmsg_craft_version(struct buff **bufOut) {
  struct buff *buf;
  buf = buff_alloc();
  btcmsg_prepare_version(buf);
  btcmsg_craft_msgheader(bufOut, "version", buf);
  buff_free(buf);
  return 0;
}


x86 assembly (clang, -O0):
<btcmsg_craft_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <buff_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <btcmsg_prepare_version@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe91(%rip),%rsi
call   1030 <btcmsg_craft_msgheader@plt>
mov    -0x10(%rbp),%rdi
call   1060 <buff_free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btcmsg_craft_version>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <buff_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <btcmsg_prepare_version@plt>
lea    0xea0(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1030 <btcmsg_craft_msgheader@plt>
mov    %rbx,%rdi
call   1060 <buff_free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.buff = type { i32 }
@.str = [8 x i8] c"version\00"
define i32 @btcmsg_craft_version(%struct.buff** %0) {
%2 = alloca %struct.buff**
%3 = alloca %struct.buff*
store %struct.buff** %0, %struct.buff*** %2
%4 = call %struct.buff* (...) @buff_alloc()
store %struct.buff* %4, %struct.buff** %3
%5 = load %struct.buff*, %struct.buff** %3
%6 = call i32 @btcmsg_prepare_version(%struct.buff* %5)
%7 = load %struct.buff**, %struct.buff*** %2
%8 = load %struct.buff*, %struct.buff** %3
%9 = call i32 @btcmsg_craft_msgheader(%struct.buff** %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %struct.buff* %8)
%10 = load %struct.buff*, %struct.buff** %3
%11 = call i32 @buff_free(%struct.buff* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.buff = type { i32 }
@.str = [8 x i8] c"version\00"
define i32 @btcmsg_craft_version(%struct.buff** %0) {
%2 = tail call %struct.buff* (...) @buff_alloc()
%3 = tail call i32 @btcmsg_prepare_version(%struct.buff* %2)
%4 = tail call i32 @btcmsg_craft_msgheader(%struct.buff** %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %struct.buff* %2)
%5 = tail call i32 @buff_free(%struct.buff* %2)
ret i32 0
}
/* Variables and functions */
void *malloc(int);
void *my_malloc(int s) { return malloc(s); }


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

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

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

LLVM IR (-O2):
define noalias i8* @my_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
int HelpItem58(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem58() {
ret i32 0
}
void func2(x, y) int x, y;
{ sizeof(x); }


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

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

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

LLVM IR (-O2):
define void @func2(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Delay_ms(int);
void Delay2s() { Delay_ms(2000); }


x86 assembly (clang, -O0):
<Delay2s>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7d0,%edi
call   1030 <Delay_ms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay2s>:
mov    $0x7d0,%edi
jmp    1030 <Delay_ms@plt>

LLVM IR (-O0):
define void @Delay2s() {
%1 = call i32 @Delay_ms(i32 2000)
ret void
}

LLVM IR (-O2):
define void @Delay2s() {
%1 = tail call i32 @Delay_ms(i32 2000)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t minutes_diff(uint16_t now, uint16_t prev) {
  if (now >= prev)
    return now - prev;
  return 65535 - prev + now;
}


x86 assembly (clang, -O0):
<minutes_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1124 <minutes_diff+0x24>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <minutes_diff+0x32>
mov    $0xffff,%eax
sub    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minutes_diff>:
mov    %edi,%eax
sub    %esi,%eax
add    $0xffff,%eax
sub    %esi,%edi
cmovge %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @minutes_diff(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 65535, i32 0
%5 = sub i32 %0, %1
%6 = add i32 %5, %4
ret i32 %6
}
int if_out_loop(int t) {
  int p = 10;
  int j = t + 10;
  if (j < 2) {
    p++;
  } else {
    p = 3;
    for (int k = 0; k < 100; k++) {
      int m = 0;
    }
  }
  return p;
}


x86 assembly (clang, -O0):
<if_out_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    112f <if_out_loop+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1161 <if_out_loop+0x61>
movl   $0x3,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
jge    115c <if_out_loop+0x5c>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <if_out_loop+0x3d>
jmp    1161 <if_out_loop+0x61>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_out_loop>:
xor    %eax,%eax
cmp    $0xfffffff8,%edi
setl   %al
lea    0x3(,%rax,8),%eax
ret

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

LLVM IR (-O2):
define i32 @if_out_loop(i32 %0) {
%2 = icmp slt i32 %0, -8
%3 = select i1 %2, i32 11, i32 3
ret i32 %3
}
void finalize_renderer(struct renderer *renderer) {}


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

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

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

LLVM IR (-O2):
%struct.renderer = type opaque
define void @finalize_renderer(%struct.renderer* nocapture %0) {
ret void
}
/* Variables and functions */
int gmx_fio_open(char *, char *);
int open_trn(char *fn, char *mode) { return gmx_fio_open(fn, mode); }


x86 assembly (clang, -O0):
<open_trn>:
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   1030 <gmx_fio_open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_trn>:
jmp    1030 <gmx_fio_open@plt>

LLVM IR (-O0):
define i32 @open_trn(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 = load i8*, i8** %4
%7 = call i32 @gmx_fio_open(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @open_trn(i8* %0, i8* %1) {
%3 = tail call i32 @gmx_fio_open(i8* %0, i8* %1)
ret i32 %3
}
void example_NCC__typ_generic_arity(struct module *mod) {}


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

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

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

LLVM IR (-O2):
%struct.module = type opaque
define void @example_NCC__typ_generic_arity(%struct.module* nocapture %0) {
ret void
}
int test(t)
int t;
{ return t + 1; }


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

x86 assembly (clang, -O2):
<test>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int detect();
int /*<<< orphan*/ printf(char *);
void get_libname(void) {
  int d = detect();
  switch (d) {
  case 1:
    printf("armv8\n");
    break;
  }
}


x86 assembly (clang, -O0):
<get_libname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <detect@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
jne    114f <get_libname+0x2f>
jmp    1143 <get_libname+0x23>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_libname>:
push   %rax
xor    %eax,%eax
call   1040 <detect@plt>
cmp    $0x1,%eax
jne    113a <get_libname+0x1a>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"armv8\0A\00"
define void @get_libname() {
%1 = alloca i32
%2 = call i32 (...) @detect()
store i32 %2, i32* %1
%3 = load i32, i32* %1
switch i32 %3, label %6 [
i32 1, label %4
]
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %0, %4
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"armv8\00"
define void @get_libname() {
%1 = tail call i32 (...) @detect()
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
ret void
}
void uart_putc(int c) {
  *(volatile unsigned int *)((void *)((char *)(0x04000040 << 2) + (0 << 2))) =
      c;
}


x86 assembly (clang, -O0):
<uart_putc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x10000100,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_putc>:
mov    %edi,0x10000100
ret

LLVM IR (-O0):
define void @uart_putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 268435712 to i32*)
ret void
}

LLVM IR (-O2):
define void @uart_putc(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 268435712 to i32*)
ret void
}
/* Variables and functions */
int toupper(char);
int EquationParse__ConvertHexDigitToNumber(char ch) {
  int Number;
  Number = toupper(ch) - '0';
  if (Number >= 10) {
    Number -= ('A' - '0' - 10);
  }
  return Number;
}


x86 assembly (clang, -O0):
<EquationParse__ConvertHexDigitToNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jl     1140 <EquationParse__ConvertHexDigitToNumber+0x30>
mov    -0x8(%rbp),%eax
sub    $0x7,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EquationParse__ConvertHexDigitToNumber>:
push   %rax
call   1030 <toupper@plt>
lea    -0x30(%rax),%edx
lea    -0x37(%rax),%ecx
cmp    $0x3a,%eax
cmovl  %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @EquationParse__ConvertHexDigitToNumber(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i32 @toupper(i8 signext %4)
%6 = sub nsw i32 %5, 48
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 10
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 7
store i32 %11, i32* %3
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @EquationParse__ConvertHexDigitToNumber(i8 signext %0) {
%2 = tail call i32 @toupper(i8 signext %0)
%3 = icmp sgt i32 %2, 57
%4 = select i1 %3, i32 -55, i32 -48
%5 = add nsw i32 %4, %2
ret i32 %5
}
int test_imm_2Buint16_reg(unsigned short val) {
  return ((val) & (-0x2B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Buint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -43
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct ib_hash_map {
  int dummy;
};
struct ib_hash_entry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ib_map_erase(struct ib_hash_map *, struct ib_hash_entry *);
struct ib_hash_entry *ib_map_first(struct ib_hash_map *);
void ib_map_clear(struct ib_hash_map *hm) {
  while (1) {
    struct ib_hash_entry *entry = ib_map_first(hm);
    if (entry == NULL)
      break;
    ib_map_erase(hm, entry);
  }
  ((void)0);
}


x86 assembly (clang, -O0):
<ib_map_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ib_map_first@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1149 <ib_map_clear+0x29>
jmp    115b <ib_map_clear+0x3b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <ib_map_erase@plt>
jmp    112c <ib_map_clear+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ib_map_clear>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <ib_map_first@plt>
test   %rax,%rax
je     114a <ib_map_clear+0x2a>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <ib_map_erase@plt>
mov    %rbx,%rdi
jmp    1130 <ib_map_clear+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.ib_hash_map = type { i32 }
%struct.ib_hash_entry = type { i32 }
define void @ib_map_clear(%struct.ib_hash_map* %0) {
%2 = alloca %struct.ib_hash_map*
%3 = alloca %struct.ib_hash_entry*
store %struct.ib_hash_map* %0, %struct.ib_hash_map** %2
br label %4
4: ; preds = %1, %10
%5 = load %struct.ib_hash_map*, %struct.ib_hash_map** %2
%6 = call %struct.ib_hash_entry* @ib_map_first(%struct.ib_hash_map* %5)
store %struct.ib_hash_entry* %6, %struct.ib_hash_entry** %3
%7 = load %struct.ib_hash_entry*, %struct.ib_hash_entry** %3
%8 = icmp eq %struct.ib_hash_entry* %7, null
br i1 %8, label %9, label %10
9: ; preds = %4
br label %14
10: ; preds = %4
%11 = load %struct.ib_hash_map*, %struct.ib_hash_map** %2
%12 = load %struct.ib_hash_entry*, %struct.ib_hash_entry** %3
%13 = call i32 @ib_map_erase(%struct.ib_hash_map* %11, %struct.ib_hash_entry* %12)
br label %4
14: ; preds = %9
ret void
}

LLVM IR (-O2):
%struct.ib_hash_map = type { i32 }
%struct.ib_hash_entry = type { i32 }
define void @ib_map_clear(%struct.ib_hash_map* %0) {
%2 = tail call %struct.ib_hash_entry* @ib_map_first(%struct.ib_hash_map* %0)
%3 = icmp eq %struct.ib_hash_entry* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi %struct.ib_hash_entry* [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @ib_map_erase(%struct.ib_hash_map* %0, %struct.ib_hash_entry* %5)
%7 = tail call %struct.ib_hash_entry* @ib_map_first(%struct.ib_hash_map* %0)
%8 = icmp eq %struct.ib_hash_entry* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t count_args(const char **args) {
  uint32_t count = 0;
  const char **arg = args;
  while (*arg) {
    count++;
    arg++;
  }
  return count;
}


x86 assembly (clang, -O0):
<count_args>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1143 <count_args+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <count_args+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_args>:
cmpq   $0x0,(%rdi)
je     1120 <count_args+0x20>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpq   $0x0,0x8(%rdi,%rcx,8)
mov    %rax,%rcx
jne    1110 <count_args+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @count_args(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8** [ %8, %4 ], [ %0, %1 ]
%6 = phi i64 [ %7, %4 ], [ 0, %1 ]
%7 = add nuw nsw i64 %6, 1
%8 = getelementptr inbounds i8*, i8** %5, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %7, %4 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ pixel_avg_wxh(unsigned char *, int, unsigned char *, int,
                                 int, int);
void pixel_avg_4x4(unsigned char *pix1, int i_stride_pix1, unsigned char *pix2,
                   int i_stride_pix2) {
  pixel_avg_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 4, 4);
}


x86 assembly (clang, -O0):
<pixel_avg_4x4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x4,%r9d
mov    %r9d,%r8d
call   1030 <pixel_avg_wxh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_4x4>:
mov    $0x4,%r8d
mov    $0x4,%r9d
jmp    1030 <pixel_avg_wxh@plt>

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

LLVM IR (-O2):
define void @pixel_avg_4x4(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @pixel_avg_wxh(i8* %0, i32 %1, i8* %2, i32 %3, i32 4, i32 4)
ret void
}