// File: /workspace/github_c_makefile_star2_O1/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), %ebx
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), %rcx
movq %rcx, 0x58(%rsp)
movups 0x98(%rax), %xmm0
movaps %xmm0, 0xa0(%rsp)
movups 0x88(%rax), %xmm0
movaps %xmm0, 0x90(%rsp)
cmpl $0x1, %ebx
adcl $0x0, %ebx
movq %rax, %rdi
callq 0x3040
movslq %ebx, %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0x3260
movq %rax, 0x50(%rsp)
movl $0x8, %esi
movq %r15, %rdi
callq 0x3260
movq %rax, %r12
movl %ebx, 0x4c(%rsp)
movl %ebx, %r13d
testl %r15d, %r15d
jle 0x2de6a
xorl %r15d, %r15d
movq 0x50(%rsp), %rbx
xorl %r14d, %r14d
movq %r12, 0x60(%rsp)
movl 0x4c(%rsp), %ebp
movl %r15d, %ecx
movq 0x68(%rsp), %rax
leal (%rax,%rcx), %r15d
movl %r15d, %eax
cltd
idivl %ebp
movl %eax, %r12d
movl %ecx, %eax
cltd
idivl %ebp
subl %eax, %r12d
movl $0x1, %edi
movl $0xa8, %esi
callq 0x3260
movl %ebp, (%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 -0xc02(%rip), %rdx      # 0x2d22f
movq %rax, %rcx
callq 0x3370
testl %eax, %eax
je 0x2de49
leaq 0x28b9b(%rip), %rdi     # 0x569df
callq 0xe956
movq 0xb0(%rsp), %rax
movq 0x60(%rsp), %r12
movq %rax, (%r12,%r14,8)
incq %r14
addq $0x40, %rbx
cmpq %r14, %r13
jne 0x2dda3
cmpl $0x0, 0x4c(%rsp)
jle 0x2de86
xorl %ebx, %ebx
movq (%r12,%rbx,8), %rdi
xorl %esi, %esi
callq 0x3480
incq %rbx
cmpq %rbx, %r13
jne 0x2de73
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
movq 0x50(%rsp), %r14
movq %r14, %rsi
movl 0x4c(%rsp), %ebp
movl %ebp, %edx
callq 0x2df30
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups 0x30(%rbx), %xmm3
movq 0x58(%rsp), %rax
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movl $0x0, 0x28(%rax)
testl %ebp, %ebp
jle 0x2df0c
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 0x2b6fd
addq $0x40, %rbx
decq %r13
jne 0x2ded5
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