xunge/DecIR huggingface dataset:
/* Type definitions */
struct of_state {
  int dummy;
};
struct of_geom {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ primtoflux(double *, struct of_state *, int /*<<< orphan*/,
                              struct of_geom *, double *);
void primtoU(double *pr, struct of_state *q, struct of_geom *geom, double *U) {
  primtoflux(pr, q, 0, geom, U);
  return;
}


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

x86 assembly (clang, -O2):
<primtoU>:
mov    %rcx,%r8
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <primtoflux@plt>

LLVM IR (-O0):
%struct.of_state = type { i32 }
%struct.of_geom = type { i32 }
define void @primtoU(double* %0, %struct.of_state* %1, %struct.of_geom* %2, double* %3) {
%5 = alloca double*
%6 = alloca %struct.of_state*
%7 = alloca %struct.of_geom*
%8 = alloca double*
store double* %0, double** %5
store %struct.of_state* %1, %struct.of_state** %6
store %struct.of_geom* %2, %struct.of_geom** %7
store double* %3, double** %8
%9 = load double*, double** %5
%10 = load %struct.of_state*, %struct.of_state** %6
%11 = load %struct.of_geom*, %struct.of_geom** %7
%12 = load double*, double** %8
%13 = call i32 @primtoflux(double* %9, %struct.of_state* %10, i32 0, %struct.of_geom* %11, double* %12)
ret void
}

LLVM IR (-O2):
%struct.of_state = type { i32 }
%struct.of_geom = type { i32 }
define void @primtoU(double* %0, %struct.of_state* %1, %struct.of_geom* %2, double* %3) {
%5 = tail call i32 @primtoflux(double* %0, %struct.of_state* %1, i32 0, %struct.of_geom* %2, double* %3)
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *);
int valid_crossover(char value[]) {
  int v = atoi(value);
  if (v > 255 || v < 0) {
    printf("\nWARNING: Crossover cannot be greater than 255 or less than 0. "
           "Using default instead\n\n");
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<valid_crossover>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xff,-0x14(%rbp)
jg     114f <valid_crossover+0x2f>
cmpl   $0x0,-0x14(%rbp)
jge    1167 <valid_crossover+0x47>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116e <valid_crossover+0x4e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_crossover>:
push   %rax
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x100,%ecx
jb     1143 <valid_crossover+0x23>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [87 x i8] c"\0AWARNING: Crossover cannot be greater than 255 or less than 0. Using default instead\0A\0A\00"
define i32 @valid_crossover(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @atoi(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 255
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9, %1
%13 = call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %15
14: ; preds = %9
store i32 1, i32* %2
br label %15
15: ; preds = %14, %12
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@str = [86 x i8] c"\0AWARNING: Crossover cannot be greater than 255 or less than 0. Using default instead\0A\00"
define i32 @valid_crossover(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = icmp ugt i32 %2, 255
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %7
}
getnum(s) char *s;
{
  int a;
  char c;
  a = 0;
  while ((c = *s++) >= '0' && c <= '9') {
    a = a * 10 + c - '0';
  }
  return (a);
}


x86 assembly (clang, -O0):
<getnum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xe(%rbp)
jl     1141 <getnum+0x41>
movsbl -0xd(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
test   $0x1,%al
jne    1151 <getnum+0x51>
jmp    1166 <getnum+0x66>
imul   $0xa,-0xc(%rbp),%eax
movsbl -0xd(%rbp),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <getnum+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnum>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <getnum+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <getnum+0x20>
ret

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

LLVM IR (-O2):
define i32 @getnum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i8* [ %10, %5 ], [ %0, %1 ]
%8 = phi i32 [ %13, %5 ], [ 0, %1 ]
%9 = zext i8 %6 to i32
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = mul nsw i32 %8, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %9
%14 = load i8, i8* %10
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %13, %5 ]
ret i32 %18
}
void main() {
  const volatile int var = 10;
  int *ptr = &var;
  printf("Intital value %d\n", var);
  *ptr = 100;
  printf("Changed Value %d", var);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movl   $0x64,(%rax)
mov    -0x4(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
mov    0x4(%rsp),%esi
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x64,0x4(%rsp)
mov    0x4(%rsp),%esi
lea    0xed4(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Intital value %d\0A\00"
@.str.1 = [17 x i8] c"Changed Value %d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32*
store volatile i32 10, i32* %1
store i32* %1, i32** %2
%3 = load volatile i32, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32*, i32** %2
store i32 100, i32* %5
%6 = load volatile i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Intital value %d\0A\00"
@.str.1 = [17 x i8] c"Changed Value %d\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 10, i32* %1
%3 = load volatile i32, i32* %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 100, i32* %1
%5 = load volatile i32, i32* %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
void enable_interrupts() { __asm__ __volatile__("sti"); }


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

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

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

LLVM IR (-O2):
define void @enable_interrupts() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int compare_string_string(void *string1, void *string2) {
  char *str1 = (char *)string1;
  char *str2 = (char *)string2;
  return strcmp(str1, str2);
}


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

x86 assembly (clang, -O2):
<compare_string_string>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compare_string_string(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
long int_get_c(long s) {
  if (((unsigned long)s & 0x08000000UL) == 0)
    return ((unsigned long)s & 0x0fffffffUL);
  return (long)((unsigned long)s | ~0x0fffffffUL);
}


x86 assembly (clang, -O0):
<int_get_c>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x8000000,%rax
cmp    $0x0,%rax
jne    112f <int_get_c+0x2f>
mov    -0x10(%rbp),%rax
and    $0xfffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    113d <int_get_c+0x3d>
mov    -0x10(%rbp),%rax
or     $0xfffffffff0000000,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_get_c>:
mov    %rdi,%rax
shl    $0x24,%rax
sar    $0x3f,%rax
and    $0xfffffff,%edi
and    $0xfffffffff0000000,%rax
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @int_get_c(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = and i64 %4, 134217728
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i64, i64* %3
%9 = and i64 %8, 268435455
store i64 %9, i64* %2
br label %13
10: ; preds = %1
%11 = load i64, i64* %3
%12 = or i64 %11, -268435456
store i64 %12, i64* %2
br label %13
13: ; preds = %10, %7
%14 = load i64, i64* %2
ret i64 %14
}

LLVM IR (-O2):
define i64 @int_get_c(i64 %0) {
%2 = and i64 %0, 134217728
%3 = icmp eq i64 %2, 0
%4 = and i64 %0, 268435455
%5 = select i1 %3, i64 0, i64 -268435456
%6 = or i64 %5, %4
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ string_replace_char(char, char, char *);
char *string_tolower(int /*<<< orphan*/);
char *sdo_dict__constname_to_string(char *constname) {
  return string_tolower(string_replace_char('_', '-', constname));
}


x86 assembly (clang, -O0):
<sdo_dict__constname_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x5f,%edi
mov    $0x2d,%esi
call   1030 <string_replace_char@plt>
mov    %eax,%edi
call   1040 <string_tolower@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdo_dict__constname_to_string>:
push   %rax
mov    %rdi,%rdx
mov    $0x5f,%edi
mov    $0x2d,%esi
call   1030 <string_replace_char@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <string_tolower@plt>

LLVM IR (-O0):
define i8* @sdo_dict__constname_to_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @string_replace_char(i8 signext 95, i8 signext 45, i8* %3)
%5 = call i8* @string_tolower(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @sdo_dict__constname_to_string(i8* %0) {
%2 = tail call i32 @string_replace_char(i8 signext 95, i8 signext 45, i8* %0)
%3 = tail call i8* @string_tolower(i32 %2)
ret i8* %3
}
/* Variables and functions */
int compare_objp(int /*<<< orphan*/, void const *const *, void const *const *);
int /*<<< orphan*/ compare_objp_context();
int compare_byte_allocation(void *context, const void *const *check,
                            const void *const *baseline) {
  return compare_objp(compare_objp_context(), check, baseline);
}


x86 assembly (clang, -O0):
<compare_byte_allocation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <compare_objp_context@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <compare_objp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_byte_allocation>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <compare_objp_context@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <compare_objp@plt>

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

LLVM IR (-O2):
define i32 @compare_byte_allocation(i8* nocapture readnone %0, i8** %1, i8** %2) {
%4 = tail call i32 (...) @compare_objp_context()
%5 = tail call i32 @compare_objp(i32 %4, i8** %1, i8** %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *);
void hello_exit(void) { pr_info("Good-bye world! Unloading ...\n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Good-bye world! Unloading ...\0A\00"
define void @hello_exit() {
%1 = call i32 @pr_info(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Good-bye world! Unloading ...\0A\00"
define void @hello_exit() {
%1 = tail call i32 @pr_info(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int add(int, int);
int twice(int a) { return add(a, a); }


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

x86 assembly (clang, -O2):
<twice>:
mov    %edi,%esi
jmp    1030 <add@plt>

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

LLVM IR (-O2):
define i32 @twice(i32 %0) {
%2 = tail call i32 @add(i32 %0, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int unlink(char *name) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @unlink(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char *);
int aggregate_fs_p(const char *fstype) {
  return !strcmp(fstype, "linux_raid_member") || !strcmp(fstype, "zfs_member");
}


x86 assembly (clang, -O0):
<aggregate_fs_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1157 <aggregate_fs_p+0x47>
mov    -0x8(%rbp),%rdi
lea    0xecb(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aggregate_fs_p>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     113e <aggregate_fs_p+0x2e>
lea    0xee7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"linux_raid_member\00"
@.str.1 = [11 x i8] c"zfs_member\00"
define i32 @aggregate_fs_p(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcmp(i8* %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strcmp(i8* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [18 x i8] c"linux_raid_member\00"
@.str.1 = [11 x i8] c"zfs_member\00"
define i32 @aggregate_fs_p(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(18) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *ptr) {
  if (ptr) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <xfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
test   %rdi,%rdi
je     111a <xfree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @xfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ h();
int main(int argc, char **argv) {
  h();
  return 0;
}


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

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

LLVM IR (-O0):
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 (...) @h()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @h()
ret i32 0
}
/* Variables and functions */
int yas_bma150_read_reg_byte(int);
int /*<<< orphan*/ yas_bma150_write_reg_byte(int, int);
int yas_bma150_power_down(void) {
  yas_bma150_write_reg_byte(
      0x0a, ((yas_bma150_read_reg_byte(0x0a) & ~0x01) | ((1) << 0)));
  return (0);
}


x86 assembly (clang, -O0):
<yas_bma150_power_down>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1040 <yas_bma150_read_reg_byte@plt>
mov    %eax,%esi
and    $0xfffffffe,%esi
or     $0x1,%esi
mov    $0xa,%edi
call   1030 <yas_bma150_write_reg_byte@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_bma150_power_down>:
push   %rax
mov    $0xa,%edi
call   1040 <yas_bma150_read_reg_byte@plt>
or     $0x1,%eax
mov    $0xa,%edi
mov    %eax,%esi
call   1030 <yas_bma150_write_reg_byte@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_bma150_power_down() {
%1 = call i32 @yas_bma150_read_reg_byte(i32 10)
%2 = and i32 %1, -2
%3 = or i32 %2, 1
%4 = call i32 @yas_bma150_write_reg_byte(i32 10, i32 %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @yas_bma150_power_down() {
%1 = tail call i32 @yas_bma150_read_reg_byte(i32 10)
%2 = or i32 %1, 1
%3 = tail call i32 @yas_bma150_write_reg_byte(i32 10, i32 %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
int /*<<< orphan*/ ff_bfin_put_pixels16uc_nornd(int /*<<< orphan*/ *,
                                                int /*<<< orphan*/ const *,
                                                int /*<<< orphan*/ const *,
                                                int /*<<< orphan*/, int);
void bfin_put_pixels16_y2_nornd(uint8_t *block, const uint8_t *pixels,
                                ptrdiff_t line_size, int h) {
  ff_bfin_put_pixels16uc_nornd(block, pixels, pixels + line_size, line_size, h);
}


x86 assembly (clang, -O0):
<bfin_put_pixels16_y2_nornd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <ff_bfin_put_pixels16uc_nornd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bfin_put_pixels16_y2_nornd>:
mov    %ecx,%r8d
movslq %edx,%rcx
lea    (%rsi,%rcx,4),%rdx
jmp    1030 <ff_bfin_put_pixels16uc_nornd@plt>

LLVM IR (-O0):
define void @bfin_put_pixels16_y2_nornd(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = call i32 @ff_bfin_put_pixels16uc_nornd(i32* %9, i32* %10, i32* %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @bfin_put_pixels16_y2_nornd(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = tail call i32 @ff_bfin_put_pixels16uc_nornd(i32* %0, i32* %1, i32* %6, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strnlen(char const *, size_t);
char *strndup(const char *s, size_t n) {
  size_t l = strnlen(s, n);
  char *d = malloc(l + 1);
  if (!d)
    return NULL;
  memcpy(d, s, l);
  d[l] = '\0';
  return d;
}


x86 assembly (clang, -O0):
<strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strnlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    117a <strndup+0x4a>
movq   $0x0,-0x8(%rbp)
jmp    119f <strndup+0x6f>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strnlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <strndup+0x34>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = call i64 @strnlen(i8* %8, i64 %9)
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = add i64 %11, 1
%13 = call i8* @malloc(i64 %12)
store i8* %13, i8** %7
%14 = load i8*, i8** %7
%15 = icmp ne i8* %14, null
br i1 %15, label %17, label %16
16: ; preds = %2
store i8* null, i8** %3
br label %26
17: ; preds = %2
%18 = load i8*, i8** %7
%19 = load i8*, i8** %4
%20 = load i64, i64* %6
%21 = call i32 @memcpy(i8* %18, i8* %19, i64 %20)
%22 = load i8*, i8** %7
%23 = load i64, i64* %6
%24 = getelementptr inbounds i8, i8* %22, i64 %23
store i8 0, i8* %24
%25 = load i8*, i8** %7
store i8* %25, i8** %3
br label %26
26: ; preds = %17, %16
%27 = load i8*, i8** %3
ret i8* %27
}

LLVM IR (-O2):
define i8* @strndup(i8* %0, i64 %1) {
%3 = tail call i64 @strnlen(i8* %0, i64 %1)
%4 = add i64 %3, 1
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %3)
%9 = getelementptr inbounds i8, i8* %5, i64 %3
store i8 0, i8* %9
br label %10
10: ; preds = %2, %7
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _ping_usage(void) {
  fputs("Usage: "
        "ping"
        " [-46][-c count] hostname\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_ping_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ping_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Usage: ping [-46][-c count] hostname\0A\00"
@stderr = global i32 0
define i32 @_ping_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [38 x i8] c"Usage: ping [-46][-c count] hostname\0A\00"
@stderr = global i32 0
define i32 @_ping_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int exp(int);
double alpha_n(const double V) {
  return 0.01 * (55. - V) / (exp((55. - V) / 10.) - 1.);
}


x86 assembly (clang, -O0):
<alpha_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecd(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
movsd  0xe92(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alpha_n>:
push   %rax
movsd  0xee7(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0xee3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
divsd  0xeda(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <exp@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  0xeca(%rip),%xmm1
movsd  (%rsp),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @alpha_n(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 5.500000e+01, %3
%5 = fmul double 1.000000e-02, %4
%6 = load double, double* %2
%7 = fsub double 5.500000e+01, %6
%8 = fdiv double %7, 1.000000e+01
%9 = fptosi double %8 to i32
%10 = call i32 @exp(i32 %9)
%11 = sitofp i32 %10 to double
%12 = fsub double %11, 1.000000e+00
%13 = fdiv double %5, %12
ret double %13
}

LLVM IR (-O2):
define double @alpha_n(double %0) {
%2 = fsub double 5.500000e+01, %0
%3 = fmul double %2, 1.000000e-02
%4 = fdiv double %2, 1.000000e+01
%5 = fptosi double %4 to i32
%6 = tail call i32 @exp(i32 %5)
%7 = sitofp i32 %6 to double
%8 = fadd double %7, -1.000000e+00
%9 = fdiv double %3, %8
ret double %9
}
int ShrTest12(int Y, int X, unsigned C, int CC) {
  return (Y + ((X >> C) & CC)) << C;
}


x86 assembly (clang, -O0):
<ShrTest12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
and    -0x10(%rbp),%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShrTest12>:
mov    %ecx,%eax
mov    %edx,%ecx
sar    %cl,%esi
and    %esi,%eax
add    %edi,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ShrTest12(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = ashr i32 %10, %11
%13 = load i32, i32* %8
%14 = and i32 %12, %13
%15 = add nsw i32 %9, %14
%16 = load i32, i32* %7
%17 = shl i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @ShrTest12(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = ashr i32 %1, %2
%6 = and i32 %5, %3
%7 = add nsw i32 %6, %0
%8 = shl i32 %7, %2
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int brk(int /*<<< orphan*/ *);
int main(void) {
  int ret = brk(NULL);
  assert(ret == 0);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <brk@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@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 @brk(i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @brk(i32* null)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ traiteErr(int, char *);
void messErr2(int n, char *M) {
  if ((n < 0) || (n > 48))
    n = 1;
  traiteErr(n, M);
}


x86 assembly (clang, -O0):
<messErr2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1133 <messErr2+0x23>
cmpl   $0x30,-0x4(%rbp)
jle    113a <messErr2+0x2a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <traiteErr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<messErr2>:
cmp    $0x31,%edi
mov    $0x1,%eax
cmovae %eax,%edi
jmp    1030 <traiteErr@plt>

LLVM IR (-O0):
define void @messErr2(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 48
br i1 %9, label %10, label %11
10: ; preds = %7, %2
store i32 1, i32* %3
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %3
%13 = load i8*, i8** %4
%14 = call i32 @traiteErr(i32 %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @messErr2(i32 %0, i8* %1) {
%3 = icmp ugt i32 %0, 48
%4 = select i1 %3, i32 1, i32 %0
%5 = tail call i32 @traiteErr(i32 %4, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PANIC();
int /*<<< orphan*/ exit(int);
void ___exit(int status) {
  exit(status);
  PANIC();
}


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

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

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

LLVM IR (-O2):
define void @___exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ call_ctors();
int /*<<< orphan*/ exit(int);
int main(int, char **);
void __CRT_startup() {
  char *argv[] = {"exe", 0};
  call_ctors();
  int rv = main(1, argv);
  exit(rv);
}


x86 assembly (clang, -O0):
<__CRT_startup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2cd1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2cce(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <call_ctors@plt>
lea    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1040 <main@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<__CRT_startup>:
sub    $0x18,%rsp
movaps 0x2cd5(%rip),%xmm0
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <call_ctors@plt>
mov    %rsp,%rsi
mov    $0x1,%edi
call   1040 <main@plt>
mov    %eax,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"exe\00"
@__const.__CRT_startup.argv = [2 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* null]
define void @__CRT_startup() {
%1 = alloca [2 x i8*]
%2 = alloca i32
%3 = bitcast [2 x i8*]* %1 to i8*
%4 = call i32 (...) @call_ctors()
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%6 = call i32 @main(i32 1, i8** %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"exe\00"
@__const.__CRT_startup.argv = [2 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* null]
define void @__CRT_startup() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = tail call i32 (...) @call_ctors()
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%5 = call i32 @main(i32 1, i8** %4)
%6 = call i32 @exit(i32 %5)
unreachable
}
void go_backward(int num_bits, unsigned char **data, unsigned short *len,
                 unsigned char *bitpos) {
  if (*bitpos >= num_bits)
    *bitpos -= num_bits;
  else {
    (*data)--;
    (*len)++;
    *bitpos = 8 - (num_bits - *bitpos);
  }
}


x86 assembly (clang, -O0):
<go_backward>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movzbl (%rax),%eax
cmp    -0x4(%rbp),%eax
jl     1136 <go_backward+0x36>
mov    -0x4(%rbp),%edx
mov    -0x20(%rbp),%rax
movzbl (%rax),%ecx
sub    %edx,%ecx
mov    %cl,(%rax)
jmp    116d <go_backward+0x6d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%cx
add    $0x1,%cx
mov    %cx,(%rax)
mov    -0x4(%rbp),%ecx
mov    -0x20(%rbp),%rax
movzbl (%rax),%eax
sub    %eax,%ecx
mov    $0x8,%eax
sub    %ecx,%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<go_backward>:
movzbl (%rcx),%eax
cmp    %edi,%eax
jge    1119 <go_backward+0x19>
addq   $0xffffffffffffffff,(%rsi)
addw   $0x1,(%rdx)
mov    (%rcx),%al
sub    %dil,%al
add    $0x8,%al
mov    %al,(%rcx)
ret
sub    %dil,%al
mov    %al,(%rcx)
ret

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

LLVM IR (-O2):
define void @go_backward(i32 %0, i8** nocapture %1, i16* nocapture %2, i8* nocapture %3) {
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = icmp slt i32 %6, %0
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = trunc i32 %0 to i8
%10 = sub i8 %5, %9
br label %20
11: ; preds = %4
%12 = load i8*, i8** %1
%13 = getelementptr inbounds i8, i8* %12, i64 -1
store i8* %13, i8** %1
%14 = load i16, i16* %2
%15 = add i16 %14, 1
store i16 %15, i16* %2
%16 = load i8, i8* %3
%17 = trunc i32 %0 to i8
%18 = sub i8 8, %17
%19 = add i8 %18, %16
br label %20
20: ; preds = %11, %8
%21 = phi i8 [ %19, %11 ], [ %10, %8 ]
store i8 %21, i8* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void example_hook_post() { puts("example_hook - post"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"example_hook - post\00"
define void @example_hook_post() {
%1 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"example_hook - post\00"
define void @example_hook_post() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
scalar_t__ setrlimit(int, struct rlimit *);
int /*<<< orphan*/ shutdown(int, char *, int);
void setr(int type, struct rlimit *rlim) {
  if (setrlimit(type, rlim))
    shutdown(7, "setrlimit()", 144 - 1);
}


x86 assembly (clang, -O0):
<setr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <setrlimit@plt>
cmp    $0x0,%rax
je     115b <setr+0x3b>
mov    $0x7,%edi
lea    0xeaf(%rip),%rsi
mov    $0x8f,%edx
call   1030 <shutdown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setr>:
push   %rax
call   1040 <setrlimit@plt>
test   %rax,%rax
je     1142 <setr+0x22>
lea    0xece(%rip),%rsi
mov    $0x7,%edi
mov    $0x8f,%edx
pop    %rax
jmp    1030 <shutdown@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@.str = [12 x i8] c"setrlimit()\00"
define void @setr(i32 %0, %struct.rlimit* %1) {
%3 = alloca i32
%4 = alloca %struct.rlimit*
store i32 %0, i32* %3
store %struct.rlimit* %1, %struct.rlimit** %4
%5 = load i32, i32* %3
%6 = load %struct.rlimit*, %struct.rlimit** %4
%7 = call i64 @setrlimit(i32 %5, %struct.rlimit* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @shutdown(i32 7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 143)
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@.str = [12 x i8] c"setrlimit()\00"
define void @setr(i32 %0, %struct.rlimit* %1) {
%3 = tail call i64 @setrlimit(i32 %0, %struct.rlimit* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @shutdown(i32 7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 143)
br label %7
7: ; preds = %5, %2
ret void
}
char number2str(int value) { return 'a' + value; }


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

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

LLVM IR (-O0):
define signext i8 @number2str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 97, %3
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @number2str(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 97
ret i8 %3
}
int test_leastBitPos(int x) {
  int mask = 1;
  if (x == 0)
    return 0;
  while (!(mask & x)) {
    mask = mask << 1;
  }
  return mask;
}


x86 assembly (clang, -O0):
<test_leastBitPos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <test_leastBitPos+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1158 <test_leastBitPos+0x58>
jmp    1129 <test_leastBitPos+0x29>
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1144 <test_leastBitPos+0x44>
jmp    1152 <test_leastBitPos+0x52>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <test_leastBitPos+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_leastBitPos>:
test   %edi,%edi
je     111a <test_leastBitPos+0x1a>
mov    $0x1,%ecx
nopl   0x0(%rax)
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
test   %edi,%eax
je     1110 <test_leastBitPos+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @test_leastBitPos(i32 %0) {
%2 = alloca i32
%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, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %20
8: ; preds = %1
br label %9
9: ; preds = %15, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = and i32 %10, %11
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = load i32, i32* %4
%17 = shl i32 %16, 1
store i32 %17, i32* %4
br label %9
18: ; preds = %9
%19 = load i32, i32* %4
store i32 %19, i32* %2
br label %20
20: ; preds = %18, %7
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @test_leastBitPos(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = and i32 %4, %0
%6 = icmp eq i32 %5, 0
%7 = shl i32 %4, 1
br i1 %6, label %3, label %8
8: ; preds = %3, %1
%9 = phi i32 [ 0, %1 ], [ %4, %3 ]
ret i32 %9
}
__attribute__((always_)) void __might_sleep(char *file, int line,
                                            int preempt_offset) {}


x86 assembly (clang, -O0):
<__might_sleep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__might_sleep(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @__might_sleep(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XFontProp;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XFontProp(void *_p) {
  if (_p == NULL)
    abort();
  free((XFontProp *)_p);
}


x86 assembly (clang, -O0):
<free_XFontProp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XFontProp+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XFontProp>:
test   %rdi,%rdi
je     112a <free_XFontProp+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XFontProp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XFontProp(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hd_order(FILE *f) {
  static int count = 0;
  if (!count++)
    printf("No header has been defined for the order table\n");
  return (0);
}


x86 assembly (clang, -O0):
<hd_order>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2f0a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2eff(%rip)
cmp    $0x0,%eax
jne    1142 <hd_order+0x32>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hd_order>:
push   %rax
mov    0x2f15(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f0c(%rip)
test   %eax,%eax
jne    1130 <hd_order+0x20>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@hd_order.count = internal global i32 0
@.str = [48 x i8] c"No header has been defined for the order table\0A\00"
define i32 @hd_order(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @hd_order.count
%4 = add nsw i32 %3, 1
store i32 %4, i32* @hd_order.count
%5 = icmp ne i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i32 0
}

LLVM IR (-O2):
@hd_order.count = internal unnamed_addr global i32 0
@str = [47 x i8] c"No header has been defined for the order table\00"
define i32 @hd_order(i32* nocapture readnone %0) {
%2 = load i32, i32* @hd_order.count
%3 = add nsw i32 %2, 1
store i32 %3, i32* @hd_order.count
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 0
}