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

  for (int i = 1; i <= TEAMSIZE; ++i) {
    mpObserver->Teammate_Fullstate(i).SetIsAlive(false);
    mpObserver->Opponent_Fullstate(i).SetIsAlive(false);
  }

  msg = strstr(msg, "((");

  while (msg != 0) {                 // 直到没有object为止
    msg += 2;                        // 跳过 ((
    ObjType obj = ParseObjType(msg); // 获得object的类型
    msg = strchr(msg, ')');
    ObjProperty_Coach prop =
        ParseObjProperty_Coach(msg + 1); // 获得object的属性

    switch (obj.type) {
    case OBJ_Ball:
      mpObserver->Ball_Fullstate().UpdatePos(Vector(prop.x, prop.y), 0, 1.0);
      mpObserver->Ball_Fullstate().UpdateVel(Vector(prop.vx, prop.vy), 0, 1.0);
      break;
    case OBJ_Player:
      if (obj.side == mpObserver->OurSide()) {
        mpObserver->Teammate_Fullstate(obj.num).SetIsAlive(true);
        mpObserver->Teammate_Fullstate(obj.num).UpdatePos(
            Vector(prop.x, prop.y), 0, 1.0);
        mpObserver->Teammate_Fullstate(obj.num).UpdateVel(
            Vector(prop.vx, prop.vy), 0, 1.0);
        mpObserver->Teammate_Fullstate(obj.num).UpdateBodyDir(prop.body_dir, 0,
                                                              1.0);
        mpObserver->Teammate_Fullstate(obj.num).UpdateNeckDir(prop.head_dir, 0,
                                                              1.0);
        mpObserver->Teammate_Fullstate(obj.num).UpdateCardType(prop.card_type);
        if (prop.pointing) {
          mpObserver->Teammate_Fullstate(obj.num).UpdateArmPoint(
              prop.point_dir, 0, 1.0, 0.0, 0, 0);
          // TODO:
          // 这个接口不好，因为是看不到dist，ban等信息的，这些要自己算然后维护
        }
        if (prop.tackling) {
          if (mpObserver->Teammate_Fullstate(obj.num).GetTackleBan() == 0) {
            mpObserver->Teammate_Fullstate(obj.num).UpdateTackleBan(
                ServerParam::instance().tackleCycles() - 1);
          }
        } else {
          mpObserver->Teammate_Fullstate(obj.num).UpdateTackleBan(0);
        }
        if (prop.lying) {
          if (mpObserver->Teammate_Fullstate(obj.num).GetFoulChargedCycle() ==
              0) {
            mpObserver->Teammate_Fullstate(obj.num).UpdateFoulChargedCycle(
                ServerParam::instance().foulCycles() - 1);
          }
        } else {
          mpObserver->Teammate_Fullstate(obj.num).UpdateFoulChargedCycle(0);
        }
      } else {
        mpObserver->Opponent_Fullstate(obj.num).SetIsAlive(true);
        mpObserver->Opponent_Fullstate(obj.num).UpdatePos(
            Vector(prop.x, prop.y), 0, 1.0);
        mpObserver->Opponent_Fullstate(obj.num).UpdateVel(
            Vector(prop.vx, prop.vy), 0, 1.0);
        mpObserver->Opponent_Fullstate(obj.num).UpdateBodyDir(prop.body_dir, 0,
                                                              1.0);
        mpObserver->Opponent_Fullstate(obj.num).UpdateNeckDir(prop.head_dir, 0,
                                                              1.0);
        mpObserver->Opponent_Fullstate(obj.num).UpdateCardType(prop.card_type);
        if (prop.pointing) {
          mpObserver->Opponent_Fullstate(obj.num).UpdateArmPoint(
              prop.point_dir, 0, 1.0, 0.0, 0, 0);
          // TODO:
          // 这个接口不好，因为是看不到dist，ban等信息的，这些要自己算然后维护
        }
        if (prop.tackling) {
          if (mpObserver->Opponent_Fullstate(obj.num).GetTackleBan() == 0) {
            mpObserver->Opponent_Fullstate(obj.num).UpdateTackleBan(
                ServerParam::instance().tackleCycles() - 1);
          }
        } else {
          mpObserver->Opponent_Fullstate(obj.num).UpdateTackleBan(0);
        }
        if (prop.lying) {
          if (mpObserver->Opponent_Fullstate(obj.num).GetFoulChargedCycle() ==
              0) {
            mpObserver->Opponent_Fullstate(obj.num).UpdateFoulChargedCycle(
                ServerParam::instance().foulCycles() - 1);
          }
        } else {
          mpObserver->Opponent_Fullstate(obj.num).UpdateFoulChargedCycle(0);
        }
      }
      break;
    default:
      break;
    }
    msg = strstr(msg, "(("); // 下一个object
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xe8(%rbp)
callq 0x798a0
movq %rax, %rdi
callq 0x10de0
testb $0x1, (%rax)
jne 0x72b72
callq 0x798a0
movq %rax, %rdi
callq 0x12080
testb $0x1, (%rax)
je 0x72ba8
callq 0x8f5b0
movq %rax, %rcx
movq -0xe8(%rbp), %rax
movq %rcx, -0xf0(%rbp)
movq 0x10(%rax), %rdi
callq 0x11a70
movq -0xf0(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
callq 0x8f640
movl $0x1, -0x1c(%rbp)
cmpl $0xb, -0x1c(%rbp)
jg 0x72bfa
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x1c(%rbp), %esi
callq 0x29540
movq %rax, %rdi
xorl %esi, %esi
callq 0x288a0
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x1c(%rbp), %esi
callq 0x77e10
movq %rax, %rdi
xorl %esi, %esi
callq 0x288a0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x72baf
movq -0x10(%rbp), %rdi
leaq 0x4fd72(%rip), %rsi     # 0xc2977
callq 0xa170
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x73243
movq -0xe8(%rbp), %rsi
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdx
leaq -0x34(%rbp), %rdi
callq 0x762f0
movq -0x10(%rbp), %rdi
movl $0x29, %esi
callq 0xa220
movq -0xe8(%rbp), %rsi
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdx
incq %rdx
leaq -0x80(%rbp), %rdi
callq 0x775a0
movl -0x34(%rbp), %eax
movl %eax, -0xf4(%rbp)
subl $0x1, %eax
je 0x72c86
jmp 0x72c72
movl -0xf4(%rbp), %eax
subl $0x4, %eax
je 0x72d27
jmp 0x73228
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x77e40
movq %rax, -0x108(%rbp)
leaq -0x80(%rbp), %rsi
leaq -0x80(%rbp), %rdx
addq $0x8, %rdx
leaq -0x90(%rbp), %rdi
callq 0x11a10
movq -0x108(%rbp), %rdi
leaq -0x90(%rbp), %rsi
xorl %edx, %edx
movsd 0x4e343(%rip), %xmm0    # 0xc1010
callq 0x142f0
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x77e40
movq %rax, -0x100(%rbp)
leaq -0x80(%rbp), %rsi
addq $0x10, %rsi
leaq -0x80(%rbp), %rdx
addq $0x18, %rdx
leaq -0xa0(%rbp), %rdi
callq 0x11a10
movq -0x100(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
xorl %edx, %edx
movsd 0x4e2f3(%rip), %xmm0    # 0xc1010
callq 0x142a0
jmp 0x7322a
movq -0xe8(%rbp), %rax
movsbl -0x28(%rbp), %ecx
movl %ecx, -0x10c(%rbp)
movq 0x10(%rax), %rdi
callq 0x6e5b0
movq %rax, %rcx
movl -0x10c(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x72fbf
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x29540
movq %rax, %rdi
movl $0x1, %esi
callq 0x288a0
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x29540
movq %rax, -0x120(%rbp)
leaq -0x80(%rbp), %rsi
leaq -0x80(%rbp), %rdx
addq $0x8, %rdx
leaq -0xb0(%rbp), %rdi
callq 0x11a10
movq -0x120(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
xorl %edx, %edx
movsd 0x4e251(%rip), %xmm0    # 0xc1010
callq 0x142f0
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x29540
movq %rax, -0x118(%rbp)
leaq -0x80(%rbp), %rsi
addq $0x10, %rsi
leaq -0x80(%rbp), %rdx
addq $0x18, %rdx
leaq -0xc0(%rbp), %rdi
callq 0x11a10
movq -0x118(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
xorl %edx, %edx
movsd 0x4e1fe(%rip), %xmm0    # 0xc1010
callq 0x142a0
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x29540
movq %rax, %rdi
movsd -0x60(%rbp), %xmm0
xorl %esi, %esi
movsd 0x4e1d4(%rip), %xmm1    # 0xc1010
callq 0x77ef0
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x29540
movq %rax, %rdi
movsd -0x58(%rbp), %xmm0
xorl %esi, %esi
movsd 0x4e1aa(%rip), %xmm1    # 0xc1010
callq 0x77f60
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x29540
movq %rax, %rdi
movl -0x3c(%rbp), %esi
callq 0x78050
testb $0x1, -0x50(%rbp)
je 0x72ec0
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x29540
movq %rax, %rdi
movsd -0x48(%rbp), %xmm0
xorl %ecx, %ecx
movsd 0x4e15c(%rip), %xmm1    # 0xc1010
xorps %xmm2, %xmm2
movl %ecx, %esi
movl %ecx, %edx
callq 0x78090
testb $0x1, -0x40(%rbp)
je 0x72f20
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x29540
movq %rax, %rdi
callq 0x12c40
cmpl $0x0, %eax
jne 0x72f1e
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x29540
movq %rax, -0x128(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x78160
movq -0x128(%rbp), %rdi
movl %eax, %esi
subl $0x1, %esi
callq 0x78140
jmp 0x72f3d
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x29540
movq %rax, %rdi
xorl %esi, %esi
callq 0x78140
testb $0x1, -0x3f(%rbp)
je 0x72f9d
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x29540
movq %rax, %rdi
callq 0x12c60
cmpl $0x0, %eax
jne 0x72f9b
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x29540
movq %rax, -0x130(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x781a0
movq -0x130(%rbp), %rdi
movl (%rax), %esi
subl $0x1, %esi
callq 0x78180
jmp 0x72fba
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x29540
movq %rax, %rdi
xorl %esi, %esi
callq 0x78180
jmp 0x73226
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x77e10
movq %rax, %rdi
movl $0x1, %esi
callq 0x288a0
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x77e10
movq %rax, -0x140(%rbp)
leaq -0x80(%rbp), %rsi
leaq -0x80(%rbp), %rdx
addq $0x8, %rdx
leaq -0xd0(%rbp), %rdi
callq 0x11a10
movq -0x140(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
xorl %edx, %edx
movsd 0x4dfe7(%rip), %xmm0    # 0xc1010
callq 0x142f0
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x77e10
movq %rax, -0x138(%rbp)
leaq -0x80(%rbp), %rsi
addq $0x10, %rsi
leaq -0x80(%rbp), %rdx
addq $0x18, %rdx
leaq -0xe0(%rbp), %rdi
callq 0x11a10
movq -0x138(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
xorl %edx, %edx
movsd 0x4df94(%rip), %xmm0    # 0xc1010
callq 0x142a0
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x77e10
movq %rax, %rdi
movsd -0x60(%rbp), %xmm0
xorl %esi, %esi
movsd 0x4df6a(%rip), %xmm1    # 0xc1010
callq 0x77ef0
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x77e10
movq %rax, %rdi
movsd -0x58(%rbp), %xmm0
xorl %esi, %esi
movsd 0x4df40(%rip), %xmm1    # 0xc1010
callq 0x77f60
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x77e10
movq %rax, %rdi
movl -0x3c(%rbp), %esi
callq 0x78050
testb $0x1, -0x50(%rbp)
je 0x7312a
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x77e10
movq %rax, %rdi
movsd -0x48(%rbp), %xmm0
xorl %ecx, %ecx
movsd 0x4def2(%rip), %xmm1    # 0xc1010
xorps %xmm2, %xmm2
movl %ecx, %esi
movl %ecx, %edx
callq 0x78090
testb $0x1, -0x40(%rbp)
je 0x7318a
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x77e10
movq %rax, %rdi
callq 0x12c40
cmpl $0x0, %eax
jne 0x73188
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x77e10
movq %rax, -0x148(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x78160
movq -0x148(%rbp), %rdi
movl %eax, %esi
subl $0x1, %esi
callq 0x78140
jmp 0x731a7
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x77e10
movq %rax, %rdi
xorl %esi, %esi
callq 0x78140
testb $0x1, -0x3f(%rbp)
je 0x73207
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x77e10
movq %rax, %rdi
callq 0x12c60
cmpl $0x0, %eax
jne 0x73205
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x77e10
movq %rax, -0x150(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x781a0
movq -0x150(%rbp), %rdi
movl (%rax), %esi
subl $0x1, %esi
callq 0x78180
jmp 0x73224
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x77e10
movq %rax, %rdi
xorl %esi, %esi
callq 0x78180
jmp 0x73226
jmp 0x7322a
jmp 0x7322a
movq -0x10(%rbp), %rdi
leaq 0x4f742(%rip), %rsi     # 0xc2977
callq 0xa170
movq %rax, -0x10(%rbp)
jmp 0x72c0e
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopl (%rax)