xunge/DecIR huggingface dataset:
int player_color(int p) {
  switch (p) {
  case 0:
    return 6;
  case 1:
    return 4;
  case 2:
    return 5;
  case 3:
    return 3;
  case 4:
    return 6;
  case 5:
    return 7;
  case 6:
    return 8;
  case 7:
    return 2;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<player_color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x7,%rax
ja     118c <player_color+0x8c>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x6,-0x4(%rbp)
jmp    1193 <player_color+0x93>
movl   $0x4,-0x4(%rbp)
jmp    1193 <player_color+0x93>
movl   $0x5,-0x4(%rbp)
jmp    1193 <player_color+0x93>
movl   $0x3,-0x4(%rbp)
jmp    1193 <player_color+0x93>
movl   $0x6,-0x4(%rbp)
jmp    1193 <player_color+0x93>
movl   $0x7,-0x4(%rbp)
jmp    1193 <player_color+0x93>
movl   $0x8,-0x4(%rbp)
jmp    1193 <player_color+0x93>
movl   $0x2,-0x4(%rbp)
jmp    1193 <player_color+0x93>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<player_color>:
mov    $0xffffffff,%eax
cmp    $0x7,%edi
ja     1117 <player_color+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @player_color(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %13 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
]
5: ; preds = %1
store i32 6, i32* %2
br label %14
6: ; preds = %1
store i32 4, i32* %2
br label %14
7: ; preds = %1
store i32 5, i32* %2
br label %14
8: ; preds = %1
store i32 3, i32* %2
br label %14
9: ; preds = %1
store i32 6, i32* %2
br label %14
10: ; preds = %1
store i32 7, i32* %2
br label %14
11: ; preds = %1
store i32 8, i32* %2
br label %14
12: ; preds = %1
store i32 2, i32* %2
br label %14
13: ; preds = %1
store i32 -1, i32* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6, %5
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@switch.table.player_color = [8 x i32] [i32 6, i32 4, i32 5, i32 3, i32 6, i32 7, i32 8, i32 2]
define i32 @player_color(i32 %0) {
%2 = icmp ult i32 %0, 8
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.player_color, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *thread(void *vargp) { exit(42); }


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2a,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<thread>:
push   %rax
mov    $0x2a,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i8* @thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @exit(i32 42)
unreachable
}

LLVM IR (-O2):
define noalias i8* @thread(i8* nocapture readnone %0) {
%2 = tail call i32 @exit(i32 42)
unreachable
}
/* Variables and functions */
char *strerror(int);
char *getErrString(int err) {
  char *str;
  str = strerror(err);
  if (str == NULL)
    str = "unknown error";
  return str;
}


x86 assembly (clang, -O0):
<getErrString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <strerror@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113d <getErrString+0x2d>
lea    0xec7(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getErrString>:
push   %rax
call   1030 <strerror@plt>
test   %rax,%rax
lea    0xee0(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"unknown error\00"
define i8* @getErrString(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2
ret i8* %4
}
/* Type definitions */
struct btf_type {
  int dummy;
};

/* Variables and functions */
scalar_t__ BTF_KIND_FUNC;
scalar_t__ btf_kind(struct btf_type const *);
bool btf_is_func(const struct btf_type *t) {
  return btf_kind(t) == BTF_KIND_FUNC;
}


x86 assembly (clang, -O0):
<btf_is_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <btf_kind@plt>
mov    0x2ebc(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btf_is_func>:
push   %rax
call   1030 <btf_kind@plt>
mov    0x2ecb(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.btf_type = type { i32 }
@BTF_KIND_FUNC = global i64 0
define i32 @btf_is_func(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
store %struct.btf_type* %0, %struct.btf_type** %2
%3 = load %struct.btf_type*, %struct.btf_type** %2
%4 = call i64 @btf_kind(%struct.btf_type* %3)
%5 = load i64, i64* @BTF_KIND_FUNC
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.btf_type = type { i32 }
@BTF_KIND_FUNC = global i64 0
define i32 @btf_is_func(%struct.btf_type* %0) {
%2 = tail call i64 @btf_kind(%struct.btf_type* %0)
%3 = load i64, i64* @BTF_KIND_FUNC
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
unsigned long CANRegRead(unsigned long);
int /*<<< orphan*/ CANRegWrite(unsigned long, unsigned long);
void CANIntDisable(unsigned long ulBase, unsigned long ulIntFlags) {
  ;
  ;
  CANRegWrite(ulBase + 0x00000000,
              CANRegRead(ulBase + 0x00000000) & ~(ulIntFlags));
}


x86 assembly (clang, -O0):
<CANIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x0,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x0,%rdi
call   1040 <CANRegRead@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
mov    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    %rax,%rsi
call   1030 <CANRegWrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANIntDisable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <CANRegRead@plt>
not    %rbx
and    %rax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <CANRegWrite@plt>

LLVM IR (-O0):
define void @CANIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 0
%7 = load i64, i64* %3
%8 = add i64 %7, 0
%9 = call i64 @CANRegRead(i64 %8)
%10 = load i64, i64* %4
%11 = xor i64 %10, -1
%12 = and i64 %9, %11
%13 = call i32 @CANRegWrite(i64 %6, i64 %12)
ret void
}

LLVM IR (-O2):
define void @CANIntDisable(i64 %0, i64 %1) {
%3 = tail call i64 @CANRegRead(i64 %0)
%4 = xor i64 %1, -1
%5 = and i64 %3, %4
%6 = tail call i32 @CANRegWrite(i64 %0, i64 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int /*<<< orphan*/ HibernateWriteComplete();
void HibernateClockConfig(unsigned long ulConfig) {
  unsigned long ulHIBCtl;
  DEBUG_ASSERT((ulConfig & (0x00060000 | 0x00040000 | 0x00010000)) == 0);
  ulHIBCtl = (*((volatile unsigned long *)(0x400FC010)));
  ulHIBCtl &= ~(0x00060000 | 0x00040000 | 0x00010000);
  ulHIBCtl |= ulConfig & (0x00060000 | 0x00040000 | 0x00010000);
  (*((volatile unsigned long *)(0x400FC010))) = ulHIBCtl;
  HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateClockConfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x70000,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    $0x400fc010,%eax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xfffffffffff8ffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0x70000,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateClockConfig>:
push   %rbx
mov    %rdi,%rbx
and    $0x70000,%ebx
xor    %edi,%edi
test   %rbx,%rbx
sete   %dil
call   1040 <DEBUG_ASSERT@plt>
mov    $0xfffffffffff8ffff,%rax
and    0x400fc010,%rax
40
or     %rbx,%rax
mov    %rax,0x400fc010
40
xor    %eax,%eax
pop    %rbx
jmp    1030 <HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateClockConfig(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = and i64 %4, 458752
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = and i64 %10, -458753
store i64 %11, i64* %3
%12 = load i64, i64* %2
%13 = and i64 %12, 458752
%14 = load i64, i64* %3
%15 = or i64 %14, %13
store i64 %15, i64* %3
%16 = load i64, i64* %3
store volatile i64 %16, i64* inttoptr (i64 1074774032 to i64*)
%17 = call i32 (...) @HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateClockConfig(i64 %0) {
%2 = and i64 %0, 458752
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%7 = and i64 %6, -458753
%8 = or i64 %7, %2
store volatile i64 %8, i64* inttoptr (i64 1074774032 to i64*)
%9 = tail call i32 (...) @HibernateWriteComplete()
ret void
}
/* Type definitions */
typedef int x;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int x;
  for (x = -16; x < 32; x++) {
    printf("align(%d) = %d\n", x,
           ((x) + ((1 << (2)) - 1)) & (~((1 << (2)) - 1)));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffff0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    1156 <main+0x46>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
add    $0x3,%edx
and    $0xfffffffc,%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xfffffff0,%ebx
lea    0xee0(%rip),%r14
lea    0x3(%rbx),%edx
and    $0xfffffffc,%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"align(%d) = %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -16, %0 ], [ %6, %1 ]
%3 = add nsw i32 %2, 3
%4 = and i32 %3, -4
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
%6 = add nsw i32 %2, 1
%7 = icmp eq i32 %6, 32
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
void d_storesb(unsigned char **ptr, signed char data) { *(*ptr)++ = data; }


x86 assembly (clang, -O0):
<d_storesb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_storesb>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    %sil,(%rax)
ret

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

LLVM IR (-O2):
define void @d_storesb(i8** nocapture %0, i8 signext %1) {
%3 = load i8*, i8** %0
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %4, i8** %0
store i8 %1, i8* %3
ret void
}
void cram_shutdown() { int i; }


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

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

LLVM IR (-O0):
define void @cram_shutdown() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @cram_shutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ partition(int *, int /*<<< orphan*/, unsigned int);
int /*<<< orphan*/ printA(int *, unsigned int);
void sort(int a[], unsigned int size) {
  if (a == 0 || size < 2)
    return;
  printA(a, size);
  partition(a, 0, size - 1);
  printA(a, size);
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <sort+0x24>
cmpl   $0x2,-0xc(%rbp)
jae    1149 <sort+0x29>
jmp    1172 <sort+0x52>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <printA@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <partition@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <printA@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115c <sort+0x3c>
mov    %esi,%r14d
cmp    $0x2,%esi
jb     115c <sort+0x3c>
mov    %rdi,%rbx
mov    %r14d,%esi
call   1040 <printA@plt>
lea    -0x1(%r14),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <partition@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printA@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sort(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 = icmp eq i32* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ult i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %7, %2
br label %22
11: ; preds = %7
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = call i32 @printA(i32* %12, i32 %13)
%15 = load i32*, i32** %3
%16 = load i32, i32* %4
%17 = sub i32 %16, 1
%18 = call i32 @partition(i32* %15, i32 0, i32 %17)
%19 = load i32*, i32** %3
%20 = load i32, i32* %4
%21 = call i32 @printA(i32* %19, i32 %20)
br label %22
22: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1) {
%3 = icmp eq i32* %0, null
%4 = icmp ult i32 %1, 2
%5 = or i1 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = tail call i32 @printA(i32* %0, i32 %1)
%8 = add i32 %1, -1
%9 = tail call i32 @partition(i32* %0, i32 0, i32 %8)
%10 = tail call i32 @printA(i32* %0, i32 %1)
br label %11
11: ; preds = %2, %6
ret void
}
/* Variables and functions */
scalar_t__ strtol(char const *, char const **, int);
int atoi(const char *s) {
  return (int)strtol(s, (const char **)((void *)0), 10);
}


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

x86 assembly (clang, -O2):
<atoi>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtol(i8* %3, i8** null, i32 10)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10)
%3 = trunc i64 %2 to i32
ret i32 %3
}
int descending(int x, int y) { return y > x; }


x86 assembly (clang, -O0):
<descending>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<descending>:
xor    %eax,%eax
cmp    %edi,%esi
setg   %al
ret

LLVM IR (-O0):
define i32 @descending(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 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @descending(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *argv0) {
  fprintf(stderr, "Usage:  %s\n", argv0);
  fprintf(stderr, "\tInteractive mode only for now.\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed8(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"Usage: %s\0A\00"
@.str.1 = [33 x i8] c"\09Interactive mode only for now.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"Usage: %s\0A\00"
@.str.1 = [33 x i8] c"\09Interactive mode only for now.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t rol64(uint64_t word, uint32_t shift) {
  return (word << shift) | (word >> (64 - shift));
}


x86 assembly (clang, -O0):
<rol64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol64>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rol64(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 64, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol64(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ ASN1_TIME;

/* Variables and functions */
int /*<<< orphan*/ *X509_time_adj_ex(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                     long, int /*<<< orphan*/ *);
ASN1_TIME *X509_time_adj(ASN1_TIME *s, long offset_sec, time_t *in_tm) {
  return X509_time_adj_ex(s, 0, offset_sec, in_tm);
}


x86 assembly (clang, -O0):
<X509_time_adj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
call   1030 <X509_time_adj_ex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509_time_adj>:
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <X509_time_adj_ex@plt>

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

LLVM IR (-O2):
define i32* @X509_time_adj(i32* %0, i64 %1, i32* %2) {
%4 = tail call i32* @X509_time_adj_ex(i32* %0, i32 0, i64 %1, i32* %2)
ret i32* %4
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ unix_error(char *);
void Bind(int sockfd, struct sockaddr *my_addr, int addrlen) {
  int rc;
  if ((rc = bind(sockfd, my_addr, addrlen)) < 0)
    unix_error("Bind error");
}


x86 assembly (clang, -O0):
<Bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <bind@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1159 <Bind+0x39>
lea    0xeac(%rip),%rdi
call   1030 <unix_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bind>:
push   %rax
call   1040 <bind@plt>
test   %eax,%eax
js     112c <Bind+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <unix_error@plt>

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

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [11 x i8] c"Bind error\00"
define void @Bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i32 @bind(i32 %0, %struct.sockaddr* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @unix_error(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ entab(char *, char *);
int getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int len;
  char contabs[1000];
  char input[1000];
  while ((len = getline(input, 1000)) > 0) {
    entab(contabs, input);
    printf("%s", contabs);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x7e0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    118a <main+0x5a>
lea    -0x3f0(%rbp),%rdi
lea    -0x7e0(%rbp),%rsi
call   1050 <entab@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x7e0,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jle    1187 <main+0x57>
lea    0x3f0(%rsp),%r14
mov    %rsp,%rbx
lea    0xea1(%rip),%r15
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <entab@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @getline(i8* %4, i32 1000)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %0, %7
%8 = call i32 @entab(i8* %3, i8* %4)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%10 = call i32 @getline(i8* %4, i32 1000)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %0
ret i32 0
}
int getRemainder(int n, int mod) {
  int r = n % mod;
  if (r < 0)
    r = mod + r;
  return r;
}


x86 assembly (clang, -O0):
<getRemainder>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1127 <getRemainder+0x27>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRemainder>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
sar    $0x1f,%eax
and    %esi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @getRemainder(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = add nsw i32 %5, %3
ret i32 %6
}
int test_imm_3Auint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x3A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Auint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 58
%5 = icmp ne i64 %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_3Auint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 58
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ debug_warning(char *);
void component_editor_cursor_get_param(void *handle, unsigned int index,
                                       char *buffer, int buffer_size) {
  if (!handle) {
    debug_warning("[component_editor_cursor_get_param] handle cannot be NULL");
    return;
  }
  debug_warning("[component_editor_cursor_get_param] component_editor_cursor "
                "is an internal component which does not have parameters");
}


x86 assembly (clang, -O0):
<component_editor_cursor_get_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1142 <component_editor_cursor_get_param+0x32>
lea    0xec8(%rip),%rdi
call   1030 <debug_warning@plt>
jmp    114e <component_editor_cursor_get_param+0x3e>
lea    0xef1(%rip),%rdi
call   1030 <debug_warning@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<component_editor_cursor_get_param>:
test   %rdi,%rdi
lea    0xee6(%rip),%rax
lea    0xf19(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <debug_warning@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"[component_editor_cursor_get_param] handle cannot be NULL\00"
@.str.1 = [116 x i8] c"[component_editor_cursor_get_param] component_editor_cursor is an internal component which does not have parameters\00"
define void @component_editor_cursor_get_param(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 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %4
%12 = call i32 @debug_warning(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
br label %15
13: ; preds = %4
%14 = call i32 @debug_warning(i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
ret void
}

LLVM IR (-O2):
@.str = [58 x i8] c"[component_editor_cursor_get_param] handle cannot be NULL\00"
@.str.1 = [116 x i8] c"[component_editor_cursor_get_param] component_editor_cursor is an internal component which does not have parameters\00"
define void @component_editor_cursor_get_param(i8* readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = icmp eq i8* %0, null
%6 = select i1 %5, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str.1, i64 0, i64 0)
%7 = tail call i32 @debug_warning(i8* %6)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int bpf_rand_mask(int);
uint64_t bpf_rand_u16(int shift) { return bpf_rand_mask((0xffffULL)) << shift; }


x86 assembly (clang, -O0):
<bpf_rand_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xffff,%edi
call   1030 <bpf_rand_mask@plt>
mov    -0x4(%rbp),%ecx
shl    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_rand_u16>:
push   %rbx
mov    %edi,%ebx
mov    $0xffff,%edi
call   1030 <bpf_rand_mask@plt>
mov    %ebx,%ecx
shl    %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bpf_rand_u16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @bpf_rand_mask(i32 65535)
%4 = load i32, i32* %2
%5 = shl i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @bpf_rand_u16(i32 %0) {
%2 = tail call i32 @bpf_rand_mask(i32 65535)
%3 = shl i32 %2, %0
ret i32 %3
}
void nano_init(void) {}


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

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

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

LLVM IR (-O2):
define void @nano_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ d7_to_line(unsigned long long, int);
int first_one(int /*<<< orphan*/);
int d7_flip_index(int x) { return first_one(d7_to_line(1ULL << x, x)); }


x86 assembly (clang, -O0):
<d7_flip_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%edi
shl    %cl,%rdi
mov    -0x4(%rbp),%esi
call   1030 <d7_to_line@plt>
mov    %eax,%edi
call   1040 <first_one@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d7_flip_index>:
push   %rax
mov    %edi,%ecx
mov    $0x1,%edi
shl    %cl,%rdi
mov    %ecx,%esi
call   1030 <d7_to_line@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <first_one@plt>

LLVM IR (-O0):
define i32 @d7_flip_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = shl i64 1, %4
%6 = load i32, i32* %2
%7 = call i32 @d7_to_line(i64 %5, i32 %6)
%8 = call i32 @first_one(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @d7_flip_index(i32 %0) {
%2 = zext i32 %0 to i64
%3 = shl nuw i64 1, %2
%4 = tail call i32 @d7_to_line(i64 %3, i32 %0)
%5 = tail call i32 @first_one(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ irc_nick(char *);
int /*<<< orphan*/ irc_user(char *, char *);
void irc_login(char *nick, char *user_name, char *real_name) {
  irc_nick(nick);
  irc_user(user_name, real_name);
}


x86 assembly (clang, -O0):
<irc_login>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <irc_nick@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <irc_user@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_login>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <irc_nick@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <irc_user@plt>

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

LLVM IR (-O2):
define void @irc_login(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @irc_nick(i8* %0)
%5 = tail call i32 @irc_user(i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ main_suite_add_suite();
void main_suite_add_suite_constructor(void) { main_suite_add_suite(); }


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

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

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

LLVM IR (-O2):
define void @main_suite_add_suite_constructor() {
%1 = tail call i32 (...) @main_suite_add_suite()
ret void
}
char *_memset(char *s, char b, unsigned int n) {
  unsigned int i;
  for (i = 0; i < n; i++) {
    s[i] = b;
  }
  return (s);
}


x86 assembly (clang, -O0):
<_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    113f <_memset+0x3f>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <_memset+0x18>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_memset>:
push   %rbx
mov    %rdi,%rbx
test   %edx,%edx
je     1126 <_memset+0x16>
mov    %edx,%edx
movzbl %sil,%esi
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @_memset(i8* returned writeonly %0, i8 signext %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret i8* %0
}
unsigned char transition(unsigned char c, unsigned char old) {
  if (old == 1) {
    if (c == 4 || c == 5) {
      return 1;
    } else {
      return 0;
    }
  } else if (c == 5) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<transition>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x1,%eax
jne    1149 <transition+0x49>
movzbl -0x2(%rbp),%eax
cmp    $0x4,%eax
je     1137 <transition+0x37>
movzbl -0x2(%rbp),%eax
cmp    $0x5,%eax
jne    1140 <transition+0x40>
movb   $0x1,-0x1(%rbp)
jmp    1163 <transition+0x63>
movb   $0x0,-0x1(%rbp)
jmp    1163 <transition+0x63>
movzbl -0x2(%rbp),%eax
cmp    $0x5,%eax
jne    115f <transition+0x5f>
movb   $0x1,-0x1(%rbp)
jmp    1163 <transition+0x63>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<transition>:
mov    %edi,%ecx
and    $0xfe,%cl
xor    %eax,%eax
cmp    $0x4,%cl
sete   %al
xor    %ecx,%ecx
cmp    $0x5,%dil
sete   %cl
cmp    $0x1,%sil
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @transition(i8 zeroext %0, i8 zeroext %1) {
%3 = icmp eq i8 %1, 1
%4 = and i8 %0, -2
%5 = icmp eq i8 %4, 4
%6 = icmp eq i8 %0, 5
%7 = select i1 %3, i1 %5, i1 %6
%8 = zext i1 %7 to i8
ret i8 %8
}
int ti_aroonosc_start(double const *options) { return (int)options[0]; }


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

x86 assembly (clang, -O2):
<ti_aroonosc_start>:
cvttsd2si (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @ti_aroonosc_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
ret i32 %3
}
void cpu_device_reset(int bootloader) {}


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

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

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

LLVM IR (-O2):
define void @cpu_device_reset(i32 %0) {
ret void
}
/* Variables and functions */
unsigned char protocol_dataLength();
unsigned char getReplyDataLength_Protocol() { return protocol_dataLength(); }


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

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

LLVM IR (-O0):
define zeroext i8 @getReplyDataLength_Protocol() {
%1 = call zeroext i8 (...) @protocol_dataLength()
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @getReplyDataLength_Protocol() {
%1 = tail call zeroext i8 (...) @protocol_dataLength()
ret i8 %1
}
int hex_char_to_decimal(int ch) {
  if (ch >= '0' && ch <= '9')
    return ch - '0';
  if (ch >= 'a' && ch <= 'f')
    return ch - 'a' + 10;
  if (ch >= 'A' && ch <= 'F')
    return ch - 'A' + 10;
  return 16;
}


x86 assembly (clang, -O0):
<hex_char_to_decimal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <hex_char_to_decimal+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <hex_char_to_decimal+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hex_char_to_decimal+0x7a>
cmpl   $0x61,-0x8(%rbp)
jl     114e <hex_char_to_decimal+0x4e>
cmpl   $0x66,-0x8(%rbp)
jg     114e <hex_char_to_decimal+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hex_char_to_decimal+0x7a>
cmpl   $0x41,-0x8(%rbp)
jl     1173 <hex_char_to_decimal+0x73>
cmpl   $0x46,-0x8(%rbp)
jg     1173 <hex_char_to_decimal+0x73>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hex_char_to_decimal+0x7a>
movl   $0x10,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_char_to_decimal>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <hex_char_to_decimal+0x27>
lea    -0x61(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <hex_char_to_decimal+0x16>
add    $0xffffffa9,%edi
mov    %edi,%eax
ret
lea    -0x41(%rdi),%eax
add    $0xffffffc9,%edi
cmp    $0x6,%eax
mov    $0x10,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @hex_char_to_decimal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 102
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 97
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %33
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 65
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 70
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 65
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %33
32: ; preds = %25, %22
store i32 16, i32* %2
br label %33
33: ; preds = %32, %28, %18, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @hex_char_to_decimal(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -97
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -87
br label %14
9: ; preds = %4
%10 = add i32 %0, -65
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -55
%13 = select i1 %11, i32 %12, i32 16
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_sdsmean(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_sdsmean(N, x, stride);
  printf("mean: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1040 <stdlib_strided_sdsmean@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_sdsmean@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_sdsmean(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_sdsmean(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
void ARGBToYRow_NEON() {}


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

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

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

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