// File: /workspace/github_cpp_makefile_star2_O1/tenup-coin[P]seeder/main.cpp
// Function: CDnsSeedOpts::ParseCommandLine(int, char**)
void ParseCommandLine(int argc, char **argv) {
    static const char *help = "tenup-seeder\n"
                              "Usage: %s -h <host> -n <ns> [-m <mbox>] [-t <threads>] [-p <port>]\n"
                              "\n"
                              "Options:\n"
                              "-h <host>       Hostname of the DNS seed\n"
                              "-n <ns>         Hostname of the nameserver\n"
                              "-m <mbox>       E-Mail address reported in SOA records\n"
                              "-t <threads>    Number of crawlers to run in parallel (default 96)\n"
                              "-d <threads>    Number of DNS server threads (default 4)\n"
                              "-p <port>       UDP port to listen on (default 53)\n"
                              "-o <ip:port>    Tor proxy IP/Port\n"
                              "-i <ip:port>    IPV4 SOCKS5 proxy IP/Port\n"
                              "-k <ip:port>    IPV6 SOCKS5 proxy IP/Port\n"
                              "-w f1,f2,...    Allow these flag combinations as filters\n"
                              "--testnet       Use testnet\n"
                              "--wipeban       Wipe list of banned nodes\n"
                              "--wipeignore    Wipe list of ignored nodes\n"
                              "-?, --help      Show this text\n"
                              "\n";
    bool showHelp = false;

    while(1) {
      static struct option long_options[] = {
        {"host", required_argument, 0, 'h'},
        {"ns",   required_argument, 0, 'n'},
        {"mbox", required_argument, 0, 'm'},
        {"threads", required_argument, 0, 't'},
        {"dnsthreads", required_argument, 0, 'd'},
        {"port", required_argument, 0, 'p'},
        {"onion", required_argument, 0, 'o'},
        {"proxyipv4", required_argument, 0, 'i'},
        {"proxyipv6", required_argument, 0, 'k'},
        {"filter", required_argument, 0, 'w'},
        {"testnet", no_argument, &fUseTestNet, 1},
        {"wipeban", no_argument, &fWipeBan, 1},
        {"wipeignore", no_argument, &fWipeBan, 1},
        {"help", no_argument, 0, 'h'},
        {0, 0, 0, 0}
      };
      int option_index = 0;
      int c = getopt_long(argc, argv, "h:n:m:t:p:d:o:i:k:w:", long_options, &option_index);
      if (c == -1) break;
      switch (c) {
        case 'h': {
          host = optarg;
          break;
        }
        
        case 'm': {
          mbox = optarg;
          break;
        }
        
        case 'n': {
          ns = optarg;
          break;
        }
        
        case 't': {
          int n = strtol(optarg, NULL, 10);
          if (n > 0 && n < 1000) nThreads = n;
          break;
        }

        case 'd': {
          int n = strtol(optarg, NULL, 10);
          if (n > 0 && n < 1000) nDnsThreads = n;
          break;
        }

        case 'p': {
          int p = strtol(optarg, NULL, 10);
          if (p > 0 && p < 65536) nPort = p;
          break;
        }

        case 'o': {
          tor = optarg;
          break;
        }

        case 'i': {
          ipv4_proxy = optarg;
          break;
        }

        case 'k': {
          ipv6_proxy = optarg;
          break;
        }

        case 'w': {
          char* ptr = optarg;
          while (*ptr != 0) {
            unsigned long l = strtoul(ptr, &ptr, 0);
            if (*ptr == ',') {
                ptr++;
            } else if (*ptr != 0) {
                break;
            }
            filter_whitelist.insert(l);
          }
          break;
        }

        case '?': {
          showHelp = true;
          break;
        }
      }
    }
    if (filter_whitelist.empty()) {
        filter_whitelist.insert(1);
        filter_whitelist.insert(5);
        filter_whitelist.insert(9);
        filter_whitelist.insert(13);
    }
    if (host != NULL && ns == NULL) showHelp = true;
    if (showHelp) fprintf(stderr, help, argv[0]);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0xc(%rdi), %rax
movq %rax, 0x28(%rsp)
leaq 0x10(%rdi), %rax
movq %rax, 0x20(%rsp)
leaq 0x48(%rdi), %r15
movq $0x0, 0x18(%rsp)
leaq 0x4a7a(%rip), %r12      # 0x13a78
leaq 0x8(%rsp), %r13
movb 0xd897(%rip), %al       # 0x1c8a0
testb %al, %al
je 0xf1ad
movl $0x0, 0x14(%rsp)
movl %ebp, %edi
movq %rbx, %rsi
leaq 0x510c(%rip), %rdx      # 0x14131
leaq 0xd694(%rip), %rcx      # 0x1c6c0
leaq 0x14(%rsp), %r8
callq 0x3610
leal -0x64(%rax), %ecx
cmpl $0x13, %ecx
ja 0xf077
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
movq 0xcf52(%rip), %rax      # 0x1bfa0
movq (%rax), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x3540
leal -0x1(%rax), %edx
movb $0x1, %cl
cmpl $0x3e6, %edx            # imm = 0x3E6
ja 0xf14f
movl %eax, 0x8(%r14)
jmp 0xf14f
cmpl $-0x1, %eax
je 0xf1a9
cmpl $0x3f, %eax
jne 0xf14d
movb $0x1, %cl
movb $0x1, %al
movq %rax, 0x18(%rsp)
jmp 0xf14f
movq 0xcf02(%rip), %rax      # 0x1bfa0
movq (%rax), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x3540
leal -0x1(%rax), %edx
movb $0x1, %cl
cmpl $0xfffe, %edx           # imm = 0xFFFE
ja 0xf14f
movl %eax, 0x4(%r14)
jmp 0xf14f
movq 0xced2(%rip), %rax      # 0x1bfa0
movq (%rax), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x3540
leal -0x1(%rax), %edx
movb $0x1, %cl
cmpl $0x3e6, %edx            # imm = 0x3E6
ja 0xf14f
movl %eax, (%r14)
jmp 0xf14f
movq 0xceaa(%rip), %rax      # 0x1bfa0
movq (%rax), %rax
movq %rax, 0x40(%r14)
jmp 0xf14d
movq 0xce9a(%rip), %rax      # 0x1bfa0
movq (%rax), %rax
movq %rax, 0x28(%r14)
jmp 0xf14d
movq 0xce8a(%rip), %rax      # 0x1bfa0
movq (%rax), %rax
movq %rax, 0x38(%r14)
jmp 0xf14d
movq 0xce7a(%rip), %rax      # 0x1bfa0
movq (%rax), %rax
movq %rax, 0x18(%r14)
jmp 0xf14d
movq 0xce6a(%rip), %rax      # 0x1bfa0
movq (%rax), %rax
movq %rax, 0x30(%r14)
jmp 0xf14d
movq 0xce5a(%rip), %rax      # 0x1bfa0
movq (%rax), %rax
movq %rax, 0x20(%r14)
movb $0x1, %cl
testb %cl, %cl
jne 0xf003
jmp 0xf1c1
movq 0xce40(%rip), %rax      # 0x1bfa0
movq (%rax), %rdi
movq %rdi, 0x8(%rsp)
cmpb $0x0, (%rdi)
je 0xf14d
movq %r13, %rsi
xorl %edx, %edx
callq 0x3130
movq %rax, 0x30(%rsp)
movq 0x8(%rsp), %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0xf195
cmpl $0x2c, %ecx
jne 0xf14d
incq %rax
movq %rax, 0x8(%rsp)
movq %r15, %rdi
leaq 0x30(%rsp), %rsi
callq 0xff2c
movq 0x8(%rsp), %rdi
jmp 0xf168
xorl %ecx, %ecx
jmp 0xf14f
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x37d1
jmp 0xf011
cmpq $0x0, 0x70(%r14)
jne 0xf225
leaq 0x8(%rsp), %r12
movq $0x1, (%r12)
movq %r15, %rdi
movq %r12, %rsi
callq 0x1003e
movq $0x5, (%r12)
leaq 0x8(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x1003e
movq $0x9, (%r12)
leaq 0x8(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x1003e
movq $0xd, (%r12)
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x1003e
cmpq $0x0, 0x28(%r14)
setne %al
cmpq $0x0, 0x20(%r14)
sete %cl
testb %cl, %al
jne 0xf24f
testb $0x1, 0x18(%rsp)
jne 0xf24f
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x3a1b
jmp 0xf240
nop