// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
cmpl $0x3, 0x292a5(%rip)     # 0x2d194
jl 0x3efa
cmpl $0x32, 0x2929c(%rip)    # 0x2d194
jle 0x3f12
leaq 0x1c10f(%rip), %rdi     # 0x20010
movl $0x3, %esi
movl $0x32, %edx
movb $0x0, %al
callq 0xfb80
leaq 0x27e77(%rip), %rdi     # 0x2bd90
leaq 0x1c222(%rip), %rsi     # 0x20142
callq 0x3390
cmpl $0x0, %eax
jne 0x3f38
leaq 0x1c21a(%rip), %rdi     # 0x2014b
movb $0x0, %al
callq 0xfb80
cmpl $0x0, 0x2927d(%rip)     # 0x2d1bc
jne 0x3f4f
leaq 0x1c21b(%rip), %rdi     # 0x20163
movb $0x0, %al
callq 0xfb80
movl $0x58, %edi
callq 0x3270
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x18(%rbp)
callq 0x7670
jmp 0x3f6a
movq -0x18(%rbp), %rax
movq %rax, 0x29253(%rip)     # 0x2d1c8
cmpl $0x1, 0x29240(%rip)     # 0x2d1bc
jne 0x3fbf
movq 0x29243(%rip), %rdi     # 0x2d1c8
movb 0x29205(%rip), %al      # 0x2d190
leaq 0x27dfe(%rip), %rsi     # 0x2bd90
xorl %ecx, %ecx
andb $0x1, %al
movzbl %al, %edx
callq 0xaab0
jmp 0x3ffd
movq -0x18(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x58, %esi
callq 0x3280
jmp 0x40c3
cmpl $0x2, 0x291f6(%rip)     # 0x2d1bc
jne 0x3fed
movq 0x291f9(%rip), %rdi     # 0x2d1c8
movb 0x291bb(%rip), %al      # 0x2d190
leaq 0x27db4(%rip), %rsi     # 0x2bd90
movl $0x1, %ecx
andb $0x1, %al
movzbl %al, %edx
callq 0xaab0
jmp 0x3ffb
leaq 0x1c18f(%rip), %rdi     # 0x20183
movb $0x0, %al
callq 0x3060
jmp 0x3ffd
movq 0x291c4(%rip), %rdi     # 0x2d1c8
movq (%rdi), %rax
callq *0x78(%rax)
movq 0x291b7(%rip), %rdi     # 0x2d1c8
movq (%rdi), %rax
callq *0x88(%rax)
movl 0x29174(%rip), %esi     # 0x2d194
leaq 0x1c15f(%rip), %rdi     # 0x20186
movb $0x0, %al
callq 0x3060
leaq 0x1c164(%rip), %rdi     # 0x20199
leaq 0x27d54(%rip), %rsi     # 0x2bd90
movb $0x0, %al
callq 0x3060
movb 0x29147(%rip), %dl      # 0x2d190
leaq 0x1c17a(%rip), %rax     # 0x201ca
leaq 0x1c16a(%rip), %rcx     # 0x201c1
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, -0x28(%rbp)
movq 0x2915f(%rip), %rdi     # 0x2d1c8
movq (%rdi), %rax
callq *0x40(%rax)
movl %eax, -0x1c(%rbp)
testb $0x1, 0x29117(%rip)     # 0x2d190
je 0x408d
movq 0x29146(%rip), %rdi     # 0x2d1c8
movq (%rdi), %rax
callq *0x48(%rax)
movl %eax, -0x2c(%rbp)
jmp 0x40a5
movq 0x29134(%rip), %rdi     # 0x2d1c8
movq (%rdi), %rax
callq *0x48(%rax)
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x2c(%rbp)
movl -0x1c(%rbp), %edx
movq -0x28(%rbp), %rsi
movl -0x2c(%rbp), %ecx
leaq 0x1c0f3(%rip), %rdi     # 0x201a9
movb $0x0, %al
callq 0x3060
addq $0x30, %rsp
popq %rbp
retq
movq -0x8(%rbp), %rdi
callq 0x3440
nopl (%rax)