// File: /workspace/github_cpp_makefile_star2_O3/IlyaSamoylov45[P]MapReduce-Project/main.cpp
// Function: parse_cmdline(int, char**)
void parse_cmdline(int argc, char *arr[]) {
  //check the argument values with -- in front
  check_values(arr[0], "--app");
  if(((std::string) arr[1]).compare("wordcount") != 0 && ((std::string) arr[1]).compare("sort") != 0){
    std::cout << "\n" << "Usage is:--app [wordcount, sort] --impl [procs, threads] --maps num_maps --reduces num_reduces --input infile --output outfile" << std::endl;
    std::cout << "Error was in the argument " << "[wordcount, sort]" << std::endl;
    std::cout << "You wrote: " << arr[1] << "\n" << std::endl;
    exit(EXIT_FAILURE);
  }
  check_values(arr[2], "--impl");

  if(((std::string)arr[3]).compare("procs") != 0 && ((std::string)arr[3]).compare("threads") != 0){
    std::cout << "\n" << "Usage is: --app [wordcount, sort] --impl [procs, threads] --maps num_maps --reduces num_reduces --input infile --output outfile" << std::endl;
    std::cout << "Error was in the argument " << "[procs, threads]" << std::endl;
    std::cout << "You wrote: " << arr[3] << "\n" << std::endl;
    exit(EXIT_FAILURE);
  }

  check_values(arr[4], "--maps");
  real_int(arr[5], "num_maps");
  check_values(arr[6], "--reduces");
  real_int(arr[7], "num_reduces");
  check_values(arr[8], "--input");
  check_file(arr[9], "infile");
  check_values(arr[10], "--output");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x270, %rsp            # imm = 0x270
movq %rsi, %rbx
movq (%rsi), %rsi
leaq -0x288(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x3110
leaq -0x158(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x10e19(%rip), %rsi     # 0x152b3
leaq 0x10e17(%rip), %rdx     # 0x152b8
leaq -0x168(%rbp), %rdi
callq 0x7aaa
leaq -0x288(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x68df
movq -0x168(%rbp), %rdi
cmpq %r14, %rdi
je 0x44d1
callq 0x32f0
leaq -0x278(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x44e6
callq 0x32f0
movq 0x8(%rbx), %rsi
leaq -0x48(%rbp), %rdi
leaq -0x22(%rbp), %rdx
callq 0x3110
leaq 0x10bdc(%rip), %rsi     # 0x150da
leaq -0x48(%rbp), %rdi
callq 0x30b0
testl %eax, %eax
je 0x4548
movq 0x8(%rbx), %rsi
leaq -0x68(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x3110
leaq 0x10d96(%rip), %rsi     # 0x152b9
leaq -0x68(%rbp), %r14
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
setne %r12b
movq (%r14), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x454b
callq 0x32f0
jmp 0x454b
xorl %r12d, %r12d
leaq -0x38(%rbp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x455d
callq 0x32f0
testb %r12b, %r12b
jne 0x4956
movq 0x10(%rbx), %rsi
leaq -0x268(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x3110
leaq -0x138(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x10dc3(%rip), %rsi     # 0x1534f
leaq 0x10dc2(%rip), %rdx     # 0x15355
leaq -0x148(%rbp), %rdi
callq 0x7aaa
leaq -0x268(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x68df
movq -0x148(%rbp), %rdi
cmpq %r14, %rdi
je 0x45c3
callq 0x32f0
leaq -0x258(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x45d8
callq 0x32f0
movq 0x18(%rbx), %rsi
leaq -0x48(%rbp), %rdi
leaq -0x22(%rbp), %rdx
callq 0x3110
leaq 0x10af4(%rip), %rsi     # 0x150e4
leaq -0x48(%rbp), %rdi
callq 0x30b0
testl %eax, %eax
je 0x463a
movq 0x18(%rbx), %rsi
leaq -0x68(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x3110
leaq 0x10aa4(%rip), %rsi     # 0x150b9
leaq -0x68(%rbp), %r14
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
setne %r12b
movq (%r14), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x463d
callq 0x32f0
jmp 0x463d
xorl %r12d, %r12d
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x464b
callq 0x32f0
testb %r12b, %r12b
jne 0x49c1
movq 0x20(%rbx), %rsi
leaq -0x248(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x3110
leaq -0x118(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x10ced(%rip), %rsi     # 0x15367
leaq 0x10cec(%rip), %rdx     # 0x1536d
leaq -0x128(%rbp), %rdi
callq 0x7aaa
leaq -0x248(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x68df
movq -0x128(%rbp), %rdi
cmpq %r14, %rdi
je 0x46b1
callq 0x32f0
leaq -0x238(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x46c6
callq 0x32f0
movq 0x28(%rbx), %rsi
leaq -0x228(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x3110
leaq -0xf8(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x10c82(%rip), %rsi     # 0x1536e
leaq 0x10c83(%rip), %rdx     # 0x15376
leaq -0x108(%rbp), %rdi
callq 0x7aaa
leaq -0x228(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x698b
movq -0x108(%rbp), %rdi
cmpq %r14, %rdi
je 0x4723
callq 0x32f0
leaq -0x218(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4738
callq 0x32f0
movq 0x30(%rbx), %rsi
leaq -0x208(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x3110
leaq -0xd8(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x10c19(%rip), %rsi     # 0x15377
leaq 0x10c1b(%rip), %rdx     # 0x15380
leaq -0xe8(%rbp), %rdi
callq 0x7aaa
leaq -0x208(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x68df
movq -0xe8(%rbp), %rdi
cmpq %r14, %rdi
je 0x4795
callq 0x32f0
leaq -0x1f8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x47aa
callq 0x32f0
movq 0x38(%rbx), %rsi
leaq -0x1e8(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x3110
leaq -0xb8(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x10bb1(%rip), %rsi     # 0x15381
leaq 0x10bb5(%rip), %rdx     # 0x1538c
leaq -0xc8(%rbp), %rdi
callq 0x7aaa
leaq -0x1e8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x698b
movq -0xc8(%rbp), %rdi
cmpq %r14, %rdi
je 0x4807
callq 0x32f0
leaq -0x1d8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x481c
callq 0x32f0
movq 0x40(%rbx), %rsi
leaq -0x1c8(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x3110
leaq -0x98(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x10b4b(%rip), %rsi     # 0x1538d
leaq 0x10b4b(%rip), %rdx     # 0x15394
leaq -0xa8(%rbp), %rdi
callq 0x7aaa
leaq -0x1c8(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x68df
movq -0xa8(%rbp), %rdi
cmpq %r14, %rdi
je 0x4879
callq 0x32f0
leaq -0x1b8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x488e
callq 0x32f0
movq 0x48(%rbx), %r14
leaq -0x198(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x10af0(%rip), %rsi     # 0x15395
leaq 0x10aef(%rip), %rdx     # 0x1539b
leaq -0x1a8(%rbp), %r15
movq %r15, %rdi
callq 0x7aaa
movq %r14, %rdi
movq %r15, %rsi
callq 0x6c18
movq -0x1a8(%rbp), %rdi
cmpq %r12, %rdi
je 0x48d7
callq 0x32f0
movq 0x50(%rbx), %rsi
leaq -0x188(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x3110
leaq -0x78(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x10aa2(%rip), %rsi     # 0x1539c
leaq 0x10aa3(%rip), %rdx     # 0x153a4
leaq -0x88(%rbp), %rdi
callq 0x7aaa
leaq -0x188(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x68df
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x4931
callq 0x32f0
leaq -0x178(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4946
callq 0x32f0
addq $0x270, %rsp            # imm = 0x270
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x1a673(%rip), %r15     # 0x1efd0
leaq 0x106bc(%rip), %r14     # 0x15020
movq %r15, %rdi
movq %r14, %rsi
callq 0x3310
leaq 0x10948(%rip), %rsi     # 0x152be
movq %rax, %rdi
callq 0x3310
movq %rax, %rdi
callq 0x3170
leaq 0x108cb(%rip), %rsi     # 0x15258
movq %r15, %rdi
callq 0x3310
leaq 0x109a1(%rip), %rsi     # 0x1533d
movq %rax, %rdi
callq 0x3310
movq %rax, %rdi
callq 0x3170
leaq 0x108e8(%rip), %rsi     # 0x1529b
movq %r15, %rdi
callq 0x3310
movq 0x8(%rbx), %rsi
jmp 0x4a2a
movq 0x1a608(%rip), %r15     # 0x1efd0
leaq 0x10651(%rip), %r14     # 0x15020
movq %r15, %rdi
movq %r14, %rsi
callq 0x3310
leaq 0x107f7(%rip), %rsi     # 0x151d8
movq %rax, %rdi
callq 0x3310
movq %rax, %rdi
callq 0x3170
leaq 0x10860(%rip), %rsi     # 0x15258
movq %r15, %rdi
callq 0x3310
leaq 0x1094f(%rip), %rsi     # 0x15356
movq %rax, %rdi
callq 0x3310
movq %rax, %rdi
callq 0x3170
leaq 0x1087d(%rip), %rsi     # 0x1529b
movq %r15, %rdi
callq 0x3310
movq 0x18(%rbx), %rsi
movq %rax, %rdi
callq 0x3310
movq %rax, %rdi
movq %r14, %rsi
callq 0x3310
movq %rax, %rdi
callq 0x3170
movl $0x1, %edi
callq 0x3370
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
jne 0x4bc9
jmp 0x4bd3
movq %rax, %rbx
leaq -0x38(%rbp), %rax
jmp 0x4bc0
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x4a89
callq 0x32f0
jmp 0x4a89
movq %rax, %rbx
leaq -0x178(%rbp), %rax
jmp 0x4bc0
jmp 0x4bd0
movq %rax, %rbx
movq -0x1a8(%rbp), %rdi
cmpq %r12, %rdi
jne 0x4bc9
jmp 0x4bd3
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r14, %rdi
je 0x4acb
callq 0x32f0
jmp 0x4acb
movq %rax, %rbx
leaq -0x1b8(%rbp), %rax
jmp 0x4bc0
jmp 0x4bd0
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r14, %rdi
je 0x4af5
callq 0x32f0
jmp 0x4af5
movq %rax, %rbx
leaq -0x1d8(%rbp), %rax
jmp 0x4bc0
jmp 0x4bd0
movq %rax, %rbx
movq -0xe8(%rbp), %rdi
cmpq %r14, %rdi
je 0x4b1f
callq 0x32f0
jmp 0x4b1f
movq %rax, %rbx
leaq -0x1f8(%rbp), %rax
jmp 0x4bc0
jmp 0x4bd0
movq %rax, %rbx
movq -0x108(%rbp), %rdi
cmpq %r14, %rdi
je 0x4b49
callq 0x32f0
jmp 0x4b49
movq %rax, %rbx
leaq -0x218(%rbp), %rax
jmp 0x4bc0
jmp 0x4bd0
movq %rax, %rbx
movq -0x128(%rbp), %rdi
cmpq %r14, %rdi
je 0x4b6d
callq 0x32f0
jmp 0x4b6d
movq %rax, %rbx
leaq -0x238(%rbp), %rax
jmp 0x4bc0
jmp 0x4bd0
jmp 0x4bd0
movq %rax, %rbx
movq -0x148(%rbp), %rdi
cmpq %r14, %rdi
je 0x4b93
callq 0x32f0
jmp 0x4b93
movq %rax, %rbx
leaq -0x258(%rbp), %rax
jmp 0x4bc0
jmp 0x4bd0
jmp 0x4bd0
movq %rax, %rbx
movq -0x168(%rbp), %rdi
cmpq %r14, %rdi
je 0x4bb9
callq 0x32f0
jmp 0x4bb9
movq %rax, %rbx
leaq -0x278(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4bd3
callq 0x32f0
jmp 0x4bd3
movq %rax, %rbx
movq %rbx, %rdi
callq 0x3560