#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 */

/* Variables and functions */
int /*<<< orphan*/ calculateMandelbrotScalar();
int /*<<< orphan*/ calculateMandelbrotVectorised();
int /*<<< orphan*/ runProjectionBenchmarkScalar();
int /*<<< orphan*/ runProjectionBenchmarkVectorised();
int /*<<< orphan*/ writeString(char *);
int main(void) {
  writeString("Hi!\n");
  writeString("Performing scalar tests: \n");
  writeString("Calculating Mandelbrot...\n");
  calculateMandelbrotScalar();
  writeString("Doing projection benchmark...\n");
  runProjectionBenchmarkScalar();
  writeString("Done. Performing vectorised tests: \n");
  writeString("Calculating Mandelbrot...\n");
  calculateMandelbrotVectorised();
  writeString("Doing projection benchmark...\n");
  runProjectionBenchmarkVectorised();
  writeString("Done. Have a nice day!\n");
  while (1) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1050 <writeString@plt>
lea    0xe93(%rip),%rdi
call   1050 <writeString@plt>
lea    0xea2(%rip),%rdi
call   1050 <writeString@plt>
mov    $0x0,%al
call   1070 <calculateMandelbrotScalar@plt>
lea    0xeaa(%rip),%rdi
call   1050 <writeString@plt>
mov    $0x0,%al
call   1030 <runProjectionBenchmarkScalar@plt>
lea    0xeb6(%rip),%rdi
call   1050 <writeString@plt>
lea    0xe70(%rip),%rdi
call   1050 <writeString@plt>
mov    $0x0,%al
call   1040 <calculateMandelbrotVectorised@plt>
lea    0xe78(%rip),%rdi
call   1050 <writeString@plt>
mov    $0x0,%al
call   1060 <runProjectionBenchmarkVectorised@plt>
lea    0xea9(%rip),%rdi
call   1050 <writeString@plt>
jmp    11db <main+0x8b>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xea5(%rip),%rdi
call   1050 <writeString@plt>
lea    0xe9e(%rip),%rdi
call   1050 <writeString@plt>
lea    0xead(%rip),%r14
mov    %r14,%rdi
call   1050 <writeString@plt>
xor    %eax,%eax
call   1070 <calculateMandelbrotScalar@plt>
lea    0xeb2(%rip),%rbx
mov    %rbx,%rdi
call   1050 <writeString@plt>
xor    %eax,%eax
call   1030 <runProjectionBenchmarkScalar@plt>
lea    0xebb(%rip),%rdi
call   1050 <writeString@plt>
mov    %r14,%rdi
call   1050 <writeString@plt>
xor    %eax,%eax
call   1040 <calculateMandelbrotVectorised@plt>
mov    %rbx,%rdi
call   1050 <writeString@plt>
xor    %eax,%eax
call   1060 <runProjectionBenchmarkVectorised@plt>
lea    0xeb6(%rip),%rdi
call   1050 <writeString@plt>
xchg   %ax,%ax
jmp    11d0 <main+0x80>

LLVM IR (-O0):
@.str = [5 x i8] c"Hi!\0A\00"
@.str.1 = [27 x i8] c"Performing scalar tests: \0A\00"
@.str.2 = [27 x i8] c"Calculating Mandelbrot...\0A\00"
@.str.3 = [31 x i8] c"Doing projection benchmark...\0A\00"
@.str.4 = [37 x i8] c"Done. Performing vectorised tests: \0A\00"
@.str.5 = [24 x i8] c"Done. Have a nice day!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @writeString(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @writeString(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @writeString(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (...) @calculateMandelbrotScalar()
%6 = call i32 @writeString(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 (...) @runProjectionBenchmarkScalar()
%8 = call i32 @writeString(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @writeString(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (...) @calculateMandelbrotVectorised()
%11 = call i32 @writeString(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (...) @runProjectionBenchmarkVectorised()
%13 = call i32 @writeString(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
br label %14
14: ; preds = %0, %14
br label %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"Hi!\0A\00"
@.str.1 = [27 x i8] c"Performing scalar tests: \0A\00"
@.str.2 = [27 x i8] c"Calculating Mandelbrot...\0A\00"
@.str.3 = [31 x i8] c"Doing projection benchmark...\0A\00"
@.str.4 = [37 x i8] c"Done. Performing vectorised tests: \0A\00"
@.str.5 = [24 x i8] c"Done. Have a nice day!\0A\00"
define i32 @main() {
%1 = tail call i32 @writeString(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @writeString(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @writeString(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (...) @calculateMandelbrotScalar()
%5 = tail call i32 @writeString(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 (...) @runProjectionBenchmarkScalar()
%7 = tail call i32 @writeString(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%8 = tail call i32 @writeString(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 (...) @calculateMandelbrotVectorised()
%10 = tail call i32 @writeString(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%11 = tail call i32 (...) @runProjectionBenchmarkVectorised()
%12 = tail call i32 @writeString(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
br label %13
13: ; preds = %0, %13
br label %13
}