xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ re_compile(char *);
int /*<<< orphan*/ re_print(int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (argc == 2) {
    re_print(re_compile(argv[1]));
  } else {
    printf("\nUsage: %s <PATTERN> \n", argv[0]);
  }
  return -2;
}


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)
cmpl   $0x2,-0x8(%rbp)
jne    1169 <main+0x39>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <re_compile@plt>
mov    %eax,%edi
call   1050 <re_print@plt>
jmp    117c <main+0x4c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
mov    $0xfffffffe,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1148 <main+0x18>
mov    0x8(%rsi),%rdi
call   1030 <re_compile@plt>
mov    %eax,%edi
call   1050 <re_print@plt>
jmp    1157 <main+0x27>
mov    (%rsi),%rsi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    $0xfffffffe,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0AUsage: %s <PATTERN> \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 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @re_compile(i8* %11)
%13 = call i32 @re_print(i32 %12)
br label %19
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %14, %8
ret i32 -2
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0AUsage: %s <PATTERN> \0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @re_compile(i8* %6)
%8 = tail call i32 @re_print(i32 %7)
br label %12
9: ; preds = %2
%10 = load i8*, i8** %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %4
ret i32 -2
}
/* Variables and functions */
int arping_main(int, char **);
int main(int argc, char **argv) { return arping_main(argc, argv); }


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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <arping_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <arping_main@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @arping_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @arping_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_intro() {
  printf("Only support these functions:\n"
         "\ta- launch a qemu\n"
         "\tb- kill a qemu\n"
         "\tc- query qemu status\n"
         "\td- get vm cpu affinity\n"
         "Please follow the tips and type correct choice.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [160 x i8] c"Only support these functions:\0A\09a- launch a qemu\0A\09b- kill a qemu\0A\09c- query qemu status\0A\09d- get vm cpu affinity\0APlease follow the tips and type correct choice.\0A\0A\00"
define void @print_intro() {
%1 = call i32 @printf(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [159 x i8] c"Only support these functions:\0A\09a- launch a qemu\0A\09b- kill a qemu\0A\09c- query qemu status\0A\09d- get vm cpu affinity\0APlease follow the tips and type correct choice.\0A\00"
define void @print_intro() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([159 x i8], [159 x i8]* @str, i64 0, i64 0))
ret void
}
int cstring_at_white(const char *str) {
  int c = (unsigned char)*str;
  return (c <= 0x20) && (c > 0x00);
}


x86 assembly (clang, -O0):
<cstring_at_white>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jg     112b <cstring_at_white+0x2b>
cmpl   $0x0,-0xc(%rbp)
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstring_at_white>:
mov    (%rdi),%cl
add    $0xff,%cl
xor    %eax,%eax
cmp    $0x20,%cl
setb   %al
ret

LLVM IR (-O0):
define i32 @cstring_at_white(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 32
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br label %12
12: ; preds = %9, %1
%13 = phi i1 [ false, %1 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @cstring_at_white(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -1
%4 = icmp ult i8 %3, 32
%5 = zext i1 %4 to i32
ret i32 %5
}
void arch_disable_irq() {}


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

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

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

LLVM IR (-O2):
define void @arch_disable_irq() {
ret void
}
/* Variables and functions */
double d_rnd(double);
double da_rnd(int index, double maximum) { return d_rnd(maximum); }


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

x86 assembly (clang, -O2):
<da_rnd>:
jmp    1030 <d_rnd@plt>

LLVM IR (-O0):
define double @da_rnd(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = call double @d_rnd(double %5)
ret double %6
}

LLVM IR (-O2):
define double @da_rnd(i32 %0, double %1) {
%3 = tail call double @d_rnd(double %1)
ret double %3
}
long reverse(long n) {
  long result = 0;
  for (; n > 0; n /= 10) {
    result = result * 10 + n % 10;
  }
  return result;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1154 <reverse+0x54>
imul   $0xa,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    -0x18(%rbp),%rax
add    %rdx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    1110 <reverse+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
test   %rdi,%rdi
jle    114a <reverse+0x4a>
mov    %rdi,%rcx
xor    %eax,%eax
movabs $0xcccccccccccccccd,%r8
cc cc cc
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rax,%rax,4),%rsi
mov    %rcx,%rax
mul    %r8
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rcx,%rdi
sub    %rax,%rdi
lea    (%rdi,%rsi,2),%rax
cmp    $0x9,%rcx
mov    %rdx,%rcx
ja     1120 <reverse+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @reverse(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %13, %1
%5 = load i64, i64* %2
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i64, i64* %3
%9 = mul nsw i64 %8, 10
%10 = load i64, i64* %2
%11 = srem i64 %10, 10
%12 = add nsw i64 %9, %11
store i64 %12, i64* %3
br label %13
13: ; preds = %7
%14 = load i64, i64* %2
%15 = sdiv i64 %14, 10
store i64 %15, i64* %2
br label %4
16: ; preds = %4
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @reverse(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = phi i64 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i64 %4, 10
%7 = urem i64 %5, 10
%8 = add nsw i64 %6, %7
%9 = udiv i64 %5, 10
%10 = icmp ult i64 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i64 [ 0, %1 ], [ %8, %3 ]
ret i64 %12
}
/* Variables and functions */
int errno;
int syscall(int, int, int, int, int, int /*<<< orphan*/);
int setpriority(int which, unsigned who, int value) {
  int ret = syscall(64, which, (int)who, value, 1, 0);
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<setpriority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x40,%edi
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1164 <setpriority+0x54>
xor    %ecx,%ecx
sub    -0x14(%rbp),%ecx
mov    0x2e8a(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <setpriority+0x5a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setpriority>:
push   %rax
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x40,%edi
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
test   %eax,%eax
js     1130 <setpriority+0x20>
pop    %rcx
ret
neg    %eax
mov    0x2ea7(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @setpriority(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @syscall(i32 64, i32 %0, i32 %1, i32 %2, i32 1, i32 0)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = sub nsw i32 0, %4
store i32 %7, i32* @errno
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ -1, %6 ], [ %4, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char *, char *);
int check_ps_variable(char path[100]) {
  if ((strstr(path, "PS1")) != NULL)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<check_ps_variable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1142 <check_ps_variable+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <check_ps_variable+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_ps_variable>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"PS1\00"
define i32 @check_ps_variable(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32* @strstr(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"PS1\00"
define i32 @check_ps_variable(i8* %0) {
%2 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
void foo689() {}


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

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

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

LLVM IR (-O2):
define void @foo689() {
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int krecv(int, char *, int, int /*<<< orphan*/, struct timeval *);
int buf_readchar(int fd, char *ret, struct timeval *timeout) {
  int res;
  res = krecv(fd, ret, 1, 0, timeout);
  if (res <= 0)
    return res;
  return 1;
}


x86 assembly (clang, -O0):
<buf_readchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%r8
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <krecv@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jg     1152 <buf_readchar+0x42>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <buf_readchar+0x49>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_readchar>:
push   %rbx
mov    %rdx,%r8
mov    $0x1,%ebx
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <krecv@plt>
test   %eax,%eax
cmovg  %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @buf_readchar(i32 %0, i8* %1, %struct.timeval* %2) {
%4 = tail call i32 @krecv(i32 %0, i8* %1, i32 1, i32 0, %struct.timeval* %2)
%5 = icmp slt i32 %4, 1
%6 = select i1 %5, i32 %4, i32 1
ret i32 %6
}
void brm_sync(volatile unsigned int *gpio, int gpio_sync, int gpio_ack) {
  *(gpio + 1) = *(gpio + 1) | (1 << gpio_sync);
  while ((*gpio & (1 << gpio_ack)) == 0)
    ;
  *(gpio + 1) = (*(gpio + 1)) & ~(1 << gpio_sync);
}


x86 assembly (clang, -O0):
<brm_sync>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x14(%rbp),%ecx
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1150 <brm_sync+0x50>
jmp    112e <brm_sync+0x2e>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x18(%rbp),%ecx
xor    $0xffffffff,%eax
and    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<brm_sync>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %edx,%ecx
or     %eax,0x4(%rdi)
mov    $0x1,%edx
shl    %cl,%edx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rdi),%ecx
and    %edx,%ecx
je     1120 <brm_sync+0x20>
not    %eax
and    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @brm_sync(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load volatile i32, i32* %8
%10 = load i32, i32* %5
%11 = shl i32 1, %10
%12 = or i32 %9, %11
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 1
store volatile i32 %12, i32* %14
br label %15
15: ; preds = %22, %3
%16 = load i32*, i32** %4
%17 = load volatile i32, i32* %16
%18 = load i32, i32* %6
%19 = shl i32 1, %18
%20 = and i32 %17, %19
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %15
br label %15
23: ; preds = %15
%24 = load i32*, i32** %4
%25 = getelementptr inbounds i32, i32* %24, i64 1
%26 = load volatile i32, i32* %25
%27 = load i32, i32* %5
%28 = shl i32 1, %27
%29 = xor i32 %28, -1
%30 = and i32 %26, %29
%31 = load i32*, i32** %4
%32 = getelementptr inbounds i32, i32* %31, i64 1
store volatile i32 %30, i32* %32
ret void
}

LLVM IR (-O2):
define void @brm_sync(i32* %0, i32 %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load volatile i32, i32* %4
%6 = shl nuw i32 1, %1
%7 = or i32 %5, %6
store volatile i32 %7, i32* %4
%8 = shl nuw i32 1, %2
br label %9
9: ; preds = %9, %3
%10 = load volatile i32, i32* %0
%11 = and i32 %10, %8
%12 = icmp eq i32 %11, 0
br i1 %12, label %9, label %13
13: ; preds = %9
%14 = load volatile i32, i32* %4
%15 = xor i32 %6, -1
%16 = and i32 %14, %15
store volatile i32 %16, i32* %4
ret void
}
void debug(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @debug(i8* nocapture %0, ...) {
ret void
}
void copia(void) {
  int i;
  extern char linea[], linea_max[];
  i = 0;
  while (linea[i] != '\0') {
    linea_max[i] = linea[i];
    i++;
  }
  linea_max[i] = linea[i];
}


x86 assembly (clang, -O0):
<copia>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    0x2eda(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114d <copia+0x4d>
movslq -0x4(%rbp),%rcx
mov    0x2ec2(%rip),%rax
mov    (%rax,%rcx,1),%dl
movslq -0x4(%rbp),%rcx
mov    0x2e9c(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <copia+0xb>
movslq -0x4(%rbp),%rcx
mov    0x2e98(%rip),%rax
mov    (%rax,%rcx,1),%dl
movslq -0x4(%rbp),%rcx
mov    0x2e72(%rip),%rax
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copia>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%cl
test   %cl,%cl
je     1134 <copia+0x34>
xor    %edx,%edx
mov    0x2ec2(%rip),%rsi
cs nopw 0x0(%rax,%rax,1)
mov    %cl,(%rsi,%rdx,1)
movzbl 0x1(%rax,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1120 <copia+0x20>
mov    %edx,%eax
jmp    1136 <copia+0x36>
xor    %eax,%eax
mov    0x2e9b(%rip),%rcx
movb   $0x0,(%rcx,%rax,1)
ret

LLVM IR (-O0):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %9, %0
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = load i32, i32* %1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = load i32, i32* %1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %15
store i8 %13, i8* %16
%17 = load i32, i32* %1
%18 = add nsw i32 %17, 1
store i32 %18, i32* %1
br label %2
19: ; preds = %2
%20 = load i32, i32* %1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = load i32, i32* %1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %25
store i8 %23, i8* %26
ret void
}

LLVM IR (-O2):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
%1 = load i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %13, label %3
3: ; preds = %0, %3
%4 = phi i64 [ %7, %3 ], [ 0, %0 ]
%5 = phi i8 [ %9, %3 ], [ %1, %0 ]
%6 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %4
store i8 %5, i8* %6
%7 = add nuw nsw i64 %4, 1
%8 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = and i64 %7, 4294967295
br label %13
13: ; preds = %11, %0
%14 = phi i64 [ 0, %0 ], [ %12, %11 ]
%15 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %14
store i8 0, i8* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atanl(long double);
long double sinl(int /*<<< orphan*/);
long double __attribute__((no, optimize("Ofast"))) sinatanl(long double x) {
  return sinl(atanl(x));
}


x86 assembly (clang, -O0):
<sinatanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <atanl@plt>
mov    %eax,%edi
call   1030 <sinl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinatanl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1040 <atanl@plt>
mov    %eax,%edi
add    $0x18,%rsp
jmp    1030 <sinl@plt>

LLVM IR (-O0):
define x86_fp80 @sinatanl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i32 @atanl(x86_fp80 %3)
%5 = call x86_fp80 @sinl(i32 %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @sinatanl(x86_fp80 %0) {
%2 = tail call i32 @atanl(x86_fp80 %0)
%3 = tail call x86_fp80 @sinl(i32 %2)
ret x86_fp80 %3
}
/* Variables and functions */
bool isPrimeNormal(int nr) {
  for (int i = 2; i * i < nr + 1; i++) {
    if (nr % i == 0)
      return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<isPrimeNormal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1152 <isPrimeNormal+0x52>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    113f <isPrimeNormal+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1159 <isPrimeNormal+0x59>
jmp    1144 <isPrimeNormal+0x44>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isPrimeNormal+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrimeNormal>:
mov    $0x1,%eax
cmp    $0x4,%edi
jl     112c <isPrimeNormal+0x2c>
mov    $0x2,%ecx
nop
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1125 <isPrimeNormal+0x25>
add    $0x1,%ecx
mov    %ecx,%eax
imul   %ecx,%eax
cmp    %edi,%eax
jle    1110 <isPrimeNormal+0x10>
xor    %eax,%eax
test   %edx,%edx
setne  %al
ret

LLVM IR (-O0):
define i32 @isPrimeNormal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 2, i32* %4
br label %5
5: ; preds = %19, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %22
12: ; preds = %5
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = srem i32 %13, %14
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 0, i32* %2
br label %23
18: ; preds = %12
br label %19
19: ; preds = %18
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %5
22: ; preds = %5
store i32 1, i32* %2
br label %23
23: ; preds = %22, %17
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @isPrimeNormal(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 2, %1 ]
%5 = srem i32 %0, %4
%6 = icmp eq i32 %5, 0
%7 = add nuw nsw i32 %4, 1
%8 = mul nsw i32 %7, %7
%9 = icmp sgt i32 %8, %0
%10 = select i1 %6, i1 true, i1 %9
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = xor i1 %6, true
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %11, %1
%15 = phi i32 [ 1, %1 ], [ %13, %11 ]
ret i32 %15
}
double clear_traces_d(double a, double b, double c, double d, double e,
                      double f, double g, double h, double i, double j,
                      double k, double l, double m, double n, double o,
                      double p) {
  return 0.0;
}


x86 assembly (clang, -O0):
<clear_traces_d>:
push   %rbp
mov    %rsp,%rbp
movsd  0x48(%rbp),%xmm8
movsd  0x40(%rbp),%xmm8
movsd  0x38(%rbp),%xmm8
movsd  0x30(%rbp),%xmm8
movsd  0x28(%rbp),%xmm8
movsd  0x20(%rbp),%xmm8
movsd  0x18(%rbp),%xmm8
movsd  0x10(%rbp),%xmm8
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_traces_d>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @clear_traces_d(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, double %11, double %12, double %13, double %14, double %15) {
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
store double %0, double* %17
store double %1, double* %18
store double %2, double* %19
store double %3, double* %20
store double %4, double* %21
store double %5, double* %22
store double %6, double* %23
store double %7, double* %24
store double %8, double* %25
store double %9, double* %26
store double %10, double* %27
store double %11, double* %28
store double %12, double* %29
store double %13, double* %30
store double %14, double* %31
store double %15, double* %32
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @clear_traces_d(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, double %11, double %12, double %13, double %14, double %15) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char mystring[255];
  scanf("%s", mystring);
  printf("%s\n", mystring);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
int check_longlong() { return sizeof(long long); }


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

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

LLVM IR (-O0):
define i32 @check_longlong() {
ret i32 8
}

LLVM IR (-O2):
define i32 @check_longlong() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ f_name(int, ...);
main() {
  f_name((void *)0, (int *)5);
  int integer = 2;
  f_name(integer, 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0x5,%esi
mov    $0x0,%al
call   1030 <f_name@plt>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
mov    $0x0,%al
call   1030 <f_name@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i32, ...) @f_name(i32 0, i32* inttoptr (i64 5 to i32*))
store i32 2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 (i32, ...) @f_name(i32 %3, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) @f_name(i32 0, i32* inttoptr (i64 5 to i32*))
%2 = tail call i32 (i32, ...) @f_name(i32 2, i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ raid_sse_begin();
__attribute__((always_)) void raid_avx_begin(void) { raid_sse_begin(); }


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

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

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

LLVM IR (-O2):
define void @raid_avx_begin() {
%1 = tail call i32 (...) @raid_sse_begin()
ret void
}
int contains(char *w1, char *w2) {
  int i;
  for (i = 1; w2[i] != '\0'; i++) {
    if (w1[i] != w2[i])
      return -1;
  }
  return i;
}


x86 assembly (clang, -O0):
<contains>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1167 <contains+0x67>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1154 <contains+0x54>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <contains+0x6d>
jmp    1159 <contains+0x59>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <contains+0x13>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains>:
mov    0x1(%rsi),%cl
test   %cl,%cl
je     1123 <contains+0x23>
mov    $0x1,%eax
nopl   0x0(%rax)
cmp    %cl,(%rdi,%rax,1)
jne    1129 <contains+0x29>
movzbl 0x1(%rsi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <contains+0x10>
ret
mov    $0x1,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @contains(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 1, i32* %6
br label %7
7: ; preds = %31, %2
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %34
15: ; preds = %7
%16 = load i8*, i8** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8*, i8** %5
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %21, %27
br i1 %28, label %29, label %30
29: ; preds = %15
store i32 -1, i32* %3
br label %36
30: ; preds = %15
br label %31
31: ; preds = %30
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %7
34: ; preds = %7
%35 = load i32, i32* %6
store i32 %35, i32* %3
br label %36
36: ; preds = %34, %29
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
define i32 @contains(i8* nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %19, label %6
6: ; preds = %2, %12
%7 = phi i64 [ %13, %12 ], [ 1, %2 ]
%8 = phi i8 [ %15, %12 ], [ %4, %2 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %8
br i1 %11, label %12, label %19
12: ; preds = %6
%13 = add nuw i64 %7, 1
%14 = getelementptr inbounds i8, i8* %1, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %12
%18 = trunc i64 %13 to i32
br label %19
19: ; preds = %6, %17, %2
%20 = phi i32 [ 1, %2 ], [ %18, %17 ], [ -1, %6 ]
ret i32 %20
}
/* Variables and functions */
int access(char const *, int);
int outside_access(const char *pathname, int mode) {
  return access(pathname, mode);
}


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

x86 assembly (clang, -O2):
<outside_access>:
jmp    1030 <access@plt>

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

LLVM IR (-O2):
define i32 @outside_access(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @access(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, ...);
void Move_Ret_To_Foreign_L(int index) {
  Inst_Printf("lda", "$1,pl_foreign_long");
  Inst_Printf("stq", "$0,%d($1)", index * 8);
}


x86 assembly (clang, -O0):
<Move_Ret_To_Foreign_L>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
mov    -0x4(%rbp),%edx
shl    $0x3,%edx
lea    0xeda(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Move_Ret_To_Foreign_L>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
lea    0xee3(%rip),%rsi
xor    %eax,%eax
call   1030 <Inst_Printf@plt>
shl    $0x3,%ebx
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"lda\00"
@.str.1 = [19 x i8] c"$1,pl_foreign_long\00"
@.str.2 = [4 x i8] c"stq\00"
@.str.3 = [10 x i8] c"$0,%d($1)\00"
define void @Move_Ret_To_Foreign_L(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 8
%6 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"lda\00"
@.str.1 = [19 x i8] c"$1,pl_foreign_long\00"
@.str.2 = [4 x i8] c"stq\00"
@.str.3 = [10 x i8] c"$0,%d($1)\00"
define void @Move_Ret_To_Foreign_L(i32 %0) {
%2 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%3 = shl nsw i32 %0, 3
%4 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret void
}
double part_VaryIntegral(x1, r1, x2, r2, rmin, rmax)
double x1, r1, x2, r2, rmin, rmax;
{
  double VolumeIntegral(), VPintegrand();
  return VolumeIntegral(VPintegrand, rmin, rmax, 0.0, 0.0, 0.0, x1, r1, x2, r2,
                        1);
}


x86 assembly (clang, -O0):
<part_VaryIntegral>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm5
movsd  -0x10(%rbp),%xmm6
movsd  -0x18(%rbp),%xmm7
movsd  -0x20(%rbp),%xmm8
mov    0x2e84(%rip),%rdi
xorps  %xmm4,%xmm4
mov    $0x1,%esi
movaps %xmm4,%xmm2
movaps %xmm4,%xmm3
movsd  %xmm8,(%rsp)
mov    $0x8,%al
call   1030 <VolumeIntegral@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<part_VaryIntegral>:
push   %rax
movaps %xmm5,%xmm8
movaps %xmm4,%xmm9
movaps %xmm2,%xmm7
movaps %xmm1,%xmm6
movaps %xmm0,%xmm5
movsd  %xmm3,(%rsp)
mov    0x2eb2(%rip),%rdi
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
xorps  %xmm4,%xmm4
movaps %xmm9,%xmm0
movaps %xmm8,%xmm1
mov    $0x1,%esi
mov    $0x8,%al
call   1030 <VolumeIntegral@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @part_VaryIntegral(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %11
%14 = load double, double* %12
%15 = load double, double* %7
%16 = load double, double* %8
%17 = load double, double* %9
%18 = load double, double* %10
%19 = call double (double (...)*, double, double, double, double, double, double, double, double, double, i32, ...) bitcast (double (...)* @VolumeIntegral to double (double (...)*, double, double, double, double, double, double, double, double, double, i32, ...)*)(double (...)* @VPintegrand, double %13, double %14, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double %15, double %16, double %17, double %18, i32 1)
ret double %19
}

LLVM IR (-O2):
define double @part_VaryIntegral(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call double (double (...)*, double, double, double, double, double, double, double, double, double, i32, ...) bitcast (double (...)* @VolumeIntegral to double (double (...)*, double, double, double, double, double, double, double, double, double, i32, ...)*)(double (...)* @VPintegrand, double %4, double %5, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double %0, double %1, double %2, double %3, i32 1)
ret double %7
}
/* Type definitions */
struct cstate {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ addrange(struct cstate *, int /*<<< orphan*/, char);
void addranges_d(struct cstate *g) { addrange(g, '0', '9'); }


x86 assembly (clang, -O0):
<addranges_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x30,%esi
mov    $0x39,%edx
call   1030 <addrange@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addranges_d>:
mov    $0x30,%esi
mov    $0x39,%edx
jmp    1030 <addrange@plt>

LLVM IR (-O0):
%struct.cstate = type { i32 }
define void @addranges_d(%struct.cstate* %0) {
%2 = alloca %struct.cstate*
store %struct.cstate* %0, %struct.cstate** %2
%3 = load %struct.cstate*, %struct.cstate** %2
%4 = call i32 @addrange(%struct.cstate* %3, i32 48, i8 signext 57)
ret void
}

LLVM IR (-O2):
%struct.cstate = type { i32 }
define void @addranges_d(%struct.cstate* %0) {
%2 = tail call i32 @addrange(%struct.cstate* %0, i32 48, i8 signext 57)
ret void
}
void gtk_settings_set_string_property() {}


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

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

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

LLVM IR (-O2):
define void @gtk_settings_set_string_property() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printHelp() { printf("Run as ./program <threadsCount> <passThroughs>\n"); }


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"Run as ./program <threadsCount> <passThroughs>\0A\00"
define void @printHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [47 x i8] c"Run as ./program <threadsCount> <passThroughs>\00"
define void @printHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret void
}
int cmd_reset(char *arg_list[], int n) {
  sw_printf("\nstart run %s...\n\n\r", __func__);
  return 0;
}


x86 assembly (clang, -O0):
<cmd_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
lea    0xee7(%rip),%rsi
mov    $0x0,%al
call   1030 <sw_printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"\0Astart run %s...\0A\0A\0D\00"
@__func__.cmd_reset = [10 x i8] c"cmd_reset\00"
define i32 @cmd_reset(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @sw_printf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.cmd_reset, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0Astart run %s...\0A\0A\0D\00"
@__func__.cmd_reset = [10 x i8] c"cmd_reset\00"
define i32 @cmd_reset(i8** nocapture readnone %0, i32 %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @sw_printf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.cmd_reset, i64 0, i64 0))
ret i32 0
}
void PF_checkpos() {}


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

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

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

LLVM IR (-O2):
define void @PF_checkpos() {
ret void
}
void audiohw_postinit(void) {
  (*(volatile unsigned short *)(0x38)) = (0x01),
                             (*(volatile unsigned short *)(0x39)) |= 1;
}


x86 assembly (clang, -O0):
<audiohw_postinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x38,%eax
movw   $0x1,(%rax)
mov    $0x39,%eax
mov    (%rax),%ax
movzwl %ax,%eax
or     $0x1,%eax
mov    %ax,%cx
mov    $0x39,%eax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<audiohw_postinit>:
movw   $0x1,0x38
orw    $0x1,0x39
ret

LLVM IR (-O0):
define void @audiohw_postinit() {
store volatile i16 1, i16* inttoptr (i64 56 to i16*)
%1 = load volatile i16, i16* inttoptr (i64 57 to i16*)
%2 = zext i16 %1 to i32
%3 = or i32 %2, 1
%4 = trunc i32 %3 to i16
store volatile i16 %4, i16* inttoptr (i64 57 to i16*)
ret void
}

LLVM IR (-O2):
define void @audiohw_postinit() {
store volatile i16 1, i16* inttoptr (i64 56 to i16*)
%1 = load volatile i16, i16* inttoptr (i64 57 to i16*)
%2 = or i16 %1, 1
store volatile i16 %2, i16* inttoptr (i64 57 to i16*)
ret void
}
/* Variables and functions */
int pow(int, double);
float henyey_greenstein_phase_func(float mu) {
  const float g = 0.76;
  return (1. - g * g) /
         ((4. + 3.14159265359) * pow(1. + g * g - 2. * g * mu, 1.5));
}


x86 assembly (clang, -O0):
<henyey_greenstein_phase_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xf03(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed9(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xeb9(%rip),%xmm0
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  0xea0(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe8c(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<henyey_greenstein_phase_func>:
push   %rax
cvtss2sd %xmm0,%xmm0
mulsd  0xee3(%rip),%xmm0
addsd  0xee3(%rip),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xedf(%rip),%xmm0
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xed3(%rip),%xmm0
movsd  0xed3(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @henyey_greenstein_phase_func(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0x3FE851EB80000000, float* %3
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = call double @llvm.fmuladd.f64(double 0xBFF851EB80000000, double %5, double 0x3FF93DD980000000)
%7 = fptosi double %6 to i32
%8 = call i32 @pow(i32 %7, double 1.500000e+00)
%9 = sitofp i32 %8 to double
%10 = fmul double 0x401C90FDAA221775, %9
%11 = fdiv double 0x3FDB089A00000000, %10
%12 = fptrunc double %11 to float
ret float %12
}

LLVM IR (-O2):
define float @henyey_greenstein_phase_func(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0xBFF851EB80000000, double 0x3FF93DD980000000)
%4 = fptosi double %3 to i32
%5 = tail call i32 @pow(i32 %4, double 1.500000e+00)
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 0x401C90FDAA221775
%8 = fdiv double 0x3FDB089A00000000, %7
%9 = fptrunc double %8 to float
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ chown(char const *, int, int);
int /*<<< orphan*/ rename(char const *, char const *);
void main() {
  const char *filename_from = "/tmp/query_php.txt";
  const char *filename_to = "/tmp/query.txt";
  chown(filename_from, 1000, 1000);
  rename(filename_from, filename_to);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xed9(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3e8,%edx
mov    %edx,%esi
call   1030 <chown@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <rename@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
mov    $0x3e8,%edx
call   1030 <chown@plt>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <rename@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"/tmp/query_php.txt\00"
@.str.1 = [15 x i8] c"/tmp/query.txt\00"
define void @main() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = call i32 @chown(i8* %3, i32 1000, i32 1000)
%5 = load i8*, i8** %1
%6 = load i8*, i8** %2
%7 = call i32 @rename(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"/tmp/query_php.txt\00"
@.str.1 = [15 x i8] c"/tmp/query.txt\00"
define void @main() {
%1 = tail call i32 @chown(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1000, i32 1000)
%2 = tail call i32 @rename(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}