xunge/DecIR huggingface dataset:
/* Variables and functions */
double exp(double);
double exp_wrapper(double *arg_list) { return (exp(arg_list[0])); }


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

x86 assembly (clang, -O2):
<exp_wrapper>:
movsd  (%rdi),%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @exp_wrapper(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = call double @exp(double %5)
ret double %6
}

LLVM IR (-O2):
define double @exp_wrapper(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @exp(double %2)
ret double %3
}
void sock_init(void) {}


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

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

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

LLVM IR (-O2):
define void @sock_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void myprint_liba(char *str) { printf("libA print: %s", str); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"libA print: %s\00"
define void @myprint_liba(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"libA print: %s\00"
define void @myprint_liba(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
long __attribute__((__always___, __gnu___, __const__, __artificial__))
iceil(const long N, const long K) {
  const long r = N % K;
  if (r != 0)
    return N + K - r;
  else
    return N;
}


x86 assembly (clang, -O0):
<iceil>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     113a <iceil+0x3a>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1142 <iceil+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iceil>:
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1116 <iceil+0x16>
mov    %rdi,%rax
cqto
idiv   %rsi
jmp    111c <iceil+0x1c>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
add    %rdi,%rsi
sub    %rdx,%rsi
test   %rdx,%rdx
cmove  %rdi,%rsi
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @iceil(i64 %0, i64 %1) {
%3 = srem i64 %0, %1
%4 = icmp eq i64 %3, 0
%5 = add nsw i64 %1, %0
%6 = sub i64 %5, %3
%7 = select i1 %4, i64 %0, i64 %6
ret i64 %7
}
void onDestroy() {}


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

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

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

LLVM IR (-O2):
define void @onDestroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_string(char *);
char *l_askNbytes(int /*<<< orphan*/, char *, int /*<<< orphan*/, int);
char *macgetnametostick(char *arg) {
  return l_askNbytes(get_string(arg), "61", 0, -1);
}


x86 assembly (clang, -O0):
<macgetnametostick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_string@plt>
mov    %eax,%edi
lea    0xec2(%rip),%rsi
xor    %edx,%edx
mov    $0xffffffff,%ecx
call   1030 <l_askNbytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macgetnametostick>:
push   %rax
call   1040 <get_string@plt>
lea    0xed3(%rip),%rsi
mov    %eax,%edi
xor    %edx,%edx
mov    $0xffffffff,%ecx
pop    %rax
jmp    1030 <l_askNbytes@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"61\00"
define i8* @macgetnametostick(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @get_string(i8* %3)
%5 = call i8* @l_askNbytes(i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i32 -1)
ret i8* %5
}

LLVM IR (-O2):
@.str = [3 x i8] c"61\00"
define i8* @macgetnametostick(i8* %0) {
%2 = tail call i32 @get_string(i8* %0)
%3 = tail call i8* @l_askNbytes(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i32 -1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int WNOHANG;
int WUNTRACED;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
pid_t __waitpid(pid_t pid, int *stat_loc, int options) {
  if ((options & ~(WNOHANG | WUNTRACED)) != 0) {
    __set_errno(EINVAL);
    return (pid_t)-1;
  }
  __set_errno(ENOSYS);
  return (pid_t)-1;
}


x86 assembly (clang, -O0):
<__waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2eb4(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2e9b(%rip),%rdx
or     (%rdx),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     115f <__waitpid+0x4f>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <__waitpid+0x64>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__waitpid>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
not    %ecx
test   %edx,%ecx
jne    1132 <__waitpid+0x22>
mov    0x2eb8(%rip),%rax
jmp    1139 <__waitpid+0x29>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
@WUNTRACED = global i32 0
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__waitpid(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = load i32, i32* @WNOHANG
%10 = load i32, i32* @WUNTRACED
%11 = or i32 %9, %10
%12 = xor i32 %11, -1
%13 = and i32 %8, %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %3
%16 = load i32, i32* @EINVAL
%17 = call i32 @__set_errno(i32 %16)
store i32 -1, i32* %4
br label %21
18: ; preds = %3
%19 = load i32, i32* @ENOSYS
%20 = call i32 @__set_errno(i32 %19)
store i32 -1, i32* %4
br label %21
21: ; preds = %18, %15
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@WUNTRACED = global i32 0
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__waitpid(i32 %0, i32* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @WNOHANG
%5 = load i32, i32* @WUNTRACED
%6 = or i32 %5, %4
%7 = xor i32 %6, -1
%8 = and i32 %7, %2
%9 = icmp eq i32 %8, 0
%10 = load i32, i32* @ENOSYS
%11 = load i32, i32* @EINVAL
%12 = select i1 %9, i32 %10, i32 %11
%13 = tail call i32 @__set_errno(i32 %12)
ret i32 -1
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int c, nl;
  nl = 0;
  while ((c = getchar()) != EOF)
    if (c == '\n')
      ++nl;
  printf("%d\n", nl);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     1167 <main+0x47>
cmpl   $0xa,-0x8(%rbp)
jne    1162 <main+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb4(%rip),%r14
cmp    (%r14),%eax
je     1156 <main+0x36>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <main+0x20>
lea    0xea3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %10, %4 ], [ %1, %0 ]
%6 = phi i32 [ %9, %4 ], [ 0, %0 ]
%7 = icmp eq i32 %5, 10
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %6, %8
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %0
%14 = phi i32 [ 0, %0 ], [ %9, %4 ]
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}
/* Variables and functions */
int atoi(char const *);
scalar_t__ strcmp(char const *, char *);
int prob_conv_to_int(const char *databuf) {
  return ((strcmp(databuf, "") == 0) ? 0 : atoi(databuf));
}


x86 assembly (clang, -O0):
<prob_conv_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1150 <prob_conv_to_int+0x30>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    115c <prob_conv_to_int+0x3c>
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prob_conv_to_int>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     113e <prob_conv_to_int+0x1e>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <atoi@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @prob_conv_to_int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @atoi(i8* %8)
br label %10
10: ; preds = %7, %6
%11 = phi i32 [ 0, %6 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @prob_conv_to_int(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @atoi(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ MMC_disk_timerproc();
void disk_timerproc(void) { MMC_disk_timerproc(); }


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

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

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

LLVM IR (-O2):
define void @disk_timerproc() {
%1 = tail call i32 (...) @MMC_disk_timerproc()
ret void
}
/* Variables and functions */
int __gcd(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
void main() {
  int num0, num1;
  scanf("%d%d", &num0, &num1);
  int ret = __gcd(num0, num1);
  printf("gcd = %d\n", ret);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <__gcd@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [10 x i8] c"gcd = %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @__gcd(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int sum = 0, number;
  for (number = 2; number <= 30; number += 2)
    sum += number;
  printf("Sum is %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x1e,-0xc(%rbp)
jg     114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"Sum is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 2, i32* %3
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 30
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
store i32 %10, i32* %2
br label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 2
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Sum is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 240)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void default_print_cell(char c) { printf("%c", c); }


x86 assembly (clang, -O0):
<default_print_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_print_cell>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @default_print_cell(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @default_print_cell(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
void incle(unsigned char *n) {
  (*(unsigned int *)&n[12]) = (1 + (((*(unsigned int *)&n[12]))));
}


x86 assembly (clang, -O0):
<incle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<incle>:
addl   $0x1,0xc(%rdi)
ret

LLVM IR (-O0):
define void @incle(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 12
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = add i32 1, %6
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 12
%10 = bitcast i8* %9 to i32*
store i32 %7, i32* %10
ret void
}

LLVM IR (-O2):
define void @incle(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 12
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = add i32 %4, 1
store i32 %5, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *pname) {
  printf("Usage: %s [OPTION] <deletions.haplotypes> <snps.haplotypes>\n"
         "\n"
         " -m\tNUM\tNumber of SNPs used for imputating the deletion.\n"
         " -s\tNUM\tRange in which SNPs must lie in order to be used for "
         "imputation. \n"
         " -v\t\tVerbose.\n"
         " -h\t\tPrint this help.\n\n",
         pname);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [230 x i8] c"Usage: %s [OPTION] <deletions.haplotypes> <snps.haplotypes>\0A\0A -m\09NUM\09Number of SNPs used for imputating the deletion.\0A -s\09NUM\09Range in which SNPs must lie in order to be used for imputation. \0A -v\09\09Verbose.\0A -h\09\09Print this help.\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([230 x i8], [230 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [230 x i8] c"Usage: %s [OPTION] <deletions.haplotypes> <snps.haplotypes>\0A\0A -m\09NUM\09Number of SNPs used for imputating the deletion.\0A -s\09NUM\09Range in which SNPs must lie in order to be used for imputation. \0A -v\09\09Verbose.\0A -h\09\09Print this help.\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([230 x i8], [230 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ DrawArc(double, int /*<<< orphan*/, int);
int /*<<< orphan*/ InitGraphics();
int /*<<< orphan*/ MovePen(double, double);
main() {
  InitGraphics();
  MovePen(1.5, 1.0);
  DrawArc(0.5, 0, 360);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <InitGraphics@plt>
movsd  0xec5(%rip),%xmm0
movsd  0xec5(%rip),%xmm1
call   1050 <MovePen@plt>
movsd  0xea8(%rip),%xmm0
xor    %edi,%edi
mov    $0x168,%esi
call   1040 <DrawArc@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <InitGraphics@plt>
movsd  0xec0(%rip),%xmm0
movsd  0xec0(%rip),%xmm1
call   1050 <MovePen@plt>
movsd  0xebb(%rip),%xmm0
xor    %edi,%edi
mov    $0x168,%esi
call   1040 <DrawArc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @InitGraphics()
%2 = call i32 @MovePen(double 1.500000e+00, double 1.000000e+00)
%3 = call i32 @DrawArc(double 5.000000e-01, i32 0, i32 360)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @InitGraphics()
%2 = tail call i32 @MovePen(double 1.500000e+00, double 1.000000e+00)
%3 = tail call i32 @DrawArc(double 5.000000e-01, i32 0, i32 360)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void error(char *mensaje) {
  printf("%s\n", mensaje);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
size_t heap_left(size_t i) { return 2 * i + 1; }


x86 assembly (clang, -O0):
<heap_left>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_left>:
lea    (%rdi,%rdi,1),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @heap_left(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 2, %3
%5 = add i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @heap_left(i64 %0) {
%2 = shl i64 %0, 1
%3 = or i64 %2, 1
ret i64 %3
}
/* Variables and functions */
int ENOSYS;
int nftw(const char *path,
         int (*fn)(const char *, const struct stat *, int, struct FTW *),
         int fd_limit, int flags) {
  return ENOSYS;
}


x86 assembly (clang, -O0):
<nftw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    0x2ecf(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nftw>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.stat = type opaque
%struct.FTW = type opaque
@ENOSYS = global i32 0
define i32 @nftw(i8* %0, i32 (i8*, %struct.stat*, i32, %struct.FTW*)* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32 (i8*, %struct.stat*, i32, %struct.FTW*)*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 (i8*, %struct.stat*, i32, %struct.FTW*)* %1, i32 (i8*, %struct.stat*, i32, %struct.FTW*)** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @ENOSYS
ret i32 %9
}

LLVM IR (-O2):
%struct.stat = type opaque
%struct.FTW = type opaque
@ENOSYS = global i32 0
define i32 @nftw(i8* nocapture readnone %0, i32 (i8*, %struct.stat*, i32, %struct.FTW*)* nocapture readnone %1, i32 %2, i32 %3) {
%5 = load i32, i32* @ENOSYS
ret i32 %5
}
void do_something(void) {
  const unsigned long loop = 1000000000L;
  unsigned long i;
  static volatile unsigned long dummy;
  for (i = 0; i < loop; i++)
    dummy = i;
}


x86 assembly (clang, -O0):
<do_something>:
push   %rbp
mov    %rsp,%rbp
movq   $0x3b9aca00,-0x8(%rbp)
3b
movq   $0x0,-0x10(%rbp)
cmpq   $0x3b9aca00,-0x10(%rbp)
3b
jae    113e <do_something+0x3e>
mov    -0x10(%rbp),%rax
mov    %rax,0x2efb(%rip)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <do_something+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_something>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rax,0x2f11(%rip)
lea    0x1(%rax),%rcx
mov    %rcx,0x2f06(%rip)
lea    0x2(%rax),%rcx
mov    %rcx,0x2efb(%rip)
lea    0x3(%rax),%rcx
mov    %rcx,0x2ef0(%rip)
lea    0x4(%rax),%rcx
mov    %rcx,0x2ee5(%rip)
lea    0x5(%rax),%rcx
mov    %rcx,0x2eda(%rip)
lea    0x6(%rax),%rcx
mov    %rcx,0x2ecf(%rip)
lea    0x7(%rax),%rcx
mov    %rcx,0x2ec4(%rip)
lea    0x8(%rax),%rcx
mov    %rcx,0x2eb9(%rip)
lea    0x9(%rax),%rcx
mov    %rcx,0x2eae(%rip)
add    $0xa,%rax
cmp    $0x3b9aca00,%rax
jne    1110 <do_something+0x10>
ret

LLVM IR (-O0):
@do_something.dummy = internal global i64 0
define void @do_something() {
%1 = alloca i64
%2 = alloca i64
store i64 1000000000, i64* %1
store i64 0, i64* %2
br label %3
3: ; preds = %8, %0
%4 = load i64, i64* %2
%5 = icmp ult i64 %4, 1000000000
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i64, i64* %2
store volatile i64 %7, i64* @do_something.dummy
br label %8
8: ; preds = %6
%9 = load i64, i64* %2
%10 = add i64 %9, 1
store i64 %10, i64* %2
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
@do_something.dummy = internal global i64 0
define void @do_something() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %12, %1 ]
store volatile i64 %2, i64* @do_something.dummy
%3 = or i64 %2, 1
store volatile i64 %3, i64* @do_something.dummy
%4 = add nuw nsw i64 %2, 2
store volatile i64 %4, i64* @do_something.dummy
%5 = add nuw nsw i64 %2, 3
store volatile i64 %5, i64* @do_something.dummy
%6 = add nuw nsw i64 %2, 4
store volatile i64 %6, i64* @do_something.dummy
%7 = add nuw nsw i64 %2, 5
store volatile i64 %7, i64* @do_something.dummy
%8 = add nuw nsw i64 %2, 6
store volatile i64 %8, i64* @do_something.dummy
%9 = add nuw nsw i64 %2, 7
store volatile i64 %9, i64* @do_something.dummy
%10 = add nuw nsw i64 %2, 8
store volatile i64 %10, i64* @do_something.dummy
%11 = add nuw nsw i64 %2, 9
store volatile i64 %11, i64* @do_something.dummy
%12 = add nuw nsw i64 %2, 10
%13 = icmp eq i64 %12, 1000000000
br i1 %13, label %14, label %1
14: ; preds = %1
ret void
}
int execute_gettid() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_gettid() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_gettid() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void free_int_line(int *line) {
  free(line);
  return;
}


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

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

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

LLVM IR (-O2):
define void @free_int_line(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
help(name) {
  printf("usage: %s n [base]\n", name);
  printf("Compute fib(n) and fact(n) and output the result in base 'base'\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"usage: %s n [base]\0A\00"
@.str.1 = [65 x i8] c"Compute fib(n) and fact(n) and output the result in base 'base'\0A\00"
define i32 @help(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [20 x i8] c"usage: %s n [base]\0A\00"
@str = [64 x i8] c"Compute fib(n) and fact(n) and output the result in base 'base'\00"
define i32 @help(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int test_bit(long nr, const unsigned long *addr) {
  return 1UL & (addr[((nr) / (sizeof(unsigned long) * 8))] >>
                (nr & ((sizeof(unsigned long) * 8) - 1)));
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x6,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x8(%rbp),%rcx
and    $0x3f,%rcx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
mov    %rdi,%rcx
mov    %rdi,%rax
shr    $0x6,%rax
mov    (%rsi,%rax,8),%rax
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_bit(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i64, i64* %3
%7 = udiv i64 %6, 64
%8 = getelementptr inbounds i64, i64* %5, i64 %7
%9 = load i64, i64* %8
%10 = load i64, i64* %3
%11 = and i64 %10, 63
%12 = lshr i64 %9, %11
%13 = and i64 1, %12
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_bit(i64 %0, i64* nocapture %1) {
%3 = lshr i64 %0, 6
%4 = getelementptr inbounds i64, i64* %1, i64 %3
%5 = load i64, i64* %4
%6 = and i64 %0, 63
%7 = lshr i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = and i32 %8, 1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ md5_hash_hex(char *, char *, int);
void NAS_Hash_Hex(char *in, char *out, int o_size, int algm) {
  if (algm == 1)
    md5_hash_hex(in, out, o_size);
}


x86 assembly (clang, -O0):
<NAS_Hash_Hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    1140 <NAS_Hash_Hex+0x30>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <md5_hash_hex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NAS_Hash_Hex>:
cmp    $0x1,%ecx
jne    111a <NAS_Hash_Hex+0xa>
jmp    1030 <md5_hash_hex@plt>
ret

LLVM IR (-O0):
define void @NAS_Hash_Hex(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = call i32 @md5_hash_hex(i8* %12, i8* %13, i32 %14)
br label %16
16: ; preds = %11, %4
ret void
}

LLVM IR (-O2):
define void @NAS_Hash_Hex(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @md5_hash_hex(i8* %0, i8* %1, i32 %2)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ request_ctl_cleanup();
void teardown(void) { request_ctl_cleanup(); }


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

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

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

LLVM IR (-O2):
define void @teardown() {
%1 = tail call i32 (...) @request_ctl_cleanup()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_25519_carry_mul(uintptr_t, uintptr_t,
                                                 uintptr_t);
void fiat_25519_carry_mul(uint32_t out1[10], const uint32_t arg1[10],
                          const uint32_t arg2[10]) {
  internal_fiat_25519_carry_mul((uintptr_t)out1, (uintptr_t)arg1,
                                (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_25519_carry_mul>:
jmp    1030 <internal_fiat_25519_carry_mul@plt>

LLVM IR (-O0):
define void @fiat_25519_carry_mul(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 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_25519_carry_mul(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_25519_carry_mul(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_25519_carry_mul(i64 %4, i64 %5, i64 %6)
ret void
}
int int_non_neg(int *i) {
  if (*i < 0) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<int_non_neg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jge    1121 <int_non_neg+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1128 <int_non_neg+0x28>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_non_neg>:
mov    (%rdi),%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @int_non_neg(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @int_non_neg(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = xor i32 %2, -1
%4 = lshr i32 %3, 31
ret i32 %4
}
/* Variables and functions */
int BIO_tou_socket_non_fatal_error(int);
int get_last_tou_socket_error(int);
int BIO_tou_socket_should_retry(int s, int i) {
  int err;
  if ((i == 0) || (i == -1)) {
    err = get_last_tou_socket_error(s);
    return (BIO_tou_socket_non_fatal_error(err));
  }
  return (0);
}


x86 assembly (clang, -O0):
<BIO_tou_socket_should_retry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1142 <BIO_tou_socket_should_retry+0x22>
cmpl   $0xffffffff,-0xc(%rbp)
jne    115d <BIO_tou_socket_should_retry+0x3d>
mov    -0x8(%rbp),%edi
call   1040 <get_last_tou_socket_error@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <BIO_tou_socket_non_fatal_error@plt>
mov    %eax,-0x4(%rbp)
jmp    1164 <BIO_tou_socket_should_retry+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_tou_socket_should_retry>:
add    $0x1,%esi
cmp    $0x1,%esi
ja     1136 <BIO_tou_socket_should_retry+0x16>
push   %rax
call   1040 <get_last_tou_socket_error@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <BIO_tou_socket_non_fatal_error@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @BIO_tou_socket_should_retry(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %17
12: ; preds = %9, %2
%13 = load i32, i32* %4
%14 = call i32 @get_last_tou_socket_error(i32 %13)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = call i32 @BIO_tou_socket_non_fatal_error(i32 %15)
store i32 %16, i32* %3
br label %18
17: ; preds = %9
store i32 0, i32* %3
br label %18
18: ; preds = %17, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @BIO_tou_socket_should_retry(i32 %0, i32 %1) {
%3 = add i32 %1, 1
%4 = icmp ult i32 %3, 2
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @get_last_tou_socket_error(i32 %0)
%7 = tail call i32 @BIO_tou_socket_non_fatal_error(i32 %6)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %7, %5 ], [ 0, %2 ]
ret i32 %9
}
char *strcat2(char *s1, const char *s2) {
  char *result = s1;
  while (*s1 != '\0')
    ;
  while (*s2 != '\0')
    *s1++ = *s2++;
  *s1 = '\0';
  return result;
}


x86 assembly (clang, -O0):
<strcat2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1129 <strcat2+0x29>
jmp    1114 <strcat2+0x14>
jmp    112e <strcat2+0x2e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1165 <strcat2+0x65>
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    112e <strcat2+0x2e>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat2>:
cmpb   $0x0,(%rdi)
je     1112 <strcat2+0x12>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1110 <strcat2+0x10>
mov    (%rsi),%al
mov    %rdi,%rcx
test   %al,%al
je     1141 <strcat2+0x41>
add    $0x1,%rsi
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %al,(%rcx)
add    $0x1,%rcx
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1130 <strcat2+0x30>
movb   $0x0,(%rcx)
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @strcat2(i8* returned %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %2, %5
br label %5
6: ; preds = %2
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %6, %9
%10 = phi i8 [ %15, %9 ], [ %7, %6 ]
%11 = phi i8* [ %14, %9 ], [ %0, %6 ]
%12 = phi i8* [ %13, %9 ], [ %1, %6 ]
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %10, i8* %11
%15 = load i8, i8* %13
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %6
%18 = phi i8* [ %0, %6 ], [ %14, %9 ]
store i8 0, i8* %18
ret i8* %0
}
/* Variables and functions */
scalar_t__ Rand3();
double dRand3(void) { return ((double)Rand3() / ((double)0xFFFFFFFFUL + 1)); }


x86 assembly (clang, -O0):
<dRand3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Rand3@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dRand3>:
push   %rax
xor    %eax,%eax
call   1030 <Rand3@plt>
cvtsi2sd %rax,%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dRand3() {
%1 = call i64 (...) @Rand3()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 0x41F0000000000000
ret double %3
}

LLVM IR (-O2):
define double @dRand3() {
%1 = tail call i64 (...) @Rand3()
%2 = sitofp i64 %1 to double
%3 = fmul double %2, 0x3DF0000000000000
ret double %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ openFile();
int main(int argc, char const *argv[]) {
  openFile();
  return EXIT_SUCCESS;
}


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    $0x0,%al
call   1030 <openFile@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <openFile@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @openFile()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
float sqrt(float);
float find_dist(float x1, float y1, float x2, float y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}


x86 assembly (clang, -O0):
<find_dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
subss  -0xc(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
subss  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm3
subss  -0x10(%rbp),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_dist>:
subss  %xmm2,%xmm0
subss  %xmm3,%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1131 <find_dist+0x21>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @find_dist(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %7
%11 = fsub float %9, %10
%12 = load float, float* %5
%13 = load float, float* %7
%14 = fsub float %12, %13
%15 = load float, float* %6
%16 = load float, float* %8
%17 = fsub float %15, %16
%18 = load float, float* %6
%19 = load float, float* %8
%20 = fsub float %18, %19
%21 = fmul float %17, %20
%22 = call float @llvm.fmuladd.f32(float %11, float %14, float %21)
%23 = call float @sqrt(float %22)
ret float %23
}

LLVM IR (-O2):
define float @find_dist(float %0, float %1, float %2, float %3) {
%5 = fsub float %0, %2
%6 = fsub float %1, %3
%7 = fmul float %6, %6
%8 = tail call float @llvm.fmuladd.f32(float %5, float %5, float %7)
%9 = tail call float @sqrt(float %8)
ret float %9
}
/* Variables and functions */
char *strdup(char const *);
char *app_file_path(const char *argv0) { return strdup(argv0); }


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

x86 assembly (clang, -O2):
<app_file_path>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @app_file_path(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Type definitions */
struct nmpa_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *nmpa_alloc(struct nmpa_s *, size_t);
void *nmpa_memdup(struct nmpa_s *nmpa, const void *buf, size_t size) {
  void *ptr = nmpa_alloc(nmpa, size);
  if (ptr) {
    memcpy(ptr, buf, size);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<nmpa_memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <nmpa_alloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1161 <nmpa_memdup+0x41>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmpa_memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdx,%rsi
call   1030 <nmpa_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <nmpa_memdup+0x29>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
%struct.nmpa_s = type { i32 }
define i8* @nmpa_memdup(%struct.nmpa_s* %0, i8* %1, i64 %2) {
%4 = tail call i8* @nmpa_alloc(%struct.nmpa_s* %0, i64 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @memcpy(i8* %4, i8* %1, i64 %2)
br label %8
8: ; preds = %6, %3
ret i8* %4
}