// File: 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
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
callq 0x63700
movq %rax, -0x100(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0xaa70
movq -0xf8(%rbp), %rdx
leaq 0x50f0c(%rip), %rsi     # 0xc3504
leaq -0x30(%rbp), %rdi
callq 0x1a540
jmp 0x72603
leaq -0x69(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0xaa70
movq -0x110(%rbp), %rdx
leaq 0x50ee9(%rip), %rsi     # 0xc350a
leaq -0x68(%rbp), %rdi
callq 0x1a540
jmp 0x7262c
movq -0x100(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x68(%rbp), %rdx
callq 0x63910
jmp 0x72642
leaq -0x68(%rbp), %rdi
callq 0xa370
leaq -0x69(%rbp), %rdi
callq 0xa650
leaq -0x30(%rbp), %rdi
callq 0xa370
leaq -0x31(%rbp), %rdi
callq 0xa650
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x120(%rbp)
callq 0x9e590
movq %rax, -0x90(%rbp)
movq %rdx, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x781c0
movq -0x120(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
callq 0x78350
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x118(%rbp)
movq 0x10(%rax), %rdi
callq 0x11a70
movq -0x118(%rbp), %rdi
movq %rax, %rsi
callq 0x78380
movq -0x10(%rbp), %rdi
leaq 0x50293(%rip), %rsi     # 0xc2977
callq 0xa170
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x72b18
movq -0x108(%rbp), %rsi
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdx
leaq -0xa8(%rbp), %rdi
callq 0x762f0
movq -0x10(%rbp), %rdi
movl $0x29, %esi
callq 0xa220
movq -0x108(%rbp), %rsi
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdx
incq %rdx
leaq -0xf0(%rbp), %rdi
callq 0x763c0
movl -0xa8(%rbp), %eax
movq %rax, -0x128(%rbp)
subq $0x4, %rax
ja 0x72afd
movq -0x128(%rbp), %rax
leaq 0x509a8(%rip), %rcx     # 0xc3114
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x727b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x727a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0xa370
leaq -0x69(%rbp), %rdi
callq 0xa650
leaq -0x30(%rbp), %rdi
callq 0xa370
leaq -0x31(%rbp), %rdi
callq 0xa650
jmp 0x72b21
cmpl $0x38, -0xa4(%rbp)
jne 0x727df
cmpl $0x3, -0xa8(%rbp)
je 0x727da
jmp 0x727da
jmp 0x72aff
leaq -0xf0(%rbp), %rdi
addq $0x18, %rdi
callq 0x783a0
testb $0x1, %al
jne 0x727f5
jmp 0x7281d
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0xa4(%rbp), %esi
movsd -0xf0(%rbp), %xmm0
movsd -0xe8(%rbp), %xmm1
callq 0x6b6e0
jmp 0x72853
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0xa4(%rbp), %esi
movsd -0xf0(%rbp), %xmm0
movsd -0xe8(%rbp), %xmm1
movsd -0xe0(%rbp), %xmm2
movsd -0xd8(%rbp), %xmm3
callq 0x6b770
jmp 0x72aff
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0xa0(%rbp), %esi
movsd -0xf0(%rbp), %xmm0
movsd -0xe8(%rbp), %xmm1
callq 0x6b650
jmp 0x72aff
leaq -0xf0(%rbp), %rdi
addq $0x18, %rdi
callq 0x783a0
testb $0x1, %al
jne 0x72899
jmp 0x728bb
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rdi
movsd -0xf0(%rbp), %xmm0
movsd -0xe8(%rbp), %xmm1
callq 0x6b860
jmp 0x728eb
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rdi
movsd -0xf0(%rbp), %xmm0
movsd -0xe8(%rbp), %xmm1
movsd -0xe0(%rbp), %xmm2
movsd -0xd8(%rbp), %xmm3
callq 0x6b8c0
jmp 0x72aff
movsbl -0x9c(%rbp), %eax
cmpl $0x3f, %eax
jne 0x7293b
leaq -0xf0(%rbp), %rdi
addq $0x18, %rdi
callq 0x783a0
testb $0x1, %al
jne 0x72912
jmp 0x72934
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rdi
movsd -0xf0(%rbp), %xmm0
movsd -0xe8(%rbp), %xmm1
callq 0x6b960
jmp 0x72936
jmp 0x72936
jmp 0x72afb
cmpl $0x0, -0x98(%rbp)
jne 0x729b9
leaq -0xf0(%rbp), %rdi
addq $0x18, %rdi
callq 0x783a0
testb $0x1, %al
jne 0x7295a
jmp 0x729b2
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rdi
movb -0x9c(%rbp), %sil
movsd -0xf0(%rbp), %xmm0
movsd -0xe8(%rbp), %xmm1
movb -0xb0(%rbp), %dl
movb -0xaf(%rbp), %cl
movb -0xae(%rbp), %al
movl -0xac(%rbp), %r9d
andb $0x1, %dl
andb $0x1, %cl
andb $0x1, %al
movsbl %sil, %esi
movzbl %dl, %edx
movzbl %cl, %ecx
movzbl %al, %r8d
callq 0x6c270
jmp 0x729b4
jmp 0x729b4
jmp 0x72af9
leaq -0xf0(%rbp), %rdi
addq $0x18, %rdi
callq 0x783a0
testb $0x1, %al
jne 0x729d2
jmp 0x72a57
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rdi
movb -0x9c(%rbp), %sil
movl -0x98(%rbp), %edx
movsd -0xf0(%rbp), %xmm0
movsd -0xe8(%rbp), %xmm1
movb -0xc0(%rbp), %cl
movsd -0xb8(%rbp), %xmm2
movb -0xb0(%rbp), %r8b
movb -0xaf(%rbp), %r9b
movb -0xae(%rbp), %r10b
movl -0xac(%rbp), %eax
andb $0x1, %cl
andb $0x1, %r8b
andb $0x1, %r9b
andb $0x1, %r10b
movsbl %sil, %esi
movzbl %cl, %ecx
movzbl %r8b, %r8d
movzbl %r9b, %r9d
movzbl %r10b, %r10d
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x6cb20
jmp 0x72af7
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rdi
movb -0x9c(%rbp), %sil
movl -0x98(%rbp), %edx
movsd -0xf0(%rbp), %xmm0
movsd -0xe8(%rbp), %xmm1
movsd -0xe0(%rbp), %xmm2
movsd -0xd8(%rbp), %xmm3
movsd -0xd0(%rbp), %xmm4
movsd -0xc8(%rbp), %xmm5
movb -0xc0(%rbp), %cl
movsd -0xb8(%rbp), %xmm6
movb -0xb0(%rbp), %r8b
movb -0xaf(%rbp), %r9b
movb -0xae(%rbp), %r10b
movl -0xac(%rbp), %eax
andb $0x1, %cl
andb $0x1, %r8b
andb $0x1, %r9b
andb $0x1, %r10b
movsbl %sil, %esi
movzbl %cl, %ecx
movzbl %r8b, %r8d
movzbl %r9b, %r9d
movzbl %r10b, %r10d
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x6c5d0
jmp 0x72af9
jmp 0x72afb
jmp 0x72aff
jmp 0x72aff
movq -0x10(%rbp), %rdi
leaq 0x4fe6d(%rip), %rsi     # 0xc2977
callq 0xa170
movq %rax, -0x10(%rbp)
jmp 0x726ed
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0xaa60
nopw (%rax,%rax)