// File: /workspace/github_c_makefile_star2_O1/dalnefre[P]kernel_abe/reduce.c
// Function: apply_sum
BEH_DECL(apply_sum)
{
	CONS* msg = WHAT;
	CONS* expr = map_get(msg, expr_symbol);
	CONS* state = MINE;
	CONS* acc = map_get(state, ATOM("acc"));
	CONS* form = map_get(state, form_symbol);
	CONS* cont = map_get(state, cont_symbol);
	CONS* env = map_get(state, env_symbol);
	
	DBUG_ENTER("apply_sum");
	if (numberp(expr)) {
		assert(numberp(acc));
		acc = NUMBER(MK_INT(acc) + MK_INT(expr));
		if (nilp(form) || !consp(form)) {
			expr = acc;
		} else {
			state = NIL;
			state = map_put(state, env_symbol, env);
			state = map_put(state, cont_symbol, cont);
			state = map_put(state, form_symbol, cdr(form));
			state = map_put(state, ATOM("acc"), acc);
			BECOME(THIS, state);
			msg = NIL;
			msg = map_put(msg, env_symbol, env);
			msg = map_put(msg, cont_symbol, SELF);
			msg = map_put(msg, expr_symbol, car(form));
			SEND(a_reduce, msg);
			DBUG_RETURN;
		}
	} else {	/* error */
		SEND(an_error, ATOM("numeric args required"));
		expr = undefined_symbol;
	}
	DBUG_PRINT("", ("expr=%s", cons_to_str(expr)));
	msg = NIL;
	msg = map_put(msg, expr_symbol, expr);
	SEND(cont, msg);
	DBUG_RETURN;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x11655
movq 0x163e2(%rip), %rsi     # 0x1b148
movq %rax, %rdi
xorl %edx, %edx
callq 0x11a8a
movq %rax, %r13
movq 0x30(%rbx), %rdi
callq 0x115b6
movq %rax, %rdi
callq 0x9721
movq %rax, %rbp
leaq 0xf5aa(%rip), %rdi      # 0x14338
callq 0xea8c
movq %rbp, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x11a8a
movq %rax, %r12
movq 0x163a6(%rip), %rsi     # 0x1b150
movq %rbp, %rdi
xorl %edx, %edx
callq 0x11a8a
movq %rax, %r14
movq 0x16382(%rip), %rsi     # 0x1b140
movq %rbp, %rdi
xorl %edx, %edx
callq 0x11a8a
movq %rax, 0x8(%rsp)
movq 0x16384(%rip), %rsi     # 0x1b158
movq %rbp, %rdi
xorl %edx, %edx
callq 0x11a8a
movq %rax, %r15
leaq 0xf554(%rip), %rax      # 0x1433c
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x16591(%rip), %rax     # 0x1b388
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x2df, 0xc(%rdi)       # imm = 0x2DF
leaq 0x11cf2(%rip), %rbp     # 0x16b04
movq %rbp, 0x10(%rdi)
leaq 0x16313(%rip), %rcx     # 0x1b130
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0x13322
movl %r13d, %eax
notl %eax
testb $0x3, %al
jne 0x4f87
movl %r12d, %eax
notl %eax
testb $0x3, %al
jne 0x5047
shrq $0x2, %r12
shrq $0x2, %r13
addl %r13d, %r12d
movslq %r12d, %rax
leaq 0x3(,%rax,4), %r13
cmpq 0x1615f(%rip), %r14     # 0x1afc0
je 0x4faf
testq %r14, %r14
sete %al
testb $0x3, %r14b
setne %cl
orb %al, %cl
jne 0x4faf
movq 0x162d5(%rip), %rsi     # 0x1b158
leaq 0x1646e(%rip), %rdi     # 0x1b2f8
movq %r15, %r12
movq %r15, %rdx
callq 0x11afc
movq 0x162a4(%rip), %rsi     # 0x1b140
movq %rax, %rdi
movq 0x8(%rsp), %rdx
callq 0x11afc
movq %rax, %r15
movq 0x1629d(%rip), %rbp     # 0x1b150
movq %r14, %rdi
callq 0x11655
movq %r15, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x11afc
movq %rax, %r15
leaq 0xf465(%rip), %rdi      # 0x14338
callq 0xea8c
movq %r15, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x11afc
movq %rax, %r15
movq 0x30(%rbx), %rdi
callq 0x115b6
movq %rax, %r13
movq 0x30(%rbx), %rdi
callq 0x115b6
movq %rax, %rdi
callq 0x96e8
movq %r13, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x9930
movq 0x1623d(%rip), %rsi     # 0x1b158
leaq 0x163d6(%rip), %rdi     # 0x1b2f8
movq %r12, %rdx
callq 0x11afc
movq %rax, %r15
movq 0x1620c(%rip), %r12     # 0x1b140
movq 0x30(%rbx), %rdi
callq 0x115b6
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x11afc
movq %rax, %r15
movq 0x161f3(%rip), %r12     # 0x1b148
movq %r14, %rdi
callq 0x115b6
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x11afc
movq 0x1620e(%rip), %rsi     # 0x1b180
movq %rbx, %rdi
movq %rax, %rdx
callq 0xa327
movl $0x2f1, %eax            # imm = 0x2F1
jmp 0x502b
movq 0x161d2(%rip), %r14     # 0x1b160
leaq 0xf3d7(%rip), %rdi      # 0x1436c
callq 0xea8c
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xa327
movq 0x161b9(%rip), %r13     # 0x1b168
leaq 0x1697a(%rip), %rax     # 0x1b930
cmpl $0x0, (%rax)
leaq 0x163c8(%rip), %r14     # 0x1b388
je 0x5000
movq (%r14), %rax
movq 0x50(%rax), %rax
movq %rbp, 0x10(%rax)
movq %rbp, %rdi
callq 0x12a94
testl %eax, %eax
je 0x5000
movq (%r14), %rax
movq 0x50(%rax), %rax
movl $0x2f7, 0xc(%rax)       # imm = 0x2F7
movq %r13, %rdi
callq 0xb5ac
leaq 0xf59f(%rip), %rdi      # 0x14595
movq %rax, %rsi
xorl %eax, %eax
callq 0x13393
movq 0x16141(%rip), %rsi     # 0x1b148
leaq 0x162ea(%rip), %rdi     # 0x1b2f8
movq %r13, %rdx
callq 0x11afc
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movq %rax, %rdx
callq 0xa327
movl $0x2fb, %eax            # imm = 0x2FB
leaq 0x10(%rsp), %rdi
movl %eax, 0xc(%rdi)
callq 0x134a7
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf2f8(%rip), %rdi      # 0x14346
leaq 0xefd8(%rip), %rsi      # 0x1402d
leaq 0xf2f7(%rip), %rcx      # 0x14353
movl $0x2e1, %edx            # imm = 0x2E1
callq 0x2100