xunge/DecIR huggingface dataset:
/* Variables and functions */
int check_wireless_interface(char *);
int calculate_if_metric(char *ifname) {
  return check_wireless_interface(ifname);
}


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

x86 assembly (clang, -O2):
<calculate_if_metric>:
jmp    1030 <check_wireless_interface@plt>

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

LLVM IR (-O2):
define i32 @calculate_if_metric(i8* %0) {
%2 = tail call i32 @check_wireless_interface(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strpbrk(char const *, char *);
int filenameValid(char const *aFileNameWithoutPath) {
  if (!aFileNameWithoutPath || !strlen(aFileNameWithoutPath) ||
      strpbrk(aFileNameWithoutPath, "\\/:*?\"<>|")) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<filenameValid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1163 <filenameValid+0x43>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
je     1163 <filenameValid+0x43>
mov    -0x10(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1040 <strpbrk@plt>
cmp    $0x0,%rax
je     116f <filenameValid+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    1176 <filenameValid+0x56>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filenameValid>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
test   %rdi,%rdi
je     114e <filenameValid+0x2e>
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
je     114e <filenameValid+0x2e>
lea    0xec3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strpbrk@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\\/:*?\22<>|\00"
define i32 @filenameValid(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = call i64 @strpbrk(i8* %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10, %6, %1
store i32 0, i32* %2
br label %16
15: ; preds = %10
store i32 1, i32* %2
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [10 x i8] c"\\/:*?\22<>|\00"
define i32 @filenameValid(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @strpbrk(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %1, %3
%11 = phi i32 [ 0, %3 ], [ 0, %1 ], [ %9, %6 ]
ret i32 %11
}
double vecDot(double *u, double *v) {
  double d = u[0] * v[0] + u[1] * v[1] + u[2] * v[2];
  return d;
}


x86 assembly (clang, -O0):
<vecDot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vecDot>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @vecDot(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = load double*, double** %4
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fmul double %14, %17
%19 = call double @llvm.fmuladd.f64(double %8, double %11, double %18)
%20 = load double*, double** %3
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 2
%25 = load double, double* %24
%26 = call double @llvm.fmuladd.f64(double %22, double %25, double %19)
store double %26, double* %5
%27 = load double, double* %5
ret double %27
}

LLVM IR (-O2):
define double @vecDot(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
void testCauchy() {
  UnitTest_expect_true((0 != Random_cauchy(0.0, 1.0)), __func__, 34);
  ;
}


x86 assembly (clang, -O0):
<testCauchy>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movsd  0xed1(%rip),%xmm1
mov    $0x2,%al
call   1040 <Random_cauchy@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebd(%rip),%rsi
mov    $0x22,%edx
mov    $0x0,%al
call   1030 <UnitTest_expect_true@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testCauchy>:
push   %rax
movsd  0xed7(%rip),%xmm1
xorps  %xmm0,%xmm0
mov    $0x2,%al
call   1040 <Random_cauchy@plt>
xor    %edi,%edi
test   %eax,%eax
setne  %dil
lea    0xec6(%rip),%rsi
mov    $0x22,%edx
xor    %eax,%eax
pop    %rcx
jmp    1030 <UnitTest_expect_true@plt>

LLVM IR (-O0):
@__func__.testCauchy = [11 x i8] c"testCauchy\00"
define void @testCauchy() {
%1 = call i32 (double, double, ...) bitcast (i32 (...)* @Random_cauchy to i32 (double, double, ...)*)(double 0.000000e+00, double 1.000000e+00)
%2 = icmp ne i32 0, %1
%3 = zext i1 %2 to i32
%4 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @UnitTest_expect_true to i32 (i32, i8*, i32, ...)*)(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.testCauchy, i64 0, i64 0), i32 34)
ret void
}

LLVM IR (-O2):
@__func__.testCauchy = [11 x i8] c"testCauchy\00"
define void @testCauchy() {
%1 = tail call i32 (double, double, ...) bitcast (i32 (...)* @Random_cauchy to i32 (double, double, ...)*)(double 0.000000e+00, double 1.000000e+00)
%2 = icmp ne i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @UnitTest_expect_true to i32 (i32, i8*, i32, ...)*)(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.testCauchy, i64 0, i64 0), i32 34)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ircproto_pong(char *);
void handle_ping(char *prefix, char *cmd, char *params) {
  ircproto_pong(params);
}


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

x86 assembly (clang, -O2):
<handle_ping>:
mov    %rdx,%rdi
jmp    1030 <ircproto_pong@plt>

LLVM IR (-O0):
define void @handle_ping(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @ircproto_pong(i8* %7)
ret void
}

LLVM IR (-O2):
define void @handle_ping(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* %2) {
%4 = tail call i32 @ircproto_pong(i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int errno;
int ftruncate(int, int /*<<< orphan*/);
int __sulong_posix_ftruncate(int fildes, off_t length) {
  {
    int native_errno = errno;
    int result = ftruncate(fildes, length);
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_ftruncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <ftruncate@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    1152 <__sulong_posix_ftruncate+0x42>
xor    %eax,%eax
mov    0x2e95(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    0x2e84(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_ftruncate>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <ftruncate@plt>
xor    %ecx,%ecx
sub    (%rbx),%ecx
cmp    $0xffffffff,%eax
cmove  %ecx,%eax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @__sulong_posix_ftruncate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* @errno
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @ftruncate(i32 %8, i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i32, i32* @errno
%15 = sub nsw i32 0, %14
%16 = sext i32 %15 to i64
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
br label %18
18: ; preds = %13, %2
%19 = load i32, i32* %5
store i32 %19, i32* @errno
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @__sulong_posix_ftruncate(i32 %0, i32 %1) {
%3 = load i32, i32* @errno
%4 = tail call i32 @ftruncate(i32 %0, i32 %1)
%5 = icmp eq i32 %4, -1
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 %4
store i32 %3, i32* @errno
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  int i;
  float sum = 0;
  for (i = 1; i <= 100; i++) {
    sum = sum + (1 / (float)i);
  }
  printf("%0.2f\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1165 <main+0x55>
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm2
movss  0xeb6(%rip),%xmm1
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <main+0x1e>
movss  -0xc(%rbp),%xmm0
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%eax
xorps  %xmm0,%xmm0
movss  0xedf(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xorps  %xmm2,%xmm2
cvtsi2ss %eax,%xmm2
movaps %xmm1,%xmm3
divss  %xmm2,%xmm3
addss  %xmm0,%xmm3
lea    0x1(%rax),%ecx
xorps  %xmm2,%xmm2
cvtsi2ss %ecx,%xmm2
movaps %xmm1,%xmm0
divss  %xmm2,%xmm0
addss  %xmm3,%xmm0
add    $0x2,%eax
cmp    $0x65,%eax
jne    1130 <main+0x20>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%0.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %3
store i32 1, i32* %2
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load float, float* %3
%9 = load i32, i32* %2
%10 = sitofp i32 %9 to float
%11 = fdiv float 1.000000e+00, %10
%12 = fadd float %8, %11
store float %12, float* %3
br label %13
13: ; preds = %7
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %4
16: ; preds = %4
%17 = load float, float* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%0.2f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi float [ 0.000000e+00, %0 ], [ %10, %1 ]
%3 = phi i32 [ 1, %0 ], [ %11, %1 ]
%4 = sitofp i32 %3 to float
%5 = fdiv float 1.000000e+00, %4
%6 = fadd float %2, %5
%7 = add nuw nsw i32 %3, 1
%8 = sitofp i32 %7 to float
%9 = fdiv float 1.000000e+00, %8
%10 = fadd float %6, %9
%11 = add nuw nsw i32 %3, 2
%12 = icmp eq i32 %11, 101
br i1 %12, label %13, label %1
13: ; preds = %1
%14 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int do_test(void) {
  puts("No exceptions defined, cannot test");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"No exceptions defined, cannot test\00"
define i32 @do_test() {
%1 = call i32 @puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"No exceptions defined, cannot test\00"
define i32 @do_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int agea(int n) {
  int c;
  if (n == 1)
    c = 10;
  else
    c = agea(n - 1) + 2;
  return c;
}


x86 assembly (clang, -O0):
<agea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1131 <agea+0x21>
movl   $0xa,-0x8(%rbp)
jmp    1142 <agea+0x32>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <agea@plt>
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agea>:
cmp    $0x1,%edi
lea    0x8(%rdi,%rdi,1),%ecx
mov    $0xa,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @agea(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = shl i32 %0, 1
%4 = add i32 %3, 8
%5 = select i1 %2, i32 10, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ stderr;
int main(void) {
  char *ptr[1024];
  int i;
  for (i = 0; i < 1024; i++) {
    fprintf(stderr, "ptr[%d] = %p\n", i, ptr[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2020,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x2014(%rbp)
cmpl   $0x400,-0x2014(%rbp)
jge    117a <main+0x6a>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x2014(%rbp),%edx
movslq -0x2014(%rbp),%rax
mov    -0x2010(%rbp,%rax,8),%rcx
ff
lea    0xe9f(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x2014(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2014(%rbp)
jmp    112c <main+0x1c>
xor    %eax,%eax
add    $0x2020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x2000,%rsp
xor    %ebx,%ebx
mov    0x2ebb(%rip),%r15
lea    0xed4(%rip),%r14
nopl   0x0(%rax)
mov    (%r15),%edi
mov    (%rsp,%rbx,8),%rcx
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    $0x400,%rbx
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x2000,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"ptr[%d] = %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8*]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %15, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1024
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [1024 x i8*], [1024 x i8*]* %2, i64 0, i64 %11
%13 = load i8*, i8** %12
%14 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %13)
br label %15
15: ; preds = %7
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"ptr[%d] = %p\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8*]
%2 = bitcast [1024 x i8*]* %1 to i8*
br label %3
3: ; preds = %0, %3
%4 = phi i64 [ 0, %0 ], [ %10, %3 ]
%5 = load i32, i32* @stderr
%6 = getelementptr inbounds [1024 x i8*], [1024 x i8*]* %1, i64 0, i64 %4
%7 = load i8*, i8** %6
%8 = trunc i64 %4 to i32
%9 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %7)
%10 = add nuw nsw i64 %4, 1
%11 = icmp eq i64 %10, 1024
br i1 %11, label %12, label %3
12: ; preds = %3
ret i32 0
}
void g_source_unref() {}


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

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

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

LLVM IR (-O2):
define void @g_source_unref() {
ret void
}
/* Variables and functions */
int ENOSYS;
int xntrace_user_stop(unsigned long v) { return -ENOSYS; }


x86 assembly (clang, -O0):
<xntrace_user_stop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ed7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @xntrace_user_stop(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @xntrace_user_stop(i64 %0) {
%2 = load i32, i32* @ENOSYS
%3 = sub nsw i32 0, %2
ret i32 %3
}
void moudrv_update(void) {}


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

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

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

LLVM IR (-O2):
define void @moudrv_update() {
ret void
}
int pRec4(int argc) { return (argc == 4); }


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

x86 assembly (clang, -O2):
<pRec4>:
xor    %eax,%eax
cmp    $0x4,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @pRec4(i32 %0) {
%2 = icmp eq i32 %0, 4
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SYS_chdir;
int syscall1(int /*<<< orphan*/, long);
int chdir(char *dir) { return syscall1(SYS_chdir, (long)dir); }


x86 assembly (clang, -O0):
<chdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <syscall1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chdir>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall1@plt>

LLVM IR (-O0):
@SYS_chdir = global i32 0
define i32 @chdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @SYS_chdir
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = call i32 @syscall1(i32 %3, i64 %5)
ret i32 %6
}

LLVM IR (-O2):
@SYS_chdir = global i32 0
define i32 @chdir(i8* %0) {
%2 = load i32, i32* @SYS_chdir
%3 = ptrtoint i8* %0 to i64
%4 = tail call i32 @syscall1(i32 %2, i64 %3)
ret i32 %4
}
/* Variables and functions */
int factoriel(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, result;
  printf("Vnesi broj na koj sakas da presmetas faktoriel: ");
  scanf("%d", &n);
  result = factoriel(n);
  printf("Factoriel na %d e %d.", n, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <factoriel@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [49 x i8] c"Vnesi broj na koj sakas da presmetas faktoriel: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Factoriel na %d e %d.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @factoriel(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"Vnesi broj na koj sakas da presmetas faktoriel: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Factoriel na %d e %d.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 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 = call i32 @factoriel(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %6)
ret i32 0
}
int axp_set_chargevoltage(int vol) {
  int ret = 0;
  return ret;
}


x86 assembly (clang, -O0):
<axp_set_chargevoltage>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @axp_set_chargevoltage(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ recvfrom(int, void *, size_t, int, int /*<<< orphan*/ *,
                            int /*<<< orphan*/ *);
ssize_t recv(int socket, void *buffer, size_t length, int flags) {
  return recvfrom(socket, buffer, length, flags, NULL, NULL);
}


x86 assembly (clang, -O0):
<recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   1030 <recvfrom@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv>:
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <recvfrom@plt>

LLVM IR (-O0):
define i32 @recv(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i32, i32* %8
%13 = call i32 @recvfrom(i32 %9, i8* %10, i64 %11, i32 %12, i32* null, i32* null)
ret i32 %13
}

LLVM IR (-O2):
define i32 @recv(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @recvfrom(i32 %0, i8* %1, i64 %2, i32 %3, i32* null, i32* null)
ret i32 %5
}
int odnan(double *din) {
  int ret_val;
  extern int odsnan(double *, double *);
  ret_val = odsnan(din, din);
  return ret_val;
}


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

x86 assembly (clang, -O2):
<odnan>:
mov    %rdi,%rsi
jmp    1030 <odsnan@plt>

LLVM IR (-O0):
define i32 @odnan(double* %0) {
%2 = alloca double*
%3 = alloca i32
store double* %0, double** %2
%4 = load double*, double** %2
%5 = load double*, double** %2
%6 = call i32 @odsnan(double* %4, double* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @odnan(double* %0) {
%2 = tail call i32 @odsnan(double* %0, double* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ sqrt(int);
int distance(int alin, int acol, int blin, int bcol) {
  int dy = alin - blin;
  int dx = acol - bcol;
  return (int)sqrt(dx * dx + dy * dy);
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
imul   -0x18(%rbp),%edi
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
add    %eax,%edi
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
sub    %edx,%edi
sub    %ecx,%esi
imul   %esi,%esi
imul   %edi,%edi
add    %esi,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define i32 @distance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %9
%14 = load i32, i32* %6
%15 = load i32, i32* %8
%16 = sub nsw i32 %14, %15
store i32 %16, i32* %10
%17 = load i32, i32* %10
%18 = load i32, i32* %10
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %9
%21 = load i32, i32* %9
%22 = mul nsw i32 %20, %21
%23 = add nsw i32 %19, %22
%24 = call i64 @sqrt(i32 %23)
%25 = trunc i64 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @distance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = sub nsw i32 %1, %3
%7 = mul nsw i32 %6, %6
%8 = mul nsw i32 %5, %5
%9 = add nuw nsw i32 %7, %8
%10 = tail call i64 @sqrt(i32 %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void dofree(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<dofree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @dofree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
float mm2inch(float mm) { return mm * 0.039370; }


x86 assembly (clang, -O0):
<mm2inch>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm2inch>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @mm2inch(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 3.937000e-02
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @mm2inch(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 3.937000e-02
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int wdog_kick2(int, unsigned int *);
int wdog_pmon_kick(int id, int *ack) {
  return wdog_kick2(id, (unsigned int *)ack);
}


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

x86 assembly (clang, -O2):
<wdog_pmon_kick>:
jmp    1030 <wdog_kick2@plt>

LLVM IR (-O0):
define i32 @wdog_pmon_kick(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 @wdog_kick2(i32 %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @wdog_pmon_kick(i32 %0, i32* %1) {
%3 = tail call i32 @wdog_kick2(i32 %0, i32* %1)
ret i32 %3
}
void rng_frand_init(struct anon$18 *rngh) { rng_urand_init(rngh); }


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

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

LLVM IR (-O0):
%"struct.anon$18" = type opaque
define void @rng_frand_init(%"struct.anon$18"* %0) {
%2 = alloca %"struct.anon$18"*
store %"struct.anon$18"* %0, %"struct.anon$18"** %2
%3 = load %"struct.anon$18"*, %"struct.anon$18"** %2
%4 = call i32 (%"struct.anon$18"*, ...) bitcast (i32 (...)* @rng_urand_init to i32 (%"struct.anon$18"*, ...)*)(%"struct.anon$18"* %3)
ret void
}

LLVM IR (-O2):
%"struct.anon$18" = type opaque
define void @rng_frand_init(%"struct.anon$18"* %0) {
%2 = tail call i32 (%"struct.anon$18"*, ...) bitcast (i32 (...)* @rng_urand_init to i32 (%"struct.anon$18"*, ...)*)(%"struct.anon$18"* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ hputc(int, int /*<<< orphan*/ *);
int hputs(const char *str, FILE *out) {
  while (*str)
    hputc(*str++ & 0xff, out);
  return 0;
}


x86 assembly (clang, -O0):
<hputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <hputs+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <hputc@plt>
jmp    1120 <hputs+0x10>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hputs>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <hputs+0x36>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <hputc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <hputs+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @hputs(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
br label %5
5: ; preds = %9, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = and i32 %13, 255
%15 = load i32*, i32** %4
%16 = call i32 @hputc(i32 %14, i32* %15)
br label %5
17: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @hputs(i8* nocapture %0, i32* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = zext i8 %6 to i32
%10 = tail call i32 @hputc(i32 %9, i32* %1)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ usleep(int);
int main(void) {
  while (1) {
    printf(".");
    fflush(stdout);
    usleep(100000);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x186a0,%edi
call   1050 <usleep@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x186a0,%edi
call   1050 <usleep@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = call i32 @usleep(i32 100000)
br label %2
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @putchar(i32 46)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @usleep(i32 100000)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ SYS_close;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int);
void real_close(int fd) { syscall(SYS_close, (fd)); }


x86 assembly (clang, -O0):
<real_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<real_close>:
mov    %edi,%esi
mov    0x2ecf(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_close = global i32 0
define void @real_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SYS_close
%4 = load i32, i32* %2
%5 = call i32 @syscall(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@SYS_close = global i32 0
define void @real_close(i32 %0) {
%2 = load i32, i32* @SYS_close
%3 = tail call i32 @syscall(i32 %2, i32 %0)
ret void
}
void tdefault_terminal_inferior(struct target_ops *self) {}


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

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

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

LLVM IR (-O2):
%struct.target_ops = type opaque
define void @tdefault_terminal_inferior(%struct.target_ops* nocapture %0) {
ret void
}
void swap(char *x, char *y) {
  char temp = *x;
  *x = *y;
  *y = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getfile(char *, int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int read(int, char *, int);
main(void) {
  register int fd;
  char c;
  fd = getfile("File", 0);
  while (read(fd, &c, 1) == 1)
    putchar(c);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
xor    %esi,%esi
call   1060 <getfile@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x1,%eax
jne    1188 <main+0x48>
movsbl -0x9(%rbp),%edi
call   1030 <putchar@plt>
jmp    1160 <main+0x20>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rdi
xor    %esi,%esi
call   1060 <getfile@plt>
mov    %eax,%ebx
lea    0x7(%rsp),%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x1,%eax
jne    118e <main+0x4e>
lea    0x7(%rsp),%r14
nop
movsbl 0x7(%rsp),%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x1,%eax
je     1170 <main+0x30>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"File\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 @getfile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
store i32 %4, i32* %2
br label %5
5: ; preds = %9, %0
%6 = load i32, i32* %2
%7 = call i32 @read(i32 %6, i8* %3, i32 1)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8, i8* %3
%11 = call i32 @putchar(i8 signext %10)
br label %5
12: ; preds = %5
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"File\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @getfile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = call i32 @read(i32 %2, i8* %1, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = load i8, i8* %1
%7 = tail call i32 @putchar(i8 signext %6)
%8 = call i32 @read(i32 %2, i8* %1, i32 1)
%9 = icmp eq i32 %8, 1
br i1 %9, label %5, label %10
10: ; preds = %5, %0
%11 = tail call i32 @exit(i32 0)
unreachable
}
int two_function(void) { return 7; }


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

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

LLVM IR (-O0):
define i32 @two_function() {
ret i32 7
}

LLVM IR (-O2):
define i32 @two_function() {
ret i32 7
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *, char const *);
int mkdir(char const *, int);
char *name_get(unsigned int);
int /*<<< orphan*/ printf(char *, char const *);
void do_mkdir(unsigned name) {
  const char *namestr;
  namestr = name_get(name);
  if (mkdir(namestr, 0775) == -1) {
    err(1, "%s: mkdir", namestr);
  }
  printf("mkdir %s\n", namestr);
}


x86 assembly (clang, -O0):
<do_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <name_get@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1fd,%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
jne    1183 <do_mkdir+0x43>
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
lea    0xe82(%rip),%rsi
call   1050 <err@plt>
mov    -0x10(%rbp),%rsi
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_mkdir>:
push   %rbx
call   1060 <name_get@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1fd,%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
jne    116f <do_mkdir+0x2f>
lea    0xe9e(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
call   1050 <err@plt>
lea    0xe94(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s: mkdir\00"
@.str.1 = [10 x i8] c"mkdir %s\0A\00"
define void @do_mkdir(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @name_get(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @mkdir(i8* %6, i32 509)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @err(i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %1
%13 = load i8*, i8** %3
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s: mkdir\00"
@.str.1 = [10 x i8] c"mkdir %s\0A\00"
define void @do_mkdir(i32 %0) {
%2 = tail call i8* @name_get(i32 %0)
%3 = tail call i32 @mkdir(i8* %2, i32 509)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %7
7: ; preds = %5, %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void RunDecryptionKeySchedule(uint8_t *key, uint8_t *roundKeys) {
  (void)key;
  (void)roundKeys;
}


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

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

LLVM IR (-O0):
define void @RunDecryptionKeySchedule(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
ret void
}

LLVM IR (-O2):
define void @RunDecryptionKeySchedule(i32* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int GET32(int);
int /*<<< orphan*/ PUT32(int, unsigned int);
void uart_putc(unsigned int c) {
  while (1) {
    if (GET32(0x20215054) & 0x20)
      break;
  }
  PUT32(0x20215040, c);
}


x86 assembly (clang, -O0):
<uart_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x20215054,%edi
call   1040 <GET32@plt>
and    $0x20,%eax
cmp    $0x0,%eax
je     1146 <uart_putc+0x26>
jmp    114b <uart_putc+0x2b>
jmp    112b <uart_putc+0xb>
mov    -0x4(%rbp),%esi
mov    $0x20215040,%edi
call   1030 <PUT32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_putc>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x20215054,%edi
call   1040 <GET32@plt>
test   $0x20,%al
je     1130 <uart_putc+0x10>
mov    $0x20215040,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <PUT32@plt>

LLVM IR (-O0):
define void @uart_putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %8
%4 = call i32 @GET32(i32 539054164)
%5 = and i32 %4, 32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %9
8: ; preds = %3
br label %3
9: ; preds = %7
%10 = load i32, i32* %2
%11 = call i32 @PUT32(i32 539054144, i32 %10)
ret void
}

LLVM IR (-O2):
define void @uart_putc(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @GET32(i32 539054164)
%4 = and i32 %3, 32
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = tail call i32 @PUT32(i32 539054144, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OveroSyncSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void OveroSyncSettingsRequestUpdate() {
  UAVObjRequestUpdate(OveroSyncSettingsHandle());
}


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

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

LLVM IR (-O0):
define void @OveroSyncSettingsRequestUpdate() {
%1 = call i32 (...) @OveroSyncSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OveroSyncSettingsRequestUpdate() {
%1 = tail call i32 (...) @OveroSyncSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
unsigned short read_chan(int);
unsigned short read_vref(void) { return read_chan(0x11); }


x86 assembly (clang, -O0):
<read_vref>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%edi
call   1030 <read_chan@plt>
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_vref>:
mov    $0x11,%edi
jmp    1030 <read_chan@plt>

LLVM IR (-O0):
define zeroext i16 @read_vref() {
%1 = call zeroext i16 @read_chan(i32 17)
ret i16 %1
}

LLVM IR (-O2):
define zeroext i16 @read_vref() {
%1 = tail call zeroext i16 @read_chan(i32 17)
ret i16 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int pixel_convert_8u_rgb_to_8u_bgr(int /*<<< orphan*/ *, int, int, int,
                                   int /*<<< orphan*/ const *, int);
int pixel_convert_8u_bgr_to_8u_rgb(uint8_t *dest, int dstride, int dwidth,
                                   int dheight, const uint8_t *src,
                                   int sstride) {
  return pixel_convert_8u_rgb_to_8u_bgr(dest, dstride, dwidth, dheight, src,
                                        sstride);
}


x86 assembly (clang, -O0):
<pixel_convert_8u_bgr_to_8u_rgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
call   1030 <pixel_convert_8u_rgb_to_8u_bgr@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_convert_8u_bgr_to_8u_rgb>:
jmp    1030 <pixel_convert_8u_rgb_to_8u_bgr@plt>

LLVM IR (-O0):
define i32 @pixel_convert_8u_bgr_to_8u_rgb(i32* %0, i32 %1, i32 %2, i32 %3, i32* %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32* %4, i32** %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32*, i32** %11
%18 = load i32, i32* %12
%19 = call i32 @pixel_convert_8u_rgb_to_8u_bgr(i32* %13, i32 %14, i32 %15, i32 %16, i32* %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @pixel_convert_8u_bgr_to_8u_rgb(i32* %0, i32 %1, i32 %2, i32 %3, i32* %4, i32 %5) {
%7 = tail call i32 @pixel_convert_8u_rgb_to_8u_bgr(i32* %0, i32 %1, i32 %2, i32 %3, i32* %4, i32 %5)
ret i32 %7
}