// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xee80
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xecf0
movq %rax, %rdi
callq 0x3f70
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq 0xfef4(%rip), %rdi      # 0x131af
callq 0xb050
movq -0x90(%rbp), %rdi
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xf6a0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq 0xff08(%rip), %rdi      # 0x131f1
callq 0xb050
movq -0x88(%rbp), %rdi
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xf6a0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq 0xfe9b(%rip), %rdi      # 0x131af
callq 0xb050
movq -0x80(%rbp), %rdi
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xf6a0
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq 0xfeb2(%rip), %rdi      # 0x131ee
callq 0xb050
movq -0x78(%rbp), %rdi
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xf6a0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0xecf0
movq %rax, -0x40(%rbp)
leaq 0xfe8c(%rip), %rax      # 0x131f5
movq %rax, -0x68(%rbp)
leaq 0x14f9c(%rip), %rax     # 0x18310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x60(%rbp)
movl $0x60, -0x5c(%rbp)
leaq 0x11cd1(%rip), %rax     # 0x15060
movq %rax, -0x58(%rbp)
leaq 0x14dde(%rip), %rax     # 0x18178
movq %rax, -0x50(%rbp)
leaq 0x14f6b(%rip), %rax     # 0x18310
movq (%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x48(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x11e00
leaq 0x15500(%rip), %rax     # 0x188c0
cmpl $0x0, (%rax)
je 0x341e
leaq 0x14f44(%rip), %rax     # 0x18310
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x11c86(%rip), %rcx     # 0x15060
movq %rcx, 0x10(%rax)
leaq 0x11c7b(%rip), %rdi     # 0x15060
callq 0x11210
cmpl $0x0, %eax
je 0x341e
leaq 0x14f1a(%rip), %rax     # 0x18310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x61, 0xc(%rax)
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
leaq 0xfdea(%rip), %rdi      # 0x13201
movb $0x0, %al
callq 0x11eb0
jmp 0x3420
movq -0x38(%rbp), %rax
andq $0x3, %rax
cmpq $0x2, %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x35f2
jmp 0x3442
leaq 0x15477(%rip), %rax     # 0x188c0
cmpl $0x0, (%rax)
je 0x34a7
leaq 0x14ebb(%rip), %rax     # 0x18310
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x11bfd(%rip), %rcx     # 0x15060
movq %rcx, 0x10(%rax)
leaq 0x11bf2(%rip), %rdi     # 0x15060
callq 0x11210
cmpl $0x0, %eax
je 0x34a7
leaq 0x14e91(%rip), %rax     # 0x18310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x63, 0xc(%rax)
movq -0x38(%rbp), %rdi
callq 0xb110
movq %rax, %rsi
leaq 0xfd73(%rip), %rdi      # 0x13213
movb $0x0, %al
callq 0x11eb0
jmp 0x34a9
movq -0x38(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq 0xfd31(%rip), %rdi      # 0x131ec
callq 0xb050
movq %rax, %rcx
movq -0x98(%rbp), %rax
cmpq %rcx, %rax
jne 0x3580
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xecf0
movq %rax, %rdi
leaq 0xaf6(%rip), %rsi       # 0x3fe0
leaq 0x14d8f(%rip), %rdx     # 0x18280
callq 0x4450
leaq 0x153c3(%rip), %rax     # 0x188c0
cmpl $0x0, (%rax)
je 0x354f
leaq 0x14e07(%rip), %rax     # 0x18310
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x11b49(%rip), %rcx     # 0x15060
movq %rcx, 0x10(%rax)
leaq 0x11b3e(%rip), %rdi     # 0x15060
callq 0x11210
cmpl $0x0, %eax
je 0x354f
leaq 0x14ddd(%rip), %rax     # 0x18310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x66, 0xc(%rax)
leaq 0xfcd1(%rip), %rdi      # 0x13219
movb $0x0, %al
callq 0x11eb0
jmp 0x3551
leaq 0xfcca(%rip), %rdi      # 0x13222
movb $0x0, %al
callq 0x20e0
movl $0x1, %eax
movq %rax, 0x14dfd(%rip)     # 0x18368
movl $0x69, -0x5c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x11fd0
jmp 0x39c4
jmp 0x3582
leaq 0x15337(%rip), %rax     # 0x188c0
cmpl $0x0, (%rax)
je 0x35db
leaq 0x14d7b(%rip), %rax     # 0x18310
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x11abd(%rip), %rcx     # 0x15060
movq %rcx, 0x10(%rax)
leaq 0x11ab2(%rip), %rdi     # 0x15060
callq 0x11210
cmpl $0x0, %eax
je 0x35db
leaq 0x14d51(%rip), %rax     # 0x18310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x6b, 0xc(%rax)
leaq 0xfc65(%rip), %rdi      # 0x13239
movb $0x0, %al
callq 0x11eb0
jmp 0x35dd
movl $0x6c, -0x5c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x11fd0
jmp 0x39c4
movq -0x20(%rbp), %rax
cmpq -0x30(%rbp), %rax
je 0x37f1
xorl %eax, %eax
cmpq $0x0, -0x28(%rbp)
movb %al, -0x99(%rbp)
je 0x3624
movq -0x28(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
sete %al
movb %al, -0x99(%rbp)
movb -0x99(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x3764
movq -0x28(%rbp), %rdi
callq 0xecf0
movq %rax, %rcx
xorl %eax, %eax
movl $0x1, %edx
cmpq %rdx, %rcx
movb %al, -0x9a(%rbp)
je 0x3673
movq -0x28(%rbp), %rdi
callq 0xecf0
andq $0x3, %rax
cmpq $0x3, %rax
sete %al
movb %al, -0x9a(%rbp)
movb -0x9a(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x3764
movq -0x28(%rbp), %rdi
callq 0xee80
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x9b(%rbp)
je 0x36be
movq -0x28(%rbp), %rdi
callq 0xee80
andq $0x3, %rax
cmpq $0x0, %rax
sete %al
movb %al, -0x9b(%rbp)
movb -0x9b(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x3764
leaq 0x14ba4(%rip), %rax     # 0x18280
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq 0xfad8(%rip), %rdi      # 0x131ca
callq 0xb050
movq %rax, -0xb0(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xecf0
movq -0xb8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
movq %rax, %rdx
callq 0xf790
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0xa8(%rbp)
leaq 0xfa78(%rip), %rdi      # 0x131af
callq 0xb050
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
movq -0x30(%rbp), %rdx
callq 0xf790
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x70(%rbp), %rdx
callq 0x5180
leaq 0xfa86(%rip), %rdi      # 0x131f1
callq 0xb050
movq %rax, %rsi
movq -0x28(%rbp), %rdx
leaq 0x14b02(%rip), %rdi     # 0x18280
callq 0xf790
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xc8(%rbp)
leaq 0xfa16(%rip), %rdi      # 0x131af
callq 0xb050
movq -0xc8(%rbp), %rdi
movq %rax, %rsi
movq -0x30(%rbp), %rdx
callq 0xf790
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xecf0
movq %rax, -0xc0(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xecf0
movq %rax, %rdi
callq 0x3f00
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0x4450
jmp 0x37f3
jmp 0x37f5
leaq 0x150c4(%rip), %rax     # 0x188c0
cmpl $0x0, (%rax)
je 0x385a
leaq 0x14b08(%rip), %rax     # 0x18310
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x1184a(%rip), %rcx     # 0x15060
movq %rcx, 0x10(%rax)
leaq 0x1183f(%rip), %rdi     # 0x15060
callq 0x11210
cmpl $0x0, %eax
je 0x385a
leaq 0x14ade(%rip), %rax     # 0x18310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x79, 0xc(%rax)
movq -0x10(%rbp), %rdi
callq 0x6bc0
movq %rax, %rsi
leaq 0xf9f9(%rip), %rdi      # 0x1324c
movb $0x0, %al
callq 0x11eb0
jmp 0x385c
movq -0x40(%rbp), %rdi
callq 0xecf0
movq %rax, -0xd0(%rbp)
leaq 0xf93c(%rip), %rdi      # 0x131af
callq 0xb050
movq %rax, %rcx
movq -0xd0(%rbp), %rax
cmpq %rcx, %rax
jne 0x3889
jmp 0x38a8
leaq 0xf9c3(%rip), %rdi      # 0x13253
leaq 0xf9d7(%rip), %rsi      # 0x1326e
movl $0x7a, %edx
leaq 0xf9d4(%rip), %rcx      # 0x13277
callq 0x2100
callq 0x2bf0
movq %rax, -0x30(%rbp)
leaq 0x15008(%rip), %rax     # 0x188c0
cmpl $0x0, (%rax)
je 0x390e
leaq 0x14a4c(%rip), %rax     # 0x18310
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x1178e(%rip), %rcx     # 0x15060
movq %rcx, 0x10(%rax)
leaq 0x11783(%rip), %rdi     # 0x15060
callq 0x11210
cmpl $0x0, %eax
je 0x390e
leaq 0x14a22(%rip), %rax     # 0x18310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x7c, 0xc(%rax)
movq -0x30(%rbp), %rsi
leaq 0xf98b(%rip), %rdi      # 0x13292
movb $0x0, %al
callq 0x11eb0
jmp 0x3910
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xf040
leaq 0x14f9c(%rip), %rax     # 0x188c0
cmpl $0x0, (%rax)
je 0x3982
leaq 0x149e0(%rip), %rax     # 0x18310
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x11722(%rip), %rcx     # 0x15060
movq %rcx, 0x10(%rax)
leaq 0x11717(%rip), %rdi     # 0x15060
callq 0x11210
cmpl $0x0, %eax
je 0x3982
leaq 0x149b6(%rip), %rax     # 0x18310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x7e, 0xc(%rax)
movq -0x10(%rbp), %rdi
callq 0x6bc0
movq %rax, %rsi
leaq 0xf92b(%rip), %rdi      # 0x132a6
movb $0x0, %al
callq 0x11eb0
jmp 0x3984
movq -0x8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xecf0
movq -0xd8(%rbp), %rdi
movq %rax, %rdx
movq -0x10(%rbp), %rcx
movl $0x145857, %esi         # imm = 0x145857
callq 0x5530
movl $0x80, -0x5c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x11fd0
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax)