xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t batman_brdconfig(uint16_t port, void *p) {
  switch (port) {
  case 0x73:
    return 0xff;
  case 0x75:
    return 0xdf;
  }
  return 0;
}


x86 assembly (clang, -O0):
<batman_brdconfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x73,%eax
je     1130 <batman_brdconfig+0x30>
jmp    111f <batman_brdconfig+0x1f>
mov    -0x14(%rbp),%eax
sub    $0x75,%eax
je     113c <batman_brdconfig+0x3c>
jmp    1148 <batman_brdconfig+0x48>
movl   $0xff,-0x4(%rbp)
jmp    114f <batman_brdconfig+0x4f>
movl   $0xdf,-0x4(%rbp)
jmp    114f <batman_brdconfig+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<batman_brdconfig>:
xor    %eax,%eax
cmp    $0x75,%edi
mov    $0xdf,%ecx
cmovne %eax,%ecx
cmp    $0x73,%edi
mov    $0xff,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @batman_brdconfig(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
switch i32 %6, label %9 [
i32 115, label %7
i32 117, label %8
]
7: ; preds = %2
store i32 255, i32* %3
br label %10
8: ; preds = %2
store i32 223, i32* %3
br label %10
9: ; preds = %2
store i32 0, i32* %3
br label %10
10: ; preds = %9, %8, %7
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @batman_brdconfig(i32 %0, i8* nocapture readnone %1) {
%3 = icmp eq i32 %0, 117
%4 = select i1 %3, i32 223, i32 0
%5 = icmp eq i32 %0, 115
%6 = select i1 %5, i32 255, i32 %4
ret i32 %6
}
char decode_hex(char input) {
  static char hex[] = "0123456789ABCDEF";
  int i;
  for (i = 0; i < 16; ++i) {
    if (input == hex[i]) {
      return i;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<decode_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    1154 <decode_hex+0x54>
movsbl -0x2(%rbp),%eax
movslq -0x8(%rbp),%rdx
lea    0x2f06(%rip),%rcx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1141 <decode_hex+0x41>
mov    -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
jmp    1158 <decode_hex+0x58>
jmp    1146 <decode_hex+0x46>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1111 <decode_hex+0x11>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_hex>:
add    $0xcf,%dil
cmp    $0x15,%dil
ja     1119 <decode_hex+0x19>
movsbq %dil,%rax
lea    0xeeb(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@decode_hex.hex = internal global [17 x i8] c"0123456789ABCDEF\00"
define signext i8 @decode_hex(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 0, i32* %4
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 16
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [17 x i8], [17 x i8]* @decode_hex.hex, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %10, %15
br i1 %16, label %17, label %20
17: ; preds = %8
%18 = load i32, i32* %4
%19 = trunc i32 %18 to i8
store i8 %19, i8* %2
br label %25
20: ; preds = %8
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %5
24: ; preds = %5
store i8 0, i8* %2
br label %25
25: ; preds = %24, %17
%26 = load i8, i8* %2
ret i8 %26
}

LLVM IR (-O2):
@switch.table.decode_hex = [22 x i8] c"\01\02\03\04\05\06\07\08\09\00\00\00\00\00\00\00\0A\0B\0C\0D\0E\0F"
define signext i8 @decode_hex(i8 signext %0) {
%2 = add i8 %0, -49
%3 = icmp ult i8 %2, 22
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [22 x i8], [22 x i8]* @switch.table.decode_hex, i64 0, i64 %5
%7 = load i8, i8* %6
br label %8
8: ; preds = %4, %1
%9 = phi i8 [ 0, %1 ], [ %7, %4 ]
ret i8 %9
}
int checkPrime(int num) {
  int ctr;
  if (num > 1) {
    for (ctr = 2; ctr <= num - 1; ctr++) {
      if (num % ctr == 0)
        return 0;
    }
    if (ctr == num)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<checkPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1175 <checkPrime+0x75>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1158 <checkPrime+0x58>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1145 <checkPrime+0x45>
movl   $0x0,-0x4(%rbp)
jmp    117c <checkPrime+0x7c>
jmp    114a <checkPrime+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <checkPrime+0x18>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1170 <checkPrime+0x70>
movl   $0x1,-0x4(%rbp)
jmp    117c <checkPrime+0x7c>
jmp    1175 <checkPrime+0x75>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkPrime>:
xor    %ecx,%ecx
cmp    $0x2,%edi
jl     1125 <checkPrime+0x25>
je     1120 <checkPrime+0x20>
mov    $0x2,%esi
xchg   %ax,%ax
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1125 <checkPrime+0x25>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <checkPrime+0x10>
mov    $0x1,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @checkPrime(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %12
3: ; preds = %1
%4 = icmp eq i32 %0, 2
br i1 %4, label %12, label %5
5: ; preds = %3, %9
%6 = phi i32 [ %10, %9 ], [ 2, %3 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = add nuw nsw i32 %6, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %5
12: ; preds = %9, %5, %1, %3
%13 = phi i32 [ 1, %3 ], [ 0, %1 ], [ 1, %9 ], [ 0, %5 ]
ret i32 %13
}
int rcu_is_cpu_idle(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @rcu_is_cpu_idle() {
ret i32 1
}

LLVM IR (-O2):
define i32 @rcu_is_cpu_idle() {
ret i32 1
}
/* Variables and functions */
void *__builtin___bnd_set_ptr_bounds(void *, int);
void *chkp_test(void *p) { return __builtin___bnd_set_ptr_bounds(p, 10); }


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

x86 assembly (clang, -O2):
<chkp_test>:
mov    $0xa,%esi
jmp    1030 <__builtin___bnd_set_ptr_bounds@plt>

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

LLVM IR (-O2):
define i8* @chkp_test(i8* %0) {
%2 = tail call i8* @__builtin___bnd_set_ptr_bounds(i8* %0, i32 10)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int main(void) {
  int i = 0;
again:
  i = 1;
  printf("goto again\n");
  sleep(1);
  goto again;
  printf("i = %d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [12 x i8] c"goto again\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %3, %0
store i32 1, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
@str = [11 x i8] c"goto again\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fpu_interrupt_handler() {
  printf("fpu_handler:\tyou should see this message only once.\n");
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"fpu_handler:\09you should see this message only once.\0A\00"
define void @fpu_interrupt_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [52 x i8] c"fpu_handler:\09you should see this message only once.\00"
define void @fpu_interrupt_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret void
}
short test_170_8(short *mem) {
  short expected = 1;
  short desired = 5;
  return __atomic_compare_exchange(mem + 0, &expected, &desired, 0, 4, 0);
}


x86 assembly (clang, -O0):
<test_170_8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movw   $0x1,-0xa(%rbp)
movw   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xa(%rbp),%ax
mov    -0xc(%rbp),%dx
lock cmpxchg %dx,(%rcx)
mov    %ax,%cx
sete   %al
mov    %al,-0x11(%rbp)
mov    %cx,-0x10(%rbp)
test   $0x1,%al
jne    1142 <test_170_8+0x42>
mov    -0x10(%rbp),%ax
mov    %ax,-0xa(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_170_8>:
mov    $0x5,%dx
xor    %ecx,%ecx
mov    $0x1,%ax
lock cmpxchg %dx,(%rdi)
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @test_170_8(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
%5 = alloca i8
store i16* %0, i16** %2
store i16 1, i16* %3
store i16 5, i16* %4
%6 = load i16*, i16** %2
%7 = getelementptr inbounds i16, i16* %6, i64 0
%8 = load i16, i16* %3
%9 = load i16, i16* %4
%10 = cmpxchg i16* %7, i16 %8, i16 %9 acq_rel monotonic
%11 = extractvalue { i16, i1 } %10, 0
%12 = extractvalue { i16, i1 } %10, 1
br i1 %12, label %14, label %13
13: ; preds = %1
store i16 %11, i16* %3
br label %14
14: ; preds = %13, %1
%15 = zext i1 %12 to i8
store i8 %15, i8* %5
%16 = load i8, i8* %5
%17 = trunc i8 %16 to i1
%18 = zext i1 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define signext i16 @test_170_8(i16* nocapture %0) {
%2 = cmpxchg i16* %0, i16 1, i16 5 acq_rel monotonic
%3 = extractvalue { i16, i1 } %2, 1
%4 = zext i1 %3 to i16
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ beolv(char *, int *);
int /*<<< orphan*/ getLevel();
int /*<<< orphan*/ kiir(char *, int /*<<< orphan*/);
int /*<<< orphan*/ setLevel(int);
int changelevel() {
  int l;
  kiir("Adj meg egy szamot 1-100-ig(Jelenleg %d): ", getLevel());
  beolv("%d", &l);
  if (l > 0 && l <= 100) {
    setLevel(l);
  }
  return 1;
}


x86 assembly (clang, -O0):
<changelevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getLevel@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <kiir@plt>
lea    0xec7(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1060 <beolv@plt>
cmpl   $0x0,-0x4(%rbp)
jle    1189 <changelevel+0x49>
cmpl   $0x64,-0x4(%rbp)
jg     1189 <changelevel+0x49>
mov    -0x4(%rbp),%edi
call   1040 <setLevel@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<changelevel>:
push   %rax
xor    %eax,%eax
call   1050 <getLevel@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <kiir@plt>
lea    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <beolv@plt>
mov    0x4(%rsp),%edi
lea    -0x1(%rdi),%eax
cmp    $0x63,%eax
ja     1178 <changelevel+0x38>
call   1040 <setLevel@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Adj meg egy szamot 1-100-ig(Jelenleg %d): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @changelevel() {
%1 = alloca i32
%2 = call i32 (...) @getLevel()
%3 = call i32 @kiir(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @beolv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = load i32, i32* %1
%9 = icmp sle i32 %8, 100
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %1
%12 = call i32 @setLevel(i32 %11)
br label %13
13: ; preds = %10, %7, %0
ret i32 1
}

LLVM IR (-O2):
@.str = [43 x i8] c"Adj meg egy szamot 1-100-ig(Jelenleg %d): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @changelevel() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @getLevel()
%4 = tail call i32 @kiir(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @beolv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = add i32 %6, -1
%8 = icmp ult i32 %7, 100
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @setLevel(i32 %6)
br label %11
11: ; preds = %9, %0
ret i32 1
}
RCU_DEF_INIT_FUNC(user_f0_init, param) {}


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

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

LLVM IR (-O0):
define i32 @RCU_DEF_INIT_FUNC(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @RCU_DEF_INIT_FUNC(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
bool bit_is_pow2(unsigned int n) { return ((n > 1) && ((n - 1) & n) == 0); }


x86 assembly (clang, -O0):
<bit_is_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jbe    1128 <bit_is_pow2+0x28>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_is_pow2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     1111 <bit_is_pow2+0x11>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @bit_is_pow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 1
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub i32 %6, 1
%8 = load i32, i32* %2
%9 = and i32 %7, %8
%10 = icmp eq i32 %9, 0
br label %11
11: ; preds = %5, %1
%12 = phi i1 [ false, %1 ], [ %10, %5 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @bit_is_pow2(i32 %0) {
%2 = icmp ugt i32 %0, 1
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
char *strrchr(char *, char);
char *skipPrefix(char *p) {
  char *q;
  if ((q = strrchr(p, '/')) != NULL) {
    return q + 1;
  } else {
    return p;
  }
}


x86 assembly (clang, -O0):
<skipPrefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1149 <skipPrefix+0x39>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1151 <skipPrefix+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipPrefix>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipPrefix(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
int f_bun_mm2(float *a1, float *a2) {
  return !(__builtin_isunordered(*a1, *a2));
}


x86 assembly (clang, -O0):
<f_bun_mm2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bun_mm2>:
movss  (%rdi),%xmm0
xor    %eax,%eax
ucomiss (%rsi),%xmm0
setnp  %al
ret

LLVM IR (-O0):
define i32 @f_bun_mm2(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float*, float** %4
%8 = load float, float* %7
%9 = fcmp uno float %6, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @f_bun_mm2(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fcmp ord float %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int ProcTimeMinus(const int a, const int b) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ProcTimeMinus(i32 %0, i32 %1) {
ret i32 0
}
disable_interrupts(void) { __asm__ volatile("cli"); }


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

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

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

LLVM IR (-O2):
define i32 @disable_interrupts() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
gret() { ol("rsb"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"rsb\00"
define i32 @gret() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ scan(char *, char const *);
void main() {
  char *text = "STRLEN(3)     Linux Programmer's  John Smith fuck you  "
               "ManualRLEN(3)NAME  Jame sime  i John Smith  asdf    strlen - "
               "calculate text the length of ";
  const char *name = "J* Smi??";
  scan(text, name);
}


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
lea    0xf74(%rip),%rsi
jmp    1030 <scan@plt>

LLVM IR (-O0):
@.str = [146 x i8] c"STRLEN(3) Linux Programmer's John Smith fuck you ManualRLEN(3)NAME Jame sime i John Smith asdf strlen - calculate text the length of \00"
@.str.1 = [9 x i8] c"J* Smi??\00"
define void @main() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @scan(i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [146 x i8] c"STRLEN(3) Linux Programmer's John Smith fuck you ManualRLEN(3)NAME Jame sime i John Smith asdf strlen - calculate text the length of \00"
@.str.1 = [9 x i8] c"J* Smi??\00"
define void @main() {
%1 = tail call i32 @scan(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int bitcnt(unsigned int a) {
  int count = 0;
  int loop = 0;
  while (a) {
    loop++;
    count += (a & 0x01u);
    a >>= 1;
  }
  printf("%s:   Loop count: %d\n", __FUNCTION__, loop);
  return count;
}


x86 assembly (clang, -O0):
<bitcnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1156 <bitcnt+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1129 <bitcnt+0x19>
mov    -0xc(%rbp),%edx
lea    0xea0(%rip),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcnt>:
push   %rbx
test   %edi,%edi
je     1135 <bitcnt+0x25>
xor    %edx,%edx
xor    %ebx,%ebx
mov    %edi,%eax
nopl   0x0(%rax,%rax,1)
add    $0x1,%edx
mov    %edi,%ecx
and    $0x1,%ecx
add    %ecx,%ebx
shr    %eax
cmp    $0x1,%edi
mov    %eax,%edi
ja     1120 <bitcnt+0x10>
jmp    1139 <bitcnt+0x29>
xor    %ebx,%ebx
xor    %edx,%edx
lea    0xec0(%rip),%rdi
lea    0xecf(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"%s: Loop count: %d\0A\00"
@__FUNCTION__.bitcnt = [7 x i8] c"bitcnt\00"
define i32 @bitcnt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %8, %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = and i32 %11, 1
%13 = load i32, i32* %3
%14 = add i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %2
%16 = lshr i32 %15, 1
store i32 %16, i32* %2
br label %5
17: ; preds = %5
%18 = load i32, i32* %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.bitcnt, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [22 x i8] c"%s: Loop count: %d\0A\00"
@__FUNCTION__.bitcnt = [7 x i8] c"bitcnt\00"
define i32 @bitcnt(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = phi i32 [ %10, %3 ], [ %0, %1 ]
%7 = add nuw nsw i32 %4, 1
%8 = and i32 %6, 1
%9 = add i32 %5, %8
%10 = lshr i32 %6, 1
%11 = icmp ult i32 %6, 2
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %9, %3 ]
%14 = phi i32 [ 0, %1 ], [ %7, %3 ]
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.bitcnt, i64 0, i64 0), i32 %14)
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ BlinkC__Leds__led0Toggle();
void BlinkC__Timer0__fired(void) { BlinkC__Leds__led0Toggle(); }


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

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

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

LLVM IR (-O2):
define void @BlinkC__Timer0__fired() {
%1 = tail call i32 (...) @BlinkC__Leds__led0Toggle()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ test_in_place_add();
int /*<<< orphan*/ test_in_place_normalize();
int main(int argc, char *argv[]) {
  test_in_place_add();
  test_in_place_normalize();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test_in_place_add@plt>
mov    $0x0,%al
call   1030 <test_in_place_normalize@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_in_place_add@plt>
xor    %eax,%eax
call   1030 <test_in_place_normalize@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_in_place_add()
%7 = call i32 (...) @test_in_place_normalize()
%8 = load i32, i32* @EXIT_SUCCESS
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_in_place_add()
%4 = tail call i32 (...) @test_in_place_normalize()
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
}
unsigned short *wnn_Strcpy(s1, s2)
register unsigned short *s1;
register unsigned short *s2;
{
  register unsigned short *d;
  for (d = s1; (*d++ = *s2++) != 0;)
    ;
  return s1;
}


x86 assembly (clang, -O0):
<wnn_Strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%ax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x2,%rdx
mov    %rdx,-0x18(%rbp)
mov    %ax,(%rcx)
movzwl %ax,%eax
cmp    $0x0,%eax
je     1149 <wnn_Strcpy+0x49>
jmp    1114 <wnn_Strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wnn_Strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzwl (%rsi,%rcx,1),%edx
mov    %dx,(%rax,%rcx,1)
add    $0x2,%rcx
test   %dx,%dx
jne    1110 <wnn_Strcpy+0x10>
ret

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

LLVM IR (-O2):
define i16* @wnn_Strcpy(i16* returned writeonly %0, i16* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i16* [ %1, %2 ], [ %6, %3 ]
%5 = phi i16* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i16, i16* %4, i64 1
%7 = load i16, i16* %4
%8 = getelementptr inbounds i16, i16* %5, i64 1
store i16 %7, i16* %5
%9 = icmp eq i16 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i16* %0
}
/* Variables and functions */
char const *ERR_getErrorName(size_t);
const char *FSE_getErrorName(size_t code) { return ERR_getErrorName(code); }


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

x86 assembly (clang, -O2):
<FSE_getErrorName>:
jmp    1030 <ERR_getErrorName@plt>

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

LLVM IR (-O2):
define i8* @FSE_getErrorName(i64 %0) {
%2 = tail call i8* @ERR_getErrorName(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ __poet_fail();
int nondet(int, int);
int main(void) {
  int x = nondet(6, 10);
  if (x == 5)
    __poet_fail();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x6,%edi
mov    $0xa,%esi
call   1040 <nondet@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jne    1152 <main+0x32>
mov    $0x0,%al
call   1030 <__poet_fail@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6,%edi
mov    $0xa,%esi
call   1040 <nondet@plt>
cmp    $0x5,%eax
jne    113c <main+0x1c>
xor    %eax,%eax
call   1030 <__poet_fail@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @nondet(i32 6, i32 10)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 5
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @__poet_fail()
br label %8
8: ; preds = %6, %0
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @nondet(i32 6, i32 10)
%2 = icmp eq i32 %1, 5
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @__poet_fail()
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
void foo(void) { test_assert(1); }


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

x86 assembly (clang, -O2):
<foo>:
mov    $0x1,%edi
jmp    1030 <test_assert@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @test_assert(i32 1)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @test_assert(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun4(int);
int fun3(int i) { fun4(i); }


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

x86 assembly (clang, -O2):
<fun3>:
jmp    1030 <fun4@plt>

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

LLVM IR (-O2):
define i32 @fun3(i32 %0) {
%2 = tail call i32 @fun4(i32 %0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_loadu_pd(double const *);
__m128d test_mm_loadu_pd(double const *A) { return _mm_loadu_pd(A); }


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

x86 assembly (clang, -O2):
<test_mm_loadu_pd>:
jmp    1030 <_mm_loadu_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_loadu_pd(double* %0) {
%2 = tail call i32 @_mm_loadu_pd(double* %0)
ret i32 %2
}
/* Variables and functions */
int wrapper(int, char const *, char *const *, char *const *);
int execve(const char *__path, char *const __argv[], char *const __envp[]) {
  return wrapper(3, __path, __argv, __envp);
}


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

x86 assembly (clang, -O2):
<execve>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x3,%edi
jmp    1030 <wrapper@plt>

LLVM IR (-O0):
define i32 @execve(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 = load i8**, i8*** %5
%9 = load i8**, i8*** %6
%10 = call i32 @wrapper(i32 3, i8* %7, i8** %8, i8** %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = tail call i32 @wrapper(i32 3, i8* %0, i8** %1, i8** %2)
ret i32 %4
}
unsigned IsClientAuthorized(int socket, const char *action,
                            const char *reader) {
  (void)socket;
  (void)action;
  (void)reader;
  return 1;
}


x86 assembly (clang, -O0):
<IsClientAuthorized>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @IsClientAuthorized(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 1
}
/* Type definitions */
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int NSS_STATUS_SUCCESS;
enum nss_status _nss_puavoadmins_endgrent(void) { return NSS_STATUS_SUCCESS; }


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

x86 assembly (clang, -O2):
<_nss_puavoadmins_endgrent>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@NSS_STATUS_SUCCESS = global i32 0
define i32 @_nss_puavoadmins_endgrent() {
%1 = load i32, i32* @NSS_STATUS_SUCCESS
ret i32 %1
}

LLVM IR (-O2):
@NSS_STATUS_SUCCESS = global i32 0
define i32 @_nss_puavoadmins_endgrent() {
%1 = load i32, i32* @NSS_STATUS_SUCCESS
ret i32 %1
}
void gtk_text_view_move_child() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_move_child() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ fail(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void *allocate(size_t size) {
  void *p = malloc(size);
  if (!p)
    fail(strerror(ENOMEM));
  return p;
}


x86 assembly (clang, -O0):
<allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1169 <allocate+0x39>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edi
call   1030 <fail@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1153 <allocate+0x23>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edi
call   1030 <fail@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
define i8* @allocate(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @ENOMEM
%10 = call i32 @strerror(i32 %9)
%11 = call i32 @fail(i32 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@ENOMEM = global i32 0
define noalias i8* @allocate(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @ENOMEM
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @fail(i32 %6)
br label %8
8: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
char *strdup(const char *s) {
  size_t len = strlen(s);
  char *d;
  d = malloc(len + 1);
  if (d == NULL)
    return NULL;
  strcpy(d, s);
  return d;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1172 <strdup+0x42>
movq   $0x0,-0x8(%rbp)
jmp    1187 <strdup+0x57>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
void test4_f(void) {}


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

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

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

LLVM IR (-O2):
define void @test4_f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OutputValidLines();
int ExecuteCommand9() {
  OutputValidLines();
  return 0;
}


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

x86 assembly (clang, -O2):
<ExecuteCommand9>:
push   %rax
xor    %eax,%eax
call   1030 <OutputValidLines@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ExecuteCommand9() {
%1 = call i32 (...) @OutputValidLines()
ret i32 0
}

LLVM IR (-O2):
define i32 @ExecuteCommand9() {
%1 = tail call i32 (...) @OutputValidLines()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __ISB();
unsigned int __get_SCTLR();
int /*<<< orphan*/ __set_SCTLR(unsigned int);
void L1C_EnableBTAC(void) {
  __set_SCTLR(__get_SCTLR() | (1U << 11U));
  __ISB();
}


x86 assembly (clang, -O0):
<L1C_EnableBTAC>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <__get_SCTLR@plt>
mov    %eax,%edi
or     $0x800,%edi
call   1050 <__set_SCTLR@plt>
mov    $0x0,%al
call   1030 <__ISB@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<L1C_EnableBTAC>:
push   %rax
xor    %eax,%eax
call   1040 <__get_SCTLR@plt>
or     $0x800,%eax
mov    %eax,%edi
call   1050 <__set_SCTLR@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__ISB@plt>

LLVM IR (-O0):
define void @L1C_EnableBTAC() {
%1 = call i32 (...) @__get_SCTLR()
%2 = or i32 %1, 2048
%3 = call i32 @__set_SCTLR(i32 %2)
%4 = call i32 (...) @__ISB()
ret void
}

LLVM IR (-O2):
define void @L1C_EnableBTAC() {
%1 = tail call i32 (...) @__get_SCTLR()
%2 = or i32 %1, 2048
%3 = tail call i32 @__set_SCTLR(i32 %2)
%4 = tail call i32 (...) @__ISB()
ret void
}
/* Variables and functions */
int eeprom_read_int16(int);
int eeprom_read_uint16(int);
int /*<<< orphan*/ settings_reset_to_defaults();
int settings_get_motor_driver() {
  if (eeprom_read_uint16(128) != 0xfafbul) {
    settings_reset_to_defaults();
    return 1;
  }
  return eeprom_read_int16(36);
}


x86 assembly (clang, -O0):
<settings_get_motor_driver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80,%edi
call   1030 <eeprom_read_uint16@plt>
cltq
cmp    $0xfafb,%rax
je     1163 <settings_get_motor_driver+0x33>
mov    $0x0,%al
call   1050 <settings_reset_to_defaults@plt>
movl   $0x1,-0x4(%rbp)
jmp    1170 <settings_get_motor_driver+0x40>
mov    $0x24,%edi
call   1040 <eeprom_read_int16@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<settings_get_motor_driver>:
push   %rax
mov    $0x80,%edi
call   1030 <eeprom_read_uint16@plt>
cmp    $0xfafb,%eax
jne    114d <settings_get_motor_driver+0x1d>
mov    $0x24,%edi
pop    %rax
jmp    1040 <eeprom_read_int16@plt>
xor    %eax,%eax
call   1050 <settings_reset_to_defaults@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @settings_get_motor_driver() {
%1 = alloca i32
%2 = call i32 @eeprom_read_uint16(i32 128)
%3 = sext i32 %2 to i64
%4 = icmp ne i64 %3, 64251
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @settings_reset_to_defaults()
store i32 1, i32* %1
br label %9
7: ; preds = %0
%8 = call i32 @eeprom_read_int16(i32 36)
store i32 %8, i32* %1
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @settings_get_motor_driver() {
%1 = tail call i32 @eeprom_read_uint16(i32 128)
%2 = icmp eq i32 %1, 64251
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @settings_reset_to_defaults()
br label %7
5: ; preds = %0
%6 = tail call i32 @eeprom_read_int16(i32 36)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ 1, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_clz(unsigned int);
int8_t m_uintclz(unsigned int n) { return __builtin_clz(n); }


x86 assembly (clang, -O0):
<m_uintclz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_uintclz>:
bsr    %edi,%eax
xor    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @m_uintclz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
ret i32 %4
}

LLVM IR (-O2):
define i32 @m_uintclz(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int ar[], int n) {
  for (int i = 0; i < n; i++) {
    printf("%d ", ar[i]);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <print+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}