// File: /workspace/github_c_makefile_star2_O0/dalnefre[P]kernel_abe/actor.c
// Function: abe__clock_tick
static void
abe__clock_tick(CONFIG* cfg)
/*
 * Update real-time clock and send any delayed messages whose time has come.
 */
{
	CONS* t_node;
	struct timeval tv;

	if (gettimeofday(&tv, NULL) == 0) {
		cfg->t_now_s = (tv.tv_sec - cfg->t_epoch);
		cfg->t_now_us = tv.tv_usec;
		DBUG_PRINT("timer", ("t = %lus %luus", cfg->t_now_s, cfg->t_now_us));
	}
	while (!nilp(t_node = cfg->t_queue)) {
		CONS* t_entry = car(t_node);
		CONS* t_timer = car(t_entry);
		time_t s;
		time_t us;

		s = MK_INT(map_get_def(t_timer, ATOM("s"), NUMBER(0)));
		us = MK_INT(map_get_def(t_timer, ATOM("us"), NUMBER(0)));
		if (tv_compare(s, us, cfg->t_now_s, cfg->t_now_us) > 0) {
			break;		/* not yet time to send this message */
		}
		/* pop message from delay-timer queue and send it */
		--cfg->t_count;
		DBUG_PRINT("timer", ("t_count=%d", cfg->t_count));
		cfg->t_queue = cdr(t_node);
		abe__send(cfg, car(cdr(t_entry)), cdr(cdr(t_entry)));
		cq_free(cdr(t_entry));
		t_entry = cq_free(t_entry);
		t_node = cq_free(t_node);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x20f0
cmpl $0x0, %eax
jne 0x1c58f
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
subq 0x48(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x58(%rax)
leaq 0x133f7(%rip), %rax     # 0x2f920
cmpl $0x0, (%rax)
je 0x1c58b
leaq 0x12deb(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0xd785(%rip), %rcx      # 0x29cc8
movq %rcx, 0x10(%rax)
leaq 0xd77a(%rip), %rdi      # 0x29cc8
callq 0x278a0
cmpl $0x0, %eax
je 0x1c58b
leaq 0x12dc1(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x1e0, 0xc(%rax)       # imm = 0x1E0
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdx
leaq 0xd753(%rip), %rdi      # 0x29cd7
movb $0x0, %al
callq 0x28540
jmp 0x1c58d
jmp 0x1c58f
jmp 0x1c591
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x10(%rbp)
leaq 0x12cec(%rip), %rcx     # 0x2f290
cmpq %rcx, %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1c5c3
jmp 0x1c753
movq -0x10(%rbp), %rdi
callq 0x25380
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x25380
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq 0xdf7a(%rip), %rdi      # 0x2a566
callq 0x216e0
movq -0x50(%rbp), %rdi
movq %rax, %rsi
movl $0x3, %edx
callq 0x25d30
sarq $0x2, %rax
cltq
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq 0xd6c8(%rip), %rdi      # 0x29ce3
callq 0x216e0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movl $0x3, %edx
callq 0x25d30
sarq $0x2, %rax
cltq
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rcx
callq 0x1ad50
cmpl $0x0, %eax
jle 0x1c662
jmp 0x1c753
movq -0x8(%rbp), %rax
movl 0x68(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x68(%rax)
leaq 0x132aa(%rip), %rax     # 0x2f920
cmpl $0x0, (%rax)
je 0x1c6cf
leaq 0x12c9e(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0xd638(%rip), %rcx      # 0x29cc8
movq %rcx, 0x10(%rax)
leaq 0xd62d(%rip), %rdi      # 0x29cc8
callq 0x278a0
cmpl $0x0, %eax
je 0x1c6cf
leaq 0x12c74(%rip), %rax     # 0x2f320
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x1ef, 0xc(%rax)       # imm = 0x1EF
movq -0x8(%rbp), %rax
movl 0x68(%rax), %esi
leaq 0xd969(%rip), %rdi      # 0x2a031
movb $0x0, %al
callq 0x28540
jmp 0x1c6d1
movq -0x10(%rbp), %rdi
callq 0x25510
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x28(%rbp), %rdi
callq 0x25510
movq %rax, %rdi
callq 0x25380
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rdi
callq 0x25510
movq %rax, %rdi
callq 0x25510
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq %rax, %rdx
callq 0x1b810
movq -0x28(%rbp), %rdi
callq 0x25510
movq %rax, %rdi
callq 0x1d150
movq -0x28(%rbp), %rdi
callq 0x1d150
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1d150
movq %rax, -0x10(%rbp)
jmp 0x1c591
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)