// File: /workspace/github_c_makefile_star2_O1/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 0xb745(%rip), %rax      # 0xe0ca
movq %rsp, %rdi
movq %rax, (%rdi)
leaq 0x1097e(%rip), %r13     # 0x13310
movq (%r13), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x72, 0xc(%rdi)
leaq 0xd4fe(%rip), %rcx      # 0xfeac
movq %rcx, 0x10(%rdi)
leaq 0x10777(%rip), %rcx     # 0x13130
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xd826
movq (%r13), %rax
movq 0x18(%rax), %rcx
movq 0x10623(%rip), %rdx     # 0x12ff8
testq %rcx, %rcx
jne 0x29dd
movq (%rdx), %rcx
movq %rcx, 0x18(%rax)
callq 0x20c0
movq (%r13), %rcx
movl %eax, 0x10(%rcx)
movq (%r14), %rax
movq %rax, 0x8(%rcx)
movl $0x5, %r15d
leaq 0xb6ce(%rip), %r12      # 0xe0cf
movq 0x105d0(%rip), %rbx     # 0x12fd8
movl %ebp, %edi
movq %r14, %rsi
movq %r12, %rdx
callq 0x21c0
cmpl $0x72, %eax
jle 0x2a35
cmpl $0x73, %eax
je 0x2a58
cmpl $0x74, %eax
jne 0x2c81
movq $0x1, 0x10925(%rip) # 0x13358
jmp 0x2a08
cmpl $0x3e, %eax
jg 0x2a65
cmpl $0x23, %eax
jne 0x2a93
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x79, 0xc(%rax)
movq (%rbx), %rdi
callq 0xd0f5
jmp 0x2a08
movq $0x1, 0x108fd(%rip) # 0x13360
jmp 0x2a08
cmpl $0x6e, %eax
jne 0x2a77
movq (%rbx), %rdi
callq 0x21e0
movl %eax, %r15d
jmp 0x2a08
cmpl $0x3f, %eax
je 0x2c81
cmpl $0x56, %eax
jne 0x2c81
callq 0x2948
jmp 0x2c7a
cmpl $-0x1, %eax
jne 0x2c81
leaq 0xb619(%rip), %rdi      # 0xe0bc
leaq 0x10696(%rip), %rsi     # 0x13140
leaq 0x10693(%rip), %rdx     # 0x13144
leaq 0x10698(%rip), %rcx     # 0x13150
xorl %eax, %eax
callq 0x20f0
cmpq $0x0, 0x10891(%rip)     # 0x13358
jne 0x2caa
cmpq $0x0, 0x1088b(%rip)     # 0x13360
je 0x2c66
movl $0x64, %edi
callq 0x4073
movq %rax, %r14
xorl %eax, %eax
callq 0x2d04
movq %r14, %rdi
callq 0x3a9a
movq %r14, %rdi
movl %r15d, %esi
callq 0x37cb
leaq 0x10db7(%rip), %r12     # 0x138c0
cmpl $0x0, (%r12)
je 0x2b49
movq (%r13), %rax
movq 0x50(%rax), %rax
leaq 0xd38d(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcf98
testl %eax, %eax
je 0x2b49
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x92, 0xc(%rax)
leaq 0xb5ab(%rip), %rdi      # 0xe0ed
xorl %eax, %eax
callq 0xd897
leaq 0xb5a7(%rip), %rdi      # 0xe0f7
movl $0x64, %esi
movl $0xf4240, %edx          # imm = 0xF4240
xorl %eax, %eax
callq 0x20f0
leaq 0x10800(%rip), %rbx     # 0x13368
movq $0x0, (%rbx)
leaq 0xb5b3(%rip), %r15      # 0xe129
movq %r14, %rdi
movl $0xf4240, %esi          # imm = 0xF4240
callq 0x4e73
movl %eax, %ebp
movl 0x28(%r14), %esi
testl %esi, %esi
jle 0x2b99
movq %r15, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x20f0
cmpl $0x0, 0x68(%r14)
jle 0x2baa
movl $0x186a0, %edi          # imm = 0x186A0
callq 0x2230
movl 0x28(%r14), %eax
cmpl 0x40(%r14), %eax
jge 0x2bba
cmpq $0x0, (%rbx)
je 0x2b76
cmpl $0x0, (%r12)
je 0x2c1e
movq (%r13), %rax
movq 0x50(%rax), %rax
leaq 0xd2dc(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcf98
testl %eax, %eax
je 0x2c1e
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, (%rbx)
leaq 0xca40(%rip), %rax      # 0xf643
leaq 0xca03(%rip), %r9       # 0xf60d
cmoveq %rax, %r9
leaq 0xb53e(%rip), %rdi      # 0xe153
movl %ebp, %esi
xorl %eax, %eax
callq 0xd897
cmpl $0x0, (%r12)
je 0x2c5e
movq (%r13), %rax
movq 0x50(%rax), %rax
leaq 0xd278(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcf98
testl %eax, %eax
je 0x2c5e
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0xa0, 0xc(%rax)
leaq 0xb531(%rip), %rdi      # 0xe188
xorl %eax, %eax
callq 0xd897
movq %r14, %rdi
callq 0x59ef
callq 0x290e
movq %rsp, %rdi
movl $0xa4, 0xc(%rdi)
callq 0xd9ab
xorl %edi, %edi
callq 0x2200
movq 0x10370(%rip), %rax     # 0x12ff8
movq (%rax), %rdi
leaq 0xb3f7(%rip), %rsi      # 0xe089
leaq 0x104a7(%rip), %rdx     # 0x13140
xorl %eax, %eax
callq 0x2170
movl $0x1, %edi
callq 0x2200
leaq 0x10c0f(%rip), %rax     # 0x138c0
cmpl $0x0, (%rax)
je 0x2cfd
movq (%r13), %rax
movq 0x50(%rax), %rax
leaq 0xd1e7(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcf98
testl %eax, %eax
je 0x2cfd
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x81, 0xc(%rax)
leaq 0xb3ef(%rip), %rdi      # 0xe0d7
leaq 0x8d99(%rip), %rsi      # 0xba88
leaq -0x38b(%rip), %rdx      # 0x296b
xorl %eax, %eax
callq 0xd897
callq 0x274c
nop