// File: /workspace/github_c_makefile_star2_O1/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 0xbaba
movq %rax, %rdi
callq 0x3c25
movq %rax, %r14
leaq 0xb722(%rip), %rdi      # 0xe738
callq 0x8f90
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xbf8e
movq %rax, %r15
movq 0x30(%rbx), %rdi
callq 0xbb59
movq %rax, %r14
leaq 0xb171(%rip), %rdi      # 0xe1af
callq 0x8f90
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xbf8e
movq %rax, %r12
movq 0x30(%rbx), %rdi
callq 0xbb59
movq %rax, %r14
leaq 0xb164(%rip), %rdi      # 0xe1ca
callq 0x8f90
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xbf8e
movq %rax, %r14
leaq 0xb14d(%rip), %rax      # 0xe1cf
movq %rsp, %rdi
movq %rax, (%rdi)
leaq 0x10281(%rip), %rbp     # 0x13310
movq (%rbp), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x44, 0xc(%rdi)
leaq 0xce01(%rip), %r13      # 0xfeac
movq %r13, 0x10(%rdi)
leaq 0x100c2(%rip), %rcx     # 0x13178
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xd826
leaq 0x107f6(%rip), %rax     # 0x138c0
cmpl $0x0, (%rax)
je 0x3112
movq (%rbp), %rax
movq 0x50(%rax), %rax
movq %r13, 0x10(%rax)
movq %r13, %rdi
callq 0xcf98
testl %eax, %eax
je 0x3112
movq (%rbp), %rax
movq 0x50(%rax), %rax
movl $0x45, 0xc(%rax)
movq %r15, %rsi
shrq $0x2, %rsi
movq %r12, %rdx
shrq $0x2, %rdx
leaq 0xb0d0(%rip), %rdi      # 0xe1db
xorl %eax, %eax
callq 0xd897
leaq -0x1f0(%rip), %rsi      # 0x2f29
leaq 0x10160(%rip), %r13     # 0x13280
movq %rbx, %rdi
movq %r13, %rdx
callq 0x474e
movq %rax, %rbp
leaq 0xb085(%rip), %rdi      # 0xe1ba
callq 0x8f90
movq %r13, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0xc000
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x482b
movl %r15d, %eax
notl %eax
testb $0x3, %al
jne 0x3288
movq %r15, %r12
shrq $0x2, %r12
testl %r12d, %r12d
jle 0x31d4
movabsq $0x3fffffffc, %r14      # imm = 0x3FFFFFFFC
addq %r14, %r15
orq $0x3, %r14
andq %r15, %r14
movq 0x30(%rbx), %rdi
callq 0xbaba
movq %rax, %r15
movq 0x30(%rbx), %rdi
callq 0xbaba
movq %rax, %rdi
callq 0x3bec
movq %rax, %rbx
leaq 0xb58e(%rip), %rdi      # 0xe738
callq 0x8f90
leaq 0x100ca(%rip), %rdi     # 0x13280
movq %rax, %rsi
movq %r14, %rdx
callq 0xc000
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x3e34
jmp 0x3283
testq %r14, %r14
sete %al
testb $0x3, %r14b
setne %cl
orb %al, %cl
jne 0x3255
movq %r14, %rdi
callq 0xbaba
cmpq $0x1, %rax
je 0x3255
movq %r14, %rdi
callq 0xbaba
notl %eax
testb $0x3, %al
jne 0x3255
movq %r14, %rdi
callq 0xbb59
testq %rax, %rax
je 0x3255
movq %r14, %rdi
callq 0xbb59
testb $0x3, %al
jne 0x3255
leaq 0xafcd(%rip), %rdi      # 0xe1ee
callq 0x8f90
movq %rax, %r15
leaq 0xafbc(%rip), %rdi      # 0xe1ec
callq 0x8f90
leaq 0x10044(%rip), %rdi     # 0x13280
movq %r15, %rsi
movq %rax, %rdx
callq 0xc000
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x482b
movq 0x30(%rbx), %rdi
callq 0xbaba
leaq 0x9f3(%rip), %rsi       # 0x3c58
leaq 0x10014(%rip), %rdx     # 0x13280
movq %rax, %rdi
callq 0x3e34
movq %rsp, %rdi
movl $0x4e, 0xc(%rdi)
callq 0xd9ab
testl %r12d, %r12d
jle 0x3297
movq %rsp, %rdi
movl $0x53, 0xc(%rdi)
callq 0xd9ab
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq