// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: load_threads
void *load_threads(void *ptr)
{
    int i;
    load_args args = *(load_args *)ptr;
    if (args.threads == 0) args.threads = 1;
    data *out = args.d;
    int total = args.n;
    free(ptr);
    data *buffers = calloc(args.threads, sizeof(data));
    pthread_t *threads = calloc(args.threads, sizeof(pthread_t));
    for(i = 0; i < args.threads; ++i){
        args.d = buffers + i;
        args.n = (i+1) * total/args.threads - i * total/args.threads;
        threads[i] = load_data_in_thread(args);
    }
    for(i = 0; i < args.threads; ++i){
        pthread_join(threads[i], 0);
    }
    *out = concat_datas(buffers, args.threads);
    out->shallow = 0;
    for(i = 0; i < args.threads; ++i){
        buffers[i].shallow = 1;
        free_data(buffers[i]);
    }
    free(buffers);
    free(threads);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rdi, %rax
movl (%rdi), %ebp
movl 0x14(%rdi), %ecx
movl %ecx, 0x80(%rsp)
movups 0x4(%rdi), %xmm0
movaps %xmm0, 0x70(%rsp)
movl 0x18(%rdi), %ecx
movq %rcx, 0x68(%rsp)
leaq 0x1c(%rdi), %rsi
leaq 0xf4(%rsp), %rdi
movl $0x19, %ecx
rep  movsl (%rsi), %es:(%rdi)
movq 0x80(%rax), %r13
movups 0x98(%rax), %xmm0
movaps %xmm0, 0xa0(%rsp)
movups 0x88(%rax), %xmm0
movaps %xmm0, 0x90(%rsp)
cmpl $0x1, %ebp
adcl $0x0, %ebp
movq %rax, %rdi
callq 0x3040
movslq %ebp, %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0x3250
movq %rax, %r14
movl $0x8, %esi
movq %r15, %rdi
callq 0x3250
movq %rax, %r12
testl %r15d, %r15d
jle 0x2fb89
movq %r13, 0x58(%rsp)
movl %ebp, 0x4c(%rsp)
movl %ebp, %eax
movq %rax, 0x50(%rsp)
xorl %r15d, %r15d
movq %r14, 0x60(%rsp)
movq %r14, %rbx
xorl %r14d, %r14d
movl 0x4c(%rsp), %r13d
movq %r12, %rbp
movl %r15d, %ecx
movq 0x68(%rsp), %rax
leal (%rax,%rcx), %r15d
movl %r15d, %eax
cltd
idivl %r13d
movl %eax, %r12d
movl %ecx, %eax
cltd
idivl %r13d
subl %eax, %r12d
movl $0x1, %edi
movl $0xa8, %esi
callq 0x3250
movl %r13d, (%rax)
movaps 0x70(%rsp), %xmm0
movups %xmm0, 0x4(%rax)
movl 0x80(%rsp), %ecx
movl %ecx, 0x14(%rax)
movl %r12d, 0x18(%rax)
leaq 0x1c(%rax), %rdi
movl $0x19, %ecx
leaq 0xf4(%rsp), %rsi
rep  movsl (%rsi), %es:(%rdi)
movq %rbx, 0x80(%rax)
movaps 0x90(%rsp), %xmm0
movaps 0xa0(%rsp), %xmm1
movups %xmm0, 0x88(%rax)
movups %xmm1, 0x98(%rax)
leaq 0xb0(%rsp), %rdi
xorl %esi, %esi
leaq -0xbfc(%rip), %rdx      # 0x2eea3
movq %rax, %rcx
callq 0x3360
testl %eax, %eax
je 0x2fab7
leaq 0x2902d(%rip), %rdi     # 0x58adf
callq 0xf141
movq 0xb0(%rsp), %rax
movq %rbp, %r12
movq %rax, (%rbp,%r14,8)
incq %r14
addq $0x40, %rbx
cmpq %r14, 0x50(%rsp)
jne 0x2fa0b
movl 0x4c(%rsp), %ebp
testl %ebp, %ebp
movq 0x60(%rsp), %r14
movq 0x58(%rsp), %r13
jle 0x2fb89
xorl %ebx, %ebx
movq 0x50(%rsp), %r15
movq (%r12,%rbx,8), %rdi
xorl %esi, %esi
callq 0x3470
incq %rbx
cmpq %rbx, %r15
jne 0x2faf6
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2fbed
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups 0x30(%rbx), %xmm3
movups %xmm3, 0x30(%r13)
movups %xmm2, 0x20(%r13)
movups %xmm1, 0x10(%r13)
movups %xmm0, (%r13)
movl $0x0, 0x28(%r13)
testl %ebp, %ebp
jle 0x2fbc9
movq %r14, %rbx
movl $0x1, 0x28(%rbx)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups 0x30(%rbx), %xmm3
movups %xmm3, 0x30(%rsp)
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x2d296
addq $0x40, %rbx
decq %r15
jne 0x2fb50
jmp 0x2fbc9
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2fbed
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups 0x30(%rbx), %xmm3
movups %xmm3, 0x30(%r13)
movups %xmm2, 0x20(%r13)
movups %xmm1, 0x10(%r13)
movups %xmm0, (%r13)
movl $0x0, 0x28(%r13)
movq %r14, %rdi
callq 0x3040
movq %r12, %rdi
callq 0x3040
xorl %eax, %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq