// File: /workspace/github_c_makefile_star2_O2/dalnefre[P]kernel_abe/sample.c
// Function: each_second
BEH_DECL(each_second)
{
	CONS* count = map_get(MINE, ATOM("count"));
	CONS* tick = map_get(WHAT, ATOM("time"));
	CONS* ticker = map_get(WHAT, ATOM("from"));

	DBUG_ENTER("each_second");
	DBUG_PRINT("", ("count=%d tick=%d", MK_INT(count), MK_INT(tick)));
	SEND(ACTOR(print_line, NIL), map_put(NIL, ATOM("text"), tick));
	if (numberp(count)) {
		int n = MK_INT(count);
		if (n <= 0) {
			if (consp(ticker) && funcp(car(ticker)) && consp(cdr(ticker))) {
				SEND(ticker, map_put(NIL, ATOM("op"), ATOM("stop")));
			}
			BECOME(sink_beh, NIL);
			DBUG_RETURN;
		}
		count = NUMBER(--n);
		BECOME(THIS, map_put(NIL, ATOM("count"), count));
	}
	DBUG_RETURN;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0xb23b
movq %rax, %rdi
callq 0x379b
movq %rax, %r14
leaq 0xbb90(%rip), %rdi      # 0xe738
callq 0x895f
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xb7c7
movq %rax, %r15
movq 0x30(%rbx), %rdi
callq 0xb346
movq %rax, %r14
leaq 0xb5df(%rip), %rdi      # 0xe1af
callq 0x895f
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xb7c7
movq %rax, %r12
movq 0x30(%rbx), %rdi
callq 0xb346
movq %rax, %r14
leaq 0xb5d2(%rip), %rdi      # 0xe1ca
callq 0x895f
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xb7c7
movq %rax, %r14
leaq 0xb5bb(%rip), %rax      # 0xe1cf
movq %rsp, %rdi
movq %rax, (%rdi)
leaq 0x116ff(%rip), %rbp     # 0x14320
movq (%rbp), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x44, 0xc(%rdi)
leaq 0xd24b(%rip), %r13      # 0xfe88
movq %r13, 0x10(%rdi)
leaq 0x11540(%rip), %rcx     # 0x14188
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xd0b9
leaq 0x11c74(%rip), %rax     # 0x148d0
cmpl $0x0, (%rax)
je 0x2ca4
movq (%rbp), %rax
movq 0x50(%rax), %rax
movq %r13, 0x10(%rax)
movq %r13, %rdi
callq 0xc834
testl %eax, %eax
je 0x2ca4
movq (%rbp), %rax
movq 0x50(%rax), %rax
movl $0x45, 0xc(%rax)
movq %r15, %rsi
shrq $0x2, %rsi
movq %r12, %rdx
shrq $0x2, %rdx
leaq 0xb53e(%rip), %rdi      # 0xe1db
xorl %eax, %eax
callq 0xd130
leaq -0x1ee(%rip), %rsi      # 0x2abd
leaq 0x115de(%rip), %r13     # 0x14290
movq %rbx, %rdi
movq %r13, %rdx
callq 0x43f7
movq %rax, %rbp
leaq 0xb4f3(%rip), %rdi      # 0xe1ba
callq 0x895f
movq %r13, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0xb839
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x44d4
movl %r15d, %eax
notl %eax
pushq $0x53
popq %rbp
testb $0x3, %al
jne 0x2e0b
movq %r15, %rax
shrq $0x2, %rax
testl %eax, %eax
jle 0x2d68
movabsq $0x3fffffffc, %r14      # imm = 0x3FFFFFFFC
addq %r14, %r15
orq $0x3, %r14
andq %r15, %r14
movq 0x30(%rbx), %rdi
callq 0xb23b
movq %rax, %r15
movq 0x30(%rbx), %rdi
callq 0xb23b
movq %rax, %rdi
callq 0x3764
movq %rax, %rbx
leaq 0xb9fa(%rip), %rdi      # 0xe738
callq 0x895f
leaq 0x11546(%rip), %rdi     # 0x14290
movq %rax, %rsi
movq %r14, %rdx
callq 0xb839
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x3b56
jmp 0x2e0b
testq %r14, %r14
sete %al
testb $0x3, %r14b
setne %cl
orb %al, %cl
jne 0x2de9
movq %r14, %rdi
callq 0xb23b
cmpq $0x1, %rax
je 0x2de9
movq %r14, %rdi
callq 0xb23b
notl %eax
testb $0x3, %al
jne 0x2de9
movq %r14, %rdi
callq 0xb346
testq %rax, %rax
je 0x2de9
movq %r14, %rdi
callq 0xb346
testb $0x3, %al
jne 0x2de9
leaq 0xb439(%rip), %rdi      # 0xe1ee
callq 0x895f
movq %rax, %r15
leaq 0xb428(%rip), %rdi      # 0xe1ec
callq 0x895f
leaq 0x114c0(%rip), %rdi     # 0x14290
movq %r15, %rsi
movq %rax, %rdx
callq 0xb839
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x44d4
movq 0x30(%rbx), %rdi
callq 0xb23b
leaq 0x9d3(%rip), %rsi       # 0x37cc
leaq 0x11490(%rip), %rdx     # 0x14290
movq %rax, %rdi
callq 0x3b56
pushq $0x4e
popq %rbp
movq %rsp, %rdi
movl %ebp, 0xc(%rdi)
callq 0xd232
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq