// File: /workspace/github_c_makefile_star2_O0/dalnefre[P]kernel_abe/schemer.c
// Function: apply_lambda_beh
BEH_DECL(apply_lambda_beh)
{
	CONS* args = WHAT;
	CONS* to;
	CONS* lambda;
	CONS* vars;
	CONS* body;
	CONS* env;
	CONS* p = MINE;
	CONS* state;
	CONS* msg;
	CONS* a;

	DBUG_ENTER("apply_lambda_beh");
	DBUG_PRINT("", ("args = %s", cons_to_str(args)));
	to = pr_head(p);
	p = pr_tail(p);
	lambda = pr_head(p);
	env = pr_tail(p);
	vars = lst_first(lambda);
	DBUG_PRINT("", ("vars = %s", cons_to_str(vars)));
	body = lst_rest(lambda);
	DBUG_PRINT("", ("body = %s", cons_to_str(body)));
	if (is_empty(vars)) {
		if (is_empty(args)) {
			/* evaluate body in extended environment */
			DBUG_PRINT("", ("evaluate body"));
			msg = mk_pair(body, env);
			msg = mk_pair(to, msg);
			SEND(eval_seq__actor, msg);
		} else {
			DBUG_PRINT("", ("too many args"));
			FAIL(env, mk_list(ATOM("too-many-args"), args));
		}
	} else if (is_symbol(vars)) {
		/* bind symbol to remaining args */
		DBUG_PRINT("", ("bind remaining args"));
		state = mk_pair(vars, args);
		state = mk_pair(env, state);
		a = ACTOR(binding_beh, state);
		state = mk_pair(NIL, body);
		state = mk_pair(state, a);
		state = mk_pair(to, state);
		BECOME(THIS, state);
		SEND(SELF, NIL);
	} else if (is_pair(vars)) {
		if (is_empty(args)) {
			DBUG_PRINT("", ("too few args"));
			FAIL(env, mk_list(ATOM("too-few-args"), vars));
		} else {
			/* extend environment with new binding */
			DBUG_PRINT("", ("extend environment"));
			state = mk_pair(lst_first(vars), lst_first(args));
			state = mk_pair(env, state);
			a = ACTOR(binding_beh, state);
			state = mk_pair(lst_rest(vars), body);
			state = mk_pair(state, a);
			state = mk_pair(to, state);
			BECOME(THIS, state);
			SEND(SELF, lst_rest(args));
		}
	} else {
		DBUG_PRINT("", ("bad form"));
		FAIL(env, mk_list(ATOM("bad-form"), vars));
	}
	DBUG_RETURN;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x1c340
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x1c1b0
movq %rax, %rdi
callq 0x11430
movq %rax, -0x40(%rbp)
leaq 0x1c76d(%rip), %rax     # 0x2010d
movq %rax, -0x80(%rbp)
leaq 0x22965(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x78(%rbp)
movl $0x193, -0x74(%rbp)     # imm = 0x193
leaq 0x1f1c6(%rip), %rax     # 0x22b8c
movq %rax, -0x70(%rbp)
leaq 0x2275f(%rip), %rax     # 0x26130
movq %rax, -0x68(%rbp)
leaq 0x22934(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x60(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x1f2c0
leaq 0x22ee9(%rip), %rax     # 0x268e0
cmpl $0x0, (%rax)
je 0x3a55
leaq 0x2290d(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x1f17b(%rip), %rcx     # 0x22b8c
movq %rcx, 0x10(%rax)
leaq 0x1f170(%rip), %rdi     # 0x22b8c
callq 0x1e6d0
cmpl $0x0, %eax
je 0x3a55
leaq 0x228e3(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x194, 0xc(%rax)       # imm = 0x194
movq -0x10(%rbp), %rdi
callq 0x14080
movq %rax, %rsi
leaq 0x1c6d0(%rip), %rdi     # 0x2011e
movb $0x0, %al
callq 0x1f370
jmp 0x3a57
movq -0x40(%rbp), %rdi
callq 0x1c1b0
movq %rax, -0x18(%rbp)
movq -0x40(%rbp), %rdi
callq 0x1c340
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x1c1b0
movq %rax, -0x20(%rbp)
movq -0x40(%rbp), %rdi
callq 0x1c340
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1c1b0
movq %rax, -0x28(%rbp)
leaq 0x22e41(%rip), %rax     # 0x268e0
cmpl $0x0, (%rax)
je 0x3afd
leaq 0x22865(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x1f0d3(%rip), %rcx     # 0x22b8c
movq %rcx, 0x10(%rax)
leaq 0x1f0c8(%rip), %rdi     # 0x22b8c
callq 0x1e6d0
cmpl $0x0, %eax
je 0x3afd
leaq 0x2283b(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x19a, 0xc(%rax)       # imm = 0x19A
movq -0x28(%rbp), %rdi
callq 0x14080
movq %rax, %rsi
leaq 0x1c632(%rip), %rdi     # 0x20128
movb $0x0, %al
callq 0x1f370
jmp 0x3aff
movq -0x20(%rbp), %rdi
callq 0x1c340
movq %rax, -0x30(%rbp)
leaq 0x22dcd(%rip), %rax     # 0x268e0
cmpl $0x0, (%rax)
je 0x3b71
leaq 0x227f1(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x1f05f(%rip), %rcx     # 0x22b8c
movq %rcx, 0x10(%rax)
leaq 0x1f054(%rip), %rdi     # 0x22b8c
callq 0x1e6d0
cmpl $0x0, %eax
je 0x3b71
leaq 0x227c7(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x19c, 0xc(%rax)       # imm = 0x19C
movq -0x30(%rbp), %rdi
callq 0x14080
movq %rax, %rsi
leaq 0x1c5c8(%rip), %rdi     # 0x20132
movb $0x0, %al
callq 0x1f370
jmp 0x3b73
leaq 0x22706(%rip), %rax     # 0x26280
cmpq %rax, -0x28(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x3d68
leaq 0x226e7(%rip), %rax     # 0x26280
cmpq %rax, -0x10(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x3c49
jmp 0x3bb3
leaq 0x22d26(%rip), %rax     # 0x268e0
cmpl $0x0, (%rax)
je 0x3c0c
leaq 0x2274a(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x1efb8(%rip), %rcx     # 0x22b8c
movq %rcx, 0x10(%rax)
leaq 0x1efad(%rip), %rdi     # 0x22b8c
callq 0x1e6d0
cmpl $0x0, %eax
je 0x3c0c
leaq 0x22720(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x1a0, 0xc(%rax)       # imm = 0x1A0
leaq 0x1c537(%rip), %rdi     # 0x2013c
movb $0x0, %al
callq 0x1f370
jmp 0x3c0e
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x1c0c0
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x1c0c0
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq 0x2271d(%rip), %rsi     # 0x26358
movq -0x50(%rbp), %rdx
callq 0x12640
jmp 0x3d63
jmp 0x3c4b
leaq 0x22c8e(%rip), %rax     # 0x268e0
cmpl $0x0, (%rax)
je 0x3ca4
leaq 0x226b2(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x1ef20(%rip), %rcx     # 0x22b8c
movq %rcx, 0x10(%rax)
leaq 0x1ef15(%rip), %rdi     # 0x22b8c
callq 0x1e6d0
cmpl $0x0, %eax
je 0x3ca4
leaq 0x22688(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x1a5, 0xc(%rax)       # imm = 0x1A5
leaq 0x1c4ad(%rip), %rdi     # 0x2014a
movb $0x0, %al
callq 0x1f370
jmp 0x3ca6
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
leaq 0x1c48a(%rip), %rdi     # 0x20158
callq 0x18510
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x1c0c0
movq -0xa8(%rbp), %rdi
movq %rax, %rdx
leaq -0x1560(%rip), %rsi     # 0x2790
callq 0x12520
movq %rax, -0x98(%rbp)
leaq 0x1c387(%rip), %rdi     # 0x2008a
callq 0x18510
movq %rax, -0xa0(%rbp)
callq 0x11360
movq %rax, %rdi
leaq 0x22562(%rip), %rsi     # 0x26280
callq 0x1c0c0
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x1c0c0
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x1c0c0
movq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x1c0c0
movq -0x90(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq %rax, %rdx
callq 0x12640
jmp 0x4335
movq -0x28(%rbp), %rax
andq $0x3, %rax
cmpq $0x2, %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x3f13
movq -0x28(%rbp), %rax
movq %rax, -0xb0(%rbp)
movl $0x1, %edi
callq 0x4350
movq %rax, %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
je 0x3f13
movq -0x28(%rbp), %rax
movq %rax, -0xb8(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x4350
movq %rax, %rcx
movq -0xb8(%rbp), %rax
cmpq %rcx, %rax
je 0x3f13
jmp 0x3dd9
leaq 0x22b00(%rip), %rax     # 0x268e0
cmpl $0x0, (%rax)
je 0x3e32
leaq 0x22524(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x1ed92(%rip), %rcx     # 0x22b8c
movq %rcx, 0x10(%rax)
leaq 0x1ed87(%rip), %rdi     # 0x22b8c
callq 0x1e6d0
cmpl $0x0, %eax
je 0x3e32
leaq 0x224fa(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x1aa, 0xc(%rax)       # imm = 0x1AA
leaq 0x1c33b(%rip), %rdi     # 0x20166
movb $0x0, %al
callq 0x1f370
jmp 0x3e34
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1c0c0
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x1c0c0
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rdx
leaq -0x1205(%rip), %rsi     # 0x2c60
callq 0x12520
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rsi
leaq 0x22407(%rip), %rdi     # 0x26280
callq 0x1c0c0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x1c0c0
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x1c0c0
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x1c1b0
movq %rax, -0xc8(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x1c1b0
movq %rax, %rdi
callq 0x113c0
movq -0xc8(%rbp), %rdi
movq %rax, %rsi
movq -0x48(%rbp), %rdx
callq 0x11910
movq -0x8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x1c1b0
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
leaq 0x22377(%rip), %rdx     # 0x26280
callq 0x12640
jmp 0x4333
xorl %eax, %eax
cmpq $0x0, -0x28(%rbp)
movb %al, -0xc9(%rbp)
je 0x3f37
movq -0x28(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
sete %al
movb %al, -0xc9(%rbp)
movb -0xc9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x4217
leaq 0x2232b(%rip), %rax     # 0x26280
cmpq %rax, -0x28(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
jne 0x4217
leaq 0x2230c(%rip), %rax     # 0x26280
cmpq %rax, -0x10(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x40ab
jmp 0x3f8e
leaq 0x2294b(%rip), %rax     # 0x268e0
cmpl $0x0, (%rax)
je 0x3fe7
leaq 0x2236f(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x1ebdd(%rip), %rcx     # 0x22b8c
movq %rcx, 0x10(%rax)
leaq 0x1ebd2(%rip), %rdi     # 0x22b8c
callq 0x1e6d0
cmpl $0x0, %eax
je 0x3fe7
leaq 0x22345(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x1b5, 0xc(%rax)       # imm = 0x1B5
leaq 0x1c19a(%rip), %rdi     # 0x2017a
movb $0x0, %al
callq 0x1f370
jmp 0x3fe9
movq -0x8(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xf8(%rbp)
leaq 0x1c176(%rip), %rdi     # 0x20187
callq 0x18510
movq %rax, %rdi
movq -0x28(%rbp), %rsi
callq 0x1c0c0
movq -0xf8(%rbp), %rdi
movq %rax, %rdx
leaq -0x18a3(%rip), %rsi     # 0x2790
callq 0x12520
movq %rax, -0xe8(%rbp)
leaq 0x1c044(%rip), %rdi     # 0x2008a
callq 0x18510
movq %rax, -0xf0(%rbp)
callq 0x11360
movq %rax, %rdi
leaq 0x2221f(%rip), %rsi     # 0x26280
callq 0x1c0c0
movq -0xf0(%rbp), %rdi
movq %rax, %rsi
callq 0x1c0c0
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x1c0c0
movq -0xe8(%rbp), %rdi
movq %rax, %rsi
callq 0x1c0c0
movq -0xe0(%rbp), %rdi
movq -0xd8(%rbp), %rsi
movq %rax, %rdx
callq 0x12640
jmp 0x4212
jmp 0x40ad
leaq 0x2282c(%rip), %rax     # 0x268e0
cmpl $0x0, (%rax)
je 0x4106
leaq 0x22250(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x1eabe(%rip), %rcx     # 0x22b8c
movq %rcx, 0x10(%rax)
leaq 0x1eab3(%rip), %rdi     # 0x22b8c
callq 0x1e6d0
cmpl $0x0, %eax
je 0x4106
leaq 0x22226(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x1b9, 0xc(%rax)       # imm = 0x1B9
leaq 0x1c095(%rip), %rdi     # 0x20194
movb $0x0, %al
callq 0x1f370
jmp 0x4108
movq -0x28(%rbp), %rdi
callq 0x1c1b0
movq %rax, -0x118(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1c1b0
movq -0x118(%rbp), %rdi
movq %rax, %rsi
callq 0x1c0c0
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x1c0c0
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rdx
leaq -0x14f4(%rip), %rsi     # 0x2c60
callq 0x12520
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rdi
callq 0x1c340
movq %rax, %rdi
movq -0x30(%rbp), %rsi
callq 0x1c0c0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x1c0c0
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x1c0c0
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x1c1b0
movq %rax, -0x110(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x1c1b0
movq %rax, %rdi
callq 0x113c0
movq -0x110(%rbp), %rdi
movq %rax, %rsi
movq -0x48(%rbp), %rdx
callq 0x11910
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x1c1b0
movq %rax, -0x100(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1c340
movq -0x108(%rbp), %rdi
movq -0x100(%rbp), %rsi
movq %rax, %rdx
callq 0x12640
jmp 0x4331
jmp 0x4219
leaq 0x226c0(%rip), %rax     # 0x268e0
cmpl $0x0, (%rax)
je 0x4272
leaq 0x220e4(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x1e952(%rip), %rcx     # 0x22b8c
movq %rcx, 0x10(%rax)
leaq 0x1e947(%rip), %rdi     # 0x22b8c
callq 0x1e6d0
cmpl $0x0, %eax
je 0x4272
leaq 0x220ba(%rip), %rax     # 0x26310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x1c4, 0xc(%rax)       # imm = 0x1C4
leaq 0x1bf3c(%rip), %rdi     # 0x201a7
movb $0x0, %al
callq 0x1f370
jmp 0x4274
movq -0x8(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq 0x1bf14(%rip), %rdi     # 0x201b0
callq 0x18510
movq %rax, %rdi
movq -0x28(%rbp), %rsi
callq 0x1c0c0
movq -0x140(%rbp), %rdi
movq %rax, %rdx
leaq -0x1b2e(%rip), %rsi     # 0x2790
callq 0x12520
movq %rax, -0x130(%rbp)
leaq 0x1bdb9(%rip), %rdi     # 0x2008a
callq 0x18510
movq %rax, -0x138(%rbp)
callq 0x11360
movq %rax, %rdi
leaq 0x21f94(%rip), %rsi     # 0x26280
callq 0x1c0c0
movq -0x138(%rbp), %rdi
movq %rax, %rsi
callq 0x1c0c0
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x1c0c0
movq -0x130(%rbp), %rdi
movq %rax, %rsi
callq 0x1c0c0
movq -0x128(%rbp), %rdi
movq -0x120(%rbp), %rsi
movq %rax, %rdx
callq 0x12640
jmp 0x4333
jmp 0x4335
movl $0x1c7, -0x74(%rbp)     # imm = 0x1C7
leaq -0x80(%rbp), %rdi
callq 0x1f490
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nop