// File: /workspace/github_c_makefile_star2_O0/randyrossi[P]fisher-modem/mkfilter/src/mkshape.C
// Function: readcmdline(char**)
static void readcmdline(char** argv) {
  int ap = 0;
  unless(argv[ap] == NULL) ap++; /* skip program name */
  options = numcoeffs = truncbits = 0;
  while (argv[ap] != NULL && argv[ap][0] == '-') {
    char* s = argv[ap++];
    s++;
    uint opts = 0;
    until(*s == '\0') {
      char ch = *(s++);
      if (ch == 'c')
        opts |= opt_c;
      else if (ch == 'r')
        opts |= opt_r;
      else if (ch == 'h')
        opts |= opt_h;
      else if (ch == 'i')
        opts |= opt_i;
      else if (ch == 'l')
        opts |= opt_l;
      else if (ch == 'x')
        opts |= opt_x;
      else if (ch == 'w')
        opts |= opt_w;
      else if (ch == 'b')
        opts |= opt_b;
      else if (ch == 't')
        opts |= opt_t;
      else
        usage();
    }
    if (opts & (opt_c | opt_r)) {
      alpha = getf(argv[ap++]);
      beta = getf(argv[ap++]);
    }
    if (opts & (opt_c | opt_r | opt_h | opt_i)) {
      numcoeffs = geti(argv[ap++]);
      unless(numcoeffs & 1) giveup("sorry, filter length must be odd");
      /* (num.zeros) = (num.coeffs) - 1 */
      if (numcoeffs < 1 || numcoeffs > MAXPZ + 1)
        giveup("filter length must be in range 1 .. %d", MAXPZ + 1);
    }
    if (opts & opt_b) {
      truncbits = geti(argv[ap++]);
      if (truncbits <= 0)
        giveup("Num. bits after -b must be .gt. 0");
    }
    options |= opts;
  }
  unless(argv[ap] == NULL) usage();
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x20(%rsp), %rax
movslq 0x1c(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x130d
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
movl $0x0, 0x7d9d(%rip)      # 0x90b4
movl $0x0, 0x7d97(%rip)      # 0x90b8
movl $0x0, 0x7d85(%rip)      # 0x90b0
movq 0x20(%rsp), %rcx
movslq 0x1c(%rsp), %rdx
xorl %eax, %eax
cmpq $0x0, (%rcx,%rdx,8)
movb %al, 0xa(%rsp)
je 0x135d
movq 0x20(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
sete %al
movb %al, 0xa(%rsp)
movb 0xa(%rsp), %al
testb $0x1, %al
jne 0x136a
jmp 0x15f3
movq 0x20(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x1c(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movq 0x10(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x13b7
jmp 0x14c7
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rsp)
movb (%rax), %al
movb %al, 0xb(%rsp)
movsbl 0xb(%rsp), %eax
cmpl $0x63, %eax
jne 0x13e8
movl 0xc(%rsp), %eax
orl $0x2, %eax
movl %eax, 0xc(%rsp)
jmp 0x14c2
movsbl 0xb(%rsp), %eax
cmpl $0x72, %eax
jne 0x1402
movl 0xc(%rsp), %eax
orl $0x4, %eax
movl %eax, 0xc(%rsp)
jmp 0x14c0
movsbl 0xb(%rsp), %eax
cmpl $0x68, %eax
jne 0x141c
movl 0xc(%rsp), %eax
orl $0x8, %eax
movl %eax, 0xc(%rsp)
jmp 0x14be
movsbl 0xb(%rsp), %eax
cmpl $0x69, %eax
jne 0x1436
movl 0xc(%rsp), %eax
orl $0x10, %eax
movl %eax, 0xc(%rsp)
jmp 0x14bc
movsbl 0xb(%rsp), %eax
cmpl $0x6c, %eax
jne 0x144d
movl 0xc(%rsp), %eax
orl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x14ba
movsbl 0xb(%rsp), %eax
cmpl $0x78, %eax
jne 0x1464
movl 0xc(%rsp), %eax
orl $0x40, %eax
movl %eax, 0xc(%rsp)
jmp 0x14b8
movsbl 0xb(%rsp), %eax
cmpl $0x77, %eax
jne 0x147b
movl 0xc(%rsp), %eax
orl $0x20, %eax
movl %eax, 0xc(%rsp)
jmp 0x14b6
movsbl 0xb(%rsp), %eax
cmpl $0x62, %eax
jne 0x1494
movl 0xc(%rsp), %eax
orl $0x80, %eax
movl %eax, 0xc(%rsp)
jmp 0x14b4
movsbl 0xb(%rsp), %eax
cmpl $0x74, %eax
jne 0x14ad
movl 0xc(%rsp), %eax
orl $0x100, %eax            # imm = 0x100
movl %eax, 0xc(%rsp)
jmp 0x14b2
callq 0x19e0
jmp 0x14b4
jmp 0x14b6
jmp 0x14b8
jmp 0x14ba
jmp 0x14bc
jmp 0x14be
jmp 0x14c0
jmp 0x14c2
jmp 0x139e
movl 0xc(%rsp), %eax
andl $0x6, %eax
cmpl $0x0, %eax
je 0x151f
movq 0x20(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x1c(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1a60
movsd %xmm0, 0x7bc7(%rip)     # 0x90c0
movq 0x20(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x1c(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1a60
movsd %xmm0, 0x7ba9(%rip)     # 0x90c8
movl 0xc(%rsp), %eax
andl $0x1e, %eax
cmpl $0x0, %eax
je 0x1593
movq 0x20(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x1c(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1a80
movl %eax, 0x7b69(%rip)      # 0x90b8
movl 0x7b63(%rip), %eax      # 0x90b8
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x156b
leaq 0x1b21(%rip), %rdi      # 0x3085
xorl %esi, %esi
callq 0x1aa0
cmpl $0x1, 0x7b46(%rip)      # 0x90b8
jl 0x1580
cmpl $0x201, 0x7b3a(%rip)    # imm = 0x201
jle 0x1591
leaq 0x1b1f(%rip), %rdi      # 0x30a6
movl $0x201, %esi            # imm = 0x201
callq 0x1aa0
jmp 0x1593
movl 0xc(%rsp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x15de
movq 0x20(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x1c(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1a80
movl %eax, 0x7aef(%rip)      # 0x90b4
cmpl $0x0, 0x7ae8(%rip)      # 0x90b4
jg 0x15dc
leaq 0x1af8(%rip), %rdi      # 0x30cd
xorl %esi, %esi
callq 0x1aa0
jmp 0x15de
movl 0xc(%rsp), %eax
orl 0x7ac8(%rip), %eax      # 0x90b0
movl %eax, 0x7ac2(%rip)      # 0x90b0
jmp 0x132b
movq 0x20(%rsp), %rax
movslq 0x1c(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x1609
callq 0x19e0
addq $0x28, %rsp
retq
nop