// File: /workspace/github_cpp_makefile_star2_O1/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, -0xa0(%rbp)
movq %rdi, %rbx
callq 0x450ba
cmpb $0x0, 0x31a5(%rax)
jne 0x3fa3b
callq 0x450ba
cmpb $0x1, 0x31a6(%rax)
jne 0x3fa50
callq 0x4fec4
movq 0x10(%rbx), %rcx
movq 0xc(%rcx), %rsi
movq %rax, %rdi
callq 0x4fee2
xorl %r13d, %r13d
xorl %r14d, %r14d
movq 0x10(%rbx), %r12
leaq (%r12,%r14), %r15
addq $0x35e8, %r15           # imm = 0x35E8
movb %r13b, 0x112(%r15)
leaq 0x35f0(%r12,%r14), %rsi
movl 0x10(%rsi), %edx
xorpd %xmm0, %xmm0
movq %r15, %rdi
callq 0xf682
addq %r14, %r12
addq $0x3618, %r12           # imm = 0x3618
movl 0x10(%r12), %edx
xorpd %xmm0, %xmm0
movq %r15, %rdi
movq %r12, %rsi
callq 0xf64c
movq %r13, 0x78(%r12)
movq %r13, 0x90(%r12)
movq 0x10(%rbx), %r12
leaq (%r12,%r14), %r15
addq $0x4610, %r15           # imm = 0x4610
movb %r13b, 0x112(%r15)
leaq 0x4618(%r12,%r14), %rsi
movl 0x10(%rsi), %edx
xorpd %xmm0, %xmm0
movq %r15, %rdi
callq 0xf682
addq %r14, %r12
addq $0x4640, %r12           # imm = 0x4640
movl 0x10(%r12), %edx
xorpd %xmm0, %xmm0
movq %r15, %rdi
movq %r12, %rsi
callq 0xf64c
movq %r13, 0x78(%r12)
movq %r13, 0x90(%r12)
addq $0x178, %r14            # imm = 0x178
cmpq $0x1028, %r14           # imm = 0x1028
jne 0x3fa56
leaq 0x2ceda(%rip), %rsi     # 0x6c9fb
movq -0xa0(%rbp), %rdi
callq 0x9140
testq %rax, %rax
je 0x40020
movq %rax, %r14
leaq -0x50(%rbp), %r13
leaq -0x38(%rbp), %r12
addq $0x2, %r14
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x43432
movq %r14, %rdi
movl $0x29, %esi
callq 0x91e0
movq %rax, %r14
leaq 0x1(%rax), %rdx
leaq -0x98(%rbp), %rdi
callq 0x441d0
movl -0x50(%rbp), %eax
cmpl $0x4, %eax
je 0x3fbd7
cmpl $0x1, %eax
jne 0x40005
movq 0x10(%rbx), %rdi
movl $0x3570, %r15d          # imm = 0x3570
addq %r15, %rdi
movups -0x98(%rbp), %xmm0
movups %xmm0, -0x38(%rbp)
movq %r12, %rsi
xorl %edx, %edx
movsd 0x2b4af(%rip), %xmm0    # 0x6b058
callq 0xf682
movq 0x10(%rbx), %rdi
addq %r15, %rdi
movups -0x88(%rbp), %xmm0
movups %xmm0, -0x38(%rbp)
movq %r12, %rsi
xorl %edx, %edx
movsd 0x2b48b(%rip), %xmm0    # 0x6b058
callq 0xf64c
jmp 0x40005
movb -0x44(%rbp), %cl
movq 0x10(%rbx), %rax
cmpb 0x29(%rax), %cl
jne 0x3fc97
movslq -0x40(%rbp), %rcx
decq %rcx
imulq $0x178, %rcx, %r15      # imm = 0x178
movl $0x35e8, %r13d          # imm = 0x35E8
leaq (%rax,%r13), %rdi
addq %r15, %rdi
movb $0x1, 0x36fa(%rax,%r15)
movups -0x98(%rbp), %xmm0
movups %xmm0, -0x38(%rbp)
movq %r12, %rsi
xorl %edx, %edx
movsd 0x2b435(%rip), %xmm0    # 0x6b058
callq 0xf682
movq 0x10(%rbx), %rdi
addq %r15, %rdi
movq %r12, %rsi
addq %r13, %rdi
movups -0x88(%rbp), %xmm0
movups %xmm0, -0x38(%rbp)
xorl %edx, %edx
movsd 0x2b40e(%rip), %xmm0    # 0x6b058
callq 0xf64c
movsd -0x78(%rbp), %xmm0
movsd 0x2b404(%rip), %xmm1    # 0x6b060
ucomisd %xmm0, %xmm1
jbe 0x3fd47
movsd 0x2b402(%rip), %xmm2    # 0x6b070
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
movsd 0x2b3c8(%rip), %xmm3    # 0x6b048
movsd 0x2b3e0(%rip), %xmm4    # 0x6b068
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
ja 0x3fc88
jmp 0x3fd79
movslq -0x40(%rbp), %rcx
decq %rcx
imulq $0x178, %rcx, %r15      # imm = 0x178
movl $0x4610, %r13d          # imm = 0x4610
leaq (%rax,%r13), %rdi
addq %r15, %rdi
movb $0x1, 0x4722(%rax,%r15)
movups -0x98(%rbp), %xmm0
movups %xmm0, -0x38(%rbp)
movq %r12, %rsi
xorl %edx, %edx
movsd 0x2b385(%rip), %xmm0    # 0x6b058
callq 0xf682
movq 0x10(%rbx), %rdi
addq %r15, %rdi
addq %r13, %rdi
movups -0x88(%rbp), %xmm0
movups %xmm0, -0x38(%rbp)
movq %r12, %rsi
xorl %edx, %edx
movsd 0x2b35e(%rip), %xmm0    # 0x6b058
callq 0xf64c
movsd -0x78(%rbp), %xmm0
movsd 0x2b354(%rip), %xmm1    # 0x6b060
ucomisd %xmm0, %xmm1
jbe 0x3fe8e
movsd 0x2b352(%rip), %xmm2    # 0x6b070
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
movsd 0x2b318(%rip), %xmm3    # 0x6b048
movsd 0x2b330(%rip), %xmm4    # 0x6b068
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
ja 0x3fd38
jmp 0x3fec0
movsd 0x2b2f9(%rip), %xmm3    # 0x6b048
ucomisd %xmm3, %xmm0
movsd 0x2b315(%rip), %xmm2    # 0x6b070
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
movsd 0x2b2fb(%rip), %xmm4    # 0x6b068
jb 0x3fd79
addsd %xmm4, %xmm0
ucomisd %xmm3, %xmm0
jae 0x3fd6f
movq 0x10(%rbx), %r13
addq %r15, %r13
movl $0x35e8, %eax           # imm = 0x35E8
addq %rax, %r13
movsd %xmm0, 0xb0(%r13)
movl $0x0, 0xb8(%r13)
movq %rdx, 0xc0(%r13)
movsd -0x70(%rbp), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x3fe72
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
ja 0x3fdb2
movsd %xmm0, 0x98(%r13)
movl $0x0, 0xa0(%r13)
movq %rdx, 0xa8(%r13)
movl -0x54(%rbp), %eax
movl 0x170(%r13), %ecx
testl %ecx, %ecx
je 0x3fdef
cmpl $0x2, %eax
jne 0x3fdf6
cmpl $0x1, %ecx
jne 0x3fdf6
movl %eax, 0x170(%r13)
cmpb $0x1, -0x68(%rbp)
jne 0x3fe39
movsd -0x60(%rbp), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x3fe82
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
ja 0x3fe07
xorpd %xmm1, %xmm1
movupd %xmm1, 0xd0(%r13)
movsd %xmm0, 0xe0(%r13)
movl $0x0, 0xe8(%r13)
movq %rdx, 0xf0(%r13)
xorl %eax, %eax
cmpb $0x1, -0x58(%rbp)
jne 0x3fe58
cmpl $0x0, 0xc8(%r13)
jne 0x3fe5f
callq 0x4a75c
movl 0x3320(%rax), %eax
decl %eax
movl %eax, 0xc8(%r13)
movq 0x10(%rbx), %rax
addq %rax, %r15
addq $0x370c, %r15           # imm = 0x370C
jmp 0x3ffb8
ucomisd %xmm3, %xmm0
jb 0x3fdbc
addsd %xmm4, %xmm0
jmp 0x3fe72
ucomisd %xmm3, %xmm0
jb 0x3fe11
addsd %xmm4, %xmm0
jmp 0x3fe82
movsd 0x2b1b2(%rip), %xmm3    # 0x6b048
ucomisd %xmm3, %xmm0
movsd 0x2b1ce(%rip), %xmm2    # 0x6b070
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
movsd 0x2b1b4(%rip), %xmm4    # 0x6b068
jb 0x3fec0
addsd %xmm4, %xmm0
ucomisd %xmm3, %xmm0
jae 0x3feb6
movq 0x10(%rbx), %r13
addq %r15, %r13
movl $0x4610, %eax           # imm = 0x4610
addq %rax, %r13
movsd %xmm0, 0xb0(%r13)
movl $0x0, 0xb8(%r13)
movq %rdx, 0xc0(%r13)
movsd -0x70(%rbp), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x3ffda
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
ja 0x3fef9
movsd %xmm0, 0x98(%r13)
movl $0x0, 0xa0(%r13)
movq %rdx, 0xa8(%r13)
movl -0x54(%rbp), %eax
movl 0x170(%r13), %ecx
testl %ecx, %ecx
je 0x3ff36
cmpl $0x2, %eax
jne 0x3ff3d
cmpl $0x1, %ecx
jne 0x3ff3d
movl %eax, 0x170(%r13)
cmpb $0x1, -0x68(%rbp)
jne 0x3ff84
movsd -0x60(%rbp), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x3ffea
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
ja 0x3ff52
xorpd %xmm1, %xmm1
movupd %xmm1, 0xd0(%r13)
movsd %xmm0, 0xe0(%r13)
movl $0x0, 0xe8(%r13)
movq %rdx, 0xf0(%r13)
xorl %eax, %eax
cmpb $0x1, -0x58(%rbp)
jne 0x3ffa3
cmpl $0x0, 0xc8(%r13)
jne 0x3ffaa
callq 0x4a75c
movl 0x3320(%rax), %eax
decl %eax
movl %eax, 0xc8(%r13)
movq 0x10(%rbx), %rax
addq %rax, %r15
addq $0x4734, %r15           # imm = 0x4734
cmpb $0x1, -0x57(%rbp)
jne 0x3fffa
cmpl $0x0, (%r15)
leaq -0x50(%rbp), %r13
jne 0x40005
callq 0x4a75c
movl 0x33e8(%rax), %eax
decl %eax
movl %eax, (%r15)
jmp 0x40005
ucomisd %xmm3, %xmm0
jb 0x3ff03
addsd %xmm4, %xmm0
jmp 0x3ffda
ucomisd %xmm3, %xmm0
jb 0x3ff5c
addsd %xmm4, %xmm0
jmp 0x3ffea
movl $0x0, (%r15)
leaq -0x50(%rbp), %r13
movq %r14, %rdi
leaq 0x2c9ec(%rip), %rsi     # 0x6c9fb
callq 0x9140
movq %rax, %r14
testq %rax, %rax
jne 0x3fb41
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop