// File: /workspace/github_c_makefile_star2_O1/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
cmpl $0x2, %edi
jl 0x8864
movq %rsi, %r13
movl %edi, %ebp
leal -0x2(%rbp), %r14d
addq $0x8, %r13
decl %ebp
leaq 0x1c07c(%rip), %rbx     # 0x241cb
movq (%r13), %r12
cmpb $0x2d, (%r12)
jne 0x8813
leaq 0x8(%r13), %r15
movl $0x8, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x40a0
testl %eax, %eax
je 0x82f3
movq %r12, %rdi
leaq 0x1c050(%rip), %rsi     # 0x241d4
callq 0x41b0
testl %eax, %eax
je 0x832d
movq %r12, %rdi
leaq 0x1c044(%rip), %rsi     # 0x241df
callq 0x41b0
testl %eax, %eax
je 0x8340
movq %r12, %rdi
leaq 0x1c032(%rip), %rsi     # 0x241e4
callq 0x41b0
testl %eax, %eax
je 0x835c
movq %r12, %rdi
leaq 0x1c020(%rip), %rsi     # 0x241e9
callq 0x41b0
testl %eax, %eax
je 0x838e
movq %r12, %rdi
leaq 0x1c010(%rip), %rsi     # 0x241f0
callq 0x41b0
testl %eax, %eax
je 0x839a
movq %r12, %rdi
leaq 0x1c004(%rip), %rsi     # 0x241fb
callq 0x41b0
testl %eax, %eax
je 0x83a6
movq %r12, %rdi
leaq 0x1bff5(%rip), %rsi     # 0x24203
callq 0x41b0
testl %eax, %eax
je 0x83ca
movq %r12, %rdi
leaq 0x1bfe6(%rip), %rsi     # 0x2420b
callq 0x41b0
testl %eax, %eax
je 0x83dd
movq %r12, %rdi
leaq 0x1bfd9(%rip), %rsi     # 0x24215
callq 0x41b0
testl %eax, %eax
je 0x83fe
movq %r12, %rdi
leaq 0x1bfc7(%rip), %rsi     # 0x2421a
callq 0x41b0
testl %eax, %eax
je 0x840d
movl 0x2ef8e(%rip), %edx     # 0x371f4
movl %edx, 0x2ef84(%rip)     # 0x371f0
movzbl 0x1(%r12), %eax
addl $-0x2d, %eax
cmpl $0x4d, %eax
ja 0x8735
leaq 0x1af87(%rip), %rcx     # 0x2320c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x2ef23(%rip), %rdi     # 0x371b8
callq 0x4110
movq %rax, %r13
movq %r12, %rdi
callq 0x4110
testq %r13, %r13
je 0x84c1
leal (%rax,%r13), %edi
addl $0x2, %edi
callq 0x6469
movq %rax, %r13
movq 0x2eef4(%rip), %rsi     # 0x371b8
movq %rax, %rdi
callq 0x40b0
movq %r13, %rdi
callq 0x4110
movw $0x20, (%r13,%rax)
movq %r13, %rdi
movq %r12, %rsi
callq 0x4280
movq %r13, 0x2eeca(%rip)     # 0x371b8
jmp 0x8377
callq 0x42d0
movq (%rax), %rax
movsbq 0x8(%r12), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x8321
addq $0x8, %r12
movq %r12, %rdi
callq 0x4270
movl %eax, 0x31706(%rip)     # 0x39a20
cmpl $0xfb, %eax
jl 0x834c
movl $0xfa, 0x316f5(%rip)    # 0x39a20
jmp 0x8377
movl $0x1, %eax
movl %eax, 0x316ec(%rip)     # 0x39a24
movl %eax, 0x316ea(%rip)     # 0x39a28
jmp 0x8377
movl $0x2, 0x316e2(%rip)     # 0x39a2c
jmp 0x8366
testl %eax, %eax
jg 0x8377
movl $0x1, 0x316c6(%rip)     # 0x39a20
jmp 0x8377
movl $0x3, 0x316c6(%rip)     # 0x39a2c
movl $0x1, %eax
movl %eax, 0x316b7(%rip)     # 0x39a28
movl %eax, 0x316b9(%rip)     # 0x39a30
movl %r14d, %ebp
leal -0x1(%rbp), %r14d
movq %r15, %r13
testl %ebp, %ebp
jg 0x814f
jmp 0x8864
movl $0x1, 0x3169c(%rip)     # 0x39a34
jmp 0x8377
movl $0x1, 0x31694(%rip)     # 0x39a38
jmp 0x8377
movq (%r15), %rdi
callq 0x4110
leal 0x1(%rax), %edi
callq 0x6469
movq %rax, 0x31683(%rip)     # 0x39a40
movq (%r15), %rsi
movq %rax, %rdi
callq 0x40b0
jmp 0x8377
movl $0x1, %eax
movl %eax, 0x31653(%rip)     # 0x39a28
movl %eax, 0x3166d(%rip)     # 0x39a48
jmp 0x8377
movq 0x8(%r13), %rdi
callq 0x4270
movl %eax, 0x2edec(%rip)     # 0x371d8
addl $-0x2, %ebp
addq $0x10, %r13
movq %r13, %r15
movl %ebp, %r14d
jmp 0x8377
movl $0x1, 0x31644(%rip)     # 0x39a4c
jmp 0x8377
movl $0x1, 0x31639(%rip)     # 0x39a50
jmp 0x8377
callq 0x42d0
movq (%rax), %rcx
movsbq 0x2(%r12), %rdx
movl $0x1, %eax
testb $0x8, 0x1(%rcx,%rdx,2)
je 0x8440
leaq 0x2(%r12), %rdi
callq 0x4270
movl %eax, 0x2edaa(%rip)     # 0x371f0
cmpb $0x4e, 0x1(%r12)
jne 0x8459
movl %eax, 0x2eda0(%rip)     # 0x371f4
jmp 0x8377
movq (%r15), %rax
movq %rax, 0x2ed35(%rip)     # 0x37198
movl $0x1, 0x315e7(%rip)     # 0x39a54
cmpq $0x0, (%r15)
je 0x8878
movq (%r15), %r14
testq %r14, %r14
je 0x84a9
movq %r14, %rdi
movl $0x2c, %esi
callq 0x4130
testq %rax, %rax
je 0x84a9
movsbl 0x1(%r12), %edi
movq %r14, %rsi
movl $0x14, %edx
callq 0x80b7
jmp 0x83ec
movsbl 0x1(%r12), %edi
movq %r14, %rsi
movl $0x2, %edx
callq 0x7fdb
jmp 0x83ec
incl %eax
movl %eax, %edi
callq 0x6469
movq %rax, 0x2ece7(%rip)     # 0x371b8
jmp 0x87ca
movl $0x1, %eax
subl 0x2ed07(%rip), %eax     # 0x371e8
movl %eax, 0x2ed01(%rip)     # 0x371e8
jmp 0x8377
movl $0x1, 0x31516(%rip)     # 0x39a0c
jmp 0x8377
movq (%r15), %r12
testq %r12, %r12
jne 0x850b
jmp 0x8878
incq %r12
movzbl (%r12), %eax
cmpl $0x20, %eax
je 0x8508
cmpl $0x9, %eax
je 0x8508
movq %r12, %rdi
callq 0x4110
leal 0x2(%rax), %edi
callq 0x6469
movq %rax, 0x2ec8f(%rip)     # 0x371c0
movq %rax, %rdi
movq %r12, %rsi
callq 0x40b0
movq 0x2ec7d(%rip), %r12     # 0x371c0
movq %r12, %rdi
callq 0x4110
movw $0x20, (%r12,%rax)
jmp 0x83ec
movq (%r15), %r12
testq %r12, %r12
je 0x8878
movzbl (%r12), %eax
cmpl $0x20, %eax
je 0x8576
cmpl $0x9, %eax
jne 0x874d
incq %r12
jmp 0x8563
movl $0x1, 0x314eb(%rip)     # 0x39a70
jmp 0x8377
movl $0x1, %eax
movl %eax, 0x314c3(%rip)     # 0x39a58
movl %eax, 0x3148d(%rip)     # 0x39a28
movl %eax, 0x314bf(%rip)     # 0x39a60
jmp 0x8377
movl $0x1, %eax
subl 0x3147f(%rip), %eax     # 0x39a30
jmp 0x8371
movl $0x1, 0x314ac(%rip)     # 0x39a6c
jmp 0x8377
movl $0x0, 0x2ec1d(%rip)     # 0x371ec
jmp 0x8377
movl $0x1, %eax
movl %eax, 0x31479(%rip)     # 0x39a58
movl %eax, 0x31443(%rip)     # 0x39a28
movl %eax, 0x31471(%rip)     # 0x39a5c
jmp 0x8377
movsbq 0x2(%r12), %r13
testq %r13, %r13
je 0x860f
callq 0x42d0
movq (%rax), %rax
testb $0x8, 0x1(%rax,%r13,2)
jne 0x87fc
callq 0x42d0
movq (%rax), %rax
movq (%r15), %rdi
movsbq (%rdi), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x8803
jmp 0x88af
movl $0x1, %eax
movl %eax, 0x3141f(%rip)     # 0x39a58
movl %eax, 0x313e9(%rip)     # 0x39a28
movl %eax, 0x3141f(%rip)     # 0x39a64
jmp 0x8377
movq 0x2eb67(%rip), %rax     # 0x371b8
cmpb $0x0, (%rax)
jne 0x8897
movq (%r15), %r12
testq %r12, %r12
je 0x8878
movzbl (%r12), %eax
cmpl $0x20, %eax
je 0x8679
cmpl $0x9, %eax
jne 0x879a
incq %r12
jmp 0x8666
movq 0x2eb4b(%rip), %rax     # 0x371d0
cmpb $0x0, (%rax)
jne 0x88a3
callq 0x42d0
movq (%rax), %rax
movsbq 0x2(%r12), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x87b3
movq (%r15), %r12
testq %r12, %r12
je 0x8878
movzbl (%r12), %eax
cmpl $0x20, %eax
je 0x86c6
cmpl $0x9, %eax
jne 0x87d5
incq %r12
jmp 0x86b3
movl $0x1, %eax
movl %eax, 0x31382(%rip)     # 0x39a58
movl %eax, 0x3134c(%rip)     # 0x39a28
movl %eax, 0x31386(%rip)     # 0x39a68
jmp 0x8377
leaq 0x1d2d7(%rip), %rax     # 0x259c5
movq %rax, 0x2eaa3(%rip)     # 0x37198
movl $0x1, 0x31355(%rip)     # 0x39a54
movl %edx, %ebp
callq 0x42d0
movq (%rax), %r13
movq %r12, %rdi
callq 0x4110
movl %ebp, %edx
movsbq -0x1(%r12,%rax), %rcx
testb $0x8, 0x1(%r13,%rcx,2)
je 0x872f
leaq (%r12,%rax), %rdi
decq %rdi
callq 0x4270
movl %eax, %edx
movl %edx, 0x2eabb(%rip)     # 0x371f0
movsbl 0x1(%r12), %edi
movq %r12, %rsi
movl $0x1, %edx
callq 0x7fdb
jmp 0x8377
movq 0x2ea74(%rip), %rdi     # 0x371c8
callq 0x4110
movq %rax, %r14
movq %r12, %rdi
callq 0x4110
leal (%rax,%r14), %edi
addl $0xa, %edi
callq 0x6469
movq %rax, %r14
movq 0x2ea4e(%rip), %rdx     # 0x371c8
movq %rax, %rdi
leaq 0x1bae7(%rip), %rsi     # 0x2426b
movq %r12, %rcx
xorl %eax, %eax
callq 0x4290
movq %r14, 0x2ea33(%rip)     # 0x371c8
jmp 0x83ec
movq %r12, %rdi
callq 0x4110
leal 0x1(%rax), %edi
callq 0x6469
movq %rax, 0x2ea07(%rip)     # 0x371b8
jmp 0x87ec
movq %r12, %rdi
callq 0x4110
leal 0x1(%rax), %edi
callq 0x6469
movq %rax, 0x2ea06(%rip)     # 0x371d0
movq %rax, %rdi
movq %r12, %rsi
jmp 0x83c3
movq %r12, %rdi
callq 0x4110
leal 0x1(%rax), %edi
callq 0x6469
movq %rax, 0x2e9e4(%rip)     # 0x371d0
movq %rax, %rdi
movq %r12, %rsi
callq 0x40b0
jmp 0x83ec
addq $0x2, %r12
movq %r12, %rdi
callq 0x4270
movl %eax, 0x2e9ea(%rip)     # 0x371f8
jmp 0x8377
cmpl $0x0, 0x31212(%rip)     # 0x39a2c
je 0x8843
leaq 0x1a842(%rip), %rsi     # 0x23065
movq %r12, %rdi
callq 0x42c0
testq %rax, %rax
je 0x8864
leaq 0x1a82e(%rip), %rsi     # 0x23065
movq %rax, %rdi
callq 0x41b0
testl %eax, %eax
jne 0x8864
cmpl $0x0, 0x311c2(%rip)     # 0x39a0c
je 0x885d
leaq 0x1ba26(%rip), %rdi     # 0x24279
movq %r12, %rsi
xorl %eax, %eax
callq 0x4140
movq %r12, 0x31214(%rip)     # 0x39a78
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ac43(%rip), %rdi     # 0x234c2
callq 0x796f
movq 0x2e8f5(%rip), %rdi     # 0x37180
callq 0x40d0
xorl %edi, %edi
callq 0x42a0
leaq 0x1b9b3(%rip), %rdi     # 0x24251
callq 0x796f
leaq 0x1b98d(%rip), %rdi     # 0x24237
callq 0x796f
leaq 0x1b96c(%rip), %rdi     # 0x24222
callq 0x796f