// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rsi, %rbx
movq (%rsi), %rsi
leaq -0x280(%rbp), %rdi
leaq -0x40(%rbp), %rdx
callq 0x30e0
leaq 0xe3ed(%rip), %rsi      # 0x122b3
leaq -0x260(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x30e0
leaq -0x280(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x5b1e
leaq -0x260(%rbp), %rdi
callq 0x3120
leaq -0x280(%rbp), %rdi
callq 0x3120
movq 0x8(%rbx), %rsi
leaq -0x40(%rbp), %rdi
leaq -0x1a(%rbp), %rdx
callq 0x30e0
leaq 0xe1c1(%rip), %rsi      # 0x120da
leaq -0x40(%rbp), %rdi
callq 0x30a0
testl %eax, %eax
je 0x3fd5
movq 0x8(%rbx), %rsi
leaq -0x60(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x30e0
leaq 0xe377(%rip), %rsi      # 0x122b9
leaq -0x60(%rbp), %r14
movq %r14, %rdi
callq 0x30a0
movl %eax, %r15d
movq %r14, %rdi
callq 0x3120
leaq -0x40(%rbp), %rdi
callq 0x3120
testl %r15d, %r15d
je 0x3fde
movq 0x1b05a(%rip), %r15     # 0x1efc8
leaq 0xe0ab(%rip), %r14      # 0x12020
movq %r15, %rdi
movq %r14, %rsi
callq 0x32b0
leaq 0xe337(%rip), %rsi      # 0x122be
movq %rax, %rdi
callq 0x32b0
movq %rax, %rdi
callq 0x3150
leaq 0xe2ba(%rip), %rsi      # 0x12258
movq %r15, %rdi
callq 0x32b0
leaq 0xe390(%rip), %rsi      # 0x1233d
movq %rax, %rdi
callq 0x32b0
movq %rax, %rdi
callq 0x3150
leaq 0xe2d7(%rip), %rsi      # 0x1229b
movq %r15, %rdi
callq 0x32b0
movq 0x8(%rbx), %rsi
jmp 0x4107
leaq -0x40(%rbp), %rdi
callq 0x3120
movq 0x10(%rbx), %rsi
leaq -0x240(%rbp), %rdi
leaq -0x40(%rbp), %rdx
callq 0x30e0
leaq 0xe356(%rip), %rsi      # 0x1234f
leaq -0x220(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x30e0
leaq -0x240(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x5b1e
leaq -0x220(%rbp), %rdi
callq 0x3120
leaq -0x240(%rbp), %rdi
callq 0x3120
movq 0x18(%rbx), %rsi
leaq -0x40(%rbp), %rdi
leaq -0x1a(%rbp), %rdx
callq 0x30e0
leaq 0xe098(%rip), %rsi      # 0x120e4
leaq -0x40(%rbp), %rdi
callq 0x30a0
testl %eax, %eax
je 0x412a
movq 0x18(%rbx), %rsi
leaq -0x60(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x30e0
leaq 0xe044(%rip), %rsi      # 0x120b9
leaq -0x60(%rbp), %r14
movq %r14, %rdi
callq 0x30a0
movl %eax, %r15d
movq %r14, %rdi
callq 0x3120
leaq -0x40(%rbp), %rdi
callq 0x3120
testl %r15d, %r15d
je 0x4133
movq 0x1af23(%rip), %r15     # 0x1efc8
leaq 0xdf74(%rip), %r14      # 0x12020
movq %r15, %rdi
movq %r14, %rsi
callq 0x32b0
leaq 0xe11a(%rip), %rsi      # 0x121d8
movq %rax, %rdi
callq 0x32b0
movq %rax, %rdi
callq 0x3150
leaq 0xe183(%rip), %rsi      # 0x12258
movq %r15, %rdi
callq 0x32b0
leaq 0xe272(%rip), %rsi      # 0x12356
movq %rax, %rdi
callq 0x32b0
movq %rax, %rdi
callq 0x3150
leaq 0xe1a0(%rip), %rsi      # 0x1229b
movq %r15, %rdi
callq 0x32b0
movq 0x18(%rbx), %rsi
movq %rax, %rdi
callq 0x32b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x32b0
movq %rax, %rdi
callq 0x3150
pushq $0x1
popq %rdi
callq 0x3310
leaq -0x40(%rbp), %rdi
callq 0x3120
movq 0x20(%rbx), %rsi
leaq -0x200(%rbp), %rdi
leaq -0x40(%rbp), %rdx
callq 0x30e0
leaq 0xe219(%rip), %rsi      # 0x12367
leaq -0x1e0(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x30e0
leaq -0x200(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x5b1e
leaq -0x1e0(%rbp), %rdi
callq 0x3120
leaq -0x200(%rbp), %rdi
callq 0x3120
movq 0x28(%rbx), %rsi
leaq -0x1c0(%rbp), %rdi
leaq -0x40(%rbp), %rdx
callq 0x30e0
leaq 0xe1ca(%rip), %rsi      # 0x1236e
leaq -0x1a0(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x30e0
leaq -0x1c0(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x5bc8
leaq -0x1a0(%rbp), %rdi
callq 0x3120
leaq -0x1c0(%rbp), %rdi
callq 0x3120
movq 0x30(%rbx), %rsi
leaq -0x180(%rbp), %rdi
leaq -0x40(%rbp), %rdx
callq 0x30e0
leaq 0xe17d(%rip), %rsi      # 0x12377
leaq -0x160(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x30e0
leaq -0x180(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x5b1e
leaq -0x160(%rbp), %rdi
callq 0x3120
leaq -0x180(%rbp), %rdi
callq 0x3120
movq 0x38(%rbx), %rsi
leaq -0x140(%rbp), %rdi
leaq -0x40(%rbp), %rdx
callq 0x30e0
leaq 0xe131(%rip), %rsi      # 0x12381
leaq -0x120(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x30e0
leaq -0x140(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x5bc8
leaq -0x120(%rbp), %rdi
callq 0x3120
leaq -0x140(%rbp), %rdi
callq 0x3120
movq 0x40(%rbx), %rsi
leaq -0x100(%rbp), %rdi
leaq -0x40(%rbp), %rdx
callq 0x30e0
leaq 0xe0e7(%rip), %rsi      # 0x1238d
leaq -0xe0(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x30e0
leaq -0x100(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x5b1e
leaq -0xe0(%rbp), %rdi
callq 0x3120
leaq -0x100(%rbp), %rdi
callq 0x3120
movq 0x48(%rbx), %r14
leaq 0xe0a9(%rip), %rsi      # 0x12395
leaq -0xc0(%rbp), %rdi
leaq -0x40(%rbp), %rdx
callq 0x30e0
leaq -0xc0(%rbp), %rsi
movq %r14, %rdi
callq 0x5d6c
leaq -0xc0(%rbp), %rdi
callq 0x3120
movq 0x50(%rbx), %rsi
leaq -0xa0(%rbp), %rdi
leaq -0x40(%rbp), %rdx
callq 0x30e0
leaq 0xe06a(%rip), %rsi      # 0x1239c
leaq -0x80(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x30e0
leaq -0xa0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x5b1e
leaq -0x80(%rbp), %rdi
callq 0x3120
leaq -0xa0(%rbp), %rdi
callq 0x3120
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4374
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
jmp 0x44a1
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x3120
jmp 0x4391
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
jmp 0x44a1
jmp 0x44a8
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
jmp 0x44a1
jmp 0x44a8
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x3120
jmp 0x43ca
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
jmp 0x44a1
jmp 0x44a8
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0x3120
jmp 0x43ef
movq %rax, %rbx
leaq -0x140(%rbp), %rdi
jmp 0x44a1
jmp 0x44a8
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x3120
jmp 0x4414
movq %rax, %rbx
leaq -0x180(%rbp), %rdi
jmp 0x44a1
jmp 0x44a8
movq %rax, %rbx
leaq -0x1a0(%rbp), %rdi
callq 0x3120
jmp 0x4439
movq %rax, %rbx
leaq -0x1c0(%rbp), %rdi
jmp 0x44a1
jmp 0x44a8
movq %rax, %rbx
leaq -0x1e0(%rbp), %rdi
callq 0x3120
jmp 0x4458
movq %rax, %rbx
leaq -0x200(%rbp), %rdi
jmp 0x44a1
jmp 0x44a8
jmp 0x44a8
movq %rax, %rbx
leaq -0x220(%rbp), %rdi
callq 0x3120
jmp 0x4479
movq %rax, %rbx
leaq -0x240(%rbp), %rdi
jmp 0x44a1
jmp 0x44a8
jmp 0x44a8
movq %rax, %rbx
leaq -0x260(%rbp), %rdi
callq 0x3120
jmp 0x449a
movq %rax, %rbx
leaq -0x280(%rbp), %rdi
callq 0x3120
jmp 0x44ab
movq %rax, %rbx
movq %rbx, %rdi
callq 0x34e0