// File: MPSLab-ASU[P]DiRAC/./src/parse.cc
// Function: parse_arguments(int, char const**)
void parse_arguments(int argc, const char** argv)
{
  // make a new ArgumentParser
  // Argument format: short_name, long_name, total_arg_vals, is_optional
  ArgumentParser parser;

  // Argument that sets the path of the test directory
  parser.addArgument("-p", "--path", 1, false);
  parser.addArgument("-c", "--cmp-golden", 1, true);

  // parse the command-line arguments - throws error if invalid format
  if(argc < 3)
  {
    std::cout << parser.usage() << std::endl;
    exit (EXIT_FAILURE);
  }

  parser.parse(argc, argv);

  // Arguments are successfully parsed through command-line.
  // Use them to set necessary variables.
  dir_test = parser.retrieve<std::string>("path");

  if(parser.count("cmp-golden") == 1)
    compare_golden = true;
  else
    compare_golden = false;

  setup_file_paths();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x41ae70
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x1f0(%rbp)
callq 0x426c50
movq -0x1f0(%rbp), %rdx
leaq 0x18995d(%rip), %rsi    # 0x5a3f7c
leaq -0xe8(%rbp), %rdi
callq 0x40ef60
jmp 0x41a62d
leaq -0x121(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0x426c50
movq -0x1f8(%rbp), %rdx
leaq 0x189931(%rip), %rsi    # 0x5a3f7f
leaq -0x120(%rbp), %rdi
callq 0x40ef60
jmp 0x41a65c
leaq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
leaq -0x120(%rbp), %rdx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x41aee0
jmp 0x41a680
leaq -0x120(%rbp), %rdi
callq 0x4a2730
leaq -0x121(%rbp), %rdi
callq 0x426c70
leaq -0xe8(%rbp), %rdi
callq 0x4a2730
leaq -0xe9(%rbp), %rdi
callq 0x426c70
leaq -0x149(%rbp), %rdi
movq %rdi, -0x200(%rbp)
callq 0x426c50
movq -0x200(%rbp), %rdx
leaq 0x1898b5(%rip), %rsi    # 0x5a3f86
leaq -0x148(%rbp), %rdi
callq 0x40ef60
jmp 0x41a6df
leaq -0x171(%rbp), %rdi
movq %rdi, -0x208(%rbp)
callq 0x426c50
movq -0x208(%rbp), %rdx
leaq 0x189889(%rip), %rsi    # 0x5a3f89
leaq -0x170(%rbp), %rdi
callq 0x40ef60
jmp 0x41a70e
leaq -0xc8(%rbp), %rdi
leaq -0x148(%rbp), %rsi
leaq -0x170(%rbp), %rdx
movl $0x1, %r8d
movl %r8d, %ecx
callq 0x41aee0
jmp 0x41a733
leaq -0x170(%rbp), %rdi
callq 0x4a2730
leaq -0x171(%rbp), %rdi
callq 0x426c70
leaq -0x148(%rbp), %rdi
callq 0x4a2730
leaq -0x149(%rbp), %rdi
callq 0x426c70
cmpl $0x3, -0x4(%rbp)
jge 0x41a8e1
leaq -0x198(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x41b000
jmp 0x41a782
movq $0x61f900, %rdi         # imm = 0x61F900
leaq -0x198(%rbp), %rsi
callq 0x4a5160
movq %rax, -0x210(%rbp)
jmp 0x41a79e
movq -0x210(%rbp), %rdi
movq $0x491d30, %rsi         # imm = 0x491D30
callq 0x490f40
jmp 0x41a7b3
leaq -0x198(%rbp), %rdi
callq 0x4a2730
movl $0x1, %edi
callq 0x4ec1e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x41a827
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x41a80f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x4a2730
leaq -0x121(%rbp), %rdi
callq 0x426c70
leaq -0xe8(%rbp), %rdi
callq 0x4a2730
leaq -0xe9(%rbp), %rdi
callq 0x426c70
jmp 0x41aa98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x41a896
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x41a87e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x4a2730
leaq -0x171(%rbp), %rdi
callq 0x426c70
leaq -0x148(%rbp), %rdi
callq 0x4a2730
leaq -0x149(%rbp), %rdi
callq 0x426c70
jmp 0x41aa98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x41aa98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x4a2730
jmp 0x41aa98
movslq -0x4(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0xc8(%rbp), %rdi
callq 0x41b8f0
jmp 0x41a8f7
leaq -0x1b9(%rbp), %rdi
movq %rdi, -0x218(%rbp)
callq 0x426c50
movq -0x218(%rbp), %rdx
leaq 0x1ab320(%rip), %rsi    # 0x5c5c38
leaq -0x1b8(%rbp), %rdi
callq 0x40ef60
jmp 0x41a926
leaq -0xc8(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x41b9a0
movq %rax, -0x220(%rbp)
jmp 0x41a942
movq -0x220(%rbp), %rsi
movq $0x61e740, %rdi         # imm = 0x61E740
callq 0x4a2760
jmp 0x41a957
leaq -0x1b8(%rbp), %rdi
callq 0x4a2730
leaq -0x1b9(%rbp), %rdi
callq 0x426c70
leaq -0x1e1(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0x426c50
movq -0x228(%rbp), %rdx
leaq 0x1895fb(%rip), %rsi    # 0x5a3f8b
leaq -0x1e0(%rbp), %rdi
callq 0x40ef60
jmp 0x41a99e
leaq -0xc8(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x41bb00
movq %rax, -0x230(%rbp)
jmp 0x41a9ba
leaq -0x1e0(%rbp), %rdi
callq 0x4a2730
leaq -0x1e1(%rbp), %rdi
callq 0x426c70
movq -0x230(%rbp), %rax
cmpq $0x1, %rax
jne 0x41aa72
movq $0x61e980, %rax         # imm = 0x61E980
movb $0x1, (%rax)
jmp 0x41aa7c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x41aa24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x4a2730
leaq -0x1b9(%rbp), %rdi
callq 0x426c70
jmp 0x41aa98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x41aa64
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x4a2730
leaq -0x1e1(%rbp), %rdi
callq 0x426c70
jmp 0x41aa98
movq $0x61e980, %rax         # imm = 0x61E980
movb $0x0, (%rax)
callq 0x41aab0
jmp 0x41aa83
leaq -0xc8(%rbp), %rdi
callq 0x41bd20
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
leaq -0xc8(%rbp), %rdi
callq 0x41bd20
movq -0xf8(%rbp), %rdi
callq 0x4d0770