// File: mateuz[P]MTS-LS1/source/main.cpp
// Function: main
int main(){
  /*  Test the basic benchmark function */
  Benchmarks * fp = NULL;
  vector<double> runTimeVec;
  struct timeval start, end;
  long seconds, useconds;
  double mtime;

  fp = new F12(); //generateFuncObj(12);

  std::default_random_engine generator;
  std::uniform_real_distribution<double> distribution(fp->getMinX(), fp->getMaxX());

  vector<double> sol(dim);
  for( unsigned i = 0; i < dim; i++ ){
    sol[i] = distribution(generator);
  }

  printf("F %d value = %1.20E\n", fp->getID(), fp->compute(sol.data()));

  gettimeofday(&start, NULL);
  fp->compute(sol.data());
  gettimeofday(&end, NULL);

  seconds  = end.tv_sec  - start.tv_sec;
  useconds = end.tv_usec - start.tv_usec;

  mtime = (((seconds) * 1000 + useconds/1000.0) + 0.5)/1000;

  runTimeVec.push_back(mtime);
  printf ( "F %d, Running Time = %f s\n\n", fp->getID(), mtime);

  mts_ls1(fp, 1e6, sol);

  printf("F %d value = %1.20E\n", fp->getID(), fp->compute(sol.data()));

  delete fp;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movl $0x0, -0x4(%rbp)
movq $0x0, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x10560
movl $0x100, %edi            # imm = 0x100
callq 0x31e0
movq %rax, -0xb0(%rbp)
jmp 0xd3c6
movq -0xb0(%rbp), %rdi
callq 0x9670
jmp 0xd3d4
movq -0xb0(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x10580
jmp 0xd3ea
movq -0x10(%rbp), %rdi
callq 0x72d0
movl %eax, -0xb4(%rbp)
jmp 0xd3fb
movl -0xb4(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0xc0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x72f0
movl %eax, -0xb8(%rbp)
jmp 0xd41e
movsd -0xc0(%rbp), %xmm0
movl -0xb8(%rbp), %eax
cvtsi2sd %eax, %xmm1
leaq -0x88(%rbp), %rdi
callq 0x105a0
jmp 0xd43e
movl 0xcd84(%rip), %eax      # 0x1a1c8
movq %rax, -0xd0(%rbp)
leaq -0xa1(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x101d0
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0x101f0
jmp 0xd47a
leaq -0xa1(%rbp), %rdi
callq 0x10260
movl $0x0, -0xa8(%rbp)
movl -0xa8(%rbp), %eax
cmpl 0xcd2c(%rip), %eax      # 0x1a1c8
jae 0xd555
leaq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x105d0
movsd %xmm0, -0xd8(%rbp)
jmp 0xd4bc
movl -0xa8(%rbp), %eax
movl %eax, %esi
leaq -0xa0(%rbp), %rdi
callq 0xfe40
movsd -0xd8(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0xa8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa8(%rbp)
jmp 0xd490
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0xd752
movq -0xb0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
callq 0x31b0
jmp 0xd752
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xa1(%rbp), %rdi
callq 0x10260
jmp 0xd752
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x10150
jmp 0xd752
movq -0x10(%rbp), %rdi
callq 0x6330
movl %eax, -0xdc(%rbp)
jmp 0xd566
movq -0x10(%rbp), %rax
movq %rax, -0xf0(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0xfee0
movq -0xf0(%rbp), %rdi
movq %rax, %rsi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movsd %xmm0, -0xe8(%rbp)
jmp 0xd59a
movsd -0xe8(%rbp), %xmm0
movl -0xdc(%rbp), %esi
leaq 0x5cef(%rip), %rdi      # 0x1329e
movb $0x1, %al
callq 0x3050
jmp 0xd5b8
xorl %eax, %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
callq 0x32c0
movq -0x10(%rbp), %rax
movq %rax, -0xf8(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0xfee0
movq -0xf8(%rbp), %rdi
movq %rax, %rsi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
jmp 0xd5f1
xorl %eax, %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0x32c0
movq -0x48(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
cvtsi2sd %rax, %xmm0
cvtsi2sdq -0x58(%rbp), %xmm2
movsd 0x5bde(%rip), %xmm1     # 0x13218
divsd %xmm1, %xmm2
addsd %xmm2, %xmm0
movsd 0x59de(%rip), %xmm2     # 0x13028
addsd %xmm2, %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x10600
jmp 0xd666
movq -0x10(%rbp), %rdi
callq 0x6330
movl %eax, -0xfc(%rbp)
jmp 0xd677
movl -0xfc(%rbp), %esi
movsd -0x60(%rbp), %xmm0
leaq 0x5c2a(%rip), %rdi      # 0x132b3
movb $0x1, %al
callq 0x3050
jmp 0xd692
movq -0x10(%rbp), %rdi
movl $0xf4240, %esi          # imm = 0xF4240
leaq -0xa0(%rbp), %rdx
callq 0xc930
jmp 0xd6a9
movq -0x10(%rbp), %rdi
callq 0x6330
movl %eax, -0x100(%rbp)
jmp 0xd6ba
movq -0x10(%rbp), %rax
movq %rax, -0x110(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0xfee0
movq -0x110(%rbp), %rdi
movq %rax, %rsi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movsd %xmm0, -0x108(%rbp)
jmp 0xd6ee
movsd -0x108(%rbp), %xmm0
movl -0x100(%rbp), %esi
leaq 0x5b9b(%rip), %rdi      # 0x1329e
movb $0x1, %al
callq 0x3050
jmp 0xd70c
movq -0x10(%rbp), %rax
movq %rax, -0x118(%rbp)
cmpq $0x0, %rax
je 0xd72a
movq -0x118(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movl $0x0, -0x4(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x10150
leaq -0x28(%rbp), %rdi
callq 0x10150
movl -0x4(%rbp), %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x10150
movq -0x68(%rbp), %rdi
callq 0x3320
nopw %cs:(%rax,%rax)