xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long time_in_usec(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  unsigned long time_in_micros = ((1000 * 1000) * tv.tv_sec) + tv.tv_usec;
  return time_in_micros;
}


x86 assembly (clang, -O0):
<time_in_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_in_usec>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0xf4240,%rax,%rcx
movslq 0x4(%rsp),%rax
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @time_in_usec() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 1000000, %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %2
%11 = load i64, i64* %2
ret i64 %11
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @time_in_usec() {
%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 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sext i32 %9 to i64
ret i64 %10
}
int do_371() { return 371; }


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

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

LLVM IR (-O0):
define i32 @do_371() {
ret i32 371
}

LLVM IR (-O2):
define i32 @do_371() {
ret i32 371
}
float filter_triangle(float x) {
  if (x < -1.0)
    return 0.0;
  if (x < 0.0)
    return 1.0 + x;
  if (x < 1.0)
    return 1.0 - x;
  return 0.0;
}


x86 assembly (clang, -O0):
<filter_triangle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <filter_triangle+0x31>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11b0 <filter_triangle+0xb0>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    116a <filter_triangle+0x6a>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb0(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11b0 <filter_triangle+0xb0>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe8d(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11a8 <filter_triangle+0xa8>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe72(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11b0 <filter_triangle+0xb0>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_triangle>:
xorps  %xmm1,%xmm1
movss  0xef5(%rip),%xmm2
ucomiss %xmm0,%xmm2
ja     1135 <filter_triangle+0x35>
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1121 <filter_triangle+0x21>
addss  0xee4(%rip),%xmm0
ret
movss  0xedb(%rip),%xmm2
ucomiss %xmm0,%xmm2
jbe    1135 <filter_triangle+0x35>
subss  %xmm0,%xmm2
movaps %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @filter_triangle(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, -1.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store float 0.000000e+00, float* %2
br label %27
8: ; preds = %1
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fcmp olt double %10, 0.000000e+00
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = fadd double 1.000000e+00, %14
%16 = fptrunc double %15 to float
store float %16, float* %2
br label %27
17: ; preds = %8
%18 = load float, float* %3
%19 = fpext float %18 to double
%20 = fcmp olt double %19, 1.000000e+00
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load float, float* %3
%23 = fpext float %22 to double
%24 = fsub double 1.000000e+00, %23
%25 = fptrunc double %24 to float
store float %25, float* %2
br label %27
26: ; preds = %17
store float 0.000000e+00, float* %2
br label %27
27: ; preds = %26, %21, %12, %7
%28 = load float, float* %2
ret float %28
}

LLVM IR (-O2):
define float @filter_triangle(float %0) {
%2 = fcmp olt float %0, -1.000000e+00
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = fcmp olt float %0, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = fadd float %0, 1.000000e+00
br label %11
7: ; preds = %3
%8 = fcmp olt float %0, 1.000000e+00
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = fsub float 1.000000e+00, %0
br label %11
11: ; preds = %7, %1, %9, %5
%12 = phi float [ %6, %5 ], [ %10, %9 ], [ 0.000000e+00, %1 ], [ 0.000000e+00, %7 ]
ret float %12
}
/* Variables and functions */
unsigned long long factorial(unsigned long long);
unsigned long long combinations(unsigned long long n, unsigned long long r) {
  return factorial(n) / (factorial(r) * factorial(n - r));
}


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

x86 assembly (clang, -O2):
<combinations>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <factorial@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1030 <factorial@plt>
mov    %rax,%r12
sub    %r15,%rbx
mov    %rbx,%rdi
call   1030 <factorial@plt>
mov    %rax,%rcx
imul   %r12,%rcx
mov    %r14,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1159 <combinations+0x49>
mov    %r14,%rax
xor    %edx,%edx
div    %rcx
jmp    1160 <combinations+0x50>
mov    %r14d,%eax
xor    %edx,%edx
div    %ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @combinations(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 = call i64 @factorial(i64 %5)
%7 = load i64, i64* %4
%8 = call i64 @factorial(i64 %7)
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = sub i64 %9, %10
%12 = call i64 @factorial(i64 %11)
%13 = mul i64 %8, %12
%14 = udiv i64 %6, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @combinations(i64 %0, i64 %1) {
%3 = tail call i64 @factorial(i64 %0)
%4 = tail call i64 @factorial(i64 %1)
%5 = sub i64 %0, %1
%6 = tail call i64 @factorial(i64 %5)
%7 = mul i64 %6, %4
%8 = udiv i64 %3, %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ bin2hex(unsigned char const *, int, char *);
int /*<<< orphan*/ printf(char *, char const *, char *);
void pv(const char *tag, const unsigned char *val, int len) {
  char obuf[2048];
  bin2hex(val, len, obuf);
  printf("%s = %s\n", tag, obuf);
}


x86 assembly (clang, -O0):
<pv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x820(%rbp),%rdx
call   1040 <bin2hex@plt>
mov    -0x8(%rbp),%rsi
lea    -0x820(%rbp),%rdx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pv>:
push   %r14
push   %rbx
sub    $0x808,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %rsi,%rdi
mov    %edx,%esi
mov    %r14,%rdx
call   1040 <bin2hex@plt>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
add    $0x808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s = %s\0A\00"
define void @pv(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [2048 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%11 = call i32 @bin2hex(i8* %8, i32 %9, i8* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s = %s\0A\00"
define void @pv(i8* %0, i8* %1, i32 %2) {
%4 = alloca [2048 x i8]
%5 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%6 = call i32 @bin2hex(i8* %1, i32 %2, i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %5)
ret void
}
/* Variables and functions */
int sprintf(char *, char *, int);
char *print_int(int i, char *output) {
  int len;
  len = sprintf(output, "%d", i);
  return output + len;
}


x86 assembly (clang, -O0):
<print_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xee3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @print_int(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i32, i32* %3
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
ret i8* %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @print_int(i32 %0, i8* writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
ret i8* %5
}
int parseCount(char **argv) {
  if (!argv)
    return 0;
  int count = -1;
  while (argv[++count])
    ;
  return count;
}


x86 assembly (clang, -O0):
<parseCount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <parseCount+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    114c <parseCount+0x4c>
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1146 <parseCount+0x46>
jmp    1126 <parseCount+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseCount>:
test   %rdi,%rdi
je     111e <parseCount+0x1e>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <parseCount+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @parseCount(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ -1, %1 ]
%5 = add nsw i64 %4, 1
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %5 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
int /*<<< orphan*/ abort();
int munmap(void *, int /*<<< orphan*/);
int /*<<< orphan*/ sysconf(int /*<<< orphan*/);
void free_page(void *page) {
  int err;
  err = munmap(page, sysconf(_SC_PAGESIZE));
  if (err)
    abort();
}


x86 assembly (clang, -O0):
<free_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1050 <sysconf@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <munmap@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1171 <free_page+0x41>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_page>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1050 <sysconf@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <munmap@plt>
test   %eax,%eax
jne    1152 <free_page+0x22>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
define void @free_page(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @_SC_PAGESIZE
%6 = call i32 @sysconf(i32 %5)
%7 = call i32 @munmap(i8* %4, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
define void @free_page(i8* %0) {
%2 = load i32, i32* @_SC_PAGESIZE
%3 = tail call i32 @sysconf(i32 %2)
%4 = tail call i32 @munmap(i8* %0, i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}
/* Type definitions */
struct task_struct {
  int dummy;
};
struct rq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BUG();
void switched_to_idle(struct rq *rq, struct task_struct *p) { BUG(); }


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

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

LLVM IR (-O0):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @switched_to_idle(%struct.rq* %0, %struct.task_struct* %1) {
%3 = alloca %struct.rq*
%4 = alloca %struct.task_struct*
store %struct.rq* %0, %struct.rq** %3
store %struct.task_struct* %1, %struct.task_struct** %4
%5 = call i32 (...) @BUG()
ret void
}

LLVM IR (-O2):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @switched_to_idle(%struct.rq* nocapture readnone %0, %struct.task_struct* nocapture readnone %1) {
%3 = tail call i32 (...) @BUG()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x37_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x37_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x37_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x37_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x37_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(FILE *stream) { return ((int)stream); }


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

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

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

LLVM IR (-O2):
define i32 @fileno(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int endian() {
  static int init = 0;
  static int endian = 0;
  char *p;
  if (init)
    return endian;
  init = 1;
  p = &init;
  return endian = p[0] ? 1 : 0;
}


x86 assembly (clang, -O0):
<endian>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f19(%rip)
je     111f <endian+0x1f>
mov    0x2f11(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <endian+0x51>
movl   $0x1,0x2efb(%rip)
lea    0x2ef4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,0x2eda(%rip)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian>:
cmpb   $0x1,0x2f1d(%rip)
jne    1111 <endian+0x11>
movzbl 0x2f18(%rip),%eax
ret
movb   $0x1,0x2f0c(%rip)
movb   $0x1,0x2f09(%rip)
mov    $0x1,%eax
ret

LLVM IR (-O0):
@endian.init = internal global i32 0
@endian.endian = internal global i32 0
define i32 @endian() {
%1 = alloca i32
%2 = alloca i8*
%3 = load i32, i32* @endian.init
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* @endian.endian
store i32 %6, i32* %1
br label %15
7: ; preds = %0
store i32 1, i32* @endian.init
store i8* bitcast (i32* @endian.init to i8*), i8** %2
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
store i32 %14, i32* @endian.endian
store i32 %14, i32* %1
br label %15
15: ; preds = %7, %5
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@endian.init = internal unnamed_addr global i1 false
@endian.endian = internal unnamed_addr global i1 false
define i32 @endian() {
%1 = load i1, i1* @endian.init
br i1 %1, label %2, label %5
2: ; preds = %0
%3 = load i1, i1* @endian.endian
%4 = zext i1 %3 to i32
br label %6
5: ; preds = %0
store i1 true, i1* @endian.init
store i1 true, i1* @endian.endian
br label %6
6: ; preds = %5, %2
%7 = phi i32 [ %4, %2 ], [ 1, %5 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_SyntaxMarkVariableNotAllowedInDelimiter(long p_position) {
  _Error(p_position, "Mark variables are not allowed in delimiter clauses");
}


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

x86 assembly (clang, -O2):
<Error_SyntaxMarkVariableNotAllowedInDelimiter>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"Mark variables are not allowed in delimiter clauses\00"
define void @Error_SyntaxMarkVariableNotAllowedInDelimiter(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"Mark variables are not allowed in delimiter clauses\00"
define void @Error_SyntaxMarkVariableNotAllowedInDelimiter(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int is_leap_year(int);
uint16_t to_century_day_number(uint16_t y, uint16_t ydn) {
  uint16_t cdn;
  cdn = ydn;
  cdn--;
  while (y > 2000) {
    y--;
    cdn += 365;
    cdn += is_leap_year(y);
  }
  return cdn;
}


x86 assembly (clang, -O0):
<to_century_day_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x7d0,-0x4(%rbp)
jle    1161 <to_century_day_number+0x51>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x16d,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <is_leap_year@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112d <to_century_day_number+0x1d>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_century_day_number>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
add    $0xffffffff,%r14d
cmp    $0x7d1,%edi
jl     114d <to_century_day_number+0x3d>
mov    %edi,%ebx
add    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%edi
call   1030 <is_leap_year@plt>
add    %eax,%r14d
add    $0x16d,%r14d
add    $0xffffffff,%ebx
cmp    $0x7d1,%ebx
ja     1130 <to_century_day_number+0x20>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @to_century_day_number(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = add nsw i32 %7, -1
store i32 %8, i32* %5
br label %9
9: ; preds = %12, %2
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 2000
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, -1
store i32 %14, i32* %3
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 365
store i32 %16, i32* %5
%17 = load i32, i32* %3
%18 = call i32 @is_leap_year(i32 %17)
%19 = load i32, i32* %5
%20 = add nsw i32 %19, %18
store i32 %20, i32* %5
br label %9
21: ; preds = %9
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @to_century_day_number(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = icmp sgt i32 %0, 2000
br i1 %4, label %5, label %13
5: ; preds = %2, %5
%6 = phi i32 [ %11, %5 ], [ %3, %2 ]
%7 = phi i32 [ %8, %5 ], [ %0, %2 ]
%8 = add nsw i32 %7, -1
%9 = add nsw i32 %6, 365
%10 = tail call i32 @is_leap_year(i32 %8)
%11 = add nsw i32 %9, %10
%12 = icmp ugt i32 %7, 2001
br i1 %12, label %5, label %13
13: ; preds = %5, %2
%14 = phi i32 [ %3, %2 ], [ %11, %5 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ initGpio();
int /*<<< orphan*/ initVars();
int /*<<< orphan*/ startupPwm();
void init() {
  initVars();
  startupPwm();
  initGpio();
}


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

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1030 <initVars@plt>
xor    %eax,%eax
call   1050 <startupPwm@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <initGpio@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 (...) @initVars()
%2 = call i32 (...) @startupPwm()
%3 = call i32 (...) @initGpio()
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @initVars()
%2 = tail call i32 (...) @startupPwm()
%3 = tail call i32 (...) @initGpio()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_add_sub_rounding();
int /*<<< orphan*/ test_random();
int /*<<< orphan*/ test_specials();
int main(void) {
  printf(".data\n");
  printf(".globl TESTS\n");
  printf("TESTS:\n");
  test_add_sub_rounding();
  test_specials();
  test_random();
  printf(".long -1");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <test_add_sub_rounding@plt>
mov    $0x0,%al
call   1050 <test_specials@plt>
mov    $0x0,%al
call   1030 <test_random@plt>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb1(%rip),%rdi
call   1040 <puts@plt>
lea    0xeab(%rip),%rdi
call   1040 <puts@plt>
lea    0xeac(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <test_add_sub_rounding@plt>
xor    %eax,%eax
call   1060 <test_specials@plt>
xor    %eax,%eax
call   1030 <test_random@plt>
lea    0xe6f(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c".data\0A\00"
@.str.1 = [14 x i8] c".globl TESTS\0A\00"
@.str.2 = [8 x i8] c"TESTS:\0A\00"
@.str.3 = [9 x i8] c".long -1\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 (...) @test_add_sub_rounding()
%5 = call i32 (...) @test_specials()
%6 = call i32 (...) @test_random()
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [9 x i8] c".long -1\00"
@str = [6 x i8] c".data\00"
@str.4 = [13 x i8] c".globl TESTS\00"
@str.5 = [7 x i8] c"TESTS:\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 (...) @test_add_sub_rounding()
%5 = tail call i32 (...) @test_specials()
%6 = tail call i32 (...) @test_random()
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
void XcmsDisplayOfCCC() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void fprint_orl_data(FILE *stream, uint8_t data) {
  fprintf(stream,
          "ORL   A, #"
          "0x%02X"
          "                  ",
          data);
}


x86 assembly (clang, -O0):
<fprint_orl_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_orl_data>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"ORL A,x%02X \00"
define void @fprint_orl_data(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"ORL A,x%02X \00"
define void @fprint_orl_data(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int BIO_set_tcp_ndelay(int s, int on) {
  int ret = 0;
  return (ret == 0);
}


x86 assembly (clang, -O0):
<BIO_set_tcp_ndelay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @BIO_set_tcp_ndelay(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @BIO_set_tcp_ndelay(i32 %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int errno;
int /*<<< orphan*/ printf(char *, int);
long sysconf(int /*<<< orphan*/);
int main(void) {
  long nproc = sysconf(_SC_NPROCESSORS_ONLN);
  printf("sysconf(_SC_NPROCESSORS_ONLN) = %ld processors.\n", nproc);
  if (nproc < 0) {
    printf("errno = %d\n", errno);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
jge    1173 <main+0x53>
mov    0x2e73(%rip),%rax
mov    (%rax),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
test   %rbx,%rbx
jns    115a <main+0x3a>
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
@.str = [49 x i8] c"sysconf(_SC_NPROCESSORS_ONLN) = %ld processors.\0A\00"
@.str.1 = [12 x i8] c"errno = %d\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i64 @sysconf(i32 %1)
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp slt i64 %2, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @errno
%8 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ SetCamera();
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
void myReshape(int w, int h) {
  glMatrixMode(GL_MODELVIEW);
  glViewport(0, 0, w, h);
  glLoadIdentity();
  SetCamera();
}


x86 assembly (clang, -O0):
<myReshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1060 <glViewport@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
mov    $0x0,%al
call   1050 <SetCamera@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myReshape>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1060 <glViewport@plt>
xor    %eax,%eax
call   1040 <glLoadIdentity@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <SetCamera@plt>

LLVM IR (-O0):
@GL_MODELVIEW = global i32 0
define void @myReshape(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @GL_MODELVIEW
%6 = call i32 @glMatrixMode(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @glViewport(i32 0, i32 0, i32 %7, i32 %8)
%10 = call i32 (...) @glLoadIdentity()
%11 = call i32 (...) @SetCamera()
ret void
}

LLVM IR (-O2):
@GL_MODELVIEW = global i32 0
define void @myReshape(i32 %0, i32 %1) {
%3 = load i32, i32* @GL_MODELVIEW
%4 = tail call i32 @glMatrixMode(i32 %3)
%5 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%6 = tail call i32 (...) @glLoadIdentity()
%7 = tail call i32 (...) @SetCamera()
ret void
}
int hash(char *s) {
  int hsh;
  hsh = 0;
  for (; *s != '\0'; s++)
    hsh += *s;
  return hsh % 8000;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113d <hash+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x1f40,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%al
test   %al,%al
je     1140 <hash+0x40>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsbl %al,%eax
add    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash+0x10>
movslq %ecx,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x29,%rcx
add    %edx,%ecx
imul   $0x1f40,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ 0, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = add nsw i32 %6, %8
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = srem i32 %9, 8000
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 0, %1 ], [ %14, %13 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("AES 128 Key Expansion");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [22 x i8] c"AES 128 Key Expansion\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void handle_tag_start(char *tag) { return; }


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

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

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

LLVM IR (-O2):
define void @handle_tag_start(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
int32_t mcnet_read_int32(uint8_t *in) {
  return (in[0] << 24) + (in[1] << 16) + (in[2] << 8) + in[3];
}


x86 assembly (clang, -O0):
<mcnet_read_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
add    0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcnet_read_int32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
add    %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
add    %ecx,%eax
add    0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @mcnet_read_int32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = add nsw i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = add nsw i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = add nsw i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @mcnet_read_int32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = add nsw i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = add nsw i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = add nsw i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
void sighand(int signum) {
  printf(" I am in sig handler \n");
  wait(NULL);
}


x86 assembly (clang, -O0):
<sighand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <wait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighand>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <wait@plt>

LLVM IR (-O0):
@.str = [23 x i8] c" I am in sig handler \0A\00"
define void @sighand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @wait(i32* null)
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c" I am in sig handler \00"
define void @sighand(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @wait(i32* null)
ret void
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
void RNDResponseSink_ConnectionManager_PrepareForConnection(
    struct UPnPService *Service, int ErrorCode, void *User, int ConnectionID,
    int AVTransportID, int RcsID) {
  printf("RND Invoke Response: "
         "ConnectionManager/PrepareForConnection[ErrorCode:%d](%d,%d,%d)\r\n",
         ErrorCode, ConnectionID, AVTransportID, RcsID);
}


x86 assembly (clang, -O0):
<RNDResponseSink_ConnectionManager_PrepareForConnection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNDResponseSink_ConnectionManager_PrepareForConnection>:
lea    0xee9(%rip),%rdi
mov    %ecx,%edx
mov    %r8d,%ecx
mov    %r9d,%r8d
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [86 x i8] c"RND Invoke Response: ConnectionManager/PrepareForConnection[ErrorCode:%d](%d,%d,%d)\0D\0A\00"
define void @RNDResponseSink_ConnectionManager_PrepareForConnection(%struct.UPnPService* %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca %struct.UPnPService*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store %struct.UPnPService* %0, %struct.UPnPService** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %8
%14 = load i32, i32* %10
%15 = load i32, i32* %11
%16 = load i32, i32* %12
%17 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [86 x i8] c"RND Invoke Response: ConnectionManager/PrepareForConnection[ErrorCode:%d](%d,%d,%d)\0D\0A\00"
define void @RNDResponseSink_ConnectionManager_PrepareForConnection(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %3, i32 %4, i32 %5)
ret void
}
void template_normal_function1() {}


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

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

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

LLVM IR (-O2):
define void @template_normal_function1() {
ret void
}
unsigned int rtnlgrp_to_mask(unsigned int grp) {
  return grp ? 1 << (grp - 1) : 0;
}


x86 assembly (clang, -O0):
<rtnlgrp_to_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1126 <rtnlgrp_to_mask+0x26>
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <rtnlgrp_to_mask+0x30>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <rtnlgrp_to_mask+0x30>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtnlgrp_to_mask>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    %eax,%eax
cmp    $0x1,%edi
cmovae %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @rtnlgrp_to_mask(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = add i32 %0, -1
%4 = shl nuw i32 1, %3
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("----------------PROCESS START----------------\n");
  printf("Prob 3: normal\n");
  printf("----------------PROCESS   END----------------\n");
  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    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [47 x i8] c"----------------PROCESS START----------------\0A\00"
@.str.1 = [16 x i8] c"Prob 3: normal\0A\00"
@.str.2 = [47 x i8] c"----------------PROCESS END----------------\0A\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 ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [46 x i8] c"----------------PROCESS START----------------\00"
@str.3 = [15 x i8] c"Prob 3: normal\00"
@str.4 = [46 x i8] c"----------------PROCESS END----------------\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int cmd_diag_probe_common(int, char **, int);
int cmd_diag_fastprobe(int argc, char **argv) {
  return cmd_diag_probe_common(argc, argv, 1);
}


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

x86 assembly (clang, -O2):
<cmd_diag_fastprobe>:
mov    $0x1,%edx
jmp    1030 <cmd_diag_probe_common@plt>

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

LLVM IR (-O2):
define i32 @cmd_diag_fastprobe(i32 %0, i8** %1) {
%3 = tail call i32 @cmd_diag_probe_common(i32 %0, i8** %1, i32 1)
ret i32 %3
}
int ath10k_spectral_vif_stop(struct ath10k_vif *arvif) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ath10k_vif = type opaque
define i32 @ath10k_spectral_vif_stop(%struct.ath10k_vif* nocapture readnone %0) {
ret i32 0
}