// File: /workspace/github_cpp_makefile_star2_O3/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 0xc040(%rip), %rsi      # 0x12261
xorl %edx, %edx
callq 0xe806
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 0x63e7
leaq 0x20(%rbx), %r15
leaq 0xc695(%rip), %rsi      # 0x128f5
movq %r14, %rdi
callq 0xe794
testq %rax, %rax
je 0x627d
movq %rax, %rdi
movq %r15, %rsi
callq 0xe3d2
cmpl $0x1, %eax
jne 0x6284
movl $0x0, (%r15)
leaq 0x24(%rbx), %r15
leaq 0xc134(%rip), %rsi      # 0x123c3
movq %r14, %rdi
callq 0xe794
testq %rax, %rax
je 0x62ac
movq %rax, %rdi
movq %r15, %rsi
callq 0xe3d2
cmpl $0x1, %eax
jne 0x62b3
movl $0x0, (%r15)
leaq 0x28(%rbx), %r15
leaq 0xbe40(%rip), %rsi      # 0x120fe
movq %r14, %rdi
callq 0xe794
testq %rax, %rax
je 0x62db
movq %rax, %rdi
movq %r15, %rsi
callq 0xe3d2
cmpl $0x1, %eax
jne 0x62e2
movl $0x0, (%r15)
leaq 0x2c(%rbx), %r15
leaq 0xbe1b(%rip), %rsi      # 0x12108
movq %r14, %rdi
callq 0xe794
testq %rax, %rax
je 0x630a
movq %rax, %rdi
movq %r15, %rsi
callq 0xe3d2
cmpl $0x1, %eax
jne 0x6311
movl $0x0, (%r15)
leaq 0x30(%rbx), %r15
leaq 0xc0a1(%rip), %rsi      # 0x123bd
movq %r14, %rdi
callq 0xe794
testq %rax, %rax
je 0x6339
movq %rax, %rdi
movq %r15, %rsi
callq 0xe438
cmpl $0x1, %eax
jne 0x6340
movl $0x3f800000, (%r15)     # imm = 0x3F800000
leaq 0x34(%rbx), %r15
leaq 0xc07a(%rip), %rsi      # 0x123c5
movq %r14, %rdi
callq 0xe794
testq %rax, %rax
je 0x6368
movq %rax, %rdi
movq %r15, %rsi
callq 0xe40c
cmpl $0x1, %eax
jne 0x636c
movb $0x1, (%r15)
leaq 0xbdb8(%rip), %rsi      # 0x1212b
movq %r14, %rdi
callq 0xd5f8
testq %rax, %rax
je 0x639f
leaq 0xbda4(%rip), %rsi      # 0x1212b
movq %r14, %rdi
callq 0xd5f8
leaq 0x38(%rbx), %rsi
movq %rax, %rdi
callq 0x5ac0
testl %eax, %eax
jne 0x63f4
leaq 0xbee9(%rip), %rsi      # 0x1228f
movq %r14, %rdi
callq 0xd5f8
testq %rax, %rax
je 0x63d8
leaq 0xbed5(%rip), %rsi      # 0x1228f
movq %r14, %rdi
callq 0xd5f8
addq $0x70, %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x63fe
movl %eax, %r15d
testl %eax, %eax
jne 0x63db
xorl %r15d, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x47e1
movl $0x2, %r15d
jmp 0x63db
movl %eax, %r15d
callq 0x47ae
jmp 0x63db