// File: /workspace/github_cpp_makefile_star2_O3/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 0x9abc
movq %rax, %r14
movq %rax, %rdi
callq 0x7824
movl %eax, %r12d
movq %r14, %rdi
callq 0x781a
movq %rax, %r15
movq %r14, %rdi
callq 0x71fc
movq %rax, %r13
movq %r14, %rdi
callq 0x7606
movq %rax, -0x40(%rbp)
leaq 0x5363(%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 0x9a3e
movq 0x8(%r15), %rdx
subq (%r15), %rdx
sarq $0x3, %rdx
leaq 0x534d(%rip), %rsi      # 0xb680
movq %r14, %rdi
xorl %eax, %eax
callq 0x3080
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x9a3e
movq 0x8(%r13), %rdx
subq (%r13), %rdx
sarq $0x3, %rdx
leaq 0x533b(%rip), %rsi      # 0xb697
movq %r14, %rdi
xorl %eax, %eax
callq 0x3080
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x9a3e
movl $0x30, %edi
callq 0x3300
leaq 0x8(%rax), %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%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 0x6512
leaq -0xf0(%rbp), %r13
movq %r14, -0x48(%rbp)
movq %rcx, -0x68(%rbp)
movq (%rcx), %rdi
movq %rdi, -0x60(%rbp)
callq 0x5324
movq %rax, -0x38(%rbp)
movq %rax, %rdi
callq 0x3e24
movq %rax, %r15
movq 0x18(%rax), %r14
addq $0x8, %r15
cmpq %r15, %r14
movq -0x50(%rbp), %r12
je 0x6414
leaq 0x20(%r14), %rsi
movl 0x40(%r14), %ebx
movq %r12, %rdi
callq 0x3e5c
subl %ebx, (%rax)
movq %r14, %rdi
callq 0x31f0
movq %rax, %r14
cmpq %r15, %rax
jne 0x63f2
movq -0x38(%rbp), %rdi
callq 0x3e48
movq %rax, %r15
movq 0x18(%rax), %r14
addq $0x8, %r15
cmpq %r15, %r14
je 0x644f
leaq 0x20(%r14), %rsi
movl 0x40(%r14), %ebx
movq %r12, %rdi
callq 0x3e5c
addl %ebx, (%rax)
movq %r14, %rdi
callq 0x31f0
movq %rax, %r14
cmpq %r15, %rax
jne 0x642d
movq -0x38(%rbp), %rdi
callq 0x43b2
movq %rax, %r14
movq -0x60(%rbp), %rbx
movq %rbx, %rdi
callq 0x532e
movq %rax, %rdi
callq 0x43b2
movq %rax, %r15
movq %rbx, %rdi
callq 0x5338
movq %rax, %rdi
callq 0x43b2
movq %r13, %rdi
leaq 0x5221(%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 0x9a3e
movq 0x18(%rbx), %r15
movq -0x48(%rbp), %r14
cmpq %r14, %r15
movq %r13, %rbx
leaq 0x51fd(%rip), %r13      # 0xb6c2
je 0x64f9
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 0x9a3e
movq %r15, %rdi
callq 0x31f0
movq %rax, %r15
cmpq %r14, %rax
jne 0x64c7
movq -0x68(%rbp), %rcx
addq $0x8, %rcx
movq -0x58(%rbp), %rax
cmpq 0x8(%rax), %rcx
movq %rbx, %r13
jne 0x63c2
movq 0x8(%r12), %rdi
leaq 0x51ad(%rip), %rsi      # 0xb6cb
callq 0x9a3e
movq -0x40(%rbp), %rax
movq 0x18(%rax), %r14
addq $0x8, %rax
cmpq %rax, %r14
je 0x65ac
movq %rax, %rbx
leaq -0x88(%rbp), %r15
leaq 0x51af(%rip), %r12      # 0xb6f4
leaq -0xf0(%rbp), %r13
movq 0x20(%r14), %rsi
movq %r15, %rdi
callq 0xaab8
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 0x658c
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3320
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq %r13, %rsi
callq 0x9a3e
movq %r14, %rdi
callq 0x31f0
movq %rax, %r14
cmpq %rbx, %rax
jne 0x654c
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq