// File: /workspace/github_cpp_makefile_star2_O2/negativeview[P]Software-Business-Sim/StatusCommand.cpp
// Function: StatusCommand::executeCommand(char const*)
void StatusCommand::executeCommand(const char *line) {
	Company *playerCompany = this->_masterState->getPlayerCompany();
	int money = playerCompany->getMoney();
	vector<Person *> *employees = playerCompany->getEmployees();
	vector<Project *> *projects = playerCompany->getProjects();
	map<Platform *, int> *platformSkills = playerCompany->getPlatformSkills();

	char message[100];
	sprintf(message, "You currently have %d money", money);
	this->_masterState->addMessage(message);

	sprintf(message, "You have %lu employees", employees->size());
	this->_masterState->addMessage(message);

	sprintf(message, "You have %lu projects", projects->size());
	this->_masterState->addMessage(message);

	map<string, int> *score = new map<string, int>();
	for (vector<Project *>::iterator it = projects->begin(); it != projects->end(); ++it) {
		Project *p = *it;

		Platform *platform = p->getPlatform();
		map<string, int> *requirements = platform->getRequires();
		for (map<string, int>::iterator it2 = requirements->begin(); it2 != requirements->end(); ++it2) {
			(*score)[it2->first] -= it2->second;
		}
		map<string, int> *provides = platform->getProvides();
		for(map<string, int>::iterator it2 = provides->begin(); it2 != provides->end(); ++it2) {
			(*score)[it2->first] += it2->second;
		}

		sprintf(message, "\t%s-based %s for %s\n", platform->getFullName(), p->getLanguage()->getFullName(), p->getMarket()->getFullName());
		this->_masterState->addMessage(message);

		for(map<string, int>::iterator it2 = score->begin(); it2 != score->end(); ++it2) {
			sprintf(message, "\t%s: %d\n", it2->first.c_str(), it2->second);
			this->_masterState->addMessage(message);
		}

	}

	this->_masterState->addMessage("Your skills in platforms are as follows:");
	for (map<Platform *, int>::iterator it = platformSkills->begin(); it != platformSkills->end(); ++it) {
		sprintf(message, "\t%s: %d", it->first->getName().c_str(), it->second);
		this->_masterState->addMessage(message);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x902e
movq %rax, %r15
movq %rax, %rdi
callq 0x7274
movl %eax, %r13d
movq %r15, %rdi
callq 0x726a
movq %rax, %r14
movq %r15, %rdi
callq 0x6cfc
movq %rax, %r12
movq %r15, %rdi
callq 0x70ae
movq %rax, -0x40(%rbp)
leaq 0x56db(%rip), %rsi      # 0xb65e
leaq -0xe0(%rbp), %r15
movq %r15, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0x3080
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x8fc6
movq 0x8(%r14), %rdx
subq (%r14), %rdx
movq %rbx, %r14
sarq $0x3, %rdx
leaq 0x56c2(%rip), %rsi      # 0xb67a
movq %r15, %rdi
xorl %eax, %eax
callq 0x3080
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x8fc6
movq 0x8(%r12), %rdx
subq (%r12), %rdx
sarq $0x3, %rdx
leaq 0x56af(%rip), %rsi      # 0xb691
movq %r15, %rdi
xorl %eax, %eax
callq 0x3080
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x8fc6
pushq $0x30
popq %rdi
callq 0x3300
movq %rax, %r13
leaq 0x8(%rax), %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movq %rbx, 0x18(%rax)
movq %rbx, 0x20(%rax)
andq $0x0, 0x28(%rax)
movq %r12, -0x48(%rbp)
movq (%r12), %rcx
movq %r14, -0x30(%rbp)
movq -0x48(%rbp), %rax
cmpq 0x8(%rax), %rcx
je 0x6170
movq %rcx, -0x58(%rbp)
movq (%rcx), %rdi
movq %rdi, -0x50(%rbp)
callq 0x5212
movq %rax, -0x38(%rbp)
movq %rax, %rdi
callq 0x3d56
movq %rax, %r15
movq 0x18(%rax), %r14
addq $0x8, %r15
cmpq %r15, %r14
je 0x6084
leaq 0x20(%r14), %rsi
movl 0x40(%r14), %r12d
movq %r13, %rdi
callq 0x3d8e
subl %r12d, (%rax)
movq %r14, %rdi
callq 0x31f0
movq %rax, %r14
jmp 0x605f
movq -0x38(%rbp), %rdi
callq 0x3d7a
movq %rax, %r15
movq 0x18(%rax), %r14
addq $0x8, %r15
cmpq %r15, %r14
je 0x60bd
leaq 0x20(%r14), %rsi
movl 0x40(%r14), %r12d
movq %r13, %rdi
callq 0x3d8e
addl %r12d, (%rax)
movq %r14, %rdi
callq 0x31f0
movq %rax, %r14
jmp 0x6098
movq -0x38(%rbp), %rdi
callq 0x42b6
movq %rax, %r14
movq -0x50(%rbp), %r12
movq %r12, %rdi
callq 0x521c
movq %rax, %rdi
callq 0x42b6
movq %rax, %r15
movq %r12, %rdi
callq 0x5226
movq %rax, %rdi
callq 0x42b6
leaq -0xe0(%rbp), %r12
movq %r12, %rdi
leaq 0x55a6(%rip), %rsi      # 0xb6a7
movq %r14, %rdx
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x3080
movq -0x30(%rbp), %r14
movq 0x8(%r14), %rdi
movq %r12, %rsi
callq 0x8fc6
movq 0x18(%r13), %r15
cmpq %rbx, %r15
je 0x6163
movq 0x20(%r15), %rdx
movl 0x40(%r15), %ecx
leaq -0xe0(%rbp), %r12
movq %r12, %rdi
leaq 0x5579(%rip), %rsi      # 0xb6bc
xorl %eax, %eax
callq 0x3080
movq 0x8(%r14), %rdi
movq %r12, %rsi
callq 0x8fc6
movq %r15, %rdi
callq 0x31f0
movq %rax, %r15
jmp 0x6125
movq -0x58(%rbp), %rcx
addq $0x8, %rcx
jmp 0x602a
movq 0x8(%r14), %rdi
leaq 0x554a(%rip), %rsi      # 0xb6c5
callq 0x8fc6
movq -0x40(%rbp), %rbx
movq 0x18(%rbx), %r15
addq $0x8, %rbx
leaq -0x78(%rbp), %r14
leaq 0x5557(%rip), %r12      # 0xb6ee
leaq -0xe0(%rbp), %r13
cmpq %rbx, %r15
je 0x61e9
movq 0x20(%r15), %rsi
movq %r14, %rdi
callq 0xa15a
movq -0x78(%rbp), %rdx
movl 0x28(%r15), %ecx
movq %r13, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x3080
movq %r14, %rdi
callq 0x3170
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq %r13, %rsi
callq 0x8fc6
movq %r15, %rdi
callq 0x31f0
movq %rax, %r15
jmp 0x619e
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop