// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Parser.cpp
// Function: Parser::ParseObjProperty_Fullstate(char*)
Parser::ObjProperty_Fullstate Parser::ParseObjProperty_Fullstate(char *msg) {
  //((p r 11 14) 0.385 -7.01275e-12 -1.15337e-23 -8.33192e-24 46.129 0 (stamina
  //8000 0.933173 1 124249)))
  //((p {l|r} <unum> [g] <player_type_id>)
  //  <pos.x> <pos.y> <vel.x> <vel.y> <body_angle> <neck_angle>
  //  [ <point_dist> <point_dir>]
  //  (<stamina> <effort> <recovery> <capacity>)
  // [t|k|f] [y|r])

  ObjProperty_Fullstate result;

  // ball or player
  result.x = parser::get_double(&msg);
  result.y = parser::get_double(&msg);

  result.vx = parser::get_double(&msg);
  result.vy = parser::get_double(&msg);

  if (*msg != ')') { // player
    result.body_dir = parser::get_double(&msg);
    result.head_dir = parser::get_double(&msg);

    while (*msg == ' ')
      ++msg;

    if (*msg != '(') { // pointing
      result.pointing = true;
      result.point_dist = parser::get_double(&msg);
      result.point_dir = parser::get_double(&msg);
    }

    result.stamina = parser::get_double(&msg);
    result.effort = parser::get_double(&msg);
    result.recovery = parser::get_double(&msg);
    result.capacity = parser::get_double(&msg);

    msg++;

    if (*msg != ')') {
      while (*msg == ' ')
        ++msg;

      switch (*msg) {
      case 't':
        result.tackling = true;
        ++msg;
        break;
      case 'f':
        result.lying = true;
        ++msg;
        break;
      case 'y':
        result.card_type = CR_Yellow;
        ++msg;
        break;
      case 'r':
        result.card_type = CR_Red;
        ++msg;
        break;
      case 'k':
        // kicking
        ++msg;
        break;
      default:
        Assert(0);
        break;
      }

      while (*msg == ' ')
        ++msg;

      if (*msg != ')') {
        if (*msg == 't') {
          result.tackling = true;
        } else if (*msg == 'f') {
          result.lying = true;
        } else if (*msg == 'k') {
        } else if (*msg == 'y') {
          result.card_type = CR_Yellow;
        } else if (*msg == 'r') {
          result.card_type = CR_Red;
        }

        while (*msg == ' ')
          ++msg;
        if (*msg != ')') {
          ++msg;
          if (*msg == 'y') {
            result.card_type = CR_Yellow;
          } else if (*msg == 'r') {
            result.card_type = CR_Red;
          }
        }
      }
    }
  }
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq -0x18(%rbp), %r14
movq %rdx, (%r14)
callq 0x384c2
movq %r14, %rdi
callq 0x381af
movsd %xmm0, (%rbx)
movq %r14, %rdi
callq 0x381af
movsd %xmm0, 0x8(%rbx)
movq %r14, %rdi
callq 0x381af
movsd %xmm0, 0x10(%rbx)
movq %r14, %rdi
callq 0x381af
movsd %xmm0, 0x18(%rbx)
movq (%r14), %rax
cmpb $0x29, (%rax)
je 0x37453
movq %r14, %rdi
callq 0x381af
movsd %xmm0, 0x20(%rbx)
movq %r14, %rdi
callq 0x381af
movsd %xmm0, 0x28(%rbx)
movq (%r14), %rax
incq %rax
movzbl -0x1(%rax), %ecx
cmpl $0x20, %ecx
jne 0x37314
movq %rax, -0x18(%rbp)
jmp 0x37302
cmpl $0x28, %ecx
je 0x3733b
movb $0x1, 0x30(%rbx)
leaq -0x18(%rbp), %r14
movq %r14, %rdi
callq 0x381af
movsd %xmm0, 0x38(%rbx)
movq %r14, %rdi
callq 0x381af
movsd %xmm0, 0x40(%rbx)
leaq -0x18(%rbp), %r14
movq %r14, %rdi
callq 0x381af
movsd %xmm0, 0x48(%rbx)
movq %r14, %rdi
callq 0x381af
movsd %xmm0, 0x50(%rbx)
movq %r14, %rdi
callq 0x381af
movsd %xmm0, 0x58(%rbx)
movq %r14, %rdi
callq 0x381af
movsd %xmm0, 0x60(%rbx)
movq (%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, (%r14)
movb 0x1(%rax), %cl
cmpb $0x29, %cl
je 0x37453
addq $0x2, %rax
cmpb $0x20, %cl
jne 0x3739d
movq %rax, -0x18(%rbp)
movb (%rax), %cl
incq %rax
jmp 0x3738d
movzbl %cl, %ecx
cmpl $0x66, %ecx
je 0x373d1
cmpl $0x6b, %ecx
je 0x373dc
cmpl $0x72, %ecx
je 0x373c2
cmpl $0x74, %ecx
je 0x373cb
cmpl $0x79, %ecx
jne 0x373d7
movl $0x1, 0x6c(%rbx)
jmp 0x373dc
movl $0x2, 0x6c(%rbx)
jmp 0x373dc
movb $0x1, 0x68(%rbx)
jmp 0x373dc
movb $0x1, 0x69(%rbx)
jmp 0x373dc
decq %rax
jmp 0x373e0
movq %rax, -0x18(%rbp)
incq %rax
movzbl -0x1(%rax), %ecx
cmpl $0x20, %ecx
je 0x373dc
cmpl $0x29, %ecx
je 0x37453
cmpl $0x66, %ecx
je 0x3740e
cmpl $0x72, %ecx
je 0x37414
cmpl $0x74, %ecx
je 0x3741d
cmpl $0x79, %ecx
jne 0x3742a
movl $0x1, 0x6c(%rbx)
jmp 0x3742a
movb $0x1, 0x69(%rbx)
jmp 0x3742a
movl $0x2, 0x6c(%rbx)
jmp 0x3742a
movb $0x1, 0x68(%rbx)
jmp 0x3742a
movq %rax, -0x18(%rbp)
incq %rax
movzbl -0x1(%rax), %ecx
cmpl $0x20, %ecx
je 0x37423
cmpl $0x29, %ecx
je 0x37453
movq %rax, -0x18(%rbp)
movzbl (%rax), %eax
cmpl $0x79, %eax
je 0x3744d
cmpl $0x72, %eax
jne 0x37453
pushq $0x2
jmp 0x3744f
pushq $0x1
popq %rax
movl %eax, 0x6c(%rbx)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop