// File: /workspace/github_cpp_makefile_star2_O1/halsafar[P]libtmx-parser/./src/tmxparser.cpp
// Function: tmxparser::_parseMapNode(tinyxml2::XMLElement*, tmxparser::TmxMap*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
TmxReturn _parseMapNode(tinyxml2::XMLElement* element, TmxMap* outMap, std::string tilesetPath)
{
	if (element == NULL)
	{
		return TmxReturn::kMissingMapNode;
	}

	outMap->version = element->Attribute("version");
	const char* orientation = element->Attribute("orientation");
	if (orientation != NULL)
	{
		if (strcmp(orientation, "orthogonal") == 0)
		{
			outMap->orientation = TmxOrientation::kOrthogonal;
		}
		else if (strcmp(orientation, "isometric") == 0)
		{
			outMap->orientation = TmxOrientation::kIsometric;
		}
		else if (strcmp(orientation, "staggered") == 0)
		{
			outMap->orientation = TmxOrientation::kStaggered;
		}
	}
	else
	{
		LOGW("Missing orientation attribute");
	}

	CHECK_AND_RETRIEVE_REQ_ATTRIBUTE(element->QueryUnsignedAttribute, "width", &outMap->width);
	CHECK_AND_RETRIEVE_REQ_ATTRIBUTE(element->QueryUnsignedAttribute, "height", &outMap->height);
	CHECK_AND_RETRIEVE_REQ_ATTRIBUTE(element->QueryUnsignedAttribute, "tilewidth", &outMap->tileWidth);
	CHECK_AND_RETRIEVE_REQ_ATTRIBUTE(element->QueryUnsignedAttribute, "tileheight", &outMap->tileHeight);

	CHECK_AND_RETRIEVE_OPT_ATTRIBUTE_STRING(element, "backgroundcolor", outMap->backgroundColor);
	CHECK_AND_RETRIEVE_OPT_ATTRIBUTE_STRING(element, "renderorder", outMap->renderOrder);


	TmxReturn error = _parsePropertyNode(element->FirstChildElement("properties"), &outMap->propertyMap);
	if (error)
	{
		LOGE("Error processing map properties...");
		return error;
	}

	for (tinyxml2::XMLElement* child = element->FirstChildElement("tileset"); child != NULL; child = child->NextSiblingElement("tileset"))
	{
		TmxTileset set;
		error = _parseTilesetNode(child, &set, tilesetPath);
		if (error)
		{
			LOGE("Error processing tileset node...");
			return error;
		}

		outMap->tilesetCollection.push_back(set);
	}

	for (tinyxml2::XMLElement* child = element->FirstChildElement("layer"); child != NULL; child = child->NextSiblingElement("layer"))
	{
		TmxLayer layer;
		error = _parseLayerNode(child, outMap->tilesetCollection, &layer);
		if (error)
		{
			LOGE("Error processing layer node...");
			return error;
		}

		outMap->layerCollection.push_back(layer);
	}

	for (tinyxml2::XMLElement* child = element->FirstChildElement("objectgroup"); child != NULL; child = child->NextSiblingElement("objectgroup"))
	{
		TmxObjectGroup group;
		error = _parseObjectGroupNode(child, &group);
		if (error)
		{
			LOGE("Error processing objectgroup node...");
			return error;
		}

		outMap->objectGroupCollection.push_back(group);
	}

	for (tinyxml2::XMLElement* child = element->FirstChildElement("imagelayer"); child != NULL; child = child->NextSiblingElement("imagelayer"))
	{
		TmxImageLayer imageLayer;
		error = _parseImageLayerNode(child, &imageLayer);
		if (error)
		{
			LOGE("Error parsing imagelayer node...");
			return error;
		}

		outMap->imageLayerCollection.push_back(imageLayer);
	}

	return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rdx, -0x40(%rbp)
testq %rdi, %rdi
je 0x4f76
movq %rsi, %r13
movq %rdi, %r12
leaq 0xd174(%rip), %rsi      # 0x12065
xorl %edx, %edx
callq 0xe9e8
movq %rax, %rbx
movq 0x8(%r13), %r14
movq %rax, %rdi
callq 0x4100
movq %r13, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x4330
leaq 0xd14c(%rip), %rsi      # 0x1206d
movq %r12, %rdi
xorl %edx, %edx
callq 0xe9e8
testq %rax, %rax
je 0x4f95
movq %rax, %rbx
leaq 0xd13f(%rip), %rsi      # 0x12079
movq %rax, %rdi
callq 0x42c0
testl %eax, %eax
je 0x4f81
leaq 0xd137(%rip), %rsi      # 0x12084
movq %rbx, %rdi
callq 0x42c0
testl %eax, %eax
je 0x4f8b
leaq 0xd12e(%rip), %rsi      # 0x1208e
movq %rbx, %rdi
callq 0x42c0
testl %eax, %eax
jne 0x4f9a
movl $0x2, 0x20(%r13)
jmp 0x4f9a
movl $0x3, %r12d
jmp 0x577c
movl $0x0, 0x20(%r13)
jmp 0x4f9a
movl $0x1, 0x20(%r13)
jmp 0x4f9a
callq 0x44e8
leaq 0xd15d(%rip), %rsi      # 0x120fe
movq %r12, %rdi
callq 0xe962
testq %rax, %rax
je 0x5748
leaq 0x24(%r13), %rsi
movq %rax, %rdi
callq 0xe58c
cmpl $0x1, %eax
je 0x5748
leaq 0xd13a(%rip), %rsi      # 0x12108
movq %r12, %rdi
callq 0xe962
testq %rax, %rax
je 0x574f
leaq 0x28(%r13), %rsi
movq %rax, %rdi
callq 0xe58c
cmpl $0x1, %eax
je 0x574f
leaq 0xd0ff(%rip), %rsi      # 0x120fa
movq %r12, %rdi
callq 0xe962
testq %rax, %rax
je 0x5756
leaq 0x2c(%r13), %rsi
movq %rax, %rdi
callq 0xe58c
cmpl $0x1, %eax
je 0x5756
leaq 0xd0dc(%rip), %rsi      # 0x12104
movq %r12, %rdi
callq 0xe962
testq %rax, %rax
je 0x575d
leaq 0x30(%r13), %rsi
movq %rax, %rdi
callq 0xe58c
cmpl $0x1, %eax
je 0x575d
leaq 0xd0ba(%rip), %rsi      # 0x1210f
movq %r12, %rdi
xorl %edx, %edx
callq 0xe9e8
testq %rax, %rax
je 0x509d
leaq 0xd0a4(%rip), %rsi      # 0x1210f
movq %r12, %rdi
xorl %edx, %edx
callq 0xe9e8
movq %rax, %rbx
leaq 0x38(%r13), %r14
movq 0x40(%r13), %r15
movq %rax, %rdi
callq 0x4100
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x4330
jmp 0x50b4
leaq 0x38(%r13), %rdi
movq 0x40(%r13), %rdx
movl $0x1, %ecx
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x4410
leaq 0xd064(%rip), %rsi      # 0x1211f
movq %r12, %rdi
xorl %edx, %edx
callq 0xe9e8
testq %rax, %rax
je 0x5103
leaq 0xd04e(%rip), %rsi      # 0x1211f
movq %r12, %rdi
xorl %edx, %edx
callq 0xe9e8
movq %rax, %rbx
leaq 0x58(%r13), %r14
movq 0x60(%r13), %r15
movq %rax, %rdi
callq 0x4100
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x4330
jmp 0x511a
leaq 0x58(%r13), %rdi
movq 0x60(%r13), %rdx
movl $0x1, %ecx
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x4410
leaq 0xd00a(%rip), %rsi      # 0x1212b
movq %r12, %rdi
callq 0xd6a6
leaq 0x78(%r13), %rsi
movq %rax, %rdi
callq 0x5adb
testl %eax, %eax
jne 0x5791
movq %r12, %rdi
movq %r13, -0x38(%rbp)
leaq 0xd020(%rip), %rsi      # 0x1216b
movq %r12, -0x48(%rbp)
callq 0xd6a6
testq %rax, %rax
sete %r14b
je 0x534b
movq %rax, %r13
leaq -0x140(%rbp), %r15
movq -0x38(%rbp), %rax
addq $0xb0, %rax
movq %rax, -0x158(%rbp)
xorl %ebx, %ebx
movq %r15, -0x150(%rbp)
movq %rbx, -0x148(%rbp)
movb %bl, -0x140(%rbp)
leaq -0x118(%rbp), %rax
movq %rax, -0x128(%rbp)
movq %rbx, -0x120(%rbp)
movb %bl, -0x118(%rbp)
leaq -0xd8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq %rbx, -0xe0(%rbp)
movb %bl, -0xd8(%rbp)
leaq -0xb8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq %rbx, -0xc0(%rbp)
movb %bl, -0xb8(%rbp)
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq %rbx, -0xa0(%rbp)
movb %bl, -0x98(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x80(%rbp)
movq $0x1, -0x78(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0xd0(%r15)
movl $0x3f800000, -0x60(%rbp) # imm = 0x3F800000
movups %xmm0, 0xe8(%r15)
leaq -0x168(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x178(%rbp), %rdi
callq 0x90b8
movq %r13, %rdi
leaq -0x150(%rbp), %rsi
leaq -0x178(%rbp), %rdx
callq 0x5c43
movl %eax, %r12d
movq -0x178(%rbp), %rdi
leaq -0x168(%rbp), %rax
cmpq %rax, %rdi
je 0x5281
callq 0x41c0
testl %r12d, %r12d
jne 0x533d
movq -0x158(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x7622
leaq -0x80(%rbp), %rdi
callq 0x7a4e
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x52be
callq 0x41c0
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x52d6
callq 0x41c0
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x52ee
callq 0x41c0
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0x5306
callq 0x41c0
movq -0x150(%rbp), %rdi
cmpq %r15, %rdi
je 0x5317
callq 0x41c0
testl %r12d, %r12d
jne 0x534e
movq %r13, %rdi
leaq 0xce45(%rip), %rsi      # 0x1216b
callq 0xd84e
movq %rax, %r13
testq %rax, %rax
sete %r14b
jne 0x517e
jmp 0x534e
callq 0x454a
movl %r12d, -0x2c(%rbp)
jmp 0x529d
xorl %r12d, %r12d
testb $0x1, %r14b
je 0x5742
leaq 0xcec0(%rip), %rsi      # 0x1221f
movq -0x48(%rbp), %rdi
callq 0xd6a6
testq %rax, %rax
sete %r13b
je 0x546c
movq %rax, %rbx
leaq -0x140(%rbp), %r14
movq -0x38(%rbp), %rax
leaq 0xb0(%rax), %r15
addq $0xc8, %rax
movq %rax, -0x40(%rbp)
movq %r14, -0x150(%rbp)
xorl %ecx, %ecx
movq %rcx, -0x148(%rbp)
movb $0x0, -0x140(%rbp)
leaq -0xf0(%rbp), %rax
movq %rax, -0x120(%rbp)
movq $0x1, -0x118(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r14)
movl $0x3f800000, -0x100(%rbp) # imm = 0x3F800000
movq %rcx, 0x68(%r14)
movups %xmm0, 0x58(%r14)
movups %xmm0, 0x48(%r14)
movq %rbx, %rdi
movq %r15, %rsi
leaq -0x150(%rbp), %rdx
callq 0x5e79
movl %eax, %r12d
testl %eax, %eax
jne 0x5461
movq -0x40(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x76e4
movq -0xe8(%rbp), %rdi
testq %rdi, %rdi
je 0x541e
callq 0x41c0
leaq -0x120(%rbp), %rdi
callq 0x7b34
movq -0x150(%rbp), %rdi
cmpq %r14, %rdi
je 0x543b
callq 0x41c0
testl %r12d, %r12d
jne 0x546c
movq %rbx, %rdi
leaq 0xcdd5(%rip), %rsi      # 0x1221f
callq 0xd84e
movq %rax, %rbx
testq %rax, %rax
sete %r13b
jne 0x5394
jmp 0x546c
callq 0x457e
movl %r12d, -0x2c(%rbp)
jmp 0x540d
testb $0x1, %r13b
je 0x5742
leaq 0xcd5a(%rip), %rsi      # 0x121d7
movq -0x48(%rbp), %rdi
callq 0xd6a6
testq %rax, %rax
sete %r13b
je 0x55b3
movq %rax, %rbx
leaq -0x140(%rbp), %r15
movq -0x38(%rbp), %rax
addq $0xe0, %rax
movq %rax, -0x40(%rbp)
xorl %r14d, %r14d
movq %r15, -0x150(%rbp)
movq %r14, -0x148(%rbp)
movb %r14b, -0x140(%rbp)
leaq -0x120(%rbp), %rax
movq %rax, -0x130(%rbp)
movq %r14, -0x128(%rbp)
movb %r14b, -0x120(%rbp)
leaq -0xd8(%rbp), %rax
movq %rax, -0x108(%rbp)
movq $0x1, -0x100(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%r15)
movl $0x3f800000, -0xe8(%rbp) # imm = 0x3F800000
movq %r14, 0x80(%r15)
movups %xmm0, 0x70(%r15)
movups %xmm0, 0x60(%r15)
movq %rbx, %rdi
leaq -0x150(%rbp), %rsi
callq 0x5fc4
movl %eax, %r12d
testl %eax, %eax
jne 0x55a8
movq -0x40(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x7756
leaq -0xd0(%rbp), %rdi
callq 0x7c10
leaq -0x108(%rbp), %rdi
callq 0x7b34
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0x5571
callq 0x41c0
movq -0x150(%rbp), %rdi
cmpq %r15, %rdi
je 0x5582
callq 0x41c0
testl %r12d, %r12d
jne 0x55b3
movq %rbx, %rdi
leaq 0xcc46(%rip), %rsi      # 0x121d7
callq 0xd84e
movq %rax, %rbx
testq %rax, %rax
sete %r13b
jne 0x54ae
jmp 0x55b3
callq 0x45b2
movl %r12d, -0x2c(%rbp)
jmp 0x5541
testb $0x1, %r13b
je 0x5742
leaq 0xcc56(%rip), %rsi      # 0x1221a
movq -0x48(%rbp), %rdi
callq 0xd6a6
testq %rax, %rax
je 0x577c
movq %rax, %rbx
leaq -0x140(%rbp), %r14
addq $0xf8, -0x38(%rbp)
xorl %r13d, %r13d
leaq -0x150(%rbp), %r15
movq %r14, -0x150(%rbp)
movq %r13, -0x148(%rbp)
movb %r13b, -0x140(%rbp)
leaq -0xe8(%rbp), %rax
movq %rax, -0x118(%rbp)
movq $0x1, -0x110(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%r14)
movl $0x3f800000, -0xf8(%rbp) # imm = 0x3F800000
movups %xmm0, 0x50(%r14)
leaq -0xd0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq %r13, -0xd8(%rbp)
movb %r13b, -0xd0(%rbp)
leaq -0xb0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq %r13, -0xb8(%rbp)
movb %r13b, -0xb0(%rbp)
leaq -0x90(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq %r13, -0x98(%rbp)
movb %r13b, -0x90(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x621d
movl %eax, %r12d
testl %eax, %eax
jne 0x5734
movq -0x38(%rbp), %rdi
movq %r15, %rsi
callq 0x77de
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x56c5
callq 0x41c0
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x56dd
callq 0x41c0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x56f5
callq 0x41c0
leaq -0x118(%rbp), %rdi
callq 0x7b34
movq -0x150(%rbp), %rdi
cmpq %r14, %rdi
je 0x5712
callq 0x41c0
testl %r12d, %r12d
jne 0x5742
movq %rbx, %rdi
leaq 0xcaf9(%rip), %rsi      # 0x1221a
callq 0xd84e
movq %rax, %rbx
testq %rax, %rax
jne 0x55f2
jmp 0x577c
callq 0x45e6
movl %r12d, -0x2c(%rbp)
jmp 0x56ad
movl -0x2c(%rbp), %r12d
jmp 0x577c
callq 0x4686
jmp 0x5762
callq 0x4662
jmp 0x5762
callq 0x463e
jmp 0x5762
callq 0x461a
movl $0x2, %r12d
movq 0x14861(%rip), %rax     # 0x19fd0
movq (%rax), %rsi
movl $0xa, %edi
callq 0x4270
movl %r12d, %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %r12d
callq 0x451b
jmp 0x5768
movq %rax, %rbx
leaq -0x150(%rbp), %rdi
callq 0x781c
jmp 0x57fa
movq %rax, %rbx
leaq -0x150(%rbp), %rdi
callq 0x7794
jmp 0x57fa
movq %rax, %rbx
leaq -0x150(%rbp), %rdi
callq 0x771c
jmp 0x57fa
movq %rax, %rbx
movq -0x178(%rbp), %rdi
leaq -0x168(%rbp), %rax
cmpq %rax, %rdi
je 0x57ee
callq 0x41c0
jmp 0x57ee
movq %rax, %rbx
leaq -0x150(%rbp), %rdi
callq 0x7660
movq %rbx, %rdi
callq 0x43d0