xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_add_sd(int /*<<< orphan*/, int /*<<< orphan*/);
double _mm_cvtsd_f64(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_unpackhi_pd(int /*<<< orphan*/, int /*<<< orphan*/);
double hadd_pd(__m128d x) {
  return _mm_cvtsd_f64(_mm_add_sd(x, _mm_unpackhi_pd(x, x)));
}


x86 assembly (clang, -O0):
<hadd_pd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <_mm_unpackhi_pd@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <_mm_add_sd@plt>
mov    %eax,%edi
call   1030 <_mm_cvtsd_f64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hadd_pd>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%esi
call   1050 <_mm_unpackhi_pd@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <_mm_add_sd@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <_mm_cvtsd_f64@plt>

LLVM IR (-O0):
define double @hadd_pd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @_mm_unpackhi_pd(i32 %4, i32 %5)
%7 = call i32 @_mm_add_sd(i32 %3, i32 %6)
%8 = call double @_mm_cvtsd_f64(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @hadd_pd(i32 %0) {
%2 = tail call i32 @_mm_unpackhi_pd(i32 %0, i32 %0)
%3 = tail call i32 @_mm_add_sd(i32 %0, i32 %2)
%4 = tail call double @_mm_cvtsd_f64(i32 %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ putc(char);
void putLF() { putc('\n'); }


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

x86 assembly (clang, -O2):
<putLF>:
mov    $0xa,%edi
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @putLF() {
%1 = call i32 @putc(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @putLF() {
%1 = tail call i32 @putc(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ max_apple(int **, int, int);
int /*<<< orphan*/ print_path(int, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int a[3][4] = {{4, 3, 7, 6}, {5, 2, 4, 3}, {3, 7, 2, 5}};
  max_apple(a, 3, 4);
  print_path(3, 4);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x30,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x3,%esi
mov    $0x4,%edx
call   1030 <max_apple@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1060 <print_path@plt>
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
mov    $0x4,%edx
call   1040 <max_apple@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1050 <print_path@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [3 x [4 x i32]] [[4 x i32] [i32 4, i32 3, i32 7, i32 6], [4 x i32] [i32 5, i32 2, i32 4, i32 3], [4 x i32] [i32 3, i32 7, i32 2, i32 5]]
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca [3 x [4 x i32]]
%2 = bitcast [3 x [4 x i32]]* %1 to i8*
%3 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i64 0, i64 0
%4 = bitcast [4 x i32]* %3 to i32**
%5 = call i32 @max_apple(i32** %4, i32 3, i32 4)
%6 = call i32 @print_path(i32 3, i32 4)
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [3 x [4 x i32]] [[4 x i32] [i32 4, i32 3, i32 7, i32 6], [4 x i32] [i32 5, i32 2, i32 4, i32 3], [4 x i32] [i32 3, i32 7, i32 2, i32 5]]
define i32 @main() {
%1 = alloca [3 x [4 x i32]]
%2 = bitcast [3 x [4 x i32]]* %1 to i8*
%3 = bitcast [3 x [4 x i32]]* %1 to i32**
%4 = call i32 @max_apple(i32** %3, i32 3, i32 4)
%5 = call i32 @print_path(i32 3, i32 4)
%6 = call i32 @putchar(i32 10)
ret i32 0
}
void ADCDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000008))) &= ~0x00000001;
}


x86 assembly (clang, -O0):
<ADCDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCDisable>:
andq   $0xfffffffffffffffe,0x8(%rdi)
ret

LLVM IR (-O0):
define void @ADCDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -2
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @ADCDisable(i64 %0) {
%2 = add i64 %0, 8
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -2
store volatile i64 %5, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_unpack_prim_8_le(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void ivory_serialize_unpack_uint64_le(const uint8_t *src, uint32_t offs,
                                      uint64_t *dst) {
  uint64_t tmp = ivory_serialize_unpack_prim_8_le(src + offs);
  memcpy(dst, &tmp, sizeof(*dst));
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_uint64_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <ivory_serialize_unpack_prim_8_le@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_unpack_uint64_le>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
call   1030 <ivory_serialize_unpack_prim_8_le@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @ivory_serialize_unpack_uint64_le(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = call i32 @ivory_serialize_unpack_prim_8_le(i32* %11)
store i32 %12, i32* %7
%13 = load i32*, i32** %6
%14 = call i32 @memcpy(i32* %13, i32* %7, i32 4)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_unpack_uint64_le(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = tail call i32 @ivory_serialize_unpack_prim_8_le(i32* %7)
store i32 %8, i32* %4
%9 = call i32 @memcpy(i32* %2, i32* %4, i32 4)
ret void
}
int _execve(char *name, char **argv, char **env) { return -1; }


x86 assembly (clang, -O0):
<_execve>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_execve(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @_execve(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int INT_MAX;
void kill_cpu() {
  int i, j, k;
  int m = 1;
  for (i = 1; i < 1000; i++) {
    for (j = 1; j < 1000; j++) {
      for (k = 1; k < 1000; k++) {
        m *= i;
        if (m <= INT_MAX)
          m = 1;
      }
    }
  }
}


x86 assembly (clang, -O0):
<kill_cpu>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0x3e8,-0x4(%rbp)
jge    11a3 <kill_cpu+0xa3>
movl   $0x1,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1190 <kill_cpu+0x90>
movl   $0x1,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    117d <kill_cpu+0x7d>
mov    -0x4(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%eax
jg     116a <kill_cpu+0x6a>
movl   $0x1,-0x10(%rbp)
jmp    116f <kill_cpu+0x6f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <kill_cpu+0x3a>
jmp    1182 <kill_cpu+0x82>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <kill_cpu+0x26>
jmp    1195 <kill_cpu+0x95>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <kill_cpu+0x12>
pop    %rbp
ret

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

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

LLVM IR (-O2):
@INT_MAX = global i32 0
define void @kill_cpu() {
ret void
}
/* Type definitions */
typedef int useconds_t;
struct timespec {
  int tv_nsec;
  int tv_sec;
};

/* Variables and functions */
int _nanosleep(struct timespec *, int /*<<< orphan*/ *);
int __usleep(useconds_t useconds) {
  struct timespec time_to_sleep;
  time_to_sleep.tv_nsec = (useconds % 1000000) * 1000;
  time_to_sleep.tv_sec = useconds / 1000000;
  return (_nanosleep(&time_to_sleep, NULL));
}


x86 assembly (clang, -O0):
<__usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%edx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <_nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__usleep>:
push   %rax
movslq %edi,%rax
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
imul   $0xf4240,%ecx,%edx
sub    %edx,%eax
imul   $0x3e8,%eax,%eax
mov    %eax,(%rsp)
mov    %ecx,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <_nanosleep@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @__usleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 1000000
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %6, i32* %7
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @_nanosleep(%struct.timespec* %3, i32* null)
ret i32 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @__usleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = srem i32 %0, 1000000
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %5, i32* %6
%7 = sdiv i32 %0, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @_nanosleep(%struct.timespec* %2, i32* null)
ret i32 %9
}
/* Variables and functions */
double mus_T_fix(double, double);
double mus_(double s __attribute__((unused)), double alpha) {
  return mus_T_fix(s, alpha);
}


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

x86 assembly (clang, -O2):
<mus_>:
jmp    1030 <mus_T_fix@plt>

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

LLVM IR (-O2):
define double @mus_(double %0, double %1) {
%3 = tail call double @mus_T_fix(double %0, double %1)
ret double %3
}
/* Type definitions */
struct trans {
  int dummy;
};

/* Variables and functions */
int g_tcp_can_recv(int, int);
int trans_tcp_can_recv(struct trans *self, int sck, int millis) {
  return g_tcp_can_recv(sck, millis);
}


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

x86 assembly (clang, -O2):
<trans_tcp_can_recv>:
mov    %esi,%edi
mov    %edx,%esi
jmp    1030 <g_tcp_can_recv@plt>

LLVM IR (-O0):
%struct.trans = type { i32 }
define i32 @trans_tcp_can_recv(%struct.trans* %0, i32 %1, i32 %2) {
%4 = alloca %struct.trans*
%5 = alloca i32
%6 = alloca i32
store %struct.trans* %0, %struct.trans** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = call i32 @g_tcp_can_recv(i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.trans = type { i32 }
define i32 @trans_tcp_can_recv(%struct.trans* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @g_tcp_can_recv(i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int main() {
  f(0, 0, 1, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %esi,%esi
mov    $0x1,%ecx
mov    %esi,%edi
mov    %ecx,%edx
call   1030 <f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 0, i32 0, i32 1, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 0, i32 0, i32 1, i32 1)
ret i32 0
}
/* Variables and functions */
float ss2qss();
float ss2qss_(void) { return ss2qss(); }


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

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

LLVM IR (-O0):
define float @ss2qss_() {
%1 = call float (...) @ss2qss()
ret float %1
}

LLVM IR (-O2):
define float @ss2qss_() {
%1 = tail call float (...) @ss2qss()
ret float %1
}
/* Variables and functions */
int rlreplyt(char *, char *, int, char, int /*<<< orphan*/);
int rlreply(char *prompt, char *buf, int nbuf) {
  return (rlreplyt(prompt, buf, nbuf, '\n', 0));
}


x86 assembly (clang, -O0):
<rlreply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0xa,%ecx
xor    %r8d,%r8d
call   1030 <rlreplyt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rlreply>:
mov    $0xa,%ecx
xor    %r8d,%r8d
jmp    1030 <rlreplyt@plt>

LLVM IR (-O0):
define i32 @rlreply(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @rlreplyt(i8* %7, i8* %8, i32 %9, i8 signext 10, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @rlreply(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @rlreplyt(i8* %0, i8* %1, i32 %2, i8 signext 10, i32 0)
ret i32 %4
}
/* Type definitions */
struct mg_request_info {
  int dummy;
};

/* Variables and functions */
int bool_query_param_def(struct mg_request_info const *, char const *, int);
bool bool_query_param(const struct mg_request_info *request_info,
                      const char *param) {
  return bool_query_param_def(request_info, param, false);
}


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

x86 assembly (clang, -O2):
<bool_query_param>:
xor    %edx,%edx
jmp    1030 <bool_query_param_def@plt>

LLVM IR (-O0):
%struct.mg_request_info = type { i32 }
define i32 @bool_query_param(%struct.mg_request_info* %0, i8* %1) {
%3 = alloca %struct.mg_request_info*
%4 = alloca i8*
store %struct.mg_request_info* %0, %struct.mg_request_info** %3
store i8* %1, i8** %4
%5 = load %struct.mg_request_info*, %struct.mg_request_info** %3
%6 = load i8*, i8** %4
%7 = call i32 @bool_query_param_def(%struct.mg_request_info* %5, i8* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.mg_request_info = type { i32 }
define i32 @bool_query_param(%struct.mg_request_info* %0, i8* %1) {
%3 = tail call i32 @bool_query_param_def(%struct.mg_request_info* %0, i8* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bye() { printf("Bye\n"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"Bye\0A\00"
define void @bye() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"Bye\00"
define void @bye() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int av_log2(int);
__attribute__((const)) int av_ceil_log2(int x) { return av_log2((x - 1) << 1); }


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

x86 assembly (clang, -O2):
<av_ceil_log2>:
add    %edi,%edi
add    $0xfffffffe,%edi
jmp    1030 <av_log2@plt>

LLVM IR (-O0):
define i32 @av_ceil_log2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = shl i32 %4, 1
%6 = call i32 @av_log2(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @av_ceil_log2(i32 %0) {
%2 = shl i32 %0, 1
%3 = add i32 %2, -2
%4 = tail call i32 @av_log2(i32 %3)
ret i32 %4
}
void quaternion_copy(float out[4], const float src[4]) {
  out[0] = src[0];
  out[1] = src[1];
  out[2] = src[2];
  out[3] = src[3];
}


x86 assembly (clang, -O0):
<quaternion_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<quaternion_copy>:
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
movss  0xc(%rsi),%xmm0
movss  %xmm0,0xc(%rdi)
ret

LLVM IR (-O0):
define void @quaternion_copy(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %3
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float*, float** %4
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = load float*, float** %3
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = load float*, float** %3
%19 = getelementptr inbounds float, float* %18, i64 2
store float %17, float* %19
%20 = load float*, float** %4
%21 = getelementptr inbounds float, float* %20, i64 3
%22 = load float, float* %21
%23 = load float*, float** %3
%24 = getelementptr inbounds float, float* %23, i64 3
store float %22, float* %24
ret void
}

LLVM IR (-O2):
define void @quaternion_copy(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %0, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %1, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %0, i64 2
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 3
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %0, i64 3
store float %11, float* %12
ret void
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
unsigned int cnttrailzeros(uint64_t size, uint64_t src) {
  uint64_t i;
  for (i = 0; i < size; i++) {
    if (src & (1ull << i))
      return (unsigned int)i;
  }
  return (unsigned int)size;
}


x86 assembly (clang, -O0):
<cnttrailzeros>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1164 <cnttrailzeros+0x64>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     114e <cnttrailzeros+0x4e>
mov    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    116b <cnttrailzeros+0x6b>
jmp    1153 <cnttrailzeros+0x53>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1114 <cnttrailzeros+0x14>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cnttrailzeros>:
xor    %eax,%eax
test   %rdi,%rdi
je     1122 <cnttrailzeros+0x22>
nopw   0x0(%rax,%rax,1)
bt     %rax,%rsi
jb     1122 <cnttrailzeros+0x22>
add    $0x1,%rax
cmp    %rax,%rdi
jne    1110 <cnttrailzeros+0x10>
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32 @cnttrailzeros(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = shl nuw i64 1, %5
%7 = and i64 %6, %1
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %0
br i1 %11, label %12, label %4
12: ; preds = %4, %9, %2
%13 = phi i64 [ 0, %2 ], [ %0, %9 ], [ %5, %4 ]
%14 = trunc i64 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ tailcall(int);
int main(void) {
  tailcall(1);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @tailcall(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @tailcall(i32 1)
ret i32 0
}
/* Variables and functions */
char **stb_tokens_raw(char *, char *, int *, int /*<<< orphan*/, int,
                      int /*<<< orphan*/, int /*<<< orphan*/);
char **stb_tokens_allowempty(char *src, char *delimit, int *count) {
  return stb_tokens_raw(src, delimit, count, 0, 1, 0, 0);
}


x86 assembly (clang, -O0):
<stb_tokens_allowempty>:
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
xor    %r9d,%r9d
mov    $0x1,%r8d
mov    %r9d,%ecx
movl   $0x0,(%rsp)
call   1030 <stb_tokens_raw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_tokens_allowempty>:
push   %rax
movl   $0x0,(%rsp)
xor    %ecx,%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <stb_tokens_raw@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8** @stb_tokens_allowempty(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32*, i32** %6
%10 = call i8** @stb_tokens_raw(i8* %7, i8* %8, i32* %9, i32 0, i32 1, i32 0, i32 0)
ret i8** %10
}

LLVM IR (-O2):
define i8** @stb_tokens_allowempty(i8* %0, i8* %1, i32* %2) {
%4 = tail call i8** @stb_tokens_raw(i8* %0, i8* %1, i32* %2, i32 0, i32 1, i32 0, i32 0)
ret i8** %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int get_CPSR();
int /*<<< orphan*/ set_CPSR_c(int);
uint32_t disable_interrupts(void) {
  uint32_t temp;
  temp = get_CPSR();
  set_CPSR_c(temp | 0x80);
  return temp;
}


x86 assembly (clang, -O0):
<disable_interrupts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_CPSR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
or     $0x80,%edi
call   1040 <set_CPSR_c@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_interrupts>:
push   %rbx
xor    %eax,%eax
call   1030 <get_CPSR@plt>
mov    %eax,%ebx
mov    %eax,%edi
or     $0x80,%edi
call   1040 <set_CPSR_c@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @disable_interrupts() {
%1 = alloca i32
%2 = call i32 (...) @get_CPSR()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 128
%5 = call i32 @set_CPSR_c(i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @disable_interrupts() {
%1 = tail call i32 (...) @get_CPSR()
%2 = or i32 %1, 128
%3 = tail call i32 @set_CPSR_c(i32 %2)
ret i32 %1
}
void hrtimer_forward(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<hrtimer_forward>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hrtimer_forward>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.hrtimer_forward = [16 x i8] c"hrtimer_forward\00"
define void @hrtimer_forward() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.hrtimer_forward, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.hrtimer_forward = [16 x i8] c"hrtimer_forward\00"
define void @hrtimer_forward() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.hrtimer_forward, i64 0, i64 0))
ret void
}
int strSize(char *str) {
  int i;
  for (i = 0; str[i] != '\0'; ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <strSize+0x37>
jmp    1129 <strSize+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strSize+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strSize>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strSize+0x10>
ret

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

LLVM IR (-O2):
define i32 @strSize(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ strnvis(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int main() { strnvis(0, 0, 0, 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <strnvis@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <strnvis@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @strnvis(i32 0, i32 0, i32 0, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @strnvis(i32 0, i32 0, i32 0, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_double_put(double *dest, const double *src, size_t len,
                             int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_double_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_double_put(double* %0, double* %1, i64 %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i64
%8 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_double_put(double* nocapture readnone %0, double* nocapture readnone %1, i64 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int __attribute__((target("avx"))) changed_to_mv(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @changed_to_mv() {
ret i32 0
}
/* Variables and functions */
int read(int, char *, unsigned int);
int buffer_unixread(int fd, char *buf, unsigned int len) {
  return read(fd, buf, len);
}


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

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

LLVM IR (-O0):
define i32 @buffer_unixread(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @read(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @buffer_unixread(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
void statCreateColumnBatch(void) {}


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

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

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

LLVM IR (-O2):
define void @statCreateColumnBatch() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint32_t sancus_u32zd(ssize_t v) {
  assert((v >= 0) && (v <= 0xffffffff));
  return (uint32_t)v;
}


x86 assembly (clang, -O0):
<sancus_u32zd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1134 <sancus_u32zd+0x24>
cmpl   $0xffffffff,-0x4(%rbp)
setbe  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_u32zd>:
push   %rbx
mov    %edi,%ebx
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sancus_u32zd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ule i32 %6, -1
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @sancus_u32zd(i32 returned %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
ret i32 %0
}
long long llabs(long long a) { return a > 0 ? a : -a; }


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1120 <llabs+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <llabs+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @llabs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i64, i64* %2
br label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = sub nsw i64 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i64 [ %6, %5 ], [ %9, %7 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int chown(char const *, int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((__weak__, __always___)) int
softboundcets_chown(const char *path, uid_t owner, gid_t group) {
  return chown(path, owner, group);
}


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

x86 assembly (clang, -O2):
<softboundcets_chown>:
jmp    1030 <chown@plt>

LLVM IR (-O0):
define weak i32 @softboundcets_chown(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @chown(i8* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define weak i32 @softboundcets_chown(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @chown(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XSelectionClearEvent;

/* Variables and functions */
int get_XSelectionClearEvent_type(void *_p) {
  return (int)((XSelectionClearEvent *)_p)->type;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XSelectionClearEvent_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XSelectionClearEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *__libc_realloc(void *, size_t);
void *realloc(void *p, size_t n) { return __libc_realloc(p, n); }


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

x86 assembly (clang, -O2):
<realloc>:
jmp    1030 <__libc_realloc@plt>

LLVM IR (-O0):
define i8* @realloc(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 i8* @__libc_realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @realloc(i8* %0, i64 %1) {
%3 = tail call i8* @__libc_realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
void *malloc(size_t);
void *tpm_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<tpm_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @tpm_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int ece391_open(char const *);
int open(const char *name, int flags, ...) { return ece391_open(name); }


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

x86 assembly (clang, -O2):
<open>:
jmp    1030 <ece391_open@plt>

LLVM IR (-O0):
define i32 @open(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 = call i32 @ece391_open(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @open(i8* %0, i32 %1, ...) {
%3 = tail call i32 @ece391_open(i8* %0)
ret i32 %3
}
int isgraph(int c) { return (unsigned)c - 0x21 < 0x5e; }


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x21,%eax
cmp    $0x5e,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isgraph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 33
%5 = icmp ult i32 %4, 94
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pi(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int num;
  printf("Informe o número: ");
  scanf("%d", &num);
  printf("O resultado é %.10lf\n", pi(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <pi@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"Informe o n\C3\BAmero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"O resultado \C3\A9 %.10lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @pi(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Informe o n\C3\BAmero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"O resultado \C3\A9 %.10lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @pi(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int mkfifo(char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ remove(char *);
void make_fifo(char *filename) {
  remove(filename);
  int res = mkfifo(filename, 0666);
  if (res < 0) {
    perror("mkfifo create error");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<make_fifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1b6,%esi
call   1040 <mkfifo@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1186 <make_fifo+0x46>
lea    0xe89(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_fifo>:
push   %rbx
mov    %rdi,%rbx
call   1030 <remove@plt>
mov    %rbx,%rdi
mov    $0x1b6,%esi
call   1040 <mkfifo@plt>
test   %eax,%eax
js     115c <make_fifo+0x1c>
pop    %rbx
ret
lea    0xe9d(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"mkfifo create error\00"
define void @make_fifo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @remove(i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @mkfifo(i8* %6, i32 438)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"mkfifo create error\00"
define void @make_fifo(i8* %0) {
%2 = tail call i32 @remove(i8* %0)
%3 = tail call i32 @mkfifo(i8* %0, i32 438)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
void PrintFactPNConstant2(void *theEnv, const char *logicalName,
                          void *theValue) {}


x86 assembly (clang, -O0):
<PrintFactPNConstant2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @PrintFactPNConstant2(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @PrintFactPNConstant2(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
void msleep(unsigned char milisec) {}


x86 assembly (clang, -O0):
<msleep>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @msleep(i8 zeroext %0) {
ret void
}
float Section3Area(float *radius) { return (*radius) * (*radius) * 3.141592; }


x86 assembly (clang, -O0):
<Section3Area>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedc(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section3Area>:
movss  (%rdi),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeec(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @Section3Area(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = load float*, float** %2
%6 = load float, float* %5
%7 = fmul float %4, %6
%8 = fpext float %7 to double
%9 = fmul double %8, 0x400921FAFC8B007A
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @Section3Area(float* nocapture %0) {
%2 = load float, float* %0
%3 = fmul float %2, %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x400921FAFC8B007A
%6 = fptrunc double %5 to float
ret float %6
}