// File: /workspace/github_c_makefile_star2_O0/dalnefre[P]kernel_abe/echallenge.c
// Function: erlang_challenge
void
erlang_challenge(int n, int m)
{
	CONFIG* cfg;
	int cnt;

	DBUG_ENTER("erlang_challenge");
	cfg = new_configuration(10);
	timing_actor = CFG_ACTOR(cfg, timing_beh, NIL);
	if (n <= 0) {
		CONS* ring;

		TRACE(printf("Seeding unbounded growth message ring.\n"));
		ring = CFG_ACTOR(cfg, ring_seed_beh, NUMBER(0));
		CFG_SEND(cfg, ring, ring);
	} else {
		CONS* countdown;

		TRACE(printf("Sending %d messages around a ring of %d processes.\n", m, n));
		countdown = CFG_ACTOR(cfg, countdown_builder_beh, NUMBER(n));
		CFG_SEND(cfg, countdown, cons(countdown, NUMBER(m)));
	}
	CFG_SEND(cfg, timing_actor, NIL);
	for (cnt = 1; cnt < 1000000; ++cnt) {
		int max = 1000000;
		int rem;

		rem = run_configuration(cfg, max);
/*		TRACE(printf("+ %d messages...\n", (max - rem))); */
		TRACE(fputc('.', stderr));
		if (cfg->q_count <= 0) {
			/* queue empty */
			break;
		}
	}
	TRACE(printf("< %dM messages delivered.\n", cnt));
	report_actor_usage(cfg);
	DBUG_RETURN;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
leaq 0xf5a5(%rip), %rax      # 0x120ea
movq %rax, -0x40(%rbp)
leaq 0x147a8(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x38(%rbp)
movl $0xb1, -0x34(%rbp)
leaq 0x113c5(%rip), %rax     # 0x13f30
movq %rax, -0x30(%rbp)
leaq 0x145aa(%rip), %rax     # 0x17120
movq %rax, -0x28(%rbp)
leaq 0x14777(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x20(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x10e70
movl $0xa, %edi
callq 0x37a0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x89e(%rip), %rsi      # 0x2310
leaq 0x146b3(%rip), %rdx     # 0x17268
callq 0x40d0
movq %rax, 0x14787(%rip)     # 0x17348
cmpl $0x0, -0x4(%rbp)
jg 0x2c01
leaq 0xf52d(%rip), %rdi      # 0x120fb
movb $0x0, %al
callq 0x20d0
movq -0x10(%rbp), %rdi
leaq -0x200(%rip), %rsi      # 0x29e0
movl $0x3, %edx
callq 0x40d0
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x41f0
jmp 0x2c6a
movl -0x8(%rbp), %esi
movl -0x4(%rbp), %edx
leaq 0xf515(%rip), %rdi      # 0x12123
movb $0x0, %al
callq 0x20d0
movq -0x10(%rbp), %rdi
movslq -0x4(%rbp), %rdx
shlq $0x2, %rdx
orq $0x3, %rdx
leaq -0x62c(%rip), %rsi      # 0x2600
callq 0x40d0
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x50(%rbp), %rdi
movslq -0x8(%rbp), %rsi
shlq $0x2, %rsi
orq $0x3, %rsi
callq 0xdc70
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq %rax, %rdx
callq 0x41f0
movq -0x10(%rbp), %rdi
movq 0x146d3(%rip), %rsi     # 0x17348
leaq 0x145ec(%rip), %rdx     # 0x17268
callq 0x41f0
movl $0x1, -0x14(%rbp)
cmpl $0xf4240, -0x14(%rbp)   # imm = 0xF4240
jge 0x2cd4
movl $0xf4240, -0x54(%rbp)   # imm = 0xF4240
movq -0x10(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x4af0
movl %eax, -0x58(%rbp)
movq 0x1434a(%rip), %rax     # 0x16ff8
movq (%rax), %rsi
movl $0x2e, %edi
callq 0x2110
movq -0x10(%rbp), %rax
cmpl $0x0, 0x28(%rax)
jg 0x2cc7
jmp 0x2cd4
jmp 0x2cc9
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2c88
movl -0x14(%rbp), %esi
leaq 0xf479(%rip), %rdi      # 0x12157
movb $0x0, %al
callq 0x20d0
movq -0x10(%rbp), %rdi
callq 0x5af0
movl $0xd0, -0x34(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x11040
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)