xunge/DecIR huggingface dataset:
int compare_int(const int *a, const int *b) { return *a - *b; }


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

x86 assembly (clang, -O2):
<compare_int>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare_int(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @compare_int(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}
double round(double value) {
  int temp = value * 100;
  return temp / 100.0;
}


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @round(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 1.000000e+02
%6 = fptosi double %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.000000e+02
ret double %9
}

LLVM IR (-O2):
define double @round(double %0) {
%2 = fmul double %0, 1.000000e+02
%3 = fptosi double %2 to i32
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.000000e+02
ret double %5
}
/* Type definitions */
struct shim_linux_dirent64 {
  int dummy;
};

/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, unsigned int,
                       struct shim_linux_dirent64 *, unsigned int);
int shim_getdents64(unsigned int fd, struct shim_linux_dirent64 *dirp,
                    unsigned int count) {
  return (int)shim_enosys(0, fd, dirp, count);
}


x86 assembly (clang, -O0):
<shim_getdents64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_getdents64>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
%struct.shim_linux_dirent64 = type { i32 }
define i32 @shim_getdents64(i32 %0, %struct.shim_linux_dirent64* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.shim_linux_dirent64*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.shim_linux_dirent64* %1, %struct.shim_linux_dirent64** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.shim_linux_dirent64*, %struct.shim_linux_dirent64** %5
%9 = load i32, i32* %6
%10 = call i64 @shim_enosys(i32 0, i32 %7, %struct.shim_linux_dirent64* %8, i32 %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.shim_linux_dirent64 = type { i32 }
define i32 @shim_getdents64(i32 %0, %struct.shim_linux_dirent64* %1, i32 %2) {
%4 = tail call i64 @shim_enosys(i32 0, i32 %0, %struct.shim_linux_dirent64* %1, i32 %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *malloc(int);
extern char *ReturnsAByteArray() {
  char *arr = malloc(3 * sizeof(char));
  arr[0] = 100;
  arr[1] = 90;
  arr[2] = 80;
  return arr;
}


x86 assembly (clang, -O0):
<ReturnsAByteArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x64,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x5a,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x50,0x2(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReturnsAByteArray>:
push   %rax
mov    $0x3,%edi
call   1030 <malloc@plt>
movw   $0x5a64,(%rax)
movb   $0x50,0x2(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @ReturnsAByteArray() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 3)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 100, i8* %4
%5 = load i8*, i8** %1
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 90, i8* %6
%7 = load i8*, i8** %1
%8 = getelementptr inbounds i8, i8* %7, i64 2
store i8 80, i8* %8
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @ReturnsAByteArray() {
%1 = tail call dereferenceable_or_null(3) i8* @malloc(i32 3)
store i8 100, i8* %1
%2 = getelementptr inbounds i8, i8* %1, i64 1
store i8 90, i8* %2
%3 = getelementptr inbounds i8, i8* %1, i64 2
store i8 80, i8* %3
ret i8* %1
}
void chaz_ConfWriterPython_add_local_include(const char *header) {
  (void)header;
}


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

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

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

LLVM IR (-O2):
define void @chaz_ConfWriterPython_add_local_include(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
int /*<<< orphan*/ getresgid(int *, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  uid_t rid;
  uid_t eid;
  uid_t sid;
  getresgid(&rid, &eid, &sid);
  printf("%d %d %d\n", rid, eid, sid);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <getresgid@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1030 <getresgid@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @getresgid(i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret i32 0
}
/* Variables and functions */
int rec2(int);
int rec1(int i) {
  if (i <= 0)
    return 0;
  return rec2(rec1(i + 1));
}


x86 assembly (clang, -O0):
<rec1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1141 <rec1+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1156 <rec1+0x36>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
call   1040 <rec1@plt>
mov    %eax,%edi
call   1030 <rec2@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec1>:
test   %edi,%edi
jle    1135 <rec1+0x15>
push   %rax
add    $0x1,%edi
call   1040 <rec1@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <rec2@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @rec1(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nuw nsw i32 %0, 1
%7 = tail call i32 @rec1(i32 %6)
%8 = tail call i32 @rec2(i32 %7)
br label %3
}
void set_SubCenter(unsigned char *pds, int subcenter) { pds[25] = subcenter; }


x86 assembly (clang, -O0):
<set_SubCenter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x19(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_SubCenter>:
mov    %sil,0x19(%rdi)
ret

LLVM IR (-O0):
define void @set_SubCenter(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = trunc i32 %5 to i8
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 25
store i8 %6, i8* %8
ret void
}

LLVM IR (-O2):
define void @set_SubCenter(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 25
store i8 %3, i8* %4
ret void
}
int main() {
  int i;
  int j;
  int k;
  int l;
  i = 0;
  k = 9;
  j = -100;
  l = 0;
  while (l <= 1000) {
    while (i <= 100) {
      i = i + 1;
      while (j < 20)
        j = i + j;
      k = 4;
      while (k <= 3)
        k = k + 1;
    }
    l = l + j;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x9,-0x10(%rbp)
movl   $0xffffff9c,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jg     1196 <main+0x96>
jmp    1139 <main+0x39>
cmpl   $0x64,-0x8(%rbp)
jg     1188 <main+0x88>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    1164 <main+0x64>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    114c <main+0x4c>
movl   $0x4,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jg     1183 <main+0x83>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    116b <main+0x6b>
jmp    1139 <main+0x39>
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <main+0x27>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
const char *five_english() {
  char *lang = "five";
  return lang;
}


x86 assembly (clang, -O0):
<five_english>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<five_english>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"five\00"
define i8* @five_english() {
%1 = alloca i8*
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [5 x i8] c"five\00"
define i8* @five_english() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ SYS_pivot_root;
int syscall(int /*<<< orphan*/, char const *, char const *);
int pivot_root(const char *new_root, const char *put_old) {
  return syscall(SYS_pivot_root, new_root, put_old);
}


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

x86 assembly (clang, -O2):
<pivot_root>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@SYS_pivot_root = global i32 0
define i32 @pivot_root(i8* %0, i8* %1) {
%3 = load i32, i32* @SYS_pivot_root
%4 = tail call i32 @syscall(i32 %3, i8* %0, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fdi_s25fl116k_wait_while_busy();
int /*<<< orphan*/ fdi_spi_tx1(int, int);
void fdi_s25fl116k_sleep(void) {
  fdi_s25fl116k_wait_while_busy();
  fdi_spi_tx1(23, 0xb9);
}


x86 assembly (clang, -O0):
<fdi_s25fl116k_sleep>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <fdi_s25fl116k_wait_while_busy@plt>
mov    $0x17,%edi
mov    $0xb9,%esi
call   1030 <fdi_spi_tx1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdi_s25fl116k_sleep>:
push   %rax
xor    %eax,%eax
call   1040 <fdi_s25fl116k_wait_while_busy@plt>
mov    $0x17,%edi
mov    $0xb9,%esi
pop    %rax
jmp    1030 <fdi_spi_tx1@plt>

LLVM IR (-O0):
define void @fdi_s25fl116k_sleep() {
%1 = call i32 (...) @fdi_s25fl116k_wait_while_busy()
%2 = call i32 @fdi_spi_tx1(i32 23, i32 185)
ret void
}

LLVM IR (-O2):
define void @fdi_s25fl116k_sleep() {
%1 = tail call i32 (...) @fdi_s25fl116k_wait_while_busy()
%2 = tail call i32 @fdi_spi_tx1(i32 23, i32 185)
ret void
}
int test_imm_2Cint8_reg(signed char val) {
  return ((val) & (0x2C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Cint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x2c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Cint8_reg>:
test   $0x2c,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Cint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 44
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_2Cint8_reg(i8 signext %0) {
%2 = and i8 %0, 44
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bzero(void *, size_t);
void compat_explicit_bzero(void *p, size_t n) { bzero(p, n); }


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

x86 assembly (clang, -O2):
<compat_explicit_bzero>:
jmp    1030 <bzero@plt>

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

LLVM IR (-O2):
define void @compat_explicit_bzero(i8* nocapture writeonly %0, i64 %1) {
%3 = tail call i32 @bzero(i8* %0, i64 %1)
ret void
}
println(s) char *s;
{ printf("%s\n", s); }


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

x86 assembly (clang, -O2):
<println>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define i32 @println(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret i32 undef
}
void cleanup_module(void) { asm("wbinvd;"); }


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

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

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

LLVM IR (-O2):
define void @cleanup_module() {
tail call void asm sideeffect "wbinvd;", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ rpgp_is_space(char);
void rpgp_skip_spaces(char **p) {
  while (rpgp_is_space(**p)) {
    (*p)++;
  }
}


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

x86 assembly (clang, -O2):
<rpgp_skip_spaces>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
movsbl (%rax),%edi
nopw   0x0(%rax,%rax,1)
call   1030 <rpgp_is_space@plt>
test   %rax,%rax
je     113a <rpgp_skip_spaces+0x2a>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
jmp    1120 <rpgp_skip_spaces+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @rpgp_skip_spaces(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = tail call i64 @rpgp_is_space(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1, %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
%9 = load i8, i8* %8
%10 = tail call i64 @rpgp_is_space(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void git__free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<git__free>:
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):
<git__free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @git__free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage() {
  printf("Usage: ring [TOKEN [NTH]]\n");
  printf(" TOKEN is %d by default\n", 20);
  printf(" NTH is %d by default\n", 8);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x14,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
mov    $0x14,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: ring [TOKEN [NTH]]\0A\00"
@.str.1 = [25 x i8] c" TOKEN is %d by default\0A\00"
@.str.2 = [23 x i8] c" NTH is %d by default\0A\00"
define void @usage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 20)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 8)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c" TOKEN is %d by default\0A\00"
@.str.2 = [23 x i8] c" NTH is %d by default\0A\00"
@str = [26 x i8] c"Usage: ring [TOKEN [NTH]]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 20)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 8)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int decending(int num0, int num1) { return num0 > num1 ? 1 : 0; }


x86 assembly (clang, -O0):
<decending>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decending>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @decending(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 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
ret i32 %9
}

LLVM IR (-O2):
define i32 @decending(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int isprint(int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int ls_isprint(int c) {
  int ret;
  setlocale(LC_ALL, "");
  ret = isprint(c);
  setlocale(LC_ALL, "C");
  return ret;
}


x86 assembly (clang, -O0):
<ls_isprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <setlocale@plt>
mov    -0x4(%rbp),%edi
call   1040 <isprint@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1030 <setlocale@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_isprint>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb3(%rip),%r14
mov    (%r14),%edi
lea    0xeca(%rip),%rsi
call   1030 <setlocale@plt>
mov    %ebx,%edi
call   1040 <isprint@plt>
mov    %eax,%ebx
mov    (%r14),%edi
lea    0xeb1(%rip),%rsi
call   1030 <setlocale@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"C\00"
define i32 @ls_isprint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @LC_ALL
%5 = call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @isprint(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* @LC_ALL
%9 = call i32 @setlocale(i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"C\00"
define i32 @ls_isprint(i32 %0) {
%2 = load i32, i32* @LC_ALL
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @isprint(i32 %0)
%5 = load i32, i32* @LC_ALL
%6 = tail call i32 @setlocale(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 %4
}
/* Variables and functions */
int PAPI_set_granularity(int);
void PAPIF_SET_GRANULARITY(int *granularity, int *check) {
  *check = PAPI_set_granularity(*granularity);
}


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

x86 assembly (clang, -O2):
<PAPIF_SET_GRANULARITY>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_set_granularity@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @PAPIF_SET_GRANULARITY(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @PAPI_set_granularity(i32 %3)
store i32 %4, i32* %1
ret void
}
void loadRTM2dConfig() {}


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

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

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

LLVM IR (-O2):
define void @loadRTM2dConfig() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g5_get_forceMC(int, int, double **, double *);
void(g5_get_forceMC_)(int *devid, int *ni, double (*a)[3], double *p) {
  g5_get_forceMC(*devid, *ni, a, p);
}


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

x86 assembly (clang, -O2):
<g5_get_forceMC_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <g5_get_forceMC@plt>

LLVM IR (-O0):
define void @g5_get_forceMC_(i32* %0, i32* %1, [3 x double]* %2, double* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca [3 x double]*
%8 = alloca double*
store i32* %0, i32** %5
store i32* %1, i32** %6
store [3 x double]* %2, [3 x double]** %7
store double* %3, double** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = load [3 x double]*, [3 x double]** %7
%14 = bitcast [3 x double]* %13 to double**
%15 = load double*, double** %8
%16 = call i32 @g5_get_forceMC(i32 %10, i32 %12, double** %14, double* %15)
ret void
}

LLVM IR (-O2):
define void @g5_get_forceMC_(i32* nocapture %0, i32* nocapture %1, [3 x double]* %2, double* %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = bitcast [3 x double]* %2 to double**
%8 = tail call i32 @g5_get_forceMC(i32 %5, i32 %6, double** %7, double* %3)
ret void
}
void scamper_do_sniff_cleanup() { return; }


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

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

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

LLVM IR (-O2):
define void @scamper_do_sniff_cleanup() {
ret void
}
int add_all_digits(int n) {
  int sum_of_all_digits = 0;
  while (n) {
    sum_of_all_digits += n % 10;
    n /= 10;
  }
  return sum_of_all_digits;
}


x86 assembly (clang, -O0):
<add_all_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <add_all_digits+0x3c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <add_all_digits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_all_digits>:
xor    %eax,%eax
test   %edi,%edi
je     113b <add_all_digits+0x3b>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <add_all_digits+0x10>
ret

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

LLVM IR (-O2):
define i32 @add_all_digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = add nsw i32 %4, %6
%8 = sdiv i32 %5, 10
%9 = add i32 %5, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %12
}
int int_size_is_32_for_16bit() {
  int set_msb = 1 << 15;
  set_msb = set_msb << 15;
  set_msb = set_msb << 1;
  int beyond_msb = 1 << 15;
  beyond_msb = beyond_msb << 15;
  beyond_msb = beyond_msb << 2;
  return set_msb && !beyond_msb;
}


x86 assembly (clang, -O0):
<int_size_is_32_for_16bit>:
push   %rbp
mov    %rsp,%rbp
movl   $0x8000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
movl   $0x8000,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xf,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     1151 <int_size_is_32_for_16bit+0x51>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @int_size_is_32_for_16bit() {
%1 = alloca i32
%2 = alloca i32
store i32 32768, i32* %1
%3 = load i32, i32* %1
%4 = shl i32 %3, 15
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = shl i32 %5, 1
store i32 %6, i32* %1
store i32 32768, i32* %2
%7 = load i32, i32* %2
%8 = shl i32 %7, 15
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = shl i32 %9, 2
store i32 %10, i32* %2
%11 = load i32, i32* %1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %0
%14 = load i32, i32* %2
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br label %17
17: ; preds = %13, %0
%18 = phi i1 [ false, %0 ], [ %16, %13 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @int_size_is_32_for_16bit() {
ret i32 1
}
/* Variables and functions */
scalar_t__ snprintf(int /*<<< orphan*/ *, int /*<<< orphan*/, char *, int,
                    float);
int /*<<< orphan*/ sprintf(char *, char *, int, float);
char *xmalloc(scalar_t__);
char *float2str(float d, int width) {
  char *s = xmalloc(snprintf(NULL, 0, "%*.2f", width, d) + 1);
  sprintf(s, "%*.2f", width, d);
  return s;
}


x86 assembly (clang, -O0):
<float2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
movss  -0x4(%rbp),%xmm0
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xeab(%rip),%rdx
call   1030 <snprintf@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%edx
movss  -0x4(%rbp),%xmm0
lea    0xe83(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float2str>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebp
movss  %xmm0,0xc(%rsp)
lea    0xeb9(%rip),%r14
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
mov    %ebp,%ecx
call   1030 <snprintf@plt>
lea    0x1(%rax),%rdi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
movss  0xc(%rsp),%xmm0
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%*.2f\00"
define i8* @float2str(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca i8*
store float %0, float* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load float, float* %3
%8 = call i64 @snprintf(i32* null, i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6, float %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @xmalloc(i64 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i32, i32* %4
%13 = load float, float* %3
%14 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %12, float %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [6 x i8] c"%*.2f\00"
define i8* @float2str(float %0, i32 %1) {
%3 = tail call i64 @snprintf(i32* null, i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1, float %0)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @xmalloc(i64 %4)
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1, float %0)
ret i8* %5
}
void initialize_rtc(void) {}


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

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

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

LLVM IR (-O2):
define void @initialize_rtc() {
ret void
}
int is_dir_exists(const char *pathname) {
  (void)pathname;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @is_dir_exists(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ out_line_count(char const *);
int /*<<< orphan*/ printf(char const *, int);
void out_dec(const char *fmt, int n) {
  printf(fmt, n);
  out_line_count(fmt);
}


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

x86 assembly (clang, -O2):
<out_dec>:
push   %rbx
mov    %rdi,%rbx
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <out_line_count@plt>

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

LLVM IR (-O2):
define void @out_dec(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* %0, i32 %1)
%4 = tail call i32 @out_line_count(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
size_t bytes_to_sc16q11(size_t n_bytes) {
  const size_t sample_size = 2 * sizeof(int16_t);
  assert((n_bytes % sample_size) == 0);
  return n_bytes / sample_size;
}


x86 assembly (clang, -O0):
<bytes_to_sc16q11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x8,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
shr    $0x3,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes_to_sc16q11>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   $0x7,%bl
sete   %dil
call   1030 <assert@plt>
shr    $0x3,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @bytes_to_sc16q11(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 8, i64* %3
%4 = load i64, i64* %2
%5 = urem i64 %4, 8
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i64, i64* %2
%10 = udiv i64 %9, 8
ret i64 %10
}

LLVM IR (-O2):
define i64 @bytes_to_sc16q11(i64 %0) {
%2 = and i64 %0, 7
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = lshr i64 %0, 3
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void ErrFatal(char *msg) { exit(1); }


x86 assembly (clang, -O0):
<ErrFatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<ErrFatal>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @ErrFatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @ErrFatal(i8* nocapture readnone %0) {
%2 = tail call i32 @exit(i32 1)
unreachable
}
float ft_fabs(float f) {
  f = (f < 0 ? -f : f);
  return (f);
}


x86 assembly (clang, -O0):
<ft_fabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1132 <ft_fabs+0x32>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113c <ft_fabs+0x3c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_fabs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @ft_fabs(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
br label %10
8: ; preds = %1
%9 = load float, float* %2
br label %10
10: ; preds = %8, %5
%11 = phi float [ %7, %5 ], [ %9, %8 ]
store float %11, float* %2
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @ft_fabs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello World!\n");
  return 0;
}


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)
lea    0xed3(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int typechange(char ch, char next) {
  if ((ch == ',' && next != ',') || (ch != ',' && next == ','))
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<typechange>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2c,%eax
jne    112a <typechange+0x2a>
movsbl -0x6(%rbp),%eax
cmp    $0x2c,%eax
jne    1144 <typechange+0x44>
movsbl -0x5(%rbp),%eax
cmp    $0x2c,%eax
je     1150 <typechange+0x50>
movsbl -0x6(%rbp),%eax
cmp    $0x2c,%eax
jne    1150 <typechange+0x50>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <typechange+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<typechange>:
cmp    $0x2c,%sil
setne  %al
sete   %sil
cmp    $0x2c,%dil
sete   %dl
setne  %cl
and    %al,%dl
and    %sil,%cl
or     %dl,%cl
movzbl %cl,%eax
neg    %eax
ret

LLVM IR (-O0):
define i32 @typechange(i8 signext %0, i8 signext %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 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 44
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 44
br i1 %12, label %21, label %13
13: ; preds = %9, %2
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 44
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i8, i8* %5
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 44
br i1 %20, label %21, label %22
21: ; preds = %17, %9
store i32 -1, i32* %3
br label %23
22: ; preds = %17, %13
store i32 0, i32* %3
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @typechange(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, 44
%4 = icmp ne i8 %1, 44
%5 = and i1 %3, %4
%6 = icmp ne i8 %0, 44
%7 = icmp eq i8 %1, 44
%8 = and i1 %6, %7
%9 = or i1 %5, %8
%10 = sext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
scalar_t__ strlen(char *);
int get_c_string_len_(char **ptr_ptr) {
  if (*ptr_ptr == NULL)
    return 0;
  return (int)strlen(*ptr_ptr);
}


x86 assembly (clang, -O0):
<get_c_string_len_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1136 <get_c_string_len_+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1145 <get_c_string_len_+0x35>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_c_string_len_>:
push   %rax
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1120 <get_c_string_len_+0x10>
call   1030 <strlen@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @get_c_string_len_(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @strlen(i8* %2)
%6 = trunc i64 %5 to i32
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}
unsigned int f49(unsigned int x, int y) {
  return (x << ((-y) & (8 * 4 - 1))) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f49>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x1f,%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f49>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f49(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 = sub nsw i32 0, %6
%8 = and i32 %7, 31
%9 = shl i32 %5, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = lshr i32 %10, %11
%13 = xor i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @f49(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %1
%4 = and i32 %3, 31
%5 = shl i32 %0, %4
%6 = lshr i32 %0, %1
%7 = xor i32 %5, %6
ret i32 %7
}
/* Variables and functions */
char *place_commas_in_long(long);
char *commas_in_long(long n) { return place_commas_in_long(n); }


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

x86 assembly (clang, -O2):
<commas_in_long>:
jmp    1030 <place_commas_in_long@plt>

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

LLVM IR (-O2):
define i8* @commas_in_long(i64 %0) {
%2 = tail call i8* @place_commas_in_long(i64 %0)
ret i8* %2
}
/* Variables and functions */
int int_cmp(int const *, int const *);
int intptr_cmp(const void *x1, const void *x2) {
  const int *y1 = *(const int **)x1;
  const int *y2 = *(const int **)x2;
  return int_cmp(y1, y2);
}


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

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

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

LLVM IR (-O2):
define i32 @intptr_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32**
%4 = load i32*, i32** %3
%5 = bitcast i8* %1 to i32**
%6 = load i32*, i32** %5
%7 = tail call i32 @int_cmp(i32* %4, i32* %6)
ret i32 %7
}