// File: waltersharpWEI[P]CommentEliminator/main.cpp
// Function: balanceThreads(int)
void balanceThreads(int NumThread) {
    vector<string> Files[NumThread];
    std::vector<pthread_t> ThreadPointers(NumThread);

    for (int I = 0;I < NumThread; I++) {
        Files[I].clear();
    }

    for (int I = 0;I < FileList.size();I++) {
        int TargetThread = rand() % NumThread;
        Files[TargetThread].push_back(FileList[I].path);
    }

    for (int I = 0;I < NumThread;I++) {
        pthread_create(&ThreadPointers[I],NULL,threadEliminator,&(Files[I]));
    }
    for (int I = 0; I < NumThread; I++) {
        pthread_join(ThreadPointers[I], NULL);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
movq %rax, -0x68(%rbp)
movq %rsp, %rcx
movq %rcx, -0x10(%rbp)
leaq (%rax,%rax,2), %rcx
leaq 0xf(,%rcx,8), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x60(%rbp)
movq %rcx, %rsp
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x332f
movq -0x60(%rbp), %rax
movq -0x68(%rbp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x78(%rbp)
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x4410
movq -0x80(%rbp), %rax
movq -0x78(%rbp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x70(%rbp)
jne 0x330d
movslq -0x4(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x4430
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x4450
jmp 0x3363
leaq -0x31(%rbp), %rdi
callq 0x44c0
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x33b4
movq -0x60(%rbp), %rdi
movslq -0x48(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x44e0
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x3373
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x44c0
jmp 0x352f
movl $0x0, -0x4c(%rbp)
movslq -0x4c(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq 0xae73(%rip), %rdi      # 0xe240
callq 0x4500
movq %rax, %rcx
movq -0x98(%rbp), %rax
cmpq %rcx, %rax
jae 0x344e
callq 0x2070
movl -0x4(%rbp), %ecx
cltd
idivl %ecx
movq -0x60(%rbp), %rax
movl %edx, -0x50(%rbp)
movslq -0x50(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, -0xa0(%rbp)
movslq -0x4c(%rbp), %rsi
leaq 0xae2f(%rip), %rdi      # 0xe240
callq 0x45a0
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x4530
jmp 0x3427
jmp 0x3429
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x33bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x45e0
jmp 0x352f
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x3497
movslq -0x54(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x45c0
movq -0x60(%rbp), %rcx
movq %rax, %rdi
movslq -0x54(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rcx
xorl %eax, %eax
movl %eax, %esi
leaq -0x347(%rip), %rdx      # 0x3140
callq 0x23f0
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x3455
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x34ce
movslq -0x58(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x45c0
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x21c0
jmp 0x34c1
jmp 0x34c3
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x349e
leaq -0x30(%rbp), %rdi
callq 0x45e0
movq -0x68(%rbp), %rax
movq -0x60(%rbp), %rcx
imulq $0x18, %rax, %rdx
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, -0xa8(%rbp)
je 0x3523
movq -0xa8(%rbp), %rdi
addq $-0x18, %rdi
movq %rdi, -0xb0(%rbp)
callq 0x4640
movq -0x60(%rbp), %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0xa8(%rbp)
jne 0x34f5
movq -0x10(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rcx
movq -0x68(%rbp), %rax
imulq $0x18, %rax, %rdx
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, -0xb8(%rbp)
je 0x357b
movq -0xb8(%rbp), %rdi
addq $-0x18, %rdi
movq %rdi, -0xc0(%rbp)
callq 0x4640
movq -0x60(%rbp), %rcx
movq -0xc0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0xb8(%rbp)
jne 0x354d
jmp 0x357d
movq -0x40(%rbp), %rdi
callq 0x23c0
nopw %cs:(%rax,%rax)