// File: /workspace/github_cpp_makefile_star2_O2/knei-knurow[P]lidar-visualizations/src/app.cpp
// Function: App::parse_args(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
bool App::parse_args(std::vector<std::string>& args) {
  // Print help
  if (check_arg(args, "-h", "--help")) {
    print_help();
    return false;
  }

  // Input RPLIDAR port name
  std::string rplidar_port = get_arg_value(args, "-p", "--port");

  // Input cloud filename
  std::string cloud_filename = get_arg_value(args, "-f", "--file");

  // Input cloud series filename
  std::string cloud_series_filename = get_arg_value(args, "-fs", "--file-series");

  // Output directory
  std::string output_dir = get_arg_value(args, "-o", "--output-dir", ".");

#ifdef USING_RPLIDAR
  // RPLIDAR mode
  std::string rplidar_mode_val = get_arg_value(args, "-m", "--rplidar-mode",
                                               std::to_string(int(RPLIDARScanModes::SENSITIVITY)));
  RPLIDARScanModes rplidar_mode;
  if (rplidar_mode_val == std::to_string(int(RPLIDARScanModes::STANDARD))) {
    rplidar_mode = RPLIDARScanModes::STANDARD;
  } else if (rplidar_mode_val == std::to_string(int(RPLIDARScanModes::EXPRESS))) {
    rplidar_mode = RPLIDARScanModes::EXPRESS;
  } else if (rplidar_mode_val == std::to_string(int(RPLIDARScanModes::BOOST))) {
    rplidar_mode = RPLIDARScanModes::BOOST;
  } else if (rplidar_mode_val == std::to_string(int(RPLIDARScanModes::SENSITIVITY))) {
    rplidar_mode = RPLIDARScanModes::SENSITIVITY;
  } else if (rplidar_mode_val == std::to_string(int(RPLIDARScanModes::STABILITY))) {
    rplidar_mode = RPLIDARScanModes::STABILITY;
  } else {
    std::cerr << "ERROR: Invalid RPLIDAR mode id." << std::endl;
    return false;
  }

  // RPLIDAR RPM
  int rplidar_rpm = 660;
  std::stringstream(get_arg_value(args, "-r", "--rpm")) >> rplidar_rpm;
#endif

  // GUI
  std::string gui_type_val = get_arg_value(args, "-g", "--gui", std::to_string(int(GUIType::SFML)));
  GUIType gui_type;
  if (gui_type_val == std::to_string(int(GUIType::TERMINAL))) {
    gui_type = GUIType::TERMINAL;
  }
#ifdef USING_SFML
  else if (gui_type_val == std::to_string(int(GUIType::SFML))) {
    gui_type = GUIType::SFML;
  }
#endif
  else {
    std::cerr << "ERROR: Invalid GUI id." << std::endl;
    return false;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x4778(%rip), %rsi      # 0x8359
leaq -0x158(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0x37f8
leaq 0x4761(%rip), %rsi      # 0x835c
leaq -0xf8(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0x37f8
leaq -0x158(%rbp), %rdx
leaq -0xf8(%rbp), %rcx
movq %rbx, %rsi
callq 0x46cc
movl %eax, %r15d
leaq -0xf8(%rbp), %rdi
callq 0x3130
leaq -0x158(%rbp), %rdi
callq 0x3130
testb %r15b, %r15b
je 0x3c50
callq 0x4534
xorl %eax, %eax
jmp 0x427e
leaq 0x470c(%rip), %rsi      # 0x8363
leaq -0xf8(%rbp), %rdi
leaq -0x98(%rbp), %rdx
callq 0x37f8
leaq 0x46f5(%rip), %rsi      # 0x8366
leaq -0xd8(%rbp), %rdi
leaq -0x78(%rbp), %rdx
callq 0x37f8
leaq 0x4c53(%rip), %rsi      # 0x88db
leaq -0xb8(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x37f8
leaq -0x158(%rbp), %rdi
leaq -0xf8(%rbp), %rcx
leaq -0xd8(%rbp), %r8
leaq -0xb8(%rbp), %r9
movq %rbx, %rdx
callq 0x491c
leaq -0xb8(%rbp), %rdi
callq 0x3130
leaq -0xd8(%rbp), %rdi
callq 0x3130
leaq -0xf8(%rbp), %rdi
callq 0x3130
leaq 0x4686(%rip), %rsi      # 0x836d
leaq -0xd8(%rbp), %rdi
leaq -0x78(%rbp), %rdx
callq 0x37f8
leaq 0x4672(%rip), %rsi      # 0x8370
leaq -0xb8(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x37f8
leaq 0x4bc6(%rip), %rsi      # 0x88db
leaq -0x98(%rbp), %rdi
leaq -0x118(%rbp), %rdx
callq 0x37f8
leaq -0xf8(%rbp), %rdi
leaq -0xd8(%rbp), %rcx
leaq -0xb8(%rbp), %r8
leaq -0x98(%rbp), %r9
movq %rbx, %rdx
callq 0x491c
leaq -0x98(%rbp), %rdi
callq 0x3130
leaq -0xb8(%rbp), %rdi
callq 0x3130
leaq -0xd8(%rbp), %rdi
callq 0x3130
leaq 0x4600(%rip), %rsi      # 0x8377
leaq -0xb8(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x37f8
leaq 0x45ed(%rip), %rsi      # 0x837b
leaq -0x98(%rbp), %rdi
leaq -0x118(%rbp), %rdx
callq 0x37f8
leaq 0x4b33(%rip), %rsi      # 0x88db
leaq -0x78(%rbp), %rdi
leaq -0x138(%rbp), %rdx
callq 0x37f8
leaq -0xd8(%rbp), %rdi
leaq -0xb8(%rbp), %rcx
leaq -0x98(%rbp), %r8
leaq -0x78(%rbp), %r9
movq %rbx, %rdx
callq 0x491c
leaq -0x78(%rbp), %rdi
callq 0x3130
leaq -0x98(%rbp), %rdi
callq 0x3130
leaq -0xb8(%rbp), %rdi
callq 0x3130
leaq 0x4588(%rip), %rsi      # 0x8389
leaq -0x98(%rbp), %rdi
leaq -0x118(%rbp), %rdx
callq 0x37f8
leaq 0x4571(%rip), %rsi      # 0x838c
leaq -0x78(%rbp), %rdi
leaq -0x138(%rbp), %rdx
callq 0x37f8
leaq 0x4965(%rip), %rsi      # 0x8797
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x37f8
leaq -0xb8(%rbp), %rdi
leaq -0x98(%rbp), %rcx
leaq -0x78(%rbp), %r8
leaq -0x50(%rbp), %r9
movq %rbx, %rdx
callq 0x491c
leaq -0x50(%rbp), %rdi
callq 0x3130
leaq -0x78(%rbp), %rdi
callq 0x3130
leaq -0x98(%rbp), %rdi
callq 0x3130
leaq 0x4517(%rip), %rsi      # 0x8399
leaq -0x78(%rbp), %rdi
leaq -0x138(%rbp), %rdx
callq 0x37f8
leaq 0x4503(%rip), %rsi      # 0x839c
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x37f8
leaq -0x118(%rbp), %rdi
pushq $0x1
popq %rsi
callq 0x4df2
leaq -0x98(%rbp), %rdi
leaq -0x78(%rbp), %rcx
leaq -0x50(%rbp), %r8
leaq -0x118(%rbp), %r9
movq %rbx, %rdx
callq 0x491c
leaq -0x118(%rbp), %rdi
callq 0x3130
leaq -0x50(%rbp), %rdi
callq 0x3130
leaq -0x78(%rbp), %rdi
callq 0x3130
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
callq 0x4df2
leaq -0x98(%rbp), %rdi
leaq -0x78(%rbp), %r15
movq %r15, %rsi
callq 0x4e52
movl %eax, %r12d
movq %r15, %rdi
callq 0x3130
testb %r12b, %r12b
je 0x3fcb
leaq 0x448f(%rip), %rsi      # 0x83b9
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x37f8
leaq 0x447e(%rip), %rsi      # 0x83bc
leaq -0x118(%rbp), %rdi
leaq -0x51(%rbp), %rdx
callq 0x37f8
leaq -0x138(%rbp), %rdi
xorl %esi, %esi
callq 0x4df2
leaq -0x78(%rbp), %rdi
leaq -0x50(%rbp), %rcx
leaq -0x118(%rbp), %r8
leaq -0x138(%rbp), %r9
movq %rbx, %rdx
callq 0x491c
leaq -0x138(%rbp), %rdi
callq 0x3130
leaq -0x118(%rbp), %rdi
callq 0x3130
leaq -0x50(%rbp), %rdi
callq 0x3130
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x4df2
leaq -0x78(%rbp), %rdi
leaq -0x50(%rbp), %r15
movq %r15, %rsi
callq 0x4e52
movl %eax, %r12d
movq %r15, %rdi
callq 0x3130
testb %r12b, %r12b
je 0x3ff2
xorl %r13d, %r13d
jmp 0x4021
movq 0x801e(%rip), %rdi      # 0xbff0
leaq 0x43c9(%rip), %rsi      # 0x83a2
callq 0x3290
movq %rax, %rdi
callq 0x3150
movl $0x0, -0x30(%rbp)
jmp 0x423f
leaq -0x50(%rbp), %rdi
pushq $0x1
popq %rsi
callq 0x4df2
leaq -0x78(%rbp), %rdi
movq %r15, %rsi
callq 0x4e52
movl %eax, %r12d
movq %r15, %rdi
callq 0x3130
movb $0x1, %r13b
testb %r12b, %r12b
je 0x41e8
cmpq $0x0, -0xd0(%rbp)
je 0x4072
leaq -0x50(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x4e7e
movq -0x50(%rbp), %rax
andq $0x0, -0x50(%rbp)
movq 0x8(%r14), %rdi
movq %rax, 0x8(%r14)
testq %rdi, %rdi
je 0x4066
movq (%rdi), %rax
callq *0x8(%rax)
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x4066
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%r14), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x40d5
cmpq $0x0, -0xf0(%rbp)
je 0x40ed
movabsq $0x3fc999999999999a, %rax # imm = 0x3FC999999999999A
leaq -0x118(%rbp), %rdx
movq %rax, (%rdx)
leaq -0x50(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x4ecf
movq -0x50(%rbp), %rax
andq $0x0, -0x50(%rbp)
movq 0x8(%r14), %rdi
movq %rax, 0x8(%r14)
testq %rdi, %rdi
je 0x40cb
movq (%rdi), %rax
callq *0x8(%rax)
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x40cb
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%r14), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
jne 0x40ed
movq 0x8(%r14), %rdi
andq $0x0, 0x8(%r14)
testq %rdi, %rdi
je 0x40ed
movq (%rdi), %rax
callq *0x8(%rax)
cmpq $0x0, 0x8(%r14)
jne 0x410c
cmpq $0x0, 0x18(%r14)
jne 0x410c
cmpq $0x0, 0x10(%r14)
jne 0x410c
callq 0x4534
jmp 0x422f
leaq -0x50(%rbp), %rdi
callq 0x4f27
leaq 0x18(%r14), %rdi
movq (%r15), %rsi
andq $0x0, (%r15)
callq 0x5228
movq %r15, %rdi
callq 0x4f68
testb %r13b, %r13b
je 0x416d
leaq -0x50(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x4f8c
movq -0x50(%rbp), %rax
andq $0x0, -0x50(%rbp)
movq 0x10(%r14), %rdi
movq %rax, 0x10(%r14)
testq %rdi, %rdi
je 0x416d
movq (%rdi), %rax
callq *0x8(%rax)
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x416d
movq (%rdi), %rax
callq *0x8(%rax)
movq (%rbx), %rax
movb $0x1, %cl
movl %ecx, -0x30(%rbp)
cmpq 0x8(%rbx), %rax
je 0x4236
movq 0x7e6a(%rip), %rdi      # 0xbff0
leaq 0x4256(%rip), %rsi      # 0x83e3
callq 0x3290
movq (%rbx), %r15
movq 0x8(%rbx), %r14
movq 0x7e50(%rip), %rbx      # 0xbff0
leaq 0x4265(%rip), %r12      # 0x840c
leaq 0x4260(%rip), %r13      # 0x840e
cmpq %r14, %r15
je 0x41da
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3290
movq %rax, %rdi
movq %r15, %rsi
callq 0x3260
movq %rax, %rdi
movq %r13, %rsi
callq 0x3290
addq $0x20, %r15
jmp 0x41ae
movq 0x7e0f(%rip), %rdi      # 0xbff0
callq 0x3150
jmp 0x4236
leaq -0x50(%rbp), %rdi
pushq $0x2
popq %rsi
callq 0x4df2
leaq -0x78(%rbp), %rdi
movq %r15, %rsi
callq 0x4e52
movl %eax, %r12d
movq %r15, %rdi
callq 0x3130
testb %r12b, %r12b
jne 0x3fc6
movq 0x7dd5(%rip), %rdi      # 0xbff0
leaq 0x41a5(%rip), %rsi      # 0x83c7
callq 0x3290
movq %rax, %rdi
callq 0x3150
movl $0x0, -0x30(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3130
leaq -0x98(%rbp), %rdi
callq 0x3130
leaq -0xb8(%rbp), %rdi
callq 0x3130
leaq -0xd8(%rbp), %rdi
callq 0x3130
leaq -0xf8(%rbp), %rdi
callq 0x3130
leaq -0x158(%rbp), %rdi
callq 0x3130
movl -0x30(%rbp), %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x43f7
jmp 0x43f7
jmp 0x43f7
jmp 0x43f7
jmp 0x43f7
jmp 0x43f7
jmp 0x43f7
movq %rax, %rbx
leaq -0x138(%rbp), %rdi
callq 0x3130
jmp 0x42c7
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
callq 0x3130
jmp 0x42d8
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
jmp 0x43fe
jmp 0x42ea
jmp 0x43f7
jmp 0x42ea
movq %rax, %rbx
jmp 0x4403
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
callq 0x3130
jmp 0x4306
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x3130
jmp 0x4314
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
jmp 0x440a
movq %rax, %rbx
jmp 0x440f
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x3130
jmp 0x4336
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x3130
jmp 0x4344
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
jmp 0x4416
movq %rax, %rbx
jmp 0x441b
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x3130
jmp 0x4369
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x3130
jmp 0x437a
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
jmp 0x4422
jmp 0x43e8
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x3130
jmp 0x439c
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x3130
jmp 0x43ad
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
jmp 0x442e
jmp 0x43ed
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x3130
jmp 0x43cc
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x3130
jmp 0x43dd
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
jmp 0x443a
jmp 0x43f2
movq %rax, %rbx
jmp 0x4427
movq %rax, %rbx
jmp 0x4433
movq %rax, %rbx
jmp 0x443f
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x3130
leaq -0x98(%rbp), %rdi
callq 0x3130
leaq -0xb8(%rbp), %rdi
callq 0x3130
leaq -0xd8(%rbp), %rdi
callq 0x3130
leaq -0xf8(%rbp), %rdi
callq 0x3130
leaq -0x158(%rbp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3480
nop