// File: /workspace/github_c_makefile_star2_O0/dalnefre[P]kernel_abe/reduce.c
// Function: eval_become
BEH_DECL(eval_become)
{
	CONS* msg = WHAT;
	CONS* expr = map_get(msg, expr_symbol);
	CONS* state = MINE;
	CONS* cont = map_get(state, cont_symbol);
	CONS* env = map_get(state, env_symbol);
	CONS* actor;
	CONS* beh;
	
	DBUG_ENTER("eval_become");
	actor = map_get(env, self_symbol);
	DBUG_PRINT("", ("actor=%s", cons_to_str(actor)));
	if (actorp(actor) && (car(actor) == MK_FUNC(invoke_actor))) {
		beh = car(expr);
		if (actorp(beh)) {
			DBUG_PRINT("", ("beh=%s", cons_to_str(beh)));
			state = NIL;
			state = map_put(state, env_symbol, env);
			state = map_put(state, beh_symbol, beh);
			rplacd(actor, state);		/* replace actor state & behavior function */
			expr = actor;
			DBUG_PRINT("", ("actor'=%s", cons_to_str(expr)));
		} else {	/* error */
			SEND(an_error, ATOM("become: behavior required"));
			expr = undefined_symbol;
		}
	} else {	/* error */
		SEND(an_error, ATOM("become: self must be an actor"));
		expr = undefined_symbol;
	}
	SEND(cont, map_put(NIL, expr_symbol, expr));
	DBUG_RETURN;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x16990
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq 0x183fd(%rip), %rsi     # 0x20148
xorl %eax, %eax
movl %eax, %edx
callq 0x171b0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x16800
movq %rax, %rdi
callq 0xba80
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq 0x183c4(%rip), %rsi     # 0x20140
xorl %eax, %eax
movl %eax, %edx
callq 0x171b0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq 0x183c4(%rip), %rsi     # 0x20158
xorl %eax, %eax
movl %eax, %edx
callq 0x171b0
movq %rax, -0x30(%rbp)
leaq 0x126e6(%rip), %rax     # 0x1a48e
movq %rax, -0x68(%rbp)
leaq 0x185d5(%rip), %rax     # 0x20388
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x60(%rbp)
movl $0x494, -0x5c(%rbp)     # imm = 0x494
leaq 0x14ee2(%rip), %rax     # 0x1ccb0
movq %rax, -0x58(%rbp)
leaq 0x18357(%rip), %rax     # 0x20130
movq %rax, -0x50(%rbp)
leaq 0x185a4(%rip), %rax     # 0x20388
movq (%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x48(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x19910
movq -0x30(%rbp), %rdi
movq 0x1839d(%rip), %rsi     # 0x201a0
xorl %eax, %eax
movl %eax, %edx
callq 0x171b0
movq %rax, -0x38(%rbp)
leaq 0x18b19(%rip), %rax     # 0x20930
cmpl $0x0, (%rax)
je 0x7e75
leaq 0x18565(%rip), %rax     # 0x20388
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x14e7f(%rip), %rcx     # 0x1ccb0
movq %rcx, 0x10(%rax)
leaq 0x14e74(%rip), %rdi     # 0x1ccb0
callq 0x18d20
cmpl $0x0, %eax
je 0x7e75
leaq 0x1853b(%rip), %rax     # 0x20388
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x496, 0xc(%rax)       # imm = 0x496
movq -0x38(%rbp), %rdi
callq 0xe6d0
movq %rax, %rsi
leaq 0x125ab(%rip), %rdi     # 0x1a419
movb $0x0, %al
callq 0x199c0
jmp 0x7e77
movq -0x38(%rbp), %rax
andq $0x3, %rax
cmpq $0x1, %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x8043
movq -0x38(%rbp), %rdi
callq 0x16800
leaq -0xb97(%rip), %rcx      # 0x7310
shlq $0x2, %rcx
orq $0x3, %rcx
cmpq %rcx, %rax
jne 0x8043
movq -0x18(%rbp), %rdi
callq 0x16800
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
andq $0x3, %rax
cmpq $0x1, %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x8007
jmp 0x7ee7
leaq 0x18a42(%rip), %rax     # 0x20930
cmpl $0x0, (%rax)
je 0x7f4c
leaq 0x1848e(%rip), %rax     # 0x20388
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x14da8(%rip), %rcx     # 0x1ccb0
movq %rcx, 0x10(%rax)
leaq 0x14d9d(%rip), %rdi     # 0x1ccb0
callq 0x18d20
cmpl $0x0, %eax
je 0x7f4c
leaq 0x18464(%rip), %rax     # 0x20388
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x49a, 0xc(%rax)       # imm = 0x49A
movq -0x40(%rbp), %rdi
callq 0xe6d0
movq %rax, %rsi
leaq 0x12506(%rip), %rdi     # 0x1a44b
movb $0x0, %al
callq 0x199c0
jmp 0x7f4e
leaq 0x183a3(%rip), %rax     # 0x202f8
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq 0x181f4(%rip), %rsi     # 0x20158
movq -0x30(%rbp), %rdx
callq 0x172a0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq 0x1820c(%rip), %rsi     # 0x20188
movq -0x40(%rbp), %rdx
callq 0x172a0
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x16b50
movq -0x38(%rbp), %rax
movq %rax, -0x18(%rbp)
leaq 0x1898b(%rip), %rax     # 0x20930
cmpl $0x0, (%rax)
je 0x8003
leaq 0x183d7(%rip), %rax     # 0x20388
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x14cf1(%rip), %rcx     # 0x1ccb0
movq %rcx, 0x10(%rax)
leaq 0x14ce6(%rip), %rdi     # 0x1ccb0
callq 0x18d20
cmpl $0x0, %eax
je 0x8003
leaq 0x183ad(%rip), %rax     # 0x20388
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x4a0, 0xc(%rax)       # imm = 0x4A0
movq -0x18(%rbp), %rdi
callq 0xe6d0
movq %rax, %rsi
leaq 0x1249e(%rip), %rdi     # 0x1a49a
movb $0x0, %al
callq 0x199c0
jmp 0x8005
jmp 0x8041
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq 0x1814a(%rip), %rax     # 0x20160
movq %rax, -0x70(%rbp)
leaq 0x12483(%rip), %rdi     # 0x1a4a4
callq 0x12b60
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq %rax, %rdx
callq 0xcc90
movq 0x1812b(%rip), %rax     # 0x20168
movq %rax, -0x18(%rbp)
jmp 0x8083
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq 0x1810b(%rip), %rax     # 0x20160
movq %rax, -0x80(%rbp)
leaq 0x1245e(%rip), %rdi     # 0x1a4be
callq 0x12b60
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq %rax, %rdx
callq 0xcc90
movq 0x180e9(%rip), %rax     # 0x20168
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x90(%rbp)
movq 0x180a8(%rip), %rsi     # 0x20148
movq -0x18(%rbp), %rdx
leaq 0x1824d(%rip), %rdi     # 0x202f8
callq 0x172a0
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq %rax, %rdx
callq 0xcc90
movl $0x4aa, -0x5c(%rbp)     # imm = 0x4AA
leaq -0x68(%rbp), %rdi
callq 0x19ae0
addq $0xa0, %rsp
popq %rbp
retq
nop