// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc.c
// Function: parse_args
static int parse_args(int argc, char **argv,
		      CommandFunction *func_,
		      int *nargs_, char **cmd_, char ***args_ )
{
	struct Command	*cp;
	struct Command	*matchcmd=0;
	char		*prgname = get_prgname(argv[0]);
	int		i=0, helprequested=0;

	if( argc < 2 || !strcmp(argv[1], "help") ||
		!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")){
		help(prgname);
		return 0;
	}

	for( cp = commands; cp->verb; cp++ )
		if( !cp->ncmds)
			cp->ncmds = split_command(cp->verb, &(cp->cmds));

	for( cp = commands; cp->verb; cp++ ){
		int     match;

		if( argc-1 < cp->ncmds )
			continue;
		for( match = 1, i = 0 ; i < cp->ncmds ; i++ ){
			char	*s1, *s2;
			s1 = cp->cmds[i];
			s2 = argv[i+1];

			for(s2 = cp->cmds[i], s1 = argv[i+1];
				*s1 == *s2 && *s1;
				s1++, s2++ ) ;
			if( *s1 ){
				match=0;
				break;
			}
		}

		/* If you understand why this code works ...
			you are a genious !! */
		if(argc>i+1 && !strcmp(argv[i+1],"--help")){
			if(!helprequested)
				printf("Usage:\n");
			print_help(prgname, cp, ADVANCED_HELP);
			helprequested=1;
			continue;
		}

		if(!match)
			continue;

		matchcmd = cp;
		*nargs_  = argc-matchcmd->ncmds-1;
		*cmd_ = matchcmd->verb;
		*args_ = argv+matchcmd->ncmds+1;
		*func_ = cp->func;

		break;
	}

	if(helprequested){
		printf("\n%s\n", MMC_VERSION);
		return 0;
	}

	if(!matchcmd){
		fprintf( stderr, "ERROR: unknown command '%s'\n",argv[1]);
		help(prgname);
		return -1;
	}

	if(check_ambiguity(matchcmd, argv))
		return -2;

	/* check the number of argument */
	if (matchcmd->nargs < 0 && matchcmd->nargs < -*nargs_ ){
		fprintf(stderr, "ERROR: '%s' requires minimum %d arg(s)\n",
			matchcmd->verb, -matchcmd->nargs);
			return -2;
	}
	if(matchcmd->nargs >= 0 && matchcmd->nargs != *nargs_ && matchcmd->nargs != 999){
		fprintf(stderr, "ERROR: '%s' requires %d arg(s)\n",
			matchcmd->verb, matchcmd->nargs);
			return -2;
	}
	
        if (prepare_args( nargs_, args_, prgname, matchcmd )){
                fprintf(stderr, "ERROR: not enough memory\\n");
		return -20;
        }


	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3850
movq %rax, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x50(%rbp)
cmpl $0x2, -0x8(%rbp)
jl 0x3496
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xebaf(%rip), %rsi      # 0x12009
callq 0x3170
cmpl $0x0, %eax
je 0x3496
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xeb91(%rip), %rsi      # 0x12004
callq 0x3170
cmpl $0x0, %eax
je 0x3496
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xeb7b(%rip), %rsi      # 0x12007
callq 0x3170
cmpl $0x0, %eax
jne 0x34ab
movq -0x48(%rbp), %rdi
callq 0x38a0
movl $0x0, -0x4(%rbp)
jmp 0x383f
leaq 0x17c9e(%rip), %rax     # 0x1b150
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x34f9
movq -0x38(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x34e9
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x38(%rbp), %rsi
addq $0x28, %rsi
callq 0x3930
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x30(%rax)
jmp 0x34eb
movq -0x38(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x38(%rbp)
jmp 0x34b6
leaq 0x17c50(%rip), %rax     # 0x1b150
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x36d4
movl -0x8(%rbp), %eax
subl $0x1, %eax
movq -0x38(%rbp), %rcx
cmpl 0x30(%rcx), %eax
jge 0x3527
jmp 0x36c3
movl $0x1, -0x54(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x30(%rcx), %eax
jge 0x3605
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movl -0x4c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x68(%rbp)
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movl -0x4c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movsbl (%rax), %ecx
movq -0x68(%rbp), %rax
movsbl (%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x69(%rbp)
jne 0x35be
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x69(%rbp)
movb -0x69(%rbp), %al
testb $0x1, %al
jne 0x35c7
jmp 0x35e3
jmp 0x35c9
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x3597
movq -0x60(%rbp), %rax
cmpb $0x0, (%rax)
je 0x35f5
movl $0x0, -0x54(%rbp)
jmp 0x3605
jmp 0x35f7
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x3535
movl -0x8(%rbp), %eax
movl -0x4c(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jle 0x3663
movq -0x10(%rbp), %rax
movl -0x4c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xe9dd(%rip), %rsi      # 0x12007
callq 0x3170
cmpl $0x0, %eax
jne 0x3663
cmpl $0x0, -0x50(%rbp)
jne 0x3648
leaq 0xe9cd(%rip), %rdi      # 0x1200e
movb $0x0, %al
callq 0x30c0
movq -0x48(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl $0x1, %edx
callq 0x3a20
movl $0x1, -0x50(%rbp)
jmp 0x36c3
cmpl $0x0, -0x54(%rbp)
jne 0x366b
jmp 0x36c3
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movl -0x8(%rbp), %ecx
movq -0x40(%rbp), %rax
subl 0x30(%rax), %ecx
subl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x40(%rbp), %rax
movslq 0x30(%rax), %rax
shlq $0x3, %rax
addq %rax, %rcx
addq $0x8, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x36d4
movq -0x38(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x38(%rbp)
jmp 0x3504
cmpl $0x0, -0x50(%rbp)
je 0x36fb
leaq 0xe935(%rip), %rdi      # 0x12016
leaq 0xe933(%rip), %rsi      # 0x1201b
movb $0x0, %al
callq 0x30c0
movl $0x0, -0x4(%rbp)
jmp 0x383f
cmpq $0x0, -0x40(%rbp)
jne 0x3737
movq 0x178e7(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0xe904(%rip), %rsi      # 0x1201f
movb $0x0, %al
callq 0x3180
movq -0x48(%rbp), %rdi
callq 0x38a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x383f
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3b10
cmpl $0x0, %eax
je 0x3755
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x383f
movq -0x40(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jge 0x37a7
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x20(%rbp), %rdx
xorl %ecx, %ecx
subl (%rdx), %ecx
cmpl %ecx, %eax
jge 0x37a7
movq 0x17877(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x40(%rbp), %rax
xorl %ecx, %ecx
subl 0x8(%rax), %ecx
leaq 0xe8a8(%rip), %rsi      # 0x1203c
movb $0x0, %al
callq 0x3180
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x383f
movq -0x40(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jl 0x37fd
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
je 0x37fd
movq -0x40(%rbp), %rax
cmpl $0x3e7, 0x8(%rax)       # imm = 0x3E7
je 0x37fd
movq 0x1781c(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x40(%rbp), %rax
movl 0x8(%rax), %ecx
leaq 0xe877(%rip), %rsi      # 0x12064
movb $0x0, %al
callq 0x3180
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x383f
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
callq 0x3d60
cmpl $0x0, %eax
je 0x3838
movq 0x177d2(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
leaq 0xe85c(%rip), %rsi      # 0x12084
movb $0x0, %al
callq 0x3180
movl $0xffffffec, -0x4(%rbp) # imm = 0xFFFFFFEC
jmp 0x383f
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)