// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x84df
cmpl $0x0, 0x3f724(%rip)     # 0x47bec
je 0x84df
movq -0x8(%rbp), %rsi
movl -0xc(%rbp), %edx
leaq 0x2c67c(%rip), %rdi     # 0x34b54
movb $0x0, %al
callq 0x4120
cmpq $0x0, -0x8(%rbp)
je 0x8503
movq -0x8(%rbp), %rdi
leaq 0x2ab58(%rip), %rsi     # 0x33049
callq 0x4280
movq %rax, -0x228(%rbp)
cmpq $0x0, %rax
jne 0x8524
movq 0x3caee(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x2c660(%rip), %rsi     # 0x34b78
movb $0x0, %al
callq 0x4190
jmp 0x87fc
movq -0x8(%rbp), %rsi
leaq 0x3fdf1(%rip), %rdi     # 0x48320
callq 0x40a0
movq -0x228(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rax
movb $0x4d, (%rax)
leaq -0x220(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x40a0
movq -0x228(%rbp), %rax
movb $0x63, (%rax)
cmpl $0x0, 0x3cc5b(%rip)     # 0x451cc
jne 0x85a9
leaq -0x220(%rbp), %rdi
leaq 0x2db22(%rip), %rsi     # 0x360a3
callq 0x4230
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x85a9
movq -0x8(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0xa570
cmpl $0x0, %eax
je 0x865e
cmpl $0x0, 0x3cc1c(%rip)     # 0x451cc
jne 0x85ef
cmpq $0x0, -0x18(%rbp)
je 0x85ef
cmpl $0x0, 0x3f628(%rip)     # 0x47be8
je 0x85de
movq 0x3ca2f(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0x2c5bc(%rip), %rsi     # 0x34b93
movb $0x0, %al
callq 0x4190
movq -0x18(%rbp), %rdi
callq 0x6d20
movq $0x0, -0x18(%rbp)
leaq -0x270(%rbp), %rdi
movq 0x3cb93(%rip), %rdx     # 0x45190
leaq 0x2c59b(%rip), %rsi     # 0x34b9f
movb $0x0, %al
callq 0x4260
movq -0x8(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x32220
leaq -0x220(%rbp), %rdi
leaq 0x2da7a(%rip), %rsi     # 0x360a3
callq 0x4230
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x865c
movq 0x3c9b9(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
leaq -0x220(%rbp), %rdx
leaq 0x2c556(%rip), %rsi     # 0x34ba6
movb $0x0, %al
callq 0x4190
jmp 0x87fc
jmp 0x865e
cmpl $0x0, 0x3f583(%rip)     # 0x47be8
je 0x868a
movq 0x3c98a(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
leaq -0x220(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq 0x2bd9a(%rip), %rsi     # 0x3441d
movb $0x0, %al
callq 0x4190
callq 0x4900
callq 0x1c810
movq %rax, 0x3f535(%rip)     # 0x47bd0
callq 0x1c810
movq %rax, 0x3f539(%rip)     # 0x47be0
callq 0x66f0
movq %rax, 0x3fe6d(%rip)     # 0x48520
movq 0x3fe66(%rip), %rcx     # 0x48520
movq 0x3f50f(%rip), %rax     # 0x47bd0
movq %rcx, 0x10(%rax)
movq 0x3f504(%rip), %rdi     # 0x47bd0
movq -0x18(%rbp), %rsi
movq 0x3f581(%rip), %rdx     # 0x47c58
callq 0x1cb60
movq 0x3fe3d(%rip), %rdi     # 0x48520
callq 0x6740
movq 0x3f4e1(%rip), %rdi     # 0x47bd0
xorl %esi, %esi
callq 0x1ca30
movq 0x3f4d3(%rip), %rax     # 0x47bd0
movq 0x10(%rax), %rax
movq %rax, -0x278(%rbp)
callq 0x2d100
movq -0x278(%rbp), %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x6100
movq 0x3f4bb(%rip), %rdi     # 0x47be0
callq 0x1c950
movq (%rax), %rax
movq %rax, 0x3fdf4(%rip)     # 0x48528
cmpl $0x0, 0x3f4ad(%rip)     # 0x47be8
je 0x8760
movq 0x3c8b4(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
movq 0x3fdd6(%rip), %rcx     # 0x48528
leaq 0x2c466(%rip), %rsi     # 0x34bbf
movb $0x0, %al
callq 0x4190
cmpq $0x0, 0x3fdc0(%rip)     # 0x48528
je 0x8796
movq -0x18(%rbp), %rdi
callq 0x6d20
movq $0x0, -0x18(%rbp)
cmpl $0x0, 0x3f486(%rip)     # 0x47c08
je 0x8794
movq 0x3fd9d(%rip), %rdi     # 0x48528
xorl %eax, %eax
movl %eax, %esi
callq 0x2e910
jmp 0x87d0
movq 0x3c85b(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x2c42f(%rip), %rsi     # 0x34bda
movb $0x0, %al
callq 0x4190
cmpl $0x0, 0x3f453(%rip)     # 0x47c0c
je 0x87c7
leaq -0x220(%rbp), %rdi
callq 0x4070
movl $0x1, -0xc(%rbp)
jmp 0x87fc
movq 0x3fd49(%rip), %rdi     # 0x48520
callq 0x6780
cmpl $0x0, 0x3f429(%rip)     # 0x47c0c
je 0x87fa
cmpl $0x0, 0x3f460(%rip)     # 0x47c4c
jne 0x87fa
leaq -0x220(%rbp), %rdi
callq 0x4070
jmp 0x880c
cmpl $0x0, -0xc(%rbp)
je 0x880c
movl $0x1, %edi
callq 0x4270
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
nopw %cs:(%rax,%rax)