// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: fill_truth_iseg
void fill_truth_iseg(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;
    int j;
    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);

        image mask = resize_image(sized, mw, mh);
        truth[i*(mw*mh+1)] = id;
        for(j = 0; j < mw*mh; ++j){
            truth[i*(mw*mh + 1) + 1 + j] = mask.data[j];
        }
        ++i;

        free_image(mask);
        free_image(sized);
        free(rle);
    }
    if(i < num_boxes) truth[i*(mw*mh+1)] = -1;
    fclose(file);
    free_image(part);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x90b8, %rsp           # imm = 0x90B8
movl %r9d, %r14d
movl %r8d, %r12d
movq %rdx, 0x20(%rsp)
movl %esi, %r15d
leaq 0x2c382(%rip), %rsi     # 0x5694f
leaq 0x2c39f(%rip), %rbp     # 0x56973
leaq 0xa0(%rsp), %r13
movq %rbp, %rdx
movq %r13, %rcx
callq 0xe842
leaq 0x2c36f(%rip), %rsi     # 0x5695d
movq %r13, %rdi
movq %rbp, %rdx
movq %r13, %rcx
callq 0xe842
leaq 0x2b151(%rip), %rsi     # 0x55754
leaq 0x2e1af(%rip), %rbp     # 0x587b9
movq %r13, %rdi
movq %rbp, %rdx
movq %r13, %rcx
callq 0xe842
leaq 0x2c349(%rip), %rsi     # 0x56968
movq %r13, %rdi
movq %rbp, %rdx
movq %r13, %rcx
callq 0xe842
leaq 0x2c339(%rip), %rsi     # 0x5696d
movq %r13, %rdi
movq %rbp, %rdx
movq %r13, %rcx
callq 0xe842
leaq 0x2e688(%rip), %rsi     # 0x58cd1
movq %r13, %rdi
callq 0x33a0
movq %rax, %rbx
testq %rax, %rax
jne 0x2a666
leaq 0xa0(%rsp), %rdi
callq 0xe142
leaq 0x68(%rsp), %rdi
movl $0x1, %ebp
movl %r12d, %esi
movl %r14d, %edx
movl $0x1, %ecx
callq 0x1529e
leaq 0x2c2f1(%rip), %rsi     # 0x56978
xorl %r12d, %r12d
leaq 0x1c(%rsp), %rdx
leaq 0x10a0(%rsp), %rcx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30b0
cmpl $0x2, %eax
setne %al
testl %r15d, %r15d
setg %cl
setle %dl
orb %al, %dl
jne 0x2a8c8
movq %rbx, 0x48(%rsp)
leaq 0x90f0(%rsp), %rax
movss 0xc(%rax), %xmm0
movss %xmm0, 0x44(%rsp)
movss 0x8(%rax), %xmm0
movss %xmm0, 0x40(%rsp)
movl (%rax), %ecx
movl %ecx, 0x3c(%rsp)
movl 0x4(%rax), %ecx
movl %ecx, 0x38(%rsp)
movss 0x10(%rax), %xmm0
movss %xmm0, 0x34(%rsp)
movss 0x14(%rax), %xmm0
movss %xmm0, 0x30(%rsp)
movss 0x18(%rax), %xmm0
movss %xmm0, 0x2c(%rsp)
movl 0x9120(%rsp), %eax
movl %eax, %ebx
imull 0x9118(%rsp), %ebx
leal 0x1(%rbx), %eax
movl %eax, 0x28(%rsp)
cltq
movq %rax, 0x80(%rsp)
movl %r15d, %r13d
leaq 0x10a0(%rsp), %r15
xorl %r12d, %r12d
movl $0x0, 0x18(%rsp)
movq %r15, %rdi
leaq 0x18(%rsp), %rsi
xorl %edx, %edx
callq 0xe017
movq %rax, %r14
movl 0x18(%rsp), %esi
movq 0x78(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x68(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0x2a37e
movq 0x78(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x68(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x50(%rsp), %rdi
movss 0x44(%rsp), %xmm0
movss 0x40(%rsp), %xmm1
movl 0x3c(%rsp), %esi
movl 0x38(%rsp), %edx
movss 0x34(%rsp), %xmm2
movss 0x30(%rsp), %xmm3
movss 0x2c(%rsp), %xmm4
callq 0x183d8
cmpl $0x0, 0x9110(%rsp)
je 0x2a7d7
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x16f91
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x88(%rsp), %rdi
movl 0x9118(%rsp), %esi
movl 0x9120(%rsp), %edx
callq 0x1676b
xorps %xmm0, %xmm0
cvtsi2ssl 0x1c(%rsp), %xmm0
movq %r12, %rax
imulq 0x80(%rsp), %rax
movq 0x20(%rsp), %rcx
movss %xmm0, (%rcx,%rax,4)
testl %ebx, %ebx
jle 0x2a84f
movl %ebp, %eax
movq 0x20(%rsp), %rcx
leaq (%rcx,%rax,4), %rax
movq 0x98(%rsp), %rcx
xorl %edx, %edx
movss (%rcx,%rdx,4), %xmm0
movss %xmm0, (%rax,%rdx,4)
incq %rdx
cmpq %rdx, %rbx
jne 0x2a83d
incq %r12
movq 0x98(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x88(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
movq %r14, %rdi
callq 0x3040
movq 0x48(%rsp), %rdi
leaq 0x2c0dc(%rip), %rsi     # 0x56978
leaq 0x1c(%rsp), %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x30b0
cmpq %r13, %r12
setb %cl
cmpl $0x2, %eax
jne 0x2a8c3
addl 0x28(%rsp), %ebp
cmpq %r13, %r12
jb 0x2a739
movq 0x48(%rsp), %rbx
testb %cl, %cl
je 0x2a8f0
movl 0x9120(%rsp), %eax
imull 0x9118(%rsp), %eax
incl %eax
imull %eax, %r12d
movslq %r12d, %rax
movq 0x20(%rsp), %rcx
movl $0xbf800000, (%rcx,%rax,4) # imm = 0xBF800000
movq %rbx, %rdi
callq 0x3140
movq 0x78(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x68(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
addq $0x90b8, %rsp           # imm = 0x90B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq