// File: /workspace/github_c_makefile_star2_O0/jelaas[P]egetty/jelopt.c
// Function: jelopt_multi
int jelopt_multi(char **argv, int opt_short, char *opt_long,
		 int count, char **values,
		 int *err)
{
  int j,i = -1;
  int type = 0;

  if(opt_short)
    if( (i = find_short_arg(argv, opt_short)) >= 0)
      type = FOUND_SHORT;
  
  if(!type && opt_long)
    if( (i = find_long_arg(argv, opt_long)) >= 0)
      type = FOUND_LONG;
  
  if(!type)
    return 0;

  if(count < 0)
    {
      if(err) *err |= ERR_JELOPT_COUNT;
      return 0;
    }
  
  if(count && values == NULL)
    {
      if(err) *err |= ERR_JELOPT_COUNT;
      return 0;
    }
  
  if(type == FOUND_SHORT)
    {
      if(count)
	{
	  char *p = strchr(argv[i], opt_short);
	  if(*(p+1))
	    {
	      *values = strdup(p+1);
	      unquote(*values++);
	      count--;
	      *p = 0;
	    }
	}
      for(j=i+1;count--;j++)
	{
	  if(argv[j])
	    {
	      if(strcmp(argv[j], OPT_VALUE_USED))
		*values = strdup(argv[j]);
	      else
		{
		  if(err) *err |= ERR_JELOPT_VALUE_COLLISION;
		  goto err_short;
		}
	    }
	  else
	    {
	      if(err) *err |= ERR_JELOPT_MISSING_VALUE;
	    err_short:
	      rem_short_opt(argv, opt_short, i, i);
	      return 0;
	    }
	  unquote(*values++);
	  argv[j] = OPT_VALUE_USED;
	}
      rem_short_opt(argv, opt_short, i, i);
      if(values) *values++ = 0;
      return 1;
    }
  
  if(type == FOUND_LONG)
    {
      if(count == 0)
	{
	  argv[i] = OPT_VALUE_USED;
	  return 1;
	}
      
      if(strchr(argv[i], '='))
	{
	  *values = strdup(strchr(argv[i], '=')+1);
	  unquote(*values++);
	  count--;
	}
      
      for(j=i+1;count--;j++)
	{
	  if(argv[j])
	    {
	      if(strcmp(argv[j], OPT_VALUE_USED))
		*values = strdup(argv[j]);
	      else
		{
		  if(err) *err |= ERR_JELOPT_VALUE_COLLISION;
		  goto err_long;
		}
	    }
	  else
	    {
	      if(err) *err |= ERR_JELOPT_MISSING_VALUE;
	    err_long:
	      rem_opt(argv, i, i);
	      return 0;
	    }
	  unquote(*values++);
	  argv[j] = OPT_VALUE_USED;
	}
      argv[i] = OPT_VALUE_USED;
      *values++ = 0;
      return 1;
    }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movl $0xffffffff, -0x40(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x44(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x4031cf
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x4035b0
movl %eax, -0x40(%rbp)
cmpl $0x0, %eax
jl 0x4031cd
movl $0x1, -0x44(%rbp)
jmp 0x4031cf
cmpl $0x0, -0x44(%rbp)
jne 0x4031fa
cmpq $0x0, -0x20(%rbp)
je 0x4031fa
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x403650
movl %eax, -0x40(%rbp)
cmpl $0x0, %eax
jl 0x4031f8
movl $0x2, -0x44(%rbp)
jmp 0x4031fa
cmpl $0x0, -0x44(%rbp)
jne 0x40320c
movl $0x0, -0x4(%rbp)
jmp 0x40359e
cmpl $0x0, -0x24(%rbp)
jge 0x403230
cmpq $0x0, -0x38(%rbp)
je 0x403224
movq -0x38(%rbp), %rax
movl (%rax), %ecx
orl $0x1, %ecx
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x40359e
cmpl $0x0, -0x24(%rbp)
je 0x40325b
cmpq $0x0, -0x30(%rbp)
jne 0x40325b
cmpq $0x0, -0x38(%rbp)
je 0x40324f
movq -0x38(%rbp), %rax
movl (%rax), %ecx
orl $0x1, %ecx
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x40359e
cmpl $0x1, -0x44(%rbp)
jne 0x4033ee
cmpl $0x0, -0x24(%rbp)
je 0x4032cd
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl -0x14(%rbp), %esi
callq 0x4010e8
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpb $0x0, 0x1(%rax)
je 0x4032cb
movq -0x50(%rbp), %rdi
addq $0x1, %rdi
callq 0x42c810
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x30(%rbp)
movq (%rax), %rdi
callq 0x403760
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x50(%rbp), %rax
movb $0x0, (%rax)
jmp 0x4032cd
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x24(%rbp)
cmpl $0x0, %eax
je 0x4033b3
movq -0x10(%rbp), %rax
movslq -0x3c(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x403349
movq -0x10(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xbcec0(%rip), %rsi     # 0x4c01cc
callq 0x4010b0
cmpl $0x0, %eax
je 0x403333
movq -0x10(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x42c810
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0x403347
cmpq $0x0, -0x38(%rbp)
je 0x403345
movq -0x38(%rbp), %rax
movl (%rax), %ecx
orl $0x4, %ecx
movl %ecx, (%rax)
jmp 0x40335d
jmp 0x40337b
cmpq $0x0, -0x38(%rbp)
je 0x40335b
movq -0x38(%rbp), %rax
movl (%rax), %ecx
orl $0x2, %ecx
movl %ecx, (%rax)
jmp 0x40335d
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x40(%rbp), %edx
movl -0x40(%rbp), %ecx
callq 0x4037b0
movl $0x0, -0x4(%rbp)
jmp 0x40359e
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x30(%rbp)
movq (%rax), %rdi
callq 0x403760
movq -0x10(%rbp), %rax
movslq -0x3c(%rbp), %rcx
leaq 0xbce2b(%rip), %rdx     # 0x4c01cc
movq %rdx, (%rax,%rcx,8)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x4032d6
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x40(%rbp), %edx
movl -0x40(%rbp), %ecx
callq 0x4037b0
cmpq $0x0, -0x30(%rbp)
je 0x4033e2
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x30(%rbp)
movq $0x0, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x40359e
cmpl $0x2, -0x44(%rbp)
jne 0x403597
cmpl $0x0, -0x24(%rbp)
jne 0x40341d
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
leaq 0xbcdbf(%rip), %rdx     # 0x4c01cc
movq %rdx, (%rax,%rcx,8)
movl $0x1, -0x4(%rbp)
jmp 0x40359e
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl $0x3d, %esi
callq 0x4010e8
cmpq $0x0, %rax
je 0x403485
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl $0x3d, %esi
callq 0x4010e8
movq %rax, %rdi
addq $0x1, %rdi
callq 0x42c810
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x30(%rbp)
movq (%rax), %rdi
callq 0x403760
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x24(%rbp)
cmpl $0x0, %eax
je 0x403565
movq -0x10(%rbp), %rax
movslq -0x3c(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x403501
movq -0x10(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xbcd08(%rip), %rsi     # 0x4c01cc
callq 0x4010b0
cmpl $0x0, %eax
je 0x4034eb
movq -0x10(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x42c810
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0x4034ff
cmpq $0x0, -0x38(%rbp)
je 0x4034fd
movq -0x38(%rbp), %rax
movl (%rax), %ecx
orl $0x4, %ecx
movl %ecx, (%rax)
jmp 0x403515
jmp 0x40352d
cmpq $0x0, -0x38(%rbp)
je 0x403513
movq -0x38(%rbp), %rax
movl (%rax), %ecx
orl $0x2, %ecx
movl %ecx, (%rax)
jmp 0x403515
movq -0x10(%rbp), %rdi
movl -0x40(%rbp), %esi
movl -0x40(%rbp), %edx
callq 0x4030c0
movl $0x0, -0x4(%rbp)
jmp 0x40359e
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x30(%rbp)
movq (%rax), %rdi
callq 0x403760
movq -0x10(%rbp), %rax
movslq -0x3c(%rbp), %rcx
leaq 0xbcc79(%rip), %rdx     # 0x4c01cc
movq %rdx, (%rax,%rcx,8)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x40348e
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
leaq 0xbcc58(%rip), %rdx     # 0x4c01cc
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x30(%rbp)
movq $0x0, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x40359e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)