// File: /workspace/github_c_makefile_star2_O1/nimble-code[P]Modex/Src/modex.c
// Function: process_input
void
process_input(char *f, int phase2)
{	FILE *fp = NULL;
	char	cpp_file[512], *z, m[64];

	if (f && Verbose_cmds)
		printf("modex: process_input %s (phase %d)\n", f, phase2);

	if (!f || (z = strstr(f, ".c")) == NULL)
	{	fprintf(stderr, "modex: not a .c file <%s>\n", f);
		goto bad;
	}
	strcpy(cur_in, f);
	z++;
	*z = 'M';	/* preprocessor output */
	strcpy(cpp_file, f);
	*z = 'c';	/* restore */

	if (must_preprocess
	|| (fp = fopen(cpp_file, "r")) == NULL
	||  newer(f, cpp_file))		/* n.b. cannot see when included files change... */
	{	if (!must_preprocess
		&&  fp != NULL)
		{
if (debug_io) fprintf(stderr, "close 1 %p\n", fp);
			Fclose(fp);	/* .c newer than .M */
			fp = 0;
		}
		sprintf(m, "%s.dfn", modelname);

		modex_pp(f, m);	/* preprocessing - produce .M file */

		if ((fp = fopen(cpp_file, "r")) == NULL)
		{	fprintf(stderr, "modex: cannot open '%s'\n", cpp_file);
			goto bad;
	}	}
if (debug_io) fprintf(stderr, "Open %s -> %p\n", cpp_file, fp);

	init_nmetab();
	ParseStack = new_treestk();
	DoneStack  = new_treestk();
	contxt     = new_context();

	ParseStack->contxt = contxt;
	handle_new_file(ParseStack, fp, file_name);
	enter_scope(contxt);

	tree_parse(ParseStack, 0);			/* gram.y */

	name_scope(ParseStack->contxt, current_filename(), NONE_T);
	parse_tree = (top_of_stack(DoneStack))->parse_tree;

if (debug_io) fprintf(stderr, "close 2 %p - parsetree %p\n", fp, parse_tree);

	if (parse_tree)
	{	Fclose(fp);
		fp = 0;
		if (do_dflow)
			walk_tree(parse_tree, 0);	/* dflow.c */
	} else
	{	fprintf(stderr, "modex: no parsetree for %s\n", f);
		if (preview) unlink(cpp_file);
		phase2 = 1;	/* always exit */
		goto bad;
	}
	exit_scope(contxt);

	if (preview && !Verbose) unlink(cpp_file);

	return;
bad:
	if (phase2) exit(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x328, %rsp            # imm = 0x328
movl %esi, %ebp
movq %rdi, %rbx
testq %rdi, %rdi
je 0x8d4b
cmpl $0x0, 0x30cd6(%rip)     # 0x39a0c
je 0x8d4b
leaq 0x1bc5c(%rip), %rdi     # 0x2499b
movq %rbx, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x4140
testq %rbx, %rbx
je 0x8f88
leaq 0x1a30a(%rip), %rsi     # 0x23065
movq %rbx, %rdi
callq 0x42c0
testq %rax, %rax
je 0x8f88
movq %rax, %r14
leaq 0x313ca(%rip), %rdi     # 0x3a140
movq %rbx, %rsi
callq 0x40b0
movb $0x4d, 0x1(%r14)
leaq 0x90(%rsp), %rdi
movq %rbx, %rsi
callq 0x40b0
movb $0x63, 0x1(%r14)
cmpl $0x0, 0x2e44d(%rip)     # 0x371ec
je 0x8f20
xorl %r14d, %r14d
testq %r14, %r14
je 0x8dcb
cmpl $0x0, 0x2e438(%rip)     # 0x371ec
jne 0x8dcb
cmpl $0x0, 0x30c4b(%rip)     # 0x39a08
jne 0x9053
movq %r14, %rdi
callq 0x793c
movq 0x2e3de(%rip), %rdx     # 0x371b0
leaq 0x1bc0d(%rip), %rsi     # 0x249e6
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x4290
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21bf6
leaq 0x1cfa3(%rip), %rsi     # 0x25d9b
leaq 0x90(%rsp), %rdi
callq 0x4260
movq %rax, %r14
testq %rax, %rax
je 0x9021
cmpl $0x0, 0x30bf0(%rip)     # 0x39a08
jne 0x8fa1
callq 0x6354
callq 0x16760
movq %rax, 0x30bc1(%rip)     # 0x399f0
callq 0x16760
movq %rax, 0x30bc5(%rip)     # 0x39a00
callq 0x75a7
movq %rax, 0x314f9(%rip)     # 0x3a340
movq 0x30ba2(%rip), %rdi     # 0x399f0
movq %rax, 0x10(%rdi)
movq 0x30c1f(%rip), %rdx     # 0x39a78
movq %r14, %rsi
callq 0x169a3
movq 0x314d8(%rip), %rdi     # 0x3a340
callq 0x75d4
movq 0x30b7c(%rip), %rdi     # 0x399f0
xorl %esi, %esi
callq 0x1684b
movq 0x30b6e(%rip), %rax     # 0x399f0
movq 0x10(%rax), %r15
callq 0x1e7f4
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x7279
movq 0x30b61(%rip), %rdi     # 0x39a00
callq 0x167da
movq (%rax), %rcx
movq %rcx, 0x3149a(%rip)     # 0x3a348
cmpl $0x0, 0x30b53(%rip)     # 0x39a08
jne 0x8fc9
cmpq $0x0, 0x31485(%rip)     # 0x3a348
je 0x8fe9
movq %r14, %rdi
callq 0x793c
cmpl $0x0, 0x30b50(%rip)     # 0x39a28
je 0x8ee8
movq 0x31467(%rip), %rdi     # 0x3a348
xorl %esi, %esi
callq 0x1f7c5
movq 0x31451(%rip), %rdi     # 0x3a340
callq 0x75ee
cmpl $0x0, 0x30b31(%rip)     # 0x39a2c
je 0x9045
cmpl $0x0, 0x30b64(%rip)     # 0x39a6c
jne 0x9045
leaq 0x90(%rsp), %rdi
callq 0x4080
jmp 0x9045
leaq 0x1ce74(%rip), %rsi     # 0x25d9b
leaq 0x90(%rsp), %rdi
callq 0x4260
testq %rax, %rax
je 0x8da5
movq %rax, %r14
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x41d0
testl %eax, %eax
js 0x8e11
leaq 0x90(%rsp), %rdi
leaq 0x298(%rsp), %rsi
callq 0x41d0
testl %eax, %eax
js 0x8da8
movq 0x58(%rsp), %rax
cmpq 0x2f0(%rsp), %rax
jge 0x8da8
jmp 0x8e11
movq 0x2e069(%rip), %rax     # 0x36ff8
movq (%rax), %rdi
leaq 0x1ba26(%rip), %rsi     # 0x249bf
movq %rbx, %rdx
jmp 0x903a
movq 0x2e050(%rip), %rax     # 0x36ff8
movq (%rax), %rdi
leaq 0x1b337(%rip), %rsi     # 0x242e9
leaq 0x90(%rsp), %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x41c0
jmp 0x8e1e
movq 0x2e028(%rip), %rax     # 0x36ff8
movq (%rax), %rdi
leaq 0x1ba2c(%rip), %rsi     # 0x24a06
movq %r14, %rdx
xorl %eax, %eax
callq 0x41c0
jmp 0x8ebb
movq 0x2e008(%rip), %rax     # 0x36ff8
movq (%rax), %rdi
leaq 0x1ba27(%rip), %rsi     # 0x24a21
movq %rbx, %rdx
xorl %eax, %eax
callq 0x41c0
movl $0x1, %ebp
cmpl $0x0, 0x30a1c(%rip)     # 0x39a2c
je 0x9041
leaq 0x90(%rsp), %rdi
callq 0x4080
jmp 0x9041
movq 0x2dfd0(%rip), %rax     # 0x36ff8
movq (%rax), %rdi
leaq 0x1b9bb(%rip), %rsi     # 0x249ed
leaq 0x90(%rsp), %rdx
xorl %eax, %eax
callq 0x41c0
testl %ebp, %ebp
jne 0x9073
addq $0x328, %rsp            # imm = 0x328
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x2df9e(%rip), %rax     # 0x36ff8
movq (%rax), %rdi
leaq 0x1b976(%rip), %rsi     # 0x249da
movq %r14, %rdx
xorl %eax, %eax
callq 0x41c0
jmp 0x8dc3
movl $0x1, %edi
callq 0x42a0