// File: /workspace/github_c_makefile_star2_O3/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 0xbdf9
movq %rax, %r14
leaq 0xb870(%rip), %rdi      # 0xe0cb
callq 0x91e7
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xc22e
movq %rax, %r14
movq %rax, (%rsp)
movq %rbx, 0x10(%rsp)
movq 0x30(%rbx), %rdi
callq 0xbd5a
movq %rax, %rdi
callq 0x3e4d
movq %rax, %r15
leaq 0xb774(%rip), %rdi      # 0xe008
callq 0x91e7
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xc22e
movq %rax, %r12
leaq 0xb75d(%rip), %rdi      # 0xe00d
callq 0x91e7
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xc22e
movq %rax, %r13
leaq 0xb747(%rip), %rdi      # 0xe013
callq 0x91e7
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xc22e
movq %rax, 0x18(%rsp)
leaq 0xb72f(%rip), %rdi      # 0xe019
callq 0x91e7
leaq 0x10a72(%rip), %rdx     # 0x13368
movq %r15, %rdi
movq %rax, %rsi
callq 0xc22e
movq %rax, 0x8(%rsp)
leaq 0xb710(%rip), %rdi      # 0xe01d
callq 0x91e7
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xc22e
movq %rax, %r15
leaq 0xb6fc(%rip), %rax      # 0xe025
leaq 0x20(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x10ac0(%rip), %rbx     # 0x133f8
movq (%rbx), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x8a, 0xc(%rdi)
leaq 0xd4b1(%rip), %rbp      # 0xfe04
movq %rbp, 0x10(%rdi)
leaq 0x108d2(%rip), %rcx     # 0x13230
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xdb0e
leaq 0x1122e(%rip), %rax     # 0x13ba0
cmpl $0x0, (%rax)
je 0x29b6
movq (%rbx), %rax
movq 0x50(%rax), %rax
movq %rbp, 0x10(%rax)
movq %rbp, %rdi
callq 0xd270
testl %eax, %eax
je 0x29b6
movq (%rbx), %rax
movq 0x50(%rax), %rax
movl $0x8b, 0xc(%rax)
movq (%rsp), %rdi
callq 0x5d28
leaq 0xb687(%rip), %rdi      # 0xe033
movq %rax, %rsi
xorl %eax, %eax
callq 0xdb7f
movq 0x18(%rsp), %rsi
movl %esi, %eax
andl $0x3, %eax
cmpl $0x2, %eax
jne 0x2a84
movl %r15d, %eax
andl $0x3, %eax
cmpl $0x1, %eax
jne 0x2aa3
shrq $0x2, %r12
shrq $0x2, %r14
shrq $0x2, %r13
testl %r12d, %r12d
jle 0x2a79
cmpl %r13d, %r14d
jg 0x2a59
movq 0x8(%rsp), %rdi
movq (%rsp), %rdx
callq 0xc2a0
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x4a83
addl %r14d, %r12d
movslq %r12d, %rax
leaq 0x3(,%rax,4), %r14
movq 0x30(%rbx), %rdi
callq 0xbd5a
movq %rax, %r15
leaq 0xb697(%rip), %rdi      # 0xe0cb
callq 0x91e7
leaq 0x10928(%rip), %rdi     # 0x13368
movq %rax, %rsi
movq %r14, %rdx
callq 0xc2a0
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x4a83
leaq 0x20(%rsp), %rdi
movl $0x9b, 0xc(%rdi)
callq 0xdc93
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl %r13d, %r14d
jge 0x29f2
jmp 0x2a59
leaq 0xb5b0(%rip), %rdi      # 0xe03b
leaq 0xb5b6(%rip), %rsi      # 0xe048
leaq 0xb5b6(%rip), %rcx      # 0xe04f
movl $0x8c, %edx
callq 0x2110
leaq 0xb5c2(%rip), %rdi      # 0xe06c
leaq 0xb597(%rip), %rsi      # 0xe048
leaq 0xb597(%rip), %rcx      # 0xe04f
movl $0x8d, %edx
callq 0x2110