// File: 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
subq $0x290, %rsp            # imm = 0x290
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x170(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xc370
leaq -0x68(%rbp), %rdi
callq 0xc370
movq -0x170(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xa6b0
movq %rax, -0x70(%rbp)
movq -0x170(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xa720
movq %rax, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0xa6e0
testb $0x1, %al
jne 0xb79a
jmp 0xb972
leaq -0x70(%rbp), %rdi
callq 0xa750
movq (%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rdi
callq 0x10cd0
movq %rax, -0x178(%rbp)
jmp 0xb7bc
movq -0x178(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rdi
callq 0xa070
movq %rax, -0xa0(%rbp)
movq -0x88(%rbp), %rdi
callq 0xa0d0
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0xa0a0
testb $0x1, %al
jne 0xb80c
jmp 0xb962
leaq -0xa0(%rbp), %rdi
callq 0xa100
movq %rax, %rsi
leaq -0x38(%rbp), %rdi
callq 0xc560
movq %rax, -0x180(%rbp)
jmp 0xb82d
movq -0x180(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xac(%rbp)
leaq -0xa0(%rbp), %rdi
movq %rdi, -0x198(%rbp)
callq 0xa100
movq -0x198(%rbp), %rdi
movl 0x8(%rax), %ecx
movl -0xac(%rbp), %eax
addl %ecx, %eax
movl %eax, -0xac(%rbp)
movl -0xac(%rbp), %eax
movl %eax, -0x18c(%rbp)
callq 0xa100
movq %rax, %rsi
leaq -0x38(%rbp), %rdi
callq 0xc560
movq %rax, -0x188(%rbp)
jmp 0xb88d
movq -0x188(%rbp), %rax
movl -0x18c(%rbp), %ecx
movl %ecx, (%rax)
leaq -0xa0(%rbp), %rdi
movq %rdi, -0x1b0(%rbp)
callq 0xa100
movq -0x1b0(%rbp), %rdi
movl 0x8(%rax), %eax
movl %eax, -0x1a4(%rbp)
callq 0xa100
movq %rax, %rsi
leaq -0x68(%rbp), %rdi
callq 0xc560
movq %rax, -0x1a0(%rbp)
jmp 0xb8d9
movl -0x1a4(%rbp), %eax
movq -0x1a0(%rbp), %rcx
cmpl (%rcx), %eax
jle 0xb94f
leaq -0xa0(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
callq 0xa100
movq -0x1c8(%rbp), %rdi
movl 0x8(%rax), %eax
movl %eax, -0x1bc(%rbp)
callq 0xa100
movq %rax, %rsi
leaq -0x68(%rbp), %rdi
callq 0xc560
movq %rax, -0x1b8(%rbp)
jmp 0xb927
movq -0x1b8(%rbp), %rax
movl -0x1bc(%rbp), %ecx
movl %ecx, (%rax)
jmp 0xb94f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0xbe4a
jmp 0xb951
leaq -0xa0(%rbp), %rdi
callq 0xa130
jmp 0xb7dd
jmp 0xb964
leaq -0x70(%rbp), %rdi
callq 0xa770
jmp 0xb770
leaq -0x38(%rbp), %rdi
callq 0xa070
movq %rax, -0xb8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xa0d0
movq %rax, -0xc0(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0xa0a0
testb $0x1, %al
jne 0xb9ae
jmp 0xba89
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0xa100
movq %rax, %rcx
movq -0x170(%rbp), %rax
movslq 0x8(%rcx), %rcx
movq %rcx, -0x1e0(%rbp)
movq 0x10(%rax), %rdi
callq 0x4060
movq -0x1e8(%rbp), %rdi
movq %rax, %rcx
movq -0x1e0(%rbp), %rax
xorl %edx, %edx
divq %rcx
movq %rax, -0x1d8(%rbp)
callq 0xa100
movq %rax, %rsi
leaq -0x68(%rbp), %rdi
callq 0xc560
movq %rax, -0x1d0(%rbp)
jmp 0xba16
movq -0x170(%rbp), %rax
movq -0x1d8(%rbp), %rcx
movq -0x1d0(%rbp), %rdx
movslq (%rdx), %rdx
addq %rdx, %rcx
shrq %rcx
movl %ecx, -0x1fc(%rbp)
movq 0x28(%rax), %rax
movq %rax, -0x1f8(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0xa100
movq -0x1f8(%rbp), %rdi
movq %rax, %rsi
callq 0xc560
movq %rax, -0x1f0(%rbp)
jmp 0xba69
movq -0x1f0(%rbp), %rax
movl -0x1fc(%rbp), %ecx
movl %ecx, (%rax)
leaq -0xb8(%rbp), %rdi
callq 0xa130
jmp 0xb982
leaq -0xf0(%rbp), %rdi
callq 0xc390
leaq -0x120(%rbp), %rdi
callq 0xc390
movq -0x170(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xa6b0
movq %rax, -0x128(%rbp)
movq -0x170(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xa720
movq %rax, -0x130(%rbp)
leaq -0x128(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xa6e0
testb $0x1, %al
jne 0xbaeb
jmp 0xbcf7
leaq -0x128(%rbp), %rdi
callq 0xa750
movq (%rax), %rax
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rdi
callq 0x10cf0
movq %rax, -0x208(%rbp)
jmp 0xbb16
movq -0x208(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rdi
callq 0xc640
movq %rax, -0x148(%rbp)
movq -0x140(%rbp), %rdi
callq 0xc6a0
movq %rax, -0x150(%rbp)
leaq -0x148(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0xc670
testb $0x1, %al
jne 0xbb66
jmp 0xbce4
leaq -0x148(%rbp), %rdi
callq 0xc7b0
movq %rax, %rsi
leaq -0xf0(%rbp), %rdi
callq 0xc6d0
movq %rax, -0x210(%rbp)
jmp 0xbb8a
movq -0x210(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x154(%rbp)
leaq -0x148(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0xc7b0
movq -0x228(%rbp), %rdi
movl 0x8(%rax), %ecx
movl -0x154(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x154(%rbp)
movl -0x154(%rbp), %eax
movl %eax, -0x21c(%rbp)
callq 0xc7b0
movq %rax, %rsi
leaq -0xf0(%rbp), %rdi
callq 0xc6d0
movq %rax, -0x218(%rbp)
jmp 0xbbed
movq -0x218(%rbp), %rax
movl -0x21c(%rbp), %ecx
movl %ecx, (%rax)
leaq -0x148(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0xc7b0
movq -0x240(%rbp), %rdi
movl 0x8(%rax), %eax
movl %eax, -0x234(%rbp)
callq 0xc7b0
movq %rax, %rsi
leaq -0x120(%rbp), %rdi
callq 0xc6d0
movq %rax, -0x230(%rbp)
jmp 0xbc3c
movl -0x234(%rbp), %eax
movq -0x230(%rbp), %rcx
cmpl (%rcx), %eax
jle 0xbcd1
leaq -0x148(%rbp), %rdi
movq %rdi, -0x258(%rbp)
callq 0xc7b0
movq -0x258(%rbp), %rdi
movl 0x8(%rax), %eax
movl %eax, -0x24c(%rbp)
callq 0xc7b0
movq %rax, %rsi
leaq -0x120(%rbp), %rdi
callq 0xc6d0
movq %rax, -0x248(%rbp)
jmp 0xbc91
movq -0x248(%rbp), %rax
movl -0x24c(%rbp), %ecx
movl %ecx, (%rax)
jmp 0xbcd1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x120(%rbp), %rdi
callq 0xc800
leaq -0xf0(%rbp), %rdi
callq 0xc800
jmp 0xbe4a
jmp 0xbcd3
leaq -0x148(%rbp), %rdi
callq 0xc7d0
jmp 0xbb37
jmp 0xbce6
leaq -0x128(%rbp), %rdi
callq 0xa770
jmp 0xbab8
leaq -0xf0(%rbp), %rdi
callq 0xc640
movq %rax, -0x160(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0xc6a0
movq %rax, -0x168(%rbp)
leaq -0x160(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0xc670
testb $0x1, %al
jne 0xbd39
jmp 0xbe17
leaq -0x160(%rbp), %rdi
movq %rdi, -0x278(%rbp)
callq 0xc7b0
movq %rax, %rcx
movq -0x170(%rbp), %rax
movslq 0x8(%rcx), %rcx
movq %rcx, -0x270(%rbp)
movq 0x10(%rax), %rdi
callq 0x4060
movq -0x278(%rbp), %rdi
movq %rax, %rcx
movq -0x270(%rbp), %rax
xorl %edx, %edx
divq %rcx
movq %rax, -0x268(%rbp)
callq 0xc7b0
movq %rax, %rsi
leaq -0x120(%rbp), %rdi
callq 0xc6d0
movq %rax, -0x260(%rbp)
jmp 0xbda4
movq -0x170(%rbp), %rax
movq -0x268(%rbp), %rcx
movq -0x260(%rbp), %rdx
movslq (%rdx), %rdx
addq %rdx, %rcx
shrq %rcx
movl %ecx, -0x28c(%rbp)
movq 0x30(%rax), %rax
movq %rax, -0x288(%rbp)
leaq -0x160(%rbp), %rdi
callq 0xc7b0
movq -0x288(%rbp), %rdi
movq %rax, %rsi
callq 0xc6d0
movq %rax, -0x280(%rbp)
jmp 0xbdf7
movq -0x280(%rbp), %rax
movl -0x28c(%rbp), %ecx
movl %ecx, (%rax)
leaq -0x160(%rbp), %rdi
callq 0xc7d0
jmp 0xbd0a
leaq -0x120(%rbp), %rdi
callq 0xc800
leaq -0xf0(%rbp), %rdi
callq 0xc800
leaq -0x68(%rbp), %rdi
callq 0xc820
leaq -0x38(%rbp), %rdi
callq 0xc820
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
leaq -0x68(%rbp), %rdi
callq 0xc820
leaq -0x38(%rbp), %rdi
callq 0xc820
movq -0x90(%rbp), %rdi
callq 0x35d0
nopl (%rax,%rax)