// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rax
movq %rdi, %rbx
leaq -0x58(%rbp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x33b0
movq -0x60(%rbp), %rdx
testq %rdx, %rdx
je 0xd3de
cmpq 0xb8(%rbx), %rdx
jne 0xd3c0
movq 0xb0(%rbx), %rsi
movq -0x68(%rbp), %rdi
callq 0x3310
testl %eax, %eax
jne 0xd3c0
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x35c5(%rip), %rsi      # 0x108da
leaq 0x35c5(%rip), %rdx      # 0x108e1
leaq -0x48(%rbp), %rdi
callq 0x4bc4
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x5b8c
movl %eax, %r14d
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0xd349
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x32f0
testb %r14b, %r14b
jne 0xd3fc
leaq -0x48(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x35ae(%rip), %rsi      # 0x1090e
leaq 0x35b6(%rip), %rdx      # 0x1091d
callq 0x4bc4
leaq 0x9545(%rip), %rdi      # 0x168b8
leaq -0x48(%rbp), %rsi
callq 0x796a
movq %rbx, %rdi
movq %rax, %rsi
callq 0xc248
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0xd39c
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x32f0
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0xd3b1
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x32f0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x3180
movq %rax, %r12
leaq 0x34ea(%rip), %rsi      # 0x108be
movq %rax, %rdi
callq 0x3130
jmp 0xd42f
movl $0x10, %edi
callq 0x3180
movq %rax, %r12
leaq 0x345a(%rip), %rsi      # 0x1084c
movq %rax, %rdi
callq 0x3130
jmp 0xd42f
movb $0x1, 0xd8(%rbx)
leaq 0x70(%rbx), %rdi
leaq 0x34d4(%rip), %rsi      # 0x108e2
callq 0x33e0
movl $0x10, %edi
callq 0x3180
movq %rax, %r12
leaq 0x34c5(%rip), %rsi      # 0x108ec
movq %rax, %rdi
callq 0x3130
movq 0x8bba(%rip), %rsi      # 0x15ff0
movq 0x8b73(%rip), %rdx      # 0x15fb0
movq %r12, %rdi
callq 0x3500
jmp 0xd44f
jmp 0xd44f
jmp 0xd47c
jmp 0xd45f
jmp 0xd47c
movq %rdx, %r15
movq %rax, %r14
movq %r12, %rdi
callq 0x3250
jmp 0xd482
movq %rdx, %r15
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0xd482
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x32f0
jmp 0xd482
movq %rdx, %r15
movq %rax, %r14
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0xd497
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x32f0
cmpl $0x1, %r15d
jne 0xd4dd
movq %r14, %rdi
callq 0x3140
movl 0xd0(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xd0(%rbx)
cmpl $0x2, %eax
jl 0xd4d0
leaq 0x345e(%rip), %rsi      # 0x1091e
movq %rbx, %rdi
callq 0xd616
movq %rbx, %rdi
callq 0xd712
callq 0x3420
movq %rax, %r14
callq 0x34c0
movq %r14, %rdi
callq 0x3530
movq %rax, %rdi
callq 0x6550