// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/Parser.cpp
// Function: Parser::ParseObjProperty(char*)
Parser::ObjProperty Parser::ParseObjProperty(char *msg) {
  ObjProperty result;

  /* 'high' quality only */
  result.dist = parser::get_double(&msg); /* 'high' quality     */
  result.dir = parser::get_double(&msg);

  if (*msg != ')') {
    if (*msg == ' ') {
      ++msg;
    }
    if (*msg == 't') {
      result.tackling = true;
      ++msg;
    } else if (*msg == 'k') {
      result.kicked = true;
      ++msg;
    } else if (*msg == 'f') {
      result.lying = true;
      ++msg;
    }
  }
  if (*msg != ')') {
    result.dist_chg = parser::get_double(&msg); // 也可能是pointdir
    if (*msg == ' ') {                          // 后面还有
      msg++;                                    // 跳过空格
      if (*msg == 't' || *msg == 'k' || *msg == 'f') {
        if (*msg == 't') {
          result.tackling = true;
        } else if (*msg == 'k') {
          result.kicked = true;
        } else
          result.lying = true;
        msg++;
        result.point_dir = result.dist_chg;
        result.pointing = true;
        result.dist_chg = INVALID_VALUE;
      } else {
        result.dir_chg = parser::get_double(&msg);
      }
    } else if (*msg == ')') {
      result.pointing = true;
      result.point_dir = result.dist_chg;
      result.dist_chg = INVALID_VALUE;
    }
  }

  if (*msg != ')') {
    result.body_dir = parser::get_double(&msg);
    result.head_dir = parser::get_double(&msg);
    if (*msg == ' ') { // 后面还有 pointdir and/or tackling/kicked flag
      msg++;
      if (*msg == 't' || *msg == 'k' ||
          *msg == 'f') { // 只有tackling/kicked flag
        if (*msg == 't') {
          result.tackling = true;
        } else if (*msg == 'k') {
          result.kicked = true;
        } else
          result.lying = true;
        msg++;
      } else { // 是数字
        result.pointing = true;
        result.point_dir = parser::get_double(&msg);
        if (*msg == ' ') {
          while (*msg == ' ')
            ++msg;
          if (*msg == 't' || *msg == 'k' || *msg == 'f') {
            if (*msg == 't') {
              result.tackling = true;
              ++msg;
            } else if (*msg == 'k') {
              result.kicked = true;
              ++msg;
            } else {
              result.lying = true;
              ++msg;
            }
            while (*msg == ' ')
              ++msg;
          }
          if (*msg == 'y') {
            result.card_type = CR_Yellow;
            ++msg;
          } else if (*msg == 'r') {
            result.card_type = CR_Red;
            ++msg;
          } else if (*msg != ')') {
            PARSE_ERROR("why come to this place");
          }
        }
      }
    }
  }

  if (*msg != ')') {
    PARSE_ERROR("Should be done with object info here");
  }

  Assert(result.card_type ==
         CR_None); // TODO: server 不会发card_type和foul_charged
  Assert(result.lying == false);

  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x18(%rbp)
movq %rdi, %rax
movq %rax, -0x20(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
callq 0x78500
leaq -0x10(%rbp), %rdi
callq 0x77d60
movq -0x18(%rbp), %rdi
movsd %xmm0, (%rdi)
leaq -0x10(%rbp), %rdi
callq 0x77d60
movq -0x18(%rbp), %rdi
movsd %xmm0, 0x8(%rdi)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
je 0x76495
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x7642b
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x74, %eax
jne 0x7644d
movq -0x18(%rbp), %rax
movb $0x1, 0x40(%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x76493
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x6b, %eax
jne 0x7646f
movq -0x18(%rbp), %rax
movb $0x1, 0x41(%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x76491
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
jne 0x7648f
movq -0x18(%rbp), %rax
movb $0x1, 0x42(%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x76491
jmp 0x76493
jmp 0x76495
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
je 0x7659d
leaq -0x10(%rbp), %rdi
callq 0x77d60
movq -0x18(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x7656e
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x74, %eax
je 0x764f7
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x6b, %eax
je 0x764f7
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
jne 0x7655a
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x74, %eax
jne 0x7650d
movq -0x18(%rbp), %rax
movb $0x1, 0x40(%rax)
jmp 0x7652d
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x6b, %eax
jne 0x76523
movq -0x18(%rbp), %rax
movb $0x1, 0x41(%rax)
jmp 0x7652b
movq -0x18(%rbp), %rax
movb $0x1, 0x42(%rax)
jmp 0x7652d
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x38(%rax)
movb $0x1, 0x30(%rax)
movsd 0x4cf0d(%rip), %xmm0    # 0xc3460
movsd %xmm0, 0x10(%rax)
jmp 0x7656c
leaq -0x10(%rbp), %rdi
callq 0x77d60
movq -0x18(%rbp), %rax
movsd %xmm0, 0x18(%rax)
jmp 0x7659b
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
jne 0x76599
movq -0x18(%rbp), %rax
movb $0x1, 0x30(%rax)
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x38(%rax)
movsd 0x4cecc(%rip), %xmm0    # 0xc3460
movsd %xmm0, 0x10(%rax)
jmp 0x7659b
jmp 0x7659d
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
je 0x7679e
leaq -0x10(%rbp), %rdi
callq 0x77d60
movq -0x18(%rbp), %rax
movsd %xmm0, 0x20(%rax)
leaq -0x10(%rbp), %rdi
callq 0x77d60
movq -0x18(%rbp), %rax
movsd %xmm0, 0x28(%rax)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x7679c
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x74, %eax
je 0x76611
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x6b, %eax
je 0x76611
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
jne 0x76658
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x74, %eax
jne 0x76627
movq -0x18(%rbp), %rax
movb $0x1, 0x40(%rax)
jmp 0x76647
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x6b, %eax
jne 0x7663d
movq -0x18(%rbp), %rax
movb $0x1, 0x41(%rax)
jmp 0x76645
movq -0x18(%rbp), %rax
movb $0x1, 0x42(%rax)
jmp 0x76647
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x7679a
movq -0x18(%rbp), %rax
movb $0x1, 0x30(%rax)
leaq -0x10(%rbp), %rdi
callq 0x77d60
movq -0x18(%rbp), %rax
movsd %xmm0, 0x38(%rax)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x76798
jmp 0x76684
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x7669e
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x76684
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x74, %eax
je 0x766c2
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x6b, %eax
je 0x766c2
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
jne 0x7673a
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x74, %eax
jne 0x766e4
movq -0x18(%rbp), %rax
movb $0x1, 0x40(%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x7671c
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x6b, %eax
jne 0x76706
movq -0x18(%rbp), %rax
movb $0x1, 0x41(%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x7671a
movq -0x18(%rbp), %rax
movb $0x1, 0x42(%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x7671c
jmp 0x7671e
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x76738
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x7671e
jmp 0x7673a
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x79, %eax
jne 0x7675f
movq -0x18(%rbp), %rax
movl $0x1, 0x44(%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x76796
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x72, %eax
jne 0x76784
movq -0x18(%rbp), %rax
movl $0x2, 0x44(%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x76794
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
je 0x76792
jmp 0x76792
jmp 0x76794
jmp 0x76796
jmp 0x76798
jmp 0x7679a
jmp 0x7679c
jmp 0x7679e
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
je 0x767ac
jmp 0x767ac
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)