// File: /workspace/github_cpp_makefile_star2_O3/chulchultrain[P]FactoryHead/WorkingStats/WorkingStats.cpp
// Function: CalculateEVs(std::vector<int, std::allocator<int>> const&, std::vector<int, std::allocator<int>> const&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<int> CalculateEVs(const vector<int> &ws, const vector<int> &bs, int IV,string nature) {
	vector<int> res(6,-1);
	int splitAcross = 0;
	if( CalcHP(bs[0],0,IV,100) == ws[0])
		res[0] = 0;
	for(int i = 1; i < 6; i++)
		if( CalcNonHP(i,bs[i],0,IV,100,nature) == ws[i])
			res[i] = 0;
	for(int j = 0; j < 6; j++)
		if( res[j] == -1)
			splitAcross++;
	if(splitAcross > 0 && splitAcross < 6) {
		for(int j = 0; j < 6; j++)
			if( res[j] == -1)
				res[j] = 510 / splitAcross;

		if( CalcHP(bs[0],res[0],IV,100) != ws[0]) {
				cout << "ERROR:WORKINGSTATS.CPP/CALCULATEEVS EV CANNOT MATCH STATS\n";
				cout << 0 << " " << res[0] << endl;			
		}
		for(int i = 1; i < 6; i++)
			if(CalcNonHP(i,bs[i],res[i],IV,100,nature) != ws[i]) {
				cout << "ERROR:WORKINGSTATS.CPP/CALCULATEEVS EV CANNOT MATCH STATS\n";
				cout << i << " " << res[i] << endl;
				return res;
			}			
	}
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r8, -0x50(%rbp)
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movl $0x18, %edi
callq 0x21a0
movq %rax, (%rbx)
leaq 0x18(%rax), %rcx
movq %rcx, 0x10(%rbx)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, (%rax)
movq $-0x1, 0x10(%rax)
movq %rbx, -0x60(%rbp)
movq %rcx, 0x8(%rbx)
movq %r15, -0x40(%rbp)
movq (%r15), %rcx
movl (%rcx), %ecx
movq %r14, -0x48(%rbp)
leal (%r14,%rcx,2), %edx
addl $0x6e, %edx
movq %r12, -0x38(%rbp)
movq (%r12), %rcx
cmpl (%rcx), %edx
jne 0xed64
movl $0x0, (%rax)
movq %rax, -0x30(%rbp)
movq -0x48(%rbp), %rax
addl $0x6e, %eax
movq %rax, -0x58(%rbp)
movl $0x1, %r13d
leaq -0x90(%rbp), %rbx
leaq -0xa0(%rbp), %r14
movq -0x40(%rbp), %rax
movq (%rax), %rax
movl (%rax,%r13,4), %r12d
movq %rbx, -0xa0(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x88c2
movl %r13d, %edi
movl %r12d, %esi
xorl %edx, %edx
movq -0x48(%rbp), %rcx
movl $0x64, %r8d
movq %r14, %r9
callq 0xe9ca
movl %eax, %r12d
movq -0x38(%rbp), %rax
movq (%rax), %rax
movl (%rax,%r13,4), %r15d
movq -0xa0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xedf2
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x21b0
cmpl %r15d, %r12d
jne 0xee03
movq -0x30(%rbp), %rax
movl $0x0, (%rax,%r13,4)
incq %r13
cmpq $0x6, %r13
jne 0xed87
xorl %eax, %eax
xorl %ecx, %ecx
movq -0x30(%rbp), %rsi
xorl %edx, %edx
cmpl $-0x1, (%rsi,%rax,4)
sete %dl
addl %edx, %ecx
incq %rax
cmpq $0x6, %rax
jne 0xee18
leal -0x1(%rcx), %eax
cmpl $0x4, %eax
ja 0xeffb
xorl %esi, %esi
movq -0x30(%rbp), %rbx
cmpl $-0x1, (%rbx,%rsi,4)
jne 0xee50
movl $0x1fe, %eax            # imm = 0x1FE
xorl %edx, %edx
divl %ecx
movl %eax, (%rbx,%rsi,4)
incq %rsi
cmpq $0x6, %rsi
jne 0xee3e
movq -0x40(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movl (%rbx), %ecx
leal 0x3(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
sarl $0x2, %edx
movq -0x58(%rbp), %rcx
leal (%rcx,%rax,2), %eax
addl %edx, %eax
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
cmpl (%rcx), %eax
je 0xeef4
movq 0x1014e(%rip), %rdi     # 0x1efd8
leaq 0x7397(%rip), %rsi      # 0x16228
movl $0x3a, %edx
callq 0x2200
movq 0x10136(%rip), %rdi     # 0x1efd8
xorl %esi, %esi
callq 0x22c0
movq %rax, %r14
leaq 0x7785(%rip), %rsi      # 0x16638
movl $0x1, %edx
movq %rax, %rdi
callq 0x2200
movl (%rbx), %esi
movq %r14, %rdi
callq 0x22c0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movl $0x1, %r13d
leaq -0x70(%rbp), %rbx
leaq -0x80(%rbp), %r15
movq -0x40(%rbp), %rax
movq (%rax), %rax
movl (%rax,%r13,4), %r14d
movq -0x30(%rbp), %rax
movl (%rax,%r13,4), %r12d
movq %rbx, -0x80(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x88c2
movl %r13d, %edi
movl %r14d, %esi
movl %r12d, %edx
movq -0x48(%rbp), %rcx
movl $0x64, %r8d
movq %r15, %r12
movq %r15, %r9
callq 0xe9ca
movl %eax, %r14d
movq -0x38(%rbp), %rax
movq (%rax), %rax
movl (%rax,%r13,4), %r15d
movq -0x80(%rbp), %rdi
cmpq %rbx, %rdi
je 0xef70
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x21b0
cmpl %r15d, %r14d
jne 0xef83
incq %r13
cmpq $0x6, %r13
movq %r12, %r15
jne 0xef02
jmp 0xeffb
movq 0x1004e(%rip), %rdi     # 0x1efd8
leaq 0x7297(%rip), %rsi      # 0x16228
movl $0x3a, %edx
callq 0x2200
movq 0x10036(%rip), %rdi     # 0x1efd8
movl %r13d, %esi
callq 0x22c0
movq %rax, %r14
leaq 0x7684(%rip), %rsi      # 0x16638
movl $0x1, %edx
movq %rax, %rdi
callq 0x2200
movq -0x30(%rbp), %rax
movl (%rax,%r13,4), %esi
movq %r14, %rdi
callq 0x22c0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movq -0x60(%rbp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xf026
jmp 0xf026
jmp 0xf026
movq %rax, %r14
movq -0x80(%rbp), %rdi
cmpq %rbx, %rdi
je 0xf049
movq -0x70(%rbp), %rsi
jmp 0xf041
movq %rax, %r14
jmp 0xf049
movq %rax, %r14
movq -0xa0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xf049
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0x18, %esi
movq -0x30(%rbp), %rdi
callq 0x21b0
movq %r14, %rdi
callq 0x22d0