// File: /workspace/github_c_makefile_star2_O2/ComplexNetworks-DCC-FCUP[P]gtrieScanner/CmdLine.cpp
// Function: CmdLine::prepare_graph()
void CmdLine::prepare_graph() {

  // Check motif size
  if (motif_size<MIN_MOTIF_SIZE || motif_size>MAX_MOTIF_SIZE)
    Error::msg("Invalid subgraph size (%d <= SIZE <= %d)", MIN_MOTIF_SIZE, MAX_MOTIF_SIZE);

  // Check if graph file name was given
  if (!strcmp(graph_file, INVALID_FILE))
    Error::msg("No graph file specified");

  // Check graph format
  if (format == NOFORMAT)
    Error::msg("No valid graph format specified");

  // Read the graph file
  g = new GraphMatrix();

  // Use simple or simple_weight text format
  if (format == SIMPLE)
    GraphUtils::readFileTxt(g, graph_file, dir, false);
  else if  (format == SIMPLE_WEIGHT)
    GraphUtils::readFileTxt(g, graph_file, dir, true);
  else printf("??");

  // sort and create array of neighbours
  g->sortNeighbours();
  g->makeArrayNeighbours();

  // Print chosen parameters
  printf("Subgraph Size: %d\n", motif_size);
  printf("Graph File: %s\n", graph_file);
  printf("%s, %d Nodes, %d Edges\n", dir?"Directed":"Undirected",g->numNodes(), dir?g->numEdges():g->numEdges()/2);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x16bb2(%rip), %eax     # 0x19724
addl $-0x33, %eax
cmpl $-0x31, %eax
ja 0x2b8e
leaq 0xd4af(%rip), %rdi      # 0x10030
pushq $0x3
popq %rsi
pushq $0x32
popq %rdx
xorl %eax, %eax
callq 0x7c64
leaq 0x1578b(%rip), %rdi     # 0x18320
leaq 0xd59d(%rip), %rsi      # 0x10139
pushq $0x9
popq %rdx
callq 0x2220
testl %eax, %eax
jne 0x2bb6
leaq 0xd593(%rip), %rdi      # 0x10142
xorl %eax, %eax
callq 0x7c64
cmpl $0x0, 0x16b8f(%rip)     # 0x1974c
jne 0x2bcd
leaq 0xd594(%rip), %rdi      # 0x1015a
xorl %eax, %eax
callq 0x7c64
pushq $0x58
popq %rdi
callq 0x2200
movq %rax, %rbx
movq %rax, %rdi
callq 0x44f8
movq %rbx, 0x16b71(%rip)     # 0x19758
movl 0x16b5f(%rip), %eax     # 0x1974c
cmpl $0x2, %eax
je 0x2c0c
cmpl $0x1, %eax
jne 0x2c27
movzbl 0x16b22(%rip), %edx     # 0x19720
leaq 0x1571b(%rip), %rsi     # 0x18320
movq %rbx, %rdi
xorl %ecx, %ecx
jmp 0x2c20
movzbl 0x16b0d(%rip), %edx     # 0x19720
leaq 0x15706(%rip), %rsi     # 0x18320
pushq $0x1
popq %rcx
movq %rbx, %rdi
callq 0x52d8
jmp 0x2c35
leaq 0xd54c(%rip), %rdi      # 0x1017a
xorl %eax, %eax
callq 0x2060
movq 0x16b1c(%rip), %rdi     # 0x19758
movq (%rdi), %rax
callq *0x78(%rax)
movq 0x16b0f(%rip), %rdi     # 0x19758
movq (%rdi), %rax
callq *0x88(%rax)
movl 0x16acc(%rip), %esi     # 0x19724
leaq 0xd51e(%rip), %rdi      # 0x1017d
xorl %eax, %eax
callq 0x2060
leaq 0xd523(%rip), %rdi      # 0x10190
leaq 0x156ac(%rip), %rsi     # 0x18320
xorl %eax, %eax
callq 0x2060
movq 0x16ad6(%rip), %rdi     # 0x19758
movq (%rdi), %rax
leaq 0xd52c(%rip), %rcx      # 0x101b8
leaq 0xd52e(%rip), %rbx      # 0x101c1
cmpb $0x0, 0x16a86(%rip)     # 0x19720
cmovneq %rcx, %rbx
callq *0x40(%rax)
movl %eax, %ebp
movq 0x16aae(%rip), %rdi     # 0x19758
movq (%rdi), %rax
movb 0x16a6c(%rip), %r14b    # 0x19720
callq *0x48(%rax)
movl %eax, %ecx
pushq $0x2
popq %rsi
cltd
idivl %esi
testb %r14b, %r14b
cmovel %eax, %ecx
leaq 0xd4d4(%rip), %rdi      # 0x101a0
movq %rbx, %rsi
movl %ebp, %edx
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x2060
movq %rax, %r14
pushq $0x58
popq %rsi
movq %rbx, %rdi
callq 0x2210
movq %r14, %rdi
callq 0x23b0