// File: /workspace/github_cpp_makefile_star2_O2/halsafar[P]libtmx-parser/./src/tmxparser.cpp
// Function: tmxparser::_parseObjectNode(tinyxml2::XMLElement*, tmxparser::TmxObject*)
TmxReturn _parseObjectNode(tinyxml2::XMLElement* element, TmxObject* outObj)
{
	TmxReturn error = TmxReturn::kSuccess;

	if (element->Attribute("name"))
	{
		outObj->name = element->Attribute("name");
	}

	if (element->Attribute("type"))
	{
		outObj->type = element->Attribute("type");
	}
	outObj->x = element->FloatAttribute("x");
	outObj->y = element->FloatAttribute("y");
	outObj->width = element->FloatAttribute("width");
	outObj->height = element->FloatAttribute("height");
	outObj->rotation = element->FloatAttribute("rotation");
	outObj->referenceGid = element->UnsignedAttribute("gid");
	outObj->visible = element->BoolAttribute("visible");

	error = _parsePropertyNode(element->FirstChildElement("properties"), &outObj->propertyMap);
	if (error)
	{
		return error;
	}


	tinyxml2::XMLElement* shapeElement = NULL;
	if ((shapeElement = element->FirstChildElement("ellipse")) != NULL)
	{
		outObj->shapeType = kEllipse;
	}
	else if ((shapeElement = element->FirstChildElement("polygon")) != NULL)
	{
		outObj->shapeType = kPolygon;
	}
	else if ((shapeElement = element->FirstChildElement("polyline")) != NULL)
	{
		outObj->shapeType = kPolyline;
	}
	else
	{
		outObj->shapeType = kSquare;
	}

	if ((outObj->shapeType == kPolygon || outObj->shapeType == kPolyline) && shapeElement != NULL)
	{
		if (shapeElement->Attribute("points") == NULL)
		{
			LOGE("Missing points attribute for shape requiring one...");
			return TmxReturn::kErrorParsing;
		}

		std::string pointString = shapeElement->Attribute("points");
		std::istringstream pairStringStream(pointString);
		std::string pairToken;
		while(std::getline(pairStringStream, pairToken, ' '))
		{
			TmxShapePoint pair;
			std::istringstream pointStringString(pairToken);
			std::string pointToken;
			std::getline(pointStringString, pointToken, ',');
			pair.first = (float)atof(pointToken.c_str());
			std::getline(pointStringString, pointToken, ',');
			pair.second = (float)atof(pointToken.c_str());

			outObj->shapePoints.push_back(pair);
		}
	}

	return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x368, %rsp            # imm = 0x368
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x9dd4(%rip), %rsi      # 0x10261
xorl %edx, %edx
callq 0xc8a0
testq %rax, %rax
je 0x64b5
leaq 0x9dc1(%rip), %rsi      # 0x10261
movq %r14, %rdi
xorl %edx, %edx
callq 0xc8a0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4420
leaq 0xa04d(%rip), %rsi      # 0x10509
movq %r14, %rdi
xorl %edx, %edx
callq 0xc8a0
testq %rax, %rax
je 0x64e8
leaq 0xa037(%rip), %rsi      # 0x10509
movq %r14, %rdi
xorl %edx, %edx
callq 0xc8a0
leaq 0x20(%rbx), %rdi
movq %rax, %rsi
callq 0x4420
leaq 0xa3de(%rip), %rsi      # 0x108cd
movq %r14, %rdi
callq 0x6cb6
movss %xmm0, 0x40(%rbx)
leaq 0x9ec0(%rip), %rsi      # 0x103c3
movq %r14, %rdi
callq 0x6cb6
movss %xmm0, 0x44(%rbx)
leaq 0x9be7(%rip), %rsi      # 0x100fe
movq %r14, %rdi
callq 0x6cb6
movss %xmm0, 0x48(%rbx)
leaq 0x9bdd(%rip), %rsi      # 0x10108
movq %r14, %rdi
callq 0x6cb6
movss %xmm0, 0x4c(%rbx)
leaq 0x9fcf(%rip), %rsi      # 0x1050e
movq %r14, %rdi
callq 0x6cb6
movss %xmm0, 0x50(%rbx)
leaq 0x9e17(%rip), %rsi      # 0x1036a
movq %r14, %rdi
callq 0x6bc4
movl %eax, 0x54(%rbx)
leaq 0x9e60(%rip), %rsi      # 0x103c5
movq %r14, %rdi
callq 0x6d3c
movb %al, 0x58(%rbx)
leaq 0x9bb4(%rip), %rsi      # 0x1012b
movq %r14, %rdi
callq 0xbae8
leaq 0x60(%rbx), %rsi
movq %rax, %rdi
callq 0x5089
testl %eax, %eax
jne 0x6747
leaq 0x9f7d(%rip), %rsi      # 0x10517
movq %r14, %rdi
callq 0xbae8
testq %rax, %rax
je 0x65b6
movl $0x2, 0x98(%rbx)
jmp 0x6745
leaq 0x9f62(%rip), %rsi      # 0x1051f
movq %r14, %rdi
callq 0xbae8
testq %rax, %rax
je 0x65d6
movq %rax, %r15
andl $0x0, 0x98(%rbx)
jmp 0x65fb
leaq 0x9f4a(%rip), %rsi      # 0x10527
movq %r14, %rdi
callq 0xbae8
testq %rax, %rax
je 0x6759
movq %rax, %r15
movl $0x1, 0x98(%rbx)
leaq 0x9f2e(%rip), %rsi      # 0x10530
movq %r15, %rdi
xorl %edx, %edx
callq 0xc8a0
testq %rax, %rax
je 0x6765
leaq 0x9f14(%rip), %rsi      # 0x10530
movq %r15, %rdi
xorl %edx, %edx
callq 0xc8a0
leaq -0x90(%rbp), %r14
leaq -0x210(%rbp), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x40d0
leaq -0x210(%rbp), %rdi
pushq $0x8
popq %rdx
movq %r14, %rsi
callq 0x43b0
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
addq $0xa0, %rbx
leaq -0x70(%rbp), %r15
leaq -0x390(%rbp), %r13
leaq -0x50(%rbp), %r14
pushq $0x2c
popq %r12
leaq -0x210(%rbp), %rdi
movq %r15, %rsi
pushq $0x20
popq %rdx
callq 0x43f0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x6724
andq $0x0, -0x30(%rbp)
movq %r13, %rdi
movq %r15, %rsi
pushq $0x8
popq %rdx
callq 0x43b0
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
andq $0x0, -0x48(%rbp)
movb $0x0, -0x40(%rbp)
movq %r13, %rdi
movq %r14, %rsi
movl %r12d, %edx
callq 0x43f0
movq -0x50(%rbp), %rdi
callq 0x4260
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x30(%rbp)
movq %r13, %rdi
movq %r14, %rsi
movl %r12d, %edx
callq 0x43f0
movq -0x50(%rbp), %rdi
callq 0x4260
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x2c(%rbp)
movq %rbx, %rdi
leaq -0x30(%rbp), %rsi
callq 0x6dce
movq %r14, %rdi
callq 0x4478
movq %r13, %rdi
callq 0x4110
jmp 0x667b
leaq -0x70(%rbp), %rdi
callq 0x4478
leaq -0x210(%rbp), %rdi
callq 0x4110
leaq -0x90(%rbp), %rdi
callq 0x4478
xorl %eax, %eax
addq $0x368, %rsp            # imm = 0x368
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x3, 0x98(%rbx)
jmp 0x6745
movq 0x12864(%rip), %rbx     # 0x18fd0
movq (%rbx), %rcx
leaq 0x9dc1(%rip), %rdi      # 0x10537
pushq $0x45
popq %rsi
pushq $0x1
popq %rdx
callq 0x4430
movq (%rbx), %rsi
pushq $0xa
popq %rdi
callq 0x4270
pushq $0x1
popq %rax
jmp 0x6747
movq %rax, %rbx
jmp 0x67ca
jmp 0x6798
movq %rax, %rbx
jmp 0x67b5
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x4478
leaq -0x390(%rbp), %rdi
callq 0x4110
leaq -0x70(%rbp), %rdi
callq 0x4478
leaq -0x210(%rbp), %rdi
callq 0x4110
leaq -0x90(%rbp), %rdi
callq 0x4478
movq %rbx, %rdi
callq 0x43d0