// File: /workspace/github_cpp_makefile_star2_O3/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 0x43dce
cmpb $0x0, 0x31a5(%rax)
jne 0x3e9e7
callq 0x43dce
cmpb $0x1, 0x31a6(%rax)
jne 0x3e9fc
callq 0x4e858
movq 0x10(%rbx), %rcx
movq 0xc(%rcx), %rsi
movq %rax, %rdi
callq 0x4e876
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 0xf572
addq %r14, %r12
addq $0x3618, %r12           # imm = 0x3618
movl 0x10(%r12), %edx
xorpd %xmm0, %xmm0
movq %r15, %rdi
movq %r12, %rsi
callq 0xf53c
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 0xf572
addq %r14, %r12
addq $0x4640, %r12           # imm = 0x4640
movl 0x10(%r12), %edx
xorpd %xmm0, %xmm0
movq %r15, %rdi
movq %r12, %rsi
callq 0xf53c
movq %r13, 0x78(%r12)
movq %r13, 0x90(%r12)
addq $0x178, %r14            # imm = 0x178
cmpq $0x1028, %r14           # imm = 0x1028
jne 0x3ea02
leaq 0x2bf1e(%rip), %rsi     # 0x6a9eb
movq -0xa0(%rbp), %rdi
callq 0x9140
testq %rax, %rax
je 0x3efc5
movq %rax, %r14
leaq -0x50(%rbp), %r13
leaq -0x38(%rbp), %r12
addq $0x2, %r14
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x42246
movq %r14, %rdi
movl $0x29, %esi
callq 0x91e0
movq %rax, %r14
leaq 0x1(%rax), %rdx
leaq -0x98(%rbp), %rdi
callq 0x42f76
movl -0x50(%rbp), %eax
cmpl $0x4, %eax
je 0x3eb83
cmpl $0x1, %eax
jne 0x3efaa
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 0x2a503(%rip), %xmm0    # 0x69058
callq 0xf572
movq 0x10(%rbx), %rdi
addq %r15, %rdi
movups -0x88(%rbp), %xmm0
movups %xmm0, -0x38(%rbp)
movq %r12, %rsi
xorl %edx, %edx
movsd 0x2a4df(%rip), %xmm0    # 0x69058
callq 0xf53c
jmp 0x3efaa
movb -0x44(%rbp), %dl
movq 0x10(%rbx), %rax
movslq -0x40(%rbp), %rcx
decq %rcx
cmpb 0x29(%rax), %dl
jne 0x3ec43
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 0x2a489(%rip), %xmm0    # 0x69058
callq 0xf572
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 0x2a462(%rip), %xmm0    # 0x69058
callq 0xf53c
movsd -0x78(%rbp), %xmm0
movsd 0x2a458(%rip), %xmm1    # 0x69060
ucomisd %xmm0, %xmm1
jbe 0x3ecec
movsd 0x2a456(%rip), %xmm2    # 0x69070
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
movsd 0x2a41c(%rip), %xmm3    # 0x69048
movsd 0x2a434(%rip), %xmm4    # 0x69068
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
ja 0x3ec34
jmp 0x3ed1e
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 0x2a3e0(%rip), %xmm0    # 0x69058
callq 0xf572
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 0x2a3b9(%rip), %xmm0    # 0x69058
callq 0xf53c
movsd -0x78(%rbp), %xmm0
movsd 0x2a3af(%rip), %xmm1    # 0x69060
ucomisd %xmm0, %xmm1
jbe 0x3ee33
movsd 0x2a3ad(%rip), %xmm2    # 0x69070
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
movsd 0x2a373(%rip), %xmm3    # 0x69048
movsd 0x2a38b(%rip), %xmm4    # 0x69068
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
ja 0x3ecdd
jmp 0x3ee65
movsd 0x2a354(%rip), %xmm3    # 0x69048
ucomisd %xmm3, %xmm0
movsd 0x2a370(%rip), %xmm2    # 0x69070
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
movsd 0x2a356(%rip), %xmm4    # 0x69068
jb 0x3ed1e
addsd %xmm4, %xmm0
ucomisd %xmm3, %xmm0
jae 0x3ed14
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 0x3ee17
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
ja 0x3ed57
movsd %xmm0, 0x98(%r13)
movl $0x0, 0xa0(%r13)
movq %rdx, 0xa8(%r13)
movl -0x54(%rbp), %eax
movl 0x170(%r13), %ecx
testl %ecx, %ecx
je 0x3ed94
cmpl $0x2, %eax
jne 0x3ed9b
cmpl $0x1, %ecx
jne 0x3ed9b
movl %eax, 0x170(%r13)
cmpb $0x1, -0x68(%rbp)
jne 0x3edde
movsd -0x60(%rbp), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x3ee27
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
ja 0x3edac
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 0x3edfd
cmpl $0x0, 0xc8(%r13)
jne 0x3ee04
callq 0x49360
movl 0x3320(%rax), %eax
decl %eax
movl %eax, 0xc8(%r13)
movq 0x10(%rbx), %rax
addq %rax, %r15
addq $0x370c, %r15           # imm = 0x370C
jmp 0x3ef5d
ucomisd %xmm3, %xmm0
jb 0x3ed61
addsd %xmm4, %xmm0
jmp 0x3ee17
ucomisd %xmm3, %xmm0
jb 0x3edb6
addsd %xmm4, %xmm0
jmp 0x3ee27
movsd 0x2a20d(%rip), %xmm3    # 0x69048
ucomisd %xmm3, %xmm0
movsd 0x2a229(%rip), %xmm2    # 0x69070
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
movsd 0x2a20f(%rip), %xmm4    # 0x69068
jb 0x3ee65
addsd %xmm4, %xmm0
ucomisd %xmm3, %xmm0
jae 0x3ee5b
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 0x3ef7f
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
ja 0x3ee9e
movsd %xmm0, 0x98(%r13)
movl $0x0, 0xa0(%r13)
movq %rdx, 0xa8(%r13)
movl -0x54(%rbp), %eax
movl 0x170(%r13), %ecx
testl %ecx, %ecx
je 0x3eedb
cmpl $0x2, %eax
jne 0x3eee2
cmpl $0x1, %ecx
jne 0x3eee2
movl %eax, 0x170(%r13)
cmpb $0x1, -0x68(%rbp)
jne 0x3ef29
movsd -0x60(%rbp), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x3ef8f
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
ja 0x3eef7
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 0x3ef48
cmpl $0x0, 0xc8(%r13)
jne 0x3ef4f
callq 0x49360
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 0x3ef9f
cmpl $0x0, (%r15)
leaq -0x50(%rbp), %r13
jne 0x3efaa
callq 0x49360
movl 0x33e8(%rax), %eax
decl %eax
movl %eax, (%r15)
jmp 0x3efaa
ucomisd %xmm3, %xmm0
jb 0x3eea8
addsd %xmm4, %xmm0
jmp 0x3ef7f
ucomisd %xmm3, %xmm0
jb 0x3ef01
addsd %xmm4, %xmm0
jmp 0x3ef8f
movl $0x0, (%r15)
leaq -0x50(%rbp), %r13
movq %r14, %rdi
leaq 0x2ba37(%rip), %rsi     # 0x6a9eb
callq 0x9140
movq %rax, %r14
testq %rax, %rax
jne 0x3eaed
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq