// File: /workspace/github_cpp_makefile_star2_O3/XxAdi101xX[P]ChamberCrawler/Cell/Cell.cc
// Function: Cell::getInfo() const
Info Cell::getInfo() const {

	Info cellInfo;

	cellInfo.coordinates = this->coordinates;
	// check if cell occupies a character
	if (getOccupant() != nullptr) {
		if (occupant->getPlayerState() == true) {
			cellInfo.displayChar = CHAR_PLAYER;
		}
		else {
			string name = occupant->getName();
			if (name == NAME_HUMAN) {
				cellInfo.displayChar = CHAR_HUMAN;
			}
			else if (name == NAME_DWARF) {
				cellInfo.displayChar = CHAR_DWARF;
			}
			else if (name ==  NAME_ELF) {
				cellInfo.displayChar = CHAR_ELF;
			}
			else if (name == NAME_ORC) {
				 cellInfo.displayChar = CHAR_ORC;
			}
			else if (name == NAME_MERCHANT) {
				 cellInfo.displayChar = CHAR_MERCHANT;
			}
			else if (name == NAME_DRAGON) {
				cellInfo.displayChar = CHAR_DRAGON;
			}
			else if (name == NAME_HALFLING) {
				cellInfo.displayChar = CHAR_HALFLING;
			}
		}
	}
	// check if cell occupies an item
	else if (item != nullptr) {
		if (item->getItemType() == ItemType::GoldPile) {
			cellInfo.displayChar = CHAR_ITEM_GOLD_PILE;
		}
		else if (item->getItemType() == ItemType::Potion) {
			cellInfo.displayChar = CHAR_ITEM_POTION;
		}
	}
	// next few statements check for the remaining types of cells
	else if (getCellType() == CellType::Passage){
		cellInfo.displayChar = CHAR_PASSAGE;
	}
	else if (getCellType() == CellType::DoorWay) {
		cellInfo.displayChar = CHAR_DOOR_WAY;
	}
	else if (getCellType() == CellType::FloorTile) {
		cellInfo.displayChar = CHAR_FLOOR_TILE;
	}
	else if (getCellType() == CellType::Stairs) {
		cellInfo.displayChar = CHAR_STAIRS;
	}
	else if (getCellType() == CellType::Wall) {
		// check what type of wall is occupied by cell
		if ((((getNeighbour(Direction::East))->getCellType() != CellType::Null) &&
				((getNeighbour(Direction::West))->getCellType() != CellType::Null) && 
				((getNeighbour(Direction::East))->getCellType() != CellType::FloorTile) &&
        ((getNeighbour(Direction::West))->getCellType() != CellType::FloorTile)) &&
				(((getNeighbour(Direction::East))->getCellType() == CellType::Wall) ||
				((getNeighbour(Direction::West))->getCellType() == CellType::Wall) ||
				((getNeighbour(Direction::West))->getCellType() == CellType::Stairs) ||
				((getNeighbour(Direction::East))->getCellType() == CellType::Stairs)))
																																						{
			cellInfo.displayChar = CHAR_HORIZONTAL_WALL;
		}
		else {
			cellInfo.displayChar = CHAR_VERTICAL_WALL;
		}
	}
	else if (getCellType() == CellType::Null) {
    cellInfo.displayChar = CHAR_NULL;
  }

	cellInfo.isCellInfo = true;

	return cellInfo;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x18, %rdi
xorl %eax, %eax
movq %rax, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
leaq 0x48(%rbx), %rcx
movq %rcx, 0x38(%rbx)
movq %rax, 0x40(%rbx)
movb %al, 0x48(%rbx)
movb %al, 0x58(%rbx)
addq $0x28, %rsi
callq 0x15694
movq 0x68(%r14), %r15
movq 0x70(%r14), %rdi
testq %rdi, %rdi
je 0x15219
movq 0x13d99(%rip), %rax     # 0x28fa8
cmpb $0x0, (%rax)
je 0x15220
incl 0x8(%rdi)
jmp 0x15224
testq %r15, %r15
jne 0x15232
jmp 0x15247
lock
incl 0x8(%rdi)
callq 0x1235a
testq %r15, %r15
je 0x15247
movq 0x68(%r14), %r15
movq %r15, %rdi
callq 0x16972
testb %al, %al
je 0x1527c
movb $0x40, 0x30(%rbx)
jmp 0x1542d
movq 0x58(%r14), %rdi
testq %rdi, %rdi
je 0x153eb
callq 0x1a33e
testl %eax, %eax
je 0x15429
movq 0x58(%r14), %rdi
callq 0x1a33e
cmpl $0x1, %eax
jne 0x1542d
movb $0x50, 0x30(%rbx)
jmp 0x1542d
movq 0x68(%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0x16976
movq 0x10(%rsp), %r14
cmpq 0x1566a(%rip), %r14     # 0x2a900
jne 0x152c0
movb $0x48, %bpl
testq %r14, %r14
je 0x153ca
movq 0x1564d(%rip), %rsi     # 0x2a8f8
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x5290
testl %eax, %eax
je 0x153ca
cmpq 0x155b9(%rip), %r14     # 0x2a880
jne 0x152f1
movb $0x57, %bpl
testq %r14, %r14
je 0x153ca
movq 0x1559c(%rip), %rsi     # 0x2a878
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x5290
testl %eax, %eax
je 0x153ca
cmpq 0x155a8(%rip), %r14     # 0x2a8a0
jne 0x15322
movb $0x45, %bpl
testq %r14, %r14
je 0x153ca
movq 0x1558b(%rip), %rsi     # 0x2a898
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x5290
testl %eax, %eax
je 0x153ca
cmpq 0x15617(%rip), %r14     # 0x2a940
jne 0x1534f
movb $0x4f, %bpl
testq %r14, %r14
je 0x153ca
movq 0x155fa(%rip), %rsi     # 0x2a938
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x5290
testl %eax, %eax
je 0x153ca
cmpq 0x155ca(%rip), %r14     # 0x2a920
jne 0x15378
movb $0x4d, %bpl
testq %r14, %r14
je 0x153ca
movq 0x155b1(%rip), %rsi     # 0x2a918
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x5290
testl %eax, %eax
je 0x153ca
cmpq 0x154c1(%rip), %r14     # 0x2a840
jne 0x153a1
movb $0x44, %bpl
testq %r14, %r14
je 0x153ca
movq 0x154a8(%rip), %rsi     # 0x2a838
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x5290
testl %eax, %eax
je 0x153ca
cmpq 0x15538(%rip), %r14     # 0x2a8e0
jne 0x153ce
movb $0x4c, %bpl
testq %r14, %r14
je 0x153ca
movq 0x1551f(%rip), %rsi     # 0x2a8d8
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x5290
testl %eax, %eax
jne 0x153ce
movb %bpl, 0x30(%rbx)
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1542d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5280
jmp 0x1542d
movl 0x20(%r14), %eax
cmpq $0x5, %rax
ja 0x1542d
leaq 0xac70(%rip), %rcx      # 0x2006c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
movl $0x3, %edx
callq 0x1504a
movq 0x8(%rsp), %rax
cmpl $0x5, 0x20(%rax)
jne 0x15460
xorl %ebp, %ebp
jmp 0x155c8
movb $0x47, 0x30(%rbx)
movb $0x1, 0x58(%rbx)
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movb $0x5c, 0x30(%rbx)
jmp 0x1542d
movb $0x2b, 0x30(%rbx)
jmp 0x1542d
movb $0x23, 0x30(%rbx)
jmp 0x1542d
movb $0x2e, 0x30(%rbx)
jmp 0x1542d
movb $0x20, 0x30(%rbx)
jmp 0x1542d
leaq 0x78(%rsp), %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x1504a
movq 0x78(%rsp), %rax
cmpl $0x5, 0x20(%rax)
jne 0x15484
xorl %ebp, %ebp
jmp 0x155b6
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
movl $0x3, %edx
callq 0x1504a
movq 0x68(%rsp), %rax
cmpl $0x1, 0x20(%rax)
jne 0x154a8
xorl %ebp, %ebp
jmp 0x155a7
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x1504a
movq 0x58(%rsp), %rax
cmpl $0x1, 0x20(%rax)
jne 0x154cc
xorl %ebp, %ebp
jmp 0x15598
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
movl $0x3, %edx
callq 0x1504a
movq 0x48(%rsp), %rax
cmpl $0x0, 0x20(%rax)
je 0x15572
leaq 0x38(%rsp), %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x1504a
movq 0x38(%rsp), %rax
cmpl $0x0, 0x20(%rax)
je 0x15577
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x1504a
movq 0x28(%rsp), %rax
movb $0x1, %bpl
cmpl $0x4, 0x20(%rax)
je 0x15561
leaq 0x88(%rsp), %rdi
movq %r14, %rsi
movl $0x3, %edx
callq 0x1504a
movq 0x88(%rsp), %rax
movq 0x90(%rsp), %rdi
cmpl $0x4, 0x20(%rax)
sete %bpl
testq %rdi, %rdi
je 0x15561
callq 0x1235a
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1557a
callq 0x1235a
jmp 0x1557a
movb $0x1, %bpl
jmp 0x15589
movb $0x1, %bpl
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x15589
callq 0x1235a
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x15598
callq 0x1235a
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x155a7
callq 0x1235a
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x155b6
callq 0x1235a
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x155c8
callq 0x1235a
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x155d7
callq 0x1235a
testb %bpl, %bpl
je 0x155e5
movb $0x2d, 0x30(%rbx)
jmp 0x1542d
movb $0x7c, 0x30(%rbx)
jmp 0x1542d
movq %rax, %r14
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x15605
callq 0x1235a
jmp 0x15605
movq %rax, %r14
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x15619
callq 0x1235a
jmp 0x15619
movq %rax, %r14
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1562d
callq 0x1235a
jmp 0x1562d
movq %rax, %r14
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x15641
callq 0x1235a
jmp 0x15641
movq %rax, %r14
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x15655
callq 0x1235a
jmp 0x15655
movq %rax, %r14
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x1566c
callq 0x1235a
jmp 0x1566c
movq %rax, %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x15684
callq 0x1235a
jmp 0x15684
jmp 0x15681
jmp 0x15681
movq %rax, %r14
movq %rbx, %rdi
callq 0x121ec
movq %r14, %rdi
callq 0x53e0