xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: ip monitor [ all | LISTofOBJECTS ]\n");
  exit(-1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: ip monitor [ all | LISTofOBJECTS ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: ip monitor [ all | LISTofOBJECTS ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ do_x_filter32(int *, int *, int, int, int *, int, double);
int gradX32(int *src, int *dst, int w, int h) {
  int mask[3] = {-1, 0, 1};
  do_x_filter32(src, dst, w, h, mask, 3, 1.0);
  return 1;
}


x86 assembly (clang, -O0):
<gradX32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x24(%rbp)
mov    0xed9(%rip),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    -0x24(%rbp),%r8
mov    $0x3,%r9d
movsd  0xea6(%rip),%xmm0
call   1030 <do_x_filter32@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gradX32>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xee3(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%r8
movsd  0xec9(%rip),%xmm0
mov    $0x3,%r9d
call   1030 <do_x_filter32@plt>
mov    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.gradX32.mask = [3 x i32] [i32 -1, i32 0, i32 1]
define i32 @gradX32(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [3 x i32]
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = bitcast [3 x i32]* %9 to i8*
%11 = load i32*, i32** %5
%12 = load i32*, i32** %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%16 = call i32 @do_x_filter32(i32* %11, i32* %12, i32 %13, i32 %14, i32* %15, i32 3, double 1.000000e+00)
ret i32 1
}

LLVM IR (-O2):
@__const.gradX32.mask = [3 x i32] [i32 -1, i32 0, i32 1]
define i32 @gradX32(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca [3 x i32]
%6 = bitcast [3 x i32]* %5 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%8 = call i32 @do_x_filter32(i32* %0, i32* %1, i32 %2, i32 %3, i32* %7, i32 3, double 1.000000e+00)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
int on_tty(int /*<<< orphan*/);
bool stderr_use_colors(void) { return on_tty(STDERR_FILENO); }


x86 assembly (clang, -O0):
<stderr_use_colors>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <on_tty@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stderr_use_colors>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <on_tty@plt>

LLVM IR (-O0):
@STDERR_FILENO = global i32 0
define i32 @stderr_use_colors() {
%1 = load i32, i32* @STDERR_FILENO
%2 = call i32 @on_tty(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@STDERR_FILENO = global i32 0
define i32 @stderr_use_colors() {
%1 = load i32, i32* @STDERR_FILENO
%2 = tail call i32 @on_tty(i32 %1)
ret i32 %2
}
/* Variables and functions */
scalar_t__ foo(int, int);
void t11(int i, int j) {
  (long)foo((i), (j));
  (long)0;
  ;
}


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

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

LLVM IR (-O0):
define void @t11(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 i64 @foo(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @t11(i32 %0, i32 %1) {
%3 = tail call i64 @foo(i32 %0, i32 %1)
ret void
}
int fun459() { return 459; }


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

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

LLVM IR (-O0):
define i32 @fun459() {
ret i32 459
}

LLVM IR (-O2):
define i32 @fun459() {
ret i32 459
}
/* Variables and functions */
int /*<<< orphan*/ HomeLocationHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void HomeLocationLogging() { UAVObjLogging(HomeLocationHandle()); }


x86 assembly (clang, -O0):
<HomeLocationLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <HomeLocationHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HomeLocationLogging>:
push   %rax
xor    %eax,%eax
call   1040 <HomeLocationHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @HomeLocationLogging() {
%1 = call i32 (...) @HomeLocationHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @HomeLocationLogging() {
%1 = tail call i32 (...) @HomeLocationHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
size_t nbits(int *, int);
int /*<<< orphan*/ refill(int *);
int fun_A(int *bitfill) {
  int ret;
  static int tab[] = {12,  13,  14,  15,  16,  17,  18,  19, -12,
                      -13, -14, -15, -16, -17, -18, -19, -19};
  ret = tab[nbits(bitfill, 4)];
  refill(bitfill);
  return ret;
}


x86 assembly (clang, -O0):
<fun_A>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1030 <nbits@plt>
mov    %rax,%rcx
lea    0x2efc(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <refill@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_A>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x4,%esi
call   1030 <nbits@plt>
lea    0xec9(%rip),%rcx
mov    (%rcx,%rax,4),%ebp
mov    %rbx,%rdi
call   1040 <refill@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@fun_A.tab = internal global [17 x i32] [i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 -12, i32 -13, i32 -14, i32 -15, i32 -16, i32 -17, i32 -18, i32 -19, i32 -19]
define i32 @fun_A(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i64 @nbits(i32* %4, i32 4)
%6 = getelementptr inbounds [17 x i32], [17 x i32]* @fun_A.tab, i64 0, i64 %5
%7 = load i32, i32* %6
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = call i32 @refill(i32* %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@fun_A.tab = internal unnamed_addr constant [17 x i32] [i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 -12, i32 -13, i32 -14, i32 -15, i32 -16, i32 -17, i32 -18, i32 -19, i32 -19]
define i32 @fun_A(i32* %0) {
%2 = tail call i64 @nbits(i32* %0, i32 4)
%3 = getelementptr inbounds [17 x i32], [17 x i32]* @fun_A.tab, i64 0, i64 %2
%4 = load i32, i32* %3
%5 = tail call i32 @refill(i32* %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ eset(int);
scalar_t__ strcat(char *, char *);
int Mstrcat(int nargs, int *argsv) {
  if (nargs < 2) {
    eset(21);
    return -1;
  }
  char *a = (char *)argsv[0];
  char *b = (char *)argsv[1];
  return (int)strcat(a, b);
}


x86 assembly (clang, -O0):
<Mstrcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    114f <Mstrcat+0x2f>
mov    $0x15,%edi
call   1030 <eset@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <Mstrcat+0x56>
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq 0x4(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strcat@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mstrcat>:
push   %rax
cmp    $0x1,%edi
jg     1137 <Mstrcat+0x17>
mov    $0x15,%edi
call   1030 <eset@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
movslq (%rsi),%rdi
movslq 0x4(%rsi),%rsi
call   1040 <strcat@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @Mstrcat(i32 %0, i32* nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @eset(i32 21)
br label %16
6: ; preds = %2
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = getelementptr inbounds i32, i32* %1, i64 1
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
%14 = tail call i64 @strcat(i8* %9, i8* %13)
%15 = trunc i64 %14 to i32
br label %16
16: ; preds = %6, %4
%17 = phi i32 [ -1, %4 ], [ %15, %6 ]
ret i32 %17
}
/* Type definitions */
struct libdeflate_decompressor {
  int dummy;
};

/* Variables and functions */
struct libdeflate_decompressor *libdeflate_alloc_decompressor();
int /*<<< orphan*/ msg_errno(char *);
struct libdeflate_decompressor *alloc_decompressor(void) {
  struct libdeflate_decompressor *d;
  d = libdeflate_alloc_decompressor();
  if (d == NULL)
    msg_errno("Unable to allocate decompressor");
  return d;
}


x86 assembly (clang, -O0):
<alloc_decompressor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <libdeflate_alloc_decompressor@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114a <alloc_decompressor+0x2a>
lea    0xebb(%rip),%rdi
call   1030 <msg_errno@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_decompressor>:
push   %rbx
xor    %eax,%eax
call   1040 <libdeflate_alloc_decompressor@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <alloc_decompressor+0x1c>
lea    0xec9(%rip),%rdi
call   1030 <msg_errno@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.libdeflate_decompressor = type { i32 }
@.str = [32 x i8] c"Unable to allocate decompressor\00"
define %struct.libdeflate_decompressor* @alloc_decompressor() {
%1 = alloca %struct.libdeflate_decompressor*
%2 = call %struct.libdeflate_decompressor* (...) @libdeflate_alloc_decompressor()
store %struct.libdeflate_decompressor* %2, %struct.libdeflate_decompressor** %1
%3 = load %struct.libdeflate_decompressor*, %struct.libdeflate_decompressor** %1
%4 = icmp eq %struct.libdeflate_decompressor* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @msg_errno(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = load %struct.libdeflate_decompressor*, %struct.libdeflate_decompressor** %1
ret %struct.libdeflate_decompressor* %8
}

LLVM IR (-O2):
%struct.libdeflate_decompressor = type { i32 }
@.str = [32 x i8] c"Unable to allocate decompressor\00"
define %struct.libdeflate_decompressor* @alloc_decompressor() {
%1 = tail call %struct.libdeflate_decompressor* (...) @libdeflate_alloc_decompressor()
%2 = icmp eq %struct.libdeflate_decompressor* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @msg_errno(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret %struct.libdeflate_decompressor* %1
}
int cmp(const void *x, const void *y) { return *(int *)x - *(int *)y; }


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

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

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello ");
  fork();
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fork@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <fork@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"Hello \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @fork()
%3 = tail call i32 @putchar(i32 10)
ret i32 0
}
void _dl_parse_lazy_relocation_information(struct elf_resolve *tpnt,
                                           unsigned long rel_addr,
                                           unsigned long rel_size, int type) {
  return;
}


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

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

LLVM IR (-O0):
%struct.elf_resolve = type opaque
define void @_dl_parse_lazy_relocation_information(%struct.elf_resolve* %0, i64 %1, i64 %2, i32 %3) {
%5 = alloca %struct.elf_resolve*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32
store %struct.elf_resolve* %0, %struct.elf_resolve** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.elf_resolve = type opaque
define void @_dl_parse_lazy_relocation_information(%struct.elf_resolve* nocapture %0, i64 %1, i64 %2, i32 %3) {
ret void
}
/* Type definitions */
struct qserver {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ output_packet(struct qserver *, char const *, int,
                                 int /*<<< orphan*/);
void print_packet(struct qserver *server, const char *buf, int buflen) {
  output_packet(server, buf, buflen, 0);
}


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

x86 assembly (clang, -O2):
<print_packet>:
xor    %ecx,%ecx
jmp    1030 <output_packet@plt>

LLVM IR (-O0):
%struct.qserver = type { i32 }
define void @print_packet(%struct.qserver* %0, i8* %1, i32 %2) {
%4 = alloca %struct.qserver*
%5 = alloca i8*
%6 = alloca i32
store %struct.qserver* %0, %struct.qserver** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.qserver*, %struct.qserver** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @output_packet(%struct.qserver* %7, i8* %8, i32 %9, i32 0)
ret void
}

LLVM IR (-O2):
%struct.qserver = type { i32 }
define void @print_packet(%struct.qserver* %0, i8* %1, i32 %2) {
%4 = tail call i32 @output_packet(%struct.qserver* %0, i8* %1, i32 %2, i32 0)
ret void
}
int cancelopt() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cancelopt() {
ret i32 0
}
/* Variables and functions */
long errno;
long get_err(long ret) {
  if (ret < 0)
    return -errno;
  else
    return ret;
}


x86 assembly (clang, -O0):
<get_err>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1128 <get_err+0x28>
xor    %eax,%eax
mov    0x2ec4(%rip),%rcx
sub    (%rcx),%rax
mov    %rax,-0x8(%rbp)
jmp    1130 <get_err+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_err>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%rax
test   %rdi,%rdi
cmovns %rdi,%rax
ret

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

LLVM IR (-O2):
@errno = global i64 0
define i64 @get_err(i64 %0) {
%2 = icmp slt i64 %0, 0
%3 = load i64, i64* @errno
%4 = sub nsw i64 0, %3
%5 = select i1 %2, i64 %4, i64 %0
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_least64_t;

/* Variables and functions */
size_t fmt_int64_base(char *, int /*<<< orphan*/, int);
size_t fmt_int64(char *ptr, uint_least64_t val) {
  return fmt_int64_base(ptr, val, 10);
}


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

x86 assembly (clang, -O2):
<fmt_int64>:
mov    $0xa,%edx
jmp    1030 <fmt_int64_base@plt>

LLVM IR (-O0):
define i64 @fmt_int64(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i64 @fmt_int64_base(i8* %5, i32 %6, i32 10)
ret i64 %7
}

LLVM IR (-O2):
define i64 @fmt_int64(i8* %0, i32 %1) {
%3 = tail call i64 @fmt_int64_base(i8* %0, i32 %1, i32 10)
ret i64 %3
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ CLOCKS_PER_SEC;
int GetSeconds(clock_t time) {
  double seconds = (double)time / (double)CLOCKS_PER_SEC;
  return (int)seconds;
}


x86 assembly (clang, -O0):
<GetSeconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetSeconds>:
cvtsi2sd %rdi,%xmm0
mov    0x2edc(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i64 0
define i32 @GetSeconds(i64 %0) {
%2 = alloca i64
%3 = alloca double
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sitofp i64 %4 to double
%6 = load i64, i64* @CLOCKS_PER_SEC
%7 = sitofp i64 %6 to double
%8 = fdiv double %5, %7
store double %8, double* %3
%9 = load double, double* %3
%10 = fptosi double %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i64 0
define i32 @GetSeconds(i64 %0) {
%2 = sitofp i64 %0 to double
%3 = load i64, i64* @CLOCKS_PER_SEC
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
%6 = fptosi double %5 to i32
ret i32 %6
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double clock_now() {
  struct timeval now;
  gettimeofday(&now, NULL);
  return (double)now.tv_sec + (double)now.tv_usec / 1.0e6;
}


x86 assembly (clang, -O0):
<clock_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @clock_now() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @clock_now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() { puts("Hello, World!"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
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 = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void mov_reg32_preg32x4pimm32(int reg1, int reg2, unsigned long imm32) {
  put8(0x8B);
  put8((reg1 << 3) | 4);
  put8(0x80 | (reg2 << 3) | 5);
  put32(imm32);
}


x86 assembly (clang, -O0):
<mov_reg32_preg32x4pimm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    $0x8b,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x4,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
shl    $0x3,%edi
or     $0x80,%edi
or     $0x5,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rdi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_reg32_preg32x4pimm32>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x8b,%edi
call   1030 <put8@plt>
lea    0x4(,%rbx,8),%edi
call   1030 <put8@plt>
shl    $0x3,%ebp
or     $0x85,%ebp
mov    %ebp,%edi
call   1030 <put8@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @mov_reg32_preg32x4pimm32(i32 %0, i32 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = call i32 @put8(i32 139)
%8 = load i32, i32* %4
%9 = shl i32 %8, 3
%10 = or i32 %9, 4
%11 = call i32 @put8(i32 %10)
%12 = load i32, i32* %5
%13 = shl i32 %12, 3
%14 = or i32 128, %13
%15 = or i32 %14, 5
%16 = call i32 @put8(i32 %15)
%17 = load i64, i64* %6
%18 = call i32 @put32(i64 %17)
ret void
}

LLVM IR (-O2):
define void @mov_reg32_preg32x4pimm32(i32 %0, i32 %1, i64 %2) {
%4 = tail call i32 @put8(i32 139)
%5 = shl i32 %0, 3
%6 = or i32 %5, 4
%7 = tail call i32 @put8(i32 %6)
%8 = shl i32 %1, 3
%9 = or i32 %8, 133
%10 = tail call i32 @put8(i32 %9)
%11 = tail call i32 @put32(i64 %2)
ret void
}
void ar6000_testmode_rx_report_event(struct ar6_softc *ar, void *buf,
                                     int buf_len) {}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.ar6_softc = type opaque
define void @ar6000_testmode_rx_report_event(%struct.ar6_softc* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void prtusage(void) {
  printf("No args for now\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<prtusage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<prtusage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"No args for now\0A\00"
@EXIT_FAILURE = global i32 0
define void @prtusage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [16 x i8] c"No args for now\00"
define void @prtusage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
double atof(char const *);
int strlen(char const *);
double suffix2factor(char const);
double str2double(const char *str) {
  size_t sz;
  sz = strlen(str) - 1;
  return atof(str) * suffix2factor(str[sz]);
}


x86 assembly (clang, -O0):
<str2double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <suffix2factor@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2double>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <strlen@plt>
movslq %eax,%r14
mov    %rbx,%rdi
call   1040 <atof@plt>
movsd  %xmm0,(%rsp)
movsbl -0x1(%r14,%rbx,1),%edi
call   1030 <suffix2factor@plt>
mulsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @str2double(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
store i64 %7, i64* %3
%8 = load i8*, i8** %2
%9 = call double @atof(i8* %8)
%10 = load i8*, i8** %2
%11 = load i64, i64* %3
%12 = getelementptr inbounds i8, i8* %10, i64 %11
%13 = load i8, i8* %12
%14 = call double @suffix2factor(i8 signext %13)
%15 = fmul double %9, %14
ret double %15
}

LLVM IR (-O2):
define double @str2double(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = tail call double @atof(i8* %0)
%6 = getelementptr inbounds i8, i8* %0, i64 %4
%7 = load i8, i8* %6
%8 = tail call double @suffix2factor(i8 signext %7)
%9 = fmul double %5, %8
ret double %9
}
/* Variables and functions */
int mul(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int x, y;
  printf("Enter two numbers: ");
  scanf("%d %d", &x, &y);
  printf("Product = %d\n", mul(x, y));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <mul@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1050 <mul@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"Enter two numbers: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [14 x i8] c"Product = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @mul(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Type definitions */
struct stack_st_OPENSSL_STRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
int OPENSSL_sk_num(int /*<<< orphan*/ const *);
int sk_OPENSSL_STRING_num(const struct stack_st_OPENSSL_STRING *sk) {
  return OPENSSL_sk_num((const OPENSSL_STACK *)sk);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_STRING_num>:
jmp    1030 <OPENSSL_sk_num@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_STRING = type { i32 }
define i32 @sk_OPENSSL_STRING_num(%struct.stack_st_OPENSSL_STRING* %0) {
%2 = alloca %struct.stack_st_OPENSSL_STRING*
store %struct.stack_st_OPENSSL_STRING* %0, %struct.stack_st_OPENSSL_STRING** %2
%3 = load %struct.stack_st_OPENSSL_STRING*, %struct.stack_st_OPENSSL_STRING** %2
%4 = bitcast %struct.stack_st_OPENSSL_STRING* %3 to i32*
%5 = call i32 @OPENSSL_sk_num(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_STRING = type { i32 }
define i32 @sk_OPENSSL_STRING_num(%struct.stack_st_OPENSSL_STRING* %0) {
%2 = getelementptr %struct.stack_st_OPENSSL_STRING, %struct.stack_st_OPENSSL_STRING* %0, i64 0, i32 0
%3 = tail call i32 @OPENSSL_sk_num(i32* %2)
ret i32 %3
}
int batadv_v_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @batadv_v_init() {
ret i32 0
}
int gstrswp(char **first, char **second) {
  char *temp = (*first);
  (*first) = (*second);
  (*second) = temp;
  return 0;
}


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

x86 assembly (clang, -O2):
<gstrswp>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @gstrswp(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*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret i32 0
}

LLVM IR (-O2):
define i32 @gstrswp(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret i32 0
}
void w_quick_sort_string_assign(void *data, int i, int j) {
  char **str = (char **)data;
  str[i] = str[j];
}


x86 assembly (clang, -O0):
<w_quick_sort_string_assign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_quick_sort_string_assign>:
movslq %edx,%rax
mov    (%rdi,%rax,8),%rax
movslq %esi,%rcx
mov    %rax,(%rdi,%rcx,8)
ret

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

LLVM IR (-O2):
define void @w_quick_sort_string_assign(i8* nocapture %0, i32 %1, i32 %2) {
%4 = bitcast i8* %0 to i8**
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8*, i8** %4, i64 %5
%7 = load i8*, i8** %6
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i8*, i8** %4, i64 %8
store i8* %7, i8** %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int tmp;
  unsigned char counter;
  counter = 0;
  counter = 1;
  while (counter < 10) {
    tmp = 1;
    counter++;
    tmp = 2;
  }
  assert(counter == 10);
  counter = (unsigned char)216;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x9(%rbp)
movb   $0x1,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jge    114f <main+0x3f>
movl   $0x1,-0x8(%rbp)
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
movl   $0x2,-0x8(%rbp)
jmp    1127 <main+0x17>
movzbl -0x9(%rbp),%eax
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movb   $0xd8,-0x9(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %3
store i8 1, i8* %3
br label %4
4: ; preds = %8, %0
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %11
8: ; preds = %4
store i32 1, i32* %2
%9 = load i8, i8* %3
%10 = add i8 %9, 1
store i8 %10, i8* %3
store i32 2, i32* %2
br label %4
11: ; preds = %4
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = icmp eq i32 %13, 10
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
store i8 -40, i8* %3
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int num = 10;
  printf("dec=%d,octal=%o,hex=%x\n", num, num, num);
  printf("dec=%d,octal=%#o,hex=%#x\n", num, num, num);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [24 x i8] c"dec=%d,octal=%o,hex=%x\0A\00"
@.str.1 = [26 x i8] c"dec=%d,octal=%#o,hex=%#x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 10, i32 10, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 10, i32 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ XGravityEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XGravityEvent(void *_p) {
  if (_p == NULL)
    abort();
  free((XGravityEvent *)_p);
}


x86 assembly (clang, -O0):
<free_XGravityEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XGravityEvent+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XGravityEvent>:
test   %rdi,%rdi
je     112a <free_XGravityEvent+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XGravityEvent(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 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XGravityEvent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
void UI_dup_verify_string(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_dup_verify_string() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usage_print(char *);
void help_print(char *exec_name) {
  usage_print(exec_name);
  printf("\n\t-h --help\t\t\tThis help message\n"
         "\t-v --verbose\t\t\tPrint debugging info to stderr\n"
         "\t-i --interface <interface>\tInterface name\n"
         "\t-d --discover\t\t\tDiscover DHCP Server\n"
         "\t-r --request <ip>\t\tRequest IP lease\n"
         "\t-q --release <ip>\t\tRelease IP lease\n"
         "\t-m --mac <MAC>\t\t\tMAC address\n"
         "\t-t --timeout <sec>\t\tTimeout (default 5 sec.)\n\n");
}


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

x86 assembly (clang, -O2):
<help_print>:
push   %rax
call   1040 <usage_print@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [312 x i8] c"\0A\09-h --help\09\09\09This help message\0A\09-v --verbose\09\09\09Print debugging info to stderr\0A\09-i --interface <interface>\09Interface name\0A\09-d --discover\09\09\09Discover DHCP Server\0A\09-r --request <ip>\09\09Request IP lease\0A\09-q --release <ip>\09\09Release IP lease\0A\09-m --mac <MAC>\09\09\09MAC address\0A\09-t --timeout <sec>\09\09Timeout (default 5 sec.)\0A\0A\00"
define void @help_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @usage_print(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([312 x i8], [312 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [311 x i8] c"\0A\09-h --help\09\09\09This help message\0A\09-v --verbose\09\09\09Print debugging info to stderr\0A\09-i --interface <interface>\09Interface name\0A\09-d --discover\09\09\09Discover DHCP Server\0A\09-r --request <ip>\09\09Request IP lease\0A\09-q --release <ip>\09\09Release IP lease\0A\09-m --mac <MAC>\09\09\09MAC address\0A\09-t --timeout <sec>\09\09Timeout (default 5 sec.)\0A\00"
define void @help_print(i8* %0) {
%2 = tail call i32 @usage_print(i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([311 x i8], [311 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double percentile_nocopy_double(int, double *, double);
double percentile_nocopy(int n, double *data, double pct) {
  return percentile_nocopy_double(n, data, pct);
}


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

x86 assembly (clang, -O2):
<percentile_nocopy>:
jmp    1030 <percentile_nocopy_double@plt>

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

LLVM IR (-O2):
define double @percentile_nocopy(i32 %0, double* %1, double %2) {
%4 = tail call double @percentile_nocopy_double(i32 %0, double* %1, double %2)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int main(int argc, char const *argv[]) {
  int i;
  for (i = argc - 1; i > 0; i--) {
    printf("%s ", argv[i]);
  }
  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    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    115f <main+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <main+0x1f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1149 <main+0x39>
mov    %rsi,%r15
mov    %edi,%ebx
add    $0x1,%rbx
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
mov    (%r15,%rax,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x2,%rbx
ja     1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %6
br label %9
9: ; preds = %19, %2
%10 = load i32, i32* %6
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %6
%21 = add nsw i32 %20, -1
store i32 %21, i32* %6
br label %9
22: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = icmp ugt i64 %7, 2
br i1 %13, label %6, label %14
14: ; preds = %6, %2
ret i32 0
}