// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: fill_truth_mask
void fill_truth_mask(char *path, int num_boxes, float *truth, int classes, int w, int h, augment_args aug, int flip, int mw, int mh)
{
    char labelpath[4096];
    find_replace(path, "images", "mask", labelpath);
    find_replace(labelpath, "JPEGImages", "mask", labelpath);
    find_replace(labelpath, ".jpg", ".txt", labelpath);
    find_replace(labelpath, ".JPG", ".txt", labelpath);
    find_replace(labelpath, ".JPEG", ".txt", labelpath);
    FILE *file = fopen(labelpath, "r");
    if(!file) file_error(labelpath);
    char buff[32788];
    int id;
    int i = 0;
    image part = make_image(w, h, 1);
    while((fscanf(file, "%d %s", &id, buff) == 2) && i < num_boxes){
        int n = 0;
        int *rle = read_intlist(buff, &n, 0);
        load_rle(part, rle, n);
        image sized = rotate_crop_image(part, aug.rad, aug.scale, aug.w, aug.h, aug.dx, aug.dy, aug.aspect);
        if(flip) flip_image(sized);
        box b = bound_image(sized);
        if(b.w > 0){
            image crop = crop_image(sized, b.x, b.y, b.w, b.h);
            image mask = resize_image(crop, mw, mh);
            truth[i*(4 + mw*mh + 1) + 0] = (b.x + b.w/2.)/sized.w;
            truth[i*(4 + mw*mh + 1) + 1] = (b.y + b.h/2.)/sized.h;
            truth[i*(4 + mw*mh + 1) + 2] = b.w/sized.w;
            truth[i*(4 + mw*mh + 1) + 3] = b.h/sized.h;
            int j;
            for(j = 0; j < mw*mh; ++j){
                truth[i*(4 + mw*mh + 1) + 4 + j] = mask.data[j];
            }
            truth[i*(4 + mw*mh + 1) + 4 + mw*mh] = id;
            free_image(crop);
            free_image(mask);
            ++i;
        }
        free_image(sized);
        free(rle);
    }
    fclose(file);
    free_image(part);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x9110, %rsp           # imm = 0x9110
movl 0x40(%rbp), %eax
movl 0x38(%rbp), %eax
movl 0x30(%rbp), %eax
leaq 0x10(%rbp), %rax
movq %rax, -0x90e8(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x1030(%rbp), %rcx
leaq 0x412a8(%rip), %rsi     # 0x7433f
leaq 0x412c5(%rip), %rdx     # 0x74363
callq 0x4a50
leaq -0x1030(%rbp), %rdi
leaq -0x1030(%rbp), %rcx
leaq 0x41295(%rip), %rsi     # 0x7434d
leaq 0x412a4(%rip), %rdx     # 0x74363
callq 0x4a50
leaq -0x1030(%rbp), %rdi
leaq -0x1030(%rbp), %rcx
leaq 0x40060(%rip), %rsi     # 0x73139
leaq 0x42f86(%rip), %rdx     # 0x76066
callq 0x4a50
leaq -0x1030(%rbp), %rdi
leaq -0x1030(%rbp), %rcx
leaq 0x4125e(%rip), %rsi     # 0x74358
leaq 0x42f65(%rip), %rdx     # 0x76066
callq 0x4a50
leaq -0x1030(%rbp), %rdi
leaq -0x1030(%rbp), %rcx
leaq 0x41242(%rip), %rsi     # 0x7435d
leaq 0x42f44(%rip), %rdx     # 0x76066
callq 0x4a50
leaq -0x1030(%rbp), %rdi
leaq 0x43438(%rip), %rsi     # 0x7656d
callq 0x3360
movq %rax, -0x1038(%rbp)
cmpq $0x0, -0x1038(%rbp)
jne 0x33157
leaq -0x1030(%rbp), %rdi
callq 0x4110
movl $0x0, -0x9058(%rbp)
movl -0x20(%rbp), %esi
movl -0x24(%rbp), %edx
leaq -0x9070(%rbp), %rdi
movl $0x1, %ecx
callq 0xe3e0
movq -0x1038(%rbp), %rdi
leaq -0x9050(%rbp), %rcx
leaq 0x411db(%rip), %rsi     # 0x74368
leaq -0x9054(%rbp), %rdx
movb $0x0, %al
callq 0x3080
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x2, %ecx
movb %al, -0x90e9(%rbp)
jne 0x331bc
movl -0x9058(%rbp), %eax
cmpl -0xc(%rbp), %eax
setl %al
movb %al, -0x90e9(%rbp)
movb -0x90e9(%rbp), %al
testb $0x1, %al
jne 0x331cb
jmp 0x335ba
movl $0x0, -0x9074(%rbp)
leaq -0x9050(%rbp), %rdi
leaq -0x9074(%rbp), %rsi
xorl %edx, %edx
callq 0x3f60
movq %rax, -0x9080(%rbp)
movq -0x9080(%rbp), %rdi
movl -0x9074(%rbp), %esi
leaq -0x9070(%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 0x328f0
movq -0x90e8(%rbp), %rax
movss 0xc(%rax), %xmm0
movss 0x8(%rax), %xmm1
movl (%rax), %esi
movl 0x4(%rax), %edx
movss 0x10(%rax), %xmm2
movss 0x14(%rax), %xmm3
movss 0x18(%rax), %xmm4
leaq -0x9098(%rbp), %rdi
leaq -0x9070(%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 0x11e00
cmpl $0x0, 0x30(%rbp)
je 0x3329f
leaq -0x9098(%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 0x104c0
movq -0x9088(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movups -0x9098(%rbp), %xmm0
movups %xmm0, (%rax)
callq 0x32b10
movlpd %xmm0, -0x90a8(%rbp)
movlpd %xmm1, -0x90a0(%rbp)
movss -0x90a0(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x33584
cvttss2si -0x90a8(%rbp), %esi
cvttss2si -0x90a4(%rbp), %edx
cvttss2si -0x90a0(%rbp), %ecx
cvttss2si -0x909c(%rbp), %r8d
leaq -0x90c0(%rbp), %rdi
leaq -0x9098(%rbp), %rax
movq (%rax), %r9
movq %r9, (%rsp)
movq 0x8(%rax), %r9
movq %r9, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x11ca0
movl 0x38(%rbp), %esi
movl 0x40(%rbp), %edx
leaq -0x90d8(%rbp), %rdi
leaq -0x90c0(%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 0xfc00
movss -0x90a8(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x90a0(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x3dcd9(%rip), %xmm2    # 0x71058
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
cvtsi2sdl -0x9098(%rbp), %xmm1
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x18(%rbp), %rax
movl -0x9058(%rbp), %ecx
movl 0x38(%rbp), %edx
imull 0x40(%rbp), %edx
addl $0x4, %edx
addl $0x1, %edx
imull %edx, %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
movss -0x90a4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x909c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x3dc7c(%rip), %xmm2    # 0x71058
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
cvtsi2sdl -0x9094(%rbp), %xmm1
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x18(%rbp), %rax
movl -0x9058(%rbp), %ecx
movl 0x38(%rbp), %edx
imull 0x40(%rbp), %edx
addl $0x4, %edx
addl $0x1, %edx
imull %edx, %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
movss -0x90a0(%rbp), %xmm0
cvtsi2ssl -0x9098(%rbp), %xmm1
divss %xmm1, %xmm0
movq -0x18(%rbp), %rax
movl -0x9058(%rbp), %ecx
movl 0x38(%rbp), %edx
imull 0x40(%rbp), %edx
addl $0x4, %edx
addl $0x1, %edx
imull %edx, %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
movss -0x909c(%rbp), %xmm0
cvtsi2ssl -0x9094(%rbp), %xmm1
divss %xmm1, %xmm0
movq -0x18(%rbp), %rax
movl -0x9058(%rbp), %ecx
movl 0x38(%rbp), %edx
imull 0x40(%rbp), %edx
addl $0x4, %edx
addl $0x1, %edx
imull %edx, %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
movl $0x0, -0x90dc(%rbp)
movl -0x90dc(%rbp), %eax
movl 0x38(%rbp), %ecx
imull 0x40(%rbp), %ecx
cmpl %ecx, %eax
jge 0x334f5
movq -0x90c8(%rbp), %rax
movslq -0x90dc(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x18(%rbp), %rax
movl -0x9058(%rbp), %ecx
movl 0x38(%rbp), %edx
imull 0x40(%rbp), %edx
addl $0x4, %edx
addl $0x1, %edx
imull %edx, %ecx
addl $0x4, %ecx
addl -0x90dc(%rbp), %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x90dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90dc(%rbp)
jmp 0x33495
cvtsi2ssl -0x9054(%rbp), %xmm0
movq -0x18(%rbp), %rax
movl -0x9058(%rbp), %ecx
movl 0x38(%rbp), %edx
imull 0x40(%rbp), %edx
addl $0x4, %edx
addl $0x1, %edx
imull %edx, %ecx
addl $0x4, %ecx
movl 0x38(%rbp), %edx
imull 0x40(%rbp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
leaq -0x90c0(%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 -0x90d8(%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 -0x9058(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9058(%rbp)
leaq -0x9098(%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
movq -0x9080(%rbp), %rdi
callq 0x3030
jmp 0x33178
movq -0x1038(%rbp), %rdi
callq 0x3100
leaq -0x9070(%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
addq $0x9110, %rsp           # imm = 0x9110
popq %rbp
retq
nopw %cs:(%rax,%rax)