xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_smediansorted(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_smediansorted(N, x, stride);
  printf("median: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1030 <stdlib_strided_smediansorted@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1030 <stdlib_strided_smediansorted@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [12 x i8] c"median: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_smediansorted(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [12 x i8] c"median: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_smediansorted(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
long f(long val) { return val; }


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

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

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

LLVM IR (-O2):
define i64 @f(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
scalar_t__ is_separator(char const, char);
char *vle_cmds_at_arg(const char args[]) {
  while (is_separator(*args, ' ')) {
    ++args;
  }
  return (char *)args;
}


x86 assembly (clang, -O0):
<vle_cmds_at_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x20,%esi
movsbl (%rax),%edi
call   1030 <is_separator@plt>
cmp    $0x0,%rax
je     1148 <vle_cmds_at_arg+0x38>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <vle_cmds_at_arg+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vle_cmds_at_arg>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
mov    $0x20,%esi
call   1030 <is_separator@plt>
test   %rax,%rax
jne    1120 <vle_cmds_at_arg+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @vle_cmds_at_arg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @is_separator(i8 signext %5, i8 signext 32)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @vle_cmds_at_arg(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @is_separator(i8 signext %4, i8 signext 32)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int read(int, void *, long);
int File_read(int fd, void *x, long size) {
  int c;
  if ((c = read(fd, x, size)) == -1)
    return -1;
  return c;
}


x86 assembly (clang, -O0):
<File_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
jne    114b <File_read+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <File_read+0x41>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<File_read>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @File_read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
double strtod(const char *nptr, char **endptr) {
  *endptr = (char *)nptr;
  return 0;
}


x86 assembly (clang, -O0):
<strtod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtod>:
mov    %rdi,(%rsi)
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @strtod(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** %4
store i8* %5, i8** %6
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @strtod(i8* %0, i8** nocapture writeonly %1) {
store i8* %0, i8** %1
ret double 0.000000e+00
}
/* Variables and functions */
bool isPowerOfFour(int num) {
  while (num) {
    if (num == 1)
      return true;
    if (num % 4)
      return false;
    num /= 4;
  }
}


x86 assembly (clang, -O0):
<isPowerOfFour>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115a <isPowerOfFour+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1127 <isPowerOfFour+0x27>
movl   $0x1,-0x4(%rbp)
jmp    115a <isPowerOfFour+0x5a>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1147 <isPowerOfFour+0x47>
movl   $0x0,-0x4(%rbp)
jmp    115a <isPowerOfFour+0x5a>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1107 <isPowerOfFour+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOfFour>:
mov    $0x1,%eax
cmp    $0x2,%edi
jb     1128 <isPowerOfFour+0x28>
nopw   0x0(%rax,%rax,1)
test   $0x3,%dil
jne    1129 <isPowerOfFour+0x29>
lea    0x3(%rdi),%ecx
test   %edi,%edi
cmovns %edi,%ecx
sar    $0x2,%ecx
mov    %ecx,%edi
cmp    $0x1,%ecx
ja     1110 <isPowerOfFour+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isPowerOfFour(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %10, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ %0, %1 ]
%5 = and i32 %4, 3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = sdiv i32 %4, 4
%9 = icmp ult i32 %8, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %7, %1
%11 = phi i32 [ 1, %1 ], [ 1, %7 ], [ 0, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p434_sub(uintptr_t, uintptr_t, uintptr_t);
void fiat_p434_sub(uint64_t out1[7], const uint64_t arg1[7],
                   const uint64_t arg2[7]) {
  internal_fiat_p434_sub((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


x86 assembly (clang, -O0):
<fiat_p434_sub>:
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_p434_sub@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_p434_sub>:
jmp    1030 <internal_fiat_p434_sub@plt>

LLVM IR (-O0):
define void @fiat_p434_sub(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_p434_sub(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_p434_sub(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_p434_sub(i64 %4, i64 %5, i64 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ABMON_8;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_abmon_8() { return nl_langinfo(ABMON_8); }


x86 assembly (clang, -O0):
<langinfo_abmon_8>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_abmon_8>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@ABMON_8 = global i32 0
define i8* @langinfo_abmon_8() {
%1 = load i32, i32* @ABMON_8
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@ABMON_8 = global i32 0
define i8* @langinfo_abmon_8() {
%1 = load i32, i32* @ABMON_8
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
void X509_free(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_free() {
ret void
}
/* Variables and functions */
scalar_t__ errno;
int mkdir(char const *, int);
int /*<<< orphan*/ printf(char *, char const *);
int mk_dir(const char *dir, int mode) {
  if (mkdir(dir, mode) == -1) {
    return 1;
  } else {
    printf("Creating directory \"%s\"...\n", dir);
    errno = 0;
    return 0;
  }
}


x86 assembly (clang, -O0):
<mk_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
jne    1150 <mk_dir+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1175 <mk_dir+0x55>
mov    -0x10(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e79(%rip),%rax
movq   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_dir>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
je     114f <mk_dir+0x2f>
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    0x2e9c(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [28 x i8] c"Creating directory \22%s\22...\0A\00"
@errno = global i64 0
define i32 @mk_dir(i8* %0, i32 %1) {
%3 = tail call i32 @mkdir(i8* %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
store i64 0, i64* @errno
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ sla_prenut(double *, double *, double *);
void csla_prenut(double ep0, double date, double rmatpn[3][3]) {
  sla_prenut(&ep0, &date, &(rmatpn[0][0]));
}


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

x86 assembly (clang, -O2):
<csla_prenut>:
sub    $0x18,%rsp
mov    %rdi,%rdx
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <sla_prenut@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @csla_prenut(double %0, double %1, [3 x double]* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca [3 x double]*
store double %0, double* %4
store double %1, double* %5
store [3 x double]* %2, [3 x double]** %6
%7 = load [3 x double]*, [3 x double]** %6
%8 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0
%9 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%10 = call i32 @sla_prenut(double* %4, double* %5, double* %9)
ret void
}

LLVM IR (-O2):
define void @csla_prenut(double %0, double %1, [3 x double]* %2) {
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%7 = call i32 @sla_prenut(double* %4, double* %5, double* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printaMatriz(int **, int, int);
void printaMatrizQuadrada(int **mat, int tam) { printaMatriz(mat, tam, tam); }


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

x86 assembly (clang, -O2):
<printaMatrizQuadrada>:
mov    %esi,%edx
jmp    1030 <printaMatriz@plt>

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

LLVM IR (-O2):
define void @printaMatrizQuadrada(i32** %0, i32 %1) {
%3 = tail call i32 @printaMatriz(i32** %0, i32 %1, i32 %1)
ret void
}
/* Variables and functions */
long get_num(char *, char *);
char *tt_origtopology(char *, int, long);
char *macttOrigtopology(char *arg) {
  int tbl;
  long top;
  top = get_num("ttOrigTopology", arg);
  tbl = (int)get_num("ttOrigTopology", arg);
  return tt_origtopology(arg, tbl, top);
}


x86 assembly (clang, -O0):
<macttOrigtopology>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <get_num@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <get_num@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <tt_origtopology@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macttOrigtopology>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xed1(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r15,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <tt_origtopology@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"ttOrigTopology\00"
define i8* @macttOrigtopology(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @get_num(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5)
store i64 %6, i64* %4
%7 = load i8*, i8** %2
%8 = call i64 @get_num(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = load i64, i64* %4
%13 = call i8* @tt_origtopology(i8* %10, i32 %11, i64 %12)
ret i8* %13
}

LLVM IR (-O2):
@.str = [15 x i8] c"ttOrigTopology\00"
define i8* @macttOrigtopology(i8* %0) {
%2 = tail call i64 @get_num(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i64 @get_num(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = trunc i64 %3 to i32
%5 = tail call i8* @tt_origtopology(i8* %0, i32 %4, i64 %2)
ret i8* %5
}
/* Variables and functions */
int getdtablesize();
_rpc_dtablesize() {
  static int size;
  if (size == 0) {
    size = getdtablesize();
  }
  return (size);
}


x86 assembly (clang, -O0):
<_rpc_dtablesize>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
jne    112e <_rpc_dtablesize+0x1e>
mov    $0x0,%al
call   1030 <getdtablesize@plt>
mov    %eax,0x2efe(%rip)
mov    0x2ef8(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rpc_dtablesize>:
push   %rax
mov    0x2f15(%rip),%eax
test   %eax,%eax
je     111d <_rpc_dtablesize+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <getdtablesize@plt>
mov    %eax,0x2f02(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@_rpc_dtablesize.size = internal global i32 0
define i32 @_rpc_dtablesize() {
%1 = load i32, i32* @_rpc_dtablesize.size
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @getdtablesize()
store i32 %4, i32* @_rpc_dtablesize.size
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @_rpc_dtablesize.size
ret i32 %6
}

LLVM IR (-O2):
@_rpc_dtablesize.size = internal unnamed_addr global i32 0
define i32 @_rpc_dtablesize() {
%1 = load i32, i32* @_rpc_dtablesize.size
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @getdtablesize()
store i32 %4, i32* @_rpc_dtablesize.size
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
struct itimerval {
  TYPE_1__ it_value;
};

/* Variables and functions */
int /*<<< orphan*/ getitimer(int, struct itimerval *);
float itimerread(int timerid) {
  struct itimerval thistime;
  getitimer(timerid, &thistime);
  return (float)thistime.it_value.tv_sec +
         1e-6 * (float)thistime.it_value.tv_usec;
}


x86 assembly (clang, -O0):
<itimerread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1030 <getitimer@plt>
cvtsi2ssq -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
cvtsi2ssq -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xebd(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itimerread>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
call   1030 <getitimer@plt>
cvtsi2ssq 0x10(%rsp),%xmm0
cvtsi2ssq 0x8(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xec8(%rip),%xmm1
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.itimerval = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64, i64 }
define float @itimerread(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.itimerval
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @getitimer(i32 %4, %struct.itimerval* %3)
%6 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %3, i32 0, i32 0
%7 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %6, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to float
%10 = fpext float %9 to double
%11 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %3, i32 0, i32 0
%12 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %11, i32 0, i32 0
%13 = load i64, i64* %12
%14 = sitofp i64 %13 to float
%15 = fpext float %14 to double
%16 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %15, double %10)
%17 = fptrunc double %16 to float
ret float %17
}

LLVM IR (-O2):
%struct.itimerval = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64, i64 }
define float @itimerread(i32 %0) {
%2 = alloca %struct.itimerval
%3 = bitcast %struct.itimerval* %2 to i8*
%4 = call i32 @getitimer(i32 %0, %struct.itimerval* %2)
%5 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %2, i64 0, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to float
%8 = fpext float %7 to double
%9 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %2, i64 0, i32 0, i32 0
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to float
%12 = fpext float %11 to double
%13 = tail call double @llvm.fmuladd.f64(double %12, double 0x3EB0C6F7A0B5ED8D, double %8)
%14 = fptrunc double %13 to float
ret float %14
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *strdup(const char *s) {
  int len = strlen(s);
  char *r;
  r = malloc(len + 1);
  strcpy(r, s);
  return r;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ display();
void redraw() {
  clear();
  display();
}


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

x86 assembly (clang, -O2):
<redraw>:
push   %rax
xor    %eax,%eax
call   1040 <clear@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <display@plt>

LLVM IR (-O0):
define void @redraw() {
%1 = call i32 (...) @clear()
%2 = call i32 (...) @display()
ret void
}

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

/* Variables and functions */
uint32_t pack_16t_16b(int32_t a, int32_t b) {}


x86 assembly (clang, -O0):
<pack_16t_16b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pack_16t_16b(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @pack_16t_16b(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(int signo) { printf("WRITER: get signal\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"WRITER: get signal\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"WRITER: get signal\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
void foo_1_1_1_1_1_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_1_1_1_2_2_1() {
ret void
}
/* Variables and functions */
double ceil(double);
double floor(double);
double my_round(double x) {
  if (x >= 0.0)
    return floor(x + 0.5);
  return ceil(x - 0.5);
}


x86 assembly (clang, -O0):
<my_round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     115b <my_round+0x3b>
movsd  0xeb9(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1176 <my_round+0x56>
movsd  -0x10(%rbp),%xmm0
movsd  0xe98(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_round>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    1137 <my_round+0x17>
addsd  0xed6(%rip),%xmm0
jmp    1030 <ceil@plt>
addsd  0xec1(%rip),%xmm0
jmp    1040 <floor@plt>

LLVM IR (-O0):
define double @my_round(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = fadd double %7, 5.000000e-01
%9 = call double @llvm.floor.f64(double %8)
store double %9, double* %2
br label %14
10: ; preds = %1
%11 = load double, double* %3
%12 = fsub double %11, 5.000000e-01
%13 = call double @llvm.ceil.f64(double %12)
store double %13, double* %2
br label %14
14: ; preds = %10, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @my_round(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = fadd double %0, 5.000000e-01
%5 = tail call double @llvm.floor.f64(double %4)
br label %9
6: ; preds = %1
%7 = fadd double %0, -5.000000e-01
%8 = tail call double @llvm.ceil.f64(double %7)
br label %9
9: ; preds = %6, %3
%10 = phi double [ %5, %3 ], [ %8, %6 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i = 0;
  for (; i < 256; i++) {
    printf("%c --> %d\n", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%c --> %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void ikt_rd_init(const char *fname) {
  fatal("ikt"
        ": This build excluded \" MYNAME \" support because expat was not "
        "installed.\n");
}


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

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

LLVM IR (-O0):
@.str = [78 x i8] c"ikt: This build excluded \22 MYNAME \22 support because expat was not installed.\0A\00"
define void @ikt_rd_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @fatal(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [78 x i8] c"ikt: This build excluded \22 MYNAME \22 support because expat was not installed.\0A\00"
define void @ikt_rd_init(i8* nocapture readnone %0) {
%2 = tail call i32 @fatal(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float sin(float);
float BackEaseOut(float p) {
  float f = (1 - p);
  return 1 - (f * f * f - f * sin(f * 3.14159265358979323846));
}


x86 assembly (clang, -O0):
<BackEaseOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sin@plt>
movss  -0x14(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movaps %xmm0,%xmm3
movss  -0xc(%rbp),%xmm0
mulss  %xmm3,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  0xe5d(%rip),%xmm0
subss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BackEaseOut>:
push   %rax
movss  0xee7(%rip),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movaps %xmm1,%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  0xeca(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sin@plt>
movss  (%rsp),%xmm2
mulss  %xmm2,%xmm0
movss  0x4(%rsp),%xmm1
mulss  %xmm2,%xmm1
subss  %xmm0,%xmm1
movss  0xe9a(%rip),%xmm0
subss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @BackEaseOut(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fsub float 1.000000e+00, %4
store float %5, float* %3
%6 = load float, float* %3
%7 = load float, float* %3
%8 = fmul float %6, %7
%9 = load float, float* %3
%10 = load float, float* %3
%11 = load float, float* %3
%12 = fpext float %11 to double
%13 = fmul double %12, 0x400921FB54442D18
%14 = fptrunc double %13 to float
%15 = call float @sin(float %14)
%16 = fmul float %10, %15
%17 = fneg float %16
%18 = call float @llvm.fmuladd.f32(float %8, float %9, float %17)
%19 = fsub float 1.000000e+00, %18
ret float %19
}

LLVM IR (-O2):
define float @BackEaseOut(float %0) {
%2 = fsub float 1.000000e+00, %0
%3 = fmul float %2, %2
%4 = fpext float %2 to double
%5 = fmul double %4, 0x400921FB54442D18
%6 = fptrunc double %5 to float
%7 = tail call float @sin(float %6)
%8 = fneg float %2
%9 = fmul float %7, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %2, float %9)
%11 = fsub float 1.000000e+00, %10
ret float %11
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ test_bitscan(int);
int main() {
  test_bitscan(0x00000000);
  for (uint64_t i = 0, mask = 0x1; i < 64; i++, mask <<= 1) {
    test_bitscan(mask);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <test_bitscan@plt>
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x40,-0x8(%rbp)
jge    115d <main+0x4d>
mov    -0xc(%rbp),%edi
call   1030 <test_bitscan@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <main+0x24>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1030 <test_bitscan@plt>
mov    $0x1,%ebx
mov    $0x40,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%edi
call   1030 <test_bitscan@plt>
add    %ebx,%ebx
add    $0xffffffff,%ebp
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @test_bitscan(i32 0)
store i32 0, i32* %2
store i32 1, i32* %3
br label %5
5: ; preds = %11, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 64
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load i32, i32* %3
%10 = call i32 @test_bitscan(i32 %9)
br label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
%14 = load i32, i32* %3
%15 = shl i32 %14, 1
store i32 %15, i32* %3
br label %5
16: ; preds = %5
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_bitscan(i32 0)
br label %3
2: ; preds = %3
ret i32 0
3: ; preds = %0, %3
%4 = phi i32 [ 1, %0 ], [ %8, %3 ]
%5 = phi i32 [ 0, %0 ], [ %7, %3 ]
%6 = tail call i32 @test_bitscan(i32 %4)
%7 = add nuw nsw i32 %5, 1
%8 = shl i32 %4, 1
%9 = icmp eq i32 %7, 64
br i1 %9, label %2, label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int try_parse_int_imp(char *, void *, int, int);
bool try_parse_int16(char *str, int16_t *value_ptr) {
  return try_parse_int_imp(str, (void *)value_ptr, sizeof(int16_t), true);
}


x86 assembly (clang, -O0):
<try_parse_int16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
mov    $0x1,%ecx
call   1030 <try_parse_int_imp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_parse_int16>:
mov    $0x4,%edx
mov    $0x1,%ecx
jmp    1030 <try_parse_int_imp@plt>

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

LLVM IR (-O2):
define i32 @try_parse_int16(i8* %0, i32* %1) {
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @try_parse_int_imp(i8* %0, i8* %3, i32 4, i32 1)
ret i32 %4
}
int hash_func(const char *str) {
  int r = 0;
  int i;
  for (i = 0; str[i]; ++i) {
    r *= 2;
    r += str[i];
  }
  return r;
}


x86 assembly (clang, -O0):
<hash_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1151 <hash_func+0x51>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <hash_func+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_func>:
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <hash_func+0x22>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rcx,%rax,2),%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_func+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_func(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = shl nsw i32 %7, 1
%9 = sext i8 %6 to i32
%10 = add nsw i32 %8, %9
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %16
}
void halt(void) {
  while (1) {
    asm volatile("hlt");
  }
}


x86 assembly (clang, -O0):
<halt>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <halt+0x9>
hlt
jmp    1109 <halt+0x9>

x86 assembly (clang, -O2):
<halt>:
hlt
jmp    1100 <halt>

LLVM IR (-O0):
define void @halt() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @halt() {
br label %1
1: ; preds = %0, %1
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ ADPCM_close();
void OPL_close(void) { ADPCM_close(); }


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

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

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

LLVM IR (-O2):
define void @OPL_close() {
%1 = tail call i32 (...) @ADPCM_close()
ret void
}
int sort_compare(const void *a, const void *b) {
  if (*((double *)a) < *((double *)b))
    return -1;
  else if (*((double *)a) > *((double *)b))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<sort_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <sort_compare+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <sort_compare+0x5b>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1154 <sort_compare+0x54>
movl   $0x1,-0x4(%rbp)
jmp    115b <sort_compare+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_compare>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sort_compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp olt double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %24
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to double*
%17 = load double, double* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to double*
%20 = load double, double* %19
%21 = fcmp ogt double %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 1, i32* %3
br label %24
23: ; preds = %14
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %13
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @sort_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void INT_Excep_TPU6_TGI6D(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU6_TGI6D() {
ret void
}
extern void initsimd(int enable) {}


x86 assembly (clang, -O0):
<initsimd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @initsimd(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sigint_handler(int signo) {
  printf("Caught SIGINT!\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigint_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [15 x i8] c"Caught SIGINT!\00"
define void @sigint_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ lcd_clear(int);
void s_setup_destroy(void) { lcd_clear(0x000); }


x86 assembly (clang, -O0):
<s_setup_destroy>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <lcd_clear@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_setup_destroy>:
xor    %edi,%edi
jmp    1030 <lcd_clear@plt>

LLVM IR (-O0):
define void @s_setup_destroy() {
%1 = call i32 @lcd_clear(i32 0)
ret void
}

LLVM IR (-O2):
define void @s_setup_destroy() {
%1 = tail call i32 @lcd_clear(i32 0)
ret void
}
int toupper(int c) {
  if ((c >= 'a') && (c <= 'z')) {
    c += 'A' - 'a';
  }
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1124 <toupper+0x24>
cmpl   $0x7a,-0x4(%rbp)
jg     1124 <toupper+0x24>
mov    -0x4(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
void *NEditMalloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *NEditCalloc(size_t nmemb, size_t size) {
  void *ptr = NEditMalloc(nmemb * size);
  memset(ptr, 0, nmemb * size);
  return ptr;
}


x86 assembly (clang, -O0):
<NEditCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1030 <NEditMalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NEditCalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1030 <NEditMalloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @NEditCalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = call i8* @NEditMalloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = mul i64 %11, %12
%14 = call i32 @memset(i8* %10, i32 0, i64 %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @NEditCalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @NEditMalloc(i64 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}