// File: /workspace/github_c_makefile_star2_O1/dalnefre[P]kernel_abe/schemer.c
// Function: eval_beh
BEH_DECL(eval_beh)
{
	CONS* p;
	CONS* state;
	CONS* msg;
	CONS* a;

	DBUG_ENTER("eval_beh");
	if (is_pair(WHAT) && is_pair(p = pr_tail(WHAT))) {
		CONS* to = pr_head(WHAT);
		CONS* expr = pr_head(p);
		CONS* env = pr_tail(p);

		DBUG_PRINT("", ("expr = %s", cons_to_str(expr)));
		if (is_const(expr)) {
			DBUG_PRINT("", ("constant"));
			SEND(to, expr);
		} else if (is_actor(expr)) {
			DBUG_PRINT("", ("actor"));
			SEND(to, expr);
		} else if (is_symbol(expr)) {
			DBUG_PRINT("", ("symbol"));
			msg = mk_empty();
			msg = mk_list(expr, msg);
			msg = mk_list(ATOM("get"), msg);
			msg = mk_pair(msg, env);
			msg = mk_pair(to, msg);
			SEND(env, msg);
		} else if (is_pair(expr)) {
			DBUG_PRINT("", ("combination"));
			state = mk_pair(pr_tail(expr), env);
			state = mk_pair(to, state);
			a = ACTOR(apply_beh, state);
			msg = mk_pair(pr_head(expr), env);
			msg = mk_pair(a, msg);
			SEND(SELF, msg);
		} else {
			DBUG_PRINT("", ("unknown"));
			msg = mk_list(expr, mk_empty());
			msg = mk_list(ATOM("unknown-expr"), msg);
			FAIL(env, msg);
		}
	} else {
		DBUG_PRINT("", ("Ignored! %s", cons_to_str(WHAT)));
		abort();
	}
	DBUG_RETURN;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x13abd(%rip), %rax     # 0x1839e
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x1aa30(%rip), %r12     # 0x1f320
movq (%r12), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x2a0, 0xc(%rdi)       # imm = 0x2A0
leaq 0x160d4(%rip), %r13     # 0x1a9e0
movq %r13, 0x10(%rdi)
leaq 0x1a829(%rip), %rcx     # 0x1f140
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0x16ef2
movq 0x30(%rbx), %rdi
callq 0x15225
testq %rax, %rax
je 0x4d44
movq 0x30(%rbx), %rdi
callq 0x15225
testb $0x3, %al
jne 0x4d44
movq 0x30(%rbx), %rdi
callq 0x15225
cmpq 0x1a669(%rip), %rax     # 0x1efc0
je 0x4d44
movq 0x30(%rbx), %rdi
callq 0x15225
movq %rax, %rdi
callq 0x15225
testq %rax, %rax
je 0x4d44
movq 0x30(%rbx), %rdi
callq 0x15225
movq %rax, %rdi
callq 0x15225
testb $0x3, %al
jne 0x4d44
movq 0x30(%rbx), %rdi
callq 0x15225
movq %rax, %rdi
callq 0x15225
cmpq 0x1a618(%rip), %rax     # 0x1efc0
je 0x4d44
movq %rax, %r14
movq 0x30(%rbx), %rdi
callq 0x15225
movq %rax, %rdi
callq 0x15186
movq %rax, (%rsp)
movq %r14, %rdi
callq 0x15186
movq %rax, %rbp
movq %r14, %rdi
callq 0x15225
movq %rax, 0x8(%rsp)
leaq 0x1af0b(%rip), %r14     # 0x1f8f0
cmpl $0x0, (%r14)
je 0x4a2b
movq (%r12), %rax
movq 0x50(%rax), %rax
movq %r13, 0x10(%rax)
movq %r13, %rdi
callq 0x16664
testl %eax, %eax
je 0x4a2b
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x2a6, 0xc(%rax)       # imm = 0x2A6
movq %rbp, %rdi
callq 0xf17c
leaq 0x136cb(%rip), %rdi     # 0x180ec
movq %rax, %rsi
xorl %eax, %eax
callq 0x16f63
cmpq 0x1a58e(%rip), %rbp     # 0x1efc0
je 0x4ab0
movl %ebp, %r15d
andl $0x3, %r15d
cmpq $0x3, %r15
je 0x4ab0
movl $0x1, %edi
callq 0x3d66
cmpq %rax, %rbp
je 0x4ab0
xorl %edi, %edi
callq 0x3d66
cmpq %rax, %rbp
je 0x4ab0
callq 0xd26a
cmpq %rax, %rbp
je 0x4ab0
cmpl $0x2, %r15d
je 0x4b1a
cmpl $0x1, %r15d
jne 0x4bb6
cmpl $0x0, (%r14)
je 0x4aeb
movq (%r12), %rax
movq 0x50(%rax), %rax
movq %r13, 0x10(%rax)
movq %r13, %rdi
callq 0x16664
testl %eax, %eax
je 0x4aeb
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x2ab, 0xc(%rax)       # imm = 0x2AB
leaq 0x153f0(%rip), %rdi     # 0x19e9e
jmp 0x4ae4
cmpl $0x0, (%r14)
je 0x4aeb
movq (%r12), %rax
movq 0x50(%rax), %rax
movq %r13, 0x10(%rax)
movq %r13, %rdi
callq 0x16664
testl %eax, %eax
je 0x4aeb
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x2a8, 0xc(%rax)       # imm = 0x2A8
leaq 0x13718(%rip), %rdi     # 0x181fc
xorl %eax, %eax
callq 0x16f63
movq %rbx, %rdi
movq (%rsp), %rsi
movq %rbp, %rdx
callq 0xdef7
leaq 0x10(%rsp), %rdi
movl $0x2c7, 0xc(%rdi)       # imm = 0x2C7
callq 0x17077
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
callq 0x3d66
cmpq %rax, %rbp
je 0x4bb6
xorl %edi, %edi
callq 0x3d66
cmpq %rax, %rbp
je 0x4bb6
cmpl $0x0, (%r14)
je 0x4b74
movq (%r12), %rax
movq 0x50(%rax), %rax
movq %r13, 0x10(%rax)
movq %r13, %rdi
callq 0x16664
testl %eax, %eax
je 0x4b74
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x2ae, 0xc(%rax)       # imm = 0x2AE
leaq 0x13599(%rip), %rdi     # 0x18106
xorl %eax, %eax
callq 0x16f63
leaq 0x1a715(%rip), %rsi     # 0x1f290
movq %rbp, %rdi
callq 0x15164
movq %rax, %r15
leaq 0x134fd(%rip), %rdi     # 0x1808a
callq 0x1265c
movq %rax, %rdi
movq %r15, %rsi
callq 0x15164
movq %rax, %rdi
movq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x15164
movq (%rsp), %rdi
jmp 0x4c84
testq %rbp, %rbp
sete %al
testq %r15, %r15
setne %cl
orb %al, %cl
movl (%r14), %eax
je 0x4c9a
testl %eax, %eax
je 0x4c06
movq (%r12), %rax
movq 0x50(%rax), %rax
movq %r13, 0x10(%rax)
movq %r13, %rdi
callq 0x16664
testl %eax, %eax
je 0x4c06
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x2be, 0xc(%rax)       # imm = 0x2BE
leaq 0x134f7(%rip), %rdi     # 0x180f6
xorl %eax, %eax
callq 0x16f63
leaq 0x1a683(%rip), %r12     # 0x1f290
movq %rbp, %rdi
movq %r12, %rsi
callq 0x15164
movq %rax, %r15
leaq 0x135ef(%rip), %rdi     # 0x18211
callq 0x1265c
movq %rax, %rdi
movq %r15, %rsi
callq 0x15164
leaq -0x2161(%rip), %rsi     # 0x2ad8
movq %rbx, %rdi
movq %rax, %rdx
callq 0xde1a
movq %rax, %r15
leaq 0x1343c(%rip), %rdi     # 0x1808a
callq 0x1265c
movq %rax, %r13
callq 0xd26a
movq %rax, %rdi
movq %r12, %rsi
callq 0x15164
movq %r13, %rdi
movq %rax, %rsi
callq 0x15164
movq %rax, %rdi
movq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x15164
movq %r15, %rdi
movq %rax, %rsi
callq 0x15164
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
jmp 0x4af5
testl %eax, %eax
je 0x4cd3
movq (%r12), %rax
movq 0x50(%rax), %rax
movq %r13, 0x10(%rax)
movq %r13, %rdi
callq 0x16664
testl %eax, %eax
je 0x4cd3
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x2b6, 0xc(%rax)       # imm = 0x2B6
leaq 0x13539(%rip), %rdi     # 0x18205
xorl %eax, %eax
callq 0x16f63
movq %rbp, %rdi
callq 0x15225
movq %rax, %rdi
movq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x15164
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x15164
leaq -0x2122(%rip), %rsi     # 0x2bdc
movq %rbx, %rdi
movq %rax, %rdx
callq 0xde1a
movq %rax, %r12
movq %rbp, %rdi
callq 0x15186
movq %rax, %rdi
movq %r14, %rsi
callq 0x15164
movq %r12, %rdi
movq %rax, %rsi
callq 0x15164
movq %rax, %r14
movq 0x30(%rbx), %rdi
callq 0x15186
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
jmp 0x4af5
leaq 0x1aba5(%rip), %rax     # 0x1f8f0
cmpl $0x0, (%rax)
je 0x4d99
movq (%r12), %rax
movq 0x50(%rax), %rax
movq %r13, 0x10(%rax)
movq %r13, %rdi
callq 0x16664
testl %eax, %eax
je 0x4d99
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x2c4, 0xc(%rax)       # imm = 0x2C4
movq 0x30(%rbx), %rdi
callq 0x15225
movq %rax, %rdi
callq 0xf17c
leaq 0x132d1(%rip), %rdi     # 0x18060
movq %rax, %rsi
xorl %eax, %eax
callq 0x16f63
callq 0x2050