// File: halsafar[P]libtmx-parser/main.cpp
// Function: printTileDefinition(int, std::unordered_map<unsigned int, tmxparser::TmxTileDefinition, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, tmxparser::TmxTileDefinition>>> const&)
void printTileDefinition(int depth, const tmxparser::TmxTileDefinitionMap_t& map)
{
	for (auto it = map.begin(); it != map.end(); ++it)
	{
		printf_depth(depth, "%s", "<tile>");
		printf_depth(depth+1, "Id: %u", it->second.id);

		printProperties(depth+1, it->second.propertyMap);

		// animations
		printf_depth(depth+1, "%s", "<animation>");
		depth+=2;
		for (auto animIt = it->second.animations.begin(); animIt != it->second.animations.end(); ++animIt)
		{
			printf_depth(depth, "<frame tileId=%u duration=%f>", animIt->tileId, animIt->duration);
		}
		depth-=2;

		printObjectGroups(depth+1, it->second.objectgroups);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x18b80
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x18be0
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x18bb0
testb $0x1, %al
jne 0x17f1f
jmp 0x18098
imull $0x5, -0x4(%rbp), %esi
leaq 0xa6c2(%rip), %rdi      # 0x225ec
leaq 0xaa00(%rip), %rdx      # 0x22931
leaq 0xa82e(%rip), %rcx      # 0x22766
movb $0x0, %al
callq 0x4060
movl -0x4(%rbp), %eax
addl $0x1, %eax
imull $0x5, %eax, %eax
movl %eax, -0x38(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x18c10
movl -0x38(%rbp), %esi
movl 0x8(%rax), %ecx
leaq 0xa80c(%rip), %rdi      # 0x2276d
leaq 0xa9c9(%rip), %rdx      # 0x22931
movb $0x0, %al
callq 0x4060
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x18c10
movl -0x34(%rbp), %edi
movq %rax, %rsi
addq $0x8, %rsi
addq $0x8, %rsi
callq 0x17800
movl -0x4(%rbp), %eax
addl $0x1, %eax
imull $0x5, %eax, %esi
leaq 0xa648(%rip), %rdi      # 0x225ec
leaq 0xa986(%rip), %rdx      # 0x22931
leaq 0xa7c7(%rip), %rcx      # 0x22779
movb $0x0, %al
callq 0x4060
movl -0x4(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x4(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x18c10
movq %rax, %rdi
addq $0x8, %rdi
addq $0x40, %rdi
callq 0xb170
movq %rax, -0x28(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x18c10
movq %rax, %rdi
addq $0x8, %rdi
addq $0x40, %rdi
callq 0xb1a0
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x18c40
testb $0x1, %al
jne 0x1800f
jmp 0x1805c
imull $0x5, -0x4(%rbp), %eax
movl %eax, -0x40(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x18c80
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x18c80
movl -0x40(%rbp), %esi
movl -0x3c(%rbp), %ecx
movss 0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0xa742(%rip), %rdi      # 0x22785
leaq 0xa8e7(%rip), %rdx      # 0x22931
movb $0x1, %al
callq 0x4060
leaq -0x28(%rbp), %rdi
callq 0x18ca0
jmp 0x17fdf
movl -0x4(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x18c10
movl -0x44(%rbp), %edi
movq %rax, %rsi
addq $0x8, %rsi
addq $0x58, %rsi
callq 0x17c40
leaq -0x18(%rbp), %rdi
callq 0x18cc0
jmp 0x17efc
addq $0x50, %rsp
popq %rbp
retq
nop