xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int pid_t;
typedef int id_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int wait(int *);
id_t r_wait(int *stat_loc) {
  pid_t retval;
  while (((retval = wait(stat_loc)) == -1) && (errno == EINTR))
    ;
  return retval;
}


x86 assembly (clang, -O0):
<r_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <wait@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0xd(%rbp)
jne    1152 <r_wait+0x42>
mov    0x2ea1(%rip),%rax
mov    (%rax),%rax
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1162 <r_wait+0x52>
jmp    1167 <r_wait+0x57>
jmp    111c <r_wait+0xc>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_wait>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2ec1(%rip),%r14
mov    0x2eb2(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <wait@plt>
cmp    $0xffffffff,%eax
jne    1145 <r_wait+0x35>
mov    (%r15),%rcx
cmp    %rcx,(%r14)
je     1130 <r_wait+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @r_wait(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %14, %1
%5 = load i32*, i32** %2
%6 = call i32 @wait(i32* %5)
store i32 %6, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i64, i64* @errno
%10 = load i64, i64* @EINTR
%11 = icmp eq i64 %9, %10
br label %12
12: ; preds = %8, %4
%13 = phi i1 [ false, %4 ], [ %11, %8 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %4
15: ; preds = %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @r_wait(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @wait(i32* %0)
%4 = icmp eq i32 %3, -1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EINTR
%7 = icmp eq i64 %5, %6
%8 = select i1 %4, i1 %7, i1 false
br i1 %8, label %2, label %9
9: ; preds = %2
ret i32 %3
}
/* Type definitions */
struct activity {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stub_print_memory_stats(struct activity *, int, int,
                                           unsigned long long, int);
void print_avg_memory_stats(struct activity *a, int prev, int curr,
                            unsigned long long itv) {
  stub_print_memory_stats(a, prev, curr, itv, 1);
}


x86 assembly (clang, -O0):
<print_avg_memory_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <stub_print_memory_stats@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_avg_memory_stats>:
mov    $0x1,%r8d
jmp    1030 <stub_print_memory_stats@plt>

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

LLVM IR (-O2):
%struct.activity = type { i32 }
define void @print_avg_memory_stats(%struct.activity* %0, i32 %1, i32 %2, i64 %3) {
%5 = tail call i32 @stub_print_memory_stats(%struct.activity* %0, i32 %1, i32 %2, i64 %3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pipe(int pipefd[2]) {
  assert(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @pipe(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @pipe(i32* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ a(int /*<<< orphan*/);
int /*<<< orphan*/ b(int /*<<< orphan*/);
int /*<<< orphan*/ c(int /*<<< orphan*/);
int /*<<< orphan*/ d(int /*<<< orphan*/);
main() {
  a(0);
  b(0);
  c(0);
  d(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1060 <a@plt>
xor    %edi,%edi
call   1040 <b@plt>
xor    %edi,%edi
call   1050 <c@plt>
xor    %edi,%edi
call   1030 <d@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <a@plt>
xor    %edi,%edi
call   1040 <b@plt>
xor    %edi,%edi
call   1050 <c@plt>
xor    %edi,%edi
call   1030 <d@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @a(i32 0)
%2 = call i32 @b(i32 0)
%3 = call i32 @c(i32 0)
%4 = call i32 @d(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @a(i32 0)
%2 = tail call i32 @b(i32 0)
%3 = tail call i32 @c(i32 0)
%4 = tail call i32 @d(i32 0)
ret i32 0
}
/* Variables and functions */
char *strdup(char const *);
char *dupstr(const void *a) { return strdup((const char *)a); }


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

x86 assembly (clang, -O2):
<dupstr>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @dupstr(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
char *strstr(char const *, char *);
const char *check_funcptr(const char *type) {
  const char *str = strstr(type, "(*)");
  if (str)
    return str + 2;
  return NULL;
}


x86 assembly (clang, -O0):
<check_funcptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114c <check_funcptr+0x3c>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <check_funcptr+0x44>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_funcptr>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
lea    0x2(%rax),%rcx
test   %rax,%rax
cmovne %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"(*)\00"
define i8* @check_funcptr(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 2
%5 = select i1 %3, i8* null, i8* %4
ret i8* %5
}
/* Type definitions */
struct in_addr {
  scalar_t__ s_addr;
};

/* Variables and functions */
__attribute__((always_)) int ip4equal(const struct in_addr *a,
                                      const struct in_addr *b) {
  return a->s_addr == b->s_addr;
}


x86 assembly (clang, -O0):
<ip4equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip4equal>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
sete   %al
ret

LLVM IR (-O0):
%struct.in_addr = type { i64 }
define i32 @ip4equal(%struct.in_addr* %0, %struct.in_addr* %1) {
%3 = alloca %struct.in_addr*
%4 = alloca %struct.in_addr*
store %struct.in_addr* %0, %struct.in_addr** %3
store %struct.in_addr* %1, %struct.in_addr** %4
%5 = load %struct.in_addr*, %struct.in_addr** %3
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = load %struct.in_addr*, %struct.in_addr** %4
%9 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = icmp eq i64 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.in_addr = type { i64 }
define i32 @ip4equal(%struct.in_addr* nocapture %0, %struct.in_addr* nocapture %1) {
%3 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %0, i64 0, i32 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int default_screen_is_locked(struct backlight *b) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.backlight = type opaque
define i32 @default_screen_is_locked(%struct.backlight* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ chtype;

/* Variables and functions */
scalar_t__ ERR;
scalar_t__ addch(int /*<<< orphan*/);
uint8_t ccbi_addch(chtype c) { return ((addch(c)) == ERR ? 0 : 1); }


x86 assembly (clang, -O0):
<ccbi_addch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <addch@plt>
mov    %rax,%rdx
mov    0x2ebb(%rip),%rax
mov    (%rax),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@ERR = global i64 0
define i32 @ccbi_addch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @addch(i32 %3)
%5 = load i64, i64* @ERR
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 1
ret i32 %8
}

LLVM IR (-O2):
@ERR = global i64 0
define i32 @ccbi_addch(i32 %0) {
%2 = tail call i64 @addch(i32 %0)
%3 = load i64, i64* @ERR
%4 = icmp ne i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ realCreate(int, int);
int main() {
  realCreate(0, 0);
  realCreate(10, 0);
  realCreate(20, 20);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @realCreate(i32 0, i32 0)
%2 = tail call i32 @realCreate(i32 10, i32 0)
%3 = tail call i32 @realCreate(i32 20, i32 20)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() {
  int num = 1;
  char *c = (char *)&num;
  if (*c)
    printf("Little-Endian\n");
  else
    printf("Big-Endian\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <main+0x35>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
jmp    1151 <main+0x41>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Little-Endian\0A\00"
@.str.1 = [12 x i8] c"Big-Endian\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 1, i32* %1
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"Little-Endian\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ executer(char *);
int printf(char *);
int scanf(char *, char *);
void dialoguer(void) {
  char nom[100];
  while (printf("> "), scanf("%s", nom) == 1) {
    executer(nom);
  }
}


x86 assembly (clang, -O0):
<dialoguer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    116b <dialoguer+0x3b>
lea    -0x70(%rbp),%rdi
call   1050 <executer@plt>
jmp    1138 <dialoguer+0x8>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dialoguer>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1190 <dialoguer+0x60>
mov    %rsp,%rbx
lea    0xe9d(%rip),%r14
lea    0xe99(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <executer@plt>
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     1170 <dialoguer+0x40>
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"> \00"
@.str.1 = [3 x i8] c"%s\00"
define void @dialoguer() {
%1 = alloca [100 x i8]
br label %2
2: ; preds = %7, %0
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%9 = call i32 @executer(i8* %8)
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"> \00"
@.str.1 = [3 x i8] c"%s\00"
define void @dialoguer() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %11
6: ; preds = %0, %6
%7 = call i32 @executer(i8* %2)
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%10 = icmp eq i32 %9, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %0
ret void
}
__attribute__((__no__)) void
do_nothing_big_hole_assigned_dynamic_partial(struct test_big_hole *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_big_hole_assigned_dynamic_partial>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_big_hole_assigned_dynamic_partial+0x1b>
jmp    1120 <do_nothing_big_hole_assigned_dynamic_partial+0x20>
jmp    1120 <do_nothing_big_hole_assigned_dynamic_partial+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_big_hole = type opaque
define void @do_nothing_big_hole_assigned_dynamic_partial(%struct.test_big_hole* %0) {
%2 = alloca %struct.test_big_hole*
store %struct.test_big_hole* %0, %struct.test_big_hole** %2
%3 = load %struct.test_big_hole*, %struct.test_big_hole** %2
%4 = ptrtoint %struct.test_big_hole* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_big_hole = type opaque
define void @do_nothing_big_hole_assigned_dynamic_partial(%struct.test_big_hole* nocapture %0) {
ret void
}
/* Variables and functions */
int get_status();
int /*<<< orphan*/ set_status(int);
void set_bev(int yesOrNo) {
  int t = get_status();
  if (yesOrNo) {
    t |= 0x00400000;
  } else {
    t &= ~0x00400000;
  }
  set_status(t);
}


x86 assembly (clang, -O0):
<set_bev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_status@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114f <set_bev+0x2f>
mov    -0x8(%rbp),%eax
or     $0x400000,%eax
mov    %eax,-0x8(%rbp)
jmp    115a <set_bev+0x3a>
mov    -0x8(%rbp),%eax
and    $0xffbfffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <set_status@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bev>:
push   %rbx
xor    %ebx,%ebx
test   %edi,%edi
setne  %bl
xor    %eax,%eax
call   1040 <get_status@plt>
and    $0xffbfffff,%eax
shl    $0x16,%ebx
or     %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <set_status@plt>

LLVM IR (-O0):
define void @set_bev(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @get_status()
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = or i32 %8, 4194304
store i32 %9, i32* %3
br label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = and i32 %11, -4194305
store i32 %12, i32* %3
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %3
%15 = call i32 @set_status(i32 %14)
ret void
}

LLVM IR (-O2):
define void @set_bev(i32 %0) {
%2 = tail call i32 (...) @get_status()
%3 = icmp eq i32 %0, 0
%4 = and i32 %2, -4194305
%5 = select i1 %3, i32 0, i32 4194304
%6 = or i32 %4, %5
%7 = tail call i32 @set_status(i32 %6)
ret void
}
/* Variables and functions */
scalar_t__ it_proper(int);
int /*<<< orphan*/ strcpy(char *, char *);
void theset(char *buff, int item) {
  if (it_proper(item))
    strcpy(buff, "");
  else
    strcpy(buff, "the ");
}


x86 assembly (clang, -O0):
<theset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <it_proper@plt>
cmp    $0x0,%rax
je     1156 <theset+0x36>
mov    -0x8(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1166 <theset+0x46>
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<theset>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <it_proper@plt>
test   %rax,%rax
lea    0xecb(%rip),%rax
lea    0xec8(%rip),%rsi
cmove  %rax,%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"the \00"
define void @theset(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i64 @it_proper(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @strcpy(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"the \00"
define void @theset(i8* %0, i32 %1) {
%3 = tail call i64 @it_proper(i32 %1)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @strcpy(i8* %0, i8* %5)
ret void
}
unsigned sra(unsigned x, int k) {
  int xsrl = (unsigned)x >> k;
  int sign = x & 1 << (sizeof(int) << 3 - 1);
  int mask = ((1 << k) - 1) << (sizeof(int) << 3 - k);
  (sign) && (xsrl |= mask);
  return xsrl;
}


x86 assembly (clang, -O0):
<sra>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x10000,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    $0x3,%ecx
sub    -0x8(%rbp),%ecx
mov    %ecx,%ecx
mov    $0x4,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x15(%rbp)
je     1168 <sra+0x68>
mov    -0x14(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sra>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
test   $0x10000,%edi
je     112b <sra+0x2b>
mov    $0xffffffff,%edi
shl    %cl,%edi
not    %edi
mov    $0x3,%dl
sub    %cl,%dl
mov    $0x4,%esi
mov    %edx,%ecx
shl    %cl,%rsi
mov    %esi,%ecx
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @sra(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = lshr i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = and i32 %11, 65536
store i32 %12, i32* %6
%13 = load i32, i32* %4
%14 = shl i32 1, %13
%15 = sub nsw i32 %14, 1
%16 = load i32, i32* %4
%17 = sub nsw i32 3, %16
%18 = zext i32 %17 to i64
%19 = shl i64 4, %18
%20 = trunc i64 %19 to i32
%21 = shl i32 %15, %20
store i32 %21, i32* %7
%22 = load i32, i32* %6
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %29
24: ; preds = %2
%25 = load i32, i32* %7
%26 = load i32, i32* %5
%27 = or i32 %26, %25
store i32 %27, i32* %5
%28 = icmp ne i32 %27, 0
br label %29
29: ; preds = %24, %2
%30 = phi i1 [ false, %2 ], [ %28, %24 ]
%31 = zext i1 %30 to i32
%32 = load i32, i32* %5
ret i32 %32
}

LLVM IR (-O2):
define i32 @sra(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %0, 65536
%5 = icmp eq i32 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = shl nsw i32 -1, %1
%8 = xor i32 %7, -1
%9 = sub nsw i32 3, %1
%10 = zext i32 %9 to i64
%11 = shl i64 4, %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %8, %12
%14 = or i32 %13, %3
br label %15
15: ; preds = %6, %2
%16 = phi i32 [ %14, %6 ], [ %3, %2 ]
ret i32 %16
}
void outreg(int channel, int reg, unsigned char val) {
  *((volatile unsigned char *)0xfffce800 + (channel * 0x0) + (reg * 0x1)) = val;
}


x86 assembly (clang, -O0):
<outreg>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
imul   $0x0,-0x4(%rbp),%eax
movslq %eax,%rcx
mov    $0xfffce800,%eax
add    %rcx,%rax
mov    -0x8(%rbp),%ecx
shl    $0x0,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outreg>:
movslq %esi,%rax
mov    $0xfffce800,%ecx
mov    %dl,(%rax,%rcx,1)
ret

LLVM IR (-O0):
define void @outreg(i32 %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = load i32, i32* %4
%9 = mul nsw i32 %8, 0
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* inttoptr (i64 4294764544 to i8*), i64 %10
%12 = load i32, i32* %5
%13 = mul nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
store volatile i8 %7, i8* %15
ret void
}

LLVM IR (-O2):
define void @outreg(i32 %0, i32 %1, i8 zeroext %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* inttoptr (i64 4294764544 to i8*), i64 %4
store volatile i8 %2, i8* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int syscall(int, int, char const *, int /*<<< orphan*/, int /*<<< orphan*/);
int mknodat(int fd, const char *path, mode_t mode, dev_t dev) {
  return syscall(324, fd, path, mode, dev);
}


x86 assembly (clang, -O0):
<mknodat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    $0x144,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mknodat>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x144,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @mknodat(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @syscall(i32 324, i32 %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void quote_calc_error(const char *s) { fprintf(stderr, "%s\n", s); }


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

x86 assembly (clang, -O2):
<quote_calc_error>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @quote_calc_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @quote_calc_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int f3(char *);
int f4(void) {
  char buf[131072];
  return f3(buf);
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20000,%rsp
lea    -0x20000(%rbp),%rdi
call   1030 <f3@plt>
add    $0x20000,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
sub    $0x20008,%rsp
mov    %rsp,%rdi
call   1030 <f3@plt>
add    $0x20008,%rsp
ret

LLVM IR (-O0):
define i32 @f4() {
%1 = alloca [131072 x i8]
%2 = getelementptr inbounds [131072 x i8], [131072 x i8]* %1, i64 0, i64 0
%3 = call i32 @f3(i8* %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @f4() {
%1 = alloca [131072 x i8]
%2 = getelementptr inbounds [131072 x i8], [131072 x i8]* %1, i64 0, i64 0
%3 = call i32 @f3(i8* %2)
ret i32 %3
}
int compare(const void *i, const void *j) { return *(int *)(i) - *(int *)(j); }


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ intcmp(char *, char *);
int binary_le(char *s1, char *s2) { return intcmp(s1, s2) <= 0; }


x86 assembly (clang, -O0):
<binary_le>:
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 <intcmp@plt>
cmp    $0x0,%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_le>:
push   %rax
call   1030 <intcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setle  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @binary_le(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @intcmp(i8* %5, i8* %6)
%8 = icmp sle i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @binary_le(i8* %0, i8* %1) {
%3 = tail call i64 @intcmp(i8* %0, i8* %1)
%4 = icmp slt i64 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
void *__coverity_alloc__(int);
int /*<<< orphan*/ __coverity_mark_as_afm_allocated__(void *, char *);
void *H5Tvlen_create(void *base_type_id) {
  void *id = __coverity_alloc__(10);
  __coverity_mark_as_afm_allocated__(id, "H5Tclose");
  return id;
}


x86 assembly (clang, -O0):
<H5Tvlen_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<H5Tvlen_create>:
push   %rbx
mov    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"H5Tclose\00"
define i8* @H5Tvlen_create(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @__coverity_alloc__(i32 10)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @__coverity_mark_as_afm_allocated__(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
@.str = [9 x i8] c"H5Tclose\00"
define i8* @H5Tvlen_create(i8* nocapture readnone %0) {
%2 = tail call i8* @__coverity_alloc__(i32 10)
%3 = tail call i32 @__coverity_mark_as_afm_allocated__(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Type definitions */
struct iovec {
  int /*<<< orphan*/ member_0;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int process_vm_readv(int /*<<< orphan*/, struct iovec *, unsigned long,
                     struct iovec *, unsigned long, unsigned long);
int main(void) {
  pid_t pid = 0;
  struct iovec local_iov = {0};
  struct iovec remote_iov = {0};
  unsigned long liovcnt = 1;
  unsigned long riovcnt = 1;
  unsigned long flags = 0;
  return process_vm_readv(pid, &local_iov, liovcnt, &remote_iov, riovcnt,
                          flags);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
movq   $0x1,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rcx
call   1040 <process_vm_readv@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x0,0x10(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rcx
mov    $0x1,%edx
mov    $0x1,%r8d
xor    %edi,%edi
xor    %r9d,%r9d
call   1030 <process_vm_readv@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.iovec = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.iovec
%4 = alloca %struct.iovec
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %2
%8 = bitcast %struct.iovec* %3 to i8*
%9 = bitcast %struct.iovec* %4 to i8*
store i64 1, i64* %5
store i64 1, i64* %6
store i64 0, i64* %7
%10 = load i32, i32* %2
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = call i32 @process_vm_readv(i32 %10, %struct.iovec* %3, i64 %11, %struct.iovec* %4, i64 %12, i64 %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @main() {
%1 = alloca %struct.iovec
%2 = alloca %struct.iovec
%3 = bitcast %struct.iovec* %1 to i8*
%4 = getelementptr inbounds %struct.iovec, %struct.iovec* %1, i64 0, i32 0
store i32 0, i32* %4
%5 = bitcast %struct.iovec* %2 to i8*
%6 = getelementptr inbounds %struct.iovec, %struct.iovec* %2, i64 0, i32 0
store i32 0, i32* %6
%7 = call i32 @process_vm_readv(i32 0, %struct.iovec* %1, i64 1, %struct.iovec* %2, i64 1, i64 0)
ret i32 %7
}
long bitcount(long n) {
  long c = 0;
  while (n != 0) {
    c += (n & 1L);
    n >>= 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <bitcount+0x3c>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <bitcount+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %rdi,%rdi
je     1124 <bitcount+0x24>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %rdx,%rax
sar    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i64 @bitcount(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %8, %3 ], [ %0, %1 ]
%6 = and i64 %5, 1
%7 = add nuw nsw i64 %4, %6
%8 = ashr i64 %5, 1
%9 = icmp ult i64 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i64 [ 0, %1 ], [ %7, %3 ]
ret i64 %11
}
/* Type definitions */
struct bplus_non_leaf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct bplus_non_leaf *);
void non_leaf_delete(struct bplus_non_leaf *node) { free(node); }


x86 assembly (clang, -O0):
<non_leaf_delete>:
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):
<non_leaf_delete>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.bplus_non_leaf = type { i32 }
define void @non_leaf_delete(%struct.bplus_non_leaf* %0) {
%2 = alloca %struct.bplus_non_leaf*
store %struct.bplus_non_leaf* %0, %struct.bplus_non_leaf** %2
%3 = load %struct.bplus_non_leaf*, %struct.bplus_non_leaf** %2
%4 = call i32 @free(%struct.bplus_non_leaf* %3)
ret void
}

LLVM IR (-O2):
%struct.bplus_non_leaf = type { i32 }
define void @non_leaf_delete(%struct.bplus_non_leaf* nocapture %0) {
%2 = tail call i32 @free(%struct.bplus_non_leaf* %0)
ret void
}
/* Variables and functions */
int fdt_subnode_offset_namelen(void const *, int, char const *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name) {
  return fdt_subnode_offset_namelen(fdt, parentoffset, name, strlen(name));
}


x86 assembly (clang, -O0):
<fdt_subnode_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
call   1040 <fdt_subnode_offset_namelen@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdt_subnode_offset>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fdt_subnode_offset_namelen@plt>

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

LLVM IR (-O2):
define i32 @fdt_subnode_offset(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i32 @fdt_subnode_offset_namelen(i8* %0, i32 %1, i8* %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
char *strrchr(char *, char);
void strip_ext(char *name) {
  char *period;
  period = strrchr(name, '.');
  if (period)
    *period = '\0';
}


x86 assembly (clang, -O0):
<strip_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <strip_ext+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_ext>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1123 <strip_ext+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @strip_ext(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
int printf(char *, char const *);
int printError(const char *message) {
  int ret = 0;
  ret = printf("ERROR: %s", message);
  return ret;
}


x86 assembly (clang, -O0):
<printError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printError>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"ERROR: %s\00"
define i32 @printError(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
@.str = [10 x i8] c"ERROR: %s\00"
define i32 @printError(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
unsigned long thread_saved_pc(struct task_struct *tsk) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define i64 @thread_saved_pc(%struct.task_struct* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ RS232_SendByte(int, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void RS232_cputs(int comport_number, const char *text) {
  while (*text != 0)
    RS232_SendByte(comport_number, *(text++));
  sleep(1);
}


x86 assembly (clang, -O0):
<RS232_cputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115e <RS232_cputs+0x3e>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
call   1030 <RS232_SendByte@plt>
jmp    112f <RS232_cputs+0xf>
mov    $0x1,%edi
call   1040 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RS232_cputs>:
push   %rbp
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1155 <RS232_cputs+0x35>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%esi
mov    %ebp,%edi
call   1030 <RS232_SendByte@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <RS232_cputs+0x20>
mov    $0x1,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <sleep@plt>

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

LLVM IR (-O2):
define void @RS232_cputs(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = sext i8 %6 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = tail call i32 @RS232_SendByte(i32 %0, i32 %8)
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = tail call i32 @sleep(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, char *);
void exceedance_curve_output_get_where_clause(char *where_clause, char *station,
                                              char *datatype, char *begin_date,
                                              char *end_date) {
  sprintf(where_clause,
          "station = '%s' and datatype = '%s' and measurement_date between "
          "'%s' and '%s' and measurement_value is not null",
          station, datatype, begin_date, end_date);
}


x86 assembly (clang, -O0):
<exceedance_curve_output_get_where_clause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
lea    0xeb9(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exceedance_curve_output_get_where_clause>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xedd(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [112 x i8] c"station = '%s' and datatype = '%s' and measurement_date between '%s' and '%s' and measurement_value is not null\00"
define void @exceedance_curve_output_get_where_clause(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13, i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [112 x i8] c"station = '%s' and datatype = '%s' and measurement_date between '%s' and '%s' and measurement_value is not null\00"
define void @exceedance_curve_output_get_where_clause(i8* nocapture writeonly %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3, i8* %4)
ret void
}
/* Variables and functions */
double median_weight_nocopy_double(int, double *, double *);
double median_weight_nocopy(int n, double *data, double *err) {
  return median_weight_nocopy_double(n, data, err);
}


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

x86 assembly (clang, -O2):
<median_weight_nocopy>:
jmp    1030 <median_weight_nocopy_double@plt>

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

LLVM IR (-O2):
define double @median_weight_nocopy(i32 %0, double* %1, double* %2) {
%4 = tail call double @median_weight_nocopy_double(i32 %0, double* %1, double* %2)
ret double %4
}