// File: /workspace/github_cpp_makefile_star2_O2/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 $0x88, %rsp
movq %r8, -0x58(%rbp)
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
leaq -0x64(%rbp), %rdx
orl $-0x1, (%rdx)
pushq $0x6
popq %rsi
leaq -0x31(%rbp), %rcx
movq %rdi, -0x30(%rbp)
callq 0x4d62
movq %r14, -0x48(%rbp)
movq (%r14), %rax
movl (%rax), %eax
movq %rbx, -0x50(%rbp)
leal (%rbx,%rax,2), %eax
addl $0x6e, %eax
movq %r15, -0x40(%rbp)
movq (%r15), %rcx
cmpl (%rcx), %eax
jne 0xc9c6
movq -0x30(%rbp), %rax
movq (%rax), %rax
andl $0x0, (%rax)
movq -0x50(%rbp), %rax
addl $0x6e, %eax
movq %rax, -0x60(%rbp)
pushq $0x1
popq %rbx
leaq -0xa8(%rbp), %r14
pushq $0x64
popq %r12
cmpq $0x6, %rbx
je 0xca3d
movq -0x48(%rbp), %rax
movq (%rax), %rax
movl (%rax,%rbx,4), %r13d
movq %r14, %rdi
movq -0x58(%rbp), %rsi
callq 0x2240
movl %ebx, %edi
movl %r13d, %esi
xorl %edx, %edx
movq -0x50(%rbp), %rcx
movl %r12d, %r8d
movq %r14, %r9
callq 0xc722
movl %eax, %r13d
movq -0x40(%rbp), %rax
movq (%rax), %rax
movl (%rax,%rbx,4), %r15d
movq %r14, %rdi
callq 0x20e0
cmpl %r15d, %r13d
jne 0xca38
movq -0x30(%rbp), %rax
movq (%rax), %rax
andl $0x0, (%rax,%rbx,4)
incq %rbx
jmp 0xc9df
movq -0x30(%rbp), %rax
movq (%rax), %rcx
xorl %eax, %eax
xorl %esi, %esi
cmpq $0x6, %rax
je 0xca5e
xorl %edx, %edx
cmpl $-0x1, (%rcx,%rax,4)
sete %dl
addl %edx, %esi
incq %rax
jmp 0xca48
leal -0x1(%rsi), %eax
cmpl $0x4, %eax
ja 0xcbaf
xorl %edi, %edi
cmpq $0x6, %rdi
je 0xca89
cmpl $-0x1, (%rcx,%rdi,4)
jne 0xca84
movl $0x1fe, %eax            # imm = 0x1FE
xorl %edx, %edx
divl %esi
movl %eax, (%rcx,%rdi,4)
incq %rdi
jmp 0xca6c
movq -0x48(%rbp), %rax
movq (%rax), %rax
movl (%rax), %esi
movl (%rcx), %eax
pushq $0x4
popq %rcx
cltd
idivl %ecx
movq -0x60(%rbp), %rcx
leal (%rcx,%rsi,2), %ecx
addl %eax, %ecx
movq -0x40(%rbp), %rax
movq (%rax), %rax
cmpl (%rax), %ecx
je 0xcaf7
movq 0x10523(%rip), %rdi     # 0x1cfd8
leaq 0x5754(%rip), %rsi      # 0x12210
callq 0x2190
movq 0x10510(%rip), %rdi     # 0x1cfd8
xorl %esi, %esi
callq 0x22d0
leaq 0x5b4a(%rip), %rsi      # 0x12620
movq %rax, %rdi
callq 0x2190
movq -0x30(%rbp), %rcx
movq (%rcx), %rcx
movl (%rcx), %esi
movq %rax, %rdi
callq 0x22d0
movq %rax, %rdi
callq 0x20f0
pushq $0x1
popq %rbx
leaq -0x88(%rbp), %r14
cmpq $0x6, %rbx
je 0xcbaf
movq -0x48(%rbp), %rax
movq (%rax), %rax
movl (%rax,%rbx,4), %r12d
movq -0x30(%rbp), %rax
movq (%rax), %rax
movl (%rax,%rbx,4), %r13d
movq %r14, %rdi
movq -0x58(%rbp), %rsi
callq 0x2240
movl %ebx, %edi
movl %r12d, %esi
movl %r13d, %edx
movq -0x50(%rbp), %rcx
pushq $0x64
popq %r8
movq %r14, %r9
callq 0xc722
movl %eax, %r12d
movq -0x40(%rbp), %rax
movq (%rax), %rax
movl (%rax,%rbx,4), %r15d
movq %r14, %rdi
callq 0x20e0
cmpl %r15d, %r12d
jne 0xcb65
incq %rbx
jmp 0xcb01
movq 0x1046c(%rip), %rdi     # 0x1cfd8
leaq 0x569d(%rip), %rsi      # 0x12210
callq 0x2190
movq 0x10459(%rip), %rdi     # 0x1cfd8
movl %ebx, %esi
callq 0x22d0
leaq 0x5a93(%rip), %rsi      # 0x12620
movq %rax, %rdi
callq 0x2190
movq -0x30(%rbp), %rcx
movq (%rcx), %rcx
movl (%rcx,%rbx,4), %esi
movq %rax, %rdi
callq 0x22d0
movq %rax, %rdi
callq 0x20f0
movq -0x30(%rbp), %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xcbd7
jmp 0xcbd7
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
jmp 0xcbe6
jmp 0xcbd7
movq %rax, %rbx
jmp 0xcbeb
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x20e0
movq -0x30(%rbp), %rdi
callq 0x6248
movq %rbx, %rdi
callq 0x22e0