xunge/DecIR huggingface dataset:
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ printf(char *, char const *, int, char const *, size_t,
                          unsigned long);
void *debug_malloc(size_t size, const char *file, int line, const char *func) {
  void *p;
  p = malloc(size);
  printf("%s:%d:%s:malloc(%ld): p=0x%lx\n", file, line, func, size,
         (unsigned long)p);
  return p;
}


x86 assembly (clang, -O0):
<debug_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    -0x28(%rbp),%r9
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_malloc>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %edx,%r15d
mov    %rsi,%r12
mov    %rdi,%rbp
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xebd(%rip),%rdi
mov    %r12,%rsi
mov    %r15d,%edx
mov    %r14,%rcx
mov    %rbp,%r8
mov    %rax,%r9
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"%s:%d:%s:malloc(%ld): p=0x%lx\0A\00"
define i8* @debug_malloc(i64 %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
store i64 %0, i64* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load i64, i64* %5
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %9
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i64, i64* %5
%16 = load i8*, i8** %9
%17 = ptrtoint i8* %16 to i64
%18 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13, i8* %14, i64 %15, i64 %17)
%19 = load i8*, i8** %9
ret i8* %19
}

LLVM IR (-O2):
@.str = [31 x i8] c"%s:%d:%s:malloc(%ld): p=0x%lx\0A\00"
define i8* @debug_malloc(i64 %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i8* @malloc(i64 %0)
%6 = ptrtoint i8* %5 to i64
%7 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %3, i64 %0, i64 %6)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void ps_selcolor(FILE *ps, char *cname) { fprintf(ps, "%s\n", cname); }


x86 assembly (clang, -O0):
<ps_selcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps_selcolor>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @ps_selcolor(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(double, int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(void) {
  bar(1.0, 2, 3);
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xeb9(%rip),%xmm0
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <bar@plt>
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xec7(%rip),%xmm0
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <bar@plt>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bar(double 1.000000e+00, i32 2, i32 3)
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 @bar(double 1.000000e+00, i32 2, i32 3)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void initialize_mem_state(void *state) {
  memset(state, 0, 25 * sizeof(unsigned short));
}


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

x86 assembly (clang, -O2):
<initialize_mem_state>:
xor    %esi,%esi
mov    $0x32,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @initialize_mem_state(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i32 0, i32 50)
ret void
}
/* Variables and functions */
int printf(char const *, double);
int sbt_printf_d(const char *fmt, double d) { return printf(fmt, d); }


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

x86 assembly (clang, -O2):
<sbt_printf_d>:
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define i32 @sbt_printf_d(i8* %0, double %1) {
%3 = tail call i32 @printf(i8* %0, double %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
void CdsObjectToDidl_Helper_WriteTimeString(char *str, int intTime) {
  if (intTime > 0) {
    sprintf(str, "%02d:%02d:%02d", ((intTime / 3600) % 60),
            ((intTime / 60) % 60), (intTime % 60));
  }
}


x86 assembly (clang, -O0):
<CdsObjectToDidl_Helper_WriteTimeString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1175 <CdsObjectToDidl_Helper_WriteTimeString+0x65>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0xc(%rbp),%eax
mov    $0x3c,%esi
cltd
idiv   %esi
mov    %edx,%r8d
mov    -0x10(%rbp),%edx
lea    0xe90(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CdsObjectToDidl_Helper_WriteTimeString>:
test   %esi,%esi
jle    1162 <CdsObjectToDidl_Helper_WriteTimeString+0x52>
mov    %esi,%r8d
mov    %esi,%ecx
mov    $0x91a2b3c5,%edx
imul   %rcx,%rdx
shr    $0x2b,%rdx
mov    $0x88888889,%eax
mov    %rdx,%rsi
imul   %rax,%rsi
shr    $0x25,%rsi
imul   $0x3c,%esi,%esi
sub    %esi,%edx
imul   %rax,%rcx
shr    $0x25,%rcx
imul   %rcx,%rax
shr    $0x25,%rax
imul   $0x3c,%eax,%eax
imul   $0x3c,%ecx,%esi
sub    %eax,%ecx
sub    %esi,%r8d
lea    0xea3(%rip),%rsi
jmp    1030 <sprintf@plt>
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%02d:%02d:%02d\00"
define void @CdsObjectToDidl_Helper_WriteTimeString(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 3600
%11 = srem i32 %10, 60
%12 = load i32, i32* %4
%13 = sdiv i32 %12, 60
%14 = srem i32 %13, 60
%15 = load i32, i32* %4
%16 = srem i32 %15, 60
%17 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %14, i32 %16)
br label %18
18: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%02d:%02d:%02d\00"
define void @CdsObjectToDidl_Helper_WriteTimeString(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = udiv i32 %1, 3600
%6 = urem i32 %5, 60
%7 = udiv i32 %1, 60
%8 = urem i32 %7, 60
%9 = urem i32 %1, 60
%10 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8, i32 %9)
br label %11
11: ; preds = %4, %2
ret void
}
void txt_program(chan, program) {
  prtime();
  printf("Program, chan=%d program=%d\n", chan + 1, program);
}


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

x86 assembly (clang, -O2):
<txt_program>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <prtime@plt>
add    $0x1,%ebp
lea    0xec8(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Program, chan=%d program=%d\0A\00"
define void @txt_program(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @prtime()
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Program, chan=%d program=%d\0A\00"
define void @txt_program(i32 %0, i32 %1) {
%3 = tail call i32 (...) @prtime()
%4 = add nsw i32 %0, 1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %1)
ret void
}
int lt(const void *l, const void *r) {
  if ((long)l < (long)r)
    return 1;
  if ((long)l == (long)r)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<lt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    %rcx,%rax
jge    1129 <lt+0x29>
movl   $0x1,-0x4(%rbp)
jmp    114d <lt+0x4d>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    %rcx,%rax
jne    1146 <lt+0x46>
movl   $0x0,-0x4(%rbp)
jmp    114d <lt+0x4d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setne  %cl
neg    %ecx
cmp    %rsi,%rdi
mov    $0x1,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @lt(i8* readnone %0, i8* readnone %1) {
%3 = icmp slt i8* %0, %1
%4 = icmp ne i8* %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ c(char *);
int /*<<< orphan*/ reveal();
void End() {
  c("unnest");
  reveal();
}


x86 assembly (clang, -O0):
<End>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <c@plt>
mov    $0x0,%al
call   1040 <reveal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<End>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <c@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <reveal@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"unnest\00"
define void @End() {
%1 = call i32 @c(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @reveal()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"unnest\00"
define void @End() {
%1 = tail call i32 @c(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @reveal()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Func();
main() { Func(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Func()
ret i32 0
}
void w14(void *x, long long y) { *(long long *)(x + 32754) = y; }


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

x86 assembly (clang, -O2):
<w14>:
mov    %rsi,0x7ff2(%rdi)
ret

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

LLVM IR (-O2):
define void @w14(i8* nocapture writeonly %0, i64 %1) {
%3 = getelementptr i8, i8* %0, i64 32754
%4 = bitcast i8* %3 to i64*
store i64 %1, i64* %4
ret void
}
/* Type definitions */
typedef int intmax_t;

/* Variables and functions */
scalar_t__ ERANGE;
scalar_t__ errno;
int strtoimax(char const *, char **, int);
int hex2int(const char *s) {
  char *endptr;
  intmax_t x = strtoimax(s, &endptr, 16);
  if (errno == ERANGE) {
    return 0;
  }
  return x;
}


x86 assembly (clang, -O0):
<hex2int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   1030 <strtoimax@plt>
mov    %eax,-0x1c(%rbp)
mov    0x2ea0(%rip),%rax
mov    (%rax),%rax
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%rax
jne    1157 <hex2int+0x47>
movl   $0x0,-0x4(%rbp)
jmp    115d <hex2int+0x4d>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2int>:
push   %rax
mov    %rsp,%rsi
mov    $0x10,%edx
call   1030 <strtoimax@plt>
mov    0x2eb3(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2eb9(%rip),%rdx
xor    %esi,%esi
cmp    (%rdx),%rcx
cmove  %esi,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i64 0
@ERANGE = global i64 0
define i32 @hex2int(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @strtoimax(i8* %0, i8** %2, i32 16)
%5 = load i64, i64* @errno
%6 = load i64, i64* @ERANGE
%7 = icmp eq i64 %5, %6
%8 = select i1 %7, i32 0, i32 %4
ret i32 %8
}
/* Type definitions */
typedef int int64_t;

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


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

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

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

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

/* Variables and functions */
int __i64_cmp(void *a, void *b) { return *(int64_t *)a - *(int64_t *)b; }


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

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

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

LLVM IR (-O2):
define i32 @__i64_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rightrot(unsigned int, int);
main() {
  unsigned x = 0xff;
  printf("0x%x\n", x);
  printf("0x%x\n", rightrot(x, 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xff,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1040 <rightrot@plt>
mov    %eax,%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
mov    $0xff,%edi
mov    $0x2,%esi
call   1040 <rightrot@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"0x%x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 255)
%2 = tail call i32 @rightrot(i32 255, i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ extern_func1_9(int, char *, unsigned long);
void extern_func1_8(int a, char *b, unsigned long c) {
  extern_func1_9(a, b, c);
}


x86 assembly (clang, -O0):
<extern_func1_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <extern_func1_9@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extern_func1_8>:
jmp    1030 <extern_func1_9@plt>

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

LLVM IR (-O2):
define void @extern_func1_8(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @extern_func1_9(i32 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int f186(int *);
int f187(int *p) { return f186(p); }


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

x86 assembly (clang, -O2):
<f187>:
jmp    1030 <f186@plt>

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

LLVM IR (-O2):
define i32 @f187(i32* %0) {
%2 = tail call i32 @f186(i32* %0)
ret i32 %2
}
/* Variables and functions */
int test_dynarr_append();
int test_dynarr_len();
int test_dynarr_set();
int test_dynarr_slice();
int test_makedynarr();
int main(void) {
  int rval = 0;
  rval |= test_makedynarr();
  rval |= test_dynarr_append();
  rval |= test_dynarr_slice();
  rval |= test_dynarr_set();
  rval |= test_dynarr_len();
  return rval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1070 <test_makedynarr@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <test_dynarr_append@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <test_dynarr_slice@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <test_dynarr_set@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test_dynarr_len@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1070 <test_makedynarr@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <test_dynarr_append@plt>
mov    %eax,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1030 <test_dynarr_slice@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1040 <test_dynarr_set@plt>
mov    %eax,%ebx
or     %r14d,%ebx
or     %ebp,%ebx
xor    %eax,%eax
call   1050 <test_dynarr_len@plt>
or     %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @test_makedynarr()
%4 = load i32, i32* %2
%5 = or i32 %4, %3
store i32 %5, i32* %2
%6 = call i32 (...) @test_dynarr_append()
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = call i32 (...) @test_dynarr_slice()
%10 = load i32, i32* %2
%11 = or i32 %10, %9
store i32 %11, i32* %2
%12 = call i32 (...) @test_dynarr_set()
%13 = load i32, i32* %2
%14 = or i32 %13, %12
store i32 %14, i32* %2
%15 = call i32 (...) @test_dynarr_len()
%16 = load i32, i32* %2
%17 = or i32 %16, %15
store i32 %17, i32* %2
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_makedynarr()
%2 = tail call i32 (...) @test_dynarr_append()
%3 = or i32 %2, %1
%4 = tail call i32 (...) @test_dynarr_slice()
%5 = or i32 %3, %4
%6 = tail call i32 (...) @test_dynarr_set()
%7 = or i32 %5, %6
%8 = tail call i32 (...) @test_dynarr_len()
%9 = or i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void stack_fault(void) { panic("exception(fault): stack fault"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"exception(fault): stack fault\00"
define void @stack_fault() {
%1 = call i32 @panic(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"exception(fault): stack fault\00"
define void @stack_fault() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned long long complementBit_fun_ullong(unsigned long long x, unsigned i) {
  return x ^ 1 << i;
}


x86 assembly (clang, -O0):
<complementBit_fun_ullong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
xor    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<complementBit_fun_ullong>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
xor    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @complementBit_fun_ullong(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = sext i32 %7 to i64
%9 = xor i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @complementBit_fun_ullong(i64 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = sext i32 %3 to i64
%5 = xor i64 %4, %0
ret i64 %5
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  unsigned int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void cssh_msleep(unsigned int msec) {
  struct timespec ts;
  ts.tv_sec = msec / 1000;
  ts.tv_nsec = (msec % 1000) * 1000000;
  nanosleep(&ts, NULL);
}


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

x86 assembly (clang, -O2):
<cssh_msleep>:
push   %rax
mov    %edi,%eax
imul   $0x10624dd3,%rax,%rax
shr    $0x26,%rax
mov    %eax,(%rsp)
imul   $0x3e8,%eax,%eax
sub    %eax,%edi
imul   $0xf4240,%edi,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

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

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @cssh_msleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = udiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = urem i32 %0, 1000
%7 = mul nuw nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ snprintf(char *, int, char *, double);
char *print_double_for_lisp(double n) {
  static char buf[256];
  memset(buf, 0, 256);
  snprintf(buf, 255,
           "(let ((*read-default-float-format* 'double-float)) (coerce "
           "(read-from-string \"%.20E\") 'double-float))",
           n);
  return buf;
}


x86 assembly (clang, -O0):
<print_double_for_lisp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0x2f0c(%rip),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
movsd  -0x8(%rbp),%xmm0
lea    0x2ef4(%rip),%rdi
mov    $0xff,%esi
lea    0xea8(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2edc(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_double_for_lisp>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
lea    0x2f0e(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    0xeb8(%rip),%rdx
mov    %rbx,%rdi
mov    $0xff,%esi
movsd  0x8(%rsp),%xmm0
call   1030 <snprintf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@print_double_for_lisp.buf = internal global [256 x i8] zeroinitializer
@.str = [102 x i8] c"(let ((*read-default-float-format* 'double-float)) (coerce (read-from-string \22%.20E\22) 'double-float))\00"
define i8* @print_double_for_lisp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @memset(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @print_double_for_lisp.buf, i64 0, i64 0), i32 0, i32 256)
%4 = load double, double* %2
%5 = call i32 @snprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @print_double_for_lisp.buf, i64 0, i64 0), i32 255, i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0), double %4)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @print_double_for_lisp.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@print_double_for_lisp.buf = internal global [256 x i8] zeroinitializer
@.str = [102 x i8] c"(let ((*read-default-float-format* 'double-float)) (coerce (read-from-string \22%.20E\22) 'double-float))\00"
define i8* @print_double_for_lisp(double %0) {
%2 = tail call i32 @memset(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @print_double_for_lisp.buf, i64 0, i64 0), i32 0, i32 256)
%3 = tail call i32 @snprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @print_double_for_lisp.buf, i64 0, i64 0), i32 255, i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0), double %0)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @print_double_for_lisp.buf, i64 0, i64 0)
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int celcon_dimension_of_points(int *dimension) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(83, dimension, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_dimension_of_points>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x53,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_dimension_of_points>:
mov    %rdi,%rsi
mov    $0x53,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @celcon_dimension_of_points(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 83, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @celcon_dimension_of_points(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 83, i32* %0, i32* undef, double* undef)
ret i32 %2
}
int initialize(len)
int len;
{
  int num_vars;
  remove_unneeded_vertices(len);
  num_vars = assign_csp_val(len);
  return num_vars;
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <remove_unneeded_vertices@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <assign_csp_val@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <remove_unneeded_vertices@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <assign_csp_val@plt>

LLVM IR (-O0):
define i32 @initialize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @remove_unneeded_vertices to i32 (i32, ...)*)(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 (i32, ...) bitcast (i32 (...)* @assign_csp_val to i32 (i32, ...)*)(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @initialize(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @remove_unneeded_vertices to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @assign_csp_val to i32 (i32, ...)*)(i32 %0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ushort;

/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
ushort *usvector(long nl, long nh) {
  ushort *v;
  v = (ushort *)malloc((size_t)((nh - nl + 1 + 0) * sizeof(ushort)));
  if (!v)
    nrerror("allocation failure in usvector()");
  return v - nl + 0;
}


x86 assembly (clang, -O0):
<usvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x0,%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <usvector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x4(,%rsi,4),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <usvector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x2,%r14
sub    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [33 x i8] c"allocation failure in usvector()\00"
define i32* @usvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 0
%11 = mul i64 %10, 4
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %5
%14 = load i32*, i32** %5
%15 = icmp ne i32* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nrerror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load i32*, i32** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = getelementptr inbounds i32, i32* %22, i64 0
ret i32* %23
}

LLVM IR (-O2):
@.str = [33 x i8] c"allocation failure in usvector()\00"
define i32* @usvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 2
%5 = add i64 %4, 4
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i32*
%12 = sub i64 0, %0
%13 = getelementptr inbounds i32, i32* %11, i64 %12
ret i32* %13
}
int test_imm_A0uint32_reg(unsigned int val) {
  return ((val) & (0xA0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A0uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xa0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_A0uint32_reg(i32 %0) {
%2 = and i32 %0, 160
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int eg_indirect_table_set(unsigned int, int, unsigned int, int, unsigned int *);
int eg_class_lut_table_set(unsigned int dev_id, unsigned int index,
                           unsigned int *pentry) {
  if ((index < 0) || (index > 47)) {
    return -1;
  }
  return eg_indirect_table_set(dev_id, 1, index, 14, pentry);
}


x86 assembly (clang, -O0):
<eg_class_lut_table_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jb     1136 <eg_class_lut_table_set+0x26>
cmpl   $0x2f,-0xc(%rbp)
jbe    1142 <eg_class_lut_table_set+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <eg_class_lut_table_set+0x4e>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    $0x1,%esi
mov    $0xe,%ecx
call   1030 <eg_indirect_table_set@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eg_class_lut_table_set>:
cmp    $0x2f,%esi
jbe    111b <eg_class_lut_table_set+0xb>
mov    $0xffffffff,%eax
ret
mov    %rdx,%r8
mov    %esi,%edx
mov    $0x1,%esi
mov    $0xe,%ecx
jmp    1030 <eg_indirect_table_set@plt>

LLVM IR (-O0):
define i32 @eg_class_lut_table_set(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* %6
%9 = icmp ult i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp ugt i32 %11, 47
br i1 %12, label %13, label %14
13: ; preds = %10, %3
store i32 -1, i32* %4
br label %19
14: ; preds = %10
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = load i32*, i32** %7
%18 = call i32 @eg_indirect_table_set(i32 %15, i32 1, i32 %16, i32 14, i32* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @eg_class_lut_table_set(i32 %0, i32 %1, i32* %2) {
%4 = icmp ugt i32 %1, 47
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @eg_indirect_table_set(i32 %0, i32 1, i32 %1, i32 14, i32* %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ -1, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
char **sys_siglist;
main() {
  char *msg = sys_siglist[2];
  exit(msg == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%rax
xor    %edi,%edi
cmpq   $0x0,0x10(%rax)
sete   %dil
call   1030 <exit@plt>

LLVM IR (-O0):
@sys_siglist = global i8** null
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = load i8**, i8*** @sys_siglist
%4 = getelementptr inbounds i8*, i8** %3, i64 2
%5 = load i8*, i8** %4
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = icmp eq i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@sys_siglist = global i8** null
define i32 @main() {
%1 = load i8**, i8*** @sys_siglist
%2 = getelementptr inbounds i8*, i8** %1, i64 2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @exit(i32 %5)
unreachable
}
int fib(int n) {
  if (n <= 1) {
    return 1;
  } else {
    return fib(n - 1) + fib(n - 2);
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1131 <fib+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <fib+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1145 <fib+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x3,%ebx
ja     1130 <fib+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
double limit_degrees(double);
double greenwich_mean_sidereal_time(double jd, double jc) {
  return limit_degrees(280.46061837 + 360.98564736629 * (jd - 2451545.0) +
                       jc * jc * (0.000387933 - jc / 38710000.0));
}


x86 assembly (clang, -O0):
<greenwich_mean_sidereal_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xef1(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xed5(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xed1(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm3
movsd  0xea6(%rip),%xmm2
divsd  %xmm2,%xmm3
movsd  0xe92(%rip),%xmm2
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <limit_degrees@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greenwich_mean_sidereal_time>:
addsd  0xee8(%rip),%xmm0
mulsd  0xee8(%rip),%xmm0
addsd  0xee8(%rip),%xmm0
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
divsd  0xee0(%rip),%xmm1
addsd  0xee0(%rip),%xmm1
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
jmp    1030 <limit_degrees@plt>

LLVM IR (-O0):
define double @greenwich_mean_sidereal_time(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 = fsub double %5, 0x4142B42C80000000
%7 = call double @llvm.fmuladd.f64(double 0x40768FC5362C39AA, double %6, double 0x4071875EB15E3164)
%8 = load double, double* %4
%9 = load double, double* %4
%10 = fmul double %8, %9
%11 = load double, double* %4
%12 = fdiv double %11, 3.871000e+07
%13 = fsub double 3.879330e-04, %12
%14 = call double @llvm.fmuladd.f64(double %10, double %13, double %7)
%15 = call double @limit_degrees(double %14)
ret double %15
}

LLVM IR (-O2):
define double @greenwich_mean_sidereal_time(double %0, double %1) {
%3 = fadd double %0, 0xC142B42C80000000
%4 = tail call double @llvm.fmuladd.f64(double %3, double 0x40768FC5362C39AA, double 0x4071875EB15E3164)
%5 = fmul double %1, %1
%6 = fdiv double %1, 3.871000e+07
%7 = fsub double 3.879330e-04, %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double %7, double %4)
%9 = tail call double @limit_degrees(double %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x, Distance;
  scanf("%d", &x);
  Distance = x * 2;
  printf("%d minutos\n", Distance);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%d minutos\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = shl nsw i32 %4, 1
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vprintf(char *, int /*<<< orphan*/);
void test1(va_list args) { vprintf("%d %f %ld %c %s %% %x %X %i\n", args); }


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

x86 assembly (clang, -O2):
<test1>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <vprintf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"%d %f %ld %c %s %% %x %X %i\0A\00"
define void @test1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @vprintf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"%d %f %ld %c %s %% %x %X %i\0A\00"
define void @test1(i32 %0) {
%2 = tail call i32 @vprintf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}