// File: /workspace/github_c_makefile_star2_O3/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 0xbaca
movq %rax, %rdi
callq 0x3bbd
movq %rax, %r14
leaq 0xb77a(%rip), %rdi      # 0xe738
callq 0x8f57
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xbf9e
movq %rax, %r15
movq 0x30(%rbx), %rdi
callq 0xbb69
movq %rax, %r14
leaq 0xb1c9(%rip), %rdi      # 0xe1af
callq 0x8f57
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xbf9e
movq %rax, %r12
movq 0x30(%rbx), %rdi
callq 0xbb69
movq %rax, %r14
leaq 0xb1bc(%rip), %rdi      # 0xe1ca
callq 0x8f57
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xbf9e
movq %rax, %r14
leaq 0xb1a5(%rip), %rax      # 0xe1cf
movq %rsp, %rdi
movq %rax, (%rdi)
leaq 0x102d9(%rip), %rbp     # 0x13310
movq (%rbp), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x44, 0xc(%rdi)
leaq 0xce59(%rip), %r13      # 0xfeac
movq %r13, 0x10(%rdi)
leaq 0x1011a(%rip), %rcx     # 0x13178
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xd87e
leaq 0x1084e(%rip), %rax     # 0x138c0
cmpl $0x0, (%rax)
je 0x30ba
movq (%rbp), %rax
movq 0x50(%rax), %rax
movq %r13, 0x10(%rax)
movq %r13, %rdi
callq 0xcfe0
testl %eax, %eax
je 0x30ba
movq (%rbp), %rax
movq 0x50(%rax), %rax
movl $0x45, 0xc(%rax)
movq %r15, %rsi
shrq $0x2, %rsi
movq %r12, %rdx
shrq $0x2, %rdx
leaq 0xb128(%rip), %rdi      # 0xe1db
xorl %eax, %eax
callq 0xd8ef
leaq -0x1f0(%rip), %rsi      # 0x2ed1
leaq 0x101b8(%rip), %r13     # 0x13280
movq %rbx, %rdi
movq %r13, %rdx
callq 0x4716
movq %rax, %rbp
leaq 0xb0dd(%rip), %rdi      # 0xe1ba
callq 0x8f57
movq %r13, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0xc010
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x47f3
movl %r15d, %eax
notl %eax
movl $0x53, %ebp
testb $0x3, %al
jne 0x3225
movq %r15, %rax
shrq $0x2, %rax
testl %eax, %eax
jle 0x3180
movabsq $0x3fffffffc, %r14      # imm = 0x3FFFFFFFC
addq %r14, %r15
orq $0x3, %r14
andq %r15, %r14
movq 0x30(%rbx), %rdi
callq 0xbaca
movq %rax, %r15
movq 0x30(%rbx), %rdi
callq 0xbaca
movq %rax, %rdi
callq 0x3b84
movq %rax, %rbx
leaq 0xb5e2(%rip), %rdi      # 0xe738
callq 0x8f57
leaq 0x1011e(%rip), %rdi     # 0x13280
movq %rax, %rsi
movq %r14, %rdx
callq 0xc010
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x3e16
jmp 0x3225
testq %r14, %r14
sete %al
testb $0x3, %r14b
setne %cl
orb %al, %cl
jne 0x3201
movq %r14, %rdi
callq 0xbaca
cmpq $0x1, %rax
je 0x3201
movq %r14, %rdi
callq 0xbaca
notl %eax
testb $0x3, %al
jne 0x3201
movq %r14, %rdi
callq 0xbb69
testq %rax, %rax
je 0x3201
movq %r14, %rdi
callq 0xbb69
testb $0x3, %al
jne 0x3201
leaq 0xb021(%rip), %rdi      # 0xe1ee
callq 0x8f57
movq %rax, %r15
leaq 0xb010(%rip), %rdi      # 0xe1ec
callq 0x8f57
leaq 0x10098(%rip), %rdi     # 0x13280
movq %r15, %rsi
movq %rax, %rdx
callq 0xc010
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x47f3
movq 0x30(%rbx), %rdi
callq 0xbaca
leaq 0x9df(%rip), %rsi       # 0x3bf0
leaq 0x10068(%rip), %rdx     # 0x13280
movq %rax, %rdi
callq 0x3e16
movl $0x4e, %ebp
movq %rsp, %rdi
movl %ebp, 0xc(%rdi)
callq 0xda03
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq