// File: /workspace/github_c_makefile_star2_O0/dalnefre[P]kernel_abe/reduce.c
// Function: main
int
main(int argc, char** argv)
{
	int c;
	BOOL test_mode = FALSE;			/* flag to run unit tests */
	BOOL interactive = FALSE;		/* flag to run unit tests */

	DBUG_ENTER("main");
	DBUG_PROCESS(argv[0]);
	while ((c = getopt(argc, argv, "ti#:V")) != EOF) {
		switch(c) {
		case 't':	test_mode = TRUE;		break;
		case 'i':	interactive = TRUE;		break;
		case '#':	DBUG_PUSH(optarg);		break;
		case 'V':	banner();				exit(EXIT_SUCCESS);
		case '?':							usage();
		default:							usage();
		}
	}
	banner();
	if (test_mode) {
		test_reduce();	/* this test involves running the dispatch loop */
	} else {
		CONFIG* cfg;
		CONS* show_result;

		cfg = init_reduce();
		show_result = CFG_ACTOR(cfg, print_msg,
			map_put(NIL, ATOM("message"), ATOM("= ")));
		while (optind < argc) {
			FILE* f;
			char* filename = argv[optind++];
			DBUG_PRINT("", ("filename=%s", filename));
			if ((f = fopen(filename, "r")) == NULL) {
				perror(filename);
				exit(EXIT_FAILURE);
			}
			TRACE(printf("Loading %s...\n", filename));
			read_reduce_print(f, show_result);
			fclose(f);
		}
		if (interactive) {
			printf("Entering INTERACTIVE mode.\n");
			read_reduce_print(stdin, show_result);
		}
		report_actor_usage(cfg);
	}
	report_cons_stats();
	DBUG_RETURN (exit(EXIT_SUCCESS), 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
leaq 0x1061f(%rip), %rax     # 0x1ae0f
movq %rax, -0x50(%rbp)
leaq 0x15b8d(%rip), %rax     # 0x20388
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x48(%rbp)
movl $0x728, -0x44(%rbp)     # imm = 0x728
leaq 0x1249a(%rip), %rax     # 0x1ccb0
movq %rax, -0x40(%rbp)
leaq 0x1590f(%rip), %rax     # 0x20130
movq %rax, -0x38(%rbp)
leaq 0x15b5c(%rip), %rax     # 0x20388
movq (%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x19910
leaq 0x15b41(%rip), %rax     # 0x20388
movq (%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0xa865
leaq 0x15b30(%rip), %rax     # 0x20388
movq (%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0xa873
movq 0x1578c(%rip), %rax     # 0x1fff8
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rcx
leaq 0x15b0a(%rip), %rax     # 0x20388
movq (%rax), %rax
movq %rcx, 0x18(%rax)
callq 0x20a0
movl %eax, %ecx
leaq 0x15af5(%rip), %rax     # 0x20388
movq (%rax), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
leaq 0x15ae1(%rip), %rax     # 0x20388
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x10558(%rip), %rdx     # 0x1ae14
callq 0x21d0
movl %eax, -0x14(%rbp)
cmpl $-0x1, %eax
je 0xa95b
movl -0x14(%rbp), %eax
movl %eax, -0x7c(%rbp)
subl $0x23, %eax
je 0xa918
jmp 0xa8da
movl -0x7c(%rbp), %eax
subl $0x3f, %eax
je 0xa94c
jmp 0xa8e4
movl -0x7c(%rbp), %eax
subl $0x56, %eax
je 0xa940
jmp 0xa8ee
movl -0x7c(%rbp), %eax
subl $0x69, %eax
je 0xa90d
jmp 0xa8f8
movl -0x7c(%rbp), %eax
subl $0x74, %eax
jne 0xa951
jmp 0xa902
movl $0x1, %eax
movq %rax, -0x20(%rbp)
jmp 0xa956
movl $0x1, %eax
movq %rax, -0x28(%rbp)
jmp 0xa956
jmp 0xa91a
leaq 0x15a67(%rip), %rax     # 0x20388
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x72e, 0xc(%rax)       # imm = 0x72E
movq 0x156a2(%rip), %rax     # 0x1ffd8
movq (%rax), %rdi
callq 0x18fb0
jmp 0xa956
callq 0xa790
xorl %edi, %edi
callq 0x2210
callq 0xa760
callq 0xa760
jmp 0xa8ae
callq 0xa790
cmpq $0x0, -0x20(%rbp)
je 0xa971
callq 0x9ea0
jmp 0xaaf6
callq 0xac40
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq 0xf678(%rip), %rdi      # 0x1a004
callq 0x12b60
movq %rax, -0x90(%rbp)
leaq 0x1047b(%rip), %rdi     # 0x1ae1a
callq 0x12b60
movq -0x90(%rbp), %rsi
movq %rax, %rdx
leaq 0x15943(%rip), %rdi     # 0x202f8
callq 0x172a0
movq -0x88(%rbp), %rdi
movq %rax, %rdx
leaq -0x869b(%rip), %rsi     # 0x2330
callq 0xcb70
movq %rax, -0x60(%rbp)
movq 0x155f5(%rip), %rax     # 0x1ffd0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jge 0xaac5
movq -0x10(%rbp), %rax
movq 0x155df(%rip), %rcx     # 0x1ffd0
movl (%rcx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movq 0x155d1(%rip), %rdx     # 0x1ffd0
movl %esi, (%rdx)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x70(%rbp)
leaq 0x15f1d(%rip), %rax     # 0x20930
cmpl $0x0, (%rax)
je 0xaa69
leaq 0x15969(%rip), %rax     # 0x20388
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x12283(%rip), %rcx     # 0x1ccb0
movq %rcx, 0x10(%rax)
leaq 0x12278(%rip), %rdi     # 0x1ccb0
callq 0x18d20
cmpl $0x0, %eax
je 0xaa69
leaq 0x1593f(%rip), %rax     # 0x20388
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x741, 0xc(%rax)       # imm = 0x741
movq -0x70(%rbp), %rsi
leaq 0x103bb(%rip), %rdi     # 0x1ae1d
movb $0x0, %al
callq 0x199c0
jmp 0xaa6b
movq -0x70(%rbp), %rdi
leaq 0x11f69(%rip), %rsi     # 0x1c9df
callq 0x21b0
movq %rax, -0x68(%rbp)
cmpq $0x0, %rax
jne 0xaa98
movq -0x70(%rbp), %rdi
callq 0x21c0
movl $0x1, %edi
callq 0x2210
movq -0x70(%rbp), %rsi
leaq 0x10386(%rip), %rdi     # 0x1ae29
movb $0x0, %al
callq 0x20d0
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0xab20
movq -0x68(%rbp), %rdi
callq 0x20b0
jmp 0xa9d4
cmpq $0x0, -0x28(%rbp)
je 0xaaed
leaq 0x10365(%rip), %rdi     # 0x1ae38
movb $0x0, %al
callq 0x20d0
movq 0x154e7(%rip), %rax     # 0x1ffc8
movq (%rax), %rdi
movq -0x60(%rbp), %rsi
callq 0xab20
movq -0x58(%rbp), %rdi
callq 0xe590
callq 0xa740
movl $0x751, -0x44(%rbp)     # imm = 0x751
leaq -0x50(%rbp), %rdi
callq 0x19ae0
xorl %edi, %edi
callq 0x2210
nopw %cs:(%rax,%rax)