// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Parser.cpp
// Function: Parser::ParseSight(char*)
void Parser::ParseSight(char *msg) {
  NetworkTest::instance().End("Sense", "Sight");

  mpObserver->SetLastSightRealTime(
      GetRealTimeParser()); // set the last sight time
  mpObserver->SetLatestSightTime(mpObserver->CurrentTime());

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

    switch (obj.type) {
    case OBJ_Marker:
    case OBJ_Marker_Behind:
      if (obj.marker == FLAG_NONE) {
        if (obj.type != OBJ_Marker_Behind) {
          PARSE_ERROR("Should know the marker");
        }
        break;
      }
      if (InvalidValue(prop.dir_chg)) {
        mpObserver->SeeMarker(obj.marker, prop.dist, prop.dir);
      } else { /* know direction*/
        mpObserver->SeeMarker(obj.marker, prop.dist, prop.dir, prop.dist_chg,
                              prop.dir_chg);
      }
      break;
    case OBJ_Line:
      mpObserver->SeeLine(obj.line, prop.dist, prop.dir);
      break;
    case OBJ_Ball:
      if (InvalidValue(prop.dir_chg)) { /* high quality  */
        mpObserver->SeeBall(prop.dist, prop.dir);
      } else { /* know direction*/
        mpObserver->SeeBall(prop.dist, prop.dir, prop.dist_chg, prop.dir_chg);
      }
      break;
    case OBJ_Player:
      if (obj.side == '?') {              /* Too far for team or num */
        if (InvalidValue(prop.dir_chg)) { /* high quality  */
          mpObserver->SeePlayer(prop.dist, prop.dir);
        } else { /* know direction*/
          PARSE_ERROR("Shouldn't know dirChng when the player's far");
        }
      } else {                              // 知道是哪边的
        if (obj.num == 0) {                 /* Too far for number     */
          if (InvalidValue(prop.dir_chg)) { /* high quality  */
            mpObserver->SeePlayer(obj.side, prop.dist, prop.dir, prop.tackling,
                                  prop.kicked, prop.lying, prop.card_type);
          } else { /* know direction*/
            PARSE_ERROR("Shouldn't know dirChng when the team Member's far");
          }
        } else {                            /* Know side AND number   */
          if (InvalidValue(prop.dir_chg)) { /* high quality  */
            mpObserver->SeePlayer(obj.side, obj.num, prop.dist, prop.dir,
                                  prop.pointing, prop.point_dir, prop.tackling,
                                  prop.kicked, prop.lying, prop.card_type);
          } else { /* know direction*/
            mpObserver->SeePlayer(obj.side, obj.num, prop.dist, prop.dir,
                                  prop.dist_chg, prop.dir_chg, prop.body_dir,
                                  prop.head_dir, prop.pointing, prop.point_dir,
                                  prop.tackling, prop.kicked, prop.lying,
                                  prop.card_type);
          }
        }
      }
      break;
    default:
      break;
    }
    msg = strstr(msg, "(("); // 下一个object
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %r15
movq %rdi, %rbx
callq 0x3018a
movq %rax, %r14
leaq 0x23f97(%rip), %rsi     # 0x593c4
leaq -0xc8(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x10e4a
leaq 0x23f86(%rip), %rsi     # 0x593ca
leaq -0xa8(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq 0x10e4a
leaq -0xc8(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
movq %r14, %rdi
callq 0x302f2
leaq -0xa8(%rbp), %rdi
callq 0x9240
leaq -0xc8(%rbp), %rdi
callq 0x9240
movq 0x10(%rbx), %r14
callq 0x4746d
movq %rax, 0x3370(%r14)
movq %rdx, 0x3378(%r14)
movq 0x10(%rbx), %rax
movq 0xc(%rax), %rcx
movq %rcx, 0x14(%rax)
leaq 0x234fc(%rip), %r14     # 0x589ab
movq %r15, %rdi
movq %r14, %rsi
callq 0x9140
movq %rax, %r15
leaq -0x70(%rbp), %r13
leaq 0x23c7c(%rip), %r12     # 0x59144
testq %r15, %r15
je 0x356a3
addq $0x2, %r15
leaq -0x88(%rbp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x37460
movq %r15, %rdi
pushq $0x29
popq %rsi
callq 0x91f0
movq %rax, %r15
leaq 0x1(%rax), %rdx
movq %r13, %rdi
callq 0x37504
movl -0x88(%rbp), %eax
cmpq $0x4, %rax
ja 0x35690
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movl -0x84(%rbp), %esi
cmpl $0x38, %esi
je 0x35690
movsd -0x58(%rbp), %xmm3
ucomisd 0x23dea(%rip), %xmm3    # 0x59320
movq 0x10(%rbx), %rdi
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
jae 0x35634
movsd -0x60(%rbp), %xmm2
callq 0x32816
jmp 0x35690
movb -0x7c(%rbp), %al
cmpb $0x3f, %al
jne 0x355d2
movsd -0x58(%rbp), %xmm0
ucomisd 0x23db3(%rip), %xmm0    # 0x59320
jb 0x35690
movq 0x10(%rbx), %rdi
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
callq 0x328d8
jmp 0x35690
movq 0x10(%rbx), %rdi
movl -0x80(%rbp), %esi
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
callq 0x327b2
jmp 0x35690
movsd -0x58(%rbp), %xmm3
ucomisd 0x23d6d(%rip), %xmm3    # 0x59320
movq 0x10(%rbx), %rdi
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
jae 0x3562d
movsd -0x60(%rbp), %xmm2
callq 0x32892
jmp 0x35690
movl -0x78(%rbp), %edx
movsd -0x58(%rbp), %xmm3
movsbl %al, %esi
testl %edx, %edx
je 0x3563b
ucomisd 0x23d37(%rip), %xmm3    # 0x59320
movq 0x10(%rbx), %rdi
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
jae 0x3566b
movsd -0x60(%rbp), %xmm2
movsd -0x50(%rbp), %xmm4
movsd -0x48(%rbp), %xmm5
movzbl -0x40(%rbp), %ecx
movsd -0x38(%rbp), %xmm6
movzbl -0x30(%rbp), %r8d
movzbl -0x2f(%rbp), %r9d
movzbl -0x2e(%rbp), %eax
movl -0x2c(%rbp), %r10d
pushq %r10
pushq %rax
callq 0x32d30
jmp 0x3568e
callq 0x3286a
jmp 0x35690
callq 0x327e4
jmp 0x35690
ucomisd 0x23cdd(%rip), %xmm3    # 0x59320
jb 0x35690
movq 0x10(%rbx), %rdi
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
movzbl -0x30(%rbp), %edx
movzbl -0x2f(%rbp), %ecx
movzbl -0x2e(%rbp), %r8d
movl -0x2c(%rbp), %r9d
callq 0x32c26
jmp 0x35690
movzbl -0x40(%rbp), %ecx
movsd -0x38(%rbp), %xmm2
movzbl -0x30(%rbp), %r8d
movzbl -0x2f(%rbp), %r9d
movzbl -0x2e(%rbp), %eax
movl -0x2c(%rbp), %r10d
pushq %r10
pushq %rax
callq 0x32e64
popq %rax
popq %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0x9140
movq %rax, %r15
jmp 0x354c8
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x9240
jmp 0x356c9
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0x9240
movq %rbx, %rdi
callq 0x98b0
nop