// File: /workspace/github_c_makefile_star2_O2/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 0xb346
movq %rax, %r14
movq %rbx, 0x10(%rsp)
movq 0x30(%rbx), %rdi
callq 0xb23b
movq %rax, %rdi
callq 0x379b
movq %rax, %r12
leaq 0xb34d(%rip), %r13      # 0xe1af
movq %r13, %rdi
callq 0x895f
movq %r12, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xb7c7
movq %rax, %rbx
leaq 0xb370(%rip), %rdi      # 0xe1f1
callq 0x895f
movq %r12, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xb7c7
movq %rax, %rbp
movq %r13, %rdi
callq 0x895f
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xb7c7
movq %rax, 0x8(%rsp)
leaq 0xb337(%rip), %rdi      # 0xe1ee
callq 0x895f
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xb7c7
movq %rax, %r12
movq %r14, %rdi
callq 0xb23b
movq %rax, 0x18(%rsp)
leaq 0xb315(%rip), %rax      # 0xe1f5
leaq 0x20(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x11431(%rip), %r13     # 0x14320
movq (%r13), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x60, 0xc(%rdi)
leaq 0xcf7d(%rip), %rcx      # 0xfe88
movq %rcx, 0x10(%rdi)
leaq 0x11272(%rip), %rcx     # 0x14188
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xd0b9
leaq 0x119a6(%rip), %rax     # 0x148d0
movq %rax, %r15
cmpl $0x0, (%rax)
je 0x2f76
movq (%r13), %rax
movq 0x50(%rax), %rax
leaq 0xcf47(%rip), %rdi      # 0xfe88
movq %rdi, 0x10(%rax)
callq 0xc834
testl %eax, %eax
je 0x2f76
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x61, 0xc(%rax)
leaq 0xb29d(%rip), %rdi      # 0xe201
movq %rbx, %rsi
movq 0x8(%rsp), %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0xd130
movl %r12d, %eax
andl $0x3, %eax
cmpl $0x2, %eax
jne 0x303b
cmpl $0x0, (%r15)
leaq 0x11390(%rip), %r14     # 0x14320
je 0x2fd4
movq (%r14), %rax
movq 0x50(%rax), %rax
leaq 0xcee8(%rip), %rdi      # 0xfe88
movq %rdi, 0x10(%rax)
callq 0xc834
testl %eax, %eax
je 0x2fd4
movq (%r14), %rax
movq 0x50(%rax), %rax
movl $0x63, 0xc(%rax)
movq %r12, %rdi
callq 0x89be
leaq 0xb249(%rip), %rdi      # 0xe213
movq %rax, %rsi
xorl %eax, %eax
callq 0xd130
leaq 0xb211(%rip), %rdi      # 0xe1ec
callq 0x895f
cmpq %rax, %r12
movq 0x10(%rsp), %rax
je 0x3295
pushq $0x6c
popq %rbx
cmpl $0x0, (%r15)
je 0x330b
movq (%r14), %rax
movq 0x50(%rax), %rax
leaq 0xce7f(%rip), %rdi      # 0xfe88
movq %rdi, 0x10(%rax)
callq 0xc834
testl %eax, %eax
je 0x330b
movq (%r14), %rax
movq 0x50(%rax), %rax
movl $0x6b, 0xc(%rax)
leaq 0xb1ea(%rip), %rdi      # 0xe219
xorl %eax, %eax
callq 0xd130
jmp 0x330b
cmpq 0x8(%rsp), %rbx
movq %r15, %r13
movq 0x10(%rsp), %rbx
je 0x315a
testq %rbp, %rbp
sete %al
testb $0x3, %bpl
setne %cl
orb %al, %cl
jne 0x30ef
movq %rbp, %rdi
callq 0xb23b
cmpq $0x1, %rax
je 0x30ef
movq %rbp, %rdi
callq 0xb23b
notl %eax
testb $0x3, %al
jne 0x30ef
movq %rbp, %rdi
callq 0xb346
testq %rax, %rax
je 0x30ef
movq %rbp, %rdi
callq 0xb346
testb $0x3, %al
jne 0x30ef
leaq 0xb12b(%rip), %rdi      # 0xe1ca
callq 0x895f
movq %rax, %r15
movq 0x30(%rbx), %rdi
callq 0xb23b
leaq 0x111d9(%rip), %rdi     # 0x14290
movq %r15, %rsi
movq %rax, %rdx
callq 0xb839
movq %rax, %r15
leaq 0xb0e3(%rip), %rdi      # 0xe1af
callq 0x895f
movq %r15, %rdi
movq %rax, %rsi
movq 0x8(%rsp), %rdx
callq 0xb839
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x44d4
leaq 0xb0fb(%rip), %rdi      # 0xe1f1
callq 0x895f
leaq 0x1118e(%rip), %rdi     # 0x14290
movq %rax, %rsi
movq %rbp, %rdx
callq 0xb839
movq %rax, %r15
leaq 0xb098(%rip), %rdi      # 0xe1af
callq 0x895f
movq %r15, %rdi
movq %rax, %rsi
movq 0x8(%rsp), %rdx
callq 0xb839
movq %rax, %r15
movq 0x30(%rbx), %rdi
callq 0xb23b
movq %rax, %r12
movq 0x30(%rbx), %rdi
callq 0xb23b
movq %rax, %rdi
callq 0x3764
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x3b56
cmpl $0x0, (%r13)
leaq 0x111ba(%rip), %r12     # 0x14320
je 0x31ac
movq (%r12), %rax
movq 0x50(%rax), %rax
leaq 0xcd11(%rip), %rdi      # 0xfe88
movq %rdi, 0x10(%rax)
callq 0xc834
testl %eax, %eax
je 0x31ac
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x79, 0xc(%rax)
movq %r14, %rdi
callq 0x5748
leaq 0xb08a(%rip), %rdi      # 0xe22c
movq %rax, %rsi
xorl %eax, %eax
callq 0xd130
movq 0x18(%rsp), %rbp
movq %rbp, %rdi
callq 0xb23b
movq %rax, %r15
leaq 0xafec(%rip), %rdi      # 0xe1af
callq 0x895f
cmpq %rax, %r15
jne 0x3327
callq 0x297d
movq %rax, %r15
cmpl $0x0, (%r13)
je 0x321c
movq (%r12), %rax
movq 0x50(%rax), %rax
leaq 0xcc99(%rip), %rdi      # 0xfe88
movq %rdi, 0x10(%rax)
callq 0xc834
testl %eax, %eax
je 0x321c
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x7c, 0xc(%rax)
leaq 0xb060(%rip), %rdi      # 0xe272
movq %r15, %rsi
xorl %eax, %eax
callq 0xd130
movq %rbp, %rdi
movq %r15, %rsi
callq 0xb45f
cmpl $0x0, (%r13)
je 0x3272
movq (%r12), %rax
movq 0x50(%rax), %rax
leaq 0xcc4b(%rip), %rdi      # 0xfe88
movq %rdi, 0x10(%rax)
callq 0xc834
testl %eax, %eax
je 0x3272
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0x7e, 0xc(%rax)
movq %r14, %rdi
callq 0x5748
leaq 0xb01e(%rip), %rdi      # 0xe286
movq %rax, %rsi
xorl %eax, %eax
callq 0xd130
movq 0x30(%rbx), %rdi
callq 0xb23b
movl $0x145857, %esi         # imm = 0x145857
movq %rbx, %rdi
movq %rax, %rdx
movq %r14, %rcx
callq 0x475d
movl $0x80, %ebx
jmp 0x330b
movq 0x30(%rax), %rdi
callq 0xb23b
leaq 0x527(%rip), %rsi       # 0x37cc
leaq 0x10fe4(%rip), %rdx     # 0x14290
movq %rax, %rdi
callq 0x3b56
cmpl $0x0, (%r15)
je 0x32f1
movq (%r14), %rax
movq 0x50(%rax), %rax
leaq 0xcbc0(%rip), %rdi      # 0xfe88
movq %rdi, 0x10(%rax)
callq 0xc834
testl %eax, %eax
je 0x32f1
movq (%r14), %rax
movq 0x50(%rax), %rax
movl $0x66, 0xc(%rax)
leaq 0xaffa(%rip), %rdi      # 0xe2e4
xorl %eax, %eax
callq 0xd130
leaq 0xafdf(%rip), %rdi      # 0xe2d7
callq 0x20b0
movq $0x1, 0x11070(%rip) # 0x14378
pushq $0x69
popq %rbx
leaq 0x20(%rsp), %rdi
movl %ebx, 0xc(%rdi)
callq 0xd232
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xaf05(%rip), %rdi      # 0xe233
leaq 0xaf19(%rip), %rsi      # 0xe24e
leaq 0xaf1b(%rip), %rcx      # 0xe257
pushq $0x7a
popq %rdx
callq 0x2110