xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main(int main_argc, char **main_argv) {
  char *x;
  x = main_argv[0];
  assert(main_argc >= 1);
  assert(main_argv[main_argc] == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
test   %ebp,%ebp
setg   %dil
call   1030 <assert@plt>
movslq %ebp,%rax
xor    %edi,%edi
cmpq   $0x0,(%rbx,%rax,8)
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
store i8* %8, i8** %5
%9 = load i32, i32* %3
%10 = icmp sge i32 %9, 1
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8**, i8*** %4
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = icmp eq i8* %17, null
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds i8*, i8** %1, i64 %6
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
ret i32 0
}
/* Variables and functions */
int isatty(int);
int sysapi_device_isatty(int fd) { return isatty(fd); }


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

x86 assembly (clang, -O2):
<sysapi_device_isatty>:
jmp    1030 <isatty@plt>

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

LLVM IR (-O2):
define i32 @sysapi_device_isatty(i32 %0) {
%2 = tail call i32 @isatty(i32 %0)
ret i32 %2
}
int sigma(int n) {
  int sig;
  for (sig = 0; n >= 1; n--)
    sig = sig + n;
  return sig;
}


x86 assembly (clang, -O0):
<sigma>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jl     112f <sigma+0x2f>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <sigma+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigma>:
test   %edi,%edi
jle    1119 <sigma+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sigma(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %14
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_fchown;
int syscall(int /*<<< orphan*/, int, int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((always_)) int _syscall_fchown(int fd, uid_t owner, gid_t group) {
  return syscall(__NR_fchown, fd, owner, group);
}


x86 assembly (clang, -O0):
<_syscall_fchown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_syscall_fchown>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_fchown = global i32 0
define i32 @_syscall_fchown(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @__NR_fchown
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @syscall(i32 %7, i32 %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@__NR_fchown = global i32 0
define i32 @_syscall_fchown(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @__NR_fchown
%5 = tail call i32 @syscall(i32 %4, i32 %0, i32 %1, i32 %2)
ret i32 %5
}
double *fct_2(double *a, double *b, double *c, double *d, double *e, double *f,
              double *g, double *h) {
  (void)a;
  (void)b;
  (void)c;
  (void)d;
  (void)e;
  (void)f;
  (void)g;
  (void)h;
  return c;
}


x86 assembly (clang, -O0):
<fct_2>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fct_2>:
mov    %rdx,%rax
ret

LLVM IR (-O0):
define double* @fct_2(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double* %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
store double* %0, double** %9
store double* %1, double** %10
store double* %2, double** %11
store double* %3, double** %12
store double* %4, double** %13
store double* %5, double** %14
store double* %6, double** %15
store double* %7, double** %16
%17 = load double*, double** %9
%18 = load double*, double** %10
%19 = load double*, double** %11
%20 = load double*, double** %12
%21 = load double*, double** %13
%22 = load double*, double** %14
%23 = load double*, double** %15
%24 = load double*, double** %16
%25 = load double*, double** %11
ret double* %25
}

LLVM IR (-O2):
define double* @fct_2(double* nocapture readnone %0, double* nocapture readnone %1, double* readnone returned %2, double* nocapture readnone %3, double* nocapture readnone %4, double* nocapture readnone %5, double* nocapture readnone %6, double* nocapture readnone %7) {
ret double* %2
}
/* Variables and functions */
int /*<<< orphan*/ rt_main(void *);
void *launch(void *p) {
  rt_main(p);
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @launch(i8* %0) {
%2 = tail call i32 @rt_main(i8* %0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ android_compiler_barrier();
extern __attribute__((always_)) void android_memory_store_barrier() {
  android_compiler_barrier();
}


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

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

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

LLVM IR (-O2):
define void @android_memory_store_barrier() {
%1 = tail call i32 (...) @android_compiler_barrier()
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
scalar_t__ __VERIFIER_nondet_int();
int /*<<< orphan*/ append_node(struct node **, void *);
void create_list(struct node **list, void *data) {
  append_node(list, data);
  append_node(list, data);
  while (__VERIFIER_nondet_int())
    append_node(list, data);
}


x86 assembly (clang, -O0):
<create_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <append_node@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <append_node@plt>
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
je     116d <create_list+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <append_node@plt>
jmp    114a <create_list+0x2a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_list>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <append_node@plt>
nop
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <append_node@plt>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
jne    1130 <create_list+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define void @create_list(%struct.node** %0, i8* %1) {
%3 = alloca %struct.node**
%4 = alloca i8*
store %struct.node** %0, %struct.node*** %3
store i8* %1, i8** %4
%5 = load %struct.node**, %struct.node*** %3
%6 = load i8*, i8** %4
%7 = call i32 @append_node(%struct.node** %5, i8* %6)
%8 = load %struct.node**, %struct.node*** %3
%9 = load i8*, i8** %4
%10 = call i32 @append_node(%struct.node** %8, i8* %9)
br label %11
11: ; preds = %14, %2
%12 = call i64 (...) @__VERIFIER_nondet_int()
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load %struct.node**, %struct.node*** %3
%16 = load i8*, i8** %4
%17 = call i32 @append_node(%struct.node** %15, i8* %16)
br label %11
18: ; preds = %11
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @create_list(%struct.node** %0, i8* %1) {
%3 = tail call i32 @append_node(%struct.node** %0, i8* %1)
%4 = tail call i32 @append_node(%struct.node** %0, i8* %1)
%5 = tail call i64 (...) @__VERIFIER_nondet_int()
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2, %7
%8 = tail call i32 @append_node(%struct.node** %0, i8* %1)
%9 = tail call i64 (...) @__VERIFIER_nondet_int()
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %7
11: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int com3(char **para) {
  printf("this is com3\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<com3>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"this is com3\0A\00"
define i32 @com3(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"this is com3\00"
define i32 @com3(i8** nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int getNum(long int num, unsigned int n) {
  while (n != 0) {
    num /= 10;
    n--;
  }
  return num % 10;
}


x86 assembly (clang, -O0):
<getNum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1135 <getNum+0x35>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <getNum+0xb>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNum>:
movabs $0x6666666666666667,%r9
66 66 66
test   %esi,%esi
je     117c <getNum+0x7c>
lea    -0x1(%rsi),%r8d
mov    %esi,%r10d
and    $0x3,%r10d
je     1141 <getNum+0x41>
xor    %ecx,%ecx
nopl   (%rax)
mov    %rdi,%rax
imul   %r9
mov    %rdx,%rdi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdi
add    %rax,%rdi
add    $0x1,%ecx
cmp    %ecx,%r10d
jne    1120 <getNum+0x20>
sub    %ecx,%esi
cmp    $0x3,%r8d
jb     117c <getNum+0x7c>
movabs $0x346dc5d63886594b,%rcx
c5 6d 34
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rdi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xb,%rdi
add    %rax,%rdi
add    $0xfffffffc,%esi
jne    1160 <getNum+0x60>
mov    %rdi,%rax
imul   %r9
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x2,%rdx
add    %eax,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%edi
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @getNum(i64 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %27, label %4
4: ; preds = %2
%5 = add i32 %1, -1
%6 = and i32 %1, 3
%7 = icmp eq i32 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %4, %8
%9 = phi i32 [ %13, %8 ], [ %1, %4 ]
%10 = phi i64 [ %12, %8 ], [ %0, %4 ]
%11 = phi i32 [ %14, %8 ], [ 0, %4 ]
%12 = sdiv i64 %10, 10
%13 = add i32 %9, -1
%14 = add i32 %11, 1
%15 = icmp eq i32 %14, %6
br i1 %15, label %16, label %8
16: ; preds = %8, %4
%17 = phi i64 [ undef, %4 ], [ %12, %8 ]
%18 = phi i32 [ %1, %4 ], [ %13, %8 ]
%19 = phi i64 [ %0, %4 ], [ %12, %8 ]
%20 = icmp ult i32 %5, 3
br i1 %20, label %27, label %21
21: ; preds = %16, %21
%22 = phi i32 [ %25, %21 ], [ %18, %16 ]
%23 = phi i64 [ %24, %21 ], [ %19, %16 ]
%24 = sdiv i64 %23, 10000
%25 = add i32 %22, -4
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %21
27: ; preds = %16, %21, %2
%28 = phi i64 [ %0, %2 ], [ %17, %16 ], [ %24, %21 ]
%29 = srem i64 %28, 10
%30 = trunc i64 %29 to i32
ret i32 %30
}
/* Variables and functions */
scalar_t__ strcasecmp(char *, char *);
void strcasecmp_constant_and_var_1() {
  char *x = "abc";
  if (strcasecmp("Abc", x) != 0)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strcasecmp_constant_and_var_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed6(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     113d <strcasecmp_constant_and_var_1+0x2d>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"Abc\00"
define void @strcasecmp_constant_and_var_1() {
%1 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i64 @strcasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i8, i8* null
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @strcasecmp_constant_and_var_1() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
double *pdvector(int dim) {
  double *vec;
  vec = (double *)malloc(dim * sizeof(double));
  if (!vec)
    printf("memory allocation error, pdvector\n");
  return vec;
}


x86 assembly (clang, -O0):
<pdvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <pdvector+0x35>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdvector>:
push   %rbx
shl    $0x3,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113d <pdvector+0x1d>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"memory allocation error, pdvector\0A\00"
define double* @pdvector(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 8
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to double*
store double* %9, double** %3
%10 = load double*, double** %3
%11 = icmp ne double* %10, null
br i1 %11, label %14, label %12
12: ; preds = %1
%13 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %1
%15 = load double*, double** %3
ret double* %15
}

LLVM IR (-O2):
@str = [34 x i8] c"memory allocation error, pdvector\00"
define double* @pdvector(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i64 @malloc(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = inttoptr i64 %3 to double*
ret double* %8
}
/* Variables and functions */
char *strrchr(char *, char);
char *dirname(char *path) {
  char *separator;
  separator = strrchr(path, '/');
  if (separator == path) {
    return "/";
  } else if (separator) {
    *separator = 0;
    return path;
  } else {
    return ".";
  }
}


x86 assembly (clang, -O0):
<dirname>:
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)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    114c <dirname+0x3c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <dirname+0x66>
cmpq   $0x0,-0x18(%rbp)
je     116b <dirname+0x5b>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <dirname+0x66>
lea    0xe90(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirname>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
cmp    %rbx,%rax
je     112d <dirname+0x1d>
test   %rax,%rax
je     1136 <dirname+0x26>
movb   $0x0,(%rax)
jmp    113d <dirname+0x2d>
lea    0xecc(%rip),%rbx
jmp    113d <dirname+0x2d>
lea    0xec5(%rip),%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
@.str.1 = [2 x i8] c".\00"
define i8* @dirname(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 = load i8*, i8** %4
%8 = load i8*, i8** %3
%9 = icmp eq i8* %7, %8
br i1 %9, label %10, label %11
10: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
br label %18
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i8*, i8** %4
store i8 0, i8* %15
%16 = load i8*, i8** %3
store i8* %16, i8** %2
br label %18
17: ; preds = %11
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %18
18: ; preds = %17, %14, %10
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
@.str.1 = [2 x i8] c".\00"
define i8* @dirname(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, %0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = icmp eq i8* %2, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i8 0, i8* %2
br label %7
7: ; preds = %4, %1, %6
%8 = phi i8* [ %0, %6 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %4 ]
ret i8* %8
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t bswap_16(uint16_t x) { return (x >> 8) | (x << 8); }


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

x86 assembly (clang, -O2):
<bswap_16>:
mov    %edi,%eax
sar    $0x8,%eax
shl    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @bswap_16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @bswap_16(i32 %0) {
%2 = ashr i32 %0, 8
%3 = shl i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void testloopC() {
  for (int i = 0; i < 16; i += 2) {
    printf("item = %i\n", i);
  }
}


x86 assembly (clang, -O0):
<testloopC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1146 <testloopC+0x36>
mov    -0x4(%rbp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <testloopC+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testloopC>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"item = %i\0A\00"
define void @testloopC() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 6)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 8)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 12)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 14)
ret void
}
/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main() {
  fork();
  (fork() && fork()) || fork();
  fork();
  printf("forked\n");
  sleep(15);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    $0x0,%al
call   1050 <fork@plt>
cmp    $0x0,%rax
je     1170 <main+0x40>
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1181 <main+0x51>
mov    $0x0,%al
call   1050 <fork@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    $0x0,%al
call   1050 <fork@plt>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
mov    $0xf,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
je     1150 <main+0x20>
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
jne    1157 <main+0x27>
xor    %eax,%eax
call   1050 <fork@plt>
xor    %eax,%eax
call   1050 <fork@plt>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
mov    $0xf,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"forked\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @fork()
%3 = call i64 (...) @fork()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i64 (...) @fork()
%7 = icmp ne i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5, %0
%9 = call i64 (...) @fork()
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ true, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
%14 = call i64 (...) @fork()
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @sleep(i32 15)
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"forked\00"
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = tail call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i64 (...) @fork()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4, %0
%8 = tail call i64 (...) @fork()
br label %9
9: ; preds = %7, %4
%10 = tail call i64 (...) @fork()
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @sleep(i32 15)
ret i32 0
}
/* Variables and functions */
char *CuStrAlloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *CuStrCopy(const char *old) {
  int len = strlen(old);
  char *new = CuStrAlloc(len + 1);
  strcpy(new, old);
  return new;
}


x86 assembly (clang, -O0):
<CuStrCopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1050 <CuStrAlloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CuStrCopy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <CuStrAlloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @CuStrCopy(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @CuStrAlloc(i32 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void sig_hander(int sig) {
  while (waitpid(-1, NULL, WNOHANG) > 0)
    ;
}


x86 assembly (clang, -O0):
<sig_hander>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    1141 <sig_hander+0x31>
jmp    111b <sig_hander+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_hander>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <sig_hander+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @sig_hander(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 -1, i32* null, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @sig_hander(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
unsigned xrop3_165_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = T ^ D;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_165_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_165_1_1>:
mov    %esi,%eax
or     %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %esi,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_165_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
store i32 %20, i32* %7
%21 = load i32, i32* %7
%22 = load i32, i32* %5
%23 = xor i32 %21, %22
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = xor i32 %24, -1
store i32 %25, i32* %8
%26 = load i32, i32* %8
%27 = load i32, i32* %6
%28 = xor i32 %27, -1
%29 = and i32 %26, %28
%30 = load i32, i32* %7
%31 = xor i32 %30, -1
%32 = and i32 %29, %31
%33 = load i32, i32* %5
%34 = load i32, i32* %6
%35 = and i32 %33, %34
%36 = or i32 %32, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %7
%39 = and i32 %37, %38
%40 = or i32 %36, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @xrop3_165_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = or i8 %1, %0
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = or i32 %8, %4
%10 = xor i32 %9, -256
ret i32 %10
}
/* Variables and functions */
scalar_t__ isprint(unsigned char);
scalar_t__ isspace(unsigned char);
int printable(unsigned char c) {
  return (!(c & 0x80) && (isprint(c) || isspace(c)));
}


x86 assembly (clang, -O0):
<printable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
and    $0x80,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    117a <printable+0x5a>
movzbl -0x1(%rbp),%edi
call   1040 <isprint@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x3(%rbp)
jne    1174 <printable+0x54>
movzbl -0x1(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printable>:
push   %rbx
test   %dil,%dil
js     1140 <printable+0x20>
movzbl %dil,%ebx
mov    %ebx,%edi
call   1040 <isprint@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1144 <printable+0x24>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @printable(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 128
%6 = icmp ne i32 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %1
%8 = load i8, i8* %2
%9 = call i64 @isprint(i8 zeroext %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i8, i8* %2
%13 = call i64 @isspace(i8 zeroext %12)
%14 = icmp ne i64 %13, 0
br label %15
15: ; preds = %11, %7
%16 = phi i1 [ true, %7 ], [ %14, %11 ]
br label %17
17: ; preds = %15, %1
%18 = phi i1 [ false, %1 ], [ %16, %15 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @printable(i8 zeroext %0) {
%2 = icmp sgt i8 %0, -1
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = tail call i64 @isprint(i8 zeroext %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @isspace(i8 zeroext %0)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %3, %6, %1
%11 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ print(int);
int main() {
  int i;
  for (i = 0; i < 5; i++) {
    print(i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <print@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <print@plt>
mov    $0x1,%edi
call   1030 <print@plt>
mov    $0x2,%edi
call   1030 <print@plt>
mov    $0x3,%edi
call   1030 <print@plt>
mov    $0x4,%edi
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print(i32 0)
%2 = tail call i32 @print(i32 1)
%3 = tail call i32 @print(i32 2)
%4 = tail call i32 @print(i32 3)
%5 = tail call i32 @print(i32 4)
ret i32 0
}
__attribute__((patchable_function_entry(0))) void f0() {}


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

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

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

LLVM IR (-O2):
define void @f0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void deldata(void *d) { free(d); }


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

x86 assembly (clang, -O2):
<deldata>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @deldata(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct fid_ep {
  int dummy;
};
struct fid_domain {
  int dummy;
};
struct fi_info {
  int dummy;
};

/* Variables and functions */
int gnix_ep_open(struct fid_domain *, struct fi_info *, struct fid_ep **,
                 void *);
int fi_endpoint(struct fid_domain *domain, struct fi_info *info,
                struct fid_ep **ep, void *context) {
  return gnix_ep_open(domain, info, ep, context);
}


x86 assembly (clang, -O0):
<fi_endpoint>:
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),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <gnix_ep_open@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fi_endpoint>:
jmp    1030 <gnix_ep_open@plt>

LLVM IR (-O0):
%struct.fid_domain = type { i32 }
%struct.fi_info = type { i32 }
%struct.fid_ep = type { i32 }
define i32 @fi_endpoint(%struct.fid_domain* %0, %struct.fi_info* %1, %struct.fid_ep** %2, i8* %3) {
%5 = alloca %struct.fid_domain*
%6 = alloca %struct.fi_info*
%7 = alloca %struct.fid_ep**
%8 = alloca i8*
store %struct.fid_domain* %0, %struct.fid_domain** %5
store %struct.fi_info* %1, %struct.fi_info** %6
store %struct.fid_ep** %2, %struct.fid_ep*** %7
store i8* %3, i8** %8
%9 = load %struct.fid_domain*, %struct.fid_domain** %5
%10 = load %struct.fi_info*, %struct.fi_info** %6
%11 = load %struct.fid_ep**, %struct.fid_ep*** %7
%12 = load i8*, i8** %8
%13 = call i32 @gnix_ep_open(%struct.fid_domain* %9, %struct.fi_info* %10, %struct.fid_ep** %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.fid_domain = type { i32 }
%struct.fi_info = type { i32 }
%struct.fid_ep = type { i32 }
define i32 @fi_endpoint(%struct.fid_domain* %0, %struct.fi_info* %1, %struct.fid_ep** %2, i8* %3) {
%5 = tail call i32 @gnix_ep_open(%struct.fid_domain* %0, %struct.fi_info* %1, %struct.fid_ep** %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
size_t ls_memdiff_ex(void const *const, void const *const, size_t const, int);
size_t ls_memdiff(const void *const restrict cmp1,
                  const void *const restrict cmp2, const size_t size) {
  return ls_memdiff_ex(cmp1, cmp2, size, 16);
}


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

x86 assembly (clang, -O2):
<ls_memdiff>:
mov    $0x10,%ecx
jmp    1030 <ls_memdiff_ex@plt>

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

LLVM IR (-O2):
define i64 @ls_memdiff(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = tail call i64 @ls_memdiff_ex(i8* %0, i8* %1, i64 %2, i32 16)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int main() {
  f(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *wcalloc(size_t nelements, size_t bytes) {
  void *tmp;
  tmp = NULL;
  tmp = calloc(nelements, bytes);
  if (tmp == NULL) {
    fprintf(stderr, "Calloc() error: Out of memory.\n");
    exit(EXIT_FAILURE);
  }
  return (tmp);
}


x86 assembly (clang, -O0):
<wcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1187 <wcalloc+0x57>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xe8c(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcalloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <wcalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Calloc() error: Out of memory.\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @wcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
store i8* null, i8** %5
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Calloc() error: Out of memory.\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @wcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Variables and functions */
float expf(float);
float alogf(float x) { return expf(x); }


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

x86 assembly (clang, -O2):
<alogf>:
jmp    1030 <expf@plt>

LLVM IR (-O0):
define float @alogf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @expf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @alogf(float %0) {
%2 = tail call float @expf(float %0)
ret float %2
}
int fun(char *a) {
  if (*a == 0)
    return 0;
  return fun(a + 1) + 1;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1138 <fun+0x28>
movl   $0x0,-0x4(%rbp)
jmp    114b <fun+0x3b>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <fun@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
cmpb   $0x0,(%rdi)
je     111c <fun+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <fun+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @fun(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add nuw nsw i32 %6, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
int Sequential_Search1(int a[], int n, int key) {
  int i;
  for (i = 1; i <= n; i++) {
    if (a[1] == key)
      return i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Sequential_Search1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     114f <Sequential_Search1+0x4f>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
cmp    -0x18(%rbp),%eax
jne    113c <Sequential_Search1+0x3c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <Sequential_Search1+0x56>
jmp    1141 <Sequential_Search1+0x41>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <Sequential_Search1+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sequential_Search1>:
xor    %eax,%eax
test   %esi,%esi
jle    1119 <Sequential_Search1+0x19>
mov    0x4(%rdi),%ecx
nopl   0x0(%rax)
cmp    %edx,%ecx
je     111a <Sequential_Search1+0x1a>
add    $0xffffffff,%esi
jne    1110 <Sequential_Search1+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @Sequential_Search1(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%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 1, i32* %8
br label %9
9: ; preds = %22, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %25
13: ; preds = %9
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = load i32, i32* %7
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = load i32, i32* %8
store i32 %20, i32* %4
br label %26
21: ; preds = %13
br label %22
22: ; preds = %21
%23 = load i32, i32* %8
%24 = add nsw i32 %23, 1
store i32 %24, i32* %8
br label %9
25: ; preds = %9
store i32 0, i32* %4
br label %26
26: ; preds = %25, %19
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
define i32 @Sequential_Search1(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, 1
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, %2
br label %9
9: ; preds = %5, %11
%10 = phi i32 [ 1, %5 ], [ %12, %11 ]
br i1 %8, label %14, label %11
11: ; preds = %9
%12 = add nuw i32 %10, 1
%13 = icmp eq i32 %10, %1
br i1 %13, label %14, label %9
14: ; preds = %9, %11, %3
%15 = phi i32 [ 0, %3 ], [ 0, %11 ], [ 1, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ Tracking_UI_setTargetPressed();
void UI_UI_setTargetPressed() { Tracking_UI_setTargetPressed(); }


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

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

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

LLVM IR (-O2):
define void @UI_UI_setTargetPressed() {
%1 = tail call i32 (...) @Tracking_UI_setTargetPressed()
ret void
}