// File: /workspace/github_c_makefile_star2_O1/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 0x16902(%rip), %eax     # 0x19704
addl $-0x33, %eax
cmpl $-0x31, %eax
ja 0x2e22
leaq 0xe21f(%rip), %rdi      # 0x11030
movl $0x3, %esi
movl $0x32, %edx
xorl %eax, %eax
callq 0x8110
movabsq $0x5f5f4c4c554e5f5f, %rax # imm = 0x5F5F4C4C554E5F5F
xorq 0x154cd(%rip), %rax     # 0x18300
movzbl 0x154ce(%rip), %ecx     # 0x18308
orq %rax, %rcx
jne 0x2e4d
leaq 0xe2fc(%rip), %rdi      # 0x11142
xorl %eax, %eax
callq 0x8110
cmpl $0x0, 0x168d8(%rip)     # 0x1972c
jne 0x2e64
leaq 0xe2fd(%rip), %rdi      # 0x1115a
xorl %eax, %eax
callq 0x8110
movl $0x58, %edi
callq 0x21f0
movq %rax, %rbx
movq %rax, %rdi
callq 0x485c
movq %rbx, 0x168b8(%rip)     # 0x19738
movl 0x168a6(%rip), %eax     # 0x1972c
cmpl $0x2, %eax
je 0x2ea5
cmpl $0x1, %eax
jne 0x2ec2
movzbl 0x16869(%rip), %edx     # 0x19700
leaq 0x15462(%rip), %rsi     # 0x18300
movq %rbx, %rdi
xorl %ecx, %ecx
jmp 0x2ebb
movzbl 0x16854(%rip), %edx     # 0x19700
leaq 0x1544d(%rip), %rsi     # 0x18300
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x56d8
jmp 0x2ed0
leaq 0xe2b1(%rip), %rdi      # 0x1117a
xorl %eax, %eax
callq 0x2060
movq 0x16861(%rip), %rdi     # 0x19738
movq (%rdi), %rax
callq *0x78(%rax)
movq 0x16854(%rip), %rdi     # 0x19738
movq (%rdi), %rax
callq *0x88(%rax)
movl 0x16811(%rip), %esi     # 0x19704
leaq 0xe283(%rip), %rdi      # 0x1117d
xorl %eax, %eax
callq 0x2060
leaq 0xe288(%rip), %rdi      # 0x11190
leaq 0x153f1(%rip), %rsi     # 0x18300
xorl %eax, %eax
callq 0x2060
movq 0x1681b(%rip), %rdi     # 0x19738
movq (%rdi), %rax
leaq 0xe291(%rip), %rcx      # 0x111b8
leaq 0xe293(%rip), %rbx      # 0x111c1
cmpb $0x0, 0x167cb(%rip)     # 0x19700
cmovneq %rcx, %rbx
callq *0x40(%rax)
movl %eax, %ebp
movq 0x167f3(%rip), %rdi     # 0x19738
movq (%rdi), %rax
movb 0x167b1(%rip), %r14b    # 0x19700
callq *0x48(%rax)
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
testb %r14b, %r14b
cmovnel %eax, %ecx
leaq 0xe238(%rip), %rdi      # 0x111a0
movq %rbx, %rsi
movl %ebp, %edx
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x2060
movq %rax, %r14
movl $0x58, %esi
movq %rbx, %rdi
callq 0x2200
movq %r14, %rdi
callq 0x2370