// File: /workspace/github_cpp_makefile_star2_O2/negativeview[P]Software-Business-Sim/Company.cpp
// Function: Company::recomputeCompanySkills()
void Company::recomputeCompanySkills() {
	map<Platform *, int> tmpSkillListTotals;
	map<Platform *, int> highestSkill;

	for (vector<Person *>::iterator it = this->_employees->begin(); it != this->_employees->end(); ++it) {
		Person *employee = *it;
		map<Platform *, int> *employeePlatformSkills = employee->getPlatformSkills();
		for (map<Platform *, int>::iterator it2 = employeePlatformSkills->begin(); it2 != employeePlatformSkills->end(); ++it2) {
			int existingSkill = tmpSkillListTotals[it2->first];
			existingSkill += it2->second;
			tmpSkillListTotals[it2->first] = existingSkill;

			if (it2->second > highestSkill[it2->first])
				highestSkill[it2->first] = it2->second;
		}
	}

	for (map<Platform *, int>::iterator it3 = tmpSkillListTotals.begin(); it3 != tmpSkillListTotals.end(); ++it3) {
		(*this->_platformSkills)[it3->first] = ((it3->second / this->_employees->size()) + highestSkill[it3->first]) / 2;
	}

	map<Language *, int> tmpLanguageListTotals;
	map<Language *, int> highestLanguage;

	for (vector<Person *>::iterator it = this->_employees->begin(); it != this->_employees->end(); ++it) {
		Person *employee = *it;
		map<Language *, int> *employeeLanguageSkills = employee->getLanguageSkills();
		for (map<Language *, int>::iterator it2 = employeeLanguageSkills->begin(); it2 != employeeLanguageSkills->end(); ++it2) {
			int existingSkill = tmpLanguageListTotals[it2->first];
			existingSkill += it2->second;
			tmpLanguageListTotals[it2->first] = existingSkill;

			if (it2->second > highestLanguage[it2->first])
				highestLanguage[it2->first] = it2->second;
		}
	}

	for (map<Language *, int>::iterator it3 = tmpLanguageListTotals.begin(); it3 != tmpLanguageListTotals.end(); ++it3) {
		(*this->_languageSkills)[it3->first] = ((it3->second / this->_employees->size()) + highestLanguage[it3->first]) / 2;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %r15
leaq -0x90(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0xf0(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq 0x10(%rdi), %rax
movq (%rax), %rcx
movq %rdi, -0x38(%rbp)
cmpq 0x8(%rax), %rcx
je 0x6e7d
movq %rcx, -0x30(%rbp)
movq (%rcx), %rdi
callq 0x82ae
movq %rax, %r12
movq 0x18(%rax), %r13
addq $0x8, %r12
cmpq %r12, %r13
je 0x6e68
leaq 0x20(%r13), %rbx
leaq -0x98(%rbp), %rdi
movq %rbx, %rsi
callq 0x737e
movl (%rax), %r15d
movl 0x28(%r13), %r14d
leaq -0x98(%rbp), %rdi
movq %rbx, %rsi
callq 0x737e
addl %r15d, %r14d
movl %r14d, (%rax)
movl 0x28(%r13), %r14d
leaq -0xf8(%rbp), %rdi
movq %rbx, %rsi
callq 0x737e
cmpl (%rax), %r14d
jle 0x6e5b
movl 0x28(%r13), %r14d
leaq -0xf8(%rbp), %rdi
movq %rbx, %rsi
callq 0x737e
movl %r14d, (%rax)
movq %r13, %rdi
callq 0x31f0
movq %rax, %r13
jmp 0x6df9
movq -0x30(%rbp), %rcx
addq $0x8, %rcx
movq -0x38(%rbp), %r15
movq 0x10(%r15), %rax
jmp 0x6dd8
movq -0x80(%rbp), %rcx
leaq -0x90(%rbp), %rax
cmpq %rax, %rcx
je 0x6ee7
leaq 0x20(%rcx), %r12
movq %rcx, -0x30(%rbp)
movslq 0x28(%rcx), %rbx
movq 0x10(%r15), %rax
movq 0x8(%rax), %r13
subq (%rax), %r13
leaq -0xf8(%rbp), %rdi
movq %r12, %rsi
callq 0x737e
movslq (%rax), %r14
movq 0x28(%r15), %rdi
movq %r12, %rsi
callq 0x737e
movq %rax, %rcx
sarq $0x3, %r13
movq %rbx, %rax
xorl %edx, %edx
divq %r13
addq %r14, %rax
shrq %rax
movl %eax, (%rcx)
movq -0x30(%rbp), %rdi
callq 0x31f0
movq %rax, %rcx
jmp 0x6e81
leaq -0x60(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0xc0(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq 0x10(%r15), %rax
movq (%rax), %rcx
cmpq 0x8(%rax), %rcx
je 0x6fc2
movq %rcx, -0x30(%rbp)
movq (%rcx), %rdi
callq 0x82b8
movq %rax, %r12
movq 0x18(%rax), %r13
addq $0x8, %r12
cmpq %r12, %r13
je 0x6fad
leaq 0x20(%r13), %rbx
leaq -0x68(%rbp), %rdi
movq %rbx, %rsi
callq 0x73d0
movl (%rax), %r15d
movl 0x28(%r13), %r14d
leaq -0x68(%rbp), %rdi
movq %rbx, %rsi
callq 0x73d0
addl %r15d, %r14d
movl %r14d, (%rax)
movl 0x28(%r13), %r14d
leaq -0xc8(%rbp), %rdi
movq %rbx, %rsi
callq 0x73d0
cmpl (%rax), %r14d
jle 0x6fa0
movl 0x28(%r13), %r14d
leaq -0xc8(%rbp), %rdi
movq %rbx, %rsi
callq 0x73d0
movl %r14d, (%rax)
movq %r13, %rdi
callq 0x31f0
movq %rax, %r13
jmp 0x6f44
movq -0x30(%rbp), %rcx
addq $0x8, %rcx
movq -0x38(%rbp), %r15
movq 0x10(%r15), %rax
jmp 0x6f23
movq -0x50(%rbp), %rcx
leaq -0x60(%rbp), %rax
cmpq %rax, %rcx
je 0x7029
leaq 0x20(%rcx), %r12
movq %rcx, -0x38(%rbp)
movslq 0x28(%rcx), %rbx
movq 0x10(%r15), %rax
movq 0x8(%rax), %r13
subq (%rax), %r13
leaq -0xc8(%rbp), %rdi
movq %r12, %rsi
callq 0x73d0
movslq (%rax), %r14
movq 0x30(%r15), %rdi
movq %r12, %rsi
callq 0x73d0
movq %rax, %rcx
sarq $0x3, %r13
movq %rbx, %rax
xorl %edx, %edx
divq %r13
addq %r14, %rax
shrq %rax
movl %eax, (%rcx)
movq -0x38(%rbp), %rdi
callq 0x31f0
movq %rax, %rcx
jmp 0x6fc6
leaq -0xc8(%rbp), %rdi
callq 0x7422
leaq -0x68(%rbp), %rdi
callq 0x7422
leaq -0xf8(%rbp), %rdi
callq 0x747e
leaq -0x98(%rbp), %rdi
callq 0x747e
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7070
jmp 0x708a
jmp 0x7070
jmp 0x708a
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0x7422
leaq -0x68(%rbp), %rdi
callq 0x7422
jmp 0x708d
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x747e
leaq -0x98(%rbp), %rdi
callq 0x747e
movq %rbx, %rdi
callq 0x3510
nop