xunge/DecIR huggingface dataset:
/* Variables and functions */
double mayor(float, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ saludar();
int /*<<< orphan*/ scanf(char *, float *, float *);
int main() {
  float a, b;
  printf("Ingrese dos numeros, separados por un espacio: ");
  scanf("%f %f", &a, &b);
  printf("El numero mayor es: %.4f\n", mayor(a, b));
  saludar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1040 <mayor@plt>
lea    0xeaf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <saludar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1060 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm1
call   1040 <mayor@plt>
lea    0xebc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <saludar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Ingrese dos numeros, separados por un espacio: \00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [26 x i8] c"El numero mayor es: %.4f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3)
%6 = load float, float* %2
%7 = load float, float* %3
%8 = call double @mayor(float %6, float %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double %8)
%10 = call i32 (...) @saludar()
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"Ingrese dos numeros, separados por un espacio: \00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [26 x i8] c"El numero mayor es: %.4f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%7 = load float, float* %1
%8 = load float, float* %2
%9 = call double @mayor(float %7, float %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double %9)
%11 = call i32 (...) @saludar()
ret i32 0
}
int Prod(int a, int b) { return a * b; }


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

x86 assembly (clang, -O2):
<Prod>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @Prod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @Prod(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int random();
unsigned random_udp_port(void) { return (random() % (0xffff - 4097)) + 4097; }


x86 assembly (clang, -O0):
<random_udp_port>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
mov    $0xeffe,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1001,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_udp_port>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
cltq
imul   $0xffffffff8889abd1,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xf,%ecx
add    %edx,%ecx
imul   $0xeffe,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1001,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @random_udp_port() {
%1 = call i32 (...) @random()
%2 = srem i32 %1, 61438
%3 = add nsw i32 %2, 4097
ret i32 %3
}

LLVM IR (-O2):
define i32 @random_udp_port() {
%1 = tail call i32 (...) @random()
%2 = srem i32 %1, 61438
%3 = add nsw i32 %2, 4097
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: GenPasswd [-s size] [-n number of password] [-p minimum size] "
         "[-a maximum size]\n");
}


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

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

LLVM IR (-O0):
@.str = [88 x i8] c"Usage: GenPasswd [-s size] [-n number of password] [-p minimum size] [-a maximum size]\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [87 x i8] c"Usage: GenPasswd [-s size] [-n number of password] [-p minimum size] [-a maximum size]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([87 x i8], [87 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  unsigned long tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
uint64_t elapsed_usec(uint64_t t0) {
  struct timeval t1;
  uint64_t usec;
  gettimeofday(&t1, 0);
  usec = t1.tv_sec * 1000000UL + t1.tv_usec;
  usec -= t0;
  if (usec < 1)
    usec = 1;
  return usec;
}


x86 assembly (clang, -O0):
<elapsed_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
add    %rcx,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jge    1154 <elapsed_usec+0x44>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elapsed_usec>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%ecx
imul   $0xf4240,(%rsp),%eax
sub    %ebx,%ecx
add    %eax,%ecx
test   %ecx,%ecx
mov    $0x1,%eax
cmovg  %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
define i32 @elapsed_usec(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%7 = load i64, i64* %6
%8 = mul i64 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%10 = load i32, i32* %9
%11 = sext i32 %10 to i64
%12 = add i64 %8, %11
%13 = trunc i64 %12 to i32
store i32 %13, i32* %4
%14 = load i32, i32* %2
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, %14
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 1
br i1 %18, label %19, label %20
19: ; preds = %1
store i32 1, i32* %4
br label %20
20: ; preds = %19, %1
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
define i32 @elapsed_usec(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%8 = load i32, i32* %7
%9 = trunc i64 %6 to i32
%10 = mul i32 %9, 1000000
%11 = sub i32 %8, %0
%12 = add i32 %11, %10
%13 = icmp sgt i32 %12, 1
%14 = select i1 %13, i32 %12, i32 1
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ fsize(char *);
int main(int argc, char **argv) {
  if (argc == 1) {
    fsize(".");
  } else {
    while (--argc > 0) {
      fsize(*++argv);
    }
  }
  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)
cmpl   $0x1,-0x8(%rbp)
jne    1141 <main+0x31>
lea    0xec9(%rip),%rdi
call   1030 <fsize@plt>
jmp    117a <main+0x6a>
jmp    1146 <main+0x36>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1175 <main+0x65>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1030 <fsize@plt>
jmp    1146 <main+0x36>
jmp    117a <main+0x6a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x1,%edi
jne    1126 <main+0x16>
lea    0xee1(%rip),%rdi
call   1030 <fsize@plt>
jmp    1154 <main+0x44>
jle    1154 <main+0x44>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x8,%rbx
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%rdi
call   1030 <fsize@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
ja     1140 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 1
br i1 %5, label %8, label %16
6: ; preds = %2
%7 = tail call i32 @fsize(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %16
8: ; preds = %4, %8
%9 = phi i8** [ %12, %8 ], [ %1, %4 ]
%10 = phi i32 [ %11, %8 ], [ %0, %4 ]
%11 = add nsw i32 %10, -1
%12 = getelementptr inbounds i8*, i8** %9, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32 @fsize(i8* %13)
%15 = icmp ugt i32 %10, 2
br i1 %15, label %8, label %16
16: ; preds = %8, %4, %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ smooth_triangle();
void smooth_display(void) {
  glClear(GL_COLOR_BUFFER_BIT);
  smooth_triangle();
  glFlush();
}


x86 assembly (clang, -O0):
<smooth_display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1040 <smooth_triangle@plt>
mov    $0x0,%al
call   1050 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<smooth_display>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
call   1040 <smooth_triangle@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @smooth_display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = call i32 (...) @smooth_triangle()
%4 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @smooth_display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = tail call i32 (...) @smooth_triangle()
%4 = tail call i32 (...) @glFlush()
ret void
}
int GLMax(int x, int y) { return ((x > y) ? x : y); }


x86 assembly (clang, -O0):
<GLMax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <GLMax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <GLMax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLMax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @GLMax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("CLOCK_MONOTONIC unsupported\n");
  return 4;
}


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

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

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

LLVM IR (-O2):
@str = [28 x i8] c"CLOCK_MONOTONIC unsupported\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 4
}
/* Variables and functions */
bool nrf52_errata_37(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_37() {
ret i32 0
}
int is_in_bound(int *arr, int size, int *ptr) {
  if (ptr >= arr && ptr <= (arr + size))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_in_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1145 <is_in_bound+0x45>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
ja     1145 <is_in_bound+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <is_in_bound+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_bound>:
cmp    %rdi,%rdx
setae  %al
movslq %esi,%rcx
lea    (%rdi,%rcx,4),%rcx
cmp    %rdx,%rcx
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_in_bound(i32* readnone %0, i32 %1, i32* readnone %2) {
%4 = icmp uge i32* %2, %0
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = icmp uge i32* %6, %2
%8 = select i1 %4, i1 %7, i1 false
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ dhcp6_sendmessage(void *, void (*)(void *));
void dhcp6_sendrequest(void *arg) { dhcp6_sendmessage(arg, dhcp6_sendrequest); }


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

x86 assembly (clang, -O2):
<dhcp6_sendrequest>:
mov    0x2ed1(%rip),%rsi
jmp    1030 <dhcp6_sendmessage@plt>

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

LLVM IR (-O2):
define void @dhcp6_sendrequest(i8* %0) {
%2 = tail call i32 @dhcp6_sendmessage(i8* %0, void (i8*)* @dhcp6_sendrequest)
ret void
}
unsigned long hash_str(const char *str, unsigned int bits) {
  unsigned long hash;
  char c;
  for (hash = 0;; str++) {
    c = *str;
    if (c == '\0') {
      break;
    }
    hash = ((hash << 5) - hash) + c;
  }
  return hash & ((1UL << bits) - 1);
}


x86 assembly (clang, -O0):
<hash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x0,%eax
jne    112e <hash_str+0x2e>
jmp    1157 <hash_str+0x57>
mov    -0x18(%rbp),%rax
shl    $0x5,%rax
sub    -0x18(%rbp),%rax
movsbq -0x19(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <hash_str+0x13>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_str>:
mov    %esi,%ecx
mov    (%rdi),%al
test   %al,%al
je     112e <hash_str+0x2e>
add    $0x1,%rdi
xor    %edx,%edx
xchg   %ax,%ax
mov    %rdx,%rsi
shl    $0x5,%rsi
sub    %rdx,%rsi
movsbq %al,%rdx
add    %rsi,%rdx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash_str+0x10>
jmp    1130 <hash_str+0x30>
xor    %edx,%edx
mov    $0xffffffffffffffff,%rax
shl    %cl,%rax
not    %rax
and    %rdx,%rax
ret

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

LLVM IR (-O2):
define i64 @hash_str(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %12, %5 ], [ %0, %2 ]
%8 = phi i64 [ %11, %5 ], [ 0, %2 ]
%9 = mul i64 %8, 31
%10 = sext i8 %6 to i64
%11 = add i64 %9, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i64 [ 0, %2 ], [ %11, %5 ]
%17 = zext i32 %1 to i64
%18 = shl nsw i64 -1, %17
%19 = xor i64 %18, -1
%20 = and i64 %16, %19
ret i64 %20
}
int is_ore_ignored(unsigned int saddr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @is_ore_ignored(i32 %0) {
ret i32 0
}
/* Variables and functions */
char __tolower(char);
void LowerStr(char *Str) {
  while (*Str) {
    *Str = __tolower(*Str);
    Str++;
  }
}


x86 assembly (clang, -O0):
<LowerStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <LowerStr+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <__tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <LowerStr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LowerStr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <LowerStr+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <__tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <LowerStr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @LowerStr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @__tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
unsigned long zipmapRequiredLength(unsigned int klen, unsigned int vlen) {
  unsigned int l;
  l = klen + vlen + 3;
  if (klen >= 254)
    l += 4;
  if (vlen >= 254)
    l += 4;
  return l;
}


x86 assembly (clang, -O0):
<zipmapRequiredLength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xfe,-0x4(%rbp)
jb     112c <zipmapRequiredLength+0x2c>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xfe,-0x8(%rbp)
jb     1142 <zipmapRequiredLength+0x42>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zipmapRequiredLength>:
lea    (%rsi,%rdi,1),%eax
xor    %ecx,%ecx
cmp    $0xfe,%edi
setae  %cl
lea    (%rax,%rcx,4),%eax
xor    %ecx,%ecx
cmp    $0xfe,%esi
setae  %cl
lea    (%rax,%rcx,4),%eax
add    $0x3,%eax
ret

LLVM IR (-O0):
define i64 @zipmapRequiredLength(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 = add i32 %6, %7
%9 = add i32 %8, 3
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = icmp uge i32 %10, 254
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %5
%14 = add i32 %13, 4
store i32 %14, i32* %5
br label %15
15: ; preds = %12, %2
%16 = load i32, i32* %4
%17 = icmp uge i32 %16, 254
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %5
%20 = add i32 %19, 4
store i32 %20, i32* %5
br label %21
21: ; preds = %18, %15
%22 = load i32, i32* %5
%23 = zext i32 %22 to i64
ret i64 %23
}

LLVM IR (-O2):
define i64 @zipmapRequiredLength(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = icmp ugt i32 %0, 253
%5 = select i1 %4, i32 7, i32 3
%6 = add i32 %3, %5
%7 = icmp ugt i32 %1, 253
%8 = add i32 %6, 4
%9 = select i1 %7, i32 %8, i32 %6
%10 = zext i32 %9 to i64
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_LITTLE_GUY_RESET_PIN() { set_io_bit(0x70, 6); }


x86 assembly (clang, -O0):
<TOSH_SET_LITTLE_GUY_RESET_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70,%edi
mov    $0x6,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_LITTLE_GUY_RESET_PIN>:
mov    $0x70,%edi
mov    $0x6,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_LITTLE_GUY_RESET_PIN() {
%1 = call i32 @set_io_bit(i32 112, i32 6)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_LITTLE_GUY_RESET_PIN() {
%1 = tail call i32 @set_io_bit(i32 112, i32 6)
ret void
}
void nseel_asm_sub_op_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_sub_op_end() {
ret void
}
int std_compare(double a, double b) { return (a > b) - (a < b); }


x86 assembly (clang, -O0):
<std_compare>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_compare>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @std_compare(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 = fcmp ogt double %5, %6
%8 = zext i1 %7 to i32
%9 = load double, double* %3
%10 = load double, double* %4
%11 = fcmp olt double %9, %10
%12 = zext i1 %11 to i32
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @std_compare(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = zext i1 %3 to i32
%5 = fcmp olt double %0, %1
%6 = sext i1 %5 to i32
%7 = add nsw i32 %6, %4
ret i32 %7
}
/* Type definitions */
struct ndm_strmap_t {
  int dummy;
};

/* Variables and functions */
char const *ndm_strmap_nget(struct ndm_strmap_t *, char const *const,
                            int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *const);
const char *ndm_strmap_get(struct ndm_strmap_t *map, const char *const key) {
  return ndm_strmap_nget(map, key, strlen(key));
}


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

x86 assembly (clang, -O2):
<ndm_strmap_get>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ndm_strmap_nget@plt>

LLVM IR (-O0):
%struct.ndm_strmap_t = type { i32 }
define i8* @ndm_strmap_get(%struct.ndm_strmap_t* %0, i8* %1) {
%3 = alloca %struct.ndm_strmap_t*
%4 = alloca i8*
store %struct.ndm_strmap_t* %0, %struct.ndm_strmap_t** %3
store i8* %1, i8** %4
%5 = load %struct.ndm_strmap_t*, %struct.ndm_strmap_t** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i8* @ndm_strmap_nget(%struct.ndm_strmap_t* %5, i8* %6, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.ndm_strmap_t = type { i32 }
define i8* @ndm_strmap_get(%struct.ndm_strmap_t* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i8* @ndm_strmap_nget(%struct.ndm_strmap_t* %0, i8* %1, i32 %3)
ret i8* %4
}
long s_align_to_ext(long size) {
  return ((size - 1) / ((4096)) + 1) * ((4096));
}


x86 assembly (clang, -O0):
<s_align_to_ext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
mov    $0x1000,%ecx
cqto
idiv   %rcx
add    $0x1,%rax
shl    $0xc,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_align_to_ext>:
lea    -0x1(%rdi),%rcx
lea    0xffe(%rdi),%rax
test   %rcx,%rcx
cmovns %rcx,%rax
and    $0xfffffffffffff000,%rax
add    $0x1000,%rax
ret

LLVM IR (-O0):
define i64 @s_align_to_ext(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 %3, 1
%5 = sdiv i64 %4, 4096
%6 = add nsw i64 %5, 1
%7 = mul nsw i64 %6, 4096
ret i64 %7
}

LLVM IR (-O2):
define i64 @s_align_to_ext(i64 %0) {
%2 = add nsw i64 %0, -1
%3 = sdiv i64 %2, 4096
%4 = shl nsw i64 %3, 12
%5 = add i64 %4, 4096
ret i64 %5
}
double drand(double *seed) {
  double x;
  int q;
  x = (*seed) * 1389796;
  q = (int)(x / 2147483647);
  x -= (double)q * 2147483647;
  *seed = x;
  return x / 2147483647;
}


x86 assembly (clang, -O0):
<drand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xef4(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xea2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
movsd  0xe7b(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<drand>:
movsd  (%rdi),%xmm0
mulsd  0xef4(%rip),%xmm0
movsd  0xef4(%rip),%xmm1
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
cvttpd2dq %xmm2,%xmm2
cvtdq2pd %xmm2,%xmm2
mulsd  %xmm1,%xmm2
subsd  %xmm2,%xmm0
movsd  %xmm0,(%rdi)
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @drand(double* %0) {
%2 = alloca double*
%3 = alloca double
%4 = alloca i32
store double* %0, double** %2
%5 = load double*, double** %2
%6 = load double, double* %5
%7 = fmul double %6, 0x413534E400000000
store double %7, double* %3
%8 = load double, double* %3
%9 = fdiv double %8, 0x41DFFFFFFFC00000
%10 = fptosi double %9 to i32
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = sitofp i32 %11 to double
%13 = load double, double* %3
%14 = fneg double %12
%15 = call double @llvm.fmuladd.f64(double %14, double 0x41DFFFFFFFC00000, double %13)
store double %15, double* %3
%16 = load double, double* %3
%17 = load double*, double** %2
store double %16, double* %17
%18 = load double, double* %3
%19 = fdiv double %18, 0x41DFFFFFFFC00000
ret double %19
}

LLVM IR (-O2):
define double @drand(double* nocapture %0) {
%2 = load double, double* %0
%3 = fmul double %2, 0x413534E400000000
%4 = fdiv double %3, 0x41DFFFFFFFC00000
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
%7 = fneg double %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x41DFFFFFFFC00000, double %3)
store double %8, double* %0
%9 = fdiv double %8, 0x41DFFFFFFFC00000
ret double %9
}
int get_raw_mode(int mode) { return (mode & 0xffff); }


x86 assembly (clang, -O0):
<get_raw_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_raw_mode>:
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @get_raw_mode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
ret i32 %4
}

LLVM IR (-O2):
define i32 @get_raw_mode(i32 %0) {
%2 = and i32 %0, 65535
ret i32 %2
}
/* Variables and functions */
long grg_get_snf3x3(long *, long **, long **, long **);
long ksp_get_snf3x3(long D_diag[3], long P[3][3], long Q[3][3], long A[3][3]) {
  return grg_get_snf3x3(D_diag, P, Q, A);
}


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

x86 assembly (clang, -O2):
<ksp_get_snf3x3>:
jmp    1030 <grg_get_snf3x3@plt>

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

LLVM IR (-O2):
define i64 @ksp_get_snf3x3(i64* %0, [3 x i64]* %1, [3 x i64]* %2, [3 x i64]* %3) {
%5 = bitcast [3 x i64]* %1 to i64**
%6 = bitcast [3 x i64]* %2 to i64**
%7 = bitcast [3 x i64]* %3 to i64**
%8 = tail call i64 @grg_get_snf3x3(i64* %0, i64** %5, i64** %6, i64** %7)
ret i64 %8
}
void RTErrInfoAlloc(void) {}


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

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

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

LLVM IR (-O2):
define void @RTErrInfoAlloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void rtlglue_free(void *APTR) { free(APTR); }


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

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

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

LLVM IR (-O2):
define void @rtlglue_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct full_date {
  int dummy;
};

/* Variables and functions */
int Get_time(unsigned char *, struct full_date *);
int Ref_time(unsigned char **sec, struct full_date *date) {
  return Get_time(sec[1] + 12, date);
}


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

x86 assembly (clang, -O2):
<Ref_time>:
mov    0x8(%rdi),%rdi
add    $0xc,%rdi
jmp    1030 <Get_time@plt>

LLVM IR (-O0):
%struct.full_date = type { i32 }
define i32 @Ref_time(i8** %0, %struct.full_date* %1) {
%3 = alloca i8**
%4 = alloca %struct.full_date*
store i8** %0, i8*** %3
store %struct.full_date* %1, %struct.full_date** %4
%5 = load i8**, i8*** %3
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i64 12
%9 = load %struct.full_date*, %struct.full_date** %4
%10 = call i32 @Get_time(i8* %8, %struct.full_date* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.full_date = type { i32 }
define i32 @Ref_time(i8** nocapture %0, %struct.full_date* %1) {
%3 = getelementptr inbounds i8*, i8** %0, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 12
%6 = tail call i32 @Get_time(i8* %5, %struct.full_date* %1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ atol(char *);
int ceil_log2(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", ceil_log2(atol(argv[1])));
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atol@plt>
mov    %eax,%edi
call   1030 <ceil_log2@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1050 <atol@plt>
mov    %eax,%edi
call   1030 <ceil_log2@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @atol(i8* %8)
%10 = call i32 @ceil_log2(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atol(i8* %4)
%6 = tail call i32 @ceil_log2(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
float bezier(float t, float p0, float p1) { return (1 - t) * p0 + t * p1; }


x86 assembly (clang, -O0):
<bezier>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  0xee5(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bezier>:
movss  0xef8(%rip),%xmm3
subss  %xmm0,%xmm3
mulss  %xmm2,%xmm0
mulss  %xmm1,%xmm3
addss  %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @bezier(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = fsub float 1.000000e+00, %7
%9 = load float, float* %5
%10 = load float, float* %4
%11 = load float, float* %6
%12 = fmul float %10, %11
%13 = call float @llvm.fmuladd.f32(float %8, float %9, float %12)
ret float %13
}

LLVM IR (-O2):
define float @bezier(float %0, float %1, float %2) {
%4 = fsub float 1.000000e+00, %0
%5 = fmul float %0, %2
%6 = tail call float @llvm.fmuladd.f32(float %4, float %1, float %5)
ret float %6
}
/* Variables and functions */
int getch();
int /*<<< orphan*/ ungetch(int);
void skipspaces(void) {
  int c;
  while ((c = getch()) == ' ' || c == '\t')
    ;
  ungetch(c);
}


x86 assembly (clang, -O0):
<skipspaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x5(%rbp)
je     114c <skipspaces+0x2c>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    115c <skipspaces+0x3c>
jmp    1161 <skipspaces+0x41>
jmp    1128 <skipspaces+0x8>
mov    -0x4(%rbp),%edi
call   1030 <ungetch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspaces>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getch@plt>
cmp    $0x9,%eax
je     1130 <skipspaces+0x10>
cmp    $0x20,%eax
je     1130 <skipspaces+0x10>
mov    %eax,%edi
pop    %rax
jmp    1030 <ungetch@plt>

LLVM IR (-O0):
define void @skipspaces() {
%1 = alloca i32
br label %2
2: ; preds = %10, %0
%3 = call i32 (...) @getch()
store i32 %3, i32* %1
%4 = icmp eq i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 9
br label %8
8: ; preds = %5, %2
%9 = phi i1 [ true, %2 ], [ %7, %5 ]
br i1 %9, label %10, label %11
10: ; preds = %8
br label %2
11: ; preds = %8
%12 = load i32, i32* %1
%13 = call i32 @ungetch(i32 %12)
ret void
}

LLVM IR (-O2):
define void @skipspaces() {
br label %1
1: ; preds = %3, %0
%2 = tail call i32 (...) @getch()
switch i32 %2, label %4 [
i32 32, label %3
i32 9, label %3
]
3: ; preds = %1, %1
br label %1
4: ; preds = %1
%5 = tail call i32 @ungetch(i32 %2)
ret void
}
float BinAvailable(float inDecimal) {
  float base = 2;
  float CurrentBin = 1;
  for (float i = 0; i < inDecimal; i++) {
    CurrentBin = CurrentBin * base;
  }
  return (CurrentBin - 1);
}


x86 assembly (clang, -O0):
<BinAvailable>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xee2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1164 <BinAvailable+0x64>
movss  -0xc(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xeab(%rip),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    112b <BinAvailable+0x2b>
movss  -0xc(%rbp),%xmm0
movss  0xe8f(%rip),%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<BinAvailable>:
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jbe    1135 <BinAvailable+0x35>
movss  0xeed(%rip),%xmm2
xorps  %xmm3,%xmm3
movaps %xmm2,%xmm0
nopl   0x0(%rax)
addss  %xmm0,%xmm0
addss  %xmm2,%xmm3
ucomiss %xmm3,%xmm1
ja     1120 <BinAvailable+0x20>
addss  0xecf(%rip),%xmm0
ret

LLVM IR (-O0):
define float @BinAvailable(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %2
store float 2.000000e+00, float* %3
store float 1.000000e+00, float* %4
store float 0.000000e+00, float* %5
br label %6
6: ; preds = %14, %1
%7 = load float, float* %5
%8 = load float, float* %2
%9 = fcmp olt float %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load float, float* %4
%12 = load float, float* %3
%13 = fmul float %11, %12
store float %13, float* %4
br label %14
14: ; preds = %10
%15 = load float, float* %5
%16 = fadd float %15, 1.000000e+00
store float %16, float* %5
br label %6
17: ; preds = %6
%18 = load float, float* %4
%19 = fsub float %18, 1.000000e+00
ret float %19
}

LLVM IR (-O2):
define float @BinAvailable(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
br i1 %2, label %7, label %5
3: ; preds = %7
%4 = fadd float %10, -1.000000e+00
br label %5
5: ; preds = %3, %1
%6 = phi float [ 0.000000e+00, %1 ], [ %4, %3 ]
ret float %6
7: ; preds = %1, %7
%8 = phi float [ %11, %7 ], [ 0.000000e+00, %1 ]
%9 = phi float [ %10, %7 ], [ 1.000000e+00, %1 ]
%10 = fmul float %9, 2.000000e+00
%11 = fadd float %8, 1.000000e+00
%12 = fcmp olt float %11, %0
br i1 %12, label %7, label %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long);
int /*<<< orphan*/ stderr;
void _checkIndexArray(long *a, long i) {
  if (i < 0 || i > a[-1]) {
    fprintf(stderr, "indice %ld excedido!\n", i);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<_checkIndexArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     114d <_checkIndexArray+0x2d>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
cmp    -0x8(%rcx),%rax
jle    1170 <_checkIndexArray+0x50>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe9f(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_checkIndexArray>:
push   %rax
mov    %rsi,%rdx
test   %rsi,%rsi
js     1131 <_checkIndexArray+0x11>
cmp    %rdx,-0x8(%rdi)
jl     1131 <_checkIndexArray+0x11>
pop    %rax
ret
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"indice %ld excedido!\0A\00"
define void @_checkIndexArray(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp slt i64 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = load i64, i64* %4
%9 = load i64*, i64** %3
%10 = getelementptr inbounds i64, i64* %9, i64 -1
%11 = load i64, i64* %10
%12 = icmp sgt i64 %8, %11
br i1 %12, label %13, label %18
13: ; preds = %7, %2
%14 = load i32, i32* @stderr
%15 = load i64, i64* %4
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %15)
%17 = call i32 @exit(i32 -1)
unreachable
18: ; preds = %7
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"indice %ld excedido!\0A\00"
define void @_checkIndexArray(i64* nocapture %0, i64 %1) {
%3 = icmp slt i64 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds i64, i64* %0, i64 -1
%6 = load i64, i64* %5
%7 = icmp slt i64 %6, %1
br i1 %7, label %8, label %12
8: ; preds = %4, %2
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %1)
%11 = tail call i32 @exit(i32 -1)
unreachable
12: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgincbstat(char *, int, int);
void cgdecsb(int a) { cgincbstat("sub", a, 1); }


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

x86 assembly (clang, -O2):
<cgdecsb>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
mov    $0x1,%edx
jmp    1030 <cgincbstat@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"sub\00"
define void @cgdecsb(i32 %0) {
%2 = tail call i32 @cgincbstat(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0, i32 1)
ret void
}
/* Variables and functions */
float SIN(float);
float COS(float angle) { return SIN(angle + 90); }


x86 assembly (clang, -O0):
<COS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
call   1030 <SIN@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<COS>:
addss  0xee8(%rip),%xmm0
jmp    1030 <SIN@plt>

LLVM IR (-O0):
define float @COS(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float %3, 9.000000e+01
%5 = call float @SIN(float %4)
ret float %5
}

LLVM IR (-O2):
define float @COS(float %0) {
%2 = fadd float %0, 9.000000e+01
%3 = tail call float @SIN(float %2)
ret float %3
}
_Bool Int_safe_MINUS_add(int x, int y, int *res) {
  return __builtin_sadd_overflow(x, y, res);
}


x86 assembly (clang, -O0):
<Int_safe_MINUS_add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
add    %eax,%edx
seto   %al
mov    %edx,(%rcx)
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Int_safe_MINUS_add>:
add    %esi,%edi
seto   %al
mov    %edi,(%rdx)
ret

LLVM IR (-O0):
define zeroext i1 @Int_safe_MINUS_add(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %7, i32 %8)
%11 = extractvalue { i32, i1 } %10, 1
%12 = extractvalue { i32, i1 } %10, 0
store i32 %12, i32* %9
ret i1 %11
}

LLVM IR (-O2):
define zeroext i1 @Int_safe_MINUS_add(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %0, i32 %1)
%5 = extractvalue { i32, i1 } %4, 1
%6 = extractvalue { i32, i1 } %4, 0
store i32 %6, i32* %2
ret i1 %5
}