// File: /workspace/github_c_makefile_star2_O0/ataradov[P]edbg/edbg.c
// Function: parse_command_line
static void parse_command_line(int argc, char **argv)
{
  int option_index = 0;
  int c;
  bool help = false;

  while ((c = getopt_long(argc, argv, short_options, long_options, &option_index)) != -1)
  {
    switch (c)
    {
      case 'h': help = true; break;
      case 'x': g_target_options.reset = strtoul(optarg, NULL, 0); break;
      case 'e': g_target_options.erase = true; break;
      case 'p': g_target_options.program = true; break;
      case 'v': g_target_options.verify = true; break;
      case 'k': g_target_options.lock = true; break;
      case 'u': g_target_options.unlock = true; break;
      case 'r': g_target_options.read = true; break;
      case 'f': g_target_options.name = optarg; break;
      case 't': g_target = optarg; break;
      case 'l': g_list = true; break;
      case 's': g_serial = optarg; break;
      case 'c': g_clock = strtoul(optarg, NULL, 0) * 1000; break;
      case 'b': g_verbose = true; break;
      case 'd': g_version = strtoul(optarg, NULL, 0); break;
      case 'o': g_target_options.offset = (uint32_t)strtoul(optarg, NULL, 0); break;
      case 'z': g_target_options.size = (uint32_t)strtoul(optarg, NULL, 0); break;
      case 'F': g_target_options.fuse_cmd = optarg; break;
      default: exit(1); break;
    }
  }

  if (help)
    print_help(argv[0]);

  if (g_target_options.fuse_cmd && 0 == strcmp(g_target_options.fuse_cmd, "help"))
    print_fuse_help();

  check(optind >= argc, "malformed command line, use '-h' for more information");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movb $0x0, -0x19(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
movq 0x12cd0(%rip), %rdx     # 0x1c1d8
leaq 0x12641(%rip), %rcx     # 0x1bb50
leaq -0x14(%rbp), %r8
callq 0x60c0
movl %eax, -0x18(%rbp)
cmpl $-0x1, %eax
je 0x96b3
movl -0x18(%rbp), %eax
addl $-0x46, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x34, %eax
ja 0x96a4
movq -0x28(%rbp), %rax
leaq 0xadac(%rip), %rcx      # 0x142f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x1, -0x19(%rbp)
jmp 0x96ae
movq 0x12a7b(%rip), %rax     # 0x1bfd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x6250
movl %eax, 0x12c1f(%rip)     # 0x1c190
jmp 0x96ae
movb $0x1, 0x12c17(%rip)     # 0x1c194
jmp 0x96ae
movb $0x1, 0x12c0c(%rip)     # 0x1c195
jmp 0x96ae
movb $0x1, 0x12c01(%rip)     # 0x1c196
jmp 0x96ae
movb $0x1, 0x12bf6(%rip)     # 0x1c197
jmp 0x96ae
movb $0x1, 0x12beb(%rip)     # 0x1c198
jmp 0x96ae
movb $0x1, 0x12be0(%rip)     # 0x1c199
jmp 0x96ae
movq 0x12a13(%rip), %rax     # 0x1bfd8
movq (%rax), %rax
movq %rax, 0x12bd1(%rip)     # 0x1c1a0
jmp 0x96ae
movq 0x129fd(%rip), %rax     # 0x1bfd8
movq (%rax), %rax
movq %rax, 0x78bab(%rip)     # 0x82190
jmp 0x96ae
movb $0x1, 0x78b98(%rip)     # 0x82189
jmp 0x96ae
movq 0x129db(%rip), %rax     # 0x1bfd8
movq (%rax), %rax
movq %rax, 0x78b91(%rip)     # 0x82198
jmp 0x96ae
movq 0x129c5(%rip), %rax     # 0x1bfd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x6250
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
movq %rax, 0x12ba1(%rip)     # 0x1c1d0
jmp 0x96ae
movb $0x1, 0x78b50(%rip)     # 0x82188
jmp 0x96ae
movq 0x12997(%rip), %rax     # 0x1bfd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x6250
movl %eax, 0x12b73(%rip)     # 0x1c1c8
jmp 0x96ae
movq 0x1297a(%rip), %rax     # 0x1bfd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x6250
movl %eax, 0x12b36(%rip)     # 0x1c1a8
jmp 0x96ae
movq 0x1295d(%rip), %rax     # 0x1bfd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x6250
movl %eax, 0x12b1d(%rip)     # 0x1c1ac
jmp 0x96ae
movq 0x12940(%rip), %rax     # 0x1bfd8
movq (%rax), %rax
movq %rax, 0x12b0e(%rip)     # 0x1c1b0
jmp 0x96ae
movl $0x1, %edi
callq 0x6280
jmp 0x94fa
testb $0x1, -0x19(%rbp)
je 0x96c5
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x9b70
cmpq $0x0, 0x12ae3(%rip)     # 0x1c1b0
je 0x96ef
movq 0x12ada(%rip), %rdi     # 0x1c1b0
leaq 0xb19c(%rip), %rsi      # 0x14879
callq 0x6180
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x96ef
callq 0x9c00
movq 0x128da(%rip), %rax     # 0x1bfd0
movl (%rax), %eax
cmpl -0x4(%rbp), %eax
setge %al
movzbl %al, %edi
andl $0x1, %edi
leaq 0xb173(%rip), %rsi      # 0x1487e
xorl %eax, %eax
callq 0x8880
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)