// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rdx, -0x20(%rbp)
movabsq $0x7fefffffffffffff, %rax # imm = 0x7FEFFFFFFFFFFFFF
movq %rax, (%rdi)
movq %rax, 0x8(%rdi)
movq %rax, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq %rax, 0x28(%rdi)
movb $0x0, 0x30(%rdi)
movq %rax, 0x38(%rdi)
movq %rax, 0x40(%rdi)
movq %rax, 0x48(%rdi)
movq %rax, 0x50(%rdi)
movq %rax, 0x58(%rdi)
movq %rax, 0x60(%rdi)
movw $0x0, 0x68(%rdi)
movl $0x0, 0x6c(%rdi)
movb (%rdx), %al
movsbl %al, %ecx
addl $-0x30, %ecx
movabsq $0x680000000001, %r15   # imm = 0x680000000001
cmpl $0xa, %ecx
jb 0x42fa3
movq -0x20(%rbp), %rcx
cmpb $0x2e, %al
ja 0x42f8b
movzbl %al, %eax
btq %rax, %r15
jb 0x42f9f
movb 0x1(%rdx), %al
incq %rdx
movsbl %al, %esi
addl $-0x30, %esi
movq %rdx, %rcx
cmpl $0xa, %esi
jae 0x42f7e
movq %rcx, -0x20(%rbp)
leaq -0x20(%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 0x42fef
movq -0x20(%rbp), %rcx
cmpb $0x2e, %al
ja 0x42fd7
movzbl %al, %eax
btq %rax, %r15
jb 0x42feb
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
movq %rdi, %rcx
cmpl $0xa, %edx
jae 0x42fca
movq %rcx, -0x20(%rbp)
leaq -0x20(%rbp), %r14
movq %r14, %rsi
callq 0x93a0
movsd %xmm0, 0x8(%rbx)
movq (%r14), %rdi
movb (%rdi), %al
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x43039
movq -0x20(%rbp), %rcx
cmpb $0x2e, %al
ja 0x43021
movzbl %al, %eax
btq %rax, %r15
jb 0x43035
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
movq %rdi, %rcx
cmpl $0xa, %edx
jae 0x43014
movq %rcx, -0x20(%rbp)
leaq -0x20(%rbp), %r14
movq %r14, %rsi
callq 0x93a0
movsd %xmm0, 0x10(%rbx)
movq (%r14), %rdi
movb (%rdi), %al
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x43083
movq -0x20(%rbp), %rcx
cmpb $0x2e, %al
ja 0x4306b
movzbl %al, %eax
btq %rax, %r15
jb 0x4307f
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
movq %rdi, %rcx
cmpl $0xa, %edx
jae 0x4305e
movq %rcx, -0x20(%rbp)
leaq -0x20(%rbp), %r14
movq %r14, %rsi
callq 0x93a0
movsd %xmm0, 0x18(%rbx)
movq (%r14), %rdi
movb (%rdi), %al
cmpb $0x29, %al
je 0x43400
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x430d5
movq -0x20(%rbp), %rcx
cmpb $0x2e, %al
ja 0x430bd
movzbl %al, %eax
btq %rax, %r15
jb 0x430d1
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
movq %rdi, %rcx
cmpl $0xa, %edx
jae 0x430b0
movq %rcx, -0x20(%rbp)
leaq -0x20(%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 0x4311f
movq -0x20(%rbp), %rcx
cmpb $0x2e, %al
ja 0x43107
movzbl %al, %eax
btq %rax, %r15
jb 0x4311b
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
movq %rdi, %rcx
cmpl $0xa, %edx
jae 0x430fa
movq %rcx, -0x20(%rbp)
leaq -0x20(%rbp), %r14
movq %r14, %rsi
callq 0x93a0
movsd %xmm0, 0x28(%rbx)
movq (%r14), %rdi
movzbl (%rdi), %eax
cmpl $0x20, %eax
jne 0x43140
incq %rdi
jmp 0x43133
cmpl $0x28, %eax
jne 0x4314e
movq %rdi, -0x20(%rbp)
jmp 0x431e2
movsbl %al, %ecx
movq %rdi, -0x20(%rbp)
movb $0x1, 0x30(%rbx)
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x4318a
movq -0x20(%rbp), %rcx
cmpb $0x2e, %al
ja 0x43172
movzbl %al, %eax
btq %rax, %r15
jb 0x43186
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
movq %rdi, %rcx
cmpl $0xa, %edx
jae 0x43165
movq %rcx, -0x20(%rbp)
leaq -0x20(%rbp), %r14
movq %r14, %rsi
callq 0x93a0
movsd %xmm0, 0x38(%rbx)
movq (%r14), %rdi
movb (%rdi), %al
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x431d4
movq -0x20(%rbp), %rcx
cmpb $0x2e, %al
ja 0x431bc
movzbl %al, %eax
btq %rax, %r15
jb 0x431d0
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
movq %rdi, %rcx
cmpl $0xa, %edx
jae 0x431af
movq %rcx, -0x20(%rbp)
leaq -0x20(%rbp), %rsi
callq 0x93a0
movsd %xmm0, 0x40(%rbx)
movq -0x20(%rbp), %rdi
movb (%rdi), %al
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x4321c
movq -0x20(%rbp), %rcx
cmpb $0x2e, %al
ja 0x43204
movzbl %al, %eax
btq %rax, %r15
jb 0x43218
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
movq %rdi, %rcx
cmpl $0xa, %edx
jae 0x431f7
movq %rcx, -0x20(%rbp)
leaq -0x20(%rbp), %r14
movq %r14, %rsi
callq 0x93a0
movsd %xmm0, 0x48(%rbx)
movq (%r14), %rdi
movb (%rdi), %al
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x43266
movq -0x20(%rbp), %rcx
cmpb $0x2e, %al
ja 0x4324e
movzbl %al, %eax
btq %rax, %r15
jb 0x43262
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
movq %rdi, %rcx
cmpl $0xa, %edx
jae 0x43241
movq %rcx, -0x20(%rbp)
leaq -0x20(%rbp), %r14
movq %r14, %rsi
callq 0x93a0
movsd %xmm0, 0x50(%rbx)
movq (%r14), %rdi
movb (%rdi), %al
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x432b0
movq -0x20(%rbp), %rcx
cmpb $0x2e, %al
ja 0x43298
movzbl %al, %eax
btq %rax, %r15
jb 0x432ac
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
movq %rdi, %rcx
cmpl $0xa, %edx
jae 0x4328b
movq %rcx, -0x20(%rbp)
leaq -0x20(%rbp), %r14
movq %r14, %rsi
callq 0x93a0
movsd %xmm0, 0x58(%rbx)
movq (%r14), %rdi
movb (%rdi), %al
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x432fa
movq -0x20(%rbp), %rcx
cmpb $0x2e, %al
ja 0x432e2
movzbl %al, %eax
btq %rax, %r15
jb 0x432f6
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
movq %rdi, %rcx
cmpl $0xa, %edx
jae 0x432d5
movq %rcx, -0x20(%rbp)
leaq -0x20(%rbp), %r14
movq %r14, %rsi
callq 0x93a0
movsd %xmm0, 0x60(%rbx)
movq (%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, (%r14)
cmpb $0x29, 0x1(%rax)
je 0x43400
movq -0x20(%rbp), %rax
movzbl (%rax), %ecx
cmpl $0x20, %ecx
jne 0x43330
incq %rax
jmp 0x43323
cmpl $0x71, %ecx
jle 0x43351
cmpl $0x72, %ecx
je 0x4335d
cmpl $0x74, %ecx
je 0x4336a
cmpl $0x79, %ecx
jne 0x4337f
movq %rax, -0x20(%rbp)
movl $0x1, 0x6c(%rbx)
jmp 0x4337c
cmpl $0x66, %ecx
je 0x43374
cmpl $0x6b, %ecx
je 0x4337c
jmp 0x4337f
movq %rax, -0x20(%rbp)
movl $0x2, 0x6c(%rbx)
jmp 0x4337c
movq %rax, -0x20(%rbp)
movb $0x1, 0x68(%rbx)
jmp 0x4337c
movq %rax, -0x20(%rbp)
movb $0x1, 0x69(%rbx)
incq %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movzbl (%rax), %ecx
cmpl $0x20, %ecx
jne 0x43394
incq %rax
jmp 0x43387
cmpl $0x71, %ecx
jle 0x433b5
cmpl $0x72, %ecx
je 0x433c9
cmpl $0x74, %ecx
je 0x433d6
cmpl $0x79, %ecx
jne 0x433e0
movq %rax, -0x20(%rbp)
movl $0x1, 0x6c(%rbx)
jmp 0x433e4
cmpl $0x29, %ecx
je 0x433fc
cmpl $0x66, %ecx
jne 0x433e0
movq %rax, -0x20(%rbp)
movb $0x1, 0x69(%rbx)
jmp 0x433e4
movq %rax, -0x20(%rbp)
movl $0x2, 0x6c(%rbx)
jmp 0x433e4
movq %rax, -0x20(%rbp)
movb $0x1, 0x68(%rbx)
jmp 0x433e4
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
incq %rax
movzbl -0x1(%rax), %ecx
cmpl $0x20, %ecx
je 0x433e8
cmpl $0x29, %ecx
jne 0x4340e
decq %rax
movq %rax, -0x20(%rbp)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, -0x20(%rbp)
movzbl (%rax), %eax
cmpl $0x72, %eax
je 0x43428
cmpl $0x79, %eax
jne 0x43400
movl $0x1, 0x6c(%rbx)
jmp 0x43400
movl $0x2, 0x6c(%rbx)
jmp 0x43400
nop