// File: nickgammon[P]tinymudserver/commands.cpp
// Function: DoSetFlag(tPlayer*, std::istream&)
void DoSetFlag (tPlayer * p, istream & sArgs)
{
  p->NeedFlag ("can_setflag");  // permissions
  tPlayer * ptarget = p->GetPlayer (sArgs, "Usage: setflag <who> <flag>");  // who
  string flag = GetFlag (sArgs, "Set which flag?"); // what
  NoMore (p, sArgs);  // check no more input
  if (ptarget->flags.find (flag) != ptarget->flags.end ())    // check not set
    throw runtime_error ("Flag already set.");
  
  ptarget->flags.insert (flag);   // set it
  *p << "You set the flag '" << flag << "' for " << ptarget->playername << "\n";  // confirm
      
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xf0(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x46e0
movq -0xe8(%rbp), %rdx
leaq 0xa889(%rip), %rsi      # 0x1c4c5
leaq -0x30(%rbp), %rdi
callq 0x67d0
jmp 0x11c47
movq -0xf0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x82b0
jmp 0x11c59
leaq -0x30(%rbp), %rdi
callq 0x47d8
leaq -0x31(%rbp), %rdi
callq 0x44a0
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x100(%rbp)
leaq -0x71(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x46e0
movq -0xf8(%rbp), %rdx
leaq 0xa832(%rip), %rsi      # 0x1c4d1
leaq -0x70(%rbp), %rdi
callq 0x67d0
jmp 0x11caa
movq -0x100(%rbp), %rsi
movq -0x108(%rbp), %rdi
movb $0x0, -0x72(%rbp)
leaq -0x70(%rbp), %rdx
leaq -0x72(%rbp), %rcx
callq 0x77e0
movq %rax, -0x110(%rbp)
jmp 0x11cd2
leaq -0x70(%rbp), %rdi
callq 0x47d8
leaq -0x71(%rbp), %rdi
callq 0x44a0
movq -0x110(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0x46e0
movq -0x118(%rbp), %rdx
leaq 0xa7d2(%rip), %rsi      # 0x1c4ed
leaq -0xb8(%rbp), %rdi
callq 0x67d0
jmp 0x11d29
movq -0x120(%rbp), %rsi
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0x10770
jmp 0x11d45
leaq -0xb8(%rbp), %rdi
callq 0x47d8
leaq -0xb9(%rbp), %rdi
callq 0x44a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x10580
jmp 0x11d6c
movq -0x50(%rbp), %rdi
addq $0xe0, %rdi
leaq -0x98(%rbp), %rsi
callq 0x8fc0
movq %rax, -0x128(%rbp)
jmp 0x11d8c
movq -0x128(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x50(%rbp), %rdi
addq $0xe0, %rdi
callq 0x8f30
movq %rax, -0xd0(%rbp)
leaq -0xc8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x8f90
testb $0x1, %al
jne 0x11dcd
jmp 0x11ed8
movl $0x10, %edi
callq 0x4250
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x130(%rbp)
leaq 0xa712(%rip), %rsi      # 0x1c4fd
callq 0x41c0
jmp 0x11df2
movq -0x130(%rbp), %rdi
movq 0x171f0(%rip), %rsi     # 0x28ff0
movq 0x171b1(%rip), %rdx     # 0x28fb8
callq 0x46a0
jmp 0x11fc8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x11e34
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x47d8
leaq -0x31(%rbp), %rdi
callq 0x44a0
jmp 0x11fbf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x11e65
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x47d8
leaq -0x71(%rbp), %rdi
callq 0x44a0
jmp 0x11fbf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x11e99
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x47d8
leaq -0xb9(%rbp), %rdi
callq 0x44a0
jmp 0x11fbf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x11fb3
movq -0x130(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x4350
jmp 0x11fb3
movq -0x50(%rbp), %rdi
addq $0xe0, %rdi
leaq -0x98(%rbp), %rsi
callq 0x9710
movb %dl, -0x139(%rbp)
movq %rax, -0x138(%rbp)
jmp 0x11efe
movb -0x139(%rbp), %al
movq -0x138(%rbp), %rcx
movq %rcx, -0xe0(%rbp)
movb %al, -0xd8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xa5ec(%rip), %rsi      # 0x1c50f
callq 0x13a80
movq %rax, -0x148(%rbp)
jmp 0x11f31
movq -0x148(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xb450
movq %rax, -0x150(%rbp)
jmp 0x11f4d
movq -0x150(%rbp), %rdi
leaq 0xa5c7(%rip), %rsi      # 0x1c522
callq 0x14660
movq %rax, -0x158(%rbp)
jmp 0x11f69
movq -0x158(%rbp), %rdi
movq -0x50(%rbp), %rsi
addq $0x90, %rsi
callq 0xb450
movq %rax, -0x160(%rbp)
jmp 0x11f89
movq -0x160(%rbp), %rdi
leaq 0xa13d(%rip), %rsi      # 0x1c0d4
callq 0x13b80
jmp 0x11f9e
leaq -0x98(%rbp), %rdi
callq 0x47d8
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
leaq -0x98(%rbp), %rdi
callq 0x47d8
movq -0x40(%rbp), %rdi
callq 0x46d0
nopl (%rax,%rax)