// File: /workspace/github_cpp_makefile_star2_O1/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 $0x378, %rsp            # imm = 0x378
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xb16f(%rip), %rsi      # 0x12261
xorl %edx, %edx
callq 0xe9e8
testq %rax, %rax
je 0x7131
leaq 0xb15c(%rip), %rsi      # 0x12261
movq %r14, %rdi
xorl %edx, %edx
callq 0xe9e8
movq %rax, %r15
movq 0x8(%rbx), %r12
movq %rax, %rdi
callq 0x4100
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x4330
leaq 0xb3d1(%rip), %rsi      # 0x12509
movq %r14, %rdi
xorl %edx, %edx
callq 0xe9e8
testq %rax, %rax
je 0x717e
leaq 0xb3bb(%rip), %rsi      # 0x12509
movq %r14, %rdi
xorl %edx, %edx
callq 0xe9e8
movq %rax, %r15
leaq 0x20(%rbx), %r12
movq 0x28(%rbx), %r13
movq %rax, %rdi
callq 0x4100
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x4330
leaq 0xb770(%rip), %rsi      # 0x128f5
movq %r14, %rdi
callq 0x7936
movss %xmm0, 0x40(%rbx)
leaq 0xb22a(%rip), %rsi      # 0x123c3
movq %r14, %rdi
callq 0x7936
movss %xmm0, 0x44(%rbx)
leaq 0xaf51(%rip), %rsi      # 0x120fe
movq %r14, %rdi
callq 0x7936
movss %xmm0, 0x48(%rbx)
leaq 0xaf47(%rip), %rsi      # 0x12108
movq %r14, %rdi
callq 0x7936
movss %xmm0, 0x4c(%rbx)
leaq 0xb339(%rip), %rsi      # 0x1250e
movq %r14, %rdi
callq 0x7936
movss %xmm0, 0x50(%rbx)
leaq 0xb181(%rip), %rsi      # 0x1236a
movq %r14, %rdi
callq 0x788e
movl %eax, 0x54(%rbx)
leaq 0xb1ca(%rip), %rsi      # 0x123c5
movq %r14, %rdi
callq 0x7994
movb %al, 0x58(%rbx)
leaq 0xaf1e(%rip), %rsi      # 0x1212b
movq %r14, %rdi
callq 0xd6a6
leaq 0x60(%rbx), %rsi
movq %rax, %rdi
callq 0x5adb
testl %eax, %eax
jne 0x7486
leaq 0xb2e7(%rip), %rsi      # 0x12517
movq %r14, %rdi
callq 0xd6a6
testq %rax, %rax
je 0x724c
movq %rax, %r15
movl $0x2, 0x98(%rbx)
jmp 0x729f
leaq 0xb2cc(%rip), %rsi      # 0x1251f
movq %r14, %rdi
callq 0xd6a6
testq %rax, %rax
je 0x726f
movq %rax, %r15
movl $0x0, 0x98(%rbx)
jmp 0x729f
leaq 0xb2b1(%rip), %rsi      # 0x12527
movq %r14, %rdi
callq 0xd6a6
testq %rax, %rax
je 0x7292
movq %rax, %r15
movl $0x1, 0x98(%rbx)
jmp 0x729f
movl $0x3, 0x98(%rbx)
xorl %r15d, %r15d
movl 0x98(%rbx), %eax
testl %eax, %eax
je 0x72be
cmpl $0x1, %eax
sete %al
testq %r15, %r15
setne %cl
testb %al, %cl
jne 0x72c7
jmp 0x7484
testq %r15, %r15
je 0x7484
leaq 0xb262(%rip), %rsi      # 0x12530
movq %r15, %rdi
xorl %edx, %edx
callq 0xe9e8
testq %rax, %rax
je 0x7498
leaq 0xb248(%rip), %rsi      # 0x12530
movq %r15, %rdi
xorl %edx, %edx
callq 0xe9e8
leaq -0x98(%rbp), %r14
leaq -0x218(%rbp), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x40e0
leaq -0x218(%rbp), %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x43a0
leaq -0x68(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x40(%rbp), %r12
leaq 0xa0(%rbx), %rax
movq %rax, -0x58(%rbp)
leaq -0x78(%rbp), %r13
leaq -0x398(%rbp), %r14
leaq -0x50(%rbp), %r15
leaq -0x218(%rbp), %rdi
movq %r13, %rsi
movl $0x20, %edx
callq 0x4400
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x743e
movq $0x0, -0x30(%rbp)
movq %r14, %rdi
movq %r13, %rsi
movl $0x8, %edx
callq 0x43a0
movq %r12, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movb $0x0, -0x40(%rbp)
movq %r14, %rdi
movq %r15, %rsi
movl $0x2c, %edx
callq 0x4400
movq -0x50(%rbp), %rdi
callq 0x4260
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x30(%rbp)
movq %r14, %rdi
movq %r15, %rsi
movl $0x2c, %edx
callq 0x4400
movq -0x50(%rbp), %rdi
callq 0x4260
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x2c(%rbp)
movq 0xa8(%rbx), %rsi
cmpq 0xb0(%rbx), %rsi
je 0x7403
movq -0x30(%rbp), %rax
movq %rax, (%rsi)
addq $0x8, 0xa8(%rbx)
jmp 0x7410
movq -0x58(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0xb6a2
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x741e
callq 0x41c0
movq %r14, %rdi
movq 0x12ba0(%rip), %rsi     # 0x19fc8
callq 0x42d0
leaq -0x320(%rbp), %rdi
callq 0x40a0
jmp 0x7350
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x7450
callq 0x41c0
movq 0x12b71(%rip), %rsi     # 0x19fc8
leaq -0x218(%rbp), %rdi
callq 0x42d0
leaq -0x1a0(%rbp), %rdi
callq 0x40a0
leaq -0x88(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7484
callq 0x41c0
xorl %eax, %eax
addq $0x378, %rsp            # imm = 0x378
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x49ed
movl $0x1, %eax
jmp 0x7486
movq %rax, %rbx
jmp 0x7511
jmp 0x74ab
movq %rax, %rbx
jmp 0x74e0
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x74c1
callq 0x41c0
movq 0x12b00(%rip), %rsi     # 0x19fc8
leaq -0x398(%rbp), %rdi
callq 0x42d0
leaq -0x320(%rbp), %rdi
callq 0x40a0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x74f2
callq 0x41c0
movq 0x12acf(%rip), %rsi     # 0x19fc8
leaq -0x218(%rbp), %rdi
callq 0x42d0
leaq -0x1a0(%rbp), %rdi
callq 0x40a0
leaq -0x88(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7526
callq 0x41c0
movq %rbx, %rdi
callq 0x43d0