xunge/DecIR huggingface dataset:
/* Type definitions */
struct Chabu_Data {
  int dummy;
};
struct Chabu_Channel_Data {
  int dummy;
};

/* Variables and functions */
struct Chabu_Channel_Data *popNextRequest(struct Chabu_Data *,
                                          int /*<<< orphan*/);
struct Chabu_Channel_Data *
Chabu_Priority_PopNextRequestData(struct Chabu_Data *chabu) {
  return popNextRequest(chabu, 0);
}


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

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

LLVM IR (-O0):
%struct.Chabu_Channel_Data = type { i32 }
%struct.Chabu_Data = type { i32 }
define %struct.Chabu_Channel_Data* @Chabu_Priority_PopNextRequestData(%struct.Chabu_Data* %0) {
%2 = alloca %struct.Chabu_Data*
store %struct.Chabu_Data* %0, %struct.Chabu_Data** %2
%3 = load %struct.Chabu_Data*, %struct.Chabu_Data** %2
%4 = call %struct.Chabu_Channel_Data* @popNextRequest(%struct.Chabu_Data* %3, i32 0)
ret %struct.Chabu_Channel_Data* %4
}

LLVM IR (-O2):
%struct.Chabu_Channel_Data = type { i32 }
%struct.Chabu_Data = type { i32 }
define %struct.Chabu_Channel_Data* @Chabu_Priority_PopNextRequestData(%struct.Chabu_Data* %0) {
%2 = tail call %struct.Chabu_Channel_Data* @popNextRequest(%struct.Chabu_Data* %0, i32 0)
ret %struct.Chabu_Channel_Data* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void charge_Client() { printf("Client has been charged.\n"); }


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

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

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

LLVM IR (-O2):
@str = [25 x i8] c"Client has been charged.\00"
define void @charge_Client() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int jours_par_mois(int, int);
int date_valable(int jour, int mois, int annee) {
  if ((mois < 1) || (mois > 12))
    return 0;
  if ((jour < 1) || (jour > jours_par_mois(mois, annee)))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<date_valable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     1135 <date_valable+0x25>
cmpl   $0xc,-0xc(%rbp)
jle    1141 <date_valable+0x31>
movl   $0x0,-0x4(%rbp)
jmp    117c <date_valable+0x6c>
cmpl   $0x1,-0x8(%rbp)
jl     1169 <date_valable+0x59>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <jours_par_mois@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jle    1175 <date_valable+0x65>
movl   $0x0,-0x4(%rbp)
jmp    117c <date_valable+0x6c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_valable>:
xor    %eax,%eax
test   %edi,%edi
jle    1134 <date_valable+0x24>
lea    -0xd(%rsi),%ecx
cmp    $0xfffffff4,%ecx
jb     1134 <date_valable+0x24>
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <jours_par_mois@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
setge  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @date_valable(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 1
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp sgt i32 %11, 12
br i1 %12, label %13, label %14
13: ; preds = %10, %3
store i32 0, i32* %4
br label %25
14: ; preds = %10
%15 = load i32, i32* %5
%16 = icmp slt i32 %15, 1
br i1 %16, label %23, label %17
17: ; preds = %14
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = call i32 @jours_par_mois(i32 %19, i32 %20)
%22 = icmp sgt i32 %18, %21
br i1 %22, label %23, label %24
23: ; preds = %17, %14
store i32 0, i32* %4
br label %25
24: ; preds = %17
store i32 1, i32* %4
br label %25
25: ; preds = %24, %23, %13
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @date_valable(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, -13
%5 = icmp ult i32 %4, -12
%6 = icmp slt i32 %0, 1
%7 = or i1 %6, %5
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = tail call i32 @jours_par_mois(i32 %1, i32 %2)
%10 = icmp sge i32 %9, %0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %3
%13 = phi i32 [ 0, %3 ], [ %11, %8 ]
ret i32 %13
}
int discover_server() {}


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

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

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

LLVM IR (-O2):
define i32 @discover_server() {
ret i32 undef
}
void u_swap(int *items, int i, int j) {
  if (i != j) {
    int temp = items[i];
    items[i] = items[j];
    items[j] = temp;
  }
}


x86 assembly (clang, -O0):
<u_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     114c <u_swap+0x4c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_swap>:
cmp    %edx,%esi
je     1116 <u_swap+0x16>
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @u_swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, %2
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
store i32 %11, i32* %7
store i32 %8, i32* %10
br label %12
12: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_i(int num) { printf("%d\n", num); }


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

x86 assembly (clang, -O2):
<print_i>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_i(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
scalar_t__ setsockopt(int, int, int, void const *, int /*<<< orphan*/);
void Setsockopt(int fd, int level, int optname, const void *optval,
                socklen_t optlen) {
  if (setsockopt(fd, level, optname, optval, optlen) < 0)
    err_sys("setsockopt error");
}


x86 assembly (clang, -O0):
<Setsockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1040 <setsockopt@plt>
cmp    $0x0,%rax
jge    1165 <Setsockopt+0x45>
lea    0xea0(%rip),%rdi
call   1030 <err_sys@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Setsockopt>:
push   %rax
call   1040 <setsockopt@plt>
test   %rax,%rax
js     112d <Setsockopt+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <err_sys@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"setsockopt error\00"
define void @Setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i64 @setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @err_sys(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}
/* Type definitions */
struct lobject {
  int dummy;
};
struct lemon {
  int dummy;
};

/* Variables and functions */
struct lobject *lobject_length(struct lemon *, struct lobject *);
struct lobject *lobject_get_default_length(struct lemon *lemon,
                                           struct lobject *self, int argc,
                                           struct lobject *argv[]) {
  return lobject_length(lemon, self);
}


x86 assembly (clang, -O0):
<lobject_get_default_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <lobject_length@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lobject_get_default_length>:
jmp    1030 <lobject_length@plt>

LLVM IR (-O0):
%struct.lemon = type { i32 }
%struct.lobject = type { i32 }
define %struct.lobject* @lobject_get_default_length(%struct.lemon* %0, %struct.lobject* %1, i32 %2, %struct.lobject** %3) {
%5 = alloca %struct.lemon*
%6 = alloca %struct.lobject*
%7 = alloca i32
%8 = alloca %struct.lobject**
store %struct.lemon* %0, %struct.lemon** %5
store %struct.lobject* %1, %struct.lobject** %6
store i32 %2, i32* %7
store %struct.lobject** %3, %struct.lobject*** %8
%9 = load %struct.lemon*, %struct.lemon** %5
%10 = load %struct.lobject*, %struct.lobject** %6
%11 = call %struct.lobject* @lobject_length(%struct.lemon* %9, %struct.lobject* %10)
ret %struct.lobject* %11
}

LLVM IR (-O2):
%struct.lemon = type { i32 }
%struct.lobject = type { i32 }
define %struct.lobject* @lobject_get_default_length(%struct.lemon* %0, %struct.lobject* %1, i32 %2, %struct.lobject** nocapture readnone %3) {
%5 = tail call %struct.lobject* @lobject_length(%struct.lemon* %0, %struct.lobject* %1)
ret %struct.lobject* %5
}
/* Type definitions */
struct mdoc_node {
  int dummy;
};
struct mdoc_meta {
  int dummy;
};
struct html {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_text(struct html *, char *);
int mdoc_ud_pre(const struct mdoc_meta *m, const struct mdoc_node *n,
                struct html *h) {
  print_text(h, "currently under development.");
  return (0);
}


x86 assembly (clang, -O0):
<mdoc_ud_pre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <print_text@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdoc_ud_pre>:
push   %rax
mov    %rdx,%rdi
lea    0xee5(%rip),%rsi
call   1030 <print_text@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mdoc_meta = type { i32 }
%struct.mdoc_node = type { i32 }
%struct.html = type { i32 }
@.str = [29 x i8] c"currently under development.\00"
define i32 @mdoc_ud_pre(%struct.mdoc_meta* %0, %struct.mdoc_node* %1, %struct.html* %2) {
%4 = alloca %struct.mdoc_meta*
%5 = alloca %struct.mdoc_node*
%6 = alloca %struct.html*
store %struct.mdoc_meta* %0, %struct.mdoc_meta** %4
store %struct.mdoc_node* %1, %struct.mdoc_node** %5
store %struct.html* %2, %struct.html** %6
%7 = load %struct.html*, %struct.html** %6
%8 = call i32 @print_text(%struct.html* %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.mdoc_meta = type { i32 }
%struct.mdoc_node = type { i32 }
%struct.html = type { i32 }
@.str = [29 x i8] c"currently under development.\00"
define i32 @mdoc_ud_pre(%struct.mdoc_meta* nocapture readnone %0, %struct.mdoc_node* nocapture readnone %1, %struct.html* %2) {
%4 = tail call i32 @print_text(%struct.html* %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int isdigit(char ch) { return ch >= '0' && ch <= '9'; }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int termios_tcflusho(int fd) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @termios_tcflusho(i32 %0) {
ret i32 1
}
void handle_list(int fd) {}


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

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

LLVM IR (-O0):
define void @handle_list(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @handle_list(i32 %0) {
ret void
}
/* Variables and functions */
long long strtoll(char const *, int /*<<< orphan*/, int);
long long ws_strtoll(const char *ptr, int offset, int base) {
  return strtoll(ptr + offset, 0, base);
}


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

x86 assembly (clang, -O2):
<ws_strtoll>:
movslq %esi,%rax
add    %rax,%rdi
xor    %esi,%esi
jmp    1030 <strtoll@plt>

LLVM IR (-O0):
define i64 @ws_strtoll(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i32, i32* %6
%12 = call i64 @strtoll(i8* %10, i32 0, i32 %11)
ret i64 %12
}

LLVM IR (-O2):
define i64 @ws_strtoll(i8* %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i64 @strtoll(i8* %5, i32 0, i32 %2)
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(int);
int main() {
  int a = 2;
  print("a  2");
  printid(a);
  a = a + 5;
  print("a  7");
  printid(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
mov    -0x8(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x8(%rbp)
lea    0xeab(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print@plt>
mov    $0x2,%edi
call   1040 <printid@plt>
lea    0xec7(%rip),%rdi
call   1030 <print@plt>
mov    $0x7,%edi
call   1040 <printid@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"a 2\00"
@.str.1 = [5 x i8] c"a 7\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
%3 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @printid(i32 %4)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 5
store i32 %7, i32* %2
%8 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = call i32 @printid(i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"a 2\00"
@.str.1 = [5 x i8] c"a 7\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(i32 2)
%3 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printid(i32 7)
ret i32 0
}
/* Variables and functions */
scalar_t__ calloc(scalar_t__, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ getenv(char *);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
scalar_t__ strlen(int /*<<< orphan*/);
char *get_username() {
  char *username = (char *)calloc(strlen(getenv("USER")) + 1, sizeof(char));
  if (!username)
    exit(1);
  strcpy(username, getenv("USER"));
  return username;
}


x86 assembly (clang, -O0):
<get_username>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1195 <get_username+0x45>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xe5c(%rip),%rdi
call   1030 <getenv@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_username>:
push   %rbx
lea    0xea8(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
mov    $0x1,%esi
call   1060 <calloc@plt>
test   %rax,%rax
je     1195 <get_username+0x45>
mov    %rax,%rbx
lea    0xe7f(%rip),%rdi
call   1030 <getenv@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"USER\00"
define i8* @get_username() {
%1 = alloca i8*
%2 = call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i64 @strlen(i32 %2)
%4 = add nsw i64 %3, 1
%5 = call i64 @calloc(i64 %4, i32 1)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %1
%7 = load i8*, i8** %1
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %0
%12 = load i8*, i8** %1
%13 = call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @strcpy(i8* %12, i32 %13)
%15 = load i8*, i8** %1
ret i8* %15
}

LLVM IR (-O2):
@.str = [5 x i8] c"USER\00"
define i8* @get_username() {
%1 = tail call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 @strlen(i32 %1)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @calloc(i64 %3, i32 1)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = tail call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @strcpy(i8* %5, i32 %10)
ret i8* %5
}
int quick_tuncompress() { return 0; }


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

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

LLVM IR (-O0):
define i32 @quick_tuncompress() {
ret i32 0
}

LLVM IR (-O2):
define i32 @quick_tuncompress() {
ret i32 0
}
int print(line, message)
int line;
const char *message;
{ return printf("(%d): %s\n", line, message); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"(%d): %s\0A\00"
define i32 @print(i32 %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t get_mask_for_first_n(const uint64_t n) { return (~0ull >> (64 - n)); }


x86 assembly (clang, -O0):
<get_mask_for_first_n>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x40,%eax
sub    -0x4(%rbp),%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0xffffffffffffffff,%rax
shr    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mask_for_first_n>:
mov    %edi,%ecx
neg    %cl
mov    $0xffffffffffffffff,%rax
shr    %cl,%rax
ret

LLVM IR (-O0):
define i32 @get_mask_for_first_n(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 64, %3
%5 = zext i32 %4 to i64
%6 = lshr i64 -1, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_mask_for_first_n(i32 %0) {
%2 = sub nsw i32 64, %0
%3 = zext i32 %2 to i64
%4 = lshr i64 -1, %3
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ tab_show_prev();
int controller_tab_prev(int k) {
  tab_show_prev();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @controller_tab_prev(i32 %0) {
%2 = tail call i32 (...) @tab_show_prev()
ret i32 0
}
void str_replace_char(char *dst, char *src, char from, char to) {
  while (*src != '\0') {
    if (*src == from)
      *dst = to;
    else
      *dst = *src;
    dst++;
    src++;
  }
  *dst = '\0';
}


x86 assembly (clang, -O0):
<str_replace_char>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1170 <str_replace_char+0x70>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1147 <str_replace_char+0x47>
mov    -0x12(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1153 <str_replace_char+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1116 <str_replace_char+0x16>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_replace_char>:
mov    (%rsi),%al
test   %al,%al
je     1129 <str_replace_char+0x29>
add    $0x1,%rsi
movzbl %cl,%ecx
nopl   (%rax)
cmp    %dl,%al
movzbl %al,%eax
cmove  %ecx,%eax
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1110 <str_replace_char+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @str_replace_char(i8* nocapture writeonly %0, i8* nocapture %1, i8 signext %2, i8 signext %3) {
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %4, %7
%8 = phi i8 [ %15, %7 ], [ %5, %4 ]
%9 = phi i8* [ %13, %7 ], [ %0, %4 ]
%10 = phi i8* [ %14, %7 ], [ %1, %4 ]
%11 = icmp eq i8 %8, %2
%12 = select i1 %11, i8 %3, i8 %8
store i8 %12, i8* %9
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %4
%18 = phi i8* [ %0, %4 ], [ %13, %7 ]
store i8 0, i8* %18
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  int i;
  for (i = 0; i < 5; i++) {
    printf("******** \n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [10 x i8] c"******** \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ operation(int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int number;
  srand(time(NULL));
  number = rand() % 100;
  operation(number);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <operation@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
movslq %eax,%rdi
imul   $0x51eb851f,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edi
call   1050 <operation@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 100
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @operation(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 100
%5 = tail call i32 @operation(i32 %4)
ret i32 0
}
/* Type definitions */
struct regs86 {
  int dummy;
};

/* Variables and functions */
int int1A_handler(struct regs86 *);
int int42_handler(int, struct regs86 *);
int int_handler(int num, struct regs86 *regs) {
  switch (num) {
  case 0x10:
  case 0x42:
    return (int42_handler(num, regs));
  case 0x1A:
    return (int1A_handler(regs));
  default:
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<int_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x10,%eax
je     1165 <int_handler+0x45>
jmp    1143 <int_handler+0x23>
mov    -0x14(%rbp),%eax
sub    $0x1a,%eax
je     1179 <int_handler+0x59>
jmp    1154 <int_handler+0x34>
mov    -0x14(%rbp),%eax
sub    $0x42,%eax
jne    118a <int_handler+0x6a>
jmp    1165 <int_handler+0x45>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <int42_handler@plt>
mov    %eax,-0x4(%rbp)
jmp    1191 <int_handler+0x71>
mov    -0x10(%rbp),%rdi
call   1030 <int1A_handler@plt>
mov    %eax,-0x4(%rbp)
jmp    1191 <int_handler+0x71>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_handler>:
cmp    $0x42,%edi
je     112f <int_handler+0xf>
cmp    $0x1a,%edi
je     1134 <int_handler+0x14>
cmp    $0x10,%edi
jne    113c <int_handler+0x1c>
jmp    1040 <int42_handler@plt>
mov    %rsi,%rdi
jmp    1030 <int1A_handler@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.regs86 = type { i32 }
define i32 @int_handler(i32 %0, %struct.regs86* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.regs86*
store i32 %0, i32* %4
store %struct.regs86* %1, %struct.regs86** %5
%6 = load i32, i32* %4
switch i32 %6, label %14 [
i32 16, label %7
i32 66, label %7
i32 26, label %11
]
7: ; preds = %2, %2
%8 = load i32, i32* %4
%9 = load %struct.regs86*, %struct.regs86** %5
%10 = call i32 @int42_handler(i32 %8, %struct.regs86* %9)
store i32 %10, i32* %3
br label %15
11: ; preds = %2
%12 = load %struct.regs86*, %struct.regs86** %5
%13 = call i32 @int1A_handler(%struct.regs86* %12)
store i32 %13, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %11, %7
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.regs86 = type { i32 }
define i32 @int_handler(i32 %0, %struct.regs86* %1) {
switch i32 %0, label %7 [
i32 16, label %3
i32 66, label %3
i32 26, label %5
]
3: ; preds = %2, %2
%4 = tail call i32 @int42_handler(i32 %0, %struct.regs86* %1)
br label %7
5: ; preds = %2
%6 = tail call i32 @int1A_handler(%struct.regs86* %1)
br label %7
7: ; preds = %2, %5, %3
%8 = phi i32 [ %6, %5 ], [ %4, %3 ], [ 0, %2 ]
ret i32 %8
}
void sws_global_init(void *(*alloc)(unsigned int size), void (*free)(void *ptr),
                     void (*log)(void *, int level, const char *fmt, ...)) {}


x86 assembly (clang, -O0):
<sws_global_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @sws_global_init(i8* (i32)* nocapture %0, void (i8*)* nocapture %1, void (i8*, i32, i8*, ...)* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
char *get_current_dir_name(void) {
  errno = ENOSYS;
  return NULL;
}


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

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

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

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define noalias i8* @get_current_dir_name() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void PDContentStreamTextExtractorUIDealloc(void *tui) { free(tui); }


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

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

LLVM IR (-O2):
define void @PDContentStreamTextExtractorUIDealloc(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
int /*<<< orphan*/ free(void *);
void xfree(void *ptr) {
  if (ptr == NULL)
    errx(1, "xfree: NULL pointer given as argument");
  free(ptr);
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <xfree+0x28>
mov    $0x1,%edi
lea    0xebd(%rip),%rsi
call   1040 <errx@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    113a <xfree+0x1a>
lea    0xed0(%rip),%rsi
mov    $0x1,%edi
call   1040 <errx@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"xfree: NULL pointer given as argument\00"
define void @xfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @errx(i32 1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"xfree: NULL pointer given as argument\00"
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @free(i8* %0)
ret void
}
char *sOutputString(char *sStr, char *sOut) {
  char *sTemp;
  sTemp = sOut;
  while (*sStr != '\0') {
    if (*sStr == '"') {
      *sTemp = '\\';
      sTemp++;
    }
    *sTemp = *sStr;
    sTemp++;
    sStr++;
  }
  *sTemp = '\0';
  return (sOut);
}


x86 assembly (clang, -O0):
<sOutputString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1170 <sOutputString+0x70>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1147 <sOutputString+0x47>
mov    -0x18(%rbp),%rax
movb   $0x5c,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <sOutputString+0x14>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sOutputString>:
mov    %rsi,%rax
mov    %rsi,%rcx
jmp    1124 <sOutputString+0x24>
nopl   0x0(%rax,%rax,1)
movb   $0x5c,(%rcx)
add    $0x1,%rcx
movzbl (%rdi),%edx
mov    %dl,(%rcx)
add    $0x1,%rcx
add    $0x1,%rdi
movzbl (%rdi),%edx
cmp    $0x22,%dl
je     1110 <sOutputString+0x10>
test   %dl,%dl
jne    111a <sOutputString+0x1a>
movb   $0x0,(%rcx)
ret

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

LLVM IR (-O2):
define i8* @sOutputString(i8* nocapture %0, i8* returned writeonly %1) {
br label %3
3: ; preds = %10, %2
%4 = phi i8* [ %0, %2 ], [ %14, %10 ]
%5 = phi i8* [ %1, %2 ], [ %13, %10 ]
%6 = load i8, i8* %4
switch i8 %6, label %10 [
i8 0, label %15
i8 34, label %7
]
7: ; preds = %3
store i8 92, i8* %5
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %4
br label %10
10: ; preds = %3, %7
%11 = phi i8 [ %9, %7 ], [ %6, %3 ]
%12 = phi i8* [ %8, %7 ], [ %5, %3 ]
store i8 %11, i8* %12
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
15: ; preds = %3
store i8 0, i8* %5
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ cgau8(double *, int, double *, double *, int, int);
void cgau8_packet(double *x, int sigInLength, double *f, int sigOutLength,
                  double ys) {
  cgau8(x, sigInLength, f, f + sigInLength, sigOutLength, 1);
  return;
}


x86 assembly (clang, -O0):
<cgau8_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%r9d
call   1030 <cgau8@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgau8_packet>:
mov    %ecx,%r8d
movslq %esi,%rsi
lea    (%rdx,%rsi,8),%rcx
mov    $0x1,%r9d
jmp    1030 <cgau8@plt>

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

LLVM IR (-O2):
define void @cgau8_packet(double* %0, i32 %1, double* %2, i32 %3, double %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds double, double* %2, i64 %6
%8 = tail call i32 @cgau8(double* %0, i32 %1, double* %2, double* %7, i32 %3, i32 1)
ret void
}
/* Variables and functions */
void *create_tree();
int /*<<< orphan*/ print_tree(void *);
int main(int argc, char **argv) {
  void *data = create_tree();
  print_tree(data);
  print_tree(data);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <create_tree@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <print_tree@plt>
mov    -0x18(%rbp),%rdi
call   1040 <print_tree@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <create_tree@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <print_tree@plt>
mov    %rbx,%rdi
call   1040 <print_tree@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @create_tree()
%4 = tail call i32 @print_tree(i8* %3)
%5 = tail call i32 @print_tree(i8* %3)
ret i32 0
}
/* Variables and functions */
int getConfigInt(char *, int);
int getDbVersion() {
  int dbVersion = getConfigInt("db.version", 1);
  if (dbVersion <= 0) {
    dbVersion = 1;
  }
  return dbVersion;
}


x86 assembly (clang, -O0):
<getDbVersion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x1,%esi
call   1030 <getConfigInt@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     113d <getDbVersion+0x2d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDbVersion>:
push   %rbx
lea    0xee8(%rip),%rdi
mov    $0x1,%ebx
mov    $0x1,%esi
call   1030 <getConfigInt@plt>
test   %eax,%eax
cmovle %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"db.version\00"
define i32 @getDbVersion() {
%1 = alloca i32
%2 = call i32 @getConfigInt(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %0
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [11 x i8] c"db.version\00"
define i32 @getDbVersion() {
%1 = tail call i32 @getConfigInt(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = icmp sgt i32 %1, 1
%3 = select i1 %2, i32 %1, i32 1
ret i32 %3
}