// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/Parser.cpp
// Function: Parser::ParseSense(char*)
void Parser::ParseSense(char *msg) {
  if (!PlayerParam::instance().isCoach() ||
      !PlayerParam::instance().isTrainer()) {
    TimeTest::instance().Update(
        mpObserver->CurrentTime()); // player每周期都有sense
  }

  NetworkTest::instance().Update(mpObserver->CurrentTime());
  NetworkTest::instance().Begin("Sense");

  parser::get_word(&msg);
  parser::get_next_word(&msg); // skip 'view'
  parser::get_next_word(&msg); // skip 'mode'
  parser::get_next_word(&msg); // skip not used view quality

  ViewWidth view_width = VW_None;
  switch (msg[1]) {
  case 'o':
    view_width = VW_Normal;
    break; /* normal */
  case 'a':
    view_width = VW_Narrow;
    break; /* narrow */
  case 'i':
    view_width = VW_Wide;
    break; /* wide   */
  default:
    PARSE_ERROR("Unknown view quality");
    break;
  }

  double stamina = parser::get_double(&msg);
  double effort = parser::get_double(&msg);
  double capacity = parser::get_double(&msg);

  double speed = parser::get_double(&msg);
  double speed_dir = parser::get_double(&msg);
  double neck_dir = parser::get_double(&msg);

  int kicks = parser::get_int(&msg);
  int dashes = parser::get_int(&msg);
  int turns = parser::get_int(&msg);
  int says = parser::get_int(&msg);
  int turn_necks = parser::get_int(&msg);
  int catchs = parser::get_int(&msg);
  int moves = parser::get_int(&msg);
  int change_views = parser::get_int(&msg);

  int arm_movable_ban = parser::get_int(&msg); // 直到下次手臂能动的剩余周期数
  int arm_expires = parser::get_int(&msg); // 直到手臂动作失效剩余的周期数
  double arm_target_dist = parser::get_double(&msg); // 指向的目标的距离
  AngleDeg arm_target_dir = parser::get_double(&msg); // 指向的目标的方向
  int points = parser::get_int(&msg);                 // point count
  parser::get_next_word(&msg);                        // focus
  parser::get_next_word(&msg);                        // target
  parser::get_next_word(&msg);                        // side
  char focus_side = msg[0];

  Unum focus_unum = 0;
  if (focus_side != 'l' && focus_side != 'r') { // 没有特别注意的队员
    focus_side = '?';
  } else { // 特别注意的队员号码
    focus_unum = parser::get_int(&msg);
  }
  int focuses = parser::get_int(&msg);
  int tackle_expires = parser::get_int(&msg);
  int tackles = parser::get_int(&msg);

  //以下是碰撞和犯规信息
  mpObserver->ClearCollisionState();

  parser::get_word(&msg);      // (collision {none|[(ball)][(player)][(post)]})
  parser::get_next_word(&msg); // skip 'collision'
  if (msg[0] != 'n') {
    do {
      switch (msg[1]) {
      case 'a':
        mpObserver->SetCollideWithBall();
        break;
      case 'l':
        mpObserver->SetCollideWithPlayer();
        break;
      case 'o':
        mpObserver->SetCollideWithPost();
        break;
      }
      parser::get_next_word(&msg);
    } while (msg[0] != 'f' && msg[0]);
  }

  int foul_charged_cycle = 0;
  CardType card_type = CR_None;

  if (msg[0]) { // v14
    foul_charged_cycle = parser::get_int(
        &msg); // (foul (charged CYCLE) (card {none|yellow|red})))
    parser::get_word(&msg);
    parser::get_next_word(&msg); // skip 'card'

    switch (msg[0]) {
    case 'n':
      break;
    case 'y':
      card_type = CR_Yellow;
      break;
    case 'r':
      card_type = CR_Red;
      break;
    }
  }

  mpObserver->SetSenseBody(
      view_width, stamina, effort, capacity,

      speed, speed_dir, neck_dir,

      kicks, dashes, turns, says, turn_necks, catchs, moves, change_views,

      arm_movable_ban, arm_expires, arm_target_dist, arm_target_dir, points,

      focus_side, focus_unum, focuses,

      tackle_expires, tackles,

      foul_charged_cycle, card_type, mpObserver->CurrentTime());

  NetworkTest::instance().SetCommandExecuteCount(
      dashes, kicks, turns, says, turn_necks, catchs, moves, change_views,
      points, tackles, focuses);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x110(%rbp)
callq 0x798a0
movq %rax, %rdi
callq 0x10de0
testb $0x1, (%rax)
je 0x7329b
callq 0x798a0
movq %rax, %rdi
callq 0x12080
testb $0x1, (%rax)
jne 0x732d1
callq 0x8f5b0
movq %rax, %rcx
movq -0x110(%rbp), %rax
movq %rcx, -0x118(%rbp)
movq 0x10(%rax), %rdi
callq 0x11a70
movq -0x118(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rsi
callq 0x8f640
callq 0x63700
movq %rax, %rcx
movq -0x110(%rbp), %rax
movq %rcx, -0x130(%rbp)
movq 0x10(%rax), %rdi
callq 0x11a70
movq -0x130(%rbp), %rdi
movq %rax, %rsi
callq 0x63ca0
callq 0x63700
movq %rax, -0x128(%rbp)
leaq -0x61(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0xaa70
movq -0x120(%rbp), %rdx
leaq 0x501db(%rip), %rsi     # 0xc3504
leaq -0x60(%rbp), %rdi
callq 0x1a540
jmp 0x73334
movq -0x128(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x63790
jmp 0x73346
leaq -0x60(%rbp), %rdi
callq 0xa370
leaq -0x61(%rbp), %rdi
callq 0xa650
leaq -0x38(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x77cc0
movq -0x140(%rbp), %rdi
callq 0x77d20
movq -0x140(%rbp), %rdi
callq 0x77d20
movq -0x140(%rbp), %rdi
callq 0x77d20
movl $0x0, -0x78(%rbp)
movq -0x38(%rbp), %rax
movsbl 0x1(%rax), %eax
movl %eax, -0x134(%rbp)
subl $0x61, %eax
je 0x733fc
jmp 0x733a8
movl -0x134(%rbp), %eax
subl $0x69, %eax
je 0x73405
jmp 0x733b5
movl -0x134(%rbp), %eax
subl $0x6f, %eax
je 0x733f3
jmp 0x7340e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x733e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x60(%rbp), %rdi
callq 0xa370
leaq -0x61(%rbp), %rdi
callq 0xa650
jmp 0x73a1b
movl $0x2, -0x78(%rbp)
jmp 0x73410
movl $0x1, -0x78(%rbp)
jmp 0x73410
movl $0x3, -0x78(%rbp)
jmp 0x73410
jmp 0x73410
leaq -0x38(%rbp), %rdi
callq 0x77d60
movsd %xmm0, -0x80(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77d60
movsd %xmm0, -0x88(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77d60
movsd %xmm0, -0x90(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77d60
movsd %xmm0, -0x98(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77d60
movsd %xmm0, -0xa0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77d60
movsd %xmm0, -0xa8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77bf0
movl %eax, -0xac(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77bf0
movl %eax, -0xb0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77bf0
movl %eax, -0xb4(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77bf0
movl %eax, -0xb8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77bf0
movl %eax, -0xbc(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77bf0
movl %eax, -0xc0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77bf0
movl %eax, -0xc4(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77bf0
movl %eax, -0xc8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77bf0
movl %eax, -0xcc(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77bf0
movl %eax, -0xd0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77d60
movsd %xmm0, -0xd8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77d60
movsd %xmm0, -0xe0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77bf0
movl %eax, -0xe4(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77d20
leaq -0x38(%rbp), %rdi
callq 0x77d20
leaq -0x38(%rbp), %rdi
callq 0x77d20
movq -0x38(%rbp), %rax
movb (%rax), %al
movb %al, -0xe5(%rbp)
movl $0x0, -0xec(%rbp)
movsbl -0xe5(%rbp), %eax
cmpl $0x6c, %eax
je 0x7358c
movsbl -0xe5(%rbp), %eax
cmpl $0x72, %eax
je 0x7358c
movb $0x3f, -0xe5(%rbp)
jmp 0x7359b
leaq -0x38(%rbp), %rdi
callq 0x77bf0
movl %eax, -0xec(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77bf0
movl %eax, -0xf0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77bf0
movl %eax, -0xf4(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x77bf0
movl %eax, %ecx
movq -0x110(%rbp), %rax
movl %ecx, -0xf8(%rbp)
movq 0x10(%rax), %rdi
callq 0x786c0
leaq -0x38(%rbp), %rdi
callq 0x77cc0
leaq -0x38(%rbp), %rdi
callq 0x77d20
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x6e, %eax
je 0x7369e
jmp 0x735fe
movq -0x38(%rbp), %rax
movsbl 0x1(%rax), %eax
movl %eax, -0x144(%rbp)
subl $0x61, %eax
je 0x7362d
jmp 0x73613
movl -0x144(%rbp), %eax
subl $0x6c, %eax
je 0x7363f
jmp 0x73620
movl -0x144(%rbp), %eax
subl $0x6f, %eax
je 0x73651
jmp 0x73661
movq -0x110(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x786f0
jmp 0x73661
movq -0x110(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x78720
jmp 0x73661
movq -0x110(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x78750
leaq -0x38(%rbp), %rdi
callq 0x77d20
movq -0x38(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x66, %ecx
movb %al, -0x145(%rbp)
je 0x7368e
movq -0x38(%rbp), %rax
cmpb $0x0, (%rax)
setne %al
movb %al, -0x145(%rbp)
movb -0x145(%rbp), %al
testb $0x1, %al
jne 0x735fe
jmp 0x7369e
movl $0x0, -0xfc(%rbp)
movl $0x0, -0x100(%rbp)
movq -0x38(%rbp), %rax
cmpb $0x0, (%rax)
je 0x73731
leaq -0x38(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x77bf0
movq -0x158(%rbp), %rdi
movl %eax, -0xfc(%rbp)
callq 0x77cc0
movq -0x158(%rbp), %rdi
callq 0x77d20
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x14c(%rbp)
subl $0x6e, %eax
je 0x73717
jmp 0x736fd
movl -0x14c(%rbp), %eax
subl $0x72, %eax
je 0x73725
jmp 0x7370a
movl -0x14c(%rbp), %eax
subl $0x79, %eax
je 0x73719
jmp 0x7372f
jmp 0x7372f
movl $0x1, -0x100(%rbp)
jmp 0x7372f
movl $0x2, -0x100(%rbp)
jmp 0x73731
movq -0x110(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x1e8(%rbp)
movl -0x78(%rbp), %ecx
movl %ecx, -0x1dc(%rbp)
movsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x1d8(%rbp)
movsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x1d0(%rbp)
movsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x1c8(%rbp)
movsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x1c0(%rbp)
movsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0x1b8(%rbp)
movsd -0xa8(%rbp), %xmm0
movsd %xmm0, -0x1b0(%rbp)
movl -0xac(%rbp), %ecx
movl %ecx, -0x1a8(%rbp)
movl -0xb0(%rbp), %ecx
movl %ecx, -0x1a4(%rbp)
movl -0xb4(%rbp), %ecx
movl %ecx, -0x1a0(%rbp)
movl -0xb8(%rbp), %ecx
movl %ecx, -0x19c(%rbp)
movl -0xbc(%rbp), %ecx
movl %ecx, -0x17c(%rbp)
movl -0xc0(%rbp), %ecx
movl %ecx, -0x178(%rbp)
movl -0xc4(%rbp), %ecx
movl %ecx, -0x174(%rbp)
movl -0xc8(%rbp), %ecx
movl %ecx, -0x170(%rbp)
movl -0xcc(%rbp), %ecx
movl %ecx, -0x16c(%rbp)
movl -0xd0(%rbp), %ecx
movl %ecx, -0x168(%rbp)
movsd -0xd8(%rbp), %xmm0
movsd %xmm0, -0x198(%rbp)
movsd -0xe0(%rbp), %xmm0
movsd %xmm0, -0x190(%rbp)
movl -0xe4(%rbp), %ecx
movl %ecx, -0x164(%rbp)
movb -0xe5(%rbp), %r13b
movl -0xec(%rbp), %r12d
movl -0xf0(%rbp), %r15d
movl -0xf4(%rbp), %r14d
movl -0xf8(%rbp), %ebx
movl -0xfc(%rbp), %ecx
movl %ecx, -0x184(%rbp)
movl -0x100(%rbp), %ecx
movl %ecx, -0x180(%rbp)
movq 0x10(%rax), %rdi
callq 0x11a70
movq -0x1e8(%rbp), %rdi
movl -0x1dc(%rbp), %esi
movsd -0x1d8(%rbp), %xmm0
movsd -0x1d0(%rbp), %xmm1
movsd -0x1c8(%rbp), %xmm2
movsd -0x1c0(%rbp), %xmm3
movsd -0x1b8(%rbp), %xmm4
movsd -0x1b0(%rbp), %xmm5
movl -0x1a8(%rbp), %edx
movl -0x1a4(%rbp), %ecx
movl -0x1a0(%rbp), %r8d
movl -0x19c(%rbp), %r9d
movsd -0x198(%rbp), %xmm6
movsd -0x190(%rbp), %xmm7
movl -0x184(%rbp), %r11d
movl -0x180(%rbp), %r10d
movq (%rax), %rax
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0x160(%rbp)
movl -0x17c(%rbp), %eax
movl %eax, (%rsp)
movl -0x178(%rbp), %eax
movl %eax, 0x8(%rsp)
movl -0x174(%rbp), %eax
movl %eax, 0x10(%rsp)
movl -0x170(%rbp), %eax
movl %eax, 0x18(%rsp)
movl -0x16c(%rbp), %eax
movl %eax, 0x20(%rsp)
movl -0x168(%rbp), %eax
movl %eax, 0x28(%rsp)
movl -0x164(%rbp), %eax
movl %eax, 0x30(%rsp)
movq -0x160(%rbp), %rax
movsbl %r13b, %r13d
movl %r13d, 0x38(%rsp)
movl %r12d, 0x40(%rsp)
movl %r15d, 0x48(%rsp)
movl %r14d, 0x50(%rsp)
movl %ebx, 0x58(%rsp)
movl %r11d, 0x60(%rsp)
movl %r10d, 0x68(%rsp)
movq %rax, 0x70(%rsp)
callq 0x6cf10
callq 0x63700
movq %rax, %rdi
movl -0xb0(%rbp), %esi
movl -0xac(%rbp), %edx
movl -0xb4(%rbp), %ecx
movl -0xb8(%rbp), %r8d
movl -0xbc(%rbp), %r9d
movl -0xc0(%rbp), %r15d
movl -0xc4(%rbp), %r14d
movl -0xc8(%rbp), %ebx
movl -0xe4(%rbp), %r11d
movl -0xf8(%rbp), %r10d
movl -0xf0(%rbp), %eax
movl %r15d, (%rsp)
movl %r14d, 0x8(%rsp)
movl %ebx, 0x10(%rsp)
movl %r11d, 0x18(%rsp)
movl %r10d, 0x20(%rsp)
movl %eax, 0x28(%rsp)
callq 0x64270
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x70(%rbp), %rdi
callq 0xaa60
nopw %cs:(%rax,%rax)