// File: /workspace/github_cpp_makefile_star2_O2/nickgammon[P]tinymudserver/states.cpp
// Function: ProcessPlayerPassword(tPlayer*, std::istream&)
void ProcessPlayerPassword (tPlayer * p, istream & sArgs)
{
  try
    {
    string password;
    sArgs >> password;

    /* password can't be blank */
    if (password.empty ())
      throw runtime_error ("Password cannot be blank.");
        
    if (password != p->password)
      throw runtime_error ("That password is incorrect.");

    // check for "blocked" flag on this player
    if (p->HaveFlag ("blocked"))
      {
      p->ClosePlayer ();
      p->prompt = "Goodbye.\n";
      throw runtime_error ("You are not permitted to connect.");
      }
      
    // OK, they're in!
    PlayerEnteredGame (p, messagemap ["existing_player"]);
 
    } // end of try block
    
  // detect too many password attempts
  catch (runtime_error & e)
    {
    if (++p->badPasswordCount >= MAX_PASSWORD_ATTEMPTS)
      {
      *p << "Too many attempts to guess the password!\n";
      p->Init ();
      }
      throw;
    }
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rax
movq %rdi, %rbx
leaq -0x58(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x33c0
cmpq $0x0, -0x60(%rbp)
je 0xaca0
leaq 0xb0(%rbx), %rsi
leaq -0x68(%rbp), %rdi
callq 0xaf23
testb %al, %al
jne 0xacbc
leaq 0x2ca4(%rip), %rsi      # 0xd8c8
leaq -0x48(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x43b6
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x4f3a
movl %eax, %r14d
leaq -0x48(%rbp), %rdi
callq 0x35c8
testb %r14b, %r14b
jne 0xacd8
leaq 0x2ca3(%rip), %rsi      # 0xd8fc
leaq -0x48(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x43b6
leaq 0x9c4b(%rip), %rdi      # 0x148b8
leaq -0x48(%rbp), %rsi
callq 0x6792
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa1ac
leaq -0x48(%rbp), %rdi
callq 0x35c8
leaq -0x68(%rbp), %rdi
callq 0x35c8
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x31b0
movq %rax, %r12
leaq 0x2b88(%rip), %rsi      # 0xd83a
movq %rax, %rdi
callq 0x3140
jmp 0xad09
pushq $0x10
popq %rdi
callq 0x31b0
movq %rax, %r12
leaq 0x2bde(%rip), %rsi      # 0xd8ac
movq %rax, %rdi
callq 0x3140
jmp 0xad09
movb $0x1, 0xd8(%rbx)
leaq 0x70(%rbx), %rdi
leaq 0x2be6(%rip), %rsi      # 0xd8d0
callq 0x3580
pushq $0x10
popq %rdi
callq 0x31b0
movq %rax, %r12
leaq 0x2bd9(%rip), %rsi      # 0xd8da
movq %rax, %rdi
callq 0x3140
movq 0x92e0(%rip), %rsi      # 0x13ff0
movq 0x92a1(%rip), %rdx      # 0x13fb8
movq %r12, %rdi
callq 0x34e0
jmp 0xad23
jmp 0xad23
movq %rdx, %r15
movq %rax, %r14
movq %r12, %rdi
callq 0x3270
jmp 0xad50
jmp 0xad4a
jmp 0xad39
jmp 0xad4a
movq %rdx, %r15
movq %rax, %r14
leaq -0x48(%rbp), %rdi
callq 0x35c8
jmp 0xad50
movq %rdx, %r15
movq %rax, %r14
leaq -0x68(%rbp), %rdi
callq 0x35c8
cmpl $0x1, %r15d
jne 0xad9f
movq %r14, %rdi
callq 0x3150
movl 0xd0(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xd0(%rbx)
cmpl $0x2, %eax
jl 0xad92
leaq 0x2b8a(%rip), %rsi      # 0xd90c
movq %rbx, %rdi
callq 0xaf30
movq %rbx, %rdi
callq 0xafd8
callq 0x3430
movq %rax, %r14
callq 0x34b0
movq %r14, %rdi
callq 0x3500
movq %rax, %rdi
callq 0x5618