xunge/DecIR huggingface dataset:
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  {
    state[0UL] = input[0UL] + (unsigned short)2885;
    if ((state[0UL] >> (unsigned short)4) & (unsigned short)1) {
      state[0UL] += state[0UL];
    }
    output[0UL] = state[0UL] - (unsigned short)46601;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0xb45,%eax
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
sar    $0x4,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113d <RandomFunc+0x3d>
movzwl -0x12(%rbp),%ecx
movzwl -0x12(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
sub    $0xb609,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
add    $0xb45,%eax
mov    %eax,%ecx
shr    $0x4,%cl
and    $0x1,%cl
shl    %cl,%eax
add    $0x49f7,%eax
mov    %ax,(%rsi)
ret

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

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = add i16 %3, 2885
%5 = lshr i16 %4, 4
%6 = and i16 %5, 1
%7 = shl i16 %4, %6
%8 = add i16 %7, 18935
store i16 %8, i16* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *, int);
char *reader();
int strlen(char *);
int main(int argc, char const *argv[]) {
  char *str_1 = reader();
  int size_of_string = strlen(str_1);
  printf("String content: %s, and string lenght: %i\n", str_1, size_of_string);
  free(str_1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <reader@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    0xe85(%rip),%rdi
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <reader@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <strlen@plt>
lea    0xea6(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"String content: %s, and string lenght: %i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i8* (...) @reader()
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %7
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12)
%14 = load i8*, i8** %6
%15 = call i32 @free(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"String content: %s, and string lenght: %i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @reader()
%4 = tail call i32 @strlen(i8* %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %4)
%6 = tail call i32 @free(i8* %3)
ret i32 0
}
/* Variables and functions */
void *dummy(unsigned i) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @dummy(i32 %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430InterruptP__Port16__default__fired();
void HplMsp430InterruptP__Port16__fired(void) {
  HplMsp430InterruptP__Port16__default__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplMsp430InterruptP__Port16__fired() {
%1 = tail call i32 (...) @HplMsp430InterruptP__Port16__default__fired()
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memset(char *, char, size_t);
char *bufit(size_t l) {
  char *p = malloc(l);
  memset(p, '!', l);
  return p;
}


x86 assembly (clang, -O0):
<bufit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x21,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bufit>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x21,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @bufit(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i8 signext 33, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @bufit(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i8 signext 33, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Size of hello: %lu\n", sizeof("hello"));
  printf("Size of integer: %lu\n", sizeof(3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x4,%esi
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    $0x6,%esi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Size of hello: %lu\0A\00"
@.str.1 = [22 x i8] c"Size of integer: %lu\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 6)
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Size of hello: %lu\0A\00"
@.str.1 = [22 x i8] c"Size of integer: %lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sysCall(int, int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void sysClear() { sysCall(3, 0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<sysClear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <sysCall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysClear>:
mov    $0x3,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <sysCall@plt>

LLVM IR (-O0):
define void @sysClear() {
%1 = call i32 @sysCall(i32 3, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @sysClear() {
%1 = tail call i32 @sysCall(i32 3, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init();
void kmain() { init(); }


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

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

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

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

/* Variables and functions */
struct node *goLeft(struct node *, int);
struct node *goRight(struct node *, int);
struct node *moveCursor(struct node *currNode, int n) {
  struct node *temp = currNode;
  if (n > 0) {
    temp = goRight(temp, n);
  } else {
    temp = goLeft(temp, n);
  }
  return temp;
}


x86 assembly (clang, -O0):
<moveCursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1156 <moveCursor+0x36>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <goRight@plt>
mov    %rax,-0x18(%rbp)
jmp    1166 <moveCursor+0x46>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <goLeft@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moveCursor>:
test   %esi,%esi
jle    1129 <moveCursor+0x9>
jmp    1030 <goRight@plt>
jmp    1040 <goLeft@plt>

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

LLVM IR (-O2):
%struct.node = type { i32 }
define %struct.node* @moveCursor(%struct.node* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call %struct.node* @goRight(%struct.node* %0, i32 %1)
br label %8
6: ; preds = %2
%7 = tail call %struct.node* @goLeft(%struct.node* %0, i32 %1)
br label %8
8: ; preds = %6, %4
%9 = phi %struct.node* [ %5, %4 ], [ %7, %6 ]
ret %struct.node* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ ringbuffer_test_reading();
int /*<<< orphan*/ ringbuffer_test_reading_and_writing();
int /*<<< orphan*/ ringbuffer_test_writing();
void test_lfds611_ringbuffer(void) {
  printf("\n"
         "Ringbuffer Tests\n"
         "================\n");
  ringbuffer_test_reading();
  ringbuffer_test_writing();
  ringbuffer_test_reading_and_writing();
  return;
}


x86 assembly (clang, -O0):
<test_lfds611_ringbuffer>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <ringbuffer_test_reading@plt>
mov    $0x0,%al
call   1030 <ringbuffer_test_writing@plt>
mov    $0x0,%al
call   1050 <ringbuffer_test_reading_and_writing@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lfds611_ringbuffer>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <ringbuffer_test_reading@plt>
xor    %eax,%eax
call   1030 <ringbuffer_test_writing@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <ringbuffer_test_reading_and_writing@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"\0ARingbuffer Tests\0A================\0A\00"
define void @test_lfds611_ringbuffer() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @ringbuffer_test_reading()
%3 = call i32 (...) @ringbuffer_test_writing()
%4 = call i32 (...) @ringbuffer_test_reading_and_writing()
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"\0ARingbuffer Tests\0A================\00"
define void @test_lfds611_ringbuffer() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @ringbuffer_test_reading()
%3 = tail call i32 (...) @ringbuffer_test_writing()
%4 = tail call i32 (...) @ringbuffer_test_reading_and_writing()
ret void
}
/* Type definitions */
struct stat {
  scalar_t__ st_size;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void file__print_size_b(struct stat *st) { printf("%7d ", (int)st->st_size); }


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

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

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

LLVM IR (-O2):
%struct.stat = type { i64 }
@.str = [5 x i8] c"%7d \00"
define void @file__print_size_b(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main(int argc, const char *argv[]) {
  foo(3);
  foo(4);
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @foo(i32 3)
%6 = call i32 @foo(i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 3)
%4 = tail call i32 @foo(i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *appli) {
  printf("%s have to be started with the address and the port number of the "
         "server and after add the char sequence to send\n",
         appli);
  printf("%s [\"IP\"] [port] [\"char sequence\"]\n", appli);
  printf("example: %s \"127.0.0.1\" 10000   will start a client connected on "
         "the server 127.0.0.1:10000\n",
         appli);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf2b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf3f(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xf38(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xf4d(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [114 x i8] c"%s have to be started with the address and the port number of the server and after add the char sequence to send\0A\00"
@.str.1 = [36 x i8] c"%s [\22IP\22] [port] [\22char sequence\22]\0A\00"
@.str.2 = [93 x i8] c"example: %s \22127.0.0.1\22 10000 will start a client connected on the server 127.0.0.1:10000\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [114 x i8] c"%s have to be started with the address and the port number of the server and after add the char sequence to send\0A\00"
@.str.1 = [36 x i8] c"%s [\22IP\22] [port] [\22char sequence\22]\0A\00"
@.str.2 = [93 x i8] c"example: %s \22127.0.0.1\22 10000 will start a client connected on the server 127.0.0.1:10000\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
void *cs2qcbx();
void *cs2qcbx_(void) { return cs2qcbx(); }


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

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

LLVM IR (-O0):
define i8* @cs2qcbx_() {
%1 = call i8* (...) @cs2qcbx()
ret i8* %1
}

LLVM IR (-O2):
define i8* @cs2qcbx_() {
%1 = tail call i8* (...) @cs2qcbx()
ret i8* %1
}
int odd(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @odd() {
ret i32 3
}

LLVM IR (-O2):
define i32 @odd() {
ret i32 3
}
/* Variables and functions */
void *clad_gar_get(void *, size_t, int, size_t);
void *clad_par_get(void *arr, size_t nmemb, size_t index) {
  return clad_gar_get(arr, nmemb, sizeof(void *), index);
}


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

x86 assembly (clang, -O2):
<clad_par_get>:
mov    %rdx,%rcx
mov    $0x8,%edx
jmp    1030 <clad_gar_get@plt>

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

LLVM IR (-O2):
define i8* @clad_par_get(i8* %0, i64 %1, i64 %2) {
%4 = tail call i8* @clad_gar_get(i8* %0, i64 %1, i32 8, i64 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ abms_system(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
void abms_net_dhcp(char *devname) {
  char lcmd[255];
  sprintf(lcmd, "%s%s %s", "/app/os/sys/bin/", "dhcpcd", devname);
  abms_system(lcmd);
  return;
}


x86 assembly (clang, -O0):
<abms_net_dhcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%r8
lea    0xebf(%rip),%rsi
lea    0xec0(%rip),%rdx
lea    0xeca(%rip),%rcx
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <abms_system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abms_net_dhcp>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%r8
lea    0xece(%rip),%rsi
lea    0xecf(%rip),%rdx
lea    0xed9(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <abms_system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s%s %s\00"
@.str.1 = [17 x i8] c"/app/os/sys/bin/\00"
@.str.2 = [7 x i8] c"dhcpcd\00"
define void @abms_net_dhcp(i8* %0) {
%2 = alloca i8*
%3 = alloca [255 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%8 = call i32 @abms_system(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s%s %s\00"
@.str.1 = [17 x i8] c"/app/os/sys/bin/\00"
@.str.2 = [7 x i8] c"dhcpcd\00"
define void @abms_net_dhcp(i8* %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = call i32 @abms_system(i8* %3)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ callback;
};
typedef TYPE_1__ XIMCallback;

/* Variables and functions */
void *get_XIMCallback_callback(void *_p) {
  return (void *)((XIMCallback *)_p)->callback;
}


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

x86 assembly (clang, -O2):
<get_XIMCallback_callback>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XIMCallback_callback(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XIMCallback_callback(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
double float_mul(double a, float b) { return a * b; }


x86 assembly (clang, -O0):
<float_mul>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_mul>:
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @float_mul(double %0, float %1) {
%3 = alloca double
%4 = alloca float
store double %0, double* %3
store float %1, float* %4
%5 = load double, double* %3
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = fmul double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @float_mul(double %0, float %1) {
%3 = fpext float %1 to double
%4 = fmul double %3, %0
ret double %4
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int inpd(int);
int /*<<< orphan*/ outpd(int, int);
void ahci_ctrl_set_bits(uint16_t iobase, uint16_t reg, uint32_t mask) {
  outpd(iobase + 0, reg);
  outpd(iobase + 4, inpd(iobase + 4) | mask);
}


x86 assembly (clang, -O0):
<ahci_ctrl_set_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
add    $0x0,%edi
mov    -0x8(%rbp),%esi
call   1030 <outpd@plt>
mov    -0x4(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
add    $0x4,%edi
call   1040 <inpd@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
or     -0xc(%rbp),%esi
call   1030 <outpd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ahci_ctrl_set_bits>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %edi,%ebp
call   1030 <outpd@plt>
add    $0x4,%ebp
mov    %ebp,%edi
call   1040 <inpd@plt>
or     %eax,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outpd@plt>

LLVM IR (-O0):
define void @ahci_ctrl_set_bits(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* %4
%8 = add nsw i32 %7, 0
%9 = load i32, i32* %5
%10 = call i32 @outpd(i32 %8, i32 %9)
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 4
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 4
%15 = call i32 @inpd(i32 %14)
%16 = load i32, i32* %6
%17 = or i32 %15, %16
%18 = call i32 @outpd(i32 %12, i32 %17)
ret void
}

LLVM IR (-O2):
define void @ahci_ctrl_set_bits(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @outpd(i32 %0, i32 %1)
%5 = add nsw i32 %0, 4
%6 = tail call i32 @inpd(i32 %5)
%7 = or i32 %6, %2
%8 = tail call i32 @outpd(i32 %5, i32 %7)
ret void
}
/* Variables and functions */
int rec1(int);
int rec2(int j) {
  if (j <= 0)
    return 0;
  return rec1(rec2(j - 1));
}


x86 assembly (clang, -O0):
<rec2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1141 <rec2+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1156 <rec2+0x36>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <rec2@plt>
mov    %eax,%edi
call   1040 <rec1@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec2>:
test   %edi,%edi
jle    1135 <rec2+0x15>
push   %rax
add    $0xffffffff,%edi
call   1030 <rec2@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <rec1@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @rec2(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @rec2(i32 %6)
%8 = tail call i32 @rec1(i32 %7)
br label %3
}
/* Variables and functions */
float ceilf(float);
float floorf(float);
float math_round(float n) {
  return (n > 0.0f) ? floorf(n + 0.5f) : ceilf(n - 0.5f);
}


x86 assembly (clang, -O0):
<math_round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    115a <math_round+0x3a>
movss  0xeba(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
call   1030 <floorf@plt>
movss  %xmm0,-0x8(%rbp)
jmp    1175 <math_round+0x55>
movss  -0x4(%rbp),%xmm0
movss  0xe99(%rip),%xmm1
subss  %xmm1,%xmm0
call   1040 <ceilf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_round>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1135 <math_round+0x15>
addss  0xed4(%rip),%xmm0
jmp    1030 <floorf@plt>
addss  0xec3(%rip),%xmm0
jmp    1040 <ceilf@plt>

LLVM IR (-O0):
define float @math_round(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load float, float* %2
%7 = fadd float %6, 5.000000e-01
%8 = call float @llvm.floor.f32(float %7)
br label %13
9: ; preds = %1
%10 = load float, float* %2
%11 = fsub float %10, 5.000000e-01
%12 = call float @llvm.ceil.f32(float %11)
br label %13
13: ; preds = %9, %5
%14 = phi float [ %8, %5 ], [ %12, %9 ]
ret float %14
}

LLVM IR (-O2):
define float @math_round(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fadd float %0, 5.000000e-01
%5 = tail call float @llvm.floor.f32(float %4)
br label %9
6: ; preds = %1
%7 = fadd float %0, -5.000000e-01
%8 = tail call float @llvm.ceil.f32(float %7)
br label %9
9: ; preds = %6, %3
%10 = phi float [ %5, %3 ], [ %8, %6 ]
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void fb_Delay(int msecs) { usleep(msecs * 1000); }


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

x86 assembly (clang, -O2):
<fb_Delay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @fb_Delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @fb_Delay(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
int mod(int x) {
  if (x < 0)
    return -x;
  else
    return x;
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <mod+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <mod+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @mod(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
five() { return (5); }


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

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

LLVM IR (-O0):
define i32 @five() {
ret i32 5
}

LLVM IR (-O2):
define i32 @five() {
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
void bar(int *a) { foo(a); }


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

x86 assembly (clang, -O2):
<bar>:
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define void @bar(i32* %0) {
%2 = tail call i32 @foo(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Albert\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [7 x i8] c"Albert\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned getval_132() { return 3685010057U; }


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

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

LLVM IR (-O0):
define i32 @getval_132() {
ret i32 -609957239
}

LLVM IR (-O2):
define i32 @getval_132() {
ret i32 -609957239
}
int gcspy_driverControlIsUsed(char val) { return (val & 1) != 0; }


x86 assembly (clang, -O0):
<gcspy_driverControlIsUsed>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gcspy_driverControlIsUsed(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @gcspy_driverControlIsUsed(i8 signext %0) {
%2 = and i8 %0, 1
%3 = zext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Qt_setColor(char *, int, int, int, int);
void Qt_setColorLine(char *widget, int r, int g, int b, int alpha) {
  (void)(widget);
  Qt_setColor("lineColor", r, g, b, alpha);
}


x86 assembly (clang, -O0):
<Qt_setColorLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xec3(%rip),%rdi
call   1030 <Qt_setColor@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"lineColor\00"
define void @Qt_setColorLine(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @Qt_setColor(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"lineColor\00"
define void @Qt_setColorLine(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @Qt_setColor(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ set_port(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
void io_set_port_direction(uint8_t port, uint8_t direction) {
  set_port(port, direction, 0x00, 0x01);
}


x86 assembly (clang, -O0):
<io_set_port_direction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <set_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_set_port_direction>:
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <set_port@plt>

LLVM IR (-O0):
define void @io_set_port_direction(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @set_port(i32 %5, i32 %6, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @io_set_port_direction(i32 %0, i32 %1) {
%3 = tail call i32 @set_port(i32 %0, i32 %1, i32 0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void gre_help(void) {
  puts("GRE Options:\n"
       "    --gre-seq-present         GRE sequence # present           "
       "(default OFF)\n"
       "    --gre-key-present         GRE key present                  "
       "(default OFF)\n"
       "    --gre-sum-present         GRE checksum present             "
       "(default OFF)\n"
       "    --gre-key NUM             GRE key                          "
       "(default RANDOM)\n"
       "    --gre-sequence NUM        GRE sequence #                   "
       "(default RANDOM)\n"
       "    --gre-saddr ADDR          GRE IP source IP address         "
       "(default RANDOM)\n"
       "    --gre-daddr ADDR          GRE IP destination IP address    "
       "(default RANDOM)\n");
}


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

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

LLVM IR (-O0):
@.str = [565 x i8] c"GRE Options:\0A --gre-seq-present GRE sequence # present (default OFF)\0A --gre-key-present GRE key present (default OFF)\0A --gre-sum-present GRE checksum present (default OFF)\0A --gre-key NUM GRE key (default RANDOM)\0A --gre-sequence NUM GRE sequence # (default RANDOM)\0A --gre-saddr ADDR GRE IP source IP address (default RANDOM)\0A --gre-daddr ADDR GRE IP destination IP address (default RANDOM)\0A\00"
define void @gre_help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([565 x i8], [565 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [565 x i8] c"GRE Options:\0A --gre-seq-present GRE sequence # present (default OFF)\0A --gre-key-present GRE key present (default OFF)\0A --gre-sum-present GRE checksum present (default OFF)\0A --gre-key NUM GRE key (default RANDOM)\0A --gre-sequence NUM GRE sequence # (default RANDOM)\0A --gre-saddr ADDR GRE IP source IP address (default RANDOM)\0A --gre-daddr ADDR GRE IP destination IP address (default RANDOM)\0A\00"
define void @gre_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([565 x i8], [565 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sock_fprog {
  int dummy;
};

/* Variables and functions */
int __bpf_l4v4_hash(struct sock_fprog *, int);
int bpf_vlan_l4v4_hash(struct sock_fprog *fprog) {
  return __bpf_l4v4_hash(fprog, true);
}


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

x86 assembly (clang, -O2):
<bpf_vlan_l4v4_hash>:
mov    $0x1,%esi
jmp    1030 <__bpf_l4v4_hash@plt>

LLVM IR (-O0):
%struct.sock_fprog = type { i32 }
define i32 @bpf_vlan_l4v4_hash(%struct.sock_fprog* %0) {
%2 = alloca %struct.sock_fprog*
store %struct.sock_fprog* %0, %struct.sock_fprog** %2
%3 = load %struct.sock_fprog*, %struct.sock_fprog** %2
%4 = call i32 @__bpf_l4v4_hash(%struct.sock_fprog* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
%struct.sock_fprog = type { i32 }
define i32 @bpf_vlan_l4v4_hash(%struct.sock_fprog* %0) {
%2 = tail call i32 @__bpf_l4v4_hash(%struct.sock_fprog* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DAEMON;
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void nakd_log_init() { openlog("nakd", 0, LOG_DAEMON); }


x86 assembly (clang, -O0):
<nakd_log_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edx
lea    0xedc(%rip),%rdi
xor    %esi,%esi
call   1030 <openlog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nakd_log_init>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
lea    0xee0(%rip),%rdi
xor    %esi,%esi
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"nakd\00"
@LOG_DAEMON = global i32 0
define void @nakd_log_init() {
%1 = load i32, i32* @LOG_DAEMON
%2 = call i32 @openlog(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0, i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"nakd\00"
@LOG_DAEMON = global i32 0
define void @nakd_log_init() {
%1 = load i32, i32* @LOG_DAEMON
%2 = tail call i32 @openlog(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0, i32 %1)
ret void
}
__attribute__((always_)) unsigned __int128 bpf_hton128(unsigned __int128 val) {
  return bpf_ntoh128(val);
}


x86 assembly (clang, -O0):
<bpf_hton128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x38(%rbp)
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
xor    %eax,%eax
call   1030 <bpf_ntoh128@plt>
movslq %eax,%rcx
mov    %rcx,%rax
sar    $0x3f,%rax
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_hton128>:
push   %rax
xor    %eax,%eax
call   1030 <bpf_ntoh128@plt>
cltq
mov    %eax,%ecx
sar    $0x1f,%ecx
movslq %ecx,%rdx
pop    %rcx
ret

LLVM IR (-O0):
define { i64, i64 } @bpf_hton128(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
store i128 %11, i128* %6
%12 = bitcast i128* %6 to { i64, i64 }*
%13 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %12, i32 0, i32 0
%14 = load i64, i64* %13
%15 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %12, i32 0, i32 1
%16 = load i64, i64* %15
%17 = call i32 (i64, i64, ...) bitcast (i32 (...)* @bpf_ntoh128 to i32 (i64, i64, ...)*)(i64 %14, i64 %16)
%18 = sext i32 %17 to i128
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @bpf_hton128(i64 %0, i64 %1) {
%3 = tail call i32 (i64, i64, ...) bitcast (i32 (...)* @bpf_ntoh128 to i32 (i64, i64, ...)*)(i64 %0, i64 %1)
%4 = sext i32 %3 to i64
%5 = ashr i32 %3, 31
%6 = sext i32 %5 to i64
%7 = insertvalue { i64, i64 } poison, i64 %4, 0
%8 = insertvalue { i64, i64 } %7, i64 %6, 1
ret { i64, i64 } %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ printf(char *, char const *);
void output_string(const char *buffer, const int write_to_file,
                   FILE *global_ofile) {
  printf("%s", buffer);
  if (write_to_file != 0)
    fprintf(global_ofile, "%s", buffer);
  return;
}


x86 assembly (clang, -O0):
<output_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
je     1161 <output_string+0x41>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xea4(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_string>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
test   %ebp,%ebp
je     114e <output_string+0x2e>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fputs@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @output_string(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 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i32*, i32** %6
%13 = load i8*, i8** %4
%14 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @output_string(i8* %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @fputs(i8* %0, i32* %2)
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void memory_copy(char **ptr) {
  *ptr = "world";
  printf("%s \n", *ptr);
}


x86 assembly (clang, -O0):
<memory_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xed9(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"world\00"
@.str.1 = [5 x i8] c"%s \0A\00"
define void @memory_copy(i8** nocapture writeonly %0) {
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %0
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}