xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t SIZE_MAX;
int /*<<< orphan*/ assert(int);
size_t align_up_to(size_t x, size_t n) {
  assert(SIZE_MAX - x > n);
  size_t a = x + (n - 1);
  return (a - (a % n));
}


x86 assembly (clang, -O0):
<align_up_to>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%rax
sub    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    -0x20(%rbp),%rax
sub    %rdx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_up_to>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2eb7(%rip),%rax
mov    (%rax),%rax
sub    %rdi,%rax
xor    %edi,%edi
cmp    %rsi,%rax
seta   %dil
call   1030 <assert@plt>
lea    (%r14,%rbx,1),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,%rax
or     %rbx,%rax
shr    $0x20,%rax
je     1153 <align_up_to+0x43>
mov    %rcx,%rax
xor    %edx,%edx
div    %rbx
jmp    1159 <align_up_to+0x49>
mov    %ecx,%eax
xor    %edx,%edx
div    %ebx
sub    %rdx,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIZE_MAX = global i64 0
define i64 @align_up_to(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* @SIZE_MAX
%7 = load i64, i64* %3
%8 = sub i64 %6, %7
%9 = load i64, i64* %4
%10 = icmp ugt i64 %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = sub i64 %14, 1
%16 = add i64 %13, %15
store i64 %16, i64* %5
%17 = load i64, i64* %5
%18 = load i64, i64* %5
%19 = load i64, i64* %4
%20 = urem i64 %18, %19
%21 = sub i64 %17, %20
ret i64 %21
}

LLVM IR (-O2):
@SIZE_MAX = global i64 0
define i64 @align_up_to(i64 %0, i64 %1) {
%3 = load i64, i64* @SIZE_MAX
%4 = sub i64 %3, %0
%5 = icmp ugt i64 %4, %1
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = add i64 %0, -1
%9 = add i64 %8, %1
%10 = urem i64 %9, %1
%11 = sub i64 %9, %10
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_long_prod_to_all(long *target, long *source, int nreduce,
                                   int PE_start, int logPE_stride, int PE_size,
                                   long *pWrk, long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_long_prod_to_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_long_prod_to_all(i64* %0, i64* %1, i32 %2, i32 %3, i32 %4, i32 %5, i64* %6, i64* %7) {
%9 = alloca i64*
%10 = alloca i64*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i64*
%16 = alloca i64*
store i64* %0, i64** %9
store i64* %1, i64** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i64* %6, i64** %15
store i64* %7, i64** %16
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_long_prod_to_all(i64* nocapture readnone %0, i64* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, i64* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
scalar_t__ sigprocmask(int, int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ unix_error(char *);
void Sigprocmask(int how, const sigset_t *set, sigset_t *oldset) {
  if (sigprocmask(how, set, oldset) < 0)
    unix_error("Sigprocmask error");
  return;
}


x86 assembly (clang, -O0):
<Sigprocmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <sigprocmask@plt>
cmp    $0x0,%rax
jge    1159 <Sigprocmask+0x39>
lea    0xeac(%rip),%rdi
call   1040 <unix_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sigprocmask>:
push   %rax
call   1030 <sigprocmask@plt>
test   %rax,%rax
js     112d <Sigprocmask+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <unix_error@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Sigprocmask error\00"
define void @Sigprocmask(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 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = call i64 @sigprocmask(i32 %7, i32* %8, i32* %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @unix_error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Sigprocmask error\00"
define void @Sigprocmask(i32 %0, i32* %1, i32* %2) {
%4 = tail call i64 @sigprocmask(i32 %0, i32* %1, i32* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @unix_error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sleep(int);
void wbt_msleep(int ms) { Sleep(ms); }


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

x86 assembly (clang, -O2):
<wbt_msleep>:
jmp    1030 <Sleep@plt>

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

LLVM IR (-O2):
define void @wbt_msleep(i32 %0) {
%2 = tail call i32 @Sleep(i32 %0)
ret void
}
/* Variables and functions */
long sum_list(long *, int);
long average_list(long *list, int count) {
  long total = sum_list(list, count);
  return total / count;
}


x86 assembly (clang, -O0):
<average_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <sum_list@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
cqto
idiv   %rcx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<average_list>:
push   %rbx
mov    %esi,%ebx
call   1030 <sum_list@plt>
movslq %ebx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     112e <average_list+0x1e>
cqto
idiv   %rcx
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
pop    %rbx
ret

LLVM IR (-O0):
define i64 @average_list(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i64
store i64* %0, i64** %3
store i32 %1, i32* %4
%6 = load i64*, i64** %3
%7 = load i32, i32* %4
%8 = call i64 @sum_list(i64* %6, i32 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = sdiv i64 %9, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @average_list(i64* %0, i32 %1) {
%3 = tail call i64 @sum_list(i64* %0, i32 %1)
%4 = sext i32 %1 to i64
%5 = sdiv i64 %3, %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
int closefd(int, int);
int /*<<< orphan*/ errno;
int NET_Dup2(int fd, int fd2) {
  if (fd < 0) {
    errno = EBADF;
    return -1;
  }
  return closefd(fd, fd2);
}


x86 assembly (clang, -O0):
<NET_Dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1146 <NET_Dup2+0x36>
mov    0x2ea9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea8(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <NET_Dup2+0x44>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <closefd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NET_Dup2>:
test   %edi,%edi
js     1119 <NET_Dup2+0x9>
jmp    1030 <closefd@plt>
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    0x2eb7(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EBADF = global i32 0
@errno = global i32 0
define i32 @NET_Dup2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* @EBADF
store i32 %9, i32* @errno
store i32 -1, i32* %3
br label %14
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call i32 @closefd(i32 %11, i32 %12)
store i32 %13, i32* %3
br label %14
14: ; preds = %10, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@EBADF = global i32 0
@errno = global i32 0
define i32 @NET_Dup2(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load i32, i32* @EBADF
store i32 %5, i32* @errno
br label %8
6: ; preds = %2
%7 = tail call i32 @closefd(i32 %0, i32 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ -1, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ cBreak();
int /*<<< orphan*/ dash();
int /*<<< orphan*/ dot();
void sR() {
  dot();
  dash();
  dot();
  cBreak();
}


x86 assembly (clang, -O0):
<sR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1050 <cBreak@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sR>:
push   %rax
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cBreak@plt>

LLVM IR (-O0):
define void @sR() {
%1 = call i32 (...) @dot()
%2 = call i32 (...) @dash()
%3 = call i32 (...) @dot()
%4 = call i32 (...) @cBreak()
ret void
}

LLVM IR (-O2):
define void @sR() {
%1 = tail call i32 (...) @dot()
%2 = tail call i32 (...) @dash()
%3 = tail call i32 (...) @dot()
%4 = tail call i32 (...) @cBreak()
ret void
}
void foo_1_2_1_2_2_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_2_2_2_2_2() {
ret void
}
/* Variables and functions */
int PATH_MAX;
int strlen(char *);
scalar_t__ xsnprintf(char *, int, char *, char *, char);
void path_add(char *path, char *new) {
  int len;
  len = strlen(path);
  len += xsnprintf(path + len, (PATH_MAX * 10) - len, "%s%c", new, ';');
}


x86 assembly (clang, -O0):
<path_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
mov    0x2ea2(%rip),%rax
imul   $0xa,(%rax),%esi
sub    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rcx
lea    0xea1(%rip),%rdx
mov    $0x3b,%r8d
call   1040 <xsnprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rax,%rbx
mov    0x2eb5(%rip),%rcx
mov    (%rcx),%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%esi
sub    %eax,%esi
lea    0xeb5(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rcx
mov    $0x3b,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <xsnprintf@plt>

LLVM IR (-O0):
@PATH_MAX = global i32 0
@.str = [5 x i8] c"%s%c\00"
define void @path_add(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i32, i32* @PATH_MAX
%13 = mul nsw i32 %12, 10
%14 = load i32, i32* %5
%15 = sub nsw i32 %13, %14
%16 = load i8*, i8** %4
%17 = call i64 @xsnprintf(i8* %11, i32 %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %16, i8 signext 59)
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = add nsw i64 %19, %17
%21 = trunc i64 %20 to i32
store i32 %21, i32* %5
ret void
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@.str = [5 x i8] c"%s%c\00"
define void @path_add(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i32, i32* @PATH_MAX
%7 = mul nsw i32 %6, 10
%8 = sub nsw i32 %7, %3
%9 = tail call i64 @xsnprintf(i8* %5, i32 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1, i8 signext 59)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ modify(int *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int len = 0;
  modify(&len);
  printf("%d\n", len);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <modify@plt>
mov    0x4(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @modify(i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _gcd(int /*<<< orphan*/, int /*<<< orphan*/);
uint32_t gcd(uint32_t *triangle) {
  return _gcd(triangle[0], _gcd(triangle[1], triangle[2]));
}


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

x86 assembly (clang, -O2):
<gcd>:
push   %rbx
mov    (%rdi),%ebx
mov    0x4(%rdi),%eax
mov    0x8(%rdi),%esi
mov    %eax,%edi
call   1030 <_gcd@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <_gcd@plt>

LLVM IR (-O0):
define i32 @gcd(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = call i32 @_gcd(i32 %8, i32 %11)
%13 = call i32 @_gcd(i32 %5, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @gcd(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = tail call i32 @_gcd(i32 %4, i32 %6)
%8 = tail call i32 @_gcd(i32 %2, i32 %7)
ret i32 %8
}
void copy_line(char *dest, char *source) {
  char *d = dest;
  char *s = source;
  while (*source) {
    if (*source == '\n' || *source == '\r')
      break;
    *dest++ = *source++;
  }
  *dest = '\0';
}


x86 assembly (clang, -O0):
<copy_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1175 <copy_line+0x75>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1149 <copy_line+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    114e <copy_line+0x4e>
jmp    1175 <copy_line+0x75>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    111c <copy_line+0x1c>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_line>:
xor    %eax,%eax
mov    $0x2401,%ecx
jmp    1117 <copy_line+0x17>
nopl   0x0(%rax)
mov    %dl,(%rdi,%rax,1)
add    $0x1,%rax
movzbl (%rsi,%rax,1),%edx
cmp    $0xd,%rdx
ja     1110 <copy_line+0x10>
bt     %rdx,%rcx
jae    1110 <copy_line+0x10>
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @copy_line(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %8, %7 ]
%5 = phi i8* [ %0, %2 ], [ %9, %7 ]
%6 = load i8, i8* %4
switch i8 %6, label %7 [
i8 0, label %10
i8 10, label %10
i8 13, label %10
]
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %6, i8* %5
br label %3
10: ; preds = %3, %3, %3
store i8 0, i8* %5
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR56_get(void) { return U_WMRCORENONE_get("U_WMR56"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR56\00"
define i32 @U_WMR56_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR56\00"
define i32 @U_WMR56_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int main() {
  signed char x;
  typedef signed char __int8_t;
  __int8_t y;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MPI_Finalize();
int /*<<< orphan*/ exit(int);
void prs_exit(int numb) {
  MPI_Finalize();
  exit(numb);
}


x86 assembly (clang, -O0):
<prs_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <MPI_Finalize@plt>
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<prs_exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <MPI_Finalize@plt>
mov    %ebx,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @prs_exit(i32 %0) {
%2 = tail call i32 (...) @MPI_Finalize()
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(void) {
  int x0 = (-0x7fffffff - 1);
  long x1 = 0L;
  int x2 = 0;
  int t = (0 || ((-0x7fffffff - 1) - (int)(x0 - x1)));
  if (t != 0) {
    x2 = t;
    abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x80000000,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x80000000,%eax
sub    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     116b <main+0x5b>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned xrop3_60_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = T ^ S;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_60_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_60_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
xor    %esi,%eax
not    %eax
and    %ecx,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_60_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
store i32 %20, i32* %7
%21 = load i32, i32* %7
%22 = load i32, i32* %6
%23 = xor i32 %21, %22
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = load i32, i32* %6
%26 = and i32 %24, %25
%27 = load i32, i32* %8
%28 = load i32, i32* %7
%29 = xor i32 %28, -1
%30 = and i32 %27, %29
%31 = or i32 %26, %30
%32 = load i32, i32* %7
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %5
%37 = and i32 %35, %36
%38 = or i32 %31, %37
ret i32 %38
}

LLVM IR (-O2):
define i32 @xrop3_60_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, -1
%8 = and i32 %4, %7
%9 = xor i32 %4, -1
%10 = and i32 %9, %5
%11 = or i32 %8, %10
ret i32 %11
}
/* Variables and functions */
int api0(int);
int fork(void) { return api0(2); }


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <api0@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
mov    $0x2,%edi
jmp    1030 <api0@plt>

LLVM IR (-O0):
define i32 @fork() {
%1 = call i32 @api0(i32 2)
ret i32 %1
}

LLVM IR (-O2):
define i32 @fork() {
%1 = tail call i32 @api0(i32 2)
ret i32 %1
}
float sqr(double x) { return x * x; }


x86 assembly (clang, -O0):
<sqr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqr>:
mulsd  %xmm0,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define float @sqr(double %0) {
%2 = fmul double %0, %0
%3 = fptrunc double %2 to float
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_socket_setnonblock_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_socket@%p::setnonblock (rtpp_socket_setnonblock) is "
          "invoked after destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_socket_setnonblock_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_socket_setnonblock_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [91 x i8] c"Method rtpp_socket@%p::setnonblock (rtpp_socket_setnonblock) is invoked after destruction\0A\00"
define void @rtpp_socket_setnonblock_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [91 x i8] c"Method rtpp_socket@%p::setnonblock (rtpp_socket_setnonblock) is invoked after destruction\0A\00"
define void @rtpp_socket_setnonblock_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int exists(const char *path) {
  struct stat buf;
  return (stat(path, &buf) == 0);
}


x86 assembly (clang, -O0):
<exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
double hf(double, int);
double chb(double v) { return hf(v, 4); }


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

x86 assembly (clang, -O2):
<chb>:
mov    $0x4,%edi
jmp    1030 <hf@plt>

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

LLVM IR (-O2):
define double @chb(double %0) {
%2 = tail call double @hf(double %0, i32 4)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int a;
  float b;
  double c;
  scanf("%d", &a);
  scanf("%f", &b);
  scanf("%lf", &c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <scanf@plt>
lea    0xecb(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1030 <scanf@plt>
lea    0xebc(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <scanf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1030 <scanf@plt>
lea    0xed5(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <scanf@plt>
lea    0xec5(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1030 <scanf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca double
%4 = bitcast i32* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %3)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ CLOCKS_PER_SEC;
scalar_t__ clock();
double time_getCPUSeconds(void) {
  clock_t cpuclock = clock();
  return (((double)(cpuclock)) / ((double)CLOCKS_PER_SEC));
}


x86 assembly (clang, -O0):
<time_getCPUSeconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
mov    0x2eb8(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_getCPUSeconds>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i64 0
define double @time_getCPUSeconds() {
%1 = alloca i64
%2 = call i64 (...) @clock()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = sitofp i64 %3 to double
%5 = load i64, i64* @CLOCKS_PER_SEC
%6 = sitofp i64 %5 to double
%7 = fdiv double %4, %6
ret double %7
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i64 0
define double @time_getCPUSeconds() {
%1 = tail call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @CLOCKS_PER_SEC
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
void get_cpuid(unsigned leaf, unsigned *regs) {
  __asm__ __volatile__("cpuid"
                       : "=a"(regs[0]), "=b"(regs[1]), "=c"(regs[2]),
                         "=d"(regs[3])
                       : "a"(leaf));
}


x86 assembly (clang, -O0):
<get_cpuid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%r8
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,%r9d
mov    -0x28(%rbp),%rax
mov    %ecx,%esi
mov    -0x20(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,0x4(%rdi)
mov    %esi,0x8(%rcx)
mov    %edx,0xc(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpuid>:
push   %rbx
mov    %edi,%eax
cpuid
mov    %eax,(%rsi)
mov    %ebx,0x4(%rsi)
mov    %ecx,0x8(%rsi)
mov    %edx,0xc(%rsi)
pop    %rbx
ret

LLVM IR (-O0):
define void @get_cpuid(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 3
%13 = load i32, i32* %3
%14 = call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %13)
%15 = extractvalue { i32, i32, i32, i32 } %14, 0
%16 = extractvalue { i32, i32, i32, i32 } %14, 1
%17 = extractvalue { i32, i32, i32, i32 } %14, 2
%18 = extractvalue { i32, i32, i32, i32 } %14, 3
store i32 %15, i32* %6
store i32 %16, i32* %8
store i32 %17, i32* %10
store i32 %18, i32* %12
ret void
}

LLVM IR (-O2):
define void @get_cpuid(i32 %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = getelementptr inbounds i32, i32* %1, i64 2
%5 = getelementptr inbounds i32, i32* %1, i64 3
%6 = tail call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %1
store i32 %8, i32* %3
store i32 %9, i32* %4
store i32 %10, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pixel_avg_wxh(unsigned char *, int, unsigned char *, int,
                                 int, int);
void pixel_avg_4x2(unsigned char *pix1, int i_stride_pix1, unsigned char *pix2,
                   int i_stride_pix2) {
  pixel_avg_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 4, 2);
}


x86 assembly (clang, -O0):
<pixel_avg_4x2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x4,%r8d
mov    $0x2,%r9d
call   1030 <pixel_avg_wxh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_4x2>:
mov    $0x4,%r8d
mov    $0x2,%r9d
jmp    1030 <pixel_avg_wxh@plt>

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

LLVM IR (-O2):
define void @pixel_avg_4x2(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @pixel_avg_wxh(i8* %0, i32 %1, i8* %2, i32 %3, i32 4, i32 2)
ret void
}
int rand_r(unsigned int *seedp) {
  unsigned int s;
  s = (*seedp) * 65521;
  *seedp = s;
  return (s >> 16);
}


x86 assembly (clang, -O0):
<rand_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xfff1,(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_r>:
imul   $0xfff1,(%rdi),%eax
mov    %eax,(%rdi)
shr    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @rand_r(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = mul i32 %5, 65521
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32*, i32** %2
store i32 %7, i32* %8
%9 = load i32, i32* %3
%10 = lshr i32 %9, 16
ret i32 %10
}

LLVM IR (-O2):
define i32 @rand_r(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul i32 %2, 65521
store i32 %3, i32* %0
%4 = lshr i32 %3, 16
ret i32 %4
}
/* Variables and functions */
int MPI_Add_error_code(int, int *);
int MPI_Add_error_string(int, char *);
int PyMPI_MPICH2_MPI_Add_error_code(int errorclass, int *errorcode) {
  int ierr;
  char errstr[1] = {0};
  ierr = MPI_Add_error_code(errorclass, errorcode);
  if (ierr)
    return ierr;
  return MPI_Add_error_string(*errorcode, errstr);
}


x86 assembly (clang, -O0):
<PyMPI_MPICH2_MPI_Add_error_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x15(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <MPI_Add_error_code@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1173 <PyMPI_MPICH2_MPI_Add_error_code+0x43>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <PyMPI_MPICH2_MPI_Add_error_code+0x55>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
lea    -0x15(%rbp),%rsi
call   1050 <MPI_Add_error_string@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PyMPI_MPICH2_MPI_Add_error_code>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movb   $0x0,0xf(%rsp)
call   1030 <MPI_Add_error_code@plt>
test   %eax,%eax
jne    1142 <PyMPI_MPICH2_MPI_Add_error_code+0x22>
mov    (%rbx),%edi
lea    0xf(%rsp),%rsi
call   1040 <MPI_Add_error_string@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @PyMPI_MPICH2_MPI_Add_error_code(i32 %0, i32* %1) {
%3 = alloca [1 x i8]
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
store i8 0, i8* %4
%5 = tail call i32 @MPI_Add_error_code(i32 %0, i32* %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %1
%9 = call i32 @MPI_Add_error_string(i32 %8, i8* %4)
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ %9, %7 ], [ %5, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void lex_error(char *msg, int line) {
  printf("\nError at line %-3d: %s\n\n", line, msg);
}


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

x86 assembly (clang, -O2):
<lex_error>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\0AError at line %-3d: %s\0A\0A\00"
define void @lex_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0AError at line %-3d: %s\0A\0A\00"
define void @lex_error(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
ret void
}
/* Type definitions */
struct tag_async_net {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ log_msg(int, char *, int, char *);
void default_child_sock_err_handler(struct tag_async_net *asnet, int fd,
                                    void *info) {
  log_msg(3,
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/w1ndy/simple-http-server/refs/heads/"
          "master/asnet.h",
          60, "epoll error on child socket");
}


x86 assembly (clang, -O0):
<default_child_sock_err_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x3,%edi
lea    0xed1(%rip),%rsi
mov    $0x3c,%edx
lea    0xf52(%rip),%rcx
call   1030 <log_msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_child_sock_err_handler>:
lea    0xee9(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    $0x3,%edi
mov    $0x3c,%edx
jmp    1030 <log_msg@plt>

LLVM IR (-O0):
%struct.tag_async_net = type { i32 }
@.str = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/w1ndy/simple-http-server/refs/heads/master/asnet.h\00"
@.str.1 = [28 x i8] c"epoll error on child socket\00"
define void @default_child_sock_err_handler(%struct.tag_async_net* %0, i32 %1, i8* %2) {
%4 = alloca %struct.tag_async_net*
%5 = alloca i32
%6 = alloca i8*
store %struct.tag_async_net* %0, %struct.tag_async_net** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = call i32 @log_msg(i32 3, i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i32 60, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.tag_async_net = type { i32 }
@.str = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/w1ndy/simple-http-server/refs/heads/master/asnet.h\00"
@.str.1 = [28 x i8] c"epoll error on child socket\00"
define void @default_child_sock_err_handler(%struct.tag_async_net* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @log_msg(i32 3, i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i32 60, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double floor(double);
double time_convert_second(double hundredth) {
  double hour;
  double min;
  double sec;
  hour = floor(hundredth);
  min = hundredth - hour;
  min *= 60.0;
  sec = min - floor(min);
  sec *= 60.0;
  return floor(sec);
}


x86 assembly (clang, -O0):
<time_convert_second>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xebd(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe86(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <floor@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_convert_second>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <floor@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xed4(%rip),%xmm1
movsd  %xmm1,(%rsp)
movapd %xmm1,%xmm0
call   1030 <floor@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xeb5(%rip),%xmm1
movapd %xmm1,%xmm0
pop    %rax
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @time_convert_second(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = call double @llvm.floor.f64(double %6)
store double %7, double* %3
%8 = load double, double* %2
%9 = load double, double* %3
%10 = fsub double %8, %9
store double %10, double* %4
%11 = load double, double* %4
%12 = fmul double %11, 6.000000e+01
store double %12, double* %4
%13 = load double, double* %4
%14 = load double, double* %4
%15 = call double @llvm.floor.f64(double %14)
%16 = fsub double %13, %15
store double %16, double* %5
%17 = load double, double* %5
%18 = fmul double %17, 6.000000e+01
store double %18, double* %5
%19 = load double, double* %5
%20 = call double @llvm.floor.f64(double %19)
ret double %20
}

LLVM IR (-O2):
define double @time_convert_second(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fsub double %0, %2
%4 = fmul double %3, 6.000000e+01
%5 = tail call double @llvm.floor.f64(double %4)
%6 = fsub double %4, %5
%7 = fmul double %6, 6.000000e+01
%8 = tail call double @llvm.floor.f64(double %7)
ret double %8
}