// File: /workspace/github_cpp_makefile_star2_O3/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 0x41e26
cmpb $0x2e, %al
ja 0x41e11
movzbl %al, %eax
btq %rax, %r15
jb 0x41e22
movb 0x1(%rdx), %al
incq %rdx
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jae 0x41e04
movq %rdx, -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 0x41e6b
cmpb $0x2e, %al
ja 0x41e56
movzbl %al, %eax
btq %rax, %r15
jb 0x41e67
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jae 0x41e49
movq %rdi, -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 0x41eae
cmpb $0x2e, %al
ja 0x41e99
movzbl %al, %eax
btq %rax, %r15
jb 0x41eaa
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jae 0x41e8c
movq %rdi, -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 0x41ef1
cmpb $0x2e, %al
ja 0x41edc
movzbl %al, %eax
btq %rax, %r15
jb 0x41eed
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jae 0x41ecf
movq %rdi, -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 0x42238
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x41f3c
cmpb $0x2e, %al
ja 0x41f27
movzbl %al, %eax
btq %rax, %r15
jb 0x41f38
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jae 0x41f1a
movq %rdi, -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 0x41f7f
cmpb $0x2e, %al
ja 0x41f6a
movzbl %al, %eax
btq %rax, %r15
jb 0x41f7b
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jae 0x41f5d
movq %rdi, -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 0x41fa0
incq %rdi
jmp 0x41f93
cmpl $0x28, %eax
jne 0x41fb0
movq %rdi, -0x20(%rbp)
movb $0x28, %al
jmp 0x42049
movsbl %al, %ecx
movq %rdi, -0x20(%rbp)
movb $0x1, 0x30(%rbx)
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x41fe5
cmpb $0x2e, %al
ja 0x41fd0
movzbl %al, %eax
btq %rax, %r15
jb 0x41fe1
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jae 0x41fc3
movq %rdi, -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 0x42028
cmpb $0x2e, %al
ja 0x42013
movzbl %al, %eax
btq %rax, %r15
jb 0x42024
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jae 0x42006
movq %rdi, -0x20(%rbp)
leaq -0x20(%rbp), %r14
movq %r14, %rsi
callq 0x93a0
movsd %xmm0, 0x40(%rbx)
movq (%r14), %rdi
movb (%rdi), %al
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x4206b
cmpb $0x2e, %al
ja 0x42056
movzbl %al, %eax
btq %rax, %r15
jb 0x42067
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jae 0x42049
movq %rdi, -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 0x420ae
cmpb $0x2e, %al
ja 0x42099
movzbl %al, %eax
btq %rax, %r15
jb 0x420aa
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jae 0x4208c
movq %rdi, -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 0x420f1
cmpb $0x2e, %al
ja 0x420dc
movzbl %al, %eax
btq %rax, %r15
jb 0x420ed
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jae 0x420cf
movq %rdi, -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 0x42134
cmpb $0x2e, %al
ja 0x4211f
movzbl %al, %eax
btq %rax, %r15
jb 0x42130
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jae 0x42112
movq %rdi, -0x20(%rbp)
leaq -0x20(%rbp), %r14
movq %r14, %rsi
callq 0x93a0
movsd %xmm0, 0x60(%rbx)
movq (%r14), %rax
movb 0x1(%rax), %cl
cmpb $0x29, %cl
je 0x42238
addq $0x2, %rax
cmpb $0x20, %cl
jne 0x42164
movb (%rax), %cl
incq %rax
jmp 0x42158
movzbl %cl, %ecx
cmpl $0x71, %ecx
jle 0x42184
cmpl $0x72, %ecx
je 0x42193
cmpl $0x74, %ecx
je 0x4219c
cmpl $0x79, %ecx
jne 0x4218e
movl $0x1, 0x6c(%rbx)
jmp 0x421a6
cmpl $0x66, %ecx
je 0x421a2
cmpl $0x6b, %ecx
je 0x421a6
decq %rax
jmp 0x421a6
movl $0x2, 0x6c(%rbx)
jmp 0x421a6
movb $0x1, 0x68(%rbx)
jmp 0x421a6
movb $0x1, 0x69(%rbx)
movq %rax, -0x20(%rbp)
movzbl (%rax), %ecx
cmpl $0x20, %ecx
jne 0x421b7
incq %rax
jmp 0x421aa
cmpl $0x71, %ecx
jle 0x421d8
cmpl $0x72, %ecx
je 0x421ec
cmpl $0x74, %ecx
je 0x421f9
cmpl $0x79, %ecx
jne 0x42203
movq %rax, -0x20(%rbp)
movl $0x1, 0x6c(%rbx)
jmp 0x42207
cmpl $0x29, %ecx
je 0x42238
cmpl $0x66, %ecx
jne 0x42203
movq %rax, -0x20(%rbp)
movb $0x1, 0x69(%rbx)
jmp 0x42207
movq %rax, -0x20(%rbp)
movl $0x2, 0x6c(%rbx)
jmp 0x42207
movq %rax, -0x20(%rbp)
movb $0x1, 0x68(%rbx)
jmp 0x42207
movq %rax, -0x20(%rbp)
incq %rax
movzbl -0x1(%rax), %ecx
cmpl $0x20, %ecx
je 0x42207
cmpl $0x29, %ecx
je 0x42238
movq %rax, -0x20(%rbp)
movzbl (%rax), %eax
cmpl $0x79, %eax
je 0x42230
cmpl $0x72, %eax
jne 0x42238
movl $0x2, %eax
jmp 0x42235
movl $0x1, %eax
movl %eax, 0x6c(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq