// File: /workspace/github_c_makefile_star2_O1/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 0xbdd9
movq %rax, %r14
leaq 0xb810(%rip), %rdi      # 0xe0cb
callq 0x9210
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xc20e
movq %rax, %r14
movq %rax, (%rsp)
movq %rbx, 0x10(%rsp)
movq 0x30(%rbx), %rdi
callq 0xbd3a
movq %rax, %rdi
callq 0x3ea5
movq %rax, %r15
leaq 0xb714(%rip), %rdi      # 0xe008
callq 0x9210
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xc20e
movq %rax, %r12
leaq 0xb6fd(%rip), %rdi      # 0xe00d
callq 0x9210
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xc20e
movq %rax, %r13
leaq 0xb6e7(%rip), %rdi      # 0xe013
callq 0x9210
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xc20e
movq %rax, 0x18(%rsp)
leaq 0xb6cf(%rip), %rdi      # 0xe019
callq 0x9210
leaq 0x10a12(%rip), %rdx     # 0x13368
movq %r15, %rdi
movq %rax, %rsi
callq 0xc20e
movq %rax, 0x8(%rsp)
leaq 0xb6b0(%rip), %rdi      # 0xe01d
callq 0x9210
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xc20e
movq %rax, %r15
leaq 0xb69c(%rip), %rax      # 0xe025
leaq 0x20(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x10a60(%rip), %rbx     # 0x133f8
movq (%rbx), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x8a, 0xc(%rdi)
leaq 0xd451(%rip), %rbp      # 0xfe04
movq %rbp, 0x10(%rdi)
leaq 0x10872(%rip), %rcx     # 0x13230
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xdaa6
leaq 0x111ce(%rip), %rax     # 0x13ba0
cmpl $0x0, (%rax)
je 0x2a16
movq (%rbx), %rax
movq 0x50(%rax), %rax
movq %rbp, 0x10(%rax)
movq %rbp, %rdi
callq 0xd218
testl %eax, %eax
je 0x2a16
movq (%rbx), %rax
movq 0x50(%rax), %rax
movl $0x8b, 0xc(%rax)
movq (%rsp), %rdi
callq 0x5d30
leaq 0xb627(%rip), %rdi      # 0xe033
movq %rax, %rsi
xorl %eax, %eax
callq 0xdb17
movq 0x18(%rsp), %rsi
movl %esi, %eax
andl $0x3, %eax
cmpl $0x2, %eax
jne 0x2ae4
movl %r15d, %eax
andl $0x3, %eax
cmpl $0x1, %eax
jne 0x2b03
shrq $0x2, %r12
shrq $0x2, %r14
shrq $0x2, %r13
testl %r12d, %r12d
jle 0x2ad9
cmpl %r13d, %r14d
jg 0x2ab9
movq 0x8(%rsp), %rdi
movq (%rsp), %rdx
callq 0xc280
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x4aab
addl %r14d, %r12d
movslq %r12d, %rax
leaq 0x3(,%rax,4), %r14
movq 0x30(%rbx), %rdi
callq 0xbd3a
movq %rax, %r15
leaq 0xb637(%rip), %rdi      # 0xe0cb
callq 0x9210
leaq 0x108c8(%rip), %rdi     # 0x13368
movq %rax, %rsi
movq %r14, %rdx
callq 0xc280
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x4aab
leaq 0x20(%rsp), %rdi
movl $0x9b, 0xc(%rdi)
callq 0xdc2b
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl %r13d, %r14d
jge 0x2a52
jmp 0x2ab9
leaq 0xb550(%rip), %rdi      # 0xe03b
leaq 0xb556(%rip), %rsi      # 0xe048
leaq 0xb556(%rip), %rcx      # 0xe04f
movl $0x8c, %edx
callq 0x2110
leaq 0xb562(%rip), %rdi      # 0xe06c
leaq 0xb537(%rip), %rsi      # 0xe048
leaq 0xb537(%rip), %rcx      # 0xe04f
movl $0x8d, %edx
callq 0x2110