// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r15
movq %rdi, %rbx
callq 0x38d94
cmpb $0x0, 0x31a5(%rax)
jne 0x35711
callq 0x38d94
cmpb $0x1, 0x31a6(%rax)
jne 0x35726
callq 0x4254e
movq 0x10(%rbx), %rcx
movq 0xc(%rcx), %rsi
movq %rax, %rdi
callq 0x425b0
movl $0x35e8, %r14d          # imm = 0x35E8
cmpq $0x4610, %r14           # imm = 0x4610
je 0x35762
movq 0x10(%rbx), %rdi
addq %r14, %rdi
xorl %esi, %esi
callq 0x381ec
movq 0x10(%rbx), %rax
leaq (%rax,%r14), %rdi
addq $0x1028, %rdi           # imm = 0x1028
xorl %esi, %esi
callq 0x381ec
addq $0x178, %r14            # imm = 0x178
jmp 0x3572c
leaq 0x23242(%rip), %r13     # 0x589ab
movq %r15, %rdi
movq %r13, %rsi
callq 0x9140
movq %rax, %r12
leaq -0x50(%rbp), %r15
testq %r12, %r12
je 0x35ad7
addq $0x2, %r12
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x37460
movq %r12, %rdi
pushq $0x29
popq %rsi
callq 0x91f0
movq %rax, %r12
leaq 0x1(%rax), %rdx
leaq -0x98(%rbp), %rdi
callq 0x37ef2
movl -0x50(%rbp), %eax
cmpl $0x4, %eax
je 0x35820
cmpl $0x1, %eax
jne 0x35ac4
movq 0x10(%rbx), %rdi
movl $0x3570, %eax           # imm = 0x3570
addq %rax, %rdi
movups -0x98(%rbp), %xmm0
movups %xmm0, -0x38(%rbp)
leaq -0x38(%rbp), %r14
movq %r14, %rsi
xorl %edx, %edx
movsd 0x2185b(%rip), %xmm0    # 0x57048
callq 0xde1c
movq 0x10(%rbx), %rdi
movl $0x3570, %eax           # imm = 0x3570
addq %rax, %rdi
movups -0x88(%rbp), %xmm0
movups %xmm0, -0x38(%rbp)
movq %r14, %rsi
xorl %edx, %edx
movsd 0x21832(%rip), %xmm0    # 0x57048
callq 0xdde8
jmp 0x35ac4
movb -0x44(%rbp), %dl
movq 0x10(%rbx), %rax
movslq -0x40(%rbp), %rcx
decq %rcx
cmpb 0x29(%rax), %dl
jne 0x35964
imulq $0x178, %rcx, %r13      # imm = 0x178
movl $0x35e8, %r14d          # imm = 0x35E8
leaq (%rax,%r14), %rdi
addq %r13, %rdi
movb $0x1, 0x36fa(%rax,%r13)
movups -0x98(%rbp), %xmm0
movups %xmm0, -0x38(%rbp)
leaq -0x38(%rbp), %r15
movq %r15, %rsi
xorl %edx, %edx
movsd 0x217d8(%rip), %xmm0    # 0x57048
callq 0xde1c
movq 0x10(%rbx), %rdi
addq %r13, %rdi
addq %r14, %rdi
movups -0x88(%rbp), %xmm0
movups %xmm0, -0x38(%rbp)
movq %r15, %rsi
xorl %edx, %edx
movsd 0x217b1(%rip), %xmm0    # 0x57048
callq 0xdde8
movq 0x10(%rbx), %rdi
addq %r13, %rdi
addq %r14, %rdi
movsd -0x78(%rbp), %xmm0
xorl %esi, %esi
movsd 0x21793(%rip), %xmm1    # 0x57048
callq 0x382a6
movq 0x10(%rbx), %rdi
addq %r13, %rdi
addq %r14, %rdi
movsd -0x70(%rbp), %xmm0
xorl %esi, %esi
movsd 0x21775(%rip), %xmm1    # 0x57048
callq 0x382f8
movq 0x10(%rbx), %rcx
leaq (%rcx,%r14), %rdi
addq %r13, %rdi
movl -0x54(%rbp), %eax
movl 0x3758(%rcx,%r13), %ecx
testl %ecx, %ecx
je 0x358fc
cmpl $0x2, %eax
jne 0x35902
cmpl $0x1, %ecx
jne 0x35902
movl %eax, 0x170(%rdi)
cmpb $0x1, -0x68(%rbp)
jne 0x35923
movsd -0x60(%rbp), %xmm0
xorps %xmm2, %xmm2
xorl %esi, %esi
movsd 0x2172e(%rip), %xmm1    # 0x57048
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3834a
movq 0x10(%rbx), %rax
leaq (%rax,%r13), %r14
addq $0x36b0, %r14           # imm = 0x36B0
xorl %eax, %eax
cmpb $0x1, -0x58(%rbp)
jne 0x3594d
cmpl $0x0, (%r14)
jne 0x35950
callq 0x3db2c
movl 0x3320(%rax), %eax
decl %eax
movl %eax, (%r14)
movq 0x10(%rbx), %rax
leaq (%rax,%r13), %r14
addq $0x370c, %r14           # imm = 0x370C
jmp 0x35a8c
imulq $0x178, %rcx, %r13      # imm = 0x178
movl $0x4610, %r15d          # imm = 0x4610
leaq (%rax,%r15), %rdi
addq %r13, %rdi
movb $0x1, 0x4722(%rax,%r13)
movups -0x98(%rbp), %xmm0
movups %xmm0, -0x38(%rbp)
leaq -0x38(%rbp), %r14
movq %r14, %rsi
xorl %edx, %edx
movsd 0x216ab(%rip), %xmm0    # 0x57048
callq 0xde1c
movq 0x10(%rbx), %rdi
addq %r13, %rdi
addq %r15, %rdi
movups -0x88(%rbp), %xmm0
movups %xmm0, -0x38(%rbp)
movq %r14, %rsi
xorl %edx, %edx
movsd 0x21684(%rip), %xmm0    # 0x57048
callq 0xdde8
movq 0x10(%rbx), %rdi
addq %r13, %rdi
addq %r15, %rdi
movsd -0x78(%rbp), %xmm0
xorl %esi, %esi
movsd 0x21666(%rip), %xmm1    # 0x57048
callq 0x382a6
movq 0x10(%rbx), %rdi
addq %r13, %rdi
addq %r15, %rdi
movsd -0x70(%rbp), %xmm0
xorl %esi, %esi
movsd 0x21648(%rip), %xmm1    # 0x57048
callq 0x382f8
movq 0x10(%rbx), %rcx
leaq (%rcx,%r15), %rdi
addq %r13, %rdi
movl -0x54(%rbp), %eax
movl 0x4780(%rcx,%r13), %ecx
testl %ecx, %ecx
je 0x35a29
cmpl $0x2, %eax
jne 0x35a2f
cmpl $0x1, %ecx
jne 0x35a2f
movl %eax, 0x170(%rdi)
cmpb $0x1, -0x68(%rbp)
jne 0x35a50
movsd -0x60(%rbp), %xmm0
xorps %xmm2, %xmm2
xorl %esi, %esi
movsd 0x21601(%rip), %xmm1    # 0x57048
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3834a
movq 0x10(%rbx), %rax
leaq (%rax,%r13), %r14
addq $0x46d8, %r14           # imm = 0x46D8
xorl %eax, %eax
cmpb $0x1, -0x58(%rbp)
jne 0x35a7a
cmpl $0x0, (%r14)
jne 0x35a7d
callq 0x3db2c
movl 0x3320(%rax), %eax
decl %eax
movl %eax, (%r14)
movq 0x10(%rbx), %rax
leaq (%rax,%r13), %r14
addq $0x4734, %r14           # imm = 0x4734
cmpb $0x1, -0x57(%rbp)
jne 0x35ab5
cmpl $0x0, (%r14)
leaq 0x22f0e(%rip), %r13     # 0x589ab
leaq -0x50(%rbp), %r15
jne 0x35ac4
callq 0x3db2c
movl 0x33e8(%rax), %eax
decl %eax
movl %eax, (%r14)
jmp 0x35ac4
andl $0x0, (%r14)
leaq 0x22eeb(%rip), %r13     # 0x589ab
leaq -0x50(%rbp), %r15
movq %r12, %rdi
movq %r13, %rsi
callq 0x9140
movq %rax, %r12
jmp 0x3577b
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq