// File: /workspace/github_c_makefile_star2_O0/dalnefre[P]kernel_abe/kernel.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, "tiM:#:V")) != EOF) {
		switch(c) {
		case 't':	test_mode = TRUE;		break;
		case 'i':	interactive = TRUE;		break;
		case 'M':	M_limit = atoi(optarg);	break;
		case '#':	DBUG_PUSH(optarg);		break;
		case 'V':	banner();				exit(EXIT_SUCCESS);
		case '?':							usage();
		default:							usage();
		}
	}
	banner();
	CFG = new_configuration(1000);
	init_kernel();  /* ==== INITIALIZE GLOBAL CONFIGURATION ==== */
	if (test_mode) {
		test_kernel();	/* this test involves running the dispatch loop */
		fputc('\n', output_file);
	}
	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);
		}
		fprintf(output_file, "Loading %s\n", filename);
		read_eval_print_loop(f, FALSE);
		fclose(f);
	}
	if (interactive) {
		fprintf(output_file, "Entering INTERACTIVE mode.\n");
		read_eval_print_loop(stdin, TRUE);
		fputc('\n', output_file);
		report_actor_usage(CFG);
	}
	report_cons_stats();

	DBUG_RETURN (exit(EXIT_SUCCESS), 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
leaq 0x23ea0(%rip), %rax     # 0x2950d
movq %rax, -0x50(%rbp)
leaq 0x29ca8(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x48(%rbp)
movl $0xcd6, -0x44(%rbp)     # imm = 0xCD6
leaq 0x23cdc(%rip), %rax     # 0x2936f
movq %rax, -0x40(%rbp)
leaq 0x29aa2(%rip), %rax     # 0x2f140
movq %rax, -0x38(%rbp)
leaq 0x29c77(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x28490
leaq 0x29c5c(%rip), %rax     # 0x2f320
movq (%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x56e2
leaq 0x29c4b(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0x56f0
movq 0x2990f(%rip), %rax     # 0x2eff8
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rcx
leaq 0x29c25(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq %rcx, 0x18(%rax)
callq 0x20a0
movl %eax, %ecx
leaq 0x29c10(%rip), %rax     # 0x2f320
movq (%rax), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
leaq 0x29bfc(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x23dd9(%rip), %rdx     # 0x29512
callq 0x21f0
movl %eax, -0x14(%rbp)
cmpl $-0x1, %eax
je 0x57fd
movl -0x14(%rbp), %eax
movl %eax, -0x6c(%rbp)
subl $0x23, %eax
je 0x57ba
jmp 0x5757
movl -0x6c(%rbp), %eax
subl $0x3f, %eax
je 0x57ee
jmp 0x5765
movl -0x6c(%rbp), %eax
subl $0x4d, %eax
je 0x57a3
jmp 0x576f
movl -0x6c(%rbp), %eax
subl $0x56, %eax
je 0x57e2
jmp 0x5779
movl -0x6c(%rbp), %eax
subl $0x69, %eax
je 0x5798
jmp 0x5783
movl -0x6c(%rbp), %eax
subl $0x74, %eax
jne 0x57f3
jmp 0x578d
movl $0x1, %eax
movq %rax, -0x20(%rbp)
jmp 0x57f8
movl $0x1, %eax
movq %rax, -0x28(%rbp)
jmp 0x57f8
movq 0x2982e(%rip), %rax     # 0x2efd8
movq (%rax), %rdi
callq 0x2210
movl %eax, 0x299d8(%rip)     # 0x2f190
jmp 0x57f8
jmp 0x57bc
leaq 0x29b5d(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0xcdd, 0xc(%rax)       # imm = 0xCDD
movq 0x29800(%rip), %rax     # 0x2efd8
movq (%rax), %rdi
callq 0x27b30
jmp 0x57f8
callq 0x5610
xorl %edi, %edi
callq 0x2230
callq 0x55e0
callq 0x55e0
jmp 0x572b
callq 0x5610
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x1adc0
movq %rax, 0x29b7d(%rip)     # 0x2f390
callq 0xbb00
cmpq $0x0, -0x20(%rbp)
je 0x5835
callq 0x4c30
movq 0x29b3d(%rip), %rsi     # 0x2f368
movl $0xa, %edi
callq 0x2130
jmp 0x5837
movq 0x29792(%rip), %rax     # 0x2efd0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jge 0x592f
movq -0x10(%rbp), %rax
movq 0x2977c(%rip), %rcx     # 0x2efd0
movl (%rcx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movq 0x2976e(%rip), %rdx     # 0x2efd0
movl %esi, (%rdx)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x60(%rbp)
leaq 0x2a0aa(%rip), %rax     # 0x2f920
cmpl $0x0, (%rax)
je 0x58cc
leaq 0x29a9e(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x23adf(%rip), %rcx     # 0x2936f
movq %rcx, 0x10(%rax)
leaq 0x23ad4(%rip), %rdi     # 0x2936f
callq 0x278a0
cmpl $0x0, %eax
je 0x58cc
leaq 0x29a74(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0xcee, 0xc(%rax)       # imm = 0xCEE
movq -0x60(%rbp), %rsi
leaq 0x23c55(%rip), %rdi     # 0x2951a
movb $0x0, %al
callq 0x28540
jmp 0x58ce
movq -0x60(%rbp), %rdi
leaq 0x25d7b(%rip), %rsi     # 0x2b654
callq 0x21d0
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
jne 0x58fb
movq -0x60(%rbp), %rdi
callq 0x21e0
movl $0x1, %edi
callq 0x2230
movq 0x29a66(%rip), %rdi     # 0x2f368
movq -0x60(%rbp), %rdx
leaq 0x23c19(%rip), %rsi     # 0x29526
movb $0x0, %al
callq 0x2170
movq -0x58(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x59a0
movq -0x58(%rbp), %rdi
callq 0x20b0
jmp 0x5837
cmpq $0x0, -0x28(%rbp)
je 0x597c
movq 0x29a2b(%rip), %rdi     # 0x2f368
leaq 0x23bee(%rip), %rsi     # 0x29532
movb $0x0, %al
callq 0x2170
movq 0x29676(%rip), %rax     # 0x2efc8
movq (%rax), %rdi
movl $0x1, %esi
callq 0x59a0
movq 0x29a02(%rip), %rsi     # 0x2f368
movl $0xa, %edi
callq 0x2130
movq 0x29a19(%rip), %rdi     # 0x2f390
callq 0x1d110
callq 0x1a570
movl $0xcff, -0x44(%rbp)     # imm = 0xCFF
leaq -0x50(%rbp), %rdi
callq 0x28660
xorl %edi, %edi
callq 0x2230
nopl (%rax,%rax)