// File: /workspace/github_cpp_makefile_star2_O1/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 0x3974e
movq %rax, %r15
leaq -0xb8(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x2dd49(%rip), %rsi     # 0x6d424
leaq 0x2dd47(%rip), %rdx     # 0x6d429
leaq -0xc8(%rbp), %rdi
callq 0x13766
leaq -0x98(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x2dd2a(%rip), %rsi     # 0x6d42a
leaq 0x2dd28(%rip), %rdx     # 0x6d42f
leaq -0xa8(%rbp), %rdi
callq 0x13766
leaq -0xc8(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
movq %r15, %rdi
callq 0x398a4
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0x3f744
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x94e0
movq -0xc8(%rbp), %rdi
cmpq %r12, %rdi
je 0x3f75f
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x94e0
movq 0x10(%rbx), %r15
callq 0x55bfd
movq %rax, 0x3370(%r15)
movq %rdx, 0x3378(%r15)
movq 0x10(%rbx), %rax
movq 0xc(%rax), %rcx
movq %rcx, 0x14(%rax)
leaq 0x2d272(%rip), %rsi     # 0x6c9fb
movq %r14, %rdi
callq 0x9140
testq %rax, %rax
je 0x3f9ab
movq %rax, %r13
leaq -0x70(%rbp), %r15
leaq 0x2d253(%rip), %r12     # 0x6c9fb
leaq 0x2d9fd(%rip), %r14     # 0x6d1ac
addq $0x2, %r13
leaq -0x88(%rbp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x43432
movq %r13, %rdi
movl $0x29, %esi
callq 0x91e0
movq %rax, %r13
leaq 0x1(%rax), %rdx
movq %r15, %rdi
callq 0x434f2
movl -0x88(%rbp), %eax
cmpq $0x4, %rax
ja 0x3f994
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
movl -0x84(%rbp), %esi
cmpl $0x38, %esi
je 0x3f994
movsd -0x70(%rbp), %xmm0
movsd -0x58(%rbp), %xmm3
ucomisd 0x2db65(%rip), %xmm3    # 0x6d380
movq 0x10(%rbx), %rdi
jae 0x3f91f
movsd -0x68(%rbp), %xmm1
movsd -0x60(%rbp), %xmm2
callq 0x3c470
jmp 0x3f994
movb -0x7c(%rbp), %al
cmpb $0x3f, %al
jne 0x3f8b2
movsd -0x58(%rbp), %xmm0
ucomisd 0x2db33(%rip), %xmm0    # 0x6d380
jb 0x3f994
movq 0x10(%rbx), %rdi
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
callq 0x3c532
jmp 0x3f994
movq 0x10(%rbx), %rdi
movl -0x80(%rbp), %esi
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
callq 0x3c40c
jmp 0x3f994
movsd -0x70(%rbp), %xmm0
movsd -0x58(%rbp), %xmm3
ucomisd 0x2dae8(%rip), %xmm3    # 0x6d380
movq 0x10(%rbx), %rdi
jae 0x3f913
movsd -0x68(%rbp), %xmm1
movsd -0x60(%rbp), %xmm2
callq 0x3c4ec
jmp 0x3f994
movl -0x78(%rbp), %edx
testl %edx, %edx
je 0x3f92b
movsd -0x70(%rbp), %xmm0
movsd -0x58(%rbp), %xmm3
ucomisd 0x2dab5(%rip), %xmm3    # 0x6d380
movq 0x10(%rbx), %rdi
jae 0x3f963
movsd -0x68(%rbp), %xmm1
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 0x3ca40
jmp 0x3f990
movsd -0x68(%rbp), %xmm1
callq 0x3c4c4
jmp 0x3f994
movsd -0x68(%rbp), %xmm1
callq 0x3c43e
jmp 0x3f994
movsd -0x58(%rbp), %xmm0
ucomisd 0x2da48(%rip), %xmm0    # 0x6d380
jb 0x3f994
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 0x3c93a
jmp 0x3f994
movzbl -0x40(%rbp), %ecx
movsd -0x68(%rbp), %xmm1
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 0x3cb74
addq $0x10, %rsp
movq %r13, %rdi
movq %r12, %rsi
callq 0x9140
movq %rax, %r13
testq %rax, %rax
jne 0x3f7af
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 0x3f9e0
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x94e0
jmp 0x3f9e0
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r12, %rdi
je 0x3f9fb
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x94e0
movq %rbx, %rdi
callq 0x98b0
nop