// File: /workspace/github_c_makefile_star2_O3/ComplexNetworks-DCC-FCUP[P]fase/FaseMain.cpp
// Function: output(Fase*)
void output(Fase* fase)
{
  printf("Finished Calculating\n");
  FILE *f = outFile;
  fprintf(f, "\tOutput:\n");
  fprintf(f, "Network: %s\n", ifilename);
  fprintf(f, "Directed: %s\n", dir ? "Yes" : "No");
  fprintf(f, "Nodes: %d\n", G->numNodes());
  fprintf(f, "Edges: %d\n", G->numEdges() / (dir ? 1 : 2));
  fprintf(f, "Subgraph Size: %d\n", K);
  if (largeScale)
    fprintf(f, "Graph Representation: Large Scale\n");
  else
    fprintf(f, "Graph Representation: Adjacency Matrix\n");

  t_end = time(0);
  struct tm *tm_start = localtime(&t_start);
  fprintf(f, "Start of Computation: %02dh%02dm%02ds %02d/%02d/%02d\n\
", tm_start->tm_hour, tm_start->tm_min, tm_start->tm_sec, tm_start->tm_mday, tm_start->tm_mon + 1, 1900 + tm_start->tm_year);
  struct tm *tm_end   = localtime(&t_end);
  fprintf(f, "End of Computation: %02dh%02dm%02ds %02d/%02d/%02d\n", tm_end->tm_hour, tm_end->tm_min, tm_end->tm_sec, tm_end->tm_mday, tm_end->tm_mon + 1, 1900 + tm_end->tm_year);
  
  fprintf(f, "\n\n\tResults:\n");
  fprintf(f, "Subgraph Occurrences: %lld\n", (long long int)(fase->getMotifCount() / prob));
  fprintf(f, "Subgraph Types: %d\n", fase->getTypes());
  fprintf(f, "Computation Time (ms): %0.4lf\n", Timer::elapsed());
  
  if (fabs(prob - 1.0) <= 10e-7)
    fprintf(f, "\nExact Enumeration, no Sampling done\n");
  else
  {
    fprintf(f, "\n\tSampling Information:\n");
    fprintf(f, "Percentage of Sampled Subgraphs: %0.2lf\%\n", 100 * prob);
    fprintf(f, "Percentage by depth:\n");
    int i;
    for (i = 0; i < K; i++)
      fprintf(f, "P[%d]: %0.3lf\%\n", i, 100 * sampProb[i]);
  }
    
  if (detailed)
  {
    fprintf(f, "\n\tDetailed Output:\n");
    for (auto element : fase->subgraphCount())
      if (samp && fabs(prob) > 10e-7)
        fprintf(f, "%s: %d occurrences\n", element.second.c_str(), (int)(element.first / prob));
      else
        fprintf(f, "%s: %d occurrences\n", element.second.c_str(), element.first);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r14
leaq 0x1fd8(%rip), %rdi      # 0xe5db
callq 0x2270
movq 0x71d9(%rip), %rbx      # 0x137e8
leaq 0x1867(%rip), %rdi      # 0xde7d
movl $0x9, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2320
leaq 0x1858(%rip), %rsi      # 0xde87
leaq 0x701a(%rip), %rdx      # 0x13650
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2240
leaq 0x185b(%rip), %rax      # 0xdea2
leaq 0x1858(%rip), %rdx      # 0xdea6
cmpb $0x0, 0x6ff3(%rip)      # 0x13648
cmovneq %rax, %rdx
leaq 0x1834(%rip), %rsi      # 0xde94
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2240
movq 0x6f17(%rip), %rdi      # 0x13588
movq (%rdi), %rax
callq *0x38(%rax)
leaq 0x182b(%rip), %rsi      # 0xdea9
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x2240
movq 0x6ef7(%rip), %rdi      # 0x13588
movq (%rdi), %rax
callq *0x40(%rax)
movzbl 0x6faa(%rip), %ecx      # 0x13648
movl $0x2, %esi
subl %ecx, %esi
cltd
idivl %esi
leaq 0x1805(%rip), %rsi      # 0xdeb4
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x2240
movl 0x6ecf(%rip), %edx      # 0x13590
leaq 0x17f7(%rip), %rsi      # 0xdebf
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2240
cmpb $0x1, 0x6f73(%rip)      # 0x1364c
jne 0xc6e9
leaq 0x17f0(%rip), %rdi      # 0xded2
movl $0x22, %esi
jmp 0xc6f5
leaq 0x1805(%rip), %rdi      # 0xdef5
movl $0x27, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2320
xorl %edi, %edi
callq 0x2150
movq %rax, 0x70e8(%rip)      # 0x137f8
leaq 0x70e1(%rip), %r15      # 0x137f8
leaq 0x70d2(%rip), %rdi      # 0x137f0
callq 0x2110
movl 0x8(%rax), %edx
movl (%rax), %r8d
movl 0x4(%rax), %ecx
movl 0xc(%rax), %r9d
movl 0x10(%rax), %r10d
incl %r10d
movl $0x76c, %r12d           # imm = 0x76C
movl 0x14(%rax), %r11d
addl %r12d, %r11d
leaq 0x17d2(%rip), %rsi      # 0xdf1d
movq %rbx, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x2240
addq $0x10, %rsp
movq %r15, %rdi
callq 0x2110
movl 0x8(%rax), %edx
movl (%rax), %r8d
movl 0x4(%rax), %ecx
movl 0xc(%rax), %r9d
movl 0x10(%rax), %r10d
incl %r10d
addl 0x14(%rax), %r12d
leaq 0x17cf(%rip), %rsi      # 0xdf53
movq %rbx, %rdi
xorl %eax, %eax
pushq %r12
pushq %r10
callq 0x2240
addq $0x10, %rsp
leaq 0x17ea(%rip), %rdi      # 0xdf87
movl $0xc, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2320
cvtsi2sdl 0x14(%r14), %xmm0
divsd 0x6e83(%rip), %xmm0     # 0x13640
cvttsd2si %xmm0, %rdx
leaq 0x17cb(%rip), %rsi      # 0xdf94
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2240
movq %r14, %rdi
callq 0x2fac
leaq 0x17ce(%rip), %rsi      # 0xdfb0
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x2240
callq 0x4e4c
leaq 0x17ca(%rip), %rsi      # 0xdfc4
movq %rbx, %rdi
movb $0x1, %al
callq 0x2240
movsd 0x6e34(%rip), %xmm0     # 0x13640
addsd 0x15bc(%rip), %xmm0     # 0xddd0
andpd 0x1544(%rip), %xmm0     # 0xdd60
movsd 0x15a4(%rip), %xmm1     # 0xddc8
ucomisd %xmm0, %xmm1
jae 0xc8ce
leaq 0x17d4(%rip), %rdi      # 0xe009
movl $0x18, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2320
movsd 0x6df1(%rip), %xmm0     # 0x13640
mulsd 0x1581(%rip), %xmm0     # 0xddd8
leaq 0x17c4(%rip), %rsi      # 0xe022
movq %rbx, %rdi
movb $0x1, %al
callq 0x2240
leaq 0x17dd(%rip), %rdi      # 0xe04c
movl $0x15, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2320
cmpl $0x0, 0x6d08(%rip)      # 0x13590
jle 0xc8e7
leaq 0x6d0f(%rip), %r13      # 0x135a0
xorl %r15d, %r15d
leaq 0x17c7(%rip), %r12      # 0xe062
movsd (%r13), %xmm0
mulsd 0x152f(%rip), %xmm0     # 0xddd8
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
movb $0x1, %al
callq 0x2240
incq %r15
movslq 0x6ccd(%rip), %rax      # 0x13590
addq $0x8, %r13
cmpq %rax, %r15
jl 0xc89b
jmp 0xc8e7
leaq 0x170e(%rip), %rdi      # 0xdfe3
movl $0x25, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2320
cmpb $0x1, 0x6d5b(%rip)      # 0x13649
jne 0xc9e3
leaq 0x1777(%rip), %rdi      # 0xe072
movl $0x13, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2320
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x2fba
movq (%r15), %r12
movq 0x8(%r15), %r13
cmpq %r13, %r12
je 0xc9d9
leaq 0x10(%rsp), %r14
leaq 0x20(%rsp), %rbp
leaq 0x1748(%rip), %r15      # 0xe086
movl (%r12), %eax
movl %eax, 0x8(%rsp)
movq %rbp, 0x10(%rsp)
movq 0x8(%r12), %rsi
movq 0x10(%r12), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x32aa
cmpb $0x1, 0x6ce4(%rip)      # 0x1364b
jne 0xc99f
movsd 0x6ccf(%rip), %xmm0     # 0x13640
movapd %xmm0, %xmm1
andpd 0x13e3(%rip), %xmm1     # 0xdd60
ucomisd 0x1443(%rip), %xmm1     # 0xddc8
jbe 0xc99f
xorps %xmm1, %xmm1
cvtsi2sdl 0x8(%rsp), %xmm1
movq 0x10(%rsp), %rdx
divsd %xmm0, %xmm1
cvttsd2si %xmm1, %ecx
jmp 0xc9a8
movq 0x10(%rsp), %rdx
movl 0x8(%rsp), %ecx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2240
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0xc9cc
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21a0
addq $0x28, %r12
cmpq %r13, %r12
jne 0xc93e
leaq 0x30(%rsp), %rdi
callq 0x31d4
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x31d4
movq %rbx, %rdi
callq 0x22c0