xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  int i = 0;
  int a;
  do {
    a = 5;
    i++;
  } while (i < 5);
  __print_int(a);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 5)
ret i32 0
}
/* Variables and functions */
scalar_t__ is_upalpha(int);
void strtolower(char *str) {
  int c;
  while ((c = *(unsigned char *)str)) {
    if (is_upalpha(c))
      *(unsigned char *)str = c + ('a' - 'A');
    str++;
  }
}


x86 assembly (clang, -O0):
<strtolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1160 <strtolower+0x50>
mov    -0xc(%rbp),%edi
call   1030 <is_upalpha@plt>
cmp    $0x0,%rax
je     114f <strtolower+0x3f>
mov    -0xc(%rbp),%eax
add    $0x20,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strtolower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtolower>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%bpl
test   %bpl,%bpl
je     1154 <strtolower+0x44>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    113c <strtolower+0x2c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%ebp
add    $0x1,%rbx
test   %bpl,%bpl
je     1154 <strtolower+0x44>
movzbl %bpl,%edi
call   1030 <is_upalpha@plt>
test   %rax,%rax
je     1130 <strtolower+0x20>
add    $0x20,%bpl
mov    %bpl,-0x1(%rbx)
jmp    1130 <strtolower+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @strtolower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = zext i8 %5 to i32
%8 = tail call i64 @is_upalpha(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = add i8 %5, 32
store i8 %11, i8* %6
br label %12
12: ; preds = %10, %4
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret void
}
int PDC_get_cur_row() {}


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

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

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

LLVM IR (-O2):
define i32 @PDC_get_cur_row() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void add_mul(int x, int y, int *pointeur_add, int *pointeur_mul) {
  printf("pointeur_add=%i, pointeur_mul=%i\n", *pointeur_add, *pointeur_mul);
  *pointeur_add = x + y;
  *pointeur_mul = x * y;
}


x86 assembly (clang, -O0):
<add_mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_mul>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%ebx
mov    %edi,%r12d
mov    (%rdx),%esi
mov    (%rcx),%edx
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
lea    (%rbx,%r12,1),%eax
mov    %eax,(%r15)
imul   %r12d,%ebx
mov    %ebx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [34 x i8] c"pointeur_add=%i, pointeur_mul=%i\0A\00"
define void @add_mul(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %7
%10 = load i32, i32* %9
%11 = load i32*, i32** %8
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = add nsw i32 %14, %15
%17 = load i32*, i32** %7
store i32 %16, i32* %17
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = mul nsw i32 %18, %19
%21 = load i32*, i32** %8
store i32 %20, i32* %21
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"pointeur_add=%i, pointeur_mul=%i\0A\00"
define void @add_mul(i32 %0, i32 %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = add nsw i32 %1, %0
store i32 %8, i32* %2
%9 = mul nsw i32 %1, %0
store i32 %9, i32* %3
ret void
}
/* Type definitions */
struct eb_node {
  int dummy;
};

/* Variables and functions */
struct eb_node *__eb_insert_dup(struct eb_node *, struct eb_node *);
struct eb_node *eb_insert_dup(struct eb_node *sub, struct eb_node *new) {
  return __eb_insert_dup(sub, new);
}


x86 assembly (clang, -O0):
<eb_insert_dup>:
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 <__eb_insert_dup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eb_insert_dup>:
jmp    1030 <__eb_insert_dup@plt>

LLVM IR (-O0):
%struct.eb_node = type { i32 }
define %struct.eb_node* @eb_insert_dup(%struct.eb_node* %0, %struct.eb_node* %1) {
%3 = alloca %struct.eb_node*
%4 = alloca %struct.eb_node*
store %struct.eb_node* %0, %struct.eb_node** %3
store %struct.eb_node* %1, %struct.eb_node** %4
%5 = load %struct.eb_node*, %struct.eb_node** %3
%6 = load %struct.eb_node*, %struct.eb_node** %4
%7 = call %struct.eb_node* @__eb_insert_dup(%struct.eb_node* %5, %struct.eb_node* %6)
ret %struct.eb_node* %7
}

LLVM IR (-O2):
%struct.eb_node = type { i32 }
define %struct.eb_node* @eb_insert_dup(%struct.eb_node* %0, %struct.eb_node* %1) {
%3 = tail call %struct.eb_node* @__eb_insert_dup(%struct.eb_node* %0, %struct.eb_node* %1)
ret %struct.eb_node* %3
}
/* Variables and functions */
char *allocate_something(int);
char *bar() { return allocate_something(25); }


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

x86 assembly (clang, -O2):
<bar>:
mov    $0x19,%edi
jmp    1030 <allocate_something@plt>

LLVM IR (-O0):
define i8* @bar() {
%1 = call i8* @allocate_something(i32 25)
ret i8* %1
}

LLVM IR (-O2):
define i8* @bar() {
%1 = tail call i8* @allocate_something(i32 25)
ret i8* %1
}
void unblockAsyncSignals(void) {}


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

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

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

LLVM IR (-O2):
define void @unblockAsyncSignals() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int sem_timedwait(int /*<<< orphan*/ *, int /*<<< orphan*/);
int sem_wait(sem_t *sem) { return sem_timedwait(sem, 0); }


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

x86 assembly (clang, -O2):
<sem_wait>:
xor    %esi,%esi
jmp    1030 <sem_timedwait@plt>

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

LLVM IR (-O2):
define i32 @sem_wait(i32* %0) {
%2 = tail call i32 @sem_timedwait(i32* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ remove_allocated_node(void *);
void wrapper_free(void *ptr) {
  remove_allocated_node(ptr);
  free(ptr);
}


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

x86 assembly (clang, -O2):
<wrapper_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <remove_allocated_node@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @wrapper_free(i8* %0) {
%2 = tail call i32 @remove_allocated_node(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printz();
int /*<<< orphan*/ sleep(int);
void bar() {
  sleep(1);
  printz();
  sleep(1);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    $0x0,%al
call   1030 <printz@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
mov    $0x1,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
call   1030 <printz@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
define void @bar() {
%1 = call i32 @sleep(i32 1)
%2 = call i32 (...) @printz()
%3 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 @sleep(i32 1)
%2 = tail call i32 (...) @printz()
%3 = tail call i32 @sleep(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fc(char *);
void gc(char b[]) { fc(b); }


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

x86 assembly (clang, -O2):
<gc>:
jmp    1030 <fc@plt>

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

LLVM IR (-O2):
define void @gc(i8* %0) {
%2 = tail call i32 @fc(i8* %0)
ret void
}
/* Variables and functions */
char getchar();
void pause(int *skip) {
  if (!*skip) {
    char c = getchar();
    while (c != '\n') {
      if (c == 's') {
        *skip = 1;
        c = '\n';
      }
      c = getchar();
    };
  }
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jne    116f <pause+0x5f>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
je     116a <pause+0x5a>
movsbl -0x9(%rbp),%eax
cmp    $0x73,%eax
jne    115b <pause+0x4b>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
movb   $0xa,-0x9(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x9(%rbp)
jmp    1133 <pause+0x23>
jmp    116f <pause+0x5f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rbx
cmpl   $0x0,(%rdi)
jne    1135 <pause+0x25>
mov    %rdi,%rbx
jmp    1126 <pause+0x16>
nopl   0x0(%rax,%rax,1)
movl   $0x1,(%rbx)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0x73,%al
je     1120 <pause+0x10>
cmp    $0xa,%al
jne    1126 <pause+0x16>
pop    %rbx
ret

LLVM IR (-O0):
define void @pause(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %22, label %7
7: ; preds = %1
%8 = call signext i8 (...) @getchar()
store i8 %8, i8* %3
br label %9
9: ; preds = %19, %7
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 10
br i1 %12, label %13, label %21
13: ; preds = %9
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 115
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i32*, i32** %2
store i32 1, i32* %18
store i8 10, i8* %3
br label %19
19: ; preds = %17, %13
%20 = call signext i8 (...) @getchar()
store i8 %20, i8* %3
br label %9
21: ; preds = %9
br label %22
22: ; preds = %21, %1
ret void
}

LLVM IR (-O2):
define void @pause(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1, %6
%5 = tail call signext i8 (...) @getchar()
switch i8 %5, label %6 [
i8 10, label %8
i8 115, label %7
]
6: ; preds = %4, %7
br label %4
7: ; preds = %4
store i32 1, i32* %0
br label %6
8: ; preds = %4, %1
ret void
}
int getsid() {}


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

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

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

LLVM IR (-O2):
define i32 @getsid() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: eva2bzimage <evafile> <bzimagefile>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"usage: eva2bzimage <evafile> <bzimagefile>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"usage: eva2bzimage <evafile> <bzimagefile>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr, "usage: %s [-r]\n", progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"usage: %s [-r]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct Node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print(struct Node *);
void printList(struct Node **buckets, int index) { print(buckets[index]); }


x86 assembly (clang, -O0):
<printList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printList>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rdi
jmp    1030 <print@plt>

LLVM IR (-O0):
%struct.Node = type { i32 }
define void @printList(%struct.Node** %0, i32 %1) {
%3 = alloca %struct.Node**
%4 = alloca i32
store %struct.Node** %0, %struct.Node*** %3
store i32 %1, i32* %4
%5 = load %struct.Node**, %struct.Node*** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.Node*, %struct.Node** %5, i64 %7
%9 = load %struct.Node*, %struct.Node** %8
%10 = call i32 @print(%struct.Node* %9)
ret void
}

LLVM IR (-O2):
%struct.Node = type { i32 }
define void @printList(%struct.Node** nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds %struct.Node*, %struct.Node** %0, i64 %3
%5 = load %struct.Node*, %struct.Node** %4
%6 = tail call i32 @print(%struct.Node* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int no_const_value = 0;
  int *const_value_p = &no_const_value;
  *const_value_p = 1;
  printf("%d\n", *const_value_p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
unsigned long mem_get_size(void *ptr) {
  unsigned long size =
      (unsigned long *)((char *)ptr - sizeof(unsigned long))[0];
  return (size);
}


x86 assembly (clang, -O0):
<mem_get_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbq -0x8(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_get_size>:
movsbq -0x8(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @mem_get_size(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 -8
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i64
%9 = inttoptr i64 %8 to i64*
%10 = ptrtoint i64* %9 to i64
store i64 %10, i64* %3
%11 = load i64, i64* %3
ret i64 %11
}

LLVM IR (-O2):
define i64 @mem_get_size(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = load i8, i8* %2
%4 = sext i8 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ rotate_wrap(int *, int, int);
void rotate(int *nums, int nums_size, int k) {
  k %= nums_size;
  rotate_wrap(nums, 0, nums_size - k - 1);
  rotate_wrap(nums, nums_size - k, nums_size - 1);
  rotate_wrap(nums, 0, nums_size - 1);
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    -0x10(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <rotate_wrap@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <rotate_wrap@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <rotate_wrap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%eax
mov    %esi,%ebx
mov    %rdi,%r14
cltd
idiv   %esi
mov    %esi,%ebp
sub    %edx,%ebp
neg    %edx
add    %ebx,%edx
add    $0xffffffff,%edx
xor    %esi,%esi
call   1030 <rotate_wrap@plt>
add    $0xffffffff,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <rotate_wrap@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <rotate_wrap@plt>

LLVM IR (-O0):
define void @rotate(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* %5
%8 = load i32, i32* %6
%9 = srem i32 %8, %7
store i32 %9, i32* %6
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = sub nsw i32 %11, %12
%14 = sub nsw i32 %13, 1
%15 = call i32 @rotate_wrap(i32* %10, i32 0, i32 %14)
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = sub nsw i32 %17, %18
%20 = load i32, i32* %5
%21 = sub nsw i32 %20, 1
%22 = call i32 @rotate_wrap(i32* %16, i32 %19, i32 %21)
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = sub nsw i32 %24, 1
%26 = call i32 @rotate_wrap(i32* %23, i32 0, i32 %25)
ret void
}

LLVM IR (-O2):
define void @rotate(i32* %0, i32 %1, i32 %2) {
%4 = srem i32 %2, %1
%5 = sub nsw i32 %1, %4
%6 = add nsw i32 %5, -1
%7 = tail call i32 @rotate_wrap(i32* %0, i32 0, i32 %6)
%8 = add nsw i32 %1, -1
%9 = tail call i32 @rotate_wrap(i32* %0, i32 %5, i32 %8)
%10 = tail call i32 @rotate_wrap(i32* %0, i32 0, i32 %8)
ret void
}
void temp_getprev(unsigned char *temp, const unsigned char *sched_keys,
                  int sk_iter) {
  for (int i = 0; i < 4; ++i) {
    temp[i] = sched_keys[sk_iter - (3 - i) - 1];
  }
  return;
}


x86 assembly (clang, -O0):
<temp_getprev>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jge    1153 <temp_getprev+0x53>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    $0x3,%edx
sub    -0x18(%rbp),%edx
sub    %edx,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <temp_getprev+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<temp_getprev>:
lea    -0x4(%rdx),%eax
cltq
mov    (%rsi,%rax,1),%al
mov    %al,(%rdi)
lea    -0x3(%rdx),%eax
cltq
mov    (%rsi,%rax,1),%al
mov    %al,0x1(%rdi)
lea    -0x2(%rdx),%eax
cltq
mov    (%rsi,%rax,1),%al
mov    %al,0x2(%rdi)
add    $0xffffffff,%edx
movslq %edx,%rax
mov    (%rsi,%rax,1),%al
mov    %al,0x3(%rdi)
ret

LLVM IR (-O0):
define void @temp_getprev(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %25, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 4
br i1 %10, label %11, label %28
11: ; preds = %8
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = sub nsw i32 3, %14
%16 = sub nsw i32 %13, %15
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %12, i64 %18
%20 = load i8, i8* %19
%21 = load i8*, i8** %4
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 %20, i8* %24
br label %25
25: ; preds = %11
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
store i32 %27, i32* %7
br label %8
28: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @temp_getprev(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = add i32 %2, -4
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
store i8 %7, i8* %0
%8 = add i32 %2, -3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %11, i8* %12
%13 = add i32 %2, -2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %1, i64 %14
%16 = load i8, i8* %15
%17 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %16, i8* %17
%18 = add i32 %2, -1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %1, i64 %19
%21 = load i8, i8* %20
%22 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %21, i8* %22
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t EMACVLANHashFilterGet(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x00000588))));
}


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

x86 assembly (clang, -O2):
<EMACVLANHashFilterGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0x588(%rax),%rax
ret

LLVM IR (-O0):
define i64 @EMACVLANHashFilterGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 1416
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @EMACVLANHashFilterGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 1416
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ done(int);
int /*<<< orphan*/ msg(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void lostpeer(int ignore) {
  (void)ignore;
  signal(SIGPIPE, SIG_IGN);
  msg("\007connection closed.");
  done(1);
}


x86 assembly (clang, -O0):
<lostpeer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
lea    0xea7(%rip),%rdi
call   1050 <msg@plt>
mov    $0x1,%edi
call   1030 <done@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lostpeer>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
lea    0xeb1(%rip),%rdi
call   1050 <msg@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <done@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
@.str = [20 x i8] c"\07connection closed.\00"
define void @lostpeer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGPIPE
%5 = load i32, i32* @SIG_IGN
%6 = call i32 @signal(i32 %4, i32 %5)
%7 = call i32 @msg(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @done(i32 1)
ret void
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
@.str = [20 x i8] c"\07connection closed.\00"
define void @lostpeer(i32 %0) {
%2 = load i32, i32* @SIGPIPE
%3 = load i32, i32* @SIG_IGN
%4 = tail call i32 @signal(i32 %2, i32 %3)
%5 = tail call i32 @msg(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @done(i32 1)
ret void
}
void cgi_def_ini() {}


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

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

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

LLVM IR (-O2):
define void @cgi_def_ini() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("weak foo\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"weak foo\0A\00"
define void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"weak foo\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned long);
scalar_t__ pthread_self();
int /*<<< orphan*/ stderr;
void thread_init() {
  fprintf(stderr, "CTRAPS: SFI Plugin Thread Init (T=%lu)\n",
          (unsigned long)pthread_self());
}


x86 assembly (clang, -O0):
<thread_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_init>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xec8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"CTRAPS: SFI Plugin Thread Init (T=%lu)\0A\00"
define void @thread_init() {
%1 = load i32, i32* @stderr
%2 = call i64 (...) @pthread_self()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %2)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"CTRAPS: SFI Plugin Thread Init (T=%lu)\0A\00"
define void @thread_init() {
%1 = load i32, i32* @stderr
%2 = tail call i64 (...) @pthread_self()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %2)
ret void
}
double f4_cb_send_pre_int_int_int_int_int_int_float(double (*cb)(int, int, int,
                                                                 int, int, int,
                                                                 float)) {
  float r = 55.0;
  return cb(8, 9, 10, 11, 12, 13, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_int_int_int_int_int_int_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0xa,%edx
mov    $0xb,%ecx
mov    $0xc,%r8d
mov    $0xd,%r9d
call   *%rax
movsd  0xeb4(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_int_int_int_int_int_int_float>:
push   %rax
mov    %rdi,%rax
movss  0xef4(%rip),%xmm0
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0xa,%edx
mov    $0xb,%ecx
mov    $0xc,%r8d
mov    $0xd,%r9d
call   *%rax
addsd  0xed2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_int_int_int_int_int_int_float(double (i32, i32, i32, i32, i32, i32, float)* %0) {
%2 = alloca double (i32, i32, i32, i32, i32, i32, float)*
%3 = alloca float
store double (i32, i32, i32, i32, i32, i32, float)* %0, double (i32, i32, i32, i32, i32, i32, float)** %2
store float 5.500000e+01, float* %3
%4 = load double (i32, i32, i32, i32, i32, i32, float)*, double (i32, i32, i32, i32, i32, i32, float)** %2
%5 = load float, float* %3
%6 = call double %4(i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, float %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_int_int_int_int_int_int_float(double (i32, i32, i32, i32, i32, i32, float)* nocapture %0) {
%2 = tail call double %0(i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, float 5.500000e+01)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Variables and functions */
char *_trim(char *, char *, int);
char *rtrim(char *str) { return _trim(str, " \t\n\r\x0B\x0C", 2); }


x86 assembly (clang, -O0):
<rtrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x2,%edx
call   1030 <_trim@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtrim>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edx
jmp    1030 <_trim@plt>

LLVM IR (-O0):
@.str = [7 x i8] c" \09\0A\0D\0B\0C\00"
define i8* @rtrim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @_trim(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2)
ret i8* %4
}

LLVM IR (-O2):
@.str = [7 x i8] c" \09\0A\0D\0B\0C\00"
define i8* @rtrim(i8* %0) {
%2 = tail call i8* @_trim(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2)
ret i8* %2
}
/* Variables and functions */
scalar_t__ malloc(int);
int *alocar(int n) { return (int *)malloc(n * sizeof(int)); }


x86 assembly (clang, -O0):
<alocar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alocar>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @alocar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 %4, 4
%6 = trunc i64 %5 to i32
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i32*
ret i32* %8
}

LLVM IR (-O2):
define i32* @alocar(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i32*
ret i32* %4
}
void Flash_Destroy(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @CA_Init() {
ret void
}
void vec3_subtract(float *dst, float *b) {
  dst[0] = dst[0] - b[0];
  dst[1] = dst[1] - b[1];
  dst[2] = dst[2] - b[2];
}


x86 assembly (clang, -O0):
<vec3_subtract>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_subtract>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
subss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
subss  0x4(%rsi),%xmm1
movss  %xmm1,0x4(%rdi)
movss  0x8(%rdi),%xmm0
subss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @vec3_subtract(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = fsub float %7, %10
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float*, float** %3
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 1
%19 = load float, float* %18
%20 = fsub float %16, %19
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 1
store float %20, float* %22
%23 = load float*, float** %3
%24 = getelementptr inbounds float, float* %23, i64 2
%25 = load float, float* %24
%26 = load float*, float** %4
%27 = getelementptr inbounds float, float* %26, i64 2
%28 = load float, float* %27
%29 = fsub float %25, %28
%30 = load float*, float** %3
%31 = getelementptr inbounds float, float* %30, i64 2
store float %29, float* %31
ret void
}

LLVM IR (-O2):
define void @vec3_subtract(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fsub float %3, %4
store float %5, float* %0
%6 = getelementptr inbounds float, float* %0, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %1, i64 1
%9 = load float, float* %8
%10 = fsub float %7, %9
store float %10, float* %6
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = fsub float %12, %14
store float %15, float* %11
ret void
}
/* Variables and functions */
int om_sysfs_writefile(char *, char *);
int om_wifi_keep_bus_on_in_suspend_set(int value) {
  return om_sysfs_writefile("/sys/module/s3cmci/parameters/persist",
                            value ? "1\n" : "0\n");
}


x86 assembly (clang, -O0):
<om_wifi_keep_bus_on_in_suspend_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xf04(%rip),%rsi
lea    0xefa(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xec6(%rip),%rdi
call   1030 <om_sysfs_writefile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<om_wifi_keep_bus_on_in_suspend_set>:
test   %edi,%edi
lea    0xf10(%rip),%rax
lea    0xf06(%rip),%rsi
cmove  %rax,%rsi
lea    0xed5(%rip),%rdi
jmp    1030 <om_sysfs_writefile@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"/sys/module/s3cmci/parameters/persist\00"
@.str.1 = [3 x i8] c"1\0A\00"
@.str.2 = [3 x i8] c"0\0A\00"
define i32 @om_wifi_keep_bus_on_in_suspend_set(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%7 = call i32 @om_sysfs_writefile(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [38 x i8] c"/sys/module/s3cmci/parameters/persist\00"
@.str.1 = [3 x i8] c"1\0A\00"
@.str.2 = [3 x i8] c"0\0A\00"
define i32 @om_wifi_keep_bus_on_in_suspend_set(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @om_sysfs_writefile(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 %4
}
/* Variables and functions */
unsigned int IrqGetCPSR();
int /*<<< orphan*/ IrqSetCPSR(unsigned int);
void IrqInterruptEnable(void) {
  unsigned _cpsr;
  _cpsr = IrqGetCPSR();
  IrqSetCPSR(_cpsr & ~0x00000080);
}


x86 assembly (clang, -O0):
<IrqInterruptEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <IrqGetCPSR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffffff7f,%edi
call   1040 <IrqSetCPSR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IrqInterruptEnable>:
push   %rax
xor    %eax,%eax
call   1030 <IrqGetCPSR@plt>
and    $0xffffff7f,%eax
mov    %eax,%edi
pop    %rax
jmp    1040 <IrqSetCPSR@plt>

LLVM IR (-O0):
define void @IrqInterruptEnable() {
%1 = alloca i32
%2 = call i32 (...) @IrqGetCPSR()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -129
%5 = call i32 @IrqSetCPSR(i32 %4)
ret void
}

LLVM IR (-O2):
define void @IrqInterruptEnable() {
%1 = tail call i32 (...) @IrqGetCPSR()
%2 = and i32 %1, -129
%3 = tail call i32 @IrqSetCPSR(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char, unsigned char,
                           unsigned char, unsigned char, char *);
void lineprint4(char *outf, long ctr, unsigned char *op, char *outstring) {
  sprintf(outf, "%02X %02X %02X %02X %s", *op, *(op + 1), *(op + 2), *(op + 3),
          outstring);
}


x86 assembly (clang, -O0):
<lineprint4>:
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    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%dl
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%r8b
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%r9b
mov    -0x20(%rbp),%rax
lea    0xeac(%rip),%rsi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl %r9b,%r9d
mov    %rax,(%rsp)
call   1030 <sprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lineprint4>:
push   %rax
movzbl (%rdx),%eax
movzbl 0x1(%rdx),%r10d
movzbl 0x2(%rdx),%r8d
movzbl 0x3(%rdx),%r9d
mov    %rcx,(%rsp)
lea    0xed2(%rip),%rsi
mov    %eax,%edx
mov    %r10d,%ecx
call   1030 <sprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [23 x i8] c"%02X %02X %02X %02X %s\00"
define void @lineprint4(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %7
%11 = load i8, i8* %10
%12 = load i8*, i8** %7
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = load i8*, i8** %7
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = load i8*, i8** %7
%19 = getelementptr inbounds i8, i8* %18, i64 3
%20 = load i8, i8* %19
%21 = load i8*, i8** %8
%22 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8 zeroext %11, i8 zeroext %14, i8 zeroext %17, i8 zeroext %20, i8* %21)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"%02X %02X %02X %02X %s\00"
define void @lineprint4(i8* nocapture writeonly %0, i64 %1, i8* nocapture %2, i8* %3) {
%5 = load i8, i8* %2
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %2, i64 2
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %2, i64 3
%11 = load i8, i8* %10
%12 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8 zeroext %5, i8 zeroext %7, i8 zeroext %9, i8 zeroext %11, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void displayBadGetUseInputMessage() {
  puts("\nThat is either not something around you or not an interesting item.");
}


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

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

LLVM IR (-O0):
@.str = [69 x i8] c"\0AThat is either not something around you or not an interesting item.\00"
define void @displayBadGetUseInputMessage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [69 x i8] c"\0AThat is either not something around you or not an interesting item.\00"
define void @displayBadGetUseInputMessage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ floatToInt(float);
int /*<<< orphan*/ intToBytes(int /*<<< orphan*/, char *);
void floatToBytes(float f, char *buf) { intToBytes(floatToInt(f), buf); }


x86 assembly (clang, -O0):
<floatToBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <floatToInt@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <intToBytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatToBytes>:
push   %rbx
mov    %rdi,%rbx
call   1030 <floatToInt@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <intToBytes@plt>

LLVM IR (-O0):
define void @floatToBytes(float %0, i8* %1) {
%3 = alloca float
%4 = alloca i8*
store float %0, float* %3
store i8* %1, i8** %4
%5 = load float, float* %3
%6 = call i32 @floatToInt(float %5)
%7 = load i8*, i8** %4
%8 = call i32 @intToBytes(i32 %6, i8* %7)
ret void
}

LLVM IR (-O2):
define void @floatToBytes(float %0, i8* %1) {
%3 = tail call i32 @floatToInt(float %0)
%4 = tail call i32 @intToBytes(i32 %3, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_welcome() {
  printf("in memory key-value mini database implemented b plus tree\n"
         "version %s\n",
         "0.1");
}


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

x86 assembly (clang, -O2):
<print_welcome>:
lea    0xee9(%rip),%rdi
lea    0xf28(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [70 x i8] c"in memory key-value mini database implemented b plus tree\0Aversion %s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
define void @print_welcome() {
%1 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"in memory key-value mini database implemented b plus tree\0Aversion %s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
define void @print_welcome() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void _M2_wallv_finish(__attribute__((unused)) int argc,
                      __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_wallv_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mystrlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void print(const char *s) { write(1, s, mystrlen(s)); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mystrlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    %rdi,%rbx
call   1040 <mystrlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @mystrlen(i8* %4)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @print(i8* %0) {
%2 = tail call i32 @mystrlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}