// File: /workspace/github_c_makefile_star2_O0/dalnefre[P]kernel_abe/schemer.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();
	{
		CONFIG* cfg = new_configuration(1000);
		CONS* show_result;

		init_schemer(cfg);		/* pre-load global definitions */
		if (test_mode) {
			test_schemer(cfg);	/* this test involves running the dispatch loop */
		}
#if 1
		show_result = CFG_ACTOR(cfg, println_beh, ATOM("="));
		cfg_add_gc_root(cfg, show_result);		/* protect from gc */
		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(cfg, f, show_result);
			fclose(f);
		}
		if (interactive) {
			printf("Entering INTERACTIVE mode.\n");
			read_reduce_print(cfg, stdin, show_result);
		}
#endif
		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 0xfd89(%rip), %rax      # 0x20ce9
movq %rax, -0x50(%rbp)
leaq 0x153a5(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x48(%rbp)
movl $0xb06, -0x44(%rbp)     # imm = 0xB06
leaq 0x11c06(%rip), %rax     # 0x22b8c
movq %rax, -0x40(%rbp)
leaq 0x1519f(%rip), %rax     # 0x26130
movq %rax, -0x38(%rbp)
leaq 0x15374(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x1f2c0
leaq 0x15359(%rip), %rax     # 0x26310
movq (%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x10fd5
leaq 0x15348(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0x10fe3
movq 0x1501c(%rip), %rax     # 0x25ff8
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rcx
leaq 0x15322(%rip), %rax     # 0x26310
movq (%rax), %rax
movq %rcx, 0x18(%rax)
callq 0x20a0
movl %eax, %ecx
leaq 0x1530d(%rip), %rax     # 0x26310
movq (%rax), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
leaq 0x152f9(%rip), %rax     # 0x26310
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0xfcc2(%rip), %rdx      # 0x20cee
callq 0x21d0
movl %eax, -0x14(%rbp)
cmpl $-0x1, %eax
je 0x110cb
movl -0x14(%rbp), %eax
movl %eax, -0x7c(%rbp)
subl $0x23, %eax
je 0x11088
jmp 0x1104a
movl -0x7c(%rbp), %eax
subl $0x3f, %eax
je 0x110bc
jmp 0x11054
movl -0x7c(%rbp), %eax
subl $0x56, %eax
je 0x110b0
jmp 0x1105e
movl -0x7c(%rbp), %eax
subl $0x69, %eax
je 0x1107d
jmp 0x11068
movl -0x7c(%rbp), %eax
subl $0x74, %eax
jne 0x110c1
jmp 0x11072
movl $0x1, %eax
movq %rax, -0x20(%rbp)
jmp 0x110c6
movl $0x1, %eax
movq %rax, -0x28(%rbp)
jmp 0x110c6
jmp 0x1108a
leaq 0x1527f(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0xb0c, 0xc(%rax)       # imm = 0xB0C
movq 0x14f32(%rip), %rax     # 0x25fd8
movq (%rax), %rdi
callq 0x1e960
jmp 0x110c6
callq 0x10f00
xorl %edi, %edi
callq 0x2210
callq 0x10ed0
callq 0x10ed0
jmp 0x1101e
callq 0x10f00
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x11bf0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0xf3b0
cmpq $0x0, -0x20(%rbp)
je 0x110f7
movq -0x58(%rbp), %rdi
callq 0x10180
movq -0x58(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq 0xfbeb(%rip), %rdi      # 0x20cf4
callq 0x18510
movq -0x88(%rbp), %rdi
movq %rax, %rdx
leaq -0xecdf(%rip), %rsi     # 0x2440
callq 0x12520
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x11ee0
movq 0x14e94(%rip), %rax     # 0x25fd0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jge 0x1122a
movq -0x10(%rbp), %rax
movq 0x14e7e(%rip), %rcx     # 0x25fd0
movl (%rcx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movq 0x14e70(%rip), %rdx     # 0x25fd0
movl %esi, (%rdx)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x70(%rbp)
leaq 0x1576c(%rip), %rax     # 0x268e0
cmpl $0x0, (%rax)
je 0x111ca
leaq 0x15190(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x119fe(%rip), %rcx     # 0x22b8c
movq %rcx, 0x10(%rax)
leaq 0x119f3(%rip), %rdi     # 0x22b8c
callq 0x1e6d0
cmpl $0x0, %eax
je 0x111ca
leaq 0x15166(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0xb22, 0xc(%rax)       # imm = 0xB22
movq -0x70(%rbp), %rsi
leaq 0xfb33(%rip), %rdi      # 0x20cf6
movb $0x0, %al
callq 0x1f370
jmp 0x111cc
movq -0x70(%rbp), %rdi
leaq 0x116e2(%rip), %rsi     # 0x228b9
callq 0x21b0
movq %rax, -0x68(%rbp)
cmpq $0x0, %rax
jne 0x111f9
movq -0x70(%rbp), %rdi
callq 0x21c0
movl $0x1, %edi
callq 0x2210
movq -0x70(%rbp), %rsi
leaq 0xfafe(%rip), %rdi      # 0x20d02
movb $0x0, %al
callq 0x20d0
movq -0x58(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
callq 0x11280
movq -0x68(%rbp), %rdi
callq 0x20b0
jmp 0x11135
cmpq $0x0, -0x28(%rbp)
je 0x11256
leaq 0xfad9(%rip), %rdi      # 0x20d11
movb $0x0, %al
callq 0x20d0
movq -0x58(%rbp), %rdi
movq 0x14d7e(%rip), %rax     # 0x25fc8
movq (%rax), %rsi
movq -0x60(%rbp), %rdx
callq 0x11280
movq -0x58(%rbp), %rdi
callq 0x13f40
callq 0x10eb0
movl $0xb33, -0x44(%rbp)     # imm = 0xB33
leaq -0x50(%rbp), %rdi
callq 0x1f490
xorl %edi, %edi
callq 0x2210
nopl (%rax,%rax)