// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Parser.cpp
// Function: Parser::ParsePlayMode(char*)
void Parser::ParsePlayMode(char *msg) {
  ServerPlayMode spm = ServerPlayModeMap::instance().GetServerPlayMode(msg);

  if (spm == SPM_Null) {
    PRINT_ERROR("unknown server play mode: " << msg << " @ "
                                             << mpObserver->CurrentTime());
    return;
  }

  PlayMode pm = PM_No_Mode;
  mpObserver->SetServerPlayMode(spm);
  switch (spm) {
  case SPM_PlayOn:
    pm = PM_Play_On;
    break;              /* play_on */
  case SPM_KickIn_Left: /* kick_in */
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Kick_In : PM_Opp_Kick_In;
    break;
  case SPM_KickIn_Right:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Kick_In : PM_Opp_Kick_In;
    break;
  case SPM_KickOff_Left:
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Kick_Off : PM_Opp_Kick_Off;
    break;
  case SPM_KickOff_Right:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Kick_Off : PM_Opp_Kick_Off;
    break;
  case SPM_GoalKick_Left:
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Goal_Kick
                                            : PM_Opp_Goal_Kick;
    break;
  case SPM_GoalKick_Right:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Goal_Kick
                                            : PM_Opp_Goal_Kick;
    break;
  case SPM_AfterGoal_Left:
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Goal_Ours : PM_Goal_Opps;
    break;
  case SPM_AfterGoal_Right:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Goal_Ours : PM_Goal_Opps;
    break;
  case SPM_CornerKick_Left: /* corner_kick */
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Corner_Kick
                                            : PM_Opp_Corner_Kick;
    break;
  case SPM_CornerKick_Right:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Corner_Kick
                                            : PM_Opp_Corner_Kick;
    break;
  case SPM_Drop_Ball:
    pm = PM_Drop_Ball;
    break;               /* drop_ball */
  case SPM_OffSide_Left: /* offside */
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Opp_Offside_Kick
                                            : PM_Our_Offside_Kick;
    break;
  case SPM_OffSide_Right:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Opp_Offside_Kick
                                            : PM_Our_Offside_Kick;
    break;
  case SPM_CatchFault_Left:
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Opp_CatchFault_Kick
                                            : PM_Our_CatchFault_Kick;
    break;
  case SPM_CatchFault_Right:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Opp_CatchFault_Kick
                                            : PM_Our_CatchFault_Kick;
    break;
  case SPM_FreeKick_Left:
    if (mLastServerPlayMode == SPM_GoalieCatchBall_Left)
      pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Goalie_Free_Kick
                                              : PM_Opp_Goalie_Free_Kick;
    else
      pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Free_Kick
                                              : PM_Opp_Free_Kick;
    break;
  case SPM_FreeKick_Right:
    if (mLastServerPlayMode == SPM_GoalieCatchBall_Right)
      pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Goalie_Free_Kick
                                              : PM_Opp_Goalie_Free_Kick;
    else
      pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Free_Kick
                                              : PM_Opp_Free_Kick;
    break;
  case SPM_Free_Kick_Fault_Left:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Free_Kick_Fault_Kick
                                            : PM_Opp_Free_Kick_Fault_Kick;
    break;
  case SPM_Free_Kick_Fault_Right:
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Free_Kick_Fault_Kick
                                            : PM_Opp_Free_Kick_Fault_Kick;
    break;
  case SPM_FirstHalfOver: /* half_time */
    pm = PM_Half_Time;    /* play_mode to before_kick_off        */
    break;
  case SPM_BeforeKickOff:
    pm = PM_Before_Kick_Off;
    break; /* before_kick_off */
    break;
  case SPM_Back_Pass_Left:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Back_Pass_Kick
                                            : PM_Opp_Back_Pass_Kick;
    break;
  case SPM_Back_Pass_Right:
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Back_Pass_Kick
                                            : PM_Opp_Back_Pass_Kick;
    break;
  case SPM_TimeOver:
    pm = PM_Time_Over;
    break;
  case SPM_TimeUp:
    pm = PM_Time_Up;
    break;
  case SPM_IndFreeKick_Left:
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Indirect_Free_Kick
                                            : PM_Opp_Indirect_Free_Kick;
    break;
  case SPM_IndFreeKick_Right:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Indirect_Free_Kick
                                            : PM_Opp_Indirect_Free_Kick;
    break;
  case SPM_PenaltySetup_Left:
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Penalty_Setup
                                            : PM_Opp_Penalty_Setup;
    break;
  case SPM_PenaltySetup_Right:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Penalty_Setup
                                            : PM_Opp_Penalty_Setup;
    break;
  case SPM_PenaltyReady_Left:
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Penalty_Ready
                                            : PM_Opp_Penalty_Ready;
    break;
  case SPM_PenaltyReady_Right:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Penalty_Ready
                                            : PM_Opp_Penalty_Ready;
    break;
  case SPM_PenaltyTaken_Left:
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Penalty_Taken
                                            : PM_Opp_Penalty_Taken;
    break;
  case SPM_PenaltyTaken_Right:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Penalty_Taken
                                            : PM_Opp_Penalty_Taken;
    break;
  case SPM_PenaltyScore_Left:
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Penalty_Score
                                            : PM_Opp_Penalty_Score;
    break;
  case SPM_PenaltyScore_Right:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Penalty_Score
                                            : PM_Opp_Penalty_Score;
    break;
  case SPM_PenaltyMiss_Left:
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Penalty_Miss
                                            : PM_Opp_Penalty_Miss;
    break;
  case SPM_PenaltyMiss_Right:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Penalty_Miss
                                            : PM_Opp_Penalty_Miss;
    break;
  case SPM_GoalieCatchBall_Left:
    pm = mpObserver->GetPlayMode();
    break;
  case SPM_GoalieCatchBall_Right:
    pm = mpObserver->GetPlayMode();
    break;
  case SPM_HalfTime:
    pm = PM_Half_Time;
    break;
  case SPM_PenaltyOnfield_Left:
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Penalty_On_Our_Field
                                            : PM_Penalty_On_Opp_Field;
    break;
  case SPM_PenaltyOnfield_Right:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Penalty_On_Our_Field
                                            : PM_Penalty_On_Opp_Field;
    break;
  case SPM_PenaltyFoul_Left:
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Penalty_Foul
                                            : PM_Opp_Penalty_Foul;
    break;
  case SPM_PenaltyFoul_Right:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Penalty_Foul
                                            : PM_Opp_Penalty_Foul;
    break;
  case SPM_PenaltyWinner_Left:
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Penalty_Winner
                                            : PM_Opp_Penalty_Winner;
    break;
  case SPM_PenaltyWinner_Right:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Penalty_Winner
                                            : PM_Opp_Penalty_Winner;
    break;
  case SPM_Foul_Left:
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Foul : PM_Opp_Foul;
    break;
  case SPM_Foul_Right:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Foul : PM_Opp_Foul;
    break;
  case SPM_TimeExtended:
    pm = PM_Extended_Time;
    break;
  case SPM_Foul_Charge_Left:
    pm = (mpObserver->OurInitSide() == 'r') ? PM_Our_Foul_Charge_Kick
                                            : PM_Opp_Foul_Charge_Kick;
    break;
  case SPM_Foul_Charge_Right:
    pm = (mpObserver->OurInitSide() == 'l') ? PM_Our_Foul_Charge_Kick
                                            : PM_Opp_Foul_Charge_Kick;
    break;
  default:
    PRINT_ERROR("unknown server play mode: " << msg << " @ "
                                             << mpObserver->CurrentTime());
    break;
  }
  mLastServerPlayMode = spm;

  if (pm == PM_Penalty_On_Our_Field) {
    if (mpObserver->SelfUnum() != PlayerParam::instance().ourGoalieUnum()) {
      mpObserver->SetOurSide((mpObserver->OurInitSide() == 'l') ? 'r' : 'l');
      mpObserver->Initialize();
    }
  } else if (pm == PM_Penalty_On_Opp_Field) {
    if (mpObserver->SelfUnum() == PlayerParam::instance().ourGoalieUnum()) {
      mpObserver->SetOurSide((mpObserver->OurInitSide() == 'l') ? 'r' : 'l');
      mpObserver->Initialize();
    }
  }

  if (pm != PM_No_Mode) {
    switch (pm) {
    case PM_Goal_Ours:
      mpObserver->OurScoreInc();
      mpObserver->SetKickOffMode(KO_Opps);
      pm = PM_Before_Kick_Off;
      break;
    case PM_Goal_Opps:
      mpObserver->OppScoreInc();
      mpObserver->SetKickOffMode(KO_Ours);
      pm = PM_Before_Kick_Off;
      break;
    case PM_Our_Penalty_Score:
      mpObserver->OurScoreInc();
      break;
    case PM_Opp_Penalty_Score:
      mpObserver->OppScoreInc();
      break;
    case PM_Half_Time:
    case PM_Extended_Time:
      ++mHalfTime;
      if (mHalfTime % 2 == 1) {
        mpObserver->SetKickOffMode(
            (mpObserver->OurInitSide() == 'l') ? KO_Ours : KO_Opps);
      } else {
        mpObserver->SetKickOffMode(
            (mpObserver->OurInitSide() == 'r') ? KO_Ours : KO_Opps);
      }

      break;
    case PM_Drop_Ball:
      mpObserver->DropBall();
      break;
    default:
      break;
    }
    mpObserver->SetPlayMode(pm);
  } else {
    PRINT_ERROR("Unkonow playmode : " << msg << " @ "
                                      << mpObserver->CurrentTime());
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x47724
movq %rax, %r15
leaq -0x50(%rbp), %r12
leaq -0x29(%rbp), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x10e4a
movq %r15, %rdi
movq %r12, %rsi
callq 0x484ba
movl %eax, %r15d
leaq -0x50(%rbp), %rdi
callq 0x9240
testl %r15d, %r15d
je 0x36d7c
movq 0x10(%rbx), %rax
movl %r15d, 0x24(%rax)
movl %r15d, %ecx
decl %ecx
pushq $0x34
popq %rsi
pushq $0x11
popq %r13
cmpl $0x3d, %ecx
ja 0x36e17
leaq 0x22406(%rip), %rdx     # 0x59158
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl 0x1c(%rax), %r12d
movl %r15d, 0x18(%rbx)
cmpl $0x1a, %r12d
je 0x36f9c
cmpl $0x17, %r12d
je 0x36ed1
jmp 0x3710a
movq 0x4026d(%rip), %rdi     # 0x76ff0
leaq 0x225bc(%rip), %rsi     # 0x59346
callq 0x94b0
leaq 0x243dc(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movl $0x693, %esi            # imm = 0x693
callq 0x9890
leaq 0x2266d(%rip), %rsi     # 0x5941f
movq %rax, %rdi
callq 0x94b0
leaq 0x22633(%rip), %rsi     # 0x593f4
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x94b0
leaq 0x243fc(%rip), %rsi     # 0x5b1d7
movq %rax, %rdi
callq 0x94b0
movq 0x10(%rbx), %rsi
addq $0xc, %rsi
movq %rax, %rdi
callq 0xd465
movq %rax, %rdi
callq 0x99e8
jmp 0x371b1
pushq $0x1c
jmp 0x370f1
pushq $0x1e
jmp 0x370f1
cmpb $0x72, 0x28(%rax)
jmp 0x36fff
movq 0x401d2(%rip), %rdi     # 0x76ff0
movl %esi, %r12d
leaq 0x2251e(%rip), %rsi     # 0x59346
callq 0x94b0
leaq 0x2433e(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movl $0x763, %esi            # imm = 0x763
callq 0x9890
leaq 0x225cf(%rip), %rsi     # 0x5941f
movq %rax, %rdi
callq 0x94b0
leaq 0x22595(%rip), %rsi     # 0x593f4
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x94b0
leaq 0x2435e(%rip), %rsi     # 0x5b1d7
movq %rax, %rdi
callq 0x94b0
movq 0x10(%rbx), %rsi
addq $0xc, %rsi
movq %rax, %rdi
callq 0xd465
movq %rax, %rdi
callq 0x99e8
movl %r12d, %esi
xorl %r12d, %r12d
jmp 0x37106
cmpb $0x72, 0x28(%rax)
jmp 0x36eae
cmpb $0x6c, 0x28(%rax)
movl %esi, %r12d
cmovel %r13d, %r12d
jmp 0x37106
cmpb $0x6c, 0x28(%rax)
jmp 0x37061
cmpb $0x6c, 0x28(%rax)
jne 0x36f98
movl %r15d, 0x18(%rbx)
movl 0x2c(%rax), %r14d
callq 0x38d94
pushq $0x17
popq %r12
cmpl 0x31a0(%rax), %r14d
jne 0x36fb6
jmp 0x371a9
xorl %r12d, %r12d
cmpb $0x6c, 0x28(%rax)
jmp 0x37010
cmpb $0x6c, 0x28(%rax)
jmp 0x370a5
cmpb $0x6c, 0x28(%rax)
jmp 0x36f7d
cmpb $0x6c, 0x28(%rax)
jmp 0x36f33
cmpb $0x72, 0x28(%rax)
jmp 0x37053
cmpb $0x72, 0x28(%rax)
jmp 0x370d7
cmpb $0x6c, 0x28(%rax)
jmp 0x36f5f
cmpb $0x72, 0x28(%rax)
jmp 0x36f51
cmpb $0x72, 0x28(%rax)
pushq $0xa
popq %rax
pushq $0x2e
jmp 0x37100
pushq $0x1
jmp 0x370f1
cmpb $0x6c, 0x28(%rax)
jmp 0x36fe0
cmpb $0x6c, 0x28(%rax)
pushq $0x5
popq %rax
pushq $0x28
jmp 0x37100
cmpb $0x72, 0x28(%rax)
pushq $0x7
popq %rax
pushq $0x2a
jmp 0x37100
cmpb $0x72, 0x28(%rax)
jmp 0x37037
pushq $0x16
jmp 0x370f1
cmpb $0x72, 0x28(%rax)
pushq $0xb
popq %rax
pushq $0x2d
jmp 0x37100
pushq $0x1d
jmp 0x370f1
cmpb $0x72, 0x28(%rax)
je 0x36ecd
movl %r15d, 0x18(%rbx)
movl 0x2c(%rax), %r14d
callq 0x38d94
pushq $0x1a
popq %r12
cmpl 0x31a0(%rax), %r14d
jne 0x371a9
movq 0x10(%rbx), %rdi
cmpb $0x6c, 0x28(%rdi)
pushq $0x72
popq %rax
pushq $0x6c
popq %rcx
movl %ecx, %edx
cmovel %eax, %edx
movb %dl, 0x29(%rdi)
cmovel %ecx, %eax
movb %al, 0x2a(%rdi)
callq 0x31e2a
jmp 0x371a9
cmpb $0x72, 0x28(%rax)
pushq $0x3
popq %rax
pushq $0x26
jmp 0x37100
cmpl $0x32, 0x18(%rbx)
movb 0x28(%rax), %al
jne 0x370f5
cmpb $0x6c, %al
jmp 0x3707a
cmpb $0x6c, 0x28(%rax)
pushq $0x14
popq %rax
pushq $0x37
jmp 0x37100
xorl %r12d, %r12d
cmpb $0x72, 0x28(%rax)
sete %r12b
xorl $0x21, %r12d
jmp 0x37106
cmpb $0x6c, 0x28(%rax)
jmp 0x370c1
pushq $0x1b
jmp 0x370f1
cmpb $0x6c, 0x28(%rax)
jmp 0x37045
cmpb $0x6c, 0x28(%rax)
pushq $0xe
popq %rax
pushq $0x31
jmp 0x37100
cmpb $0x72, 0x28(%rax)
pushq $0x2
popq %rax
pushq $0x25
jmp 0x37100
cmpb $0x6c, 0x28(%rax)
pushq $0x4
popq %rax
pushq $0x27
jmp 0x37100
cmpb $0x72, 0x28(%rax)
pushq $0x12
popq %rax
pushq $0x35
jmp 0x37100
cmpl $0x33, 0x18(%rbx)
movb 0x28(%rax), %al
jne 0x370f9
cmpb $0x72, %al
pushq $0x8
popq %rax
pushq $0x2b
jmp 0x37100
cmpb $0x72, 0x28(%rax)
jmp 0x37091
cmpb $0x6c, 0x28(%rax)
jmp 0x370cc
cmpb $0x6c, 0x28(%rax)
pushq $0x2c
popq %rax
pushq $0x9
jmp 0x37100
xorl %r12d, %r12d
cmpb $0x6c, 0x28(%rax)
jmp 0x370e5
cmpb $0x72, 0x28(%rax)
pushq $0xd
popq %rax
pushq $0x30
jmp 0x37100
cmpb $0x72, 0x28(%rax)
jmp 0x370b6
cmpb $0x6c, 0x28(%rax)
pushq $0x2f
popq %rax
pushq $0xc
jmp 0x37100
cmpb $0x72, 0x28(%rax)
pushq $0x13
popq %rax
pushq $0x36
jmp 0x37100
cmpb $0x72, 0x28(%rax)
pushq $0x10
popq %rax
pushq $0x33
jmp 0x37100
cmpb $0x6c, 0x28(%rax)
pushq $0xf
popq %rax
pushq $0x32
jmp 0x37100
xorl %r12d, %r12d
cmpb $0x72, 0x28(%rax)
sete %r12b
xorl $0x23, %r12d
jmp 0x37106
pushq $0x1f
popq %r12
jmp 0x37106
cmpb $0x6c, %al
jmp 0x370fb
cmpb $0x72, %al
pushq $0x6
popq %rax
pushq $0x29
popq %r12
cmovel %eax, %r12d
movl %r15d, 0x18(%rbx)
leal -0x1b(%r12), %eax
cmpl $0x6, %eax
ja 0x37145
leaq 0x22135(%rip), %rcx     # 0x59250
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x48(%rbx), %edx
incl %edx
movl %edx, 0x48(%rbx)
andl $0x80000001, %edx       # imm = 0x80000001
movq 0x10(%rbx), %rax
movb 0x28(%rax), %cl
cmpl $0x1, %edx
jne 0x37162
xorl %edx, %edx
cmpb $0x6c, %cl
jmp 0x37167
testl %r12d, %r12d
je 0x371c0
cmpl $0x11, %r12d
je 0x3719f
cmpl $0x34, %r12d
jne 0x371a9
movq 0x10(%rbx), %rax
incl 0x38(%rax)
movl %esi, %r12d
jmp 0x371a9
xorl %edx, %edx
cmpb $0x72, %cl
setne %dl
movl %edx, 0x20(%rax)
jmp 0x371a9
movq 0x10(%rbx), %rax
movb $0x1, 0x118(%rax)
pushq $0x1b
jmp 0x3719b
movq 0x10(%rbx), %rax
incl 0x38(%rax)
andl $0x0, 0x20(%rax)
jmp 0x37199
movq 0x10(%rbx), %rax
incl 0x34(%rax)
movl $0x1, 0x20(%rax)
pushq $0x16
popq %r12
jmp 0x371a9
movq 0x10(%rbx), %rax
incl 0x34(%rax)
movl %r13d, %r12d
movq 0x10(%rbx), %rax
movl %r12d, 0x1c(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3fe29(%rip), %rdi     # 0x76ff0
leaq 0x22178(%rip), %rsi     # 0x59346
callq 0x94b0
leaq 0x23f98(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movl $0x79b, %esi            # imm = 0x79B
callq 0x9890
leaq 0x22229(%rip), %rsi     # 0x5941f
movq %rax, %rdi
callq 0x94b0
leaq 0x2220a(%rip), %rsi     # 0x5940f
jmp 0x36dc1
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x9240
movq %rbx, %rdi
callq 0x98b0