// File: /workspace/github_c_makefile_star2_O2/dalnefre[P]kernel_abe/abe.c
// Function: main
int
main(int argc, char** argv)
{
	int c;
	int	counter = 5;			/* default 5 second counter for ticker */

	DBUG_ENTER("main");
	DBUG_PROCESS(argv[0]);
	while ((c = getopt(argc, argv, "tsn:#:V")) != EOF) {
		switch(c) {
		case 't':	test_mode = TRUE;		break;
		case 's':	init_sample = TRUE;		break;
		case 'n':	counter = atoi(optarg);	break;
		case '#':	DBUG_PUSH(optarg);		break;
		case 'V':	banner();				exit(EXIT_SUCCESS);
		case '?':							usage();
		default:							usage();
		}
	}
	banner();
	if (test_mode) {
		DBUG_PRINT("", ("_nilp()@%p, main()@%p", _nilp, main));
		test_pre();
		test_number();
		test_gc();
		test_cons();
		test_atom();
		test_emit();
	}
	if (init_sample) {
		int limit = 100;
		int	budget = 1000000;
		int n;
		CONFIG* cfg = new_configuration(limit);

		tick_init();
		test_sample(cfg);
		start_ticker(cfg, counter);
		DBUG_PRINT("", ("--begin--"));
		TRACE(printf("sample running with %d queue limit and %d budget\n", limit, budget));
		sample_done = FALSE;
		do {
			n = run_configuration(cfg, budget);
			if (cfg->q_count > 0) {
				TRACE(printf("queue length %d with %d budget remaining\n", cfg->q_count, n));
			}
			if (cfg->t_count > 0) {
				usleep(TICK_FREQ / 10);	/* delayed messages pending... sleep for a while */
			}
		} while ((cfg->q_count < cfg->q_limit) && !sample_done);
		DBUG_PRINT("", ("n=%d q_count=%d q_limit=%d t_count=%d sample_done=%s",
			n, cfg->q_count, cfg->q_limit, cfg->t_count, (sample_done ? "TRUE" : "FALSE")));
		DBUG_PRINT("", ("--end--"));
		report_actor_usage(cfg);
	}
	report_cons_stats();
	DBUG_RETURN (exit(EXIT_SUCCESS), 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movl %edi, %ebp
leaq 0xbb4b(%rip), %rax      # 0xe0ca
movq %rsp, %rdi
movq %rax, (%rdi)
leaq 0x11d94(%rip), %r13     # 0x14320
movq (%r13), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x72, 0xc(%rdi)
leaq 0xd8e0(%rip), %rcx      # 0xfe88
movq %rcx, 0x10(%rdi)
leaq 0x11b8d(%rip), %rcx     # 0x14140
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xd0b9
movq (%r13), %rax
movq 0x18(%rax), %rcx
testq %rcx, %rcx
jne 0x25d7
movq 0x11a24(%rip), %rcx     # 0x13ff8
movq (%rcx), %rcx
movq %rcx, 0x18(%rax)
callq 0x20c0
movq (%r13), %rcx
movl %eax, 0x10(%rcx)
movq (%r14), %rax
movq %rax, 0x8(%rcx)
pushq $0x5
popq %r15
leaq 0xbad6(%rip), %r12      # 0xe0cf
movq 0x119d8(%rip), %rbx     # 0x13fd8
movl %ebp, %edi
movq %r14, %rsi
movq %r12, %rdx
callq 0x21d0
cmpl $0x23, %eax
je 0x2636
cmpl $0x73, %eax
je 0x2629
cmpl $0x74, %eax
jne 0x264f
movq $0x1, 0x11d41(%rip) # 0x14368
jmp 0x2600
movq $0x1, 0x11d3c(%rip) # 0x14370
jmp 0x2600
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x79, 0xc(%rax)
movq (%rbx), %rdi
callq 0xc98d
jmp 0x2600
cmpl $0x6e, %eax
jne 0x2661
movq (%rbx), %rdi
callq 0x21f0
movl %eax, %r15d
jmp 0x2600
cmpl $-0x1, %eax
je 0x267f
cmpl $0x3f, %eax
je 0x267a
cmpl $0x56, %eax
jne 0x267a
callq 0x2542
jmp 0x2839
callq 0x251a
callq 0x2542
cmpq $0x0, 0x11cdc(%rip)     # 0x14368
jne 0x2840
cmpq $0x0, 0x11cd6(%rip)     # 0x14370
je 0x2825
pushq $0x64
popq %rdi
callq 0x3d50
movq %rax, %r14
xorl %eax, %eax
callq 0x2898
movq %r14, %rdi
callq 0x3613
movq %r14, %rdi
movl %r15d, %esi
callq 0x3344
leaq 0x12204(%rip), %rbx     # 0x148d0
cmpl $0x0, (%rbx)
je 0x270a
movq (%r13), %rax
movq 0x50(%rax), %rax
leaq 0xd7a8(%rip), %rdi      # 0xfe88
movq %rdi, 0x10(%rax)
callq 0xc834
testl %eax, %eax
je 0x270a
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x92, 0xc(%rax)
leaq 0xb9ea(%rip), %rdi      # 0xe0ed
xorl %eax, %eax
callq 0xd130
leaq 0xb9e6(%rip), %rdi      # 0xe0f7
pushq $0x64
popq %rsi
movl $0xf4240, %edx          # imm = 0xF4240
xorl %eax, %eax
callq 0x20f0
leaq 0x11c51(%rip), %r12     # 0x14378
andq $0x0, (%r12)
leaq 0xb9f6(%rip), %r15      # 0xe129
movq %r14, %rdi
movl $0xf4240, %esi          # imm = 0xF4240
callq 0x4b27
movl %eax, %ebp
movl 0x28(%r14), %esi
testl %esi, %esi
jle 0x2756
movq %r15, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x20f0
cmpl $0x0, 0x68(%r14)
jle 0x2767
movl $0x186a0, %edi          # imm = 0x186A0
callq 0x2240
movl 0x28(%r14), %eax
cmpl 0x40(%r14), %eax
jge 0x2778
cmpq $0x0, (%r12)
je 0x2733
cmpl $0x0, (%rbx)
je 0x281d
movq (%r13), %rax
movq 0x50(%rax), %rax
leaq 0xd6f8(%rip), %rdi      # 0xfe88
movq %rdi, 0x10(%rax)
callq 0xc834
testl %eax, %eax
je 0x27df
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x9f, 0xc(%rax)
movl 0x28(%r14), %edx
movl 0x40(%r14), %ecx
movl 0x68(%r14), %r8d
cmpq $0x0, (%r12)
leaq 0xce5b(%rip), %rax      # 0xf61f
leaq 0xce1e(%rip), %r9       # 0xf5e9
cmoveq %rax, %r9
leaq 0xb97d(%rip), %rdi      # 0xe153
movl %ebp, %esi
xorl %eax, %eax
callq 0xd130
cmpl $0x0, (%rbx)
je 0x281d
movq (%r13), %rax
movq 0x50(%rax), %rax
leaq 0xd695(%rip), %rdi      # 0xfe88
movq %rdi, 0x10(%rax)
callq 0xc834
testl %eax, %eax
je 0x281d
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0xa0, 0xc(%rax)
leaq 0xb972(%rip), %rdi      # 0xe188
xorl %eax, %eax
callq 0xd130
movq %r14, %rdi
callq 0x5686
callq 0x250a
movq %rsp, %rdi
movl $0xa4, 0xc(%rdi)
callq 0xd232
xorl %edi, %edi
callq 0x2210
leaq 0x12089(%rip), %rax     # 0x148d0
cmpl $0x0, (%rax)
je 0x2893
movq (%r13), %rax
movq 0x50(%rax), %rax
leaq 0xd62d(%rip), %rdi      # 0xfe88
movq %rdi, 0x10(%rax)
callq 0xc834
testl %eax, %eax
je 0x2893
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x81, 0xc(%rax)
leaq 0xb859(%rip), %rdi      # 0xe0d7
leaq 0x890f(%rip), %rsi      # 0xb194
leaq -0x327(%rip), %rdx      # 0x2565
xorl %eax, %eax
callq 0xd130
callq 0x234c