// File: /workspace/github_cpp_makefile_star2_O1/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 $0xc8, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x9b5a
movq %rax, %r14
movq %rax, %rdi
callq 0x787e
movl %eax, %r12d
movq %r14, %rdi
callq 0x7874
movq %rax, %r15
movq %r14, %rdi
callq 0x7250
movq %rax, %r13
movq %r14, %rdi
callq 0x7648
movq %rax, -0x40(%rbp)
leaq 0x534f(%rip), %rsi      # 0xb664
leaq -0xf0(%rbp), %r14
movq %r14, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0x3080
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x9adc
movq 0x8(%r15), %rdx
subq (%r15), %rdx
sarq $0x3, %rdx
leaq 0x5339(%rip), %rsi      # 0xb680
movq %r14, %rdi
xorl %eax, %eax
callq 0x3080
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x9adc
movq 0x8(%r13), %rdx
subq (%r13), %rdx
sarq $0x3, %rdx
leaq 0x5327(%rip), %rsi      # 0xb697
movq %r14, %rdi
xorl %eax, %eax
callq 0x3080
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x9adc
movl $0x30, %edi
callq 0x3300
leaq 0x8(%rax), %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, (%rax)
movq %r14, 0x18(%rax)
movq %r14, 0x20(%rax)
movq %rax, -0x50(%rbp)
movq $0x0, 0x28(%rax)
movq (%r13), %rcx
movq %r13, -0x58(%rbp)
cmpq 0x8(%r13), %rcx
movq %rbx, %r12
movq %rbx, -0x30(%rbp)
je 0x652a
leaq -0xf0(%rbp), %r13
movq %r14, -0x48(%rbp)
movq %rcx, -0x68(%rbp)
movq (%rcx), %rdi
movq %rdi, -0x60(%rbp)
callq 0x5328
movq %rax, -0x38(%rbp)
movq %rax, %rdi
callq 0x3e34
movq %rax, %r15
movq 0x18(%rax), %r14
addq $0x8, %r15
cmpq %r15, %r14
movq -0x50(%rbp), %r12
je 0x642c
leaq 0x20(%r14), %rsi
movl 0x40(%r14), %ebx
movq %r12, %rdi
callq 0x3e6c
subl %ebx, (%rax)
movq %r14, %rdi
callq 0x31f0
movq %rax, %r14
cmpq %r15, %rax
jne 0x640a
movq -0x38(%rbp), %rdi
callq 0x3e58
movq %rax, %r15
movq 0x18(%rax), %r14
addq $0x8, %r15
cmpq %r15, %r14
je 0x6467
leaq 0x20(%r14), %rsi
movl 0x40(%r14), %ebx
movq %r12, %rdi
callq 0x3e6c
addl %ebx, (%rax)
movq %r14, %rdi
callq 0x31f0
movq %rax, %r14
cmpq %r15, %rax
jne 0x6445
movq -0x38(%rbp), %rdi
callq 0x43c6
movq %rax, %r14
movq -0x60(%rbp), %rbx
movq %rbx, %rdi
callq 0x5332
movq %rax, %rdi
callq 0x43c6
movq %rax, %r15
movq %rbx, %rdi
callq 0x533c
movq %rax, %rdi
callq 0x43c6
movq %r13, %rdi
leaq 0x5209(%rip), %rsi      # 0xb6ad
movq %r14, %rdx
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x3080
movq %r12, %rbx
movq -0x30(%rbp), %r12
movq 0x8(%r12), %rdi
movq %r13, %rsi
callq 0x9adc
movq 0x18(%rbx), %r15
movq -0x48(%rbp), %r14
cmpq %r14, %r15
movq %r13, %rbx
leaq 0x51e5(%rip), %r13      # 0xb6c2
je 0x6511
movq 0x20(%r15), %rdx
movl 0x40(%r15), %ecx
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x3080
movq 0x8(%r12), %rdi
movq %rbx, %rsi
callq 0x9adc
movq %r15, %rdi
callq 0x31f0
movq %rax, %r15
cmpq %r14, %rax
jne 0x64df
movq -0x68(%rbp), %rcx
addq $0x8, %rcx
movq -0x58(%rbp), %rax
cmpq 0x8(%rax), %rcx
movq %rbx, %r13
jne 0x63da
movq 0x8(%r12), %rdi
leaq 0x5195(%rip), %rsi      # 0xb6cb
callq 0x9adc
movq -0x40(%rbp), %rax
movq 0x18(%rax), %r14
addq $0x8, %rax
cmpq %rax, %r14
je 0x65c4
movq %rax, %rbx
leaq -0x88(%rbp), %r15
leaq 0x5197(%rip), %r12      # 0xb6f4
leaq -0xf0(%rbp), %r13
movq 0x20(%r14), %rsi
movq %r15, %rdi
callq 0xab34
movq -0x88(%rbp), %rdx
movl 0x28(%r14), %ecx
movq %r13, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x3080
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x65a4
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3320
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq %r13, %rsi
callq 0x9adc
movq %r14, %rdi
callq 0x31f0
movq %rax, %r14
cmpq %rbx, %rax
jne 0x6564
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq