// File: /workspace/github_c_makefile_star2_O3/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 0x8bbd
cmpl $0x0, 0x2fe76(%rip)     # 0x38a1c
je 0x8bbd
leaq 0x1adec(%rip), %rdi     # 0x2399b
movq %rbx, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x4140
jmp 0x8bc6
testq %rbx, %rbx
je 0x8ded
leaq 0x19498(%rip), %rsi     # 0x22065
movq %rbx, %rdi
callq 0x42d0
testq %rax, %rax
je 0x8ded
movq %rax, %r14
leaq 0x30568(%rip), %rdi     # 0x39150
movq %rbx, %rsi
callq 0x40b0
movb $0x4d, 0x1(%r14)
leaq 0x90(%rsp), %rdi
movq %rbx, %rsi
callq 0x40b0
movb $0x63, 0x1(%r14)
cmpl $0x0, 0x2d5eb(%rip)     # 0x361fc
je 0x8d67
movq 0x2d5a2(%rip), %rdx     # 0x361c0
leaq 0x1adc1(%rip), %rsi     # 0x239e6
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x42a0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2122d
leaq 0x1c157(%rip), %rsi     # 0x24d9b
leaq 0x90(%rsp), %rdi
callq 0x4270
movq %rax, %r14
testq %rax, %rax
je 0x8e6f
cmpl $0x0, 0x2fdb4(%rip)     # 0x38a18
jne 0x8e06
callq 0x620c
callq 0x1696c
movq %rax, 0x2fd85(%rip)     # 0x38a00
callq 0x1696c
movq %rax, 0x2fd89(%rip)     # 0x38a10
callq 0x743c
movq %rax, 0x306bd(%rip)     # 0x39350
movq 0x2fd66(%rip), %rdi     # 0x38a00
movq %rax, 0x10(%rdi)
movq 0x2fde3(%rip), %rdx     # 0x38a88
movq %r14, %rsi
callq 0x16b70
movq 0x3069c(%rip), %rdi     # 0x39350
callq 0x7469
movq 0x2fd40(%rip), %rdi     # 0x38a00
xorl %esi, %esi
callq 0x16a56
movq 0x2fd32(%rip), %rax     # 0x38a00
movq 0x10(%rax), %r15
callq 0x1dda9
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x711f
movq 0x2fd25(%rip), %rdi     # 0x38a10
callq 0x169e5
movq (%rax), %rcx
movq %rcx, 0x3065e(%rip)     # 0x39358
cmpl $0x0, 0x2fd17(%rip)     # 0x38a18
jne 0x8e2e
testq %rcx, %rcx
je 0x8e55
movq %r14, %rdi
callq 0x77d0
cmpl $0x0, 0x2fd19(%rip)     # 0x38a38
je 0x8d2f
movq 0x30630(%rip), %rdi     # 0x39358
xorl %esi, %esi
callq 0x1edaa
movq 0x3061a(%rip), %rdi     # 0x39350
callq 0x7483
cmpl $0x0, 0x2fcfa(%rip)     # 0x38a3c
je 0x8e93
cmpl $0x0, 0x2fd2d(%rip)     # 0x38a7c
jne 0x8e93
leaq 0x90(%rsp), %rdi
callq 0x4080
jmp 0x8e93
leaq 0x1c02d(%rip), %rsi     # 0x24d9b
leaq 0x90(%rsp), %rdi
callq 0x4270
testq %rax, %rax
je 0x8c17
movq %rax, %r14
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x41e0
testl %eax, %eax
js 0x8c5d
leaq 0x90(%rsp), %rdi
leaq 0x298(%rsp), %rsi
callq 0x41e0
testl %eax, %eax
js 0x8dc6
movq 0x58(%rsp), %rax
cmpq 0x2f0(%rsp), %rax
jl 0x8c5d
cmpl $0x0, 0x2d42f(%rip)     # 0x361fc
jne 0x8c17
cmpl $0x0, 0x2fc3e(%rip)     # 0x38a18
jne 0x8ea1
movq %r14, %rdi
callq 0x77d0
jmp 0x8c17
movq 0x2d204(%rip), %rax     # 0x35ff8
movq (%rax), %rdi
leaq 0x1abc1(%rip), %rsi     # 0x239bf
movq %rbx, %rdx
jmp 0x8e88
movq 0x2d1eb(%rip), %rax     # 0x35ff8
movq (%rax), %rdi
leaq 0x1a4d2(%rip), %rsi     # 0x232e9
leaq 0x90(%rsp), %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x41d0
jmp 0x8c6a
movq 0x2d1c3(%rip), %rax     # 0x35ff8
movq (%rax), %rdi
leaq 0x1abc7(%rip), %rsi     # 0x23a06
movq %r14, %rdx
xorl %eax, %eax
callq 0x41d0
movq 0x30508(%rip), %rcx     # 0x39358
jmp 0x8d07
leaq 0x90(%rsp), %rsi
movq %rbx, %rdi
callq 0x4353
movl $0x1, %edi
callq 0x42b0
movq 0x2d182(%rip), %rax     # 0x35ff8
movq (%rax), %rdi
leaq 0x1ab6d(%rip), %rsi     # 0x239ed
leaq 0x90(%rsp), %rdx
xorl %eax, %eax
callq 0x41d0
testl %ebp, %ebp
jne 0x8e65
addq $0x328, %rsp            # imm = 0x328
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x2d150(%rip), %rax     # 0x35ff8
movq (%rax), %rdi
leaq 0x1ab28(%rip), %rsi     # 0x239da
movq %r14, %rdx
xorl %eax, %eax
callq 0x41d0
jmp 0x8de0