// File: /workspace/github_c_makefile_star2_O2/nimble-code[P]Modex/Src/modex.c
// Function: BldCmds
int
BldCmds(int argc, char **argv)
{	char *arg;

	argc--; 
	argv++;

	while(argc-- > 0)
	{	arg = *argv++;

		if (arg[0] == '-')
		{	if (strncmp(arg, "-dynamic", strlen("-dynamic")) == 0)
			{	if (isdigit((int) *(arg+strlen("-dynamic"))))
				{	dynamic = atoi(arg+(int)strlen("-dynamic"));
					if (dynamic > 250)
					{	dynamic = 250;
					} else if (dynamic < 1)
					{	dynamic = 1;
					}
				//	printf("modex: max nr of threads: %d\n", dynamic);
				} else
				{	dynamic = 250;
				}
				continue;
			} else if (strcmp(arg, "-parsetree") == 0) /* dot output of parsetree */
			{	predot = 1;
				do_dflow=1;
				continue;
			} else if (strcmp(arg, "-cfg") == 0)	/* dot output control flow graph */
			{	preview     = 2;
				do_dflow    = 1;
				sysoverride = 1;
				continue;
			} else if (strcmp(arg, "-fcg") == 0)	/* dot output fct call graph */
			{	preview     = 3;
				do_dflow    = 1;
				sysoverride = 1;
				continue;
			} else if (strcmp(arg, "-nopre") == 0)
			{	nopre = 1;
				continue;
			} else if (strcmp(arg, "-nostructs") == 0)
			{	nostructs = 1;
				continue;
			} else if (strcmp(arg, "-master") == 0)
			{	master_dfn = (char *) e_malloc(strlen(*argv)+1);
				strcpy(master_dfn, *argv);
				continue;
			} else if (strcmp(arg, "-defuse") == 0)
			{	do_dflow = 1;
				du_mode = 1;
				continue;
			} else if (strcmp(arg, "-heapsize") == 0)
			{	spin_heap_size = atoi(*argv);
				argc--; argv++;
				continue;
			} else if (strcmp(arg, "-run") == 0)
			{	tagrun = 1;
				continue;
			} else if (strcmp(arg, "-printf") == 0)
			{	add_printfs = 1;
				continue;
			}

			nrprocs = nrprocs_default;

			switch (arg[1]) {
			case 'x':
				want = "all";
				hasaction = 1;
				// fall thru
				if (isdigit((int) arg[strlen(arg)-1]))
				{	nrprocs = atoi(&arg[strlen(arg)-1]);
				} else
				{	nrprocs = nrprocs_default;
				}
			default:
				new_cmd(arg[1], arg, 1);
				break;

			/* commands with arguments */
			case 'a':
			case 'e':	/* -e or -eN or -ex */
			case 'N':
				if (isdigit((int) arg[2]))
				{	nrprocs = atoi(&arg[2]);
				} else
				{	nrprocs = 1;
				}
				if (arg[1] == 'N')
				{	nrprocs_default = nrprocs;
					break;
				}
				// fall thru
			case 'E':
			case 'f':
			case 'n':
			case 'i':
			case 'p':
				want = *argv;
				hasaction = 1;
				// fall thru
			case 'L':
			case 'M':
			case 'm':
			case 'b':
				if (!*argv)
				{	Usage("modex");
				}
				if (*argv != NULL && strchr(*argv, ',') != NULL)
				{	expand_cmd(arg[1], *argv, 20);
				} else
				{	new_cmd(arg[1], *argv, 2); // argv points to next arg
				}
				argc--; argv++;
				break;

			/* immediate commands */
			case 'C': show_code  = do_dflow = allprocs = 1; break;
			case 'X': show_deps  = do_dflow = allprocs = 1; break;
			case 'F': show_funcs = do_dflow = allprocs = 1; break;
			case 's': show_syms  = do_dflow = allprocs = 1; break;

			case 'q':
				if (arg[2] != '\0' && isdigit((int) arg[2]))
				{	quality = atoi(&arg[2]);
				} else
				{	if (isdigit((int) *argv[0]))
					{	quality = atoi(*argv);
					} else
					{	Usage("bad q flag parameter");
				}	}
				break;

			case 'O': /* -O "-DMEMLIM=8000 -O2" etc. compiler directives for pan.c */
				if (strlen(optimized) > 0)
				{	Usage("modex: multiple use of -O");
				}
				if (isdigit((int) arg[2]))	/* e.g., a plain -O3 */
				{	optimized = (char *) e_malloc(strlen(arg)+1);
					strcpy(optimized, arg);	/* older version */
					break;
				}
				/* new 2.6 */
				arg = *argv;	/* next argument */
				if (arg)
				{	while (*arg == ' ' || *arg == '\t')
					{	arg++;
					}
					optimized = (char *) e_malloc(strlen(arg)+1);
					strcpy(optimized, arg);
					argc--; argv++;
				} else
				{	Usage("modex");
				}
				break;

			case 'Q':	/* source compilation e.g.: -Q "-DDEBUG -I. -IPublic" */
				if (strlen(preproc_info) > 0)
				{	Usage("modex: multiple use of -Q");
				}
				arg = *argv;	/* next argument */
				if (arg)
				{	while (*arg == ' ' || *arg == '\t')
					{	arg++;
					}
					preproc_info = (char *) e_malloc(strlen(arg)+1);
					strcpy(preproc_info, arg);
					argc--; argv++;
				} else
				{	Usage("modex");
				}
				break;
			case 'R':	/* pan runtime flags, e.g.: -R "-E" */
				arg = *argv;
				if (arg)
				{	while (*arg == ' ' || *arg == '\t')
					{	arg++;
					}
					runtime = (char *) e_malloc(strlen(arg)+2);
					strcpy(runtime, arg);
					strcat(runtime, " ");
					argc--; argv++;
				} else
				{	Usage("modex");
				}
				break;
			case 'T':	/* e.g.: -T "s;replace;with;g" or %T sed "...." */
				arg = *argv;
				if (arg)
				{	char *tmp;
					while (*arg == ' ' || *arg == '\t')
					{	arg++;
					}
					tmp = (char *) e_malloc(strlen(sedproc_info) + strlen(arg)+1+6+3);
					// 6 = "sed '' 3=" | "
					sprintf(tmp, "%s | sed '%s'", sedproc_info, arg);
					sedproc_info = tmp;
					argc--; argv++;
				} else
				{	Usage("modex");
				}
				break;

			case 'U':	/* undefine symbol */
			case 'D':	/* define symbol */
			case 'I':	/* set include directory */
				if (strlen(preproc_info) == 0)
				{	preproc_info = (char *) e_malloc(strlen(arg)+1);
					strcpy(preproc_info, arg);
				} else
				{	char *pp = (char *) e_malloc(strlen(arg)+strlen(preproc_info)+1+1);
					strcpy(pp, preproc_info);
					strcat(pp, " ");
					strcat(pp, arg);
					preproc_info = pp;
				}
				/* printf("arg: <%s>\n", preproc_info); */
				break;

			case 'P':
				must_preprocess = 0;
				break;
			case 'Z':
				i_assert = 1 - i_assert;
				break;
			case 'z':
				sysoverride = 1 - sysoverride;
				break;
			case 'V':
				printf("%s\n", VERSION);
				exit(0);
			case 'Y':
				Verbose_cmds = 1;
				break;
			case 'v':
				Verbose = 1;	/* Verbose |= 2 or 4 for debugging verbosity */
				break;
			case 'w':
				Warnings = 1;
				break;
			case '?':
			case '-':
				Usage("modex");

			}
		} else if (arg)
		{	char *p;

			if (!preview
			||  ((p = strstr(arg, ".c")) != NULL
			&&   strcmp(p, ".c") == 0))
			{	if (Verbose_cmds)
				{	printf("-- setting file_name to %s\n", arg);
				}
				file_name = arg;
			}
			break;
		} else
			return 0;
	}

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r13
movl %edi, %r12d
decl %r12d
addq $0x8, %r13
pushq $0x8
popq %r14
testl %r12d, %r12d
jle 0x67fe
movq (%r13), %r15
cmpb $0x2d, (%r15)
jne 0x67af
leal -0x1(%r12), %ebp
leaq 0x8(%r13), %rbx
movq %r15, %rdi
leaq 0x1b07b(%rip), %rsi     # 0x211cb
movq %r14, %rdx
callq 0x40a0
testl %eax, %eax
je 0x627b
movq %r15, %rdi
leaq 0x1b06a(%rip), %rsi     # 0x211d4
callq 0x41b0
testl %eax, %eax
je 0x62b4
movq %r15, %rdi
leaq 0x1b05e(%rip), %rsi     # 0x211df
callq 0x41b0
testl %eax, %eax
je 0x62c5
movq %r15, %rdi
leaq 0x1b04c(%rip), %rsi     # 0x211e4
callq 0x41b0
testl %eax, %eax
je 0x62eb
movq %r15, %rdi
leaq 0x1b03a(%rip), %rsi     # 0x211e9
callq 0x41b0
testl %eax, %eax
je 0x630f
movq %r15, %rdi
leaq 0x1b02a(%rip), %rsi     # 0x211f0
callq 0x41b0
testl %eax, %eax
je 0x631b
movq %r15, %rdi
leaq 0x1b01e(%rip), %rsi     # 0x211fb
callq 0x41b0
testl %eax, %eax
je 0x6327
movq %r15, %rdi
leaq 0x1b00f(%rip), %rsi     # 0x21203
callq 0x41b0
testl %eax, %eax
je 0x634b
movq %r15, %rdi
leaq 0x1b000(%rip), %rsi     # 0x2120b
callq 0x41b0
testl %eax, %eax
je 0x635c
movq %r15, %rdi
leaq 0x1aff3(%rip), %rsi     # 0x21215
callq 0x41b0
testl %eax, %eax
je 0x6378
movq %r15, %rdi
leaq 0x1afe1(%rip), %rsi     # 0x2121a
callq 0x41b0
testl %eax, %eax
je 0x6384
movl 0x2dfb8(%rip), %edx     # 0x34204
movl %edx, 0x2dfae(%rip)     # 0x34200
movzbl 0x1(%r15), %eax
addl $-0x2d, %eax
cmpl $0x4d, %eax
ja 0x66d8
leaq 0x19fa2(%rip), %rcx     # 0x2020c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rbx), %rbx
jmp 0x6443
callq 0x42e0
movq (%rax), %rax
movsbq 0x8(%r15), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x62a8
addq $0x8, %r15
movq %r15, %rdi
callq 0x4280
movl %eax, 0x3078f(%rip)     # 0x36a30
cmpl $0xfb, %eax
jl 0x62d1
movl $0xfa, 0x3077e(%rip)    # 0x36a30
jmp 0x6304
pushq $0x1
popq %rax
movl %eax, 0x30777(%rip)     # 0x36a34
movl %eax, 0x30775(%rip)     # 0x36a38
jmp 0x6304
movl $0x2, 0x3076d(%rip)     # 0x36a3c
jmp 0x62f5
movq %rbx, %r13
movl %ebp, %r12d
testl %eax, %eax
jg 0x6126
movl $0x1, 0x30747(%rip)     # 0x36a30
jmp 0x6304
movl $0x3, 0x30747(%rip)     # 0x36a3c
pushq $0x1
popq %rax
movl %eax, 0x3073a(%rip)     # 0x36a38
movl %eax, 0x3073c(%rip)     # 0x36a40
movq %rbx, %r13
movl %ebp, %r12d
jmp 0x6126
movl $0x1, 0x3072b(%rip)     # 0x36a44
jmp 0x6304
movl $0x1, 0x30723(%rip)     # 0x36a48
jmp 0x6304
movq (%rbx), %rdi
callq 0x4110
leal 0x1(%rax), %edi
callq 0x4739
movq %rax, 0x30712(%rip)     # 0x36a50
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x40b0
jmp 0x6304
pushq $0x1
popq %rax
movl %eax, 0x306e4(%rip)     # 0x36a38
movl %eax, 0x306fe(%rip)     # 0x36a58
jmp 0x6304
movq 0x8(%r13), %rdi
callq 0x4280
movl %eax, 0x2de7d(%rip)     # 0x341e8
addl $-0x2, %r12d
addq $0x10, %r13
jmp 0x6126
movl $0x1, 0x306da(%rip)     # 0x36a5c
jmp 0x6304
movl $0x1, 0x306d2(%rip)     # 0x36a60
jmp 0x6304
movq 0x2de2e(%rip), %rdi     # 0x341c8
callq 0x4110
movq %rax, %r12
movq %r15, %rdi
callq 0x4110
testq %r12, %r12
je 0x647e
leal (%rax,%r12), %edi
addl $0x2, %edi
callq 0x4739
movq %rax, %r12
movq 0x2ddff(%rip), %rsi     # 0x341c8
movq %rax, %rdi
callq 0x40b0
movq %r12, %rdi
callq 0x4110
movw $0x20, (%r12,%rax)
movq %r12, %rdi
movq %r15, %rsi
callq 0x4290
movq %r12, 0x2ddd6(%rip)     # 0x341c8
jmp 0x6304
callq 0x42e0
movq (%rax), %rax
movsbq 0x2(%r15), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
pushq $0x1
popq %rax
je 0x6417
leaq 0x2(%r15), %rdi
callq 0x4280
movl %eax, 0x2dde3(%rip)     # 0x34200
cmpb $0x4e, 0x1(%r15)
jne 0x642f
movl %eax, 0x2ddda(%rip)     # 0x34204
jmp 0x6304
movq (%rbx), %rbx
movq %rbx, 0x2dd6f(%rip)     # 0x341a8
movl $0x1, 0x30621(%rip)     # 0x36a64
testq %rbx, %rbx
je 0x6810
movq %rbx, %rdi
pushq $0x2c
popq %rsi
callq 0x4130
movsbl 0x1(%r15), %edi
movq %rbx, %rsi
testq %rax, %rax
je 0x6471
pushq $0x14
popq %rdx
callq 0x60a9
jmp 0x636b
pushq $0x2
popq %rdx
callq 0x5fb8
jmp 0x636b
incl %eax
movl %eax, %edi
callq 0x4739
movq %rax, 0x2dd3a(%rip)     # 0x341c8
jmp 0x678d
pushq $0x1
popq %rax
subl 0x2dd5c(%rip), %eax     # 0x341f8
movl %eax, 0x2dd56(%rip)     # 0x341f8
jmp 0x6304
movl $0x1, 0x3056b(%rip)     # 0x36a1c
jmp 0x6304
movq (%rbx), %r15
testq %r15, %r15
je 0x6810
movzbl (%r15), %eax
cmpl $0x20, %eax
je 0x64d4
cmpl $0x9, %eax
jne 0x66ed
incq %r15
jmp 0x64c2
movq (%rbx), %r15
testq %r15, %r15
je 0x6810
movzbl (%r15), %eax
cmpl $0x20, %eax
je 0x64f7
cmpl $0x9, %eax
jne 0x672a
incq %r15
jmp 0x64e5
movl $0x1, 0x3057a(%rip)     # 0x36a80
jmp 0x6304
pushq $0x1
popq %rax
movl %eax, 0x30554(%rip)     # 0x36a68
movl %eax, 0x3051e(%rip)     # 0x36a38
movl %eax, 0x30550(%rip)     # 0x36a70
jmp 0x6304
pushq $0x1
popq %rax
subl 0x30512(%rip), %eax     # 0x36a40
jmp 0x62fe
movl $0x1, 0x3053f(%rip)     # 0x36a7c
jmp 0x6304
andl $0x0, 0x2dcb3(%rip)     # 0x341fc
jmp 0x6304
pushq $0x1
popq %rax
movl %eax, 0x30511(%rip)     # 0x36a68
movl %eax, 0x304db(%rip)     # 0x36a38
movl %eax, 0x30509(%rip)     # 0x36a6c
jmp 0x6304
pushq $0x1
popq %rax
movl %eax, 0x304f7(%rip)     # 0x36a68
movl %eax, 0x304c1(%rip)     # 0x36a38
movl %eax, 0x304f7(%rip)     # 0x36a74
jmp 0x6304
movsbq 0x2(%r15), %r12
callq 0x42e0
testq %r12, %r12
je 0x65a0
movq (%rax), %rcx
testb $0x8, 0x1(%rcx,%r12,2)
jne 0x6798
movq (%rax), %rax
movq (%rbx), %rdi
movsbq (%rdi), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x679f
jmp 0x6847
movq 0x2dc07(%rip), %rax     # 0x341c8
cmpb $0x0, (%rax)
jne 0x682f
movq (%rbx), %r15
testq %r15, %r15
jne 0x65da
jmp 0x6810
incq %r15
movzbl (%r15), %eax
cmpl $0x20, %eax
je 0x65d7
cmpl $0x9, %eax
je 0x65d7
movq %r15, %rdi
callq 0x4110
leal 0x1(%rax), %edi
callq 0x4739
movq %rax, 0x2dbc9(%rip)     # 0x341c8
jmp 0x665e
movq 0x2dbd8(%rip), %rax     # 0x341e0
cmpb $0x0, (%rax)
jne 0x683b
callq 0x42e0
movq (%rax), %rax
movsbq 0x2(%r15), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x6776
movq (%rbx), %r15
testq %r15, %r15
jne 0x6639
jmp 0x6810
incq %r15
movzbl (%r15), %eax
cmpl $0x20, %eax
je 0x6636
cmpl $0x9, %eax
je 0x6636
movq %r15, %rdi
callq 0x4110
leal 0x1(%rax), %edi
callq 0x4739
movq %rax, 0x2db82(%rip)     # 0x341e0
movq %rax, %rdi
movq %r15, %rsi
callq 0x40b0
jmp 0x636b
pushq $0x1
popq %rax
movl %eax, 0x303f1(%rip)     # 0x36a68
movl %eax, 0x303bb(%rip)     # 0x36a38
movl %eax, 0x303f5(%rip)     # 0x36a78
jmp 0x6304
leaq 0x1c236(%rip), %rax     # 0x228c5
movq %rax, 0x2db12(%rip)     # 0x341a8
movl $0x1, 0x303c4(%rip)     # 0x36a64
movl %edx, %r13d
callq 0x42e0
movq (%rax), %r12
movq %r15, %rdi
callq 0x4110
movl %r13d, %edx
movsbq -0x1(%r15,%rax), %rcx
testb $0x8, 0x1(%r12,%rcx,2)
je 0x66d2
leaq (%r15,%rax), %rdi
decq %rdi
callq 0x4280
movl %eax, %edx
movl %edx, 0x2db28(%rip)     # 0x34200
movsbl 0x1(%r15), %edi
movq %r15, %rsi
pushq $0x1
popq %rdx
callq 0x5fb8
jmp 0x6304
movq %r15, %rdi
callq 0x4110
leal 0x2(%rax), %edi
callq 0x4739
movq %rax, 0x2dacc(%rip)     # 0x341d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x40b0
movq 0x2daba(%rip), %r15     # 0x341d0
movq %r15, %rdi
callq 0x4110
movw $0x20, (%r15,%rax)
jmp 0x636b
movq 0x2daa7(%rip), %rdi     # 0x341d8
callq 0x4110
movq %rax, %rbx
movq %r15, %rdi
callq 0x4110
leal (%rax,%rbx), %edi
addl $0xa, %edi
callq 0x4739
movq %rax, %rbx
movq 0x2da82(%rip), %rdx     # 0x341d8
movq %rax, %rdi
leaq 0x1ab0b(%rip), %rsi     # 0x2126b
movq %r15, %rcx
xorl %eax, %eax
callq 0x42a0
movq %rbx, 0x2da67(%rip)     # 0x341d8
jmp 0x636b
movq %r15, %rdi
callq 0x4110
leal 0x1(%rax), %edi
callq 0x4739
movq %rax, 0x2da53(%rip)     # 0x341e0
movq %rax, %rdi
movq %r15, %rsi
jmp 0x6344
addq $0x2, %r15
movq %r15, %rdi
callq 0x4280
movl %eax, 0x2da5e(%rip)     # 0x34208
jmp 0x6304
cmpl $0x0, 0x30286(%rip)     # 0x36a3c
je 0x67dd
leaq 0x198a6(%rip), %rsi     # 0x20065
movq %r15, %rdi
callq 0x42d0
testq %rax, %rax
je 0x67fe
cmpb $0x2e, (%rax)
jne 0x67fe
cmpb $0x63, 0x1(%rax)
jne 0x67fe
cmpb $0x0, 0x2(%rax)
jne 0x67fe
cmpl $0x0, 0x30238(%rip)     # 0x36a1c
je 0x67f7
leaq 0x1aa8c(%rip), %rdi     # 0x21279
movq %r15, %rsi
xorl %eax, %eax
callq 0x4140
movq %r15, 0x3028a(%rip)     # 0x36a88
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19cab(%rip), %rdi     # 0x204c2
callq 0x5a13
movq 0x2d96d(%rip), %rdi     # 0x34190
callq 0x40d0
xorl %edi, %edi
callq 0x42b0
leaq 0x1aa1b(%rip), %rdi     # 0x21251
callq 0x5a13
leaq 0x1a9f5(%rip), %rdi     # 0x21237
callq 0x5a13
leaq 0x1a9d4(%rip), %rdi     # 0x21222
callq 0x5a13