// File: /workspace/github_cpp_makefile_star2_O1/halsafar[P]libtmx-parser/./src/tmxparser.cpp
// Function: tmxparser::_parseImageLayerNode(tinyxml2::XMLElement*, tmxparser::TmxImageLayer*)
tmxparser::TmxReturn _parseImageLayerNode(tinyxml2::XMLElement* element, TmxImageLayer* outImageLayer)
{
	TmxReturn error = TmxReturn::kSuccess;

	CHECK_AND_RETRIEVE_REQ_ATTRIBUTE_STRING(element, "name", outImageLayer->name);
	
	// x : optional , default 0
	if (element->QueryUnsignedAttribute("x", &outImageLayer->x) == tinyxml2::XML_NO_ATTRIBUTE)
		outImageLayer->x = 0U;

	// y : optional , default 0
	if (element->QueryUnsignedAttribute("y", &outImageLayer->y) == tinyxml2::XML_NO_ATTRIBUTE)
		outImageLayer->y = 0U;

	// width: optional, default: 0
	if (element->QueryUnsignedAttribute("width", &outImageLayer->widthInTiles) == tinyxml2::XML_NO_ATTRIBUTE)
		outImageLayer->widthInTiles = 0U;
	
	// height: optional, default: 0
	if (element->QueryUnsignedAttribute("height", &outImageLayer->heightInTiles) == tinyxml2::XML_NO_ATTRIBUTE)
		outImageLayer->heightInTiles = 0U;

	// opacity: optional, default: 1.0
	if (element->QueryFloatAttribute("opacity", &outImageLayer->opacity) == tinyxml2::XML_NO_ATTRIBUTE)
		outImageLayer->opacity = 1.f;

	// visible: optional, default: true
	if (element->QueryBoolAttribute("visible", &outImageLayer->visible) == tinyxml2::XML_NO_ATTRIBUTE)
		outImageLayer->visible = true;

	// properties: optional
	if (element->FirstChildElement("properties") != NULL)
	{
		error = _parsePropertyNode(element->FirstChildElement("properties"), &outImageLayer->propertyMap);
		if (error != kSuccess)
		{
			LOGE("Error parsing image layer property node...");
			return error;
		}
	}

	// image: optional
	if (element->FirstChildElement("image") != NULL)
	{
		error = _parseImageNode(element->FirstChildElement("image"), &outImageLayer->image);
		if (error != kSuccess)
			return error;
	}

	return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xc02c(%rip), %rsi      # 0x12261
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
cmpq $0x0, 0x8(%rbx)
je 0x63fb
leaq 0x20(%rbx), %r15
leaq 0xc681(%rip), %rsi      # 0x128f5
movq %r14, %rdi
callq 0xe962
testq %rax, %rax
je 0x6291
movq %rax, %rdi
movq %r15, %rsi
callq 0xe58c
cmpl $0x1, %eax
jne 0x6298
movl $0x0, (%r15)
leaq 0x24(%rbx), %r15
leaq 0xc120(%rip), %rsi      # 0x123c3
movq %r14, %rdi
callq 0xe962
testq %rax, %rax
je 0x62c0
movq %rax, %rdi
movq %r15, %rsi
callq 0xe58c
cmpl $0x1, %eax
jne 0x62c7
movl $0x0, (%r15)
leaq 0x28(%rbx), %r15
leaq 0xbe2c(%rip), %rsi      # 0x120fe
movq %r14, %rdi
callq 0xe962
testq %rax, %rax
je 0x62ef
movq %rax, %rdi
movq %r15, %rsi
callq 0xe58c
cmpl $0x1, %eax
jne 0x62f6
movl $0x0, (%r15)
leaq 0x2c(%rbx), %r15
leaq 0xbe07(%rip), %rsi      # 0x12108
movq %r14, %rdi
callq 0xe962
testq %rax, %rax
je 0x631e
movq %rax, %rdi
movq %r15, %rsi
callq 0xe58c
cmpl $0x1, %eax
jne 0x6325
movl $0x0, (%r15)
leaq 0x30(%rbx), %r15
leaq 0xc08d(%rip), %rsi      # 0x123bd
movq %r14, %rdi
callq 0xe962
testq %rax, %rax
je 0x634d
movq %rax, %rdi
movq %r15, %rsi
callq 0xe5f2
cmpl $0x1, %eax
jne 0x6354
movl $0x3f800000, (%r15)     # imm = 0x3F800000
leaq 0x34(%rbx), %r15
leaq 0xc066(%rip), %rsi      # 0x123c5
movq %r14, %rdi
callq 0xe962
testq %rax, %rax
je 0x637c
movq %rax, %rdi
movq %r15, %rsi
callq 0xe5c6
cmpl $0x1, %eax
jne 0x6380
movb $0x1, (%r15)
leaq 0xbda4(%rip), %rsi      # 0x1212b
movq %r14, %rdi
callq 0xd6a6
testq %rax, %rax
je 0x63b3
leaq 0xbd90(%rip), %rsi      # 0x1212b
movq %r14, %rdi
callq 0xd6a6
leaq 0x38(%rbx), %rsi
movq %rax, %rdi
callq 0x5adb
testl %eax, %eax
jne 0x6408
leaq 0xbed5(%rip), %rsi      # 0x1228f
movq %r14, %rdi
callq 0xd6a6
testq %rax, %rax
je 0x63ec
leaq 0xbec1(%rip), %rsi      # 0x1228f
movq %r14, %rdi
callq 0xd6a6
addq $0x70, %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x6412
movl %eax, %r15d
testl %eax, %eax
jne 0x63ef
xorl %r15d, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x47e1
movl $0x2, %r15d
jmp 0x63ef
movl %eax, %r15d
callq 0x47ae
jmp 0x63ef