// File: /workspace/github_c_makefile_star2_O0/dalnefre[P]kernel_abe/actor.c
// Function: abe__dispatch
static BOOL
abe__dispatch(CONFIG* cfg)
/*
 * Dispatch a single message/event.
 *
 * returns: TRUE on success, FALSE if there are no pending messages
 */
{
	CONS* cq = CONFIG_QUEUE(cfg);

	DBUG_ENTER("dispatch");
	DBUG_PRINT("", ("%d message(s) queued", cfg->q_count));
	XDBUG_PRINT("", ("cq = %s", cons_to_str(cq)));
	if (!CQ_EMPTY(cq)) {
		CONS* node = CQ_PEEK(cq);
		CONS* entry = car(node);
		CONS* actor;
		CONS* msg;
		BEH beh;

		XDBUG_PRINT("", ("entry=%s", cons_to_str(entry)));
		CQ_POP(CONFIG_QUEUE(cfg));
		node = cq_free(node);
		XDBUG_PRINT("", ("entry=%s", cons_to_str(entry)));
		assert(consp(entry));
		actor = car(entry);
		assert(actorp(actor));
		beh = _THIS(actor);
		msg = cdr(entry);
		--cfg->q_count;
		DBUG_PRINT("", ("actor=%s", cons_to_str(actor)));
		DBUG_PRINT("", ("msg=%s", cons_to_str(msg)));
		cfg->q_entry = entry;
		(*beh)(cfg);			/* call actor behavior to handle message */
		cfg->q_entry = NIL;
		entry = cq_free(entry);
		if (++cfg->msg_cnt_lo < 0) {
			++cfg->msg_cnt_hi;
			cfg->msg_cnt_lo = 0;
		}
		DBUG_RETURN TRUE;
	}
	DBUG_PRINT("", ("message queue empty."));
	DBUG_RETURN FALSE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
leaq 0xd91d(%rip), %rax      # 0x2a09b
movq %rax, -0x40(%rbp)
leaq 0x12b97(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x38(%rbp)
movl $0x1b0, -0x34(%rbp)     # imm = 0x1B0
leaq 0xcbcb(%rip), %rax      # 0x2936f
movq %rax, -0x30(%rbp)
leaq 0x129e9(%rip), %rax     # 0x2f198
movq %rax, -0x28(%rbp)
leaq 0x12b66(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x20(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x28490
leaq 0x1314b(%rip), %rax     # 0x2f920
cmpl $0x0, (%rax)
je 0x1c82e
leaq 0x12b3f(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0xcb80(%rip), %rcx      # 0x2936f
movq %rcx, 0x10(%rax)
leaq 0xcb75(%rip), %rdi      # 0x2936f
callq 0x278a0
cmpl $0x0, %eax
je 0x1c82e
leaq 0x12b15(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x1b1, 0xc(%rax)       # imm = 0x1B1
movq -0x10(%rbp), %rax
movl 0x28(%rax), %esi
leaq 0xd58f(%rip), %rdi      # 0x29db6
movb $0x0, %al
callq 0x28540
jmp 0x1c830
movq -0x18(%rbp), %rdi
callq 0x25380
leaq 0x12a50(%rip), %rcx     # 0x2f290
cmpq %rcx, %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
jne 0x1caaa
movq -0x18(%rbp), %rdi
callq 0x25380
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0x25380
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rdi
callq 0x25380
movq %rax, %rdi
callq 0x25510
movq -0x78(%rbp), %rdi
movq %rax, %rsi
callq 0x256a0
movq -0x48(%rbp), %rdi
callq 0x1d150
movq %rax, -0x48(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x50(%rbp)
movb %al, -0x69(%rbp)
je 0x1c8c1
movq -0x50(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
sete %al
movb %al, -0x69(%rbp)
movb -0x69(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x1c8d3
jmp 0x1c8f2
leaq 0xd7ca(%rip), %rdi      # 0x2a0a4
leaq 0xd30c(%rip), %rsi      # 0x29bed
movl $0x1be, %edx            # imm = 0x1BE
leaq 0xd7c4(%rip), %rcx      # 0x2a0b1
callq 0x2100
movq -0x50(%rbp), %rdi
callq 0x25380
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
andq $0x3, %rax
cmpq $0x1, %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x1c91d
jmp 0x1c93c
leaq 0xd7aa(%rip), %rdi      # 0x2a0ce
leaq 0xd2c2(%rip), %rsi      # 0x29bed
movl $0x1c0, %edx            # imm = 0x1C0
leaq 0xd77a(%rip), %rcx      # 0x2a0b1
callq 0x2100
movq -0x58(%rbp), %rdi
callq 0x1a590
movq %rax, -0x68(%rbp)
movq -0x50(%rbp), %rdi
callq 0x25510
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movl 0x28(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x28(%rax)
leaq 0x12fb6(%rip), %rax     # 0x2f920
cmpl $0x0, (%rax)
je 0x1c9c8
leaq 0x129aa(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0xc9eb(%rip), %rcx      # 0x2936f
movq %rcx, 0x10(%rax)
leaq 0xc9e0(%rip), %rdi      # 0x2936f
callq 0x278a0
cmpl $0x0, %eax
je 0x1c9c8
leaq 0x12980(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x1c4, 0xc(%rax)       # imm = 0x1C4
movq -0x58(%rbp), %rdi
callq 0x1d250
movq %rax, %rsi
leaq 0xd368(%rip), %rdi      # 0x29d29
movb $0x0, %al
callq 0x28540
jmp 0x1c9ca
jmp 0x1c9cc
leaq 0x12f4d(%rip), %rax     # 0x2f920
cmpl $0x0, (%rax)
je 0x1ca31
leaq 0x12941(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0xc982(%rip), %rcx      # 0x2936f
movq %rcx, 0x10(%rax)
leaq 0xc977(%rip), %rdi      # 0x2936f
callq 0x278a0
cmpl $0x0, %eax
je 0x1ca31
leaq 0x12917(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x1c5, 0xc(%rax)       # imm = 0x1C5
movq -0x60(%rbp), %rdi
callq 0x1d250
movq %rax, %rsi
leaq 0xd385(%rip), %rdi      # 0x29daf
movb $0x0, %al
callq 0x28540
jmp 0x1ca33
movq -0x50(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x68(%rbp), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movq -0x10(%rbp), %rax
leaq 0x1283c(%rip), %rcx     # 0x2f290
movq %rcx, 0x30(%rax)
movq -0x50(%rbp), %rdi
callq 0x1d150
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rcx
movl 0x3c(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rcx)
cmpl $0x0, %eax
jge 0x1ca8f
movq -0x10(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x38(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x3c(%rax)
movl $0x1ce, -0x34(%rbp)     # imm = 0x1CE
leaq -0x40(%rbp), %rdi
callq 0x28660
movl $0x1, %eax
movq %rax, -0x8(%rbp)
jmp 0x1cb1f
jmp 0x1caac
leaq 0x12e6d(%rip), %rax     # 0x2f920
cmpl $0x0, (%rax)
je 0x1cb05
leaq 0x12861(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0xc8a2(%rip), %rcx      # 0x2936f
movq %rcx, 0x10(%rax)
leaq 0xc897(%rip), %rdi      # 0x2936f
callq 0x278a0
cmpl $0x0, %eax
je 0x1cb05
leaq 0x12837(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x1d0, 0xc(%rax)       # imm = 0x1D0
leaq 0xd5de(%rip), %rdi      # 0x2a0dc
movb $0x0, %al
callq 0x28540
jmp 0x1cb07
movl $0x1d1, -0x34(%rbp)     # imm = 0x1D1
leaq -0x40(%rbp), %rdi
callq 0x28660
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)