// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
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 0x1564a
movq 0x68(%r14), %r15
movq 0x70(%r14), %rdi
testq %rdi, %rdi
je 0x15133
movq 0x13e83(%rip), %rax     # 0x28fa8
cmpb $0x0, (%rax)
je 0x1512f
incl 0x8(%rdi)
jmp 0x15133
lock
incl 0x8(%rdi)
testq %rdi, %rdi
je 0x1513d
callq 0x12250
testq %r15, %r15
je 0x15158
movq 0x68(%r14), %rdi
callq 0x16922
testb %al, %al
je 0x1518d
movb $0x40, 0x30(%rbx)
jmp 0x15432
movq 0x58(%r14), %rdi
testq %rdi, %rdi
je 0x15303
callq 0x1a366
testl %eax, %eax
je 0x1542e
movq 0x58(%r14), %rdi
callq 0x1a366
cmpl $0x1, %eax
jne 0x15432
movb $0x50, 0x30(%rbx)
jmp 0x15432
movq 0x68(%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0x16926
movq 0x10(%rsp), %r14
cmpq 0x15759(%rip), %r14     # 0x2a900
jne 0x151d1
movb $0x48, %bpl
testq %r14, %r14
je 0x152db
movq 0x1573c(%rip), %rsi     # 0x2a8f8
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x5290
testl %eax, %eax
je 0x152db
cmpq 0x156a8(%rip), %r14     # 0x2a880
jne 0x15202
movb $0x57, %bpl
testq %r14, %r14
je 0x152db
movq 0x1568b(%rip), %rsi     # 0x2a878
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x5290
testl %eax, %eax
je 0x152db
cmpq 0x15697(%rip), %r14     # 0x2a8a0
jne 0x15233
movb $0x45, %bpl
testq %r14, %r14
je 0x152db
movq 0x1567a(%rip), %rsi     # 0x2a898
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x5290
testl %eax, %eax
je 0x152db
cmpq 0x15706(%rip), %r14     # 0x2a940
jne 0x15260
movb $0x4f, %bpl
testq %r14, %r14
je 0x152db
movq 0x156e9(%rip), %rsi     # 0x2a938
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x5290
testl %eax, %eax
je 0x152db
cmpq 0x156b9(%rip), %r14     # 0x2a920
jne 0x15289
movb $0x4d, %bpl
testq %r14, %r14
je 0x152db
movq 0x156a0(%rip), %rsi     # 0x2a918
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x5290
testl %eax, %eax
je 0x152db
cmpq 0x155b0(%rip), %r14     # 0x2a840
jne 0x152b2
movb $0x44, %bpl
testq %r14, %r14
je 0x152db
movq 0x15597(%rip), %rsi     # 0x2a838
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x5290
testl %eax, %eax
je 0x152db
cmpq 0x15627(%rip), %r14     # 0x2a8e0
jne 0x152df
movb $0x4c, %bpl
testq %r14, %r14
je 0x152db
movq 0x1560e(%rip), %rsi     # 0x2a8d8
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x5290
testl %eax, %eax
jne 0x152df
movb %bpl, 0x30(%rbx)
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x15432
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5280
jmp 0x15432
movl 0x20(%r14), %eax
cmpq $0x5, %rax
ja 0x15432
leaq 0xad54(%rip), %rcx      # 0x2006c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
movl $0x3, %edx
callq 0x14f5c
movq 0x8(%rsp), %rax
movl 0x20(%rax), %r15d
cmpl $0x5, %r15d
je 0x15363
leaq 0x78(%rsp), %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x14f5c
movq 0x78(%rsp), %rax
cmpl $0x5, 0x20(%rax)
jne 0x1546f
movl $0x0, 0x4(%rsp)
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %ebp, %ebp
xorl %r14d, %r14d
xorl %eax, %eax
movl $0x0, (%rsp)
testb %al, %al
je 0x15395
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x15395
callq 0x12250
testb %r14b, %r14b
je 0x153a9
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x153a9
callq 0x12250
testb %bpl, %bpl
je 0x153bd
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x153bd
callq 0x12250
testb %r13b, %r13b
je 0x153d1
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x153d1
callq 0x12250
testb %r12b, %r12b
je 0x153e5
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x153e5
callq 0x12250
cmpb $0x0, 0x4(%rsp)
je 0x153fb
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x153fb
callq 0x12250
cmpl $0x5, %r15d
je 0x15413
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x15413
callq 0x12250
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x15422
callq 0x12250
cmpb $0x0, (%rsp)
je 0x15469
movb $0x2d, 0x30(%rbx)
jmp 0x15432
movb $0x47, 0x30(%rbx)
movb $0x1, 0x58(%rbx)
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x5c, 0x30(%rbx)
jmp 0x15432
movb $0x2b, 0x30(%rbx)
jmp 0x15432
movb $0x23, 0x30(%rbx)
jmp 0x15432
movb $0x2e, 0x30(%rbx)
jmp 0x15432
movb $0x20, 0x30(%rbx)
jmp 0x15432
movb $0x7c, 0x30(%rbx)
jmp 0x15432
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
movl $0x3, %edx
callq 0x14f5c
movq 0x68(%rsp), %rax
cmpl $0x1, 0x20(%rax)
jne 0x15497
movb $0x1, %al
movl %eax, 0x4(%rsp)
jmp 0x1536b
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x14f5c
movq 0x58(%rsp), %rax
cmpl $0x1, 0x20(%rax)
jne 0x154c5
movb $0x1, %al
movl %eax, 0x4(%rsp)
xorl %r13d, %r13d
movb $0x1, %r12b
jmp 0x15371
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
movl $0x3, %edx
callq 0x14f5c
movq 0x48(%rsp), %rax
cmpl $0x0, 0x20(%rax)
je 0x15532
leaq 0x38(%rsp), %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x14f5c
movq 0x38(%rsp), %rax
cmpl $0x0, 0x20(%rax)
je 0x15545
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x14f5c
movq 0x28(%rsp), %rax
cmpl $0x4, 0x20(%rax)
jne 0x15563
movb $0x1, %al
movl %eax, 0x4(%rsp)
xorl %eax, %eax
movb $0x1, %r12b
movb $0x1, %r13b
movb $0x1, %bpl
movb $0x1, %r14b
jmp 0x15559
movb $0x1, %al
movl %eax, 0x4(%rsp)
xorl %ebp, %ebp
movb $0x1, %r12b
movb $0x1, %r13b
xorl %r14d, %r14d
jmp 0x15557
movb $0x1, %al
movl %eax, 0x4(%rsp)
xorl %r14d, %r14d
movb $0x1, %r12b
movb $0x1, %r13b
movb $0x1, %bpl
xorl %eax, %eax
movb $0x1, %cl
movl %ecx, (%rsp)
jmp 0x1537f
leaq 0x88(%rsp), %rdi
movq %r14, %rsi
movl $0x3, %edx
callq 0x14f5c
movq 0x88(%rsp), %rax
cmpl $0x4, 0x20(%rax)
sete %al
movl %eax, (%rsp)
movb $0x1, %al
movl %eax, 0x4(%rsp)
movb $0x1, %r12b
movb $0x1, %r13b
movb $0x1, %bpl
movb $0x1, %r14b
movb $0x1, %al
jmp 0x1537f
movq %rax, %r14
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x155ba
callq 0x12250
jmp 0x155ba
movq %rax, %r14
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x155ce
callq 0x12250
jmp 0x155ce
movq %rax, %r14
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x155e2
callq 0x12250
jmp 0x155e2
movq %rax, %r14
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x155f6
callq 0x12250
jmp 0x155f6
movq %rax, %r14
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1560a
callq 0x12250
jmp 0x1560a
movq %rax, %r14
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x15621
callq 0x12250
jmp 0x15621
movq %rax, %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x15639
callq 0x12250
jmp 0x15639
jmp 0x15636
jmp 0x15636
movq %rax, %r14
movq %rbx, %rdi
callq 0x120f8
movq %r14, %rdi
callq 0x53e0
nop