// File: /workspace/github_c_makefile_star2_O3/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 0xbb69
movq %rax, %r14
movq %rbx, 0x10(%rsp)
movq 0x30(%rbx), %rdi
callq 0xbaca
movq %rax, %rdi
callq 0x3bbd
movq %rax, %r12
leaq 0xaf33(%rip), %r13      # 0xe1af
movq %r13, %rdi
callq 0x8f57
movq %r12, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xbf9e
movq %rax, %rbx
leaq 0xaf56(%rip), %rdi      # 0xe1f1
callq 0x8f57
movq %r12, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xbf9e
movq %rax, %rbp
movq %r13, %rdi
callq 0x8f57
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xbf9e
movq %rax, 0x8(%rsp)
leaq 0xaf1d(%rip), %rdi      # 0xe1ee
callq 0x8f57
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xbf9e
movq %rax, %r12
movq %r14, %rdi
callq 0xbaca
movq %rax, 0x18(%rsp)
leaq 0xaefb(%rip), %rax      # 0xe1f5
leaq 0x20(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x10007(%rip), %r13     # 0x13310
movq (%r13), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x60, 0xc(%rdi)
leaq 0xcb87(%rip), %rcx      # 0xfeac
movq %rcx, 0x10(%rdi)
leaq 0xfe48(%rip), %rcx      # 0x13178
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xd87e
leaq 0x1057c(%rip), %rax     # 0x138c0
movq %rax, %r15
cmpl $0x0, (%rax)
je 0x3390
movq (%r13), %rax
movq 0x50(%rax), %rax
leaq 0xcb51(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcfe0
testl %eax, %eax
je 0x3390
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x61, 0xc(%rax)
leaq 0xae83(%rip), %rdi      # 0xe201
movq %rbx, %rsi
movq 0x8(%rsp), %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0xd8ef
movl %r12d, %eax
andl $0x3, %eax
cmpl $0x2, %eax
jne 0x3457
cmpl $0x0, (%r15)
leaq 0xff66(%rip), %r14      # 0x13310
je 0x33ee
movq (%r14), %rax
movq 0x50(%rax), %rax
leaq 0xcaf2(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcfe0
testl %eax, %eax
je 0x33ee
movq (%r14), %rax
movq 0x50(%rax), %rax
movl $0x63, 0xc(%rax)
movq %r12, %rdi
callq 0x8fb6
leaq 0xae2f(%rip), %rdi      # 0xe213
movq %rax, %rsi
xorl %eax, %eax
callq 0xd8ef
leaq 0xadf7(%rip), %rdi      # 0xe1ec
callq 0x8f57
cmpq %rax, %r12
movq 0x10(%rsp), %rax
je 0x36b1
movl $0x6c, %ebx
cmpl $0x0, (%r15)
je 0x3729
movq (%r14), %rax
movq 0x50(%rax), %rax
leaq 0xca87(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcfe0
testl %eax, %eax
je 0x3729
movq (%r14), %rax
movq 0x50(%rax), %rax
movl $0x6b, 0xc(%rax)
leaq 0xadce(%rip), %rdi      # 0xe219
xorl %eax, %eax
callq 0xd8ef
jmp 0x3729
cmpq 0x8(%rsp), %rbx
movq %r15, %r13
movq 0x10(%rsp), %rbx
je 0x3576
testq %rbp, %rbp
sete %al
testb $0x3, %bpl
setne %cl
orb %al, %cl
jne 0x350b
movq %rbp, %rdi
callq 0xbaca
cmpq $0x1, %rax
je 0x350b
movq %rbp, %rdi
callq 0xbaca
notl %eax
testb $0x3, %al
jne 0x350b
movq %rbp, %rdi
callq 0xbb69
testq %rax, %rax
je 0x350b
movq %rbp, %rdi
callq 0xbb69
testb $0x3, %al
jne 0x350b
leaq 0xad0f(%rip), %rdi      # 0xe1ca
callq 0x8f57
movq %rax, %r15
movq 0x30(%rbx), %rdi
callq 0xbaca
leaq 0xfdad(%rip), %rdi      # 0x13280
movq %r15, %rsi
movq %rax, %rdx
callq 0xc010
movq %rax, %r15
leaq 0xacc7(%rip), %rdi      # 0xe1af
callq 0x8f57
movq %r15, %rdi
movq %rax, %rsi
movq 0x8(%rsp), %rdx
callq 0xc010
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x47f3
leaq 0xacdf(%rip), %rdi      # 0xe1f1
callq 0x8f57
leaq 0xfd62(%rip), %rdi      # 0x13280
movq %rax, %rsi
movq %rbp, %rdx
callq 0xc010
movq %rax, %r15
leaq 0xac7c(%rip), %rdi      # 0xe1af
callq 0x8f57
movq %r15, %rdi
movq %rax, %rsi
movq 0x8(%rsp), %rdx
callq 0xc010
movq %rax, %r15
movq 0x30(%rbx), %rdi
callq 0xbaca
movq %rax, %r12
movq 0x30(%rbx), %rdi
callq 0xbaca
movq %rax, %rdi
callq 0x3b84
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x3e16
cmpl $0x0, (%r13)
leaq 0xfd8e(%rip), %r12      # 0x13310
je 0x35c8
movq (%r12), %rax
movq 0x50(%rax), %rax
leaq 0xc919(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcfe0
testl %eax, %eax
je 0x35c8
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x79, 0xc(%rax)
movq %r14, %rdi
callq 0x5a98
leaq 0xac6e(%rip), %rdi      # 0xe22c
movq %rax, %rsi
xorl %eax, %eax
callq 0xd8ef
movq 0x18(%rsp), %rbp
movq %rbp, %rdi
callq 0xbaca
movq %rax, %r15
leaq 0xabd0(%rip), %rdi      # 0xe1af
callq 0x8f57
cmpq %rax, %r15
jne 0x3745
callq 0x2d91
movq %rax, %r15
cmpl $0x0, (%r13)
je 0x3638
movq (%r12), %rax
movq 0x50(%rax), %rax
leaq 0xc8a1(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcfe0
testl %eax, %eax
je 0x3638
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x7c, 0xc(%rax)
leaq 0xac44(%rip), %rdi      # 0xe272
movq %r15, %rsi
xorl %eax, %eax
callq 0xd8ef
movq %rbp, %rdi
movq %r15, %rsi
callq 0xbc16
cmpl $0x0, (%r13)
je 0x368e
movq (%r12), %rax
movq 0x50(%rax), %rax
leaq 0xc853(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcfe0
testl %eax, %eax
je 0x368e
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x7e, 0xc(%rax)
movq %r14, %rdi
callq 0x5a98
leaq 0xac02(%rip), %rdi      # 0xe286
movq %rax, %rsi
xorl %eax, %eax
callq 0xd8ef
movq 0x30(%rbx), %rdi
callq 0xbaca
movl $0x145857, %esi         # imm = 0x145857
movq %rbx, %rdi
movq %rax, %rdx
movq %r14, %rcx
callq 0x4a7e
movl $0x80, %ebx
jmp 0x3729
movq 0x30(%rax), %rdi
callq 0xbaca
leaq 0x52f(%rip), %rsi       # 0x3bf0
leaq 0xfbb8(%rip), %rdx      # 0x13280
movq %rax, %rdi
callq 0x3e16
cmpl $0x0, (%r15)
je 0x370d
movq (%r14), %rax
movq 0x50(%rax), %rax
leaq 0xc7c8(%rip), %rdi      # 0xfeac
movq %rdi, 0x10(%rax)
callq 0xcfe0
testl %eax, %eax
je 0x370d
movq (%r14), %rax
movq 0x50(%rax), %rax
movl $0x66, 0xc(%rax)
leaq 0xabde(%rip), %rdi      # 0xe2e4
xorl %eax, %eax
callq 0xd8ef
leaq 0xabc3(%rip), %rdi      # 0xe2d7
callq 0x20b0
movq $0x1, 0xfc44(%rip) # 0x13368
movl $0x69, %ebx
leaq 0x20(%rsp), %rdi
movl %ebx, 0xc(%rdi)
callq 0xda03
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xaae7(%rip), %rdi      # 0xe233
leaq 0xaafb(%rip), %rsi      # 0xe24e
leaq 0xaafd(%rip), %rcx      # 0xe257
movl $0x7a, %edx
callq 0x2110