// File: /workspace/github_c_makefile_star2_O1/dalnefre[P]kernel_abe/sample.c
// Function: time_ticker
BEH_DECL(time_ticker)
{
	CONS* msg = WHAT;
	CONS* state = MINE;
	CONS* t0 = map_get(state, ATOM("time"));
	CONS* sec = map_get(state, ATOM("sec"));
	CONS* t1 = map_get(msg, ATOM("time"));
	CONS* op = map_get(msg, ATOM("op"));
	CONS* entry = car(msg);

	DBUG_ENTER("time_ticker");
	DBUG_PRINT("", ("t0=%p t1=%p op=%p", t0, t1, op));
	if (atomp(op)) {
		DBUG_PRINT("", ("op=%s", atom_str(op)));
		if (op == ATOM("stop")) {
			BECOME(sink_beh, NIL);
			DBUG_PRINT("", ("STOPPED."));
			TRACE(printf("time_ticker: STOPPED.\n"));
			sample_done = TRUE;				/* set global flag */
			DBUG_RETURN;					/* stop ticking */
		}
		DBUG_PRINT("", ("UNKNOWN OPERATION."));
		DBUG_RETURN;
	} else if (t0 != t1) {
		if (consp(sec) && funcp(car(sec)) && consp(cdr(sec))) {
			CONS* sec_msg = NIL;

			sec_msg = map_put(sec_msg, ATOM("from"), SELF);
			sec_msg = map_put(sec_msg, ATOM("time"), t1);
			SEND(sec, sec_msg);
		}
		state = map_put(NIL, ATOM("sec"), sec);
		state = map_put(state, ATOM("time"), t1);
		BECOME(THIS, state);
	}
	DBUG_PRINT("", ("msg=%s", cons_to_str(msg)));
	assert(car(entry) == ATOM("time"));
	t1 = tick_time();
	DBUG_PRINT("", ("new tick time is %p", t1));
	rplacd(entry, t1);	/* FIXME:  HACK!!  re-use the message to reduce garbage */
	DBUG_PRINT("", ("msg'=%s", cons_to_str(msg)));
	SEND_AFTER(NUMBER(TICK_FREQ / 3), SELF, msg);
	DBUG_RETURN;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0xbb59
movq %rax, %r14
movq %rbx, 0x10(%rsp)
movq 0x30(%rbx), %rdi
callq 0xbaba
movq %rax, %rdi
callq 0x3c25
movq %rax, %r12
leaq 0xaecc(%rip), %r13      # 0xe1af
movq %r13, %rdi
callq 0x8f90
movq %r12, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xbf8e
movq %rax, %rbx
leaq 0xaeef(%rip), %rdi      # 0xe1f1
callq 0x8f90
movq %r12, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xbf8e
movq %rax, %rbp
movq %r13, %rdi
callq 0x8f90
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xbf8e
movq %rax, 0x8(%rsp)
leaq 0xaeb6(%rip), %rdi      # 0xe1ee
callq 0x8f90
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xbf8e
movq %rax, %r12
movq %r14, %rdi
callq 0xbaba
movq %rax, 0x18(%rsp)
leaq 0xae94(%rip), %rax      # 0xe1f5
leaq 0x20(%rsp), %rdi
movq %rax, (%rdi)
leaq 0xffa0(%rip), %r13      # 0x13310
movq (%r13), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x60, 0xc(%rdi)
leaq 0xcb20(%rip), %rcx      # 0xfeac
movq %rcx, 0x10(%rdi)
leaq 0xfde1(%rip), %rcx      # 0x13178
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xd826
leaq 0x10515(%rip), %rax     # 0x138c0
movq %rax, %r15
cmpl $0x0, (%rax)
je 0x33f7
movq (%r13), %rax
movq 0x50(%rax), %rax
leaq 0xcaea(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcf98
testl %eax, %eax
je 0x33f7
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x61, 0xc(%rax)
leaq 0xae1c(%rip), %rdi      # 0xe201
movq %rbx, %rsi
movq 0x8(%rsp), %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0xd897
movl %r12d, %eax
andl $0x3, %eax
cmpl $0x2, %eax
jne 0x34be
cmpl $0x0, (%r15)
leaq 0xfeff(%rip), %r14      # 0x13310
je 0x3455
movq (%r14), %rax
movq 0x50(%rax), %rax
leaq 0xca8b(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcf98
testl %eax, %eax
je 0x3455
movq (%r14), %rax
movq 0x50(%rax), %rax
movl $0x63, 0xc(%rax)
movq %r12, %rdi
callq 0x8ffd
leaq 0xadc8(%rip), %rdi      # 0xe213
movq %rax, %rsi
xorl %eax, %eax
callq 0xd897
leaq 0xad90(%rip), %rdi      # 0xe1ec
callq 0x8f90
cmpq %rax, %r12
movq 0x10(%rsp), %rax
je 0x3718
movl $0x6c, %ebx
cmpl $0x0, (%r15)
je 0x3790
movq (%r14), %rax
movq 0x50(%rax), %rax
leaq 0xca20(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcf98
testl %eax, %eax
je 0x3790
movq (%r14), %rax
movq 0x50(%rax), %rax
movl $0x6b, 0xc(%rax)
leaq 0xad67(%rip), %rdi      # 0xe219
xorl %eax, %eax
callq 0xd897
jmp 0x3790
cmpq 0x8(%rsp), %rbx
movq %r15, %r13
movq 0x10(%rsp), %rbx
je 0x35dd
testq %rbp, %rbp
sete %al
testb $0x3, %bpl
setne %cl
orb %al, %cl
jne 0x3572
movq %rbp, %rdi
callq 0xbaba
cmpq $0x1, %rax
je 0x3572
movq %rbp, %rdi
callq 0xbaba
notl %eax
testb $0x3, %al
jne 0x3572
movq %rbp, %rdi
callq 0xbb59
testq %rax, %rax
je 0x3572
movq %rbp, %rdi
callq 0xbb59
testb $0x3, %al
jne 0x3572
leaq 0xaca8(%rip), %rdi      # 0xe1ca
callq 0x8f90
movq %rax, %r15
movq 0x30(%rbx), %rdi
callq 0xbaba
leaq 0xfd46(%rip), %rdi      # 0x13280
movq %r15, %rsi
movq %rax, %rdx
callq 0xc000
movq %rax, %r15
leaq 0xac60(%rip), %rdi      # 0xe1af
callq 0x8f90
movq %r15, %rdi
movq %rax, %rsi
movq 0x8(%rsp), %rdx
callq 0xc000
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x482b
leaq 0xac78(%rip), %rdi      # 0xe1f1
callq 0x8f90
leaq 0xfcfb(%rip), %rdi      # 0x13280
movq %rax, %rsi
movq %rbp, %rdx
callq 0xc000
movq %rax, %r15
leaq 0xac15(%rip), %rdi      # 0xe1af
callq 0x8f90
movq %r15, %rdi
movq %rax, %rsi
movq 0x8(%rsp), %rdx
callq 0xc000
movq %rax, %r15
movq 0x30(%rbx), %rdi
callq 0xbaba
movq %rax, %r12
movq 0x30(%rbx), %rdi
callq 0xbaba
movq %rax, %rdi
callq 0x3bec
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x3e34
cmpl $0x0, (%r13)
leaq 0xfd27(%rip), %r12      # 0x13310
je 0x362f
movq (%r12), %rax
movq 0x50(%rax), %rax
leaq 0xc8b2(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcf98
testl %eax, %eax
je 0x362f
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x79, 0xc(%rax)
movq %r14, %rdi
callq 0x5ab0
leaq 0xac07(%rip), %rdi      # 0xe22c
movq %rax, %rsi
xorl %eax, %eax
callq 0xd897
movq 0x18(%rsp), %rbp
movq %rbp, %rdi
callq 0xbaba
movq %rax, %r15
leaq 0xab69(%rip), %rdi      # 0xe1af
callq 0x8f90
cmpq %rax, %r15
jne 0x37ac
callq 0x2de9
movq %rax, %r15
cmpl $0x0, (%r13)
je 0x369f
movq (%r12), %rax
movq 0x50(%rax), %rax
leaq 0xc83a(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcf98
testl %eax, %eax
je 0x369f
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x7c, 0xc(%rax)
leaq 0xabdd(%rip), %rdi      # 0xe272
movq %r15, %rsi
xorl %eax, %eax
callq 0xd897
movq %rbp, %rdi
movq %r15, %rsi
callq 0xbc06
cmpl $0x0, (%r13)
je 0x36f5
movq (%r12), %rax
movq 0x50(%rax), %rax
leaq 0xc7ec(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcf98
testl %eax, %eax
je 0x36f5
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x7e, 0xc(%rax)
movq %r14, %rdi
callq 0x5ab0
leaq 0xab9b(%rip), %rdi      # 0xe286
movq %rax, %rsi
xorl %eax, %eax
callq 0xd897
movq 0x30(%rbx), %rdi
callq 0xbaba
movl $0x145857, %esi         # imm = 0x145857
movq %rbx, %rdi
movq %rax, %rdx
movq %r14, %rcx
callq 0x4ab6
movl $0x80, %ebx
jmp 0x3790
movq 0x30(%rax), %rdi
callq 0xbaba
leaq 0x530(%rip), %rsi       # 0x3c58
leaq 0xfb51(%rip), %rdx      # 0x13280
movq %rax, %rdi
callq 0x3e34
cmpl $0x0, (%r15)
je 0x3774
movq (%r14), %rax
movq 0x50(%rax), %rax
leaq 0xc761(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcf98
testl %eax, %eax
je 0x3774
movq (%r14), %rax
movq 0x50(%rax), %rax
movl $0x66, 0xc(%rax)
leaq 0xab77(%rip), %rdi      # 0xe2e4
xorl %eax, %eax
callq 0xd897
leaq 0xab5c(%rip), %rdi      # 0xe2d7
callq 0x20b0
movq $0x1, 0xfbdd(%rip) # 0x13368
movl $0x69, %ebx
leaq 0x20(%rsp), %rdi
movl %ebx, 0xc(%rdi)
callq 0xd9ab
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xaa80(%rip), %rdi      # 0xe233
leaq 0xaa94(%rip), %rsi      # 0xe24e
leaq 0xaa96(%rip), %rcx      # 0xe257
movl $0x7a, %edx
callq 0x2110