// File: /workspace/github_c_makefile_star2_O0/dalnefre[P]kernel_abe/challenge.c
// Function: challenge
BEH_DECL(challenge)
{
	CONS* msg = WHAT;
	CONS* state = MINE;
	CONS* n = map_get(state, ATOM("n"));
	CONS* a = map_get(state, ATOM("a"));

	DBUG_ENTER("challenge");
	DBUG_PRINT("", ("self=%p", SELF));
	DBUG_PRINT("", ("msg=%p n=%d a=%p", msg, MK_INT(n), a));
	if (0 < MK_INT(n)) {
		a = ACTOR(challenge, map_put(NIL, ATOM("n"), NUMBER(MK_INT(n) - 1)));
		BECOME(countdown_ring, map_put(state, ATOM("a"), a));
		SEND(a, msg);
	} else {
		state = NIL;
		state = map_put(state, ATOM("a"), msg);
		state = map_put(state, ATOM("n"), n);
		BECOME(countdown_ring, state);
		SEND(msg, NUMBER(M_CNT));			/* disable this line for process creation only */
	}
	DBUG_RETURN;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xdb80
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xd9f0
movq %rax, %rdi
callq 0x2c70
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq 0xfaf6(%rip), %rdi      # 0x1209e
callq 0x9d50
movq -0x60(%rbp), %rdi
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xe3a0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq 0xfa34(%rip), %rdi      # 0x12004
callq 0x9d50
movq -0x58(%rbp), %rdi
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xe3a0
movq %rax, -0x28(%rbp)
leaq 0xfa59(%rip), %rax      # 0x12049
movq %rax, -0x50(%rbp)
leaq 0x14cfd(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x48(%rbp)
movl $0x51, -0x44(%rbp)
leaq 0x11802(%rip), %rax     # 0x13e18
movq %rax, -0x40(%rbp)
leaq 0x14aff(%rip), %rax     # 0x17120
movq %rax, -0x38(%rbp)
leaq 0x14ccc(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x10b00
leaq 0x15249(%rip), %rax     # 0x17890
cmpl $0x0, (%rax)
je 0x26a9
leaq 0x14ca5(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x117b7(%rip), %rcx     # 0x13e18
movq %rcx, 0x10(%rax)
leaq 0x117ac(%rip), %rdi     # 0x13e18
callq 0xff10
cmpl $0x0, %eax
je 0x26a9
leaq 0x14c7b(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x52, 0xc(%rax)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xd9f0
movq %rax, %rsi
leaq 0xf973(%rip), %rdi      # 0x12015
movb $0x0, %al
callq 0x10bb0
jmp 0x26ab
jmp 0x26ad
leaq 0x151dc(%rip), %rax     # 0x17890
cmpl $0x0, (%rax)
je 0x2718
leaq 0x14c38(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x1174a(%rip), %rcx     # 0x13e18
movq %rcx, 0x10(%rax)
leaq 0x1173f(%rip), %rdi     # 0x13e18
callq 0xff10
cmpl $0x0, %eax
je 0x2718
leaq 0x14c0e(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x53, 0xc(%rax)
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rax
sarq $0x2, %rax
movl %eax, %edx
movq -0x28(%rbp), %rcx
leaq 0xf91b(%rip), %rdi      # 0x1202c
movb $0x0, %al
callq 0x10bb0
jmp 0x271a
movq -0x20(%rbp), %rax
sarq $0x2, %rax
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jge 0x27dc
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq 0xf961(%rip), %rdi      # 0x1209e
callq 0x9d50
movq %rax, %rsi
movq -0x20(%rbp), %rax
sarq $0x2, %rax
subl $0x1, %eax
movslq %eax, %rdx
shlq $0x2, %rdx
orq $0x3, %rdx
leaq 0x14b06(%rip), %rdi     # 0x17268
callq 0xe490
movq -0x78(%rbp), %rdi
movq %rax, %rdx
leaq -0x215(%rip), %rsi      # 0x2560
callq 0x3d60
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xd9f0
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq 0xf866(%rip), %rdi      # 0x12004
callq 0x9d50
movq -0x70(%rbp), %rdi
movq %rax, %rsi
movq -0x28(%rbp), %rdx
callq 0xe490
movq -0x68(%rbp), %rdi
movq %rax, %rdx
leaq -0x4b1(%rip), %rsi      # 0x2310
callq 0x3150
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x3e80
jmp 0x286f
leaq 0x14a85(%rip), %rax     # 0x17268
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq 0xf80b(%rip), %rdi      # 0x12004
callq 0x9d50
movq -0x88(%rbp), %rdi
movq %rax, %rsi
movq -0x10(%rbp), %rdx
callq 0xe490
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq 0xf87a(%rip), %rdi      # 0x1209e
callq 0x9d50
movq -0x80(%rbp), %rdi
movq %rax, %rsi
movq -0x20(%rbp), %rdx
callq 0xe490
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xd9f0
movq %rax, %rdi
movq -0x18(%rbp), %rdx
leaq -0x548(%rip), %rsi      # 0x2310
callq 0x3150
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x193, %edx            # imm = 0x193
callq 0x3e80
movl $0x5f, -0x44(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x10cd0
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax,%rax)