// File: 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
subq $0x30, %rsp
movq %rdi, -0x18(%rbp)
movq %rdi, %rax
movq %rax, -0x20(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
callq 0x78600
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)
leaq -0x10(%rbp), %rdi
callq 0x77d60
movq -0x18(%rbp), %rdi
movsd %xmm0, 0x10(%rdi)
leaq -0x10(%rbp), %rdi
callq 0x77d60
movq -0x18(%rbp), %rdi
movsd %xmm0, 0x18(%rdi)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
je 0x762e4
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 0x76085
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x7606b
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x28, %eax
je 0x760bd
movq -0x18(%rbp), %rax
movb $0x1, 0x30(%rax)
leaq -0x10(%rbp), %rdi
callq 0x77d60
movq -0x18(%rbp), %rax
movsd %xmm0, 0x38(%rax)
leaq -0x10(%rbp), %rdi
callq 0x77d60
movq -0x18(%rbp), %rax
movsd %xmm0, 0x40(%rax)
leaq -0x10(%rbp), %rdi
callq 0x77d60
movq -0x18(%rbp), %rax
movsd %xmm0, 0x48(%rax)
leaq -0x10(%rbp), %rdi
callq 0x77d60
movq -0x18(%rbp), %rax
movsd %xmm0, 0x50(%rax)
leaq -0x10(%rbp), %rdi
callq 0x77d60
movq -0x18(%rbp), %rax
movsd %xmm0, 0x58(%rax)
leaq -0x10(%rbp), %rdi
callq 0x77d60
movq -0x18(%rbp), %rax
movsd %xmm0, 0x60(%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
je 0x762e2
jmp 0x76123
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x7613d
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x76123
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
addl $-0x66, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x13, %eax
ja 0x761d6
movq -0x28(%rbp), %rax
leaq 0x4d193(%rip), %rcx     # 0xc32f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movb $0x1, 0x68(%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x761d8
movq -0x18(%rbp), %rax
movb $0x1, 0x69(%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x761d8
movq -0x18(%rbp), %rax
movl $0x1, 0x6c(%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x761d8
movq -0x18(%rbp), %rax
movl $0x2, 0x6c(%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x761d8
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x761d8
jmp 0x761d8
jmp 0x761da
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x761f4
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x761da
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
je 0x762e0
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x74, %eax
jne 0x7621a
movq -0x18(%rbp), %rax
movb $0x1, 0x68(%rax)
jmp 0x76276
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
jne 0x76230
movq -0x18(%rbp), %rax
movb $0x1, 0x69(%rax)
jmp 0x76274
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x6b, %eax
jne 0x7623e
jmp 0x76272
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x79, %eax
jne 0x76257
movq -0x18(%rbp), %rax
movl $0x1, 0x6c(%rax)
jmp 0x76270
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x72, %eax
jne 0x7626e
movq -0x18(%rbp), %rax
movl $0x2, 0x6c(%rax)
jmp 0x76270
jmp 0x76272
jmp 0x76274
jmp 0x76276
jmp 0x76278
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x76292
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x76278
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
je 0x762de
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x79, %eax
jne 0x762c3
movq -0x18(%rbp), %rax
movl $0x1, 0x6c(%rax)
jmp 0x762dc
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x72, %eax
jne 0x762da
movq -0x18(%rbp), %rax
movl $0x2, 0x6c(%rax)
jmp 0x762dc
jmp 0x762de
jmp 0x762e0
jmp 0x762e2
jmp 0x762e4
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop