// File: /workspace/github_cpp_makefile_star2_O2/yohm[P]dynamical_graph_model/main.cpp
// Function: main
int main (int argc, char* argv[]) {

  if(argc != 5) {
    std::cerr << "Usage : ./main.out <connectance> <t_init> <t_measure> <seed>" << std::endl;
    exit(1);
  }

  const double connectance = std::stod(argv[1]);
  const uint32_t t_init = std::stoul(argv[2]);
  const uint32_t t_measure = std::stoul(argv[3]);
  const uint64_t seed = std::stoull(argv[4]);
  
  std::cerr << "Lists of given parameters are as follows:" << std::endl
            << "connectance:\t" << connectance << std::endl
            << "t_init:\t" << t_init << std::endl
            << "t_measure:\t" << t_measure << std::endl
            << "seed:\t" << seed << std::endl;

  //ofstreams
  DynamicalGraph dg( seed, connectance);
  std::clock_t start = std::clock();
  dg.Run(t_init, t_measure);
  dg.LifetimeHistoOutput("lifetime.dat");
  dg.DiversityHistoOutput("diversity_histo.dat");
  dg.ExtinctionSizeHistoOutput("extinction_histo.dat");
  std::ofstream json("_output.json");
  json << "{ \"diversity\": " << dg.AverageDiversity()
       << ", \"link_density\": " << dg.AverageLinkDensity()
       << ", \"CC\": " << dg.AverageCC() << " }" << std::endl;
  json.close();
  std::clock_t end = std::clock();
  std::cerr << "elapsed time : " << static_cast<double>(end-start)/CLOCKS_PER_SEC << std::endl;

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x338, %rsp            # imm = 0x338
cmpl $0x5, %edi
jne 0x35a0
movq %rsi, %rbx
movq 0x8(%rsi), %rsi
leaq 0x138(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x2080
leaq 0x138(%rsp), %rdi
xorl %esi, %esi
callq 0x3779
movsd %xmm0, 0x8(%rsp)
leaq 0x138(%rsp), %rdi
callq 0x20a0
movq 0x10(%rbx), %rsi
leaq 0x138(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x2080
leaq 0x138(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x3792
movq %rax, %r14
leaq 0x138(%rsp), %rdi
callq 0x20a0
movq 0x18(%rbx), %rsi
leaq 0x138(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x2080
leaq 0x138(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x3792
movq %rax, %r15
leaq 0x138(%rsp), %rdi
callq 0x20a0
movq 0x20(%rbx), %rsi
leaq 0x138(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x2080
leaq 0x138(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x37ae
movq %rax, %rbx
leaq 0x138(%rsp), %rdi
callq 0x20a0
movq 0x4ca5(%rip), %rdi      # 0x7ff0
leaq 0x1d7d(%rip), %rsi      # 0x50cf
callq 0x21a0
movq %rax, %rdi
callq 0x20b0
leaq 0x1d93(%rip), %rsi      # 0x50f9
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x2280
movq %rax, %rdi
callq 0x20b0
leaq 0x1d7c(%rip), %rsi      # 0x5107
movq %rax, %rdi
callq 0x21a0
movl %r14d, %esi
movq %rax, %rdi
callq 0x2110
movq %rax, %rdi
callq 0x20b0
leaq 0x1d63(%rip), %rsi      # 0x5110
movq %rax, %rdi
callq 0x21a0
movl %r15d, %esi
movq %rax, %rdi
callq 0x2110
movq %rax, %rdi
callq 0x20b0
leaq 0x1d4d(%rip), %rsi      # 0x511c
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2110
movq %rax, %rdi
callq 0x20b0
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x28b6
callq 0x2100
movq %rax, %rbx
movq %r12, %rdi
movl %r14d, %esi
movl %r15d, %edx
callq 0x2a14
leaq 0x1d06(%rip), %rsi      # 0x5123
leaq 0x10(%rsp), %rdi
callq 0x303c
leaq 0x1d02(%rip), %rsi      # 0x5130
leaq 0x10(%rsp), %rdi
callq 0x3100
leaq 0x1d05(%rip), %rsi      # 0x5144
leaq 0x10(%rsp), %rdi
callq 0x30a0
leaq 0x1d09(%rip), %rsi      # 0x5159
leaq 0x138(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0x21d0
leaq 0x1cff(%rip), %rsi      # 0x5166
leaq 0x138(%rsp), %rdi
callq 0x21a0
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x3164
movq %r14, %rdi
callq 0x2280
leaq 0x1ce6(%rip), %rsi      # 0x5176
movq %rax, %rdi
callq 0x21a0
movsd 0x128(%rsp), %xmm0
movsd 0x130(%rsp), %xmm1
unpcklps 0x1b7f(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1b87(%rip), %xmm1     # 0x5040
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq %rax, %rdi
callq 0x2280
leaq 0x1cb1(%rip), %rsi      # 0x5189
movq %rax, %rdi
callq 0x21a0
movsd 0x118(%rsp), %xmm0
movsd 0x120(%rsp), %xmm1
unpcklps 0x1b37(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1b3f(%rip), %xmm1     # 0x5040
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq %rax, %rdi
callq 0x2280
leaq 0x1c72(%rip), %rsi      # 0x5192
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20b0
leaq 0x138(%rsp), %rdi
callq 0x2220
callq 0x2100
movq %rax, %r14
movq 0x4aa4(%rip), %rdi      # 0x7ff0
leaq 0x1c42(%rip), %rsi      # 0x5195
callq 0x21a0
subq %rbx, %r14
cvtsi2sd %r14, %xmm0
divsd 0x1ab0(%rip), %xmm0     # 0x5018
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
callq 0x20b0
leaq 0x138(%rsp), %rdi
callq 0x2250
leaq 0x10(%rsp), %rdi
callq 0x37ca
xorl %eax, %eax
addq $0x338, %rsp            # imm = 0x338
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x4a49(%rip), %rdi      # 0x7ff0
leaq 0x1ae4(%rip), %rsi      # 0x5092
callq 0x21a0
movq %rax, %rdi
callq 0x20b0
pushq $0x1
popq %rdi
callq 0x2200
jmp 0x35ea
jmp 0x35d1
jmp 0x35e3
jmp 0x35d1
jmp 0x35e3
jmp 0x35d1
jmp 0x35e3
movq %rax, %rbx
leaq 0x138(%rsp), %rdi
callq 0x20a0
jmp 0x3609
movq %rax, %rbx
jmp 0x3609
jmp 0x35ef
movq %rax, %rbx
jmp 0x35ff
movq %rax, %rbx
leaq 0x138(%rsp), %rdi
callq 0x2250
leaq 0x10(%rsp), %rdi
callq 0x37ca
movq %rbx, %rdi
callq 0x22c0
nop