// File: /workspace/github_c_makefile_star2_O2/dalnefre[P]kernel_abe/schemer.c
// Function: eval_define_beh
BEH_DECL(eval_define_beh)
{
	CONS* p;
	CONS* state;
	CONS* msg;
	CONS* a;

	DBUG_ENTER("eval_define_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);
		CONS* form = is_pair(expr) ? lst_first(expr) : NIL;

		DBUG_PRINT("", ("form = %s", cons_to_str(form)));
		if (is_symbol(form)) {
			DBUG_PRINT("", ("symbol"));
			state = mk_pair(form, env);
			state = mk_pair(to, state);
			a = ACTOR(apply_define_beh, state);
			DBUG_PRINT("", ("expr = %s", cons_to_str(lst_second(expr))));
			msg = mk_pair(lst_second(expr), env);
			msg = mk_pair(a, msg);
			SEND(eval__actor, msg);
		} else if (is_pair(form)) {
			CONS* name = lst_first(form);
			CONS* vars = lst_rest(form);
			CONS* body = lst_rest(expr);
			
			DBUG_PRINT("", ("lambda"));
			DBUG_PRINT("", ("name = %s", cons_to_str(name)));
			DBUG_PRINT("", ("vars = %s", cons_to_str(vars)));
			DBUG_PRINT("", ("body = %s", cons_to_str(body)));
			state = mk_pair(vars, body);
			state = mk_pair(state, env);
			a = ACTOR(lambda_beh, state);
			msg = mk_empty();
			msg = mk_list(a, msg);
			msg = mk_list(name, msg);
			msg = mk_list(ATOM("define"), msg);
			msg = mk_pair(msg, env);
			msg = mk_pair(to, msg);
			SEND(env, msg);
		} else {
			DBUG_PRINT("", ("error"));
			msg = mk_list(ATOM("define"), expr);
			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 0x1206d(%rip), %rax     # 0x17270
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x1910e(%rip), %r12     # 0x1e320
movq (%r12), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x367, 0xc(%rdi)       # imm = 0x367
leaq 0x1478e(%rip), %rcx     # 0x199bc
movq %rcx, 0x10(%rdi)
leaq 0x18f07(%rip), %rcx     # 0x1e140
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0x16679
movq 0x30(%rbx), %rdi
callq 0x14906
testq %rax, %rax
je 0x5791
movq 0x30(%rbx), %rdi
callq 0x14906
testb $0x3, %al
jne 0x5791
movq 0x30(%rbx), %rdi
callq 0x14906
cmpq 0x18d47(%rip), %rax     # 0x1dfc0
je 0x5791
movq 0x30(%rbx), %rdi
callq 0x14906
movq %rax, %rdi
callq 0x14906
testq %rax, %rax
je 0x5791
movq 0x30(%rbx), %rdi
callq 0x14906
movq %rax, %rdi
callq 0x14906
testb $0x3, %al
jne 0x5791
movq 0x30(%rbx), %rdi
callq 0x14906
movq %rax, %rdi
callq 0x14906
cmpq 0x18cf6(%rip), %rax     # 0x1dfc0
je 0x5791
movq %rax, %r14
movq 0x30(%rbx), %rdi
callq 0x14906
movq %rax, %rdi
callq 0x147fb
movq %rax, %rbp
movq %r14, %rdi
callq 0x147fb
movq %rax, %r13
movq %r14, %rdi
callq 0x14906
movq %rax, %r14
leaq 0x18f8c(%rip), %r15     # 0x1e290
cmpq %r15, %r13
movq %rbp, 0x8(%rsp)
je 0x5326
testq %r13, %r13
je 0x5326
movl %r13d, %eax
andl $0x3, %eax
jne 0x5326
movq %r13, %rdi
callq 0x147fb
movq %rax, %r15
leaq 0x195c3(%rip), %rbp     # 0x1e8f0
cmpl $0x0, (%rbp)
je 0x5377
movq (%r12), %rax
movq 0x50(%rax), %rax
leaq 0x1467a(%rip), %rdi     # 0x199bc
movq %rdi, 0x10(%rax)
callq 0x15df4
testl %eax, %eax
je 0x5377
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x36e, 0xc(%rax)       # imm = 0x36E
movq %r15, %rdi
callq 0xed08
leaq 0x11e77(%rip), %rdi     # 0x171e4
movq %rax, %rsi
xorl %eax, %eax
callq 0x166f0
movl %r15d, %r12d
andl $0x3, %r12d
cmpq $0x2, %r12
jne 0x54b7
pushq $0x1
popq %rdi
callq 0x38f6
cmpq %rax, %r15
je 0x54b7
xorl %edi, %edi
callq 0x38f6
cmpq %rax, %r15
je 0x54b7
cmpl $0x0, (%rbp)
leaq 0x18f6c(%rip), %r12     # 0x1e320
je 0x53ef
movq (%r12), %rax
movq 0x50(%rax), %rax
leaq 0x145f7(%rip), %rdi     # 0x199bc
movq %rdi, 0x10(%rax)
callq 0x15df4
testl %eax, %eax
je 0x53ef
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x370, 0xc(%rax)       # imm = 0x370
leaq 0x11d1e(%rip), %rdi     # 0x17106
xorl %eax, %eax
callq 0x166f0
movq %r15, %rdi
movq %r14, %rsi
callq 0x14764
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x14764
leaq -0x3db(%rip), %rsi      # 0x5033
movq %rbx, %rdi
movq %rax, %rdx
callq 0xd9b7
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x5482
leaq 0x18ef7(%rip), %rax     # 0x1e320
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x14585(%rip), %rdi     # 0x199bc
movq %rdi, 0x10(%rax)
callq 0x15df4
testl %eax, %eax
je 0x5482
leaq 0x18ed5(%rip), %rax     # 0x1e320
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x374, 0xc(%rax)       # imm = 0x374
movq %r13, %rdi
callq 0x14906
movq %rax, %rdi
callq 0x147fb
movq %rax, %rdi
callq 0xed08
leaq 0x11c74(%rip), %rdi     # 0x170ec
movq %rax, %rsi
xorl %eax, %eax
callq 0x166f0
movq %r13, %rdi
callq 0x14906
movq %rax, %rdi
callq 0x147fb
movq %rax, %rdi
movq %r14, %rsi
callq 0x14764
movq %r12, %rdi
movq %rax, %rsi
callq 0x14764
movq 0x18ec9(%rip), %rsi     # 0x1e378
movq %rbx, %rdi
jmp 0x5769
cmpq 0x18b02(%rip), %r15     # 0x1dfc0
je 0x56af
testq %r15, %r15
je 0x56af
testq %r12, %r12
jne 0x56af
movq %r15, %rdi
callq 0x147fb
movq %rax, (%rsp)
movq %r15, %rdi
callq 0x14906
movq %rax, %r12
movq %r13, %rdi
callq 0x14906
movq %rax, %r13
cmpl $0x0, (%rbp)
je 0x563d
leaq 0x18e17(%rip), %r15     # 0x1e320
movq (%r15), %rax
movq 0x50(%rax), %rax
leaq 0x144a5(%rip), %rdi     # 0x199bc
movq %rdi, 0x10(%rax)
callq 0x15df4
testl %eax, %eax
je 0x5540
movq (%r15), %rax
movq 0x50(%rax), %rax
movl $0x37d, 0xc(%rax)       # imm = 0x37D
leaq 0x11d47(%rip), %rdi     # 0x17280
xorl %eax, %eax
callq 0x166f0
cmpl $0x0, (%rbp)
je 0x563d
leaq 0x18dcf(%rip), %r15     # 0x1e320
movq (%r15), %rax
movq 0x50(%rax), %rax
leaq 0x1445d(%rip), %rdi     # 0x199bc
movq %rdi, 0x10(%rax)
callq 0x15df4
testl %eax, %eax
je 0x5594
movq (%r15), %rax
movq 0x50(%rax), %rax
movl $0x37e, 0xc(%rax)       # imm = 0x37E
movq (%rsp), %rdi
callq 0xed08
leaq 0x11b10(%rip), %rdi     # 0x1709a
movq %rax, %rsi
xorl %eax, %eax
callq 0x166f0
cmpl $0x0, (%rbp)
je 0x563d
leaq 0x18d7b(%rip), %r15     # 0x1e320
movq (%r15), %rax
movq 0x50(%rax), %rax
leaq 0x14409(%rip), %rdi     # 0x199bc
movq %rdi, 0x10(%rax)
callq 0x15df4
testl %eax, %eax
je 0x55e7
movq (%r15), %rax
movq 0x50(%rax), %rax
movl $0x37f, 0xc(%rax)       # imm = 0x37F
movq %r12, %rdi
callq 0xed08
leaq 0x11b4b(%rip), %rdi     # 0x17128
movq %rax, %rsi
xorl %eax, %eax
callq 0x166f0
cmpl $0x0, (%rbp)
je 0x563d
leaq 0x18d2c(%rip), %rax     # 0x1e320
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x143ba(%rip), %rdi     # 0x199bc
movq %rdi, 0x10(%rax)
callq 0x15df4
testl %eax, %eax
je 0x563d
leaq 0x18d0a(%rip), %rax     # 0x1e320
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x380, 0xc(%rax)       # imm = 0x380
movq %r13, %rdi
callq 0xed08
leaq 0x11aff(%rip), %rdi     # 0x17132
movq %rax, %rsi
xorl %eax, %eax
callq 0x166f0
movq %r12, %rdi
movq %r13, %rsi
callq 0x14764
movq %rax, %rdi
movq %r14, %rsi
callq 0x14764
leaq -0x1cf5(%rip), %rsi     # 0x3965
movq %rbx, %rdi
movq %rax, %rdx
callq 0xd9b7
leaq 0x18c24(%rip), %rsi     # 0x1e290
movq %rax, %rdi
callq 0x14764
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x14764
movq %rax, %r15
leaq 0x11a25(%rip), %rdi     # 0x170af
callq 0x11f1f
movq %rax, %rdi
movq %r15, %rsi
callq 0x14764
movq %rax, %rdi
movq %r14, %rsi
callq 0x14764
movq 0x8(%rsp), %rdi
jmp 0x575b
cmpl $0x0, (%rbp)
leaq 0x18c66(%rip), %r15     # 0x1e320
je 0x56f3
movq (%r15), %rax
movq 0x50(%rax), %rax
leaq 0x142f2(%rip), %rdi     # 0x199bc
movq %rdi, 0x10(%rax)
callq 0x15df4
testl %eax, %eax
je 0x56f3
movq (%r15), %rax
movq 0x50(%rax), %rax
movl $0x38c, 0xc(%rax)       # imm = 0x38C
leaq 0x11b41(%rip), %rdi     # 0x1722d
xorl %eax, %eax
callq 0x166f0
leaq 0x119b5(%rip), %rdi     # 0x170af
callq 0x11f1f
movq %rax, %rdi
movq %r13, %rsi
callq 0x14764
leaq -0x3039(%rip), %rsi     # 0x26d8
movq %rbx, %rdi
movq %rax, %rdx
callq 0xd9b7
movq %rax, %r15
leaq 0x11964(%rip), %rdi     # 0x1708a
callq 0x11f1f
movq %rax, %r12
callq 0xccde
leaq 0x18b56(%rip), %rsi     # 0x1e290
movq %rax, %rdi
callq 0x14764
movq %r12, %rdi
movq %rax, %rsi
callq 0x14764
movq %rax, %rdi
movq %r14, %rsi
callq 0x14764
movq %r15, %rdi
movq %rax, %rsi
callq 0x14764
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xda94
leaq 0x10(%rsp), %rdi
movl $0x394, 0xc(%rdi)       # imm = 0x394
callq 0x167f2
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19158(%rip), %rax     # 0x1e8f0
cmpl $0x0, (%rax)
je 0x57f6
leaq 0x18b7c(%rip), %rax     # 0x1e320
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x1420a(%rip), %rdi     # 0x199bc
movq %rdi, 0x10(%rax)
callq 0x15df4
testl %eax, %eax
je 0x57f6
leaq 0x18b5a(%rip), %rax     # 0x1e320
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x391, 0xc(%rax)       # imm = 0x391
movq 0x30(%rbx), %rdi
callq 0x14906
movq %rax, %rdi
callq 0xed08
leaq 0x11874(%rip), %rdi     # 0x17060
movq %rax, %rsi
xorl %eax, %eax
callq 0x166f0
callq 0x2050