// File: /workspace/github_cpp_makefile_star2_O1/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 $0x290, %rsp            # imm = 0x290
movq %rsi, %rbx
movq (%rsi), %rsi
leaq -0x288(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x3110
leaq -0x138(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x11e1a(%rip), %rsi     # 0x162b3
leaq 0x11e18(%rip), %rdx     # 0x162b8
leaq -0x148(%rbp), %rdi
callq 0x7c22
leaq -0x288(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x6a2e
movq -0x148(%rbp), %rdi
cmpq %r14, %rdi
je 0x44d0
callq 0x32f0
leaq -0x278(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x44e5
callq 0x32f0
movq 0x8(%rbx), %rsi
leaq -0x48(%rbp), %rdi
leaq -0x248(%rbp), %rdx
callq 0x3110
leaq 0x11bda(%rip), %rsi     # 0x160da
leaq -0x48(%rbp), %rdi
callq 0x30b0
movl %eax, %r14d
testl %eax, %eax
je 0x453f
movq 0x8(%rbx), %rsi
leaq -0x2a8(%rbp), %rdi
leaq -0x23(%rbp), %rdx
callq 0x3110
leaq 0x11d8e(%rip), %rsi     # 0x162b9
leaq -0x2a8(%rbp), %rdi
callq 0x30b0
testl %eax, %eax
setne %r12b
jmp 0x4542
xorl %r12d, %r12d
testl %r14d, %r14d
je 0x455c
leaq -0x298(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x455c
callq 0x32f0
leaq -0x38(%rbp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x456e
callq 0x32f0
testb %r12b, %r12b
jne 0x496a
movq 0x10(%rbx), %rsi
leaq -0x268(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x3110
leaq -0x118(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x11db2(%rip), %rsi     # 0x1634f
leaq 0x11db1(%rip), %rdx     # 0x16355
leaq -0x128(%rbp), %rdi
callq 0x7c22
leaq -0x268(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x6a2e
movq -0x128(%rbp), %rdi
cmpq %r14, %rdi
je 0x45d4
callq 0x32f0
leaq -0x258(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x45e9
callq 0x32f0
movq 0x18(%rbx), %rsi
leaq -0x48(%rbp), %rdi
leaq -0x22(%rbp), %rdx
callq 0x3110
leaq 0x11ae3(%rip), %rsi     # 0x160e4
leaq -0x48(%rbp), %rdi
callq 0x30b0
movl %eax, %r14d
testl %eax, %eax
je 0x4640
movq 0x18(%rbx), %rsi
leaq -0x248(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x3110
leaq 0x11a8d(%rip), %rsi     # 0x160b9
leaq -0x248(%rbp), %rdi
callq 0x30b0
testl %eax, %eax
setne %r12b
jmp 0x4643
xorl %r12d, %r12d
testl %r14d, %r14d
je 0x465d
leaq -0x238(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x465d
callq 0x32f0
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x466b
callq 0x32f0
testb %r12b, %r12b
jne 0x49d5
movq 0x20(%rbx), %rsi
leaq -0x228(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x3110
leaq -0xf8(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x11ccd(%rip), %rsi     # 0x16367
leaq 0x11ccc(%rip), %rdx     # 0x1636d
leaq -0x108(%rbp), %rdi
callq 0x7c22
leaq -0x228(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x6a2e
movq -0x108(%rbp), %rdi
cmpq %r14, %rdi
je 0x46d1
callq 0x32f0
leaq -0x218(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x46e6
callq 0x32f0
movq 0x28(%rbx), %rsi
leaq -0x208(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x3110
leaq -0xd8(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x11c62(%rip), %rsi     # 0x1636e
leaq 0x11c63(%rip), %rdx     # 0x16376
leaq -0xe8(%rbp), %rdi
callq 0x7c22
leaq -0x208(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x6ada
movq -0xe8(%rbp), %rdi
cmpq %r14, %rdi
je 0x4743
callq 0x32f0
leaq -0x1f8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4758
callq 0x32f0
movq 0x30(%rbx), %rsi
leaq -0x1e8(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x3110
leaq -0xb8(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x11bf9(%rip), %rsi     # 0x16377
leaq 0x11bfb(%rip), %rdx     # 0x16380
leaq -0xc8(%rbp), %rdi
callq 0x7c22
leaq -0x1e8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x6a2e
movq -0xc8(%rbp), %rdi
cmpq %r14, %rdi
je 0x47b5
callq 0x32f0
leaq -0x1d8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x47ca
callq 0x32f0
movq 0x38(%rbx), %rsi
leaq -0x1c8(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x3110
leaq -0x98(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x11b91(%rip), %rsi     # 0x16381
leaq 0x11b95(%rip), %rdx     # 0x1638c
leaq -0xa8(%rbp), %rdi
callq 0x7c22
leaq -0x1c8(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x6ada
movq -0xa8(%rbp), %rdi
cmpq %r14, %rdi
je 0x4827
callq 0x32f0
leaq -0x1b8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x483c
callq 0x32f0
movq 0x40(%rbx), %rsi
leaq -0x1a8(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x3110
leaq -0x78(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x11b2e(%rip), %rsi     # 0x1638d
leaq 0x11b2e(%rip), %rdx     # 0x16394
leaq -0x88(%rbp), %rdi
callq 0x7c22
leaq -0x1a8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x6a2e
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x4896
callq 0x32f0
leaq -0x198(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x48ab
callq 0x32f0
movq 0x48(%rbx), %r14
leaq -0x178(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x11ad3(%rip), %rsi     # 0x16395
leaq 0x11ad2(%rip), %rdx     # 0x1639b
leaq -0x188(%rbp), %r15
movq %r15, %rdi
callq 0x7c22
movq %r14, %rdi
movq %r15, %rsi
callq 0x6d67
movq -0x188(%rbp), %rdi
cmpq %r12, %rdi
je 0x48f4
callq 0x32f0
movq 0x50(%rbx), %rsi
leaq -0x168(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x3110
leaq -0x58(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x11a85(%rip), %rsi     # 0x1639c
leaq 0x11a86(%rip), %rdx     # 0x163a4
leaq -0x68(%rbp), %rdi
callq 0x7c22
leaq -0x168(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x6a2e
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x4945
callq 0x32f0
leaq -0x158(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x495a
callq 0x32f0
addq $0x290, %rsp            # imm = 0x290
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x1b65f(%rip), %r15     # 0x1ffd0
leaq 0x116a8(%rip), %r14     # 0x16020
movq %r15, %rdi
movq %r14, %rsi
callq 0x3310
leaq 0x11934(%rip), %rsi     # 0x162be
movq %rax, %rdi
callq 0x3310
movq %rax, %rdi
callq 0x3170
leaq 0x118b7(%rip), %rsi     # 0x16258
movq %r15, %rdi
callq 0x3310
leaq 0x1198d(%rip), %rsi     # 0x1633d
movq %rax, %rdi
callq 0x3310
movq %rax, %rdi
callq 0x3170
leaq 0x118d4(%rip), %rsi     # 0x1629b
movq %r15, %rdi
callq 0x3310
movq 0x8(%rbx), %rsi
jmp 0x4a3e
movq 0x1b5f4(%rip), %r15     # 0x1ffd0
leaq 0x1163d(%rip), %r14     # 0x16020
movq %r15, %rdi
movq %r14, %rsi
callq 0x3310
leaq 0x117e3(%rip), %rsi     # 0x161d8
movq %rax, %rdi
callq 0x3310
movq %rax, %rdi
callq 0x3170
leaq 0x1184c(%rip), %rsi     # 0x16258
movq %r15, %rdi
callq 0x3310
leaq 0x1193b(%rip), %rsi     # 0x16356
movq %rax, %rdi
callq 0x3310
movq %rax, %rdi
callq 0x3170
leaq 0x11869(%rip), %rsi     # 0x1629b
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 0x4bda
jmp 0x4be4
movq %rax, %rbx
leaq -0x38(%rbp), %rax
jmp 0x4bd1
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x4a9a
callq 0x32f0
jmp 0x4a9a
movq %rax, %rbx
leaq -0x158(%rbp), %rax
jmp 0x4bd1
jmp 0x4be1
movq %rax, %rbx
movq -0x188(%rbp), %rdi
cmpq %r12, %rdi
jne 0x4bda
jmp 0x4be4
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x4adc
callq 0x32f0
jmp 0x4adc
movq %rax, %rbx
leaq -0x198(%rbp), %rax
jmp 0x4bd1
jmp 0x4be1
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r14, %rdi
je 0x4b06
callq 0x32f0
jmp 0x4b06
movq %rax, %rbx
leaq -0x1b8(%rbp), %rax
jmp 0x4bd1
jmp 0x4be1
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r14, %rdi
je 0x4b30
callq 0x32f0
jmp 0x4b30
movq %rax, %rbx
leaq -0x1d8(%rbp), %rax
jmp 0x4bd1
jmp 0x4be1
movq %rax, %rbx
movq -0xe8(%rbp), %rdi
cmpq %r14, %rdi
je 0x4b5a
callq 0x32f0
jmp 0x4b5a
movq %rax, %rbx
leaq -0x1f8(%rbp), %rax
jmp 0x4bd1
jmp 0x4be1
movq %rax, %rbx
movq -0x108(%rbp), %rdi
cmpq %r14, %rdi
je 0x4b7e
callq 0x32f0
jmp 0x4b7e
movq %rax, %rbx
leaq -0x218(%rbp), %rax
jmp 0x4bd1
jmp 0x4be1
jmp 0x4be1
movq %rax, %rbx
movq -0x128(%rbp), %rdi
cmpq %r14, %rdi
je 0x4ba4
callq 0x32f0
jmp 0x4ba4
movq %rax, %rbx
leaq -0x258(%rbp), %rax
jmp 0x4bd1
jmp 0x4be1
jmp 0x4be1
movq %rax, %rbx
movq -0x148(%rbp), %rdi
cmpq %r14, %rdi
je 0x4bca
callq 0x32f0
jmp 0x4bca
movq %rax, %rbx
leaq -0x278(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4be4
callq 0x32f0
jmp 0x4be4
movq %rax, %rbx
movq %rbx, %rdi
callq 0x3560