xunge/DecIR huggingface dataset:
/* Type definitions */
typedef union wait {
  int dummy;
} wait;
typedef int pid_t;

/* Variables and functions */
int wait4(int, union wait *, int, int /*<<< orphan*/ *);
int waitpid(pid_t pid, int *stat_loc, int options) {
  if (pid == -1)
    pid = 0;
  return wait4(pid, (union wait *)stat_loc, options, NULL);
}


x86 assembly (clang, -O0):
<waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1133 <waitpid+0x23>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <wait4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitpid>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
cmove  %eax,%edi
xor    %ecx,%ecx
jmp    1030 <wait4@plt>

LLVM IR (-O0):
%union.wait = type { i32 }
define i32 @waitpid(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 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %3
store i32 0, i32* %4
br label %10
10: ; preds = %9, %3
%11 = load i32, i32* %4
%12 = load i32*, i32** %5
%13 = bitcast i32* %12 to %union.wait*
%14 = load i32, i32* %6
%15 = call i32 @wait4(i32 %11, %union.wait* %13, i32 %14, i32* null)
ret i32 %15
}

LLVM IR (-O2):
%union.wait = type { i32 }
define i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = icmp eq i32 %0, -1
%5 = select i1 %4, i32 0, i32 %0
%6 = bitcast i32* %1 to %union.wait*
%7 = tail call i32 @wait4(i32 %5, %union.wait* %6, i32 %2, i32* null)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sub_string(int);
void year_string(int year) {
  int r = year % 100;
  year = year / 100;
  sub_string(year);
  printf(" hundred ");
  sub_string(r);
}


x86 assembly (clang, -O0):
<year_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <sub_string@plt>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <sub_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<year_string>:
push   %rbx
movslq %edi,%rbx
imul   $0x51eb851f,%rbx,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x25,%rdi
add    %eax,%edi
imul   $0x64,%edi,%eax
sub    %eax,%ebx
call   1040 <sub_string@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <sub_string@plt>

LLVM IR (-O0):
@.str = [10 x i8] c" hundred \00"
define void @year_string(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 100
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 100
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @sub_string(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %3
%12 = call i32 @sub_string(i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c" hundred \00"
define void @year_string(i32 %0) {
%2 = srem i32 %0, 100
%3 = sdiv i32 %0, 100
%4 = tail call i32 @sub_string(i32 %3)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @sub_string(i32 %2)
ret void
}
int signOf(int num) {
  if (num > 0)
    return 1;
  if (num < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<signOf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111d <signOf+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    113a <signOf+0x3a>
cmpl   $0x0,-0x8(%rbp)
jge    1133 <signOf+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    113a <signOf+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signOf>:
mov    %edi,%ecx
sar    $0x1f,%ecx
test   %edi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @signOf(i32 %0) {
%2 = ashr i32 %0, 31
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 %2, i32 1
ret i32 %4
}
float gegl_floorf(float x) {
  int i = (int)x;
  return i - (i > x);
}


x86 assembly (clang, -O0):
<gegl_floorf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ssl -0x8(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gegl_floorf>:
cvttss2si %xmm0,%eax
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @gegl_floorf(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to float
%9 = load float, float* %2
%10 = fcmp ogt float %8, %9
%11 = zext i1 %10 to i32
%12 = sub nsw i32 %6, %11
%13 = sitofp i32 %12 to float
ret float %13
}

LLVM IR (-O2):
define float @gegl_floorf(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fcmp ogt float %3, %0
%5 = sext i1 %4 to i32
%6 = add i32 %5, %2
%7 = sitofp i32 %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("main [-s|--simulate algorithm(rk4|euler)] [-r|--random "
         "function(mt|crand)] [-n|--restarts nrestarts] [-t|--threads "
         "[nthreads]] [-h|--help]\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [140 x i8] c"main [-s|--simulate algorithm(rk4|euler)] [-r|--random function(mt|crand)] [-n|--restarts nrestarts] [-t|--threads [nthreads]] [-h|--help]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [139 x i8] c"main [-s|--simulate algorithm(rk4|euler)] [-r|--random function(mt|crand)] [-n|--restarts nrestarts] [-t|--threads [nthreads]] [-h|--help]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([139 x i8], [139 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_AddVec3_init(void) {
  _hmt_register_covercase("HMM_AddVec3", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_AddVec3_init>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"HMM_AddVec3\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_AddVec3_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf_putchar(char);
int puts(const char *str) {
  int ret = 0;
  while (*str) {
    printf_putchar(*str++);
    ret++;
  }
  printf_putchar('\n');
  ret++;
  return ret;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1155 <puts+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <printf_putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <puts+0x13>
mov    $0xa,%edi
call   1030 <printf_putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1147 <puts+0x37>
mov    %rdi,%r14
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <printf_putchar@plt>
movzbl (%r14,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <puts+0x20>
jmp    114c <puts+0x3c>
mov    $0x1,%ebx
mov    $0xa,%edi
call   1030 <printf_putchar@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 1, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i32 @printf_putchar(i8 signext %5)
%10 = add i32 %6, 1
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 1, %1 ], [ %10, %4 ]
%15 = tail call i32 @printf_putchar(i8 signext 10)
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
scalar_t__ __VERIFIER_nondet_int();
int main() {
  int x;
  if (__VERIFIER_nondet_int())
    x = 1;
  else
    x = 2;
  __VERIFIER_assert(1 <= x && x <= 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
je     114c <main+0x2c>
movl   $0x1,-0x8(%rbp)
jmp    1153 <main+0x33>
movl   $0x2,-0x8(%rbp)
xor    %eax,%eax
mov    $0x1,%ecx
cmp    -0x8(%rbp),%ecx
mov    %al,-0x9(%rbp)
jg     1170 <main+0x50>
cmpl   $0x2,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 @__VERIFIER_assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void reverse(char *a) {
  if (*(a + 1) != '\0') {
    reverse(a + 1);
  }
  printf("%c", *a);
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     114a <reverse+0x2a>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rax
lea    0xeab(%rip),%rdi
movsbl (%rax),%esi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x0,0x1(%rdi)
je     1133 <reverse+0x13>
lea    0x1(%rbx),%rdi
call   1030 <reverse@plt>
movsbl (%rbx),%esi
lea    0xec3(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @reverse(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %13)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @reverse(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
tail call void @reverse(i8* %2)
br label %6
6: ; preds = %5, %1
%7 = load i8, i8* %0
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: sonic [-s speed] [-v volume] infile outfile\n"
                  "    -s -- Set speed up factor.  1.0 means no change, 2.0 "
                  "means 2X faster\n"
                  "    -v -- Scale volume as percentage of maximum allowed.  "
                  "100 uses full range.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [204 x i8] c"Usage: sonic [-s speed] [-v volume] infile outfile\0A -s -- Set speed up factor. 1.0 means no change, 2.0 means 2X faster\0A -v -- Scale volume as percentage of maximum allowed. 100 uses full range.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([204 x i8], [204 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [204 x i8] c"Usage: sonic [-s speed] [-v volume] infile outfile\0A -s -- Set speed up factor. 1.0 means no change, 2.0 means 2X faster\0A -v -- Scale volume as percentage of maximum allowed. 100 uses full range.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([204 x i8], [204 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void cls(char c[10][10]) {
  int i, j;
  for (i = 0; i < 10; i++)
    for (j = 0; j < 10; j++)
      c[i][j] = ' ';
}


x86 assembly (clang, -O0):
<cls>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1162 <cls+0x62>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    114f <cls+0x4f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <cls+0x20>
jmp    1154 <cls+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <cls+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cls>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movl   $0x20202020,0x60(%rdi)
ret

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

LLVM IR (-O2):
define void @cls([10 x i8]* nocapture writeonly %0) {
%2 = getelementptr [10 x i8], [10 x i8]* %0, i64 0, i64 0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strfcpy(char *dest, const char *src, size_t destlen) {
  strncpy(dest, src, destlen);
  dest[destlen - 1] = 0;
  return dest;
}


x86 assembly (clang, -O0):
<strfcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strfcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strfcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = sub i64 %12, 1
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @strfcpy(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ fault_report(int);
void sig_fault(int sig) { fault_report(sig); }


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

x86 assembly (clang, -O2):
<sig_fault>:
jmp    1030 <fault_report@plt>

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

LLVM IR (-O2):
define void @sig_fault(i32 %0) {
%2 = tail call i32 @fault_report(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
void db_store(const wchar_t *dirname) {}


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

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

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

LLVM IR (-O2):
define void @db_store(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
void f4(int size) {
  char src[12] = "helloworld";
  char dest[12];
  if (size > 0)
    strncpy(dest, src, size);
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1149 <f4+0x39>
lea    -0x1c(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
sub    $0x18,%rsp
movabs $0x726f776f6c6c6568,%rax
77 6f 72
mov    %rax,(%rsp)
movl   $0x646c,0x8(%rsp)
test   %edi,%edi
jle    113d <f4+0x2d>
mov    %edi,%edx
lea    0xc(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <strncpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.f4.src = [12 x i8] c"helloworld\00\00"
define void @f4(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i8]
%4 = alloca [12 x i8]
store i32 %0, i32* %2
%5 = bitcast [12 x i8]* %3 to i8*
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%11 = load i32, i32* %2
%12 = call i32 @strncpy(i8* %9, i8* %10, i32 %11)
br label %13
13: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@__const.f4.src = [12 x i8] c"helloworld\00\00"
define void @f4(i32 %0) {
%2 = alloca [12 x i8]
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @strncpy(i8* %5, i8* %4, i32 %0)
br label %9
9: ; preds = %7, %1
ret void
}
long Absff_Atol(s)
char *s;
{
  long l;
  if (sscanf(s, "%ld", &l) > 0)
    return l;
  else
    return 0.0;
}


x86 assembly (clang, -O0):
<Absff_Atol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <sscanf@plt>
cmp    $0x0,%eax
jle    1148 <Absff_Atol+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1150 <Absff_Atol+0x40>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Absff_Atol>:
push   %rbx
sub    $0x10,%rsp
lea    0xee4(%rip),%rsi
xor    %ebx,%ebx
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1030 <sscanf@plt>
test   %eax,%eax
jle    1133 <Absff_Atol+0x23>
mov    0x8(%rsp),%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define i64 @Absff_Atol(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 (i8*, i8*, ...) @sscanf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %4)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i64, i64* %4
store i64 %9, i64* %2
br label %11
10: ; preds = %1
store i64 0, i64* %2
br label %11
11: ; preds = %10, %8
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i64 @Absff_Atol(i8* nocapture %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
%5 = icmp sgt i32 %4, 0
%6 = load i64, i64* %2
%7 = select i1 %5, i64 %6, i64 0
ret i64 %7
}
int line_isspace(const char *s) {
  for (;;)
    switch (*s++) {
    default:
      return 0;
    case '\0':
      return 1;
    case '\t':
    case ' ':
      break;
    }
}


x86 assembly (clang, -O0):
<line_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     1158 <line_isspace+0x58>
jmp    112a <line_isspace+0x2a>
mov    -0x14(%rbp),%eax
sub    $0x9,%eax
je     1164 <line_isspace+0x64>
jmp    113b <line_isspace+0x3b>
mov    -0x14(%rbp),%eax
sub    $0x20,%eax
je     1164 <line_isspace+0x64>
jmp    114c <line_isspace+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    116e <line_isspace+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    116e <line_isspace+0x6e>
jmp    1169 <line_isspace+0x69>
jmp    1108 <line_isspace+0x8>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_isspace>:
jmp    1114 <line_isspace+0x14>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rdi
movsbl (%rdi),%eax
cmp    $0x9,%eax
je     1110 <line_isspace+0x10>
cmp    $0x20,%eax
je     1110 <line_isspace+0x10>
test   %eax,%eax
jne    112b <line_isspace+0x2b>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @line_isspace(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %3
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
switch i32 %8, label %9 [
i32 0, label %10
i32 9, label %11
i32 32, label %11
]
9: ; preds = %4
store i32 0, i32* %2
br label %13
10: ; preds = %4
store i32 1, i32* %2
br label %13
11: ; preds = %4, %4
br label %12
12: ; preds = %11
br label %4
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @line_isspace(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %8 [
i32 0, label %9
i32 9, label %6
i32 32, label %6
]
6: ; preds = %2, %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
br label %9
9: ; preds = %2, %8
%10 = phi i32 [ 0, %8 ], [ 1, %2 ]
ret i32 %10
}
/* Variables and functions */
int strlen(char const *);
char getStackTop(const char *stack) {
  if (strlen(stack)) {
    return stack[strlen(stack) - 1];
  }
  return '\0';
}


x86 assembly (clang, -O0):
<getStackTop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
je     1156 <getStackTop+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
jmp    115a <getStackTop+0x4a>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStackTop>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
je     112d <getStackTop+0x1d>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
mov    -0x1(%rax,%rbx,1),%al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @getStackTop(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
br label %10
10: ; preds = %1, %4
%11 = phi i8 [ %9, %4 ], [ 0, %1 ]
ret i8 %11
}
/* Variables and functions */
int /*<<< orphan*/ nsc_assert(int);
void Debugger(void) {
  nsc_assert(0 && "This function is unimplemented.");
  ;
}


x86 assembly (clang, -O0):
<Debugger>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Debugger>:
xor    %edi,%edi
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
define void @Debugger() {
%1 = call i32 @nsc_assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @Debugger() {
%1 = tail call i32 @nsc_assert(i32 0)
ret void
}
/* Type definitions */
struct rig_t {
  int dummy;
};

/* Variables and functions */
int post_event(struct rig_t *, int);
int rig_quit(struct rig_t *rig) { return post_event(rig, 1); }


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

x86 assembly (clang, -O2):
<rig_quit>:
mov    $0x1,%esi
jmp    1030 <post_event@plt>

LLVM IR (-O0):
%struct.rig_t = type { i32 }
define i32 @rig_quit(%struct.rig_t* %0) {
%2 = alloca %struct.rig_t*
store %struct.rig_t* %0, %struct.rig_t** %2
%3 = load %struct.rig_t*, %struct.rig_t** %2
%4 = call i32 @post_event(%struct.rig_t* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
%struct.rig_t = type { i32 }
define i32 @rig_quit(%struct.rig_t* %0) {
%2 = tail call i32 @post_event(%struct.rig_t* %0, i32 1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_equal(int /*<<< orphan*/, int /*<<< orphan*/);
int _thread_compare(const void *a, const void *b) {
  return !pthread_equal(*(pthread_t *)a, *(pthread_t *)b);
}


x86 assembly (clang, -O0):
<_thread_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <pthread_equal@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_thread_compare>:
push   %rax
mov    (%rdi),%edi
mov    (%rsi),%esi
call   1030 <pthread_equal@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_thread_compare(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 = call i32 @pthread_equal(i32 %7, i32 %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @_thread_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @pthread_equal(i32 %4, i32 %6)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int sesInit(int cSocket) {
  if (1) {
    write(cSocket, "220 inf122518_smtp_server\r\n", 28);
    return (0);
  } else {
    write(cSocket, "554 connection rejected\r\n", 28);
    return (-1);
  }
}


x86 assembly (clang, -O0):
<sesInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x1c,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sesInit>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1c,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"220 inf122518_smtp_server\0D\0A\00"
define i32 @sesInit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @write(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 28)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"220 inf122518_smtp_server\0D\0A\00"
define i32 @sesInit(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 28)
ret i32 0
}
/* Variables and functions */
scalar_t__ calloc(int const, int);
float *new_lp_zero(const int m, const int n) {
  return (float *)calloc(m * n * sizeof(float), 1);
}


x86 assembly (clang, -O0):
<new_lp_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_lp_zero>:
imul   %esi,%edi
shl    $0x2,%edi
mov    $0x1,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define float* @new_lp_zero(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
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 4
%10 = trunc i64 %9 to i32
%11 = call i64 @calloc(i32 %10, i32 1)
%12 = inttoptr i64 %11 to float*
ret float* %12
}

LLVM IR (-O2):
define float* @new_lp_zero(i32 %0, i32 %1) {
%3 = shl i32 %0, 2
%4 = mul i32 %3, %1
%5 = tail call i64 @calloc(i32 %4, i32 1)
%6 = inttoptr i64 %5 to float*
ret float* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("MBEDTLS_SSL_SRV_C and/or MBEDTLS_SSL_PROTO_DTLS and/or "
         "MBEDTLS_SSL_COOKIE_C and/or MBEDTLS_NET_C and/or "
         "MBEDTLS_ENTROPY_C and/or MBEDTLS_CTR_DRBG_C and/or "
         "MBEDTLS_X509_CRT_PARSE_C and/or MBEDTLS_RSA_C and/or "
         "MBEDTLS_CERTS_C and/or MBEDTLS_PEM_PARSE_C and/or "
         "MBEDTLS_TIMING_C not defined.\n");
  return (0);
}


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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [289 x i8] c"MBEDTLS_SSL_SRV_C and/or MBEDTLS_SSL_PROTO_DTLS and/or MBEDTLS_SSL_COOKIE_C and/or MBEDTLS_NET_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_CTR_DRBG_C and/or MBEDTLS_X509_CRT_PARSE_C and/or MBEDTLS_RSA_C and/or MBEDTLS_CERTS_C and/or MBEDTLS_PEM_PARSE_C and/or MBEDTLS_TIMING_C not defined.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([289 x i8], [289 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [288 x i8] c"MBEDTLS_SSL_SRV_C and/or MBEDTLS_SSL_PROTO_DTLS and/or MBEDTLS_SSL_COOKIE_C and/or MBEDTLS_NET_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_CTR_DRBG_C and/or MBEDTLS_X509_CRT_PARSE_C and/or MBEDTLS_RSA_C and/or MBEDTLS_CERTS_C and/or MBEDTLS_PEM_PARSE_C and/or MBEDTLS_TIMING_C not defined.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([288 x i8], [288 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, char);
scalar_t__ scanf(char *, char *);
int main() {
  char c;
  while (scanf("%c", &c) != EOF) {
    if (c != ' ')
      printf("%c", c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     1171 <main+0x51>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     116c <main+0x4c>
lea    0xe9d(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea7(%rip),%r15
cmp    (%r15),%rax
jne    1152 <main+0x32>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xea7(%rip),%rbx
lea    0xf(%rsp),%r14
jmp    1170 <main+0x50>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
cmp    (%r15),%rax
je     1146 <main+0x26>
movzbl 0xf(%rsp),%eax
cmp    $0x20,%al
je     1160 <main+0x40>
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1160 <main+0x40>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %14, %0
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %15
7: ; preds = %3
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 32
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8, i8* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %12)
br label %14
14: ; preds = %11, %7
br label %3
15: ; preds = %3
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i8
%2 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i64, i64* @EOF
%4 = icmp eq i64 %2, %3
br i1 %4, label %14, label %5
5: ; preds = %0, %10
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, 32
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %6)
br label %10
10: ; preds = %8, %5
%11 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%12 = load i64, i64* @EOF
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %5
14: ; preds = %10, %0
ret i32 0
}
void *cast_test_float() {
  double *y = (double *)malloc(sizeof(double));
  *y = 3.21;
  return y;
}


x86 assembly (clang, -O0):
<cast_test_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xece(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_test_float>:
push   %rax
mov    $0x8,%edi
call   1030 <malloc@plt>
movabs $0x4009ae147ae147ae,%rcx
ae 09 40
mov    %rcx,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @cast_test_float() {
%1 = alloca double*
%2 = call i8* @malloc(i64 8)
%3 = bitcast i8* %2 to double*
store double* %3, double** %1
%4 = load double*, double** %1
store double 3.210000e+00, double* %4
%5 = load double*, double** %1
%6 = bitcast double* %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @cast_test_float() {
%1 = tail call dereferenceable_or_null(8) i8* @malloc(i64 8)
%2 = bitcast i8* %1 to double*
store double 3.210000e+00, double* %2
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ vga_early_init();
void kmain() {
  vga_early_init();
  while (1) {
  }
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <vga_early_init@plt>
jmp    111b <kmain+0xb>

x86 assembly (clang, -O2):
<kmain>:
push   %rax
xor    %eax,%eax
call   1030 <vga_early_init@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <kmain+0x10>

LLVM IR (-O0):
define void @kmain() {
%1 = call i32 (...) @vga_early_init()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @kmain() {
%1 = tail call i32 (...) @vga_early_init()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ __arm64_clear_cache(char *, char *);
void __clear_cache(char *beg, char *end) { __arm64_clear_cache(beg, end); }


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

x86 assembly (clang, -O2):
<__clear_cache>:
jmp    1030 <__arm64_clear_cache@plt>

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

LLVM IR (-O2):
define void @__clear_cache(i8* %0, i8* %1) {
%3 = tail call i32 @__arm64_clear_cache(i8* %0, i8* %1)
ret void
}
int func2() { return 2; }


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @func2() {
ret i32 2
}

LLVM IR (-O2):
define i32 @func2() {
ret i32 2
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ sig_action(int, int /*<<< orphan*/ *, void *, char *,
                              char *);
void sigfpe_action(int number, siginfo_t *info, void *data) {
  sig_action(number, info, data, "Floating Point Exception",
             "Your application crashed due a floating point exception.");
}


x86 assembly (clang, -O0):
<sigfpe_action>:
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
lea    0xecb(%rip),%rcx
lea    0xedd(%rip),%r8
call   1030 <sig_action@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigfpe_action>:
lea    0xee9(%rip),%rcx
lea    0xefb(%rip),%r8
jmp    1030 <sig_action@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Floating Point Exception\00"
@.str.1 = [57 x i8] c"Your application crashed due a floating point exception.\00"
define void @sigfpe_action(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = load i8*, i8** %6
%10 = call i32 @sig_action(i32 %7, i32* %8, i8* %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Floating Point Exception\00"
@.str.1 = [57 x i8] c"Your application crashed due a floating point exception.\00"
define void @sigfpe_action(i32 %0, i32* %1, i8* %2) {
%4 = tail call i32 @sig_action(i32 %0, i32* %1, i8* %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int anios;
  int edad;
  printf("Ingresar tu edad \n");
  scanf("%d", &anios);
  edad = anios * 365;
  printf("Tienes %d dias de edad \n", edad);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
imul   $0x16d,0x4(%rsp),%esi
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"Tienes %d dias de edad \0A\00"
@str = [18 x i8] c"Ingresar tu edad \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, 365
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ test_shuffle();
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL));
  int counter = 0;
  if (!test_shuffle()) {
    printf("Shuffle test failed!\n");
    counter++;
  }
  printf("%d tests failed.\n", counter);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <test_shuffle@plt>
cmp    $0x0,%eax
jne    118d <main+0x4d>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
xor    %eax,%eax
call   1050 <test_shuffle@plt>
test   %eax,%eax
jne    117d <main+0x2d>
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
lea    0xe7c(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Shuffle test failed!\0A\00"
@.str.1 = [18 x i8] c"%d tests failed.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
store i32 0, i32* %2
%5 = call i32 (...) @test_shuffle()
%6 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %11
11: ; preds = %7, %0
%12 = load i32, i32* %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"%d tests failed.\0A\00"
@str = [21 x i8] c"Shuffle test failed!\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @test_shuffle()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = phi i32 [ 0, %0 ], [ 1, %5 ]
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
int rational_norm(long double *x) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rational_norm(x86_fp80* nocapture readnone %0) {
ret i32 0
}