// File: /workspace/github_c_makefile_star2_O2/dalnefre[P]kernel_abe/life.c
// Function: int_generator
BEH_DECL(int_generator)
{
	CONS* msg = WHAT;
	CONS* next = map_get(msg, ATOM("next"));
	CONS* state = MINE;
	CONS* step = map_get(state, ATOM("step"));
	CONS* limit = map_get(state, ATOM("limit"));
	CONS* label = map_get(state, ATOM("label"));
	CONS* ctx = map_get_def(state, ATOM("ctx"), NIL);
	CONS* send_to = map_get(state, ATOM("send-to"));
	
	DBUG_ENTER("int_generator");
	DBUG_PRINT("", ("next=%s", cons_to_str(next)));
	assert(atomp(label));
	assert(actorp(send_to));
	if (0 < MK_INT(step)) {
		if (MK_INT(next) <= MK_INT(limit)) {
			SEND(send_to, map_put(ctx, label, next));
			next = NUMBER(MK_INT(next) + MK_INT(step));
			SEND(SELF, map_put(NIL, ATOM("next"), next));
		}
	} else {
		if (MK_INT(next) >= MK_INT(limit)) {
			SEND(send_to, map_put(ctx, label, next));
			next = NUMBER(MK_INT(next) + MK_INT(step));
			SEND(SELF, map_put(NIL, ATOM("next"), next));
		}
	}
	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 0xb3d2
movq %rax, %r14
leaq 0xbc72(%rip), %rdi      # 0xe0cb
callq 0x89eb
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xb853
movq %rax, %r14
movq %rax, (%rsp)
movq %rbx, 0x10(%rsp)
movq 0x30(%rbx), %rdi
callq 0xb2c7
movq %rax, %rdi
callq 0x3827
movq %rax, %r15
leaq 0xbb76(%rip), %rdi      # 0xe008
callq 0x89eb
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xb853
movq %rax, %r12
leaq 0xbb5f(%rip), %rdi      # 0xe00d
callq 0x89eb
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xb853
movq %rax, %r13
leaq 0xbb49(%rip), %rdi      # 0xe013
callq 0x89eb
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xb853
movq %rax, 0x18(%rsp)
leaq 0xbb31(%rip), %rdi      # 0xe019
callq 0x89eb
leaq 0x11e74(%rip), %rdx     # 0x14368
movq %r15, %rdi
movq %rax, %rsi
callq 0xb853
movq %rax, 0x8(%rsp)
leaq 0xbb12(%rip), %rdi      # 0xe01d
callq 0x89eb
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xb853
movq %rax, %r15
leaq 0xbafe(%rip), %rax      # 0xe025
leaq 0x20(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x11ec2(%rip), %rbx     # 0x143f8
movq (%rbx), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x8a, 0xc(%rdi)
leaq 0xd88f(%rip), %rbp      # 0xfde0
movq %rbp, 0x10(%rdi)
leaq 0x11cd4(%rip), %rcx     # 0x14230
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xd145
leaq 0x12630(%rip), %rax     # 0x14ba0
cmpl $0x0, (%rax)
je 0x25b4
movq (%rbx), %rax
movq 0x50(%rax), %rax
movq %rbp, 0x10(%rax)
movq %rbp, %rdi
callq 0xc8c0
testl %eax, %eax
je 0x25b4
movq (%rbx), %rax
movq 0x50(%rax), %rax
movl $0x8b, 0xc(%rax)
movq (%rsp), %rdi
callq 0x57d4
leaq 0xba89(%rip), %rdi      # 0xe033
movq %rax, %rsi
xorl %eax, %eax
callq 0xd1bc
movq 0x18(%rsp), %rsi
movl %esi, %eax
andl $0x3, %eax
cmpl $0x2, %eax
jne 0x2682
movl %r15d, %eax
andl $0x3, %eax
cmpl $0x1, %eax
jne 0x26a1
shrq $0x2, %r12
shrq $0x2, %r14
shrq $0x2, %r13
testl %r12d, %r12d
jle 0x2677
cmpl %r13d, %r14d
jg 0x2657
movq 0x8(%rsp), %rdi
movq (%rsp), %rdx
callq 0xb8c5
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x4560
addl %r14d, %r12d
movslq %r12d, %rax
leaq 0x3(,%rax,4), %r14
movq 0x30(%rbx), %rdi
callq 0xb2c7
movq %rax, %r15
leaq 0xba99(%rip), %rdi      # 0xe0cb
callq 0x89eb
leaq 0x11d2a(%rip), %rdi     # 0x14368
movq %rax, %rsi
movq %r14, %rdx
callq 0xb8c5
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x4560
leaq 0x20(%rsp), %rdi
movl $0x9b, 0xc(%rdi)
callq 0xd2be
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl %r13d, %r14d
jge 0x25f0
jmp 0x2657
leaq 0xb9b2(%rip), %rdi      # 0xe03b
leaq 0xb9b8(%rip), %rsi      # 0xe048
leaq 0xb9b8(%rip), %rcx      # 0xe04f
movl $0x8c, %edx
callq 0x2110
leaq 0xb9c4(%rip), %rdi      # 0xe06c
leaq 0xb999(%rip), %rsi      # 0xe048
leaq 0xb999(%rip), %rcx      # 0xe04f
movl $0x8d, %edx
callq 0x2110