// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
movq %rdi, %rbx
callq 0x38882
movq %rax, %r15
leaq -0xb8(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x2cd5d(%rip), %rsi     # 0x6b3fc
leaq 0x2cd5b(%rip), %rdx     # 0x6b401
leaq -0xc8(%rbp), %rdi
callq 0x1362e
leaq -0x98(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x2cd3e(%rip), %rsi     # 0x6b402
leaq 0x2cd3c(%rip), %rdx     # 0x6b407
leaq -0xa8(%rbp), %rdi
callq 0x1362e
leaq -0xc8(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
movq %r15, %rdi
callq 0x389d2
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0x3e708
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x94e0
movq -0xc8(%rbp), %rdi
cmpq %r12, %rdi
je 0x3e723
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x94e0
movq 0x10(%rbx), %r15
callq 0x54409
movq %rax, 0x3370(%r15)
movq %rdx, 0x3378(%r15)
movq 0x10(%rbx), %rax
movq 0xc(%rax), %rcx
movq %rcx, 0x14(%rax)
leaq 0x2c29e(%rip), %rsi     # 0x6a9eb
movq %r14, %rdi
callq 0x9140
testq %rax, %rax
je 0x3e957
movq %rax, %r13
leaq -0x70(%rbp), %r15
leaq 0x2c27f(%rip), %r12     # 0x6a9eb
leaq 0x2ca11(%rip), %r14     # 0x6b184
addq $0x2, %r13
leaq -0x88(%rbp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x42246
movq %r13, %rdi
movl $0x29, %esi
callq 0x91e0
movq %rax, %r13
leaq 0x1(%rax), %rdx
movq %r15, %rdi
callq 0x42304
movl -0x88(%rbp), %eax
cmpq $0x4, %rax
ja 0x3e940
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
movl -0x84(%rbp), %esi
cmpl $0x38, %esi
je 0x3e940
movsd -0x58(%rbp), %xmm3
ucomisd 0x2cb7e(%rip), %xmm3    # 0x6b358
movq 0x10(%rbx), %rdi
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
jae 0x3e8da
movsd -0x60(%rbp), %xmm2
callq 0x3b48c
jmp 0x3e940
movb -0x7c(%rbp), %al
cmpb $0x3f, %al
jne 0x3e876
movsd -0x58(%rbp), %xmm0
ucomisd 0x2cb47(%rip), %xmm0    # 0x6b358
jb 0x3e940
movq 0x10(%rbx), %rdi
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
callq 0x3b54e
jmp 0x3e940
movq 0x10(%rbx), %rdi
movl -0x80(%rbp), %esi
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
callq 0x3b428
jmp 0x3e940
movsd -0x58(%rbp), %xmm3
ucomisd 0x2cb01(%rip), %xmm3    # 0x6b358
movq 0x10(%rbx), %rdi
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
jae 0x3e8d3
movsd -0x60(%rbp), %xmm2
callq 0x3b508
jmp 0x3e940
movl -0x78(%rbp), %edx
movsd -0x58(%rbp), %xmm3
testl %edx, %edx
je 0x3e8e1
ucomisd 0x2cace(%rip), %xmm3    # 0x6b358
movq 0x10(%rbx), %rdi
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
jae 0x3e914
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), %r10d
movl -0x2c(%rbp), %r11d
movsbl %al, %esi
pushq %r11
pushq %r10
callq 0x3ba70
jmp 0x3e93c
callq 0x3b4e0
jmp 0x3e940
callq 0x3b45a
jmp 0x3e940
ucomisd 0x2ca6f(%rip), %xmm3    # 0x6b358
jb 0x3e940
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
movsbl %al, %esi
callq 0x3b95c
jmp 0x3e940
movzbl -0x40(%rbp), %ecx
movsd -0x38(%rbp), %xmm2
movzbl -0x30(%rbp), %r8d
movzbl -0x2f(%rbp), %r9d
movzbl -0x2e(%rbp), %r10d
movl -0x2c(%rbp), %r11d
movsbl %al, %esi
pushq %r11
pushq %r10
callq 0x3bba4
addq $0x10, %rsp
movq %r13, %rdi
movq %r12, %rsi
callq 0x9140
movq %rax, %r13
testq %rax, %rax
jne 0x3e773
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0x3e98c
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x94e0
jmp 0x3e98c
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r12, %rdi
je 0x3e9a7
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x94e0
movq %rbx, %rdi
callq 0x98b0
nop