// File: /workspace/github_c_makefile_star2_O0/dalnefre[P]kernel_abe/challenge.c
// Function: countdown_ring
BEH_DECL(countdown_ring)
{
	CONS* m = WHAT;
	CONS* state = MINE;
	CONS* n = map_get(state, ATOM("n"));
	CONS* a = map_get(state, ATOM("a"));

	DBUG_ENTER("countdown_ring");
	DBUG_PRINT("", ("self=%p", SELF));
	DBUG_PRINT("", ("m=%d n=%d a=%p", MK_INT(m), MK_INT(n), a));
	if (MK_INT(m) < 0) {
		SEND(a, n);
	} else if (0 < MK_INT(n)) {
		SEND(a, m);
	} else if (0 < MK_INT(m)) {
		SEND(a, NUMBER(MK_INT(m) - 1));
	}
	DBUG_RETURN;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %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 0xfd49(%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 0xfc87(%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 0xfc69(%rip), %rax      # 0x12006
movq %rax, -0x50(%rbp)
leaq 0x14f50(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x48(%rbp)
movl $0x2e, -0x44(%rbp)
leaq 0x11a55(%rip), %rax     # 0x13e18
movq %rax, -0x40(%rbp)
leaq 0x14d52(%rip), %rax     # 0x17120
movq %rax, -0x38(%rbp)
leaq 0x14f1f(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x10b00
leaq 0x1549c(%rip), %rax     # 0x17890
cmpl $0x0, (%rax)
je 0x2456
leaq 0x14ef8(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x11a0a(%rip), %rcx     # 0x13e18
movq %rcx, 0x10(%rax)
leaq 0x119ff(%rip), %rdi     # 0x13e18
callq 0xff10
cmpl $0x0, %eax
je 0x2456
leaq 0x14ece(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x2f, 0xc(%rax)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xd9f0
movq %rax, %rsi
leaq 0xfbc6(%rip), %rdi      # 0x12015
movb $0x0, %al
callq 0x10bb0
jmp 0x2458
jmp 0x245a
leaq 0x1542f(%rip), %rax     # 0x17890
cmpl $0x0, (%rax)
je 0x24cb
leaq 0x14e8b(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x1199d(%rip), %rcx     # 0x13e18
movq %rcx, 0x10(%rax)
leaq 0x11992(%rip), %rdi     # 0x13e18
callq 0xff10
cmpl $0x0, %eax
je 0x24cb
leaq 0x14e61(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x30, 0xc(%rax)
movq -0x10(%rbp), %rax
sarq $0x2, %rax
movl %eax, %esi
movq -0x20(%rbp), %rax
sarq $0x2, %rax
movl %eax, %edx
movq -0x28(%rbp), %rcx
leaq 0xfb59(%rip), %rdi      # 0x1201d
movb $0x0, %al
callq 0x10bb0
jmp 0x24cd
movq -0x10(%rbp), %rax
sarq $0x2, %rax
cmpl $0x0, %eax
jge 0x24ed
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x3e80
jmp 0x2547
movq -0x20(%rbp), %rax
sarq $0x2, %rax
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jge 0x2510
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x3e80
jmp 0x2545
movq -0x10(%rbp), %rax
sarq $0x2, %rax
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jge 0x2543
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rax
sarq $0x2, %rax
subl $0x1, %eax
movslq %eax, %rdx
shlq $0x2, %rdx
orq $0x3, %rdx
callq 0x3e80
jmp 0x2545
jmp 0x2547
movl $0x38, -0x44(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x10cd0
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)