// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x348, %rsp            # imm = 0x348
cmpl $0x5, %edi
jne 0x3c5e
movq %rsi, %r12
movq 0x8(%rsi), %rsi
leaq 0x148(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x20a0
movq 0x148(%rsp), %rbx
callq 0x2040
movq %rax, %r15
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0x20(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2180
cmpq %rbx, (%r14)
je 0x3c83
movl (%r15), %eax
testl %eax, %eax
movsd %xmm0, 0x8(%rsp)
je 0x370a
cmpl $0x22, %eax
jne 0x370d
leaq 0x1af0(%rip), %rdi      # 0x51f5
callq 0x22a0
movl %ebp, (%r15)
leaq 0x158(%rsp), %rbx
movq -0x10(%rbx), %rdi
cmpq %rbx, %rdi
je 0x3723
callq 0x21e0
movq 0x10(%r12), %rsi
leaq 0x148(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x20a0
movq 0x148(%rsp), %r14
movl (%r15), %ebp
movl $0x0, (%r15)
leaq 0x20(%rsp), %r13
movq %r14, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x2070
cmpq %r14, (%r13)
je 0x3c8f
movl (%r15), %ecx
testl %ecx, %ecx
movq %rax, 0x18(%rsp)
je 0x3788
cmpl $0x22, %ecx
jne 0x378b
leaq 0x1a77(%rip), %rdi      # 0x51fa
callq 0x22a0
movl %ebp, (%r15)
movq 0x148(%rsp), %rdi
cmpq %rbx, %rdi
je 0x379d
callq 0x21e0
movq 0x18(%r12), %rsi
leaq 0x148(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x20a0
movq 0x148(%rsp), %r13
movl (%r15), %r14d
movl $0x0, (%r15)
leaq 0x20(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
movl $0xa, %edx
callq 0x2070
cmpq %r13, (%rbp)
je 0x3c9b
movl (%r15), %ecx
testl %ecx, %ecx
movq %rax, 0x10(%rsp)
je 0x3802
cmpl $0x22, %ecx
jne 0x3805
leaq 0x19fd(%rip), %rdi      # 0x51fa
callq 0x22a0
movl %r14d, (%r15)
movq 0x148(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3817
callq 0x21e0
movq 0x20(%r12), %rsi
leaq 0x148(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x20a0
movq 0x148(%rsp), %r13
movl (%r15), %r14d
movl $0x0, (%r15)
leaq 0x20(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
movl $0xa, %edx
callq 0x2270
cmpq %r13, (%rbp)
je 0x3ca7
movq %rax, %r12
movl (%r15), %eax
testl %eax, %eax
je 0x387a
cmpl $0x22, %eax
jne 0x387d
leaq 0x198b(%rip), %rdi      # 0x5200
callq 0x22a0
movl %r14d, (%r15)
movq 0x148(%rsp), %rdi
cmpq %rbx, %rdi
je 0x388f
callq 0x21e0
movq 0x475a(%rip), %r15      # 0x7ff0
leaq 0x1882(%rip), %rsi      # 0x511f
movl $0x29, %edx
movq %r15, %rdi
callq 0x2240
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
movq %rax, %r15
leaq 0x186e(%rip), %rsi      # 0x5149
movl $0xd, %edx
movq %rax, %rdi
callq 0x2240
movq %r15, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x22f0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
movq %rax, %r15
leaq 0x182d(%rip), %rsi      # 0x5157
movl $0x8, %edx
movq %rax, %rdi
callq 0x2240
movq 0x18(%rsp), %rbx
movl %ebx, %esi
movq %r15, %rdi
callq 0x2130
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
movq %rax, %r15
leaq 0x17e6(%rip), %rsi      # 0x5160
movl $0xb, %edx
movq %rax, %rdi
callq 0x2240
movq 0x10(%rsp), %r14
movl %r14d, %esi
movq %r15, %rdi
callq 0x2130
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
movq %rax, %r15
leaq 0x17a1(%rip), %rsi      # 0x516c
movl $0x6, %edx
movq %rax, %rdi
callq 0x2240
movq %r15, %rdi
movq %r12, %rsi
callq 0x2130
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
leaq 0x20(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x2ab2
callq 0x2120
movq %rax, %r15
movq %r13, %rdi
movl %ebx, %esi
movl %r14d, %edx
callq 0x2c1e
leaq 0x1734(%rip), %rsi      # 0x5173
leaq 0x20(%rsp), %rdi
callq 0x33ee
leaq 0x1730(%rip), %rsi      # 0x5180
leaq 0x20(%rsp), %rdi
callq 0x3506
leaq 0x1733(%rip), %rsi      # 0x5194
leaq 0x20(%rsp), %rdi
callq 0x347c
leaq 0x1737(%rip), %rsi      # 0x51a9
leaq 0x148(%rsp), %rdi
movl $0x10, %edx
callq 0x2230
leaq 0x172b(%rip), %rsi      # 0x51b6
leaq 0x148(%rsp), %rdi
movl $0xf, %edx
callq 0x2240
leaq 0x20(%rsp), %rdi
callq 0x3594
leaq 0x148(%rsp), %rdi
callq 0x22f0
movq %rax, %rbx
leaq 0x1708(%rip), %rsi      # 0x51c6
movl $0x12, %edx
movq %rax, %rdi
callq 0x2240
movsd 0x138(%rsp), %xmm0
movsd 0x140(%rsp), %xmm1
unpcklps 0x155c(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1564(%rip), %xmm1     # 0x5050
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rbx
leaq 0x16cb(%rip), %rsi      # 0x51d9
movl $0x8, %edx
movq %rax, %rdi
callq 0x2240
movsd 0x128(%rsp), %xmm0
movsd 0x130(%rsp), %xmm1
unpcklps 0x150c(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1514(%rip), %xmm1     # 0x5050
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rbx
leaq 0x1684(%rip), %rsi      # 0x51e2
movl $0x2, %edx
movq %rax, %rdi
callq 0x2240
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
leaq 0x148(%rsp), %rdi
callq 0x2290
callq 0x2120
movq %rax, %rbx
movq 0x4442(%rip), %rdi      # 0x7ff0
leaq 0x1630(%rip), %rsi      # 0x51e5
movl $0xf, %edx
callq 0x2240
subq %r15, %rbx
xorps %xmm0, %xmm0
cvtsi2sd %rbx, %xmm0
divsd 0x144e(%rip), %xmm0     # 0x5020
movq 0x4417(%rip), %rdi      # 0x7ff0
callq 0x22f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
movq 0x43b9(%rip), %rax      # 0x7fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x150(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x148(%rsp,%rcx)
callq 0x21c0
leaq 0x240(%rsp), %rdi
callq 0x2080
leaq 0x20(%rsp), %rdi
callq 0x3e3c
xorl %eax, %eax
addq $0x348, %rsp            # imm = 0x348
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x438b(%rip), %rdi      # 0x7ff0
leaq 0x1476(%rip), %rsi      # 0x50e2
callq 0x2200
movq %rax, %rdi
callq 0x20c0
movl $0x1, %edi
callq 0x2260
leaq 0x156b(%rip), %rdi      # 0x51f5
callq 0x2110
leaq 0x1564(%rip), %rdi      # 0x51fa
callq 0x2110
leaq 0x1558(%rip), %rdi      # 0x51fa
callq 0x2110
leaq 0x1552(%rip), %rdi      # 0x5200
callq 0x2110
jmp 0x3d0f
jmp 0x3cbb
jmp 0x3cbb
jmp 0x3cbb
movq %rax, %r12
jmp 0x3d30
jmp 0x3cc2
movq %rax, %r12
cmpl $0x0, (%r15)
jne 0x3cdc
movl %r14d, (%r15)
jmp 0x3cdc
movq %rax, %r12
cmpl $0x0, (%r15)
jne 0x3cdc
movl %ebp, (%r15)
movq 0x148(%rsp), %rdi
cmpq %rbx, %rdi
jne 0x3d08
jmp 0x3d30
movq %rax, %r12
cmpl $0x0, (%r15)
jne 0x3cf7
movl %ebp, (%r15)
leaq 0x158(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3d30
callq 0x21e0
jmp 0x3d30
movq %rax, %r12
jmp 0x3d26
jmp 0x3d16
movq %rax, %r12
leaq 0x148(%rsp), %rdi
callq 0x22c0
leaq 0x20(%rsp), %rdi
callq 0x3e3c
movq %r12, %rdi
callq 0x2330