// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x90e0, %rsp           # imm = 0x90E0
movl 0x40(%rbp), %eax
movl 0x38(%rbp), %eax
movl 0x30(%rbp), %eax
leaq 0x10(%rbp), %rax
movq %rax, -0x90c0(%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 0x41698(%rip), %rsi     # 0x7433f
leaq 0x416b5(%rip), %rdx     # 0x74363
callq 0x4a50
leaq -0x1030(%rbp), %rdi
leaq -0x1030(%rbp), %rcx
leaq 0x41685(%rip), %rsi     # 0x7434d
leaq 0x41694(%rip), %rdx     # 0x74363
callq 0x4a50
leaq -0x1030(%rbp), %rdi
leaq -0x1030(%rbp), %rcx
leaq 0x40450(%rip), %rsi     # 0x73139
leaq 0x43376(%rip), %rdx     # 0x76066
callq 0x4a50
leaq -0x1030(%rbp), %rdi
leaq -0x1030(%rbp), %rcx
leaq 0x4164e(%rip), %rsi     # 0x74358
leaq 0x43355(%rip), %rdx     # 0x76066
callq 0x4a50
leaq -0x1030(%rbp), %rdi
leaq -0x1030(%rbp), %rcx
leaq 0x41632(%rip), %rsi     # 0x7435d
leaq 0x43334(%rip), %rdx     # 0x76066
callq 0x4a50
leaq -0x1030(%rbp), %rdi
leaq 0x43828(%rip), %rsi     # 0x7656d
callq 0x3360
movq %rax, -0x1038(%rbp)
cmpq $0x0, -0x1038(%rbp)
jne 0x32d67
leaq -0x1030(%rbp), %rdi
callq 0x4110
movl $0x0, -0x9058(%rbp)
movl -0x20(%rbp), %esi
movl -0x24(%rbp), %edx
leaq -0x9078(%rbp), %rdi
movl $0x1, %ecx
callq 0xe3e0
movq -0x1038(%rbp), %rdi
leaq -0x9050(%rbp), %rcx
leaq 0x415cb(%rip), %rsi     # 0x74368
leaq -0x9054(%rbp), %rdx
movb $0x0, %al
callq 0x3080
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x2, %ecx
movb %al, -0x90c1(%rbp)
jne 0x32dcc
movl -0x9058(%rbp), %eax
cmpl -0xc(%rbp), %eax
setl %al
movb %al, -0x90c1(%rbp)
movb -0x90c1(%rbp), %al
testb $0x1, %al
jne 0x32ddb
jmp 0x32fd9
movl $0x0, -0x907c(%rbp)
leaq -0x9050(%rbp), %rdi
leaq -0x907c(%rbp), %rsi
xorl %edx, %edx
callq 0x3f60
movq %rax, -0x9088(%rbp)
movq -0x9088(%rbp), %rdi
movl -0x907c(%rbp), %esi
leaq -0x9078(%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 -0x90c0(%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 -0x90a0(%rbp), %rdi
leaq -0x9078(%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 0x32eaf
leaq -0x90a0(%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
movl 0x38(%rbp), %esi
movl 0x40(%rbp), %edx
leaq -0x90b8(%rbp), %rdi
leaq -0x90a0(%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
cvtsi2ssl -0x9054(%rbp), %xmm0
movq -0x18(%rbp), %rax
movl -0x9058(%rbp), %ecx
movl 0x38(%rbp), %edx
imull 0x40(%rbp), %edx
addl $0x1, %edx
imull %edx, %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
movl $0x0, -0x905c(%rbp)
movl -0x905c(%rbp), %eax
movl 0x38(%rbp), %ecx
imull 0x40(%rbp), %ecx
cmpl %ecx, %eax
jge 0x32f6f
movq -0x90a8(%rbp), %rax
movslq -0x905c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x18(%rbp), %rax
movl -0x9058(%rbp), %ecx
movl 0x38(%rbp), %edx
imull 0x40(%rbp), %edx
addl $0x1, %edx
imull %edx, %ecx
addl $0x1, %ecx
addl -0x905c(%rbp), %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x905c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x905c(%rbp)
jmp 0x32f12
movl -0x9058(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9058(%rbp)
leaq -0x90b8(%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 -0x90a0(%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 -0x9088(%rbp), %rdi
callq 0x3030
jmp 0x32d88
movl -0x9058(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x3300b
movq -0x18(%rbp), %rax
movl -0x9058(%rbp), %ecx
movl 0x38(%rbp), %edx
imull 0x40(%rbp), %edx
addl $0x1, %edx
imull %edx, %ecx
movslq %ecx, %rcx
movss 0x410d6(%rip), %xmm0    # 0x740dc
movss %xmm0, (%rax,%rcx,4)
movq -0x1038(%rbp), %rdi
callq 0x3100
leaq -0x9078(%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 $0x90e0, %rsp           # imm = 0x90E0
popq %rbp
retq
nopw %cs:(%rax,%rax)