// File: /workspace/github_cpp_makefile_star2_O2/riyadparvez[P]louvain-method/main_community.cpp
// Function: main
int
main(int argc, char **argv) {
  srand(time(NULL)+getpid());

  parse_args(argc, argv);
  time_t time_begin, time_end;
  time(&time_begin);
  if (verbose)
    display_time("Begin");

  Community c(filename, filename_w, type, -1, precision);
  if (filename_part!=NULL)
    c.init_partition(filename_part);
  Graph g;
  bool improvement=true;
  double mod=c.modularity(), new_mod;
  int level=0;

  do {
    if (verbose) {
      cerr << "level " << level << ":\n";
      display_time("  start computation");
      cerr << "  network size: " 
	   << c.g.nb_nodes << " nodes, " 
	   << c.g.nb_links << " links, "
	   << c.g.total_weight << " weight." << endl;
    }

    improvement = c.one_level();
    new_mod = c.modularity();
    if (++level==display_level)
      g.display();
    if (display_level==-1)
      c.display_partition();
    g = c.partition2graph_binary();
    c = Community(g, -1, precision);

    if (verbose)
      cerr << "  modularity increased from " << mod << " to " << new_mod << endl;

    mod=new_mod;
    if (verbose)
      display_time("  end computation");

    if (filename_part!=NULL && level==1) // do at least one more computation if partition is provided
      improvement=true;
  } while(improvement);

  time(&time_end);
  if (verbose) {
    display_time("End");
    cerr << "Total duration: " << (time_end-time_begin) << " sec." << endl;
  }
  if (write_community) {
    g.write_community(filename_comm);
  }
  cerr << new_mod << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x348, %rsp            # imm = 0x348
movq %rsi, %rbx
movl %edi, %ebp
xorl %edi, %edi
callq 0x2150
movq %rax, %r14
callq 0x2250
addl %eax, %r14d
movl %r14d, %edi
callq 0x2170
movl %ebp, %edi
movq %rbx, %rsi
callq 0x6340
leaq 0x30(%rsp), %rdi
callq 0x2150
cmpb $0x1, 0x4cdc(%rip)      # 0xb1e4
jne 0x6516
leaq 0x117a(%rip), %rdi      # 0x768b
callq 0x646f
movq 0x4ca3(%rip), %rsi      # 0xb1c0
movq 0x4ca4(%rip), %rdx      # 0xb1c8
movl 0x4c6e(%rip), %ecx      # 0xb198
movsd 0x4c6e(%rip), %xmm0     # 0xb1a0
leaq 0xb0(%rsp), %rdi
pushq $-0x1
popq %r8
callq 0x391c
movq 0x4c8e(%rip), %rsi      # 0xb1d8
testq %rsi, %rsi
je 0x655c
leaq 0xb0(%rsp), %rdi
callq 0x3c92
leaq 0x38(%rsp), %rdi
callq 0x247c
leaq 0xb0(%rsp), %rdi
callq 0x3f92
movsd %xmm0, 0x20(%rsp)
movq $0x0, 0x8(%rsp)
leaq 0xb0(%rsp), %rbp
leaq 0x238(%rsp), %r13
leaq 0x1c0(%rsp), %r12
cmpb $0x1, 0x4c43(%rip)      # 0xb1e4
jne 0x665a
movq 0x4a42(%rip), %rdi      # 0xaff0
leaq 0x10dc(%rip), %rsi      # 0x7691
callq 0x2180
movq %rax, %rdi
movq 0x8(%rsp), %rsi
callq 0x22d0
movq %rax, %rdi
leaq 0x10c7(%rip), %rsi      # 0x7698
callq 0x2180
leaq 0x10be(%rip), %rdi      # 0x769b
callq 0x646f
movq 0x4a07(%rip), %rdi      # 0xaff0
leaq 0x10bf(%rip), %rsi      # 0x76af
callq 0x2180
movl 0xe8(%rsp), %esi
movq %rax, %rdi
callq 0x2100
movq %rax, %rdi
leaq 0x10b2(%rip), %rsi      # 0x76c0
callq 0x2180
movq 0xf0(%rsp), %rsi
movq %rax, %rdi
callq 0x2100
movq %rax, %rdi
leaq 0x109c(%rip), %rsi      # 0x76c9
callq 0x2180
movsd 0xf8(%rsp), %xmm0
movq %rax, %rdi
callq 0x2290
movq %rax, %rdi
leaq 0x1085(%rip), %rsi      # 0x76d2
callq 0x2180
movq %rax, %rdi
callq 0x20c0
movq %rbp, %rdi
callq 0x46e2
movl %eax, %ebx
movq %rbp, %rdi
callq 0x3f92
movsd %xmm0, 0x10(%rsp)
movq 0x8(%rsp), %rax
leal 0x1(%rax), %ecx
movl 0x4b28(%rip), %eax      # 0xb1a8
movl %ecx, 0x1c(%rsp)
cmpl %eax, %ecx
jne 0x6698
leaq 0x38(%rsp), %rdi
callq 0x27f6
movl 0x4b10(%rip), %eax      # 0xb1a8
cmpl $-0x1, %eax
jne 0x66a5
movq %rbp, %rdi
callq 0x414c
movq %r13, %rdi
movq %rbp, %r15
movq %rbp, %rsi
callq 0x424e
leaq 0x38(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x48ea
movq %r13, %rdi
callq 0x4944
movq %r12, %rdi
movq %rbp, %rsi
callq 0x68a0
movsd 0x4ac2(%rip), %xmm0     # 0xb1a0
movq %r13, %rdi
movq %r12, %rsi
pushq $-0x1
popq %rdx
callq 0x3af0
movq %r15, %rbp
movq %r15, %rdi
movq %r13, %rsi
callq 0x693a
movq %r13, %rdi
callq 0x69c4
movq %r12, %rdi
callq 0x4944
movb 0x4ad4(%rip), %al       # 0xb1e4
cmpb $0x1, %al
jne 0x6760
movq 0x48d5(%rip), %rdi      # 0xaff0
leaq 0xfb9(%rip), %rsi       # 0x76db
callq 0x2180
movq %rax, %rdi
movsd 0x20(%rsp), %xmm0
callq 0x2290
movq %rax, %rdi
leaq 0xfb9(%rip), %rsi       # 0x76f8
callq 0x2180
movq %rax, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x2290
movq %rax, %rdi
callq 0x20c0
movb 0x4a84(%rip), %al       # 0xb1e4
testb $0x1, %al
je 0x6770
leaq 0xf92(%rip), %rdi       # 0x76fd
callq 0x646f
cmpq $0x0, 0x4a60(%rip)      # 0xb1d8
setne %al
cmpl $0x0, 0x8(%rsp)
sete %cl
andb %al, %cl
orb %cl, %bl
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movl 0x1c(%rsp), %eax
movq %rax, 0x8(%rsp)
jne 0x659a
leaq 0x28(%rsp), %rdi
callq 0x2150
cmpb $0x1, 0x4a31(%rip)      # 0xb1e4
jne 0x67fd
leaq 0xf53(%rip), %rdi       # 0x770f
callq 0x646f
movq 0x4828(%rip), %rdi      # 0xaff0
leaq 0xf44(%rip), %rsi       # 0x7713
callq 0x2180
movq 0x28(%rsp), %rsi
subq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x2160
leaq 0xf37(%rip), %rsi       # 0x7724
movq %rax, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
cmpb $0x1, 0x49e1(%rip)      # 0xb1e5
jne 0x6817
movq 0x49c3(%rip), %rsi      # 0xb1d0
leaq 0x38(%rsp), %rdi
callq 0x288c
movq 0x47d2(%rip), %rdi      # 0xaff0
movsd 0x10(%rsp), %xmm0
callq 0x2290
movq %rax, %rdi
callq 0x20c0
leaq 0x38(%rsp), %rdi
callq 0x4944
leaq 0xb0(%rsp), %rdi
callq 0x69c4
xorl %eax, %eax
addq $0x348, %rsp            # imm = 0x348
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6860
jmp 0x687d
movq %rax, %rbx
jmp 0x688a
jmp 0x687d
jmp 0x687d
jmp 0x687d
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
callq 0x4944
jmp 0x6880
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x4944
leaq 0xb0(%rsp), %rdi
callq 0x69c4
movq %rbx, %rdi
callq 0x22f0
nop