// File: /workspace/github_cpp_makefile_star2_O1/Doug0855[P]TigerZone/Adapter.cpp
// Function: Adapter::parseGameMove(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
values_t Adapter::parseGameMove(std::string message)
{
  values_t out;

  std::istringstream buffer(message);
  std::istream_iterator<std::string> beg(buffer), end;

  std::vector<std::string> messageWords(beg,end);   //Put all the words from the message into a vector

  std::string gameId = messageWords[1];
  out.gameId = gameId;
  std::string temp = messageWords[3];
  out.moveNumber = temp;

  if(messageWords[6] == "FORFEITED:")  //Check to see if the other player forfeited
  {
    out.forfeit = -1;
    return out;
  }
  else if(messageWords[6] == "PLACED")  //Check to see if the other player forfeited
  {
	std::string playerId = messageWords[5];
    std::string tileType = messageWords[7];
    int xCoord = stoi(messageWords[9]);
    int yCoord = stoi(messageWords[10]);
    int rotation = stoi(messageWords[11]);
    std::string animalType = messageWords[12];

	out.playerId = playerId;

	out.coordinates = convertCoordinates(xCoord, yCoord);
	out.rotation = numRotations(rotation);
	out.tile_num = exprToTile(tileType);
	if (animalType == "CROCODILE")
		out.croc = true;
	else
		out.croc = false;
	if (animalType == "TIGER")
		out.tiger = true;
	else
		out.tiger = false;


    if(messageWords.size() == 14 && animalType == "TIGER"){
      int tigerZone = stoi(messageWords[13]);
      out.tiger_spot = convertZone(tigerZone);   //Set the zone where the meeple is placed in the tile
    }

    return out;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
movq %rdi, %rbx
leaq 0x50(%rdi), %rax
xorl %ecx, %ecx
movq %rcx, 0x38(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x18(%rdi)
movq %rax, 0x40(%rdi)
movq %rcx, 0x48(%rdi)
movb %cl, 0x50(%rdi)
leaq 0x70(%rdi), %rax
movq %rax, 0x60(%rdi)
movq %rcx, 0x68(%rdi)
movb %cl, 0x70(%rdi)
leaq 0x90(%rdi), %rax
movq %rax, 0x80(%rdi)
movq %rcx, 0x88(%rdi)
movb %cl, 0x90(%rdi)
movl $0x0, 0xa4(%rdi)
leaq -0x340(%rbp), %rdi
movq %rdx, %rsi
movl $0x8, %edx
callq 0x33b0
leaq -0x158(%rbp), %rdi
leaq -0x340(%rbp), %rsi
callq 0xc716
xorl %eax, %eax
leaq -0xa0(%rbp), %r12
movq %rax, -0x18(%r12)
movq %r12, -0x10(%r12)
movq %rax, -0x8(%r12)
movb %al, (%r12)
movb %al, 0x10(%r12)
movq -0x158(%rbp), %rax
movq -0x150(%rbp), %rsi
leaq -0x180(%rbp), %rdi
movq %rax, -0x8(%rdi)
leaq -0x170(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x148(%rbp), %rdx
addq %rsi, %rdx
callq 0x9da8
movb -0x130(%rbp), %al
movb %al, -0x160(%rbp)
movq -0xb8(%rbp), %rax
movq -0xb0(%rbp), %rsi
leaq -0x1b8(%rbp), %rdi
movq %rax, -0x8(%rdi)
leaq -0x1a8(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0xa8(%rbp), %rdx
addq %rsi, %rdx
callq 0x9da8
movb -0x90(%rbp), %al
leaq -0x1c0(%rbp), %rdx
movb %al, 0x28(%rdx)
leaq -0x48(%rbp), %rdi
leaq -0x188(%rbp), %rsi
leaq -0xe8(%rbp), %rcx
callq 0xc768
movq -0x1b8(%rbp), %rdi
cmpq %r15, %rdi
je 0xc03b
callq 0x3200
movq -0x180(%rbp), %rdi
cmpq %r14, %rdi
je 0xc04c
callq 0x3200
movq -0x48(%rbp), %rax
leaq -0xd8(%rbp), %r15
movq %r15, -0x10(%r15)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq -0xe8(%rbp), %rdi
callq 0x9da8
leaq 0x40(%rbx), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x3140
movq -0x48(%rbp), %rax
leaq -0x78(%rbp), %r13
movq %r13, -0x10(%r13)
movq 0x60(%rax), %rsi
movq 0x68(%rax), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %rdi
callq 0x9da8
leaq 0x60(%rbx), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3140
movl $0xc0, %r14d
movq -0x48(%rbp), %rdi
addq %r14, %rdi
leaq 0xc4dd(%rip), %rsi      # 0x185a6
callq 0x30b0
testl %eax, %eax
je 0xc2e2
addq -0x48(%rbp), %r14
leaq 0xc4d0(%rip), %rsi      # 0x185b1
movq %r14, %rdi
callq 0x30b0
movq -0x48(%rbp), %rax
leaq -0x118(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq 0xa0(%rax), %rsi
movq 0xa8(%rax), %rdx
addq %rsi, %rdx
leaq -0x128(%rbp), %rdi
callq 0x9da8
movq -0x48(%rbp), %rax
leaq -0xf8(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq 0xe0(%rax), %rsi
movq 0xe8(%rax), %rdx
addq %rsi, %rdx
leaq -0x108(%rbp), %rdi
callq 0x9da8
movq -0x48(%rbp), %rax
movq 0x120(%rax), %r12
callq 0x3040
movq %rax, %r14
movl (%rax), %r15d
movl $0x0, (%rax)
leaq -0x68(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x32e0
cmpq %r12, (%r13)
je 0xc4e3
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0xc4ef
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0xc4ef
movq %rax, -0xc8(%rbp)
testl %ecx, %ecx
jne 0xc1a1
movl %r15d, (%r14)
movq -0x48(%rbp), %rax
movq 0x140(%rax), %r13
movl (%r14), %r15d
movl $0x0, (%r14)
leaq -0x68(%rbp), %r12
movq %r13, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x32e0
cmpq %r13, (%r12)
je 0xc4fb
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%rax), %rdx
cmpq %rcx, %rdx
jb 0xc507
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0xc507
movq %rax, -0xc0(%rbp)
testl %ecx, %ecx
jne 0xc208
movl %r15d, (%r14)
movq -0x48(%rbp), %rax
movq 0x160(%rax), %r12
movl (%r14), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, (%r14)
leaq -0x68(%rbp), %r15
movq %r12, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x32e0
cmpq %r12, (%r15)
je 0xc513
movq %rax, %r13
addq $-0x80000000, %rax      # imm = 0x80000000
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jb 0xc51f
movl (%r14), %eax
cmpl $0x22, %eax
je 0xc51f
testl %eax, %eax
jne 0xc26f
movl -0x2c(%rbp), %eax
movl %eax, (%r14)
movq -0x48(%rbp), %rax
leaq -0x58(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq 0x180(%rax), %rsi
movq 0x188(%rax), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %rdi
callq 0x9da8
leaq 0x80(%rbx), %rdi
leaq -0x128(%rbp), %rsi
callq 0x3140
movq -0xc8(%rbp), %rax
addl $0x48, %eax
movl $0x48, %ecx
subl -0xc0(%rbp), %ecx
movl %ecx, 0x30(%rbx)
movl %eax, 0x34(%rbx)
cmpl $0x5a, %r13d
je 0xc2f8
cmpl $0x10e, %r13d           # imm = 0x10E
je 0xc2f1
cmpl $0xb4, %r13d
jne 0xc2ff
movl $0x2, %eax
jmp 0xc301
movl $0xffffffff, 0xa4(%rbx) # imm = 0xFFFFFFFF
jmp 0xc45e
movl $0x3, %eax
jmp 0xc301
movl $0x1, %eax
jmp 0xc301
xorl %eax, %eax
leaq -0xa0(%rbp), %r12
leaq -0x78(%rbp), %r13
movl %eax, 0x8(%rbx)
leaq -0x108(%rbp), %rsi
callq 0xa5ba
movl %eax, 0x4(%rbx)
leaq 0xc293(%rip), %rsi      # 0x185b8
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
sete 0xa0(%rbx)
leaq 0xc418(%rip), %rsi      # 0x18755
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
sete 0xa1(%rbx)
movq -0x40(%rbp), %rax
subq -0x48(%rbp), %rax
cmpq $0x1c0, %rax            # imm = 0x1C0
jne 0xc415
leaq 0xc3ec(%rip), %rsi      # 0x18755
leaq -0x68(%rbp), %rdi
callq 0x30b0
testl %eax, %eax
jne 0xc415
movq -0x48(%rbp), %rax
movq 0x1a0(%rax), %r15
movl (%r14), %r13d
movl $0x0, (%r14)
leaq -0x190(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x32e0
cmpq %r15, (%r12)
je 0xc52b
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0xc537
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0xc537
testl %ecx, %ecx
jne 0xc3dd
movl %r13d, (%r14)
decl %eax
movl $0x2, %ecx
movl $0x2, %edx
cmpl $0x7, %eax
ja 0xc404
movl %eax, %eax
leaq 0xc269(%rip), %rcx      # 0x18660
movl (%rcx,%rax,4), %ecx
leaq 0xc27f(%rip), %rdx      # 0x18680
movl (%rdx,%rax,4), %edx
movl %ecx, 0x38(%rbx)
movl %edx, 0x3c(%rbx)
leaq -0xa0(%rbp), %r12
leaq -0x78(%rbp), %r13
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
leaq -0xd8(%rbp), %r15
je 0xc42e
callq 0x3200
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
leaq -0x118(%rbp), %r14
je 0xc44d
callq 0x3200
movq -0x128(%rbp), %rdi
cmpq %r14, %rdi
je 0xc45e
callq 0x3200
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0xc46f
callq 0x3200
movq -0xe8(%rbp), %rdi
cmpq %r15, %rdi
je 0xc480
callq 0x3200
leaq -0x48(%rbp), %rdi
callq 0xc6c8
movq -0xb0(%rbp), %rdi
cmpq %r12, %rdi
je 0xc49a
callq 0x3200
leaq -0x140(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc4af
callq 0x3200
movq 0x12b0a(%rip), %rsi     # 0x1efc0
leaq -0x340(%rbp), %rdi
callq 0x3300
leaq -0x2c8(%rbp), %rdi
callq 0x30d0
movq %rbx, %rax
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbe86(%rip), %rdi      # 0x18370
callq 0x3150
leaq 0xbe7a(%rip), %rdi      # 0x18370
callq 0x3320
leaq 0xbe6e(%rip), %rdi      # 0x18370
callq 0x3150
leaq 0xbe62(%rip), %rdi      # 0x18370
callq 0x3320
leaq 0xbe56(%rip), %rdi      # 0x18370
callq 0x3150
leaq 0xbe4a(%rip), %rdi      # 0x18370
callq 0x3320
leaq 0xbe3e(%rip), %rdi      # 0x18370
callq 0x3150
leaq 0xbe32(%rip), %rdi      # 0x18370
callq 0x3320
movq %rax, %r12
cmpl $0x0, (%r14)
jne 0xc554
movl %r13d, (%r14)
jmp 0xc554
movq %rax, %r12
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xc605
callq 0x3200
jmp 0xc605
movq %rax, %r12
jmp 0xc605
movq %rax, %r12
jmp 0xc61d
jmp 0xc581
movq %rax, %r12
jmp 0xc635
jmp 0xc58b
movq %rax, %r12
jmp 0xc64a
movq %rax, %r12
jmp 0xc662
movq %rax, %r12
movq -0x1b8(%rbp), %rdi
cmpq %r15, %rdi
je 0xc5b4
callq 0x3200
jmp 0xc5b4
movq %rax, %r12
movq -0x180(%rbp), %rdi
cmpq %r14, %rdi
je 0xc66b
callq 0x3200
jmp 0xc66b
movq %rax, %r12
jmp 0xc66b
movq %rax, %r12
jmp 0xc698
movq %rax, %r12
jmp 0xc6b7
movq %rax, %r12
cmpl $0x0, (%r14)
jne 0xc605
movl -0x2c(%rbp), %eax
movl %eax, (%r14)
jmp 0xc605
jmp 0xc5f9
movq %rax, %r12
cmpl $0x0, (%r14)
jne 0xc605
movl %r15d, (%r14)
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0xc61d
callq 0x3200
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0xc635
callq 0x3200
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xc64a
callq 0x3200
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0xc662
callq 0x3200
leaq -0x48(%rbp), %rdi
callq 0xc6c8
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xc683
callq 0x3200
leaq -0x140(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc698
callq 0x3200
movq 0x12921(%rip), %rsi     # 0x1efc0
leaq -0x340(%rbp), %rdi
callq 0x3300
leaq -0x2c8(%rbp), %rdi
callq 0x30d0
movq %rbx, %rdi
callq 0x8ca0
movq %r12, %rdi
callq 0x33f0
nop