// File: /workspace/github_cpp_makefile_star2_O3/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 0x3c54
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 0x3c79
movl (%r15), %eax
testl %eax, %eax
movsd %xmm0, 0x8(%rsp)
je 0x3700
cmpl $0x22, %eax
jne 0x3703
leaq 0x1afa(%rip), %rdi      # 0x51f5
callq 0x22a0
movl %ebp, (%r15)
leaq 0x158(%rsp), %rbx
movq -0x10(%rbx), %rdi
cmpq %rbx, %rdi
je 0x3719
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 0x3c85
movl (%r15), %ecx
testl %ecx, %ecx
movq %rax, 0x18(%rsp)
je 0x377e
cmpl $0x22, %ecx
jne 0x3781
leaq 0x1a81(%rip), %rdi      # 0x51fa
callq 0x22a0
movl %ebp, (%r15)
movq 0x148(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3793
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 0x3c91
movl (%r15), %ecx
testl %ecx, %ecx
movq %rax, 0x10(%rsp)
je 0x37f8
cmpl $0x22, %ecx
jne 0x37fb
leaq 0x1a07(%rip), %rdi      # 0x51fa
callq 0x22a0
movl %r14d, (%r15)
movq 0x148(%rsp), %rdi
cmpq %rbx, %rdi
je 0x380d
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 0x3c9d
movq %rax, %r12
movl (%r15), %eax
testl %eax, %eax
je 0x3870
cmpl $0x22, %eax
jne 0x3873
leaq 0x1995(%rip), %rdi      # 0x5200
callq 0x22a0
movl %r14d, (%r15)
movq 0x148(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3885
callq 0x21e0
movq 0x4764(%rip), %r15      # 0x7ff0
leaq 0x188c(%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 0x1878(%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 0x1837(%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 0x17f0(%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 0x17ab(%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 0x2ab8
callq 0x2120
movq %rax, %r15
movq %r13, %rdi
movl %ebx, %esi
movl %r14d, %edx
callq 0x2c24
leaq 0x173e(%rip), %rsi      # 0x5173
leaq 0x20(%rsp), %rdi
callq 0x33e4
leaq 0x173a(%rip), %rsi      # 0x5180
leaq 0x20(%rsp), %rdi
callq 0x34fc
leaq 0x173d(%rip), %rsi      # 0x5194
leaq 0x20(%rsp), %rdi
callq 0x3472
leaq 0x1741(%rip), %rsi      # 0x51a9
leaq 0x148(%rsp), %rdi
movl $0x10, %edx
callq 0x2230
leaq 0x1735(%rip), %rsi      # 0x51b6
leaq 0x148(%rsp), %rdi
movl $0xf, %edx
callq 0x2240
leaq 0x20(%rsp), %rdi
callq 0x358a
leaq 0x148(%rsp), %rdi
callq 0x22f0
movq %rax, %rbx
leaq 0x1712(%rip), %rsi      # 0x51c6
movl $0x12, %edx
movq %rax, %rdi
callq 0x2240
movsd 0x138(%rsp), %xmm0
movsd 0x140(%rsp), %xmm1
unpcklps 0x1566(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x156e(%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 0x16d5(%rip), %rsi      # 0x51d9
movl $0x8, %edx
movq %rax, %rdi
callq 0x2240
movsd 0x128(%rsp), %xmm0
movsd 0x130(%rsp), %xmm1
unpcklps 0x1516(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x151e(%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 0x168e(%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 0x444c(%rip), %rdi      # 0x7ff0
leaq 0x163a(%rip), %rsi      # 0x51e5
movl $0xf, %edx
callq 0x2240
subq %r15, %rbx
xorps %xmm0, %xmm0
cvtsi2sd %rbx, %xmm0
divsd 0x1458(%rip), %xmm0     # 0x5020
movq 0x4421(%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 0x43c3(%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 0x3e24
xorl %eax, %eax
addq $0x348, %rsp            # imm = 0x348
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4395(%rip), %rdi      # 0x7ff0
leaq 0x1480(%rip), %rsi      # 0x50e2
callq 0x2200
movq %rax, %rdi
callq 0x20c0
movl $0x1, %edi
callq 0x2260
leaq 0x1575(%rip), %rdi      # 0x51f5
callq 0x2110
leaq 0x156e(%rip), %rdi      # 0x51fa
callq 0x2110
leaq 0x1562(%rip), %rdi      # 0x51fa
callq 0x2110
leaq 0x155c(%rip), %rdi      # 0x5200
callq 0x2110
jmp 0x3d05
jmp 0x3cb1
jmp 0x3cb1
jmp 0x3cb1
movq %rax, %r12
jmp 0x3d26
jmp 0x3cb8
movq %rax, %r12
cmpl $0x0, (%r15)
jne 0x3cd2
movl %r14d, (%r15)
jmp 0x3cd2
movq %rax, %r12
cmpl $0x0, (%r15)
jne 0x3cd2
movl %ebp, (%r15)
movq 0x148(%rsp), %rdi
cmpq %rbx, %rdi
jne 0x3cfe
jmp 0x3d26
movq %rax, %r12
cmpl $0x0, (%r15)
jne 0x3ced
movl %ebp, (%r15)
leaq 0x158(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3d26
callq 0x21e0
jmp 0x3d26
movq %rax, %r12
jmp 0x3d1c
jmp 0x3d0c
movq %rax, %r12
leaq 0x148(%rsp), %rdi
callq 0x22c0
leaq 0x20(%rsp), %rdi
callq 0x3e24
movq %r12, %rdi
callq 0x2330