// File: /workspace/github_c_makefile_star2_O3/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 0x1690a(%rip), %eax     # 0x19704
addl $-0x33, %eax
cmpl $-0x31, %eax
ja 0x2e1a
leaq 0xe227(%rip), %rdi      # 0x11030
movl $0x3, %esi
movl $0x32, %edx
xorl %eax, %eax
callq 0x8240
movabsq $0x5f5f4c4c554e5f5f, %rax # imm = 0x5F5F4C4C554E5F5F
xorq 0x154d5(%rip), %rax     # 0x18300
movzbl 0x154d6(%rip), %ecx     # 0x18308
orq %rax, %rcx
jne 0x2e45
leaq 0xe304(%rip), %rdi      # 0x11142
xorl %eax, %eax
callq 0x8240
cmpl $0x0, 0x168e0(%rip)     # 0x1972c
jne 0x2e5c
leaq 0xe305(%rip), %rdi      # 0x1115a
xorl %eax, %eax
callq 0x8240
movl $0x58, %edi
callq 0x21f0
movq %rax, %rbx
movq %rax, %rdi
callq 0x48f0
movq %rbx, 0x168c0(%rip)     # 0x19738
movl 0x168ae(%rip), %eax     # 0x1972c
cmpl $0x2, %eax
je 0x2e9d
cmpl $0x1, %eax
jne 0x2eba
movzbl 0x16871(%rip), %edx     # 0x19700
leaq 0x1546a(%rip), %rsi     # 0x18300
movq %rbx, %rdi
xorl %ecx, %ecx
jmp 0x2eb3
movzbl 0x1685c(%rip), %edx     # 0x19700
leaq 0x15455(%rip), %rsi     # 0x18300
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x5758
jmp 0x2ec8
leaq 0xe2b9(%rip), %rdi      # 0x1117a
xorl %eax, %eax
callq 0x2060
movq 0x16869(%rip), %rdi     # 0x19738
movq (%rdi), %rax
callq *0x78(%rax)
movq 0x1685c(%rip), %rdi     # 0x19738
movq (%rdi), %rax
callq *0x88(%rax)
movl 0x16819(%rip), %esi     # 0x19704
leaq 0xe28b(%rip), %rdi      # 0x1117d
xorl %eax, %eax
callq 0x2060
leaq 0xe290(%rip), %rdi      # 0x11190
leaq 0x153f9(%rip), %rsi     # 0x18300
xorl %eax, %eax
callq 0x2060
movq 0x16823(%rip), %rdi     # 0x19738
movq (%rdi), %rax
leaq 0xe299(%rip), %rcx      # 0x111b8
leaq 0xe29b(%rip), %rbx      # 0x111c1
cmpb $0x0, 0x167d3(%rip)     # 0x19700
cmovneq %rcx, %rbx
callq *0x40(%rax)
movl %eax, %ebp
movq 0x167fb(%rip), %rdi     # 0x19738
movq (%rdi), %rax
movb 0x167b9(%rip), %r14b    # 0x19700
callq *0x48(%rax)
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
testb %r14b, %r14b
cmovnel %eax, %ecx
leaq 0xe240(%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