// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: load_thread
void *load_thread(void *ptr)
{
    //printf("Loading data: %d\n", rand());
    load_args a = *(struct load_args*)ptr;
    if(a.exposure == 0) a.exposure = 1;
    if(a.saturation == 0) a.saturation = 1;
    if(a.aspect == 0) a.aspect = 1;

    if (a.type == OLD_CLASSIFICATION_DATA){
        *a.d = load_data_old(a.paths, a.n, a.m, a.labels, a.classes, a.w, a.h);
    } else if (a.type == REGRESSION_DATA){
        *a.d = load_data_regression(a.paths, a.n, a.m, a.classes, a.min, a.max, a.size, a.angle, a.aspect, a.hue, a.saturation, a.exposure);
    } else if (a.type == CLASSIFICATION_DATA){
        *a.d = load_data_augment(a.paths, a.n, a.m, a.labels, a.classes, a.hierarchy, a.min, a.max, a.size, a.angle, a.aspect, a.hue, a.saturation, a.exposure, a.center);
    } else if (a.type == SUPER_DATA){
        *a.d = load_data_super(a.paths, a.n, a.m, a.w, a.h, a.scale);
    } else if (a.type == WRITING_DATA){
        *a.d = load_data_writing(a.paths, a.n, a.m, a.w, a.h, a.out_w, a.out_h);
    } else if (a.type == ISEG_DATA){
        *a.d = load_data_iseg(a.n, a.paths, a.m, a.w, a.h, a.classes, a.num_boxes, a.scale, a.min, a.max, a.angle, a.aspect, a.hue, a.saturation, a.exposure);
    } else if (a.type == INSTANCE_DATA){
        *a.d = load_data_mask(a.n, a.paths, a.m, a.w, a.h, a.classes, a.num_boxes, a.coords, a.min, a.max, a.angle, a.aspect, a.hue, a.saturation, a.exposure);
    } else if (a.type == SEGMENTATION_DATA){
        *a.d = load_data_seg(a.n, a.paths, a.m, a.w, a.h, a.classes, a.min, a.max, a.angle, a.aspect, a.hue, a.saturation, a.exposure, a.scale);
    } else if (a.type == REGION_DATA){
        *a.d = load_data_region(a.n, a.paths, a.m, a.w, a.h, a.num_boxes, a.classes, a.jitter, a.hue, a.saturation, a.exposure);
    } else if (a.type == DETECTION_DATA){
        *a.d = load_data_detection(a.n, a.paths, a.m, a.w, a.h, a.num_boxes, a.classes, a.jitter, a.hue, a.saturation, a.exposure);
    } else if (a.type == SWAG_DATA){
        *a.d = load_data_swag(a.paths, a.n, a.classes, a.jitter);
    } else if (a.type == COMPARE_DATA){
        *a.d = load_data_compare(a.n, a.paths, a.m, a.classes, a.w, a.h);
    } else if (a.type == IMAGE_DATA){
        *(a.im) = load_image_color(a.path, 0, 0);
        *(a.resized) = resize_image(*(a.im), a.w, a.h);
    } else if (a.type == LETTERBOX_DATA){
        *(a.im) = load_image_color(a.path, 0, 0);
        *(a.resized) = letterbox_image(*(a.im), a.w, a.h);
    } else if (a.type == TAG_DATA){
        *a.d = load_data_tag(a.paths, a.n, a.m, a.classes, a.min, a.max, a.size, a.angle, a.aspect, a.hue, a.saturation, a.exposure);
    }
    free(ptr);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movl 0x98(%rdi), %edi
cmpq $0x11, %rdi
ja 0x20500
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rsi
movl 0x18(%rbx), %edx
movl 0x1c(%rbx), %ecx
movq 0x20(%rbx), %r8
movl 0x28(%rbx), %r9d
movq %r9, 0x10(%rsp)
movl 0x2c(%rbx), %r9d
movq %r9, 0x8(%rsp)
movl 0x40(%rbx), %r14d
movl 0x44(%rbx), %r11d
movl 0x48(%rbx), %r9d
movq %r9, 0x18(%rsp)
movl 0x4c(%rbx), %r9d
movq %r9, 0x20(%rsp)
movl 0x50(%rbx), %r10d
movl 0x58(%rbx), %r15d
movss 0x64(%rbx), %xmm5
movss 0x68(%rbx), %xmm0
movss 0x6c(%rbx), %xmm6
movss 0x70(%rbx), %xmm7
movss 0x74(%rbx), %xmm3
movss 0x78(%rbx), %xmm2
leaq 0x2f7e4(%rip), %r9      # 0x4f948
movslq (%r9,%rdi,4), %rdi
addq %r9, %rdi
movq 0x80(%rbx), %r13
xorps %xmm1, %xmm1
movaps %xmm3, %xmm4
cmpeqss %xmm1, %xmm4
movss 0x2be82(%rip), %xmm8    # 0x4c008
movaps %xmm4, %xmm9
andps %xmm8, %xmm9
andnps %xmm3, %xmm4
orps %xmm9, %xmm4
movaps %xmm7, %xmm3
cmpeqss %xmm1, %xmm3
movaps %xmm3, %xmm9
andps %xmm8, %xmm9
andnps %xmm7, %xmm3
orps %xmm9, %xmm3
cmpeqss %xmm6, %xmm1
andps %xmm1, %xmm8
andnps %xmm6, %xmm1
orps %xmm8, %xmm1
movq 0x88(%rbx), %r12
movq 0x90(%rbx), %rbp
jmpq *%rdi
movl 0x5c(%rbx), %r15d
subq $0x8, %rsp
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
movl %r10d, %r9d
pushq %r15
pushq 0x30(%rsp)
pushq 0x30(%rsp)
pushq %r11
pushq 0xa0(%rbx)
callq 0x2069b
addq $0x30, %rsp
jmp 0x203ad
movl 0x60(%rbx), %esi
subq $0x30, %rsp
movq 0x48(%rsp), %rdi
movl %edi, 0x20(%rsp)
movl %r11d, 0x18(%rsp)
movl %esi, 0x10(%rsp)
movl %r14d, 0x8(%rsp)
leaq 0x58(%rsp), %r12
movq %r12, %rdi
movl %edx, %esi
movq %rax, %rdx
movq 0x38(%rsp), %r8
movq 0x40(%rsp), %r9
callq 0x1f04b
jmp 0x203fd
leaq 0x28(%rsp), %r14
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xbf36
movq 0x10(%r14), %rax
movq %rax, 0x10(%r12)
movups (%r14), %xmm0
movups %xmm0, (%r12)
subq $0x20, %rsp
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0xe7d0
jmp 0x20457
leaq 0x28(%rsp), %r12
movq %r12, %rdi
movl %edx, %esi
movq %rax, %rdx
movq 0x8(%rsp), %r8
movq 0x10(%rsp), %r9
pushq %r15
pushq 0x20(%rsp)
pushq %r11
pushq %r10
callq 0x1ea93
addq $0x20, %rsp
jmp 0x204d5
leaq 0x28(%rsp), %r12
movq %r12, %rdi
movl %edx, %esi
movq %rax, %rdx
movq 0x8(%rsp), %r8
movq 0x10(%rsp), %r9
movaps %xmm5, %xmm0
movaps %xmm2, %xmm1
movaps %xmm3, %xmm2
movaps %xmm4, %xmm3
pushq %r10
pushq %r14
callq 0x1f2d6
jmp 0x204d3
movl 0x30(%rbx), %r10d
movl 0x34(%rbx), %r11d
leaq 0x28(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
movq 0x8(%rsp), %r8
movq 0x10(%rsp), %r9
pushq %r11
pushq %r10
callq 0x20949
jmp 0x204d3
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
movl %r10d, %r8d
movl %r11d, %r9d
pushq 0x20(%rsp)
pushq 0x20(%rsp)
callq 0x205ba
jmp 0x203ab
subq $0x8, %rsp
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movl %edx, %esi
movq %rax, %rdx
movq 0x10(%rsp), %r8
movq 0x18(%rsp), %r9
movaps %xmm5, %xmm0
movaps %xmm2, %xmm1
movaps %xmm3, %xmm2
movaps %xmm4, %xmm3
pushq %r14
callq 0x1fd29
jmp 0x204d3
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
movl %r10d, %ecx
movaps %xmm5, %xmm0
callq 0x1fa4f
jmp 0x203ad
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
movl %r10d, %r8d
movl %r11d, %r9d
pushq 0x20(%rsp)
pushq 0x20(%rsp)
callq 0x20a21
popq %rax
popq %rcx
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups 0x30(%r14), %xmm3
jmp 0x204ec
subq $0x30, %rsp
movq 0x48(%rsp), %rsi
movl %esi, 0x20(%rsp)
movl %r11d, 0x18(%rsp)
movl %r15d, 0x10(%rsp)
movl %r14d, 0x8(%rsp)
leaq 0x58(%rsp), %r12
movq %r12, %rdi
movl %edx, %esi
movq %rax, %rdx
movq 0x38(%rsp), %r8
movq 0x40(%rsp), %r9
callq 0x1eda0
addq $0x30, %rsp
jmp 0x204d5
leaq 0x28(%rsp), %r14
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xbf36
movq 0x10(%r14), %rax
movq %rax, 0x10(%r12)
movups (%r14), %xmm0
movups %xmm0, (%r12)
subq $0x20, %rsp
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0xc3ee
addq $0x20, %rsp
movq 0x10(%r12), %rax
movq %rax, 0x10(%rbp)
movups (%r12), %xmm0
movups %xmm0, (%rbp)
jmp 0x20500
subq $0x8, %rsp
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movl %edx, %esi
movq %rax, %rdx
movl %r10d, %r8d
movq 0x10(%rsp), %r9
pushq 0x18(%rsp)
callq 0x1f693
jmp 0x204d3
subq $0x8, %rsp
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
movq 0x10(%rsp), %r8
movq 0x18(%rsp), %r9
pushq %r15
callq 0x20790
jmp 0x204d3
leaq 0x28(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
movl %r10d, %r9d
pushq 0x10(%rsp)
pushq 0x10(%rsp)
callq 0x20519
popq %rax
popq %rcx
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
movups 0x20(%r12), %xmm2
movups 0x30(%r12), %xmm3
movups %xmm3, 0x30(%r13)
movups %xmm2, 0x20(%r13)
movups %xmm1, 0x10(%r13)
movups %xmm0, (%r13)
movq %rbx, %rdi
callq 0x3040
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq