// File: nickgammon[P]tinymudserver/states.cpp
// Function: ProcessConfirmPassword(tPlayer*, std::istream&)
void ProcessConfirmPassword (tPlayer * p, istream & sArgs)
{
   string password;
   sArgs >> password;
  
  // password must agree
  if (password != p->password)
    {
    p->connstate = eAwaitingNewPassword;
    p->prompt = "Choose a password for " + p->playername + " ... ";
    throw runtime_error ("Password and confirmation do not agree.");
    }
  
  // that player might have been created while we were choosing a password, so check again
  ifstream f ((PLAYER_DIR + tocapitals (password) + PLAYER_EXT).c_str (), ios::in);
  if (f || FindPlayer (password))  // player file on disk, or playing without saving yet
    {
    p->connstate = eAwaitingNewName;
    p->prompt = "Please choose a name for your new character ... ";  // re-prompt for name
    throw runtime_error ("That player already exists, please choose another name.");
    }
  
  // New player now in the game
  PlayerEnteredGame (p, messagemap ["new_player"]);
         
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x360, %rsp            # imm = 0x360
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x45b0
movq -0x318(%rbp), %rsi
movq -0x10(%rbp), %rdi
callq 0x4550
jmp 0x16ea5
movq -0x8(%rbp), %rsi
addq $0xb0, %rsi
leaq -0x30(%rbp), %rdi
callq 0x17880
testb $0x1, %al
jne 0x16ec2
jmp 0x16fb9
movq -0x8(%rbp), %rax
movl $0x3, 0x68(%rax)
movq -0x8(%rbp), %rdx
addq $0x90, %rdx
leaq 0x5944(%rip), %rsi      # 0x1c823
leaq -0x80(%rbp), %rdi
callq 0x13750
jmp 0x16eea
leaq 0x58d8(%rip), %rdx      # 0x1c7c9
leaq -0x60(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xc6c0
jmp 0x16f00
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
leaq -0x60(%rbp), %rsi
movq %rsi, -0x328(%rbp)
callq 0x4520
movq -0x328(%rbp), %rdi
callq 0x47d8
leaq -0x80(%rbp), %rdi
callq 0x47d8
movl $0x10, %edi
callq 0x4250
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x320(%rbp)
leaq 0x592e(%rip), %rsi      # 0x1c879
callq 0x41c0
jmp 0x16f52
movq -0x320(%rbp), %rdi
movq 0x12090(%rip), %rsi     # 0x28ff0
movq 0x12051(%rip), %rdx     # 0x28fb8
callq 0x46a0
jmp 0x1726d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x1725b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x47d8
jmp 0x1725b
movq -0x320(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x4350
jmp 0x1725b
leaq -0x2e8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x6e20
jmp 0x16fcb
leaq 0x1282e(%rip), %rsi     # 0x29800
leaq -0x2c8(%rbp), %rdi
leaq -0x2e8(%rbp), %rdx
callq 0x17830
jmp 0x16fe7
leaq 0x12832(%rip), %rdx     # 0x29820
leaq -0x2a8(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x8c40
jmp 0x17003
leaq -0x2a8(%rbp), %rdi
callq 0x41e0
movq %rax, %rsi
leaq -0x288(%rbp), %rdi
movl $0x8, %edx
callq 0x4730
jmp 0x17025
leaq -0x2a8(%rbp), %rdi
callq 0x47d8
leaq -0x2c8(%rbp), %rdi
callq 0x47d8
leaq -0x2e8(%rbp), %rdi
callq 0x47d8
movq -0x288(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x288(%rbp,%rax), %rdi
callq 0x4540
movb %al, -0x329(%rbp)
jmp 0x17069
movb -0x329(%rbp), %al
testb $0x1, %al
jne 0x17098
jmp 0x17075
leaq -0x30(%rbp), %rdi
callq 0x7700
movq %rax, -0x338(%rbp)
jmp 0x17087
movq -0x338(%rbp), %rax
cmpq $0x0, %rax
je 0x1717c
movq -0x8(%rbp), %rax
movl $0x2, 0x68(%rax)
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
leaq 0x56d3(%rip), %rsi      # 0x1c785
callq 0x45a0
jmp 0x170b9
movl $0x10, %edi
callq 0x4250
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x340(%rbp)
leaq 0x5714(%rip), %rsi      # 0x1c7eb
callq 0x41c0
jmp 0x170de
movq -0x340(%rbp), %rdi
movq 0x11f04(%rip), %rsi     # 0x28ff0
movq 0x11ec5(%rip), %rdx     # 0x28fb8
callq 0x46a0
jmp 0x1726d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x1713d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x17131
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x2a8(%rbp), %rdi
callq 0x47d8
leaq -0x2c8(%rbp), %rdi
callq 0x47d8
leaq -0x2e8(%rbp), %rdi
callq 0x47d8
jmp 0x1725b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x1724f
movq -0x340(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x4350
jmp 0x1724f
movq -0x8(%rbp), %rax
movq %rax, -0x350(%rbp)
leaq -0x309(%rbp), %rdi
movq %rdi, -0x348(%rbp)
callq 0x46e0
movq -0x348(%rbp), %rdx
leaq 0x56f9(%rip), %rsi      # 0x1c8a1
leaq -0x308(%rbp), %rdi
callq 0x67d0
jmp 0x171b6
leaq 0x1281b(%rip), %rdi     # 0x299d8
leaq -0x308(%rbp), %rsi
callq 0xc500
movq %rax, -0x358(%rbp)
jmp 0x171d2
movq -0x358(%rbp), %rsi
movq -0x350(%rbp), %rdi
callq 0x16270
jmp 0x171e7
leaq -0x308(%rbp), %rdi
callq 0x47d8
leaq -0x309(%rbp), %rdi
callq 0x44a0
leaq -0x288(%rbp), %rdi
callq 0x4120
leaq -0x30(%rbp), %rdi
callq 0x47d8
addq $0x360, %rsp            # imm = 0x360
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x17243
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x308(%rbp), %rdi
callq 0x47d8
leaq -0x309(%rbp), %rdi
callq 0x44a0
leaq -0x288(%rbp), %rdi
callq 0x4120
leaq -0x30(%rbp), %rdi
callq 0x47d8
movq -0x38(%rbp), %rdi
callq 0x46d0
nopl (%rax)