// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: load_data_compare
data load_data_compare(int n, char **paths, int m, int classes, int w, int h)
{
    if(m) paths = get_random_paths(paths, 2*n, m);
    int i,j;
    data d = {0};
    d.shallow = 0;

    d.X.rows = n;
    d.X.vals = calloc(d.X.rows, sizeof(float*));
    d.X.cols = h*w*6;

    int k = 2*(classes);
    d.y = make_matrix(n, k);
    for(i = 0; i < n; ++i){
        image im1 = load_image_color(paths[i*2],   w, h);
        image im2 = load_image_color(paths[i*2+1], w, h);

        d.X.vals[i] = calloc(d.X.cols, sizeof(float));
        memcpy(d.X.vals[i],         im1.data, h*w*3*sizeof(float));
        memcpy(d.X.vals[i] + h*w*3, im2.data, h*w*3*sizeof(float));

        int id;
        float iou;

        char imlabel1[4096];
        char imlabel2[4096];
        find_replace(paths[i*2],   "imgs", "labels", imlabel1);
        find_replace(imlabel1, "jpg", "txt", imlabel1);
        FILE *fp1 = fopen(imlabel1, "r");

        while(fscanf(fp1, "%d %f", &id, &iou) == 2){
            if (d.y.vals[i][2*id] < iou) d.y.vals[i][2*id] = iou;
        }

        find_replace(paths[i*2+1], "imgs", "labels", imlabel2);
        find_replace(imlabel2, "jpg", "txt", imlabel2);
        FILE *fp2 = fopen(imlabel2, "r");

        while(fscanf(fp2, "%d %f", &id, &iou) == 2){
            if (d.y.vals[i][2*id + 1] < iou) d.y.vals[i][2*id + 1] = iou;
        }

        for (j = 0; j < classes; ++j){
            if (d.y.vals[i][2*j] > .5 &&  d.y.vals[i][2*j+1] < .5){
                d.y.vals[i][2*j] = 1;
                d.y.vals[i][2*j+1] = 0;
            } else if (d.y.vals[i][2*j] < .5 &&  d.y.vals[i][2*j+1] > .5){
                d.y.vals[i][2*j] = 0;
                d.y.vals[i][2*j+1] = 1;
            } else {
                d.y.vals[i][2*j]   = SECRET_NUM;
                d.y.vals[i][2*j+1] = SECRET_NUM;
            }
        }
        fclose(fp1);
        fclose(fp2);

        free_image(im1);
        free_image(im2);
    }
    if(m) free(paths);
    return d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20b0, %rsp           # imm = 0x20B0
movq %rdi, -0x2090(%rbp)
movq %rdi, -0x2088(%rbp)
movl 0x10(%rbp), %eax
movl %esi, -0x4(%rbp)
movq %rdx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movl %r9d, -0x1c(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x357b9
movq -0x10(%rbp), %rdi
movl -0x4(%rbp), %esi
shll %esi
movl -0x14(%rbp), %edx
callq 0x314c0
movq %rax, -0x10(%rbp)
movq -0x2090(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x3190
movq -0x2090(%rbp), %rax
movl $0x0, 0x28(%rax)
movl -0x4(%rbp), %ecx
movl %ecx, 0x8(%rax)
movslq 0x8(%rax), %rdi
movl $0x8, %esi
callq 0x3220
movq %rax, %rcx
movq -0x2090(%rbp), %rax
movq %rcx, 0x10(%rax)
movl 0x10(%rbp), %ecx
imull -0x1c(%rbp), %ecx
imull $0x6, %ecx, %ecx
movl %ecx, 0xc(%rax)
movl -0x18(%rbp), %eax
shll %eax
movl %eax, -0x28(%rbp)
movl -0x4(%rbp), %edi
movl -0x28(%rbp), %esi
callq 0x39450
movq %rax, %rcx
movq -0x2090(%rbp), %rax
movq %rcx, -0x38(%rbp)
movq %rdx, -0x30(%rbp)
movq -0x38(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rcx
movq %rcx, 0x20(%rax)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x35d1e
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
movl -0x1c(%rbp), %edx
movl 0x10(%rbp), %ecx
leaq -0x50(%rbp), %rdi
callq 0xf510
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
movl -0x1c(%rbp), %edx
movl 0x10(%rbp), %ecx
leaq -0x68(%rbp), %rdi
callq 0xf510
movq -0x2090(%rbp), %rax
movslq 0xc(%rax), %rdi
movl $0x4, %esi
callq 0x3220
movq %rax, %rsi
movq -0x2090(%rbp), %rax
movq 0x10(%rax), %rcx
movslq -0x20(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x10(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x40(%rbp), %rsi
movl 0x10(%rbp), %eax
imull -0x1c(%rbp), %eax
imull $0x3, %eax, %eax
movslq %eax, %rdx
shlq $0x2, %rdx
callq 0x3280
movq -0x2090(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl 0x10(%rbp), %eax
imull -0x1c(%rbp), %eax
imull $0x3, %eax, %eax
cltq
shlq $0x2, %rax
addq %rax, %rdi
movq -0x58(%rbp), %rsi
movl 0x10(%rbp), %eax
imull -0x1c(%rbp), %eax
imull $0x3, %eax, %eax
movslq %eax, %rdx
shlq $0x2, %rdx
callq 0x3280
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x1070(%rbp), %rcx
leaq 0x3ea86(%rip), %rsi     # 0x743c7
leaq 0x3e9fe(%rip), %rdx     # 0x74346
callq 0x4a50
leaq -0x1070(%rbp), %rdi
leaq -0x1070(%rbp), %rcx
leaq 0x3d7d8(%rip), %rsi     # 0x7313a
leaq 0x406fe(%rip), %rdx     # 0x76067
callq 0x4a50
leaq -0x1070(%rbp), %rdi
leaq 0x40bf1(%rip), %rsi     # 0x7656d
callq 0x3360
movq %rax, -0x2078(%rbp)
movq -0x2078(%rbp), %rdi
leaq 0x3ea36(%rip), %rsi     # 0x743cc
leaq -0x6c(%rbp), %rdx
leaq -0x70(%rbp), %rcx
movb $0x0, %al
callq 0x3080
cmpl $0x2, %eax
jne 0x359fb
movq -0x2090(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x6c(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm1
movss -0x70(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x359f9
movq -0x2090(%rbp), %rax
movss -0x70(%rbp), %xmm0
movq 0x20(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x6c(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
jmp 0x35988
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x2070(%rbp), %rcx
leaq 0x3e9ab(%rip), %rsi     # 0x743c7
leaq 0x3e923(%rip), %rdx     # 0x74346
callq 0x4a50
leaq -0x2070(%rbp), %rdi
leaq -0x2070(%rbp), %rcx
leaq 0x3d6fd(%rip), %rsi     # 0x7313a
leaq 0x40623(%rip), %rdx     # 0x76067
callq 0x4a50
leaq -0x2070(%rbp), %rdi
leaq 0x40b16(%rip), %rsi     # 0x7656d
callq 0x3360
movq %rax, -0x2080(%rbp)
movq -0x2080(%rbp), %rdi
leaq 0x3e95b(%rip), %rsi     # 0x743cc
leaq -0x6c(%rbp), %rdx
leaq -0x70(%rbp), %rcx
movb $0x0, %al
callq 0x3080
cmpl $0x2, %eax
jne 0x35adc
movq -0x2090(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x6c(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm1
movss -0x70(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x35ada
movq -0x2090(%rbp), %rax
movss -0x70(%rbp), %xmm0
movq 0x20(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x6c(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
jmp 0x35a63
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x35cb4
movq -0x2090(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x24(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x3d32d(%rip), %xmm1    # 0x72e48
ucomisd %xmm1, %xmm0
jbe 0x35ba6
movq -0x2090(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x24(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x3d2f4(%rip), %xmm0    # 0x72e48
ucomisd %xmm1, %xmm0
jbe 0x35ba6
movq -0x2090(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl -0x24(%rbp), %edx
shll %edx
movslq %edx, %rdx
movss 0x3b48f(%rip), %xmm0    # 0x7100c
movss %xmm0, (%rcx,%rdx,4)
movq 0x20(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x24(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
xorps %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
jmp 0x35ca4
movq -0x2090(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x24(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x3d276(%rip), %xmm0    # 0x72e48
ucomisd %xmm1, %xmm0
jbe 0x35c56
movq -0x2090(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x24(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x3d241(%rip), %xmm1    # 0x72e48
ucomisd %xmm1, %xmm0
jbe 0x35c56
movq -0x2090(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl -0x24(%rbp), %edx
shll %edx
movslq %edx, %rdx
xorps %xmm0, %xmm0
movss %xmm0, (%rcx,%rdx,4)
movq 0x20(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x24(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movss 0x3b3bd(%rip), %xmm0    # 0x7100c
movss %xmm0, (%rax,%rcx,4)
jmp 0x35ca2
movq -0x2090(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl -0x24(%rbp), %edx
shll %edx
movslq %edx, %rdx
movss 0x3e6a3(%rip), %xmm0    # 0x7431c
movss %xmm0, (%rcx,%rdx,4)
movq 0x20(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x24(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movss 0x3e67f(%rip), %xmm0    # 0x7431c
movss %xmm0, (%rax,%rcx,4)
jmp 0x35ca4
jmp 0x35ca6
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x35ae3
movq -0x2078(%rbp), %rdi
callq 0x3100
movq -0x2080(%rbp), %rdi
callq 0x3100
leaq -0x50(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xedb0
leaq -0x68(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xedb0
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x35845
cmpl $0x0, -0x14(%rbp)
je 0x35d2d
movq -0x10(%rbp), %rdi
callq 0x3030
movq -0x2088(%rbp), %rax
addq $0x20b0, %rsp           # imm = 0x20B0
popq %rbp
retq
nopl (%rax)