// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rdx, -0x28(%rbp)
movabsq $0x7fefffffffffffff, %r12 # imm = 0x7FEFFFFFFFFFFFFF
movq %r12, (%rdi)
movq %r12, 0x8(%rdi)
movq %r12, 0x10(%rdi)
movq %r12, 0x18(%rdi)
movq %r12, 0x20(%rdi)
movq %r12, 0x28(%rdi)
xorl %eax, %eax
movb %al, 0x30(%rdi)
movq %r12, 0x38(%rdi)
movw $0x0, 0x40(%rdi)
movb %al, 0x42(%rdi)
movl $0x0, 0x44(%rdi)
movb (%rdx), %al
movsbl %al, %ecx
addl $-0x30, %ecx
movabsq $0x680000000001, %r15   # imm = 0x680000000001
cmpl $0xa, %ecx
jb 0x43582
movq -0x28(%rbp), %rcx
cmpb $0x2e, %al
ja 0x4356a
movzbl %al, %eax
btq %rax, %r15
jb 0x4357e
movb 0x1(%rdx), %al
incq %rdx
movsbl %al, %esi
addl $-0x30, %esi
movq %rdx, %rcx
cmpl $0xa, %esi
jae 0x4355d
movq %rcx, -0x28(%rbp)
leaq -0x28(%rbp), %r14
movq %rdx, %rdi
movq %r14, %rsi
callq 0x93a0
movsd %xmm0, (%rbx)
movq (%r14), %rdi
movb (%rdi), %al
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x435ce
movq -0x28(%rbp), %rcx
cmpb $0x2e, %al
ja 0x435b6
movzbl %al, %eax
btq %rax, %r15
jb 0x435ca
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
movq %rdi, %rcx
cmpl $0xa, %edx
jae 0x435a9
movq %rcx, -0x28(%rbp)
leaq -0x28(%rbp), %r14
movq %r14, %rsi
callq 0x93a0
movsd %xmm0, 0x8(%rbx)
movq (%r14), %rax
movzbl (%rax), %ecx
cmpl $0x29, %ecx
je 0x43623
cmpl $0x20, %ecx
jne 0x435f6
incq %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movzbl (%rax), %ecx
cmpl $0x66, %ecx
je 0x43618
cmpl $0x6b, %ecx
je 0x43612
cmpl $0x74, %ecx
jne 0x43623
movb $0x1, 0x40(%rbx)
jmp 0x4361c
movb $0x1, 0x41(%rbx)
jmp 0x4361c
movb $0x1, 0x42(%rbx)
incq %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movb (%rdi), %al
cmpb $0x29, %al
je 0x436d5
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x43665
movq -0x28(%rbp), %rcx
cmpb $0x2e, %al
ja 0x4364d
movzbl %al, %eax
btq %rax, %r15
jb 0x43661
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
movq %rdi, %rcx
cmpl $0xa, %edx
jae 0x43640
movq %rcx, -0x28(%rbp)
leaq -0x28(%rbp), %r14
movq %r14, %rsi
callq 0x93a0
movsd %xmm0, 0x10(%rbx)
movq (%r14), %rcx
movzbl (%rcx), %eax
cmpl $0x29, %eax
je 0x436ab
cmpl $0x20, %eax
jne 0x436d5
leaq 0x1(%rcx), %rdi
movq %rdi, -0x28(%rbp)
movzbl 0x1(%rcx), %eax
cmpl $0x66, %eax
je 0x436bc
cmpl $0x6b, %eax
je 0x436b6
cmpl $0x74, %eax
jne 0x4381f
movb $0x1, 0x40(%rbx)
jmp 0x436c0
movb $0x1, 0x30(%rbx)
movsd %xmm0, 0x38(%rbx)
jmp 0x436d1
movb $0x1, 0x41(%rbx)
jmp 0x436c0
movb $0x1, 0x42(%rbx)
addq $0x2, %rcx
movq %rcx, -0x28(%rbp)
movsd %xmm0, 0x38(%rbx)
movb $0x1, 0x30(%rbx)
movq %r12, 0x10(%rbx)
movq -0x28(%rbp), %rdi
movb (%rdi), %al
cmpb $0x29, %al
je 0x437ad
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x43717
movq -0x28(%rbp), %rcx
cmpb $0x2e, %al
ja 0x436ff
movzbl %al, %eax
btq %rax, %r15
jb 0x43713
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
movq %rdi, %rcx
cmpl $0xa, %edx
jae 0x436f2
movq %rcx, -0x28(%rbp)
leaq -0x28(%rbp), %r14
movq %r14, %rsi
callq 0x93a0
movsd %xmm0, 0x20(%rbx)
movq (%r14), %rdi
movb (%rdi), %al
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x43761
movq -0x28(%rbp), %rcx
cmpb $0x2e, %al
ja 0x43749
movzbl %al, %eax
btq %rax, %r15
jb 0x4375d
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
movq %rdi, %rcx
cmpl $0xa, %edx
jae 0x4373c
movq %rcx, -0x28(%rbp)
leaq -0x28(%rbp), %r14
movq %r14, %rsi
callq 0x93a0
movsd %xmm0, 0x28(%rbx)
movq (%r14), %rcx
cmpb $0x20, (%rcx)
jne 0x437ad
leaq 0x1(%rcx), %rdi
movq %rdi, -0x28(%rbp)
movzbl 0x1(%rcx), %eax
cmpl $0x66, %eax
je 0x437a1
cmpl $0x6b, %eax
je 0x4379b
cmpl $0x74, %eax
jne 0x437bd
movb $0x1, 0x40(%rbx)
jmp 0x437a5
movb $0x1, 0x41(%rbx)
jmp 0x437a5
movb $0x1, 0x42(%rbx)
addq $0x2, %rcx
movq %rcx, -0x28(%rbp)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movsbl %al, %ecx
movb $0x1, 0x30(%rbx)
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x437f5
movq -0x28(%rbp), %rcx
cmpb $0x2e, %al
ja 0x437dd
movzbl %al, %eax
btq %rax, %r15
jb 0x437f1
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
movq %rdi, %rcx
cmpl $0xa, %edx
jae 0x437d0
movq %rcx, -0x28(%rbp)
leaq -0x28(%rbp), %r14
movq %r14, %rsi
callq 0x93a0
movsd %xmm0, 0x38(%rbx)
movq (%r14), %rax
cmpb $0x20, (%rax)
jne 0x437ad
movq -0x28(%rbp), %rax
movzbl (%rax), %ecx
cmpl $0x20, %ecx
jne 0x43866
incq %rax
jmp 0x43812
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x43853
movq -0x28(%rbp), %rcx
cmpb $0x2e, %al
ja 0x4383b
movzbl %al, %eax
btq %rax, %r15
jb 0x4384f
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
movq %rdi, %rcx
cmpl $0xa, %edx
jae 0x4382e
movq %rcx, -0x28(%rbp)
leaq -0x28(%rbp), %rsi
callq 0x93a0
movsd %xmm0, 0x18(%rbx)
jmp 0x436d5
cmpl $0x66, %ecx
je 0x4387f
cmpl $0x6b, %ecx
je 0x43889
cmpl $0x74, %ecx
jne 0x438ac
movq %rax, -0x28(%rbp)
movb $0x1, 0x40(%rbx)
jmp 0x43891
movq %rax, -0x28(%rbp)
movb $0x1, 0x42(%rbx)
jmp 0x43891
movq %rax, -0x28(%rbp)
movb $0x1, 0x41(%rbx)
incq %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
decq %rcx
leaq 0x1(%rcx), %rax
cmpb $0x20, 0x1(%rcx)
movq %rax, %rcx
je 0x4389f
movq %rax, -0x28(%rbp)
movzbl (%rax), %ecx
cmpl $0x72, %ecx
je 0x438ca
cmpl $0x79, %ecx
jne 0x437ad
movl $0x1, 0x44(%rbx)
jmp 0x438d1
movl $0x2, 0x44(%rbx)
incq %rax
movq %rax, -0x28(%rbp)
jmp 0x437ad
nop