// File: /workspace/github_c_makefile_star2_O0/ajpaulson[P]srogue11/monsters.c
// Function: genocide
int genocide()
{
	struct linked_list *ip, *nip;
	struct thing *mp;
	struct monster *mm;
	int i, ii, c;

	if (levcount == 0) {
		mpos = 0;
		msg("You cannot genocide Asmodeus !!");
		return 0;
	}
tryagain:
	i = TRUE;		/* assume an error now */
	while (i) {
		msg("Which monster (remember UPPER & lower case)?");
		c = readchar();		/* get a char */
		if (c == ESCAPE) {	/* he can abort (the fool) */
			msg("");
			return 0;
		}
		if (isalpha(c))		/* valid char here */
			i = FALSE;		/* exit the loop */
		else {				/* he didn't type a letter */
			mpos = 0;
			msg("Please specify a letter between 'A' and 'z'");
		}
	}
	i = midx(c);						/* get index to monster */
	mm = &monsters[i];
	if (mm->m_lev.l_lev < 0) {
		mpos = 0;
		msg("You have already eliminated the %s.",mm->m_name);
		goto tryagain;
	}
	for (ip = mlist; ip != NULL; ip = nip) {
		mp = THINGPTR(ip);
		nip = next(ip);
		if (mp->t_type == c)
			remove_monster(&mp->t_pos, ip);
	}
	mm->m_lev.l_lev = -1;				/* get rid of it */
	mm->m_lev.h_lev = -1;
	lev_mon();							/* redo monster list */
	mpos = 0;
	msg("You have wiped out the %s.",mm->m_name);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
leaq 0x25f91(%rip), %rax     # 0x36cd0
cmpl $0x0, (%rax)
jne 0x10d6b
leaq 0x25f95(%rip), %rax     # 0x36ce0
movl $0x0, (%rax)
leaq 0x1a848(%rip), %rdi     # 0x2b5a0
movb $0x0, %al
callq 0xd8f0
movl $0x0, -0x4(%rbp)
jmp 0x10eea
jmp 0x10d6d
movl $0x1, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x10df8
leaq 0x1a83f(%rip), %rdi     # 0x2b5c0
movb $0x0, %al
callq 0xd8f0
movb $0x0, %al
callq 0xdce0
movsbl %al, %eax
movl %eax, -0x34(%rbp)
cmpl $0x1b, -0x34(%rbp)
jne 0x10db5
leaq 0x1d50d(%rip), %rdi     # 0x2e2af
movb $0x0, %al
callq 0xd8f0
movl $0x0, -0x4(%rbp)
jmp 0x10eea
callq 0x65b0
movq (%rax), %rax
movslq -0x34(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x10dd8
movl $0x0, -0x2c(%rbp)
jmp 0x10df3
leaq 0x25f01(%rip), %rax     # 0x36ce0
movl $0x0, (%rax)
leaq 0x1a801(%rip), %rdi     # 0x2b5ed
movb $0x0, %al
callq 0xd8f0
jmp 0x10d74
movl -0x34(%rbp), %eax
movsbl %al, %edi
callq 0x10400
movl %eax, -0x2c(%rbp)
movslq -0x2c(%rbp), %rcx
leaq 0x225af(%rip), %rax     # 0x333c0
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jge 0x10e4d
leaq 0x25eb3(%rip), %rax     # 0x36ce0
movl $0x0, (%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rsi
leaq 0x1a7d8(%rip), %rdi     # 0x2b619
movb $0x0, %al
callq 0xd8f0
jmp 0x10d6d
leaq 0x25e5c(%rip), %rax     # 0x36cb0
movq (%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x10ea6
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
movsbl 0x8d(%rax), %eax
cmpl -0x34(%rbp), %eax
jne 0x10e9a
movq -0x20(%rbp), %rdi
addq $0x50, %rdi
movq -0x10(%rbp), %rsi
callq 0xcac0
jmp 0x10e9c
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x10e5b
movq -0x28(%rbp), %rax
movl $0xffffffff, 0xc(%rax)  # imm = 0xFFFFFFFF
movq -0x28(%rbp), %rax
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
callq 0x10480
leaq 0x25e18(%rip), %rax     # 0x36ce0
movl $0x0, (%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rsi
leaq 0x1a761(%rip), %rdi     # 0x2b63d
movb $0x0, %al
callq 0xd8f0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)