xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ listen(int, int);
int *skbind(short);
int /*<<< orphan*/ skclose(int *);
int *sklisten(short port, int backlog) {
  int *sd = skbind(port);
  if (sd) {
    if (listen(*sd, backlog) < 0) {
      skclose(sd);
      sd = NULL;
    }
  }
  return sd;
}


x86 assembly (clang, -O0):
<sklisten>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movswl -0x2(%rbp),%edi
call   1040 <skbind@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1188 <sklisten+0x58>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
call   1050 <listen@plt>
cmp    $0x0,%rax
jge    1183 <sklisten+0x53>
mov    -0x10(%rbp),%rdi
call   1030 <skclose@plt>
movq   $0x0,-0x10(%rbp)
jmp    1188 <sklisten+0x58>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sklisten>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1040 <skbind@plt>
test   %rax,%rax
je     1158 <sklisten+0x28>
mov    %rax,%rbx
mov    (%rax),%edi
mov    %ebp,%esi
call   1050 <listen@plt>
test   %rax,%rax
jns    115a <sklisten+0x2a>
mov    %rbx,%rdi
call   1030 <skclose@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32* @sklisten(i16 signext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
%5 = alloca i32*
store i16 %0, i16* %3
store i32 %1, i32* %4
%6 = load i16, i16* %3
%7 = call i32* @skbind(i16 signext %6)
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %20
10: ; preds = %2
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32, i32* %4
%14 = call i64 @listen(i32 %12, i32 %13)
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = load i32*, i32** %5
%18 = call i32 @skclose(i32* %17)
store i32* null, i32** %5
br label %19
19: ; preds = %16, %10
br label %20
20: ; preds = %19, %2
%21 = load i32*, i32** %5
ret i32* %21
}

LLVM IR (-O2):
define i32* @sklisten(i16 signext %0, i32 %1) {
%3 = tail call i32* @skbind(i16 signext %0)
%4 = icmp eq i32* %3, null
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = load i32, i32* %3
%7 = tail call i64 @listen(i32 %6, i32 %1)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @skclose(i32* %3)
br label %11
11: ; preds = %5, %9, %2
%12 = phi i32* [ null, %9 ], [ %3, %5 ], [ null, %2 ]
ret i32* %12
}
int stacked(int input) {
  int plus_2 = input + 2;
  int times_5 = input * 5;
  return plus_2 + times_5;
}


x86 assembly (clang, -O0):
<stacked>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
imul   $0x5,-0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stacked>:
lea    (%rdi,%rdi,4),%eax
add    %edi,%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @stacked(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 2
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, 5
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @stacked(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = mul nsw i32 %0, 5
%4 = add nsw i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ adainit();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("[C Code] Running test\n");
  adainit();
  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 <adainit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <adainit@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [22 x i8] c"[C Code] Running test\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @adainit()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  printf("Podaj liczbe z zakresu od 1 do 10000: ");
  scanf("%d", &a);
  if (a % 2 == 1)
    printf("nie\n");
  else
    printf("tak\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>
lea    0xee5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1170 <main+0x50>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
jmp    117c <main+0x5c>
lea    0xeb8(%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>
lea    0xee3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
cmp    $0x1,%eax
lea    0xec6(%rip),%rax
lea    0xebb(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Podaj liczbe z zakresu od 1 do 10000: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"nie\0A\00"
@.str.3 = [5 x i8] c"tak\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 2
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"Podaj liczbe z zakresu od 1 do 10000: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [4 x i8] c"tak\00"
@str.4 = [4 x i8] c"nie\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = srem i32 %5, 2
%7 = icmp eq i32 %6, 1
%8 = select i1 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
/* Type definitions */
struct ev_loop {
  int dummy;
};
struct ev_io {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ accept_cb(struct ev_loop *, struct ev_io *, int);
void c_accept_cb(struct ev_loop *loop, struct ev_io *watcher, int revents) {
  accept_cb(loop, watcher, revents);
}


x86 assembly (clang, -O0):
<c_accept_cb>:
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
call   1030 <accept_cb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_accept_cb>:
jmp    1030 <accept_cb@plt>

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

LLVM IR (-O2):
%struct.ev_loop = type { i32 }
%struct.ev_io = type { i32 }
define void @c_accept_cb(%struct.ev_loop* %0, %struct.ev_io* %1, i32 %2) {
%4 = tail call i32 @accept_cb(%struct.ev_loop* %0, %struct.ev_io* %1, i32 %2)
ret void
}
/* Variables and functions */
double ARCTAN_POS(double);
double ARCTAN(double x) {
  if (x < 0)
    return -ARCTAN_POS(-x);
  else
    return ARCTAN_POS(x);
}


x86 assembly (clang, -O0):
<ARCTAN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    116d <ARCTAN+0x5d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <ARCTAN_POS@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117c <ARCTAN+0x6c>
movsd  -0x10(%rbp),%xmm0
call   1030 <ARCTAN_POS@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ARCTAN>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1132 <ARCTAN+0x22>
push   %rax
xorpd  0xedd(%rip),%xmm0
call   1030 <ARCTAN_POS@plt>
xorpd  0xed0(%rip),%xmm0
pop    %rax
ret
jmp    1030 <ARCTAN_POS@plt>

LLVM IR (-O0):
define double @ARCTAN(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
%9 = call double @ARCTAN_POS(double %8)
%10 = fneg double %9
store double %10, double* %2
br label %14
11: ; preds = %1
%12 = load double, double* %3
%13 = call double @ARCTAN_POS(double %12)
store double %13, double* %2
br label %14
14: ; preds = %11, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @ARCTAN(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fneg double %0
%5 = tail call double @ARCTAN_POS(double %4)
%6 = fneg double %5
br label %9
7: ; preds = %1
%8 = tail call double @ARCTAN_POS(double %0)
br label %9
9: ; preds = %7, %3
%10 = phi double [ %6, %3 ], [ %8, %7 ]
ret double %10
}
/* Variables and functions */
int getpid();
int rand();
int /*<<< orphan*/ srand(int);
int time(int /*<<< orphan*/ *);
int getrand(int toprange) {
  srand((int)(time(NULL) * getpid()));
  return (rand() % toprange) + 1;
}


x86 assembly (clang, -O0):
<getrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x8(%rbp),%edi
imul   %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrand>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <getpid@plt>
imul   %eax,%ebp
mov    %ebp,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
cltd
idiv   %ebx
lea    0x1(%rdx),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getrand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @time(i32* null)
%4 = call i32 (...) @getpid()
%5 = mul nsw i32 %3, %4
%6 = call i32 @srand(i32 %5)
%7 = call i32 (...) @rand()
%8 = load i32, i32* %2
%9 = srem i32 %7, %8
%10 = add nsw i32 %9, 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @getrand(i32 %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 (...) @getpid()
%4 = mul nsw i32 %3, %2
%5 = tail call i32 @srand(i32 %4)
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, %0
%8 = add nsw i32 %7, 1
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p224_msat(uintptr_t);
void fiat_p224_msat(uint64_t out1[5]) {
  internal_fiat_p224_msat((uintptr_t)out1);
}


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

x86 assembly (clang, -O2):
<fiat_p224_msat>:
jmp    1030 <internal_fiat_p224_msat@plt>

LLVM IR (-O0):
define void @fiat_p224_msat(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i64
%5 = call i32 @internal_fiat_p224_msat(i64 %4)
ret void
}

LLVM IR (-O2):
define void @fiat_p224_msat(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = tail call i32 @internal_fiat_p224_msat(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello 1");
  fork();
  printf("Hello 2");
  fork();
  printf("Hello 3");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <fork@plt>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <fork@plt>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"Hello 1\00"
@.str.1 = [8 x i8] c"Hello 2\00"
@.str.2 = [8 x i8] c"Hello 3\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @fork()
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @fork()
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ILibWriteStringToDiskEx(char *, char *, int);
scalar_t__ strlen(char *);
void ILibWriteStringToDisk(char *FileName, char *data) {
  ILibWriteStringToDiskEx(FileName, data, (int)strlen(data));
}


x86 assembly (clang, -O0):
<ILibWriteStringToDisk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <ILibWriteStringToDiskEx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ILibWriteStringToDisk>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ILibWriteStringToDiskEx@plt>

LLVM IR (-O0):
define void @ILibWriteStringToDisk(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = trunc i64 %8 to i32
%10 = call i32 @ILibWriteStringToDiskEx(i8* %5, i8* %6, i32 %9)
ret void
}

LLVM IR (-O2):
define void @ILibWriteStringToDisk(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @ILibWriteStringToDiskEx(i8* %0, i8* %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: mezzdump [-hbo] mezzfile\n"
                  "\n"
                  "Dump information about a mezzanine IPC file.\n"
                  "\n"
                  "Options:\n"
                  "  -h\t\tPrint this message\n"
                  "  -b\t\tPrint the blob list\n"
                  "  -o\t\tPrint the object list\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [168 x i8] c"Usage: mezzdump [-hbo] mezzfile\0A\0ADump information about a mezzanine IPC file.\0A\0AOptions:\0A -h\09\09Print this message\0A -b\09\09Print the blob list\0A -o\09\09Print the object list\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [168 x i8] c"Usage: mezzdump [-hbo] mezzfile\0A\0ADump information about a mezzanine IPC file.\0A\0AOptions:\0A -h\09\09Print this message\0A -b\09\09Print the blob list\0A -o\09\09Print the object list\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ tv_nsec;
  int /*<<< orphan*/ tv_sec;
};
struct stat {
  int /*<<< orphan*/ st_atime;
};

/* Variables and functions */
int /*<<< orphan*/ get_stat_atime_ns(struct stat const *);
struct timespec get_stat_atime(struct stat const *st) {
  struct timespec t;
  t.tv_sec = st->st_atime;
  t.tv_nsec = get_stat_atime_ns(st);
  return t;
}


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

x86 assembly (clang, -O2):
<get_stat_atime>:
push   %rbx
mov    (%rdi),%ebx
call   1030 <get_stat_atime_ns@plt>
shl    $0x20,%rbx
mov    %eax,%eax
or     %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.timespec = type { i32, i32 }
define i64 @get_stat_atime(%struct.stat* %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %3
%4 = load %struct.stat*, %struct.stat** %3
%5 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i32 %6, i32* %7
%8 = load %struct.stat*, %struct.stat** %3
%9 = call i32 @get_stat_atime_ns(%struct.stat* %8)
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i32 %9, i32* %10
%11 = bitcast %struct.timespec* %2 to i64*
%12 = load i64, i64* %11
ret i64 %12
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i64 @get_stat_atime(%struct.stat* %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @get_stat_atime_ns(%struct.stat* %0)
%5 = zext i32 %3 to i64
%6 = shl nuw i64 %5, 32
%7 = zext i32 %4 to i64
%8 = or i64 %6, %7
ret i64 %8
}
/* Variables and functions */
int M_PI;
double exp(double);
double function(double _x) {
  double t = _x - M_PI / 2;
  double y = -exp(-t * t);
  return y;
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
cvtsi2sd %ecx,%xmm1
subsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
xorpd  0xec9(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
xorpd  0xeb8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @function(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = load i32, i32* @M_PI
%7 = sdiv i32 %6, 2
%8 = sitofp i32 %7 to double
%9 = fsub double %5, %8
store double %9, double* %3
%10 = load double, double* %3
%11 = fneg double %10
%12 = load double, double* %3
%13 = fmul double %11, %12
%14 = call double @exp(double %13)
%15 = fneg double %14
store double %15, double* %4
%16 = load double, double* %4
ret double %16
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @function(double %0) {
%2 = load i32, i32* @M_PI
%3 = sdiv i32 %2, 2
%4 = sitofp i32 %3 to double
%5 = fsub double %0, %4
%6 = fneg double %5
%7 = fmul double %5, %6
%8 = tail call double @exp(double %7)
%9 = fneg double %8
ret double %9
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t i64_max(int64_t x, int64_t y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<i64_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <i64_max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <i64_max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i64_max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @i64_max(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @i64_max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
long faki(int);
long bikoeff(int m, int n) { return faki(n) / faki(m) * faki(n - m); }


x86 assembly (clang, -O0):
<bikoeff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <faki@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <faki@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x4(%rbp),%edi
call   1030 <faki@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
imul   %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bikoeff>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%r14d
mov    %esi,%edi
call   1030 <faki@plt>
mov    %rax,%rbp
mov    %r14d,%edi
call   1030 <faki@plt>
mov    %rax,%rcx
mov    %rbp,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1147 <bikoeff+0x37>
mov    %rbp,%rax
cqto
idiv   %rcx
mov    %rax,%rbp
jmp    114f <bikoeff+0x3f>
mov    %ebp,%eax
xor    %edx,%edx
div    %ecx
mov    %eax,%ebp
sub    %r14d,%ebx
mov    %ebx,%edi
call   1030 <faki@plt>
imul   %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @bikoeff(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i64 @faki(i32 %5)
%7 = load i32, i32* %3
%8 = call i64 @faki(i32 %7)
%9 = sdiv i64 %6, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = sub nsw i32 %10, %11
%13 = call i64 @faki(i32 %12)
%14 = mul nsw i64 %9, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @bikoeff(i32 %0, i32 %1) {
%3 = tail call i64 @faki(i32 %1)
%4 = tail call i64 @faki(i32 %0)
%5 = sdiv i64 %3, %4
%6 = sub nsw i32 %1, %0
%7 = tail call i64 @faki(i32 %6)
%8 = mul nsw i64 %7, %5
ret i64 %8
}
/* Variables and functions */
int strlen(char *);
char *end_of_token(char *token) { return token + strlen(token); }


x86 assembly (clang, -O0):
<end_of_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_of_token>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @end_of_token(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @end_of_token(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
unsigned fastlog2(unsigned v) {
  register unsigned int r = (v & 0xAAAAAAAA) != 0;
  r |= ((v & 0xFFFF0000) != 0) << 4;
  r |= ((v & 0xFF00FF00) != 0) << 3;
  r |= ((v & 0xF0F0F0F0) != 0) << 2;
  r |= ((v & 0xCCCCCCCC) != 0) << 1;
  return r;
}


x86 assembly (clang, -O0):
<fastlog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xaaaaaaaa,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff0000,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
shl    $0x4,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff00,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
shl    $0x3,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0f0f0f0,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
shl    $0x2,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xcccccccc,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
shl    $0x1,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastlog2>:
xor    %eax,%eax
test   $0xaaaaaaaa,%edi
setne  %al
xor    %ecx,%ecx
cmp    $0x10000,%edi
setae  %cl
shl    $0x4,%ecx
or     %eax,%ecx
xor    %eax,%eax
test   $0xff00ff00,%edi
setne  %al
lea    (%rcx,%rax,8),%eax
xor    %ecx,%ecx
test   $0xf0f0f0f0,%edi
setne  %cl
lea    (%rax,%rcx,4),%eax
xor    %ecx,%ecx
test   $0xcccccccc,%edi
setne  %cl
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @fastlog2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, -1431655766
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = and i32 %8, -65536
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
%12 = shl i32 %11, 4
%13 = load i32, i32* %3
%14 = or i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %2
%16 = and i32 %15, -16711936
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i32
%19 = shl i32 %18, 3
%20 = load i32, i32* %3
%21 = or i32 %20, %19
store i32 %21, i32* %3
%22 = load i32, i32* %2
%23 = and i32 %22, -252645136
%24 = icmp ne i32 %23, 0
%25 = zext i1 %24 to i32
%26 = shl i32 %25, 2
%27 = load i32, i32* %3
%28 = or i32 %27, %26
store i32 %28, i32* %3
%29 = load i32, i32* %2
%30 = and i32 %29, -858993460
%31 = icmp ne i32 %30, 0
%32 = zext i1 %31 to i32
%33 = shl i32 %32, 1
%34 = load i32, i32* %3
%35 = or i32 %34, %33
store i32 %35, i32* %3
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
define i32 @fastlog2(i32 %0) {
%2 = and i32 %0, -1431655766
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
%5 = icmp ugt i32 %0, 65535
%6 = select i1 %5, i32 16, i32 0
%7 = or i32 %6, %4
%8 = and i32 %0, -16711936
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 0, i32 8
%11 = or i32 %7, %10
%12 = and i32 %0, -252645136
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i32 0, i32 4
%15 = or i32 %11, %14
%16 = and i32 %0, -858993460
%17 = icmp eq i32 %16, 0
%18 = select i1 %17, i32 0, i32 2
%19 = or i32 %15, %18
ret i32 %19
}
void ad799x_ring_cleanup(struct iio_dev *indio_dev) {}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @ad799x_ring_cleanup(%struct.iio_dev* nocapture %0) {
ret void
}
/* Variables and functions */
char *getenv(char const *var) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @getenv(i8* nocapture readnone %0) {
ret i8* null
}
void exit(int status) {
  asm("movl $0x1, %%eax;"
      "int $0x80;"
      :
      : "b"(status));
  exit(status);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%ebx
mov    $0x1,%eax
int    $0x80
mov    -0xc(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%eax
int    $0x80
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @exit(i32 %0) {
tail call void asm sideeffect "movl $$0x1, %eax;int $$0x80;", "{bx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
tail call void @exit(i32 %0)
unreachable
}
/* Variables and functions */
int bar();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("[BEGIN] dylib-re-export-old-format\n");
  if (bar() == 42)
    printf("[PASS] dylib-re-export-old-format\n");
  else
    printf("[FAIL] dylib-re-export-old-format, wrong value\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   1040 <printf@plt>
mov    $0x0,%al
call   1030 <bar@plt>
cmp    $0x2a,%eax
jne    115c <main+0x3c>
lea    0xed2(%rip),%rdi
call   1040 <printf@plt>
jmp    1168 <main+0x48>
lea    0xee4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <bar@plt>
cmp    $0x2a,%eax
lea    0xf14(%rip),%rax
lea    0xede(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"[BEGIN] dylib-re-export-old-format\0A\00"
@.str.1 = [35 x i8] c"[PASS] dylib-re-export-old-format\0A\00"
@.str.2 = [48 x i8] c"[FAIL] dylib-re-export-old-format, wrong value\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @bar()
%4 = icmp eq i32 %3, 42
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"[BEGIN] dylib-re-export-old-format\00"
@str.3 = [47 x i8] c"[FAIL] dylib-re-export-old-format, wrong value\00"
@str.4 = [34 x i8] c"[PASS] dylib-re-export-old-format\00"
define i32 @main() {
%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 (...) @bar()
%3 = icmp eq i32 %2, 42
%4 = select i1 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @str.3, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret i32 0
}
unsigned int getProcessCPUUsage(unsigned int pid) { return 100; }


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

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

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

LLVM IR (-O2):
define i32 @getProcessCPUUsage(i32 %0) {
ret i32 100
}
/* Variables and functions */
scalar_t__ isspace(char);
char **skip(char **in) {
  if (in && *in)
    while (isspace(**in))
      (*in)++;
  return in;
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116b <skip+0x5b>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     116b <skip+0x5b>
jmp    113a <skip+0x2a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1166 <skip+0x56>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    113a <skip+0x2a>
jmp    116b <skip+0x5b>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     114a <skip+0x3a>
mov    (%rbx),%rax
test   %rax,%rax
je     114a <skip+0x3a>
movsbl (%rax),%edi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <isspace@plt>
test   %rax,%rax
je     114a <skip+0x3a>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
jmp    1130 <skip+0x20>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8** @skip(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp ne i8** %3, null
br i1 %4, label %5, label %21
5: ; preds = %1
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %21
9: ; preds = %5
br label %10
10: ; preds = %16, %9
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = call i64 @isspace(i8 signext %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %10
%17 = load i8**, i8*** %2
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %17
br label %10
20: ; preds = %10
br label %21
21: ; preds = %20, %5, %1
%22 = load i8**, i8*** %2
ret i8** %22
}

LLVM IR (-O2):
define i8** @skip(i8** returned %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %16, label %6
6: ; preds = %3
%7 = load i8, i8* %4
%8 = tail call i64 @isspace(i8 signext %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %6, %10
%11 = load i8*, i8** %0
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8* %12, i8** %0
%13 = load i8, i8* %12
%14 = tail call i64 @isspace(i8 signext %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %10
16: ; preds = %10, %6, %3, %1
ret i8** %0
}
/* Variables and functions */
int PAPI_register_thread();
void papif_register_thread__(int *check) { *check = PAPI_register_thread(); }


x86 assembly (clang, -O0):
<papif_register_thread__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PAPI_register_thread@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_register_thread__>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_register_thread@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_register_thread__(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @PAPI_register_thread()
store i32 %2, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "Usage: %s [options]\n", name);
  fprintf(stderr, "For more information type: %s -h \n\n", name);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xedb(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: %s [options]\0A\00"
@.str.1 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: %s [options]\0A\00"
@.str.1 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qaF(char const *);
void qaF2(const char *x) { qaF(x); }


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

x86 assembly (clang, -O2):
<qaF2>:
jmp    1030 <qaF@plt>

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

LLVM IR (-O2):
define void @qaF2(i8* %0) {
%2 = tail call i32 @qaF(i8* %0)
ret void
}
/* Variables and functions */
int close(int);
int GPIO__Close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<GPIO__Close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @GPIO__Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ g_mutex_free(void *);
int gcry_gthread_mutex_destroy(void **lock) {
  g_mutex_free(*lock);
  return 0;
}


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

x86 assembly (clang, -O2):
<gcry_gthread_mutex_destroy>:
push   %rax
mov    (%rdi),%rdi
call   1030 <g_mutex_free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gcry_gthread_mutex_destroy(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @g_mutex_free(i8* %2)
ret i32 0
}
void tegra_dvfs_rail_enable(struct dvfs_rail *rail) {}


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

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

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

LLVM IR (-O2):
%struct.dvfs_rail = type opaque
define void @tegra_dvfs_rail_enable(%struct.dvfs_rail* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ u;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char const *, int);
__attribute__((always_)) uint16_t string_as_uint16(const char *s) {
  uint16_t u;
  memcpy(&u, s, sizeof(u));
  return u;
}


x86 assembly (clang, -O0):
<string_as_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_as_uint16>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @string_as_uint16(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EPOLL_CTL_DEL;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ ctl_fd(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void disconnect_client(int epfd, int client) {
  ctl_fd(epfd, client, EPOLL_CTL_DEL, 0);
  close(client);
  printf("disconnect with client %d\n", client);
}


x86 assembly (clang, -O0):
<disconnect_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1030 <ctl_fd@plt>
mov    -0x8(%rbp),%edi
call   1050 <close@plt>
mov    -0x8(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disconnect_client>:
push   %rbx
mov    %esi,%ebx
mov    0x2ebe(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1030 <ctl_fd@plt>
mov    %ebx,%edi
call   1050 <close@plt>
lea    0xeaf(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@EPOLL_CTL_DEL = global i32 0
@.str = [27 x i8] c"disconnect with client %d\0A\00"
define void @disconnect_client(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 = load i32, i32* @EPOLL_CTL_DEL
%8 = call i32 @ctl_fd(i32 %5, i32 %6, i32 %7, i32 0)
%9 = load i32, i32* %4
%10 = call i32 @close(i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@EPOLL_CTL_DEL = global i32 0
@.str = [27 x i8] c"disconnect with client %d\0A\00"
define void @disconnect_client(i32 %0, i32 %1) {
%3 = load i32, i32* @EPOLL_CTL_DEL
%4 = tail call i32 @ctl_fd(i32 %0, i32 %1, i32 %3, i32 0)
%5 = tail call i32 @close(i32 %1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void time_n_date(FILE *infile) {
  time_t tnd = time(NULL);
  fprintf(infile, "%s", ctime(&tnd));
}


x86 assembly (clang, -O0):
<time_n_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <ctime@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_n_date>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <fputs@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @time_n_date(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = call i8* @ctime(i32* %2)
%6 = call i32 @fputs(i8* %5, i32* %0)
ret void
}
unsigned int umax(unsigned int a, unsigned int b) {
  return (((a) > (b)) ? (a) : (b));
}


x86 assembly (clang, -O0):
<umax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1121 <umax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <umax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<umax>:
mov    %esi,%eax
cmp    %esi,%edi
cmova  %edi,%eax
ret

LLVM IR (-O0):
define i32 @umax(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 = icmp ugt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @umax(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}