xunge/DecIR huggingface dataset:
double obliquity_dot(double tdt) {
  double T;
  double odot;
  T = (tdt - (2451545.0)) / (36525.0);
  odot = -46.8150 + 2 * (T * (-0.00059 + 3 * (T * 0.001813)));
  odot = (((((odot) / 3600.0)) * ((3.14159265358979323846) / 180.0)));
  return (odot);
}


x86 assembly (clang, -O0):
<obliquity_dot>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xf22(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xf0e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xef0(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xed3(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xecf(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
movsd  0xeab(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe8d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe79(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obliquity_dot>:
addsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xef4(%rip),%xmm1
addsd  0xef4(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
addsd  0xeec(%rip),%xmm0
divsd  0xeec(%rip),%xmm0
mulsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @obliquity_dot(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fsub double %5, 0x4142B42C80000000
%7 = fdiv double %6, 3.652500e+04
store double %7, double* %3
%8 = load double, double* %3
%9 = load double, double* %3
%10 = fmul double %9, 1.813000e-03
%11 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %10, double -5.900000e-04)
%12 = fmul double %8, %11
%13 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %12, double -4.681500e+01)
store double %13, double* %4
%14 = load double, double* %4
%15 = fdiv double %14, 3.600000e+03
%16 = fmul double %15, 0x3F91DF46A2529D39
store double %16, double* %4
%17 = load double, double* %4
ret double %17
}

LLVM IR (-O2):
define double @obliquity_dot(double %0) {
%2 = fadd double %0, 0xC142B42C80000000
%3 = fdiv double %2, 3.652500e+04
%4 = fmul double %3, 1.813000e-03
%5 = tail call double @llvm.fmuladd.f64(double %4, double 3.000000e+00, double -5.900000e-04)
%6 = fmul double %3, %5
%7 = tail call double @llvm.fmuladd.f64(double %6, double 2.000000e+00, double -4.681500e+01)
%8 = fdiv double %7, 3.600000e+03
%9 = fmul double %8, 0x3F91DF46A2529D39
ret double %9
}
int sgs_gethex(char c) {
  return ((c) >= '0' && (c) <= '9')
             ? ((c) - '0')
             : (((c) >= 'a' && (c) <= 'f') ? ((c) - 'a' + 10)
                                           : ((c) - 'A' + 10));
}


x86 assembly (clang, -O0):
<sgs_gethex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <sgs_gethex+0x33>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <sgs_gethex+0x33>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1172 <sgs_gethex+0x72>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     115f <sgs_gethex+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x66,%eax
jg     115f <sgs_gethex+0x5f>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
jmp    116c <sgs_gethex+0x6c>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgs_gethex>:
lea    -0x30(%rdi),%eax
lea    -0x61(%rdi),%ecx
xor    %edx,%edx
cmp    $0x6,%cl
setae  %dl
shl    $0x5,%edx
add    $0xffffffa9,%edx
cmp    $0xa,%al
mov    $0xffffffd0,%eax
cmovae %edx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @sgs_gethex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 48
br label %34
14: ; preds = %6, %1
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 97
br i1 %17, label %18, label %27
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sle i32 %20, 102
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = sub nsw i32 %24, 97
%26 = add nsw i32 %25, 10
br label %32
27: ; preds = %18, %14
%28 = load i8, i8* %2
%29 = sext i8 %28 to i32
%30 = sub nsw i32 %29, 65
%31 = add nsw i32 %30, 10
br label %32
32: ; preds = %27, %22
%33 = phi i32 [ %26, %22 ], [ %31, %27 ]
br label %34
34: ; preds = %32, %10
%35 = phi i32 [ %13, %10 ], [ %33, %32 ]
ret i32 %35
}

LLVM IR (-O2):
define i32 @sgs_gethex(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = add i8 %0, -97
%6 = icmp ult i8 %5, 6
%7 = select i1 %6, i32 -87, i32 -55
%8 = select i1 %4, i32 -48, i32 %7
%9 = add nsw i32 %8, %2
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ GLUT_CURSOR_INHERIT;
int /*<<< orphan*/ GLUT_CURSOR_NONE;
int /*<<< orphan*/ glutSetCursor(int /*<<< orphan*/);
void set_cursor(int on) {
  if (on) {
    glutSetCursor(GLUT_CURSOR_INHERIT);
  } else {
    glutSetCursor(GLUT_CURSOR_NONE);
  }
}


x86 assembly (clang, -O0):
<set_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1138 <set_cursor+0x28>
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
call   1030 <glutSetCursor@plt>
jmp    1146 <set_cursor+0x36>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1030 <glutSetCursor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cursor>:
test   %edi,%edi
jne    1122 <set_cursor+0x12>
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
jmp    1030 <glutSetCursor@plt>
mov    0x2ecf(%rip),%rax
mov    (%rax),%edi
jmp    1030 <glutSetCursor@plt>

LLVM IR (-O0):
@GLUT_CURSOR_INHERIT = global i32 0
@GLUT_CURSOR_NONE = global i32 0
define void @set_cursor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @GLUT_CURSOR_INHERIT
%7 = call i32 @glutSetCursor(i32 %6)
br label %11
8: ; preds = %1
%9 = load i32, i32* @GLUT_CURSOR_NONE
%10 = call i32 @glutSetCursor(i32 %9)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@GLUT_CURSOR_INHERIT = global i32 0
@GLUT_CURSOR_NONE = global i32 0
define void @set_cursor(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @GLUT_CURSOR_NONE
%4 = load i32, i32* @GLUT_CURSOR_INHERIT
%5 = select i1 %2, i32 %3, i32 %4
%6 = tail call i32 @glutSetCursor(i32 %5)
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
void bye(void) { printf("[%d] that was all, folks~\n", getpid()); }


x86 assembly (clang, -O0):
<bye>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bye>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"[%d] that was all, folks~\0A\00"
define void @bye() {
%1 = call i32 (...) @getpid()
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"[%d] that was all, folks~\0A\00"
define void @bye() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
void getArray(FILE *in, int array[], int len) {
  for (int i = 0; i < len; i++) {
    fscanf(in, "%d", &array[i]);
  }
}


x86 assembly (clang, -O0):
<getArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1163 <getArray+0x53>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fscanf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <getArray+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1148 <getArray+0x38>
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %edx,%r12d
lea    0xed4(%rip),%r15
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <fscanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r12
jne    1130 <getArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @getArray(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
store i32 0, i32* %7
br label %8
8: ; preds = %19, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i32*, i32** %5
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = call i32 @fscanf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
store i32 %21, i32* %7
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @getArray(i32* nocapture %0, i32* %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %12, %8 ]
%10 = getelementptr inbounds i32, i32* %1, i64 %9
%11 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %10)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %7, label %8
}
/* Variables and functions */
void init(void *p) { p = NULL; }


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

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

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

LLVM IR (-O2):
define void @init(i8* nocapture %0) {
ret void
}
void __sigerr(int sig) {
  (void)sig;
  return;
}


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

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

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

LLVM IR (-O2):
define void @__sigerr(i32 %0) {
ret void
}
void b43legacy_leds_init(struct b43legacy_wldev *dev) {}


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

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

LLVM IR (-O0):
%struct.b43legacy_wldev = type opaque
define void @b43legacy_leds_init(%struct.b43legacy_wldev* %0) {
%2 = alloca %struct.b43legacy_wldev*
store %struct.b43legacy_wldev* %0, %struct.b43legacy_wldev** %2
ret void
}

LLVM IR (-O2):
%struct.b43legacy_wldev = type opaque
define void @b43legacy_leds_init(%struct.b43legacy_wldev* nocapture %0) {
ret void
}
/* Variables and functions */
int read(int /*<<< orphan*/, char *, int);
int get_next_data(char *data, int size) { return read(0, data, size); }


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

x86 assembly (clang, -O2):
<get_next_data>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <read@plt>

LLVM IR (-O0):
define i32 @get_next_data(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 @read(i32 0, i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_next_data(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @read(i32 0, i8* %0, i32 %1)
ret i32 %3
}
int main(int argc, char *argv[]) {
  __attribute__((vector_size((8) * sizeof(short)))) short v0 = {argc, 1, 2, 3,
                                                                4,    5, 6, 7};
  __attribute__((vector_size((8) * sizeof(short)))) short r1;
  r1 = v0 >> (__attribute__((vector_size((8) * sizeof(short)))) short){
                 2, 2, 2, 2, 2, 2, 2, 2};
  return (*((short *)&(r1) + 0));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movaps 0xee7(%rip),%xmm0
mov    -0x8(%rbp),%eax
pinsrw $0x0,%eax,%xmm0
movaps %xmm0,-0x20(%rbp)
movaps -0x20(%rbp),%xmm0
movaps 0xee0(%rip),%xmm1
movaps %xmm1,-0x40(%rbp)
movaps -0x40(%rbp),%xmm2
psllw  $0xc,%xmm2
movaps %xmm2,%xmm3
psraw  $0xf,%xmm3
movaps %xmm3,%xmm1
pandn  %xmm0,%xmm1
psraw  $0x8,%xmm0
pand   %xmm3,%xmm0
por    %xmm1,%xmm0
paddw  %xmm2,%xmm2
movaps %xmm2,%xmm3
psraw  $0xf,%xmm3
movaps %xmm3,%xmm1
pandn  %xmm0,%xmm1
psraw  $0x4,%xmm0
pand   %xmm3,%xmm0
por    %xmm1,%xmm0
paddw  %xmm2,%xmm2
movaps %xmm2,%xmm3
psraw  $0xf,%xmm3
movaps %xmm3,%xmm1
pandn  %xmm0,%xmm1
psraw  $0x2,%xmm0
pand   %xmm3,%xmm0
por    %xmm1,%xmm0
paddw  %xmm2,%xmm2
psraw  $0xf,%xmm2
movaps %xmm2,%xmm1
pandn  %xmm0,%xmm1
psraw  $0x1,%xmm0
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
movdqa %xmm0,-0x30(%rbp)
movswl -0x30(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movswl %di,%eax
sar    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca <8 x i16>
%7 = alloca <8 x i16>
%8 = alloca <8 x i16>
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = trunc i32 %9 to i16
%11 = insertelement <8 x i16> undef, i16 %10, i32 0
%12 = insertelement <8 x i16> %11, i16 1, i32 1
%13 = insertelement <8 x i16> %12, i16 2, i32 2
%14 = insertelement <8 x i16> %13, i16 3, i32 3
%15 = insertelement <8 x i16> %14, i16 4, i32 4
%16 = insertelement <8 x i16> %15, i16 5, i32 5
%17 = insertelement <8 x i16> %16, i16 6, i32 6
%18 = insertelement <8 x i16> %17, i16 7, i32 7
store <8 x i16> %18, <8 x i16>* %6
%19 = load <8 x i16>, <8 x i16>* %6
store <8 x i16> <i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2>, <8 x i16>* %8
%20 = load <8 x i16>, <8 x i16>* %8
%21 = ashr <8 x i16> %19, %20
store <8 x i16> %21, <8 x i16>* %7
%22 = bitcast <8 x i16>* %7 to i16*
%23 = getelementptr inbounds i16, i16* %22, i64 0
%24 = load i16, i16* %23
%25 = sext i16 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = trunc i32 %0 to i16
%4 = ashr i16 %3, 2
%5 = sext i16 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ isalpha(int);
scalar_t__ isprint(int);
int /*<<< orphan*/ isspace(int);
int ispunct(int c) { return isprint(c) && !isalpha(c) && !isspace(c); }


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <isprint@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1180 <ispunct+0x50>
mov    -0x4(%rbp),%edi
call   1040 <isalpha@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1180 <ispunct+0x50>
mov    -0x4(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1050 <isprint@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     115a <ispunct+0x2a>
mov    %ebp,%edi
call   1040 <isalpha@plt>
test   %eax,%eax
jne    115a <ispunct+0x2a>
mov    %ebp,%edi
call   1030 <isspace@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = tail call i64 @isprint(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i32 @isalpha(i32 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 @isspace(i32 %0)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %10, %7 ]
ret i32 %12
}
int lzst0_log255(int v) {
  int i, j;
  i = 0;
  j = v;
  while (j >= 255) {
    i++;
    j -= 255;
  }
  return (i);
}


x86 assembly (clang, -O0):
<lzst0_log255>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xff,-0xc(%rbp)
jl     113a <lzst0_log255+0x3a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0xff,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <lzst0_log255+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lzst0_log255>:
xor    %eax,%eax
cmp    $0xff,%edi
jl     1133 <lzst0_log255+0x33>
cmp    $0x1fd,%edi
mov    $0x1fd,%eax
cmovl  %edi,%eax
neg    %eax
lea    (%rdi,%rax,1),%ecx
add    $0xfe,%ecx
mov    $0x80808081,%eax
imul   %rcx,%rax
shr    $0x27,%rax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @lzst0_log255(i32 %0) {
%2 = icmp sgt i32 %0, 254
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = add nuw i32 %0, 254
%5 = call i32 @llvm.smin.i32(i32 %0, i32 509)
%6 = sub nuw i32 %4, %5
%7 = udiv i32 %6, 255
%8 = add nuw nsw i32 %7, 1
br label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int main() {
  setuid(0);
  system("/home/maberyick/Dropbox/Self-Research_EEG/EpocArmVisual/main.sh");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <setuid@plt>
lea    0xec3(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <setuid@plt>
lea    0xed1(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [64 x i8] c"/home/maberyick/Dropbox/Self-Research_EEG/EpocArmVisual/main.sh\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @setuid(i32 0)
%3 = call i32 @system(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [64 x i8] c"/home/maberyick/Dropbox/Self-Research_EEG/EpocArmVisual/main.sh\00"
define i32 @main() {
%1 = tail call i32 @setuid(i32 0)
%2 = tail call i32 @system(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void CloseRemoteServer() {}


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

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

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

LLVM IR (-O2):
define void @CloseRemoteServer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_int(void *num) { printf("%d ", (int)num); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_int(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
int calc_padded_message_size(int input_size, int block_size) {
  int padded_size;
  if (input_size % block_size == 0) {
    padded_size = input_size;
  } else {
    padded_size = (input_size / block_size) * block_size + block_size;
  }
  return padded_size;
}


x86 assembly (clang, -O0):
<calc_padded_message_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1125 <calc_padded_message_size+0x25>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <calc_padded_message_size+0x36>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
imul   -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_padded_message_size>:
mov    %edi,%eax
cltd
idiv   %esi
lea    (%rsi,%rdi,1),%eax
sub    %edx,%eax
test   %edx,%edx
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @calc_padded_message_size(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = add i32 %1, %0
%6 = sub i32 %5, %3
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
char *tskip(bp)
register char *bp;
{
  while (*bp && *bp != ':')
    bp++;
  while (*bp == ':')
    bp++;
  return (bp);
}


x86 assembly (clang, -O0):
<tskip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <tskip+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <tskip+0x3d>
jmp    114e <tskip+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <tskip+0x8>
jmp    1153 <tskip+0x53>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    1174 <tskip+0x74>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <tskip+0x53>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tskip>:
movzbl (%rdi),%eax
test   %al,%al
je     112e <tskip+0x2e>
cmp    $0x3a,%al
je     1120 <tskip+0x20>
add    $0x1,%rdi
jmp    1100 <tskip>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rdi),%rax
cmpb   $0x3a,0x1(%rdi)
mov    %rax,%rdi
je     1120 <tskip+0x20>
ret
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @tskip(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 58, label %7
i8 0, label %12
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %7
%8 = phi i8* [ %9, %7 ], [ %3, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 58
br i1 %11, label %7, label %12
12: ; preds = %2, %7
%13 = phi i8* [ %9, %7 ], [ %3, %2 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ urecursiveboehmregistersoftware();
int main() {
  printf("Hello world\n");
  printf("urecursiveboehmregistersoftware\n");
  urecursiveboehmregistersoftware();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <urecursiveboehmregistersoftware@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <urecursiveboehmregistersoftware@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
@str.2 = [32 x i8] c"urecursiveboehmregistersoftware\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 (...) @urecursiveboehmregistersoftware()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *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
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void vector_scalar_multiply(const int str[], int size, int multiply) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%d ", str[i] * multiply);
  }
}


x86 assembly (clang, -O0):
<vector_scalar_multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <vector_scalar_multiply+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
imul   -0x10(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <vector_scalar_multiply+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_scalar_multiply>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %esi,%esi
jle    1149 <vector_scalar_multiply+0x39>
mov    %edx,%r15d
mov    %rdi,%r12
mov    %esi,%ebp
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    (%r12,%rbx,4),%esi
imul   %r15d,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <vector_scalar_multiply+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @vector_scalar_multiply(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
store i32 0, i32* %7
br label %8
8: ; preds = %21, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %24
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32, i32* %6
%19 = mul nsw i32 %17, %18
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %12
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %8
24: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @vector_scalar_multiply(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = mul nsw i32 %10, %2
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
int test_imm_B5uint16_mem(unsigned short *val) {
  return ((*val) & (-0xB5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B5uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff4b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B5uint16_mem>:
movzwl (%rdi),%eax
test   $0xff4b,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B5uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -181
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void Count_Stack(int count) {
  printf("now stack conter = %d\n", count);
  Count_Stack(count + 1);
}


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

x86 assembly (clang, -O2):
<Count_Stack>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1120 <Count_Stack+0x10>

LLVM IR (-O0):
@.str = [23 x i8] c"now stack conter = %d\0A\00"
define void @Count_Stack(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"now stack conter = %d\0A\00"
define void @Count_Stack(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %5, %2 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = add nsw i32 %3, 1
br label %2
}
void __nop(void) {}


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

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

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

LLVM IR (-O2):
define void @__nop() {
ret void
}
int test_1() {

#pragma GCC diagnostic ignored "-Wunused-variable"

  int x;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @test_1() {
ret i32 0
}
int main() {
  int vector[6];
  int i;
  for (i = 0; i < 6; i++)
    printf(vector[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x6,-0x24(%rbp)
jge    114e <main+0x3e>
movslq -0x24(%rbp),%rax
movslq -0x20(%rbp,%rax,4),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) null)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) null)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) null)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) null)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) null)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) null)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ *greopen(char *, char const *, int /*<<< orphan*/ *);
char *unixname_to_riscos(char const *);
FILE *freopen(const char *unix_filename, const char *mode, FILE *stream) {
  char *riscos_filename = unixname_to_riscos(unix_filename);
  FILE *handle = greopen(riscos_filename, mode, stream);
  free(riscos_filename);
  return handle;
}


x86 assembly (clang, -O0):
<freopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <unixname_to_riscos@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <greopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freopen>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
call   1050 <unixname_to_riscos@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <greopen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @freopen(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%9 = load i8*, i8** %4
%10 = call i8* @unixname_to_riscos(i8* %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8*, i8** %5
%13 = load i32*, i32** %6
%14 = call i32* @greopen(i8* %11, i8* %12, i32* %13)
store i32* %14, i32** %8
%15 = load i8*, i8** %7
%16 = call i32 @free(i8* %15)
%17 = load i32*, i32** %8
ret i32* %17
}

LLVM IR (-O2):
define i32* @freopen(i8* %0, i8* %1, i32* %2) {
%4 = tail call i8* @unixname_to_riscos(i8* %0)
%5 = tail call i32* @greopen(i8* %4, i8* %1, i32* %2)
%6 = tail call i32 @free(i8* %4)
ret i32* %5
}
void pmem_drain_pm_stores(void) {}


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

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

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

LLVM IR (-O2):
define void @pmem_drain_pm_stores() {
ret void
}
f(int (*pa)[]) { return (*pa)[1]; }


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

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

LLVM IR (-O0):
define i32 @f([0 x i32]* %0) {
%2 = alloca [0 x i32]*
store [0 x i32]* %0, [0 x i32]** %2
%3 = load [0 x i32]*, [0 x i32]** %2
%4 = getelementptr inbounds [0 x i32], [0 x i32]* %3, i64 0, i64 1
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @f([0 x i32]* nocapture %0) {
%2 = getelementptr inbounds [0 x i32], [0 x i32]* %0, i64 0, i64 1
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
char *jfes_double_to_string_r(double, char *, int, double);
char *jfes_double_to_string(double value) {
  static char buf[64];
  static double precision_eps = 0.000000001;
  return jfes_double_to_string_r(value, &buf[0], 64, precision_eps);
}


x86 assembly (clang, -O0):
<jfes_double_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0x2efe(%rip),%xmm1
lea    0x2f0f(%rip),%rdi
mov    $0x40,%esi
call   1030 <jfes_double_to_string_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jfes_double_to_string>:
lea    0x2f29(%rip),%rdi
movsd  0xee1(%rip),%xmm1
mov    $0x40,%esi
jmp    1030 <jfes_double_to_string_r@plt>

LLVM IR (-O0):
@jfes_double_to_string.buf = internal global [64 x i8] zeroinitializer
@jfes_double_to_string.precision_eps = internal global double 1.000000e-09
define i8* @jfes_double_to_string(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @jfes_double_to_string.precision_eps
%5 = call i8* @jfes_double_to_string_r(double %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @jfes_double_to_string.buf, i64 0, i64 0), i32 64, double %4)
ret i8* %5
}

LLVM IR (-O2):
@jfes_double_to_string.buf = internal global [64 x i8] zeroinitializer
define i8* @jfes_double_to_string(double %0) {
%2 = tail call i8* @jfes_double_to_string_r(double %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @jfes_double_to_string.buf, i64 0, i64 0), i32 64, double 1.000000e-09)
ret i8* %2
}
/* Variables and functions */
double floor(double);
double ILLutil_our_frac(double x) { return x - floor(x); }


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

x86 assembly (clang, -O2):
<ILLutil_our_frac>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <floor@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ILLutil_our_frac(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.floor.f64(double %4)
%6 = fsub double %3, %5
ret double %6
}

LLVM IR (-O2):
define double @ILLutil_our_frac(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fsub double %0, %2
ret double %3
}
/* Variables and functions */
int mg_ncasecmp(char const *, char const *, size_t);
int mg_casecmp(const char *s1, const char *s2) {
  return mg_ncasecmp(s1, s2, (size_t)~0);
}


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

x86 assembly (clang, -O2):
<mg_casecmp>:
mov    $0xffffffffffffffff,%rdx
jmp    1030 <mg_ncasecmp@plt>

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

LLVM IR (-O2):
define i32 @mg_casecmp(i8* %0, i8* %1) {
%3 = tail call i32 @mg_ncasecmp(i8* %0, i8* %1, i64 -1)
ret i32 %3
}
int find_index(int a[], int n, int value) {
  int i;
  for (i = 0; i < n; i++) {
    if (a[i] == value) {
      return i;
    }
  }
  return (-1);
}


x86 assembly (clang, -O0):
<find_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <find_index+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <find_index+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <find_index+0x5a>
jmp    1145 <find_index+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <find_index+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_index>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <find_index+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <find_index+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <find_index+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @find_index(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello(void) {
  for (int i = 0; i < 10; i++)
    printf("bye1\n");
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1143 <hello+0x33>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <hello+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [5 x i8] c"bye1\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}