// File: /workspace/github_cpp_makefile_star2_O1/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 0xd454
cmpq 0xb8(%rbx), %rdx
jne 0xd436
movq 0xb0(%rbx), %rsi
movq -0x68(%rbp), %rdi
callq 0x3310
testl %eax, %eax
jne 0xd436
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x354f(%rip), %rsi      # 0x108da
leaq 0x354f(%rip), %rdx      # 0x108e1
leaq -0x48(%rbp), %rdi
callq 0x4bc4
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x5bca
movl %eax, %r14d
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0xd3bf
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x32f0
testb %r14b, %r14b
jne 0xd472
leaq -0x48(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x3538(%rip), %rsi      # 0x1090e
leaq 0x3540(%rip), %rdx      # 0x1091d
callq 0x4bc4
leaq 0x94cf(%rip), %rdi      # 0x168b8
leaq -0x48(%rbp), %rsi
callq 0x79b2
movq %rbx, %rdi
movq %rax, %rsi
callq 0xc2b4
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0xd412
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x32f0
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0xd427
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 0x3474(%rip), %rsi      # 0x108be
movq %rax, %rdi
callq 0x3130
jmp 0xd4a5
movl $0x10, %edi
callq 0x3180
movq %rax, %r12
leaq 0x33e4(%rip), %rsi      # 0x1084c
movq %rax, %rdi
callq 0x3130
jmp 0xd4a5
movb $0x1, 0xd8(%rbx)
leaq 0x70(%rbx), %rdi
leaq 0x345e(%rip), %rsi      # 0x108e2
callq 0x33e0
movl $0x10, %edi
callq 0x3180
movq %rax, %r12
leaq 0x344f(%rip), %rsi      # 0x108ec
movq %rax, %rdi
callq 0x3130
movq 0x8b44(%rip), %rsi      # 0x15ff0
movq 0x8afd(%rip), %rdx      # 0x15fb0
movq %r12, %rdi
callq 0x3500
jmp 0xd4c5
jmp 0xd4c5
jmp 0xd4f2
jmp 0xd4d5
jmp 0xd4f2
movq %rdx, %r15
movq %rax, %r14
movq %r12, %rdi
callq 0x3250
jmp 0xd4f8
movq %rdx, %r15
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0xd4f8
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x32f0
jmp 0xd4f8
movq %rdx, %r15
movq %rax, %r14
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0xd50d
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x32f0
cmpl $0x1, %r15d
jne 0xd553
movq %r14, %rdi
callq 0x3140
movl 0xd0(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xd0(%rbx)
cmpl $0x2, %eax
jl 0xd546
leaq 0x33e8(%rip), %rsi      # 0x1091e
movq %rbx, %rdi
callq 0xd68c
movq %rbx, %rdi
callq 0xd788
callq 0x3420
movq %rax, %r14
callq 0x34c0
movq %r14, %rdi
callq 0x3530
movq %rax, %rdi
callq 0x6584