// File: /workspace/github_cpp_makefile_star2_O1/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
pxor %xmm0, %xmm0
movdqu %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl $0x18, %edi
callq 0x21a0
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
leaq 0x18(%rax), %rcx
movq %rcx, 0x10(%rbx)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, (%rax)
movq $-0x1, 0x10(%rax)
movq %rbx, -0x58(%rbp)
movq %rcx, 0x8(%rbx)
movq %r15, -0x48(%rbp)
movq (%r15), %rcx
movl (%rcx), %ecx
movq %r14, -0x40(%rbp)
leal (%r14,%rcx,2), %edx
addl $0x6e, %edx
movq %r12, -0x38(%rbp)
movq (%r12), %rcx
cmpl (%rcx), %edx
jne 0xee4d
movl $0x0, (%rax)
movq %rax, -0x30(%rbp)
movl $0x1, %r12d
leaq -0x88(%rbp), %rbx
leaq -0x98(%rbp), %r13
movq -0x48(%rbp), %rax
movq (%rax), %rax
movl (%rax,%r12,4), %r14d
movq %rbx, -0x98(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x8870
movl %r12d, %edi
movl %r14d, %esi
xorl %edx, %edx
movq -0x40(%rbp), %rcx
movl $0x64, %r8d
movq %r13, %r9
callq 0xea66
movl %eax, %r14d
movq -0x38(%rbp), %rax
movq (%rax), %rax
movl (%rax,%r12,4), %r15d
movq -0x98(%rbp), %rdi
cmpq %rbx, %rdi
je 0xeed0
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x21b0
cmpl %r15d, %r14d
jne 0xeee1
movq -0x30(%rbp), %rax
movl $0x0, (%rax,%r12,4)
incq %r12
cmpq $0x6, %r12
jne 0xee65
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 0xeef6
leal -0x1(%rcx), %eax
cmpl $0x4, %eax
ja 0xf0dc
xorl %esi, %esi
movq -0x30(%rbp), %rbx
cmpl $-0x1, (%rbx,%rsi,4)
jne 0xef2e
movl $0x1fe, %eax            # imm = 0x1FE
xorl %edx, %edx
divl %ecx
movl %eax, (%rbx,%rsi,4)
incq %rsi
cmpq $0x6, %rsi
jne 0xef1c
movq -0x48(%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 -0x40(%rbp), %rcx
leal (%rcx,%rax,2), %eax
addl %edx, %eax
addl $0x6e, %eax
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
cmpl (%rcx), %eax
je 0xefd5
movq 0x1006d(%rip), %rdi     # 0x1efd8
leaq 0x72b6(%rip), %rsi      # 0x16228
movl $0x3a, %edx
callq 0x2200
movq 0x10055(%rip), %rdi     # 0x1efd8
xorl %esi, %esi
callq 0x22c0
movq %rax, %r12
leaq 0x76a4(%rip), %rsi      # 0x16638
movl $0x1, %edx
movq %rax, %rdi
callq 0x2200
movl (%rbx), %esi
movq %r12, %rdi
callq 0x22c0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movl $0x1, %r12d
leaq -0x68(%rbp), %rbx
leaq -0x78(%rbp), %r15
movq -0x48(%rbp), %rax
movq (%rax), %rax
movl (%rax,%r12,4), %r13d
movq -0x30(%rbp), %rax
movl (%rax,%r12,4), %r14d
movq %rbx, -0x78(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x8870
movl %r12d, %edi
movl %r13d, %esi
movl %r14d, %edx
movq -0x40(%rbp), %rcx
movl $0x64, %r8d
movq %r15, %r13
movq %r15, %r9
callq 0xea66
movl %eax, %r14d
movq -0x38(%rbp), %rax
movq (%rax), %rax
movl (%rax,%r12,4), %r15d
movq -0x78(%rbp), %rdi
cmpq %rbx, %rdi
je 0xf051
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x21b0
cmpl %r15d, %r14d
jne 0xf064
incq %r12
cmpq $0x6, %r12
movq %r13, %r15
jne 0xefe3
jmp 0xf0dc
movq 0xff6d(%rip), %rdi      # 0x1efd8
leaq 0x71b6(%rip), %rsi      # 0x16228
movl $0x3a, %edx
callq 0x2200
movq 0xff55(%rip), %rdi      # 0x1efd8
movl %r12d, %esi
callq 0x22c0
movq %rax, %r14
leaq 0x75a3(%rip), %rsi      # 0x16638
movl $0x1, %edx
movq %rax, %rdi
callq 0x2200
movq -0x30(%rbp), %rax
movl (%rax,%r12,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 -0x58(%rbp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xf107
jmp 0xf107
jmp 0xf107
movq %rax, %r14
movq -0x78(%rbp), %rdi
cmpq %rbx, %rdi
je 0xf12a
movq -0x68(%rbp), %rsi
jmp 0xf122
movq %rax, %r14
jmp 0xf12a
movq %rax, %r14
movq -0x98(%rbp), %rdi
cmpq %rbx, %rdi
je 0xf12a
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x21b0
movl $0x18, %esi
movq -0x30(%rbp), %rdi
callq 0x21b0
movq %r14, %rdi
callq 0x22d0