// File: /workspace/github_c_makefile_star2_O2/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 0x6c8e
cmpl $0x0, 0x2fda5(%rip)     # 0x36a1c
je 0x6c8e
leaq 0x1ad1b(%rip), %rdi     # 0x2199b
movq %rbx, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x4140
jmp 0x6c97
testq %rbx, %rbx
je 0x6ec6
leaq 0x193c7(%rip), %rsi     # 0x20065
movq %rbx, %rdi
callq 0x42d0
testq %rax, %rax
je 0x6ec6
movq %rax, %r14
leaq 0x30497(%rip), %rdi     # 0x37150
movq %rbx, %rsi
callq 0x40b0
movb $0x4d, 0x1(%r14)
leaq 0x90(%rsp), %rdi
movq %rbx, %rsi
callq 0x40b0
movb $0x63, 0x1(%r14)
cmpl $0x0, 0x2d51a(%rip)     # 0x341fc
je 0x6e5e
xorl %r14d, %r14d
testq %r14, %r14
je 0x6d0e
cmpl $0x0, 0x2d505(%rip)     # 0x341fc
jne 0x6d0e
cmpl $0x0, 0x2fd18(%rip)     # 0x36a18
jne 0x6f99
movq %r14, %rdi
callq 0x59e0
movq 0x2d4ab(%rip), %rdx     # 0x341c0
leaq 0x1acca(%rip), %rsi     # 0x219e6
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x42a0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f509
leaq 0x1bf60(%rip), %rsi     # 0x22c9b
leaq 0x90(%rsp), %rdi
callq 0x4270
movq %rax, %r14
testq %rax, %rax
je 0x6f67
cmpl $0x0, 0x2fcbd(%rip)     # 0x36a18
jne 0x6edf
callq 0x4679
callq 0x14b6e
movq %rax, 0x2fc8e(%rip)     # 0x36a00
callq 0x14b6e
movq %rax, 0x2fc92(%rip)     # 0x36a10
callq 0x5667
movq %rax, 0x305c6(%rip)     # 0x37350
movq 0x2fc6f(%rip), %rdi     # 0x36a00
movq %rax, 0x10(%rdi)
movq 0x2fcec(%rip), %rdx     # 0x36a88
movq %r14, %rsi
callq 0x14d14
movq 0x305a5(%rip), %rdi     # 0x37350
callq 0x5692
movq 0x2fc49(%rip), %rdi     # 0x36a00
xorl %esi, %esi
callq 0x14c4b
movq 0x2fc3b(%rip), %rax     # 0x36a00
movq 0x10(%rax), %r15
callq 0x1c2ba
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x5396
movq 0x2fc2e(%rip), %rdi     # 0x36a10
callq 0x14bdd
movq (%rax), %rcx
movq %rcx, 0x30567(%rip)     # 0x37358
cmpl $0x0, 0x2fc20(%rip)     # 0x36a18
jne 0x6f07
testq %rcx, %rcx
je 0x6f2e
movq %r14, %rdi
callq 0x59e0
cmpl $0x0, 0x2fc22(%rip)     # 0x36a38
je 0x6e26
movq 0x30539(%rip), %rdi     # 0x37358
xorl %esi, %esi
callq 0x1d148
movq 0x30523(%rip), %rdi     # 0x37350
callq 0x56ac
cmpl $0x0, 0x2fc03(%rip)     # 0x36a3c
je 0x6f8b
cmpl $0x0, 0x2fc36(%rip)     # 0x36a7c
jne 0x6f8b
leaq 0x90(%rsp), %rdi
callq 0x4080
jmp 0x6f8b
leaq 0x1be36(%rip), %rsi     # 0x22c9b
leaq 0x90(%rsp), %rdi
callq 0x4270
testq %rax, %rax
je 0x6ce8
movq %rax, %r14
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x41d0
testl %eax, %eax
js 0x6d54
leaq 0x90(%rsp), %rdi
leaq 0x298(%rsp), %rsi
callq 0x41d0
testl %eax, %eax
js 0x6ceb
movq 0x58(%rsp), %rax
cmpq 0x2f0(%rsp), %rax
jge 0x6ceb
jmp 0x6d54
movq 0x2d12b(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x1aae8(%rip), %rsi     # 0x219bf
movq %rbx, %rdx
jmp 0x6f80
movq 0x2d112(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x1a3f9(%rip), %rsi     # 0x212e9
leaq 0x90(%rsp), %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x41c0
jmp 0x6d61
movq 0x2d0ea(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x1aaee(%rip), %rsi     # 0x21a06
movq %r14, %rdx
xorl %eax, %eax
callq 0x41c0
movq 0x3042f(%rip), %rcx     # 0x37358
jmp 0x6dfe
movq 0x2d0c3(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x1aae2(%rip), %rsi     # 0x21a21
movq %rbx, %rdx
xorl %eax, %eax
callq 0x41c0
cmpl $0x0, 0x2faec(%rip)     # 0x36a3c
je 0x6f5f
leaq 0x90(%rsp), %rdi
callq 0x4080
pushq $0x1
popq %rdi
callq 0x42b0
movq 0x2d08a(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x1aa75(%rip), %rsi     # 0x219ed
leaq 0x90(%rsp), %rdx
xorl %eax, %eax
callq 0x41c0
testl %ebp, %ebp
jne 0x6f5f
addq $0x328, %rsp            # imm = 0x328
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x2d058(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x1aa30(%rip), %rsi     # 0x219da
movq %r14, %rdx
xorl %eax, %eax
callq 0x41c0
jmp 0x6d06