#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void printHeader(int density, double maxRadius) {
  time_t genTime;
  time(&genTime);
  printf(";Two-Spirals Benchmark\n");
  printf(";Generated: %s", asctime(localtime(&genTime)));
  printf(";Density:   %d\n", density);
  printf(";Radius:    %.2f\n\n", maxRadius);
  printf(";Program by: Matt White  (mwhite+@cmu.edu)\n");
  printf(";Benchmark by: Alexis Wieland of MITRE Corporation\n");
  printf(";  Any questions should be directed to neural-bench@cs.cmu.edu.");
  printf("\n\n");
  printf("$SETUP\n\n");
  printf("PROTOCOL: IO;\n");
  printf("OFFSET: 0;\n");
  printf("INPUTS: 2;\n");
  printf("OUTPUTS: 1;\n\n");
  printf("IN [1]: CONT {%.2f,-%.2f};\n", maxRadius, maxRadius);
  printf("IN [2]: CONT {%.2f,-%.2f};\n\n", maxRadius, maxRadius);
  printf("OUT [1]: BINARY;\n\n\n");
  printf("$TRAIN\n\n");
}


x86 assembly (clang, -O0):
<printHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1060 <time@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
mov    %rax,%rsi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xe92(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf95(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xeed(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xef1(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
lea    0xf00(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf06(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHeader>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %edi,%ebp
lea    0x14(%rsp),%rbx
mov    %rbx,%rdi
call   1070 <time@plt>
lea    0xf39(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1050 <asctime@plt>
lea    0xe73(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe71(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe71(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
lea    0xf00(%rip),%rdi
call   1040 <puts@plt>
lea    0xf1f(%rip),%rdi
call   1040 <puts@plt>
lea    0xe58(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xf82(%rip),%rdi
call   1040 <puts@plt>
lea    0xf2c(%rip),%rdi
call   1040 <puts@plt>
lea    0xf28(%rip),%rdi
call   1040 <puts@plt>
lea    0xf2a(%rip),%rdi
call   1040 <puts@plt>
lea    0xf29(%rip),%rdi
call   1040 <puts@plt>
lea    0xf28(%rip),%rdi
call   1040 <puts@plt>
lea    0xe42(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1060 <printf@plt>
lea    0xe47(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1060 <printf@plt>
lea    0xefb(%rip),%rdi
call   1040 <puts@plt>
lea    0xf02(%rip),%rdi
call   1040 <puts@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c";Two-Spirals Benchmark\0A\00"
@.str.1 = [15 x i8] c";Generated: %s\00"
@.str.2 = [16 x i8] c";Density: %d\0A\00"
@.str.3 = [19 x i8] c";Radius: %.2f\0A\0A\00"
@.str.4 = [44 x i8] c";Program by: Matt White (mwhite+@cmu.edu)\0A\00"
@.str.5 = [52 x i8] c";Benchmark by: Alexis Wieland of MITRE Corporation\0A\00"
@.str.6 = [64 x i8] c"; Any questions should be directed to neural-bench@cs.cmu.edu.\00"
@.str.7 = [3 x i8] c"\0A\0A\00"
@.str.8 = [9 x i8] c"$SETUP\0A\0A\00"
@.str.9 = [15 x i8] c"PROTOCOL: IO;\0A\00"
@.str.10 = [12 x i8] c"OFFSET: 0;\0A\00"
@.str.11 = [12 x i8] c"INPUTS: 2;\0A\00"
@.str.12 = [14 x i8] c"OUTPUTS: 1;\0A\0A\00"
@.str.13 = [28 x i8] c"IN [1]: CONT {%.2f,-%.2f};\0A\00"
@.str.14 = [29 x i8] c"IN [2]: CONT {%.2f,-%.2f};\0A\0A\00"
@.str.15 = [20 x i8] c"OUT [1]: BINARY;\0A\0A\0A\00"
@.str.16 = [9 x i8] c"$TRAIN\0A\0A\00"
define void @printHeader(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
store i32 %0, i32* %3
store double %1, double* %4
%6 = call i32 @time(i32* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @localtime(i32* %5)
%9 = call i8* @asctime(i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load double, double* %4
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), double %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.6, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0))
%24 = load double, double* %4
%25 = load double, double* %4
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0), double %24, double %25)
%27 = load double, double* %4
%28 = load double, double* %4
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0), double %27, double %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c";Generated: %s\00"
@.str.2 = [16 x i8] c";Density: %d\0A\00"
@.str.3 = [19 x i8] c";Radius: %.2f\0A\0A\00"
@.str.6 = [64 x i8] c"; Any questions should be directed to neural-bench@cs.cmu.edu.\00"
@.str.13 = [28 x i8] c"IN [1]: CONT {%.2f,-%.2f};\0A\00"
@.str.14 = [29 x i8] c"IN [2]: CONT {%.2f,-%.2f};\0A\0A\00"
@str = [23 x i8] c";Two-Spirals Benchmark\00"
@str.17 = [43 x i8] c";Program by: Matt White (mwhite+@cmu.edu)\00"
@str.18 = [51 x i8] c";Benchmark by: Alexis Wieland of MITRE Corporation\00"
@str.19 = [2 x i8] c"\0A\00"
@str.20 = [8 x i8] c"$SETUP\0A\00"
@str.21 = [14 x i8] c"PROTOCOL: IO;\00"
@str.22 = [11 x i8] c"OFFSET: 0;\00"
@str.23 = [11 x i8] c"INPUTS: 2;\00"
@str.24 = [13 x i8] c"OUTPUTS: 1;\0A\00"
@str.25 = [19 x i8] c"OUT [1]: BINARY;\0A\0A\00"
@str.26 = [8 x i8] c"$TRAIN\0A\00"
define void @printHeader(i32 %0, double %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @time(i32* %3)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%7 = call i32 @localtime(i32* %3)
%8 = call i8* @asctime(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %0)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), double %1)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.17, i64 0, i64 0))
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.18, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.6, i64 0, i64 0))
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.19, i64 0, i64 0))
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.20, i64 0, i64 0))
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.21, i64 0, i64 0))
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.22, i64 0, i64 0))
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.23, i64 0, i64 0))
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.24, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0), double %1, double %1)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0), double %1, double %1)
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.25, i64 0, i64 0))
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.26, i64 0, i64 0))
ret void
}