// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: get_segmentation_image2
image get_segmentation_image2(char *path, int w, int h, int classes)
{
    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);
    image mask = make_image(w, h, classes+1);
    int i;
    for(i = 0; i < w*h; ++i){
        mask.data[w*h*classes + i] = 1;
    }
    FILE *file = fopen(labelpath, "r");
    if(!file) file_error(labelpath);
    char buff[32788];
    int id;
    image part = make_image(w, h, 1);
    while(fscanf(file, "%d %s", &id, buff) == 2){
        int n = 0;
        int *rle = read_intlist(buff, &n, 0);
        load_rle(part, rle, n);
        or_image(part, mask, id);
        for(i = 0; i < w*h; ++i){
            if(part.data[i]) mask.data[w*h*classes + i] = 0;
        }
        free(rle);
    }
    //exclusive_image(mask);
    fclose(file);
    free_image(part);
    return mask;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90c0, %rsp           # imm = 0x90C0
movq %rdi, -0x9088(%rbp)
movq %rdi, -0x9090(%rbp)
movq %rsi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movl %r8d, -0x14(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x1020(%rbp), %rcx
leaq 0x3fc56(%rip), %rsi     # 0x7433f
leaq 0x3fc73(%rip), %rdx     # 0x74363
callq 0x4a50
leaq -0x1020(%rbp), %rdi
leaq -0x1020(%rbp), %rcx
leaq 0x3fc43(%rip), %rsi     # 0x7434d
leaq 0x3fc52(%rip), %rdx     # 0x74363
callq 0x4a50
leaq -0x1020(%rbp), %rdi
leaq -0x1020(%rbp), %rcx
leaq 0x3ea0e(%rip), %rsi     # 0x73139
leaq 0x41934(%rip), %rdx     # 0x76066
callq 0x4a50
leaq -0x1020(%rbp), %rdi
leaq -0x1020(%rbp), %rcx
leaq 0x3fc0c(%rip), %rsi     # 0x74358
leaq 0x41913(%rip), %rdx     # 0x76066
callq 0x4a50
leaq -0x1020(%rbp), %rdi
leaq -0x1020(%rbp), %rcx
leaq 0x3fbf0(%rip), %rsi     # 0x7435d
leaq 0x418f2(%rip), %rdx     # 0x76066
callq 0x4a50
movq -0x9088(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
callq 0xe3e0
movl $0x0, -0x1024(%rbp)
movl -0x1024(%rbp), %eax
movl -0xc(%rbp), %ecx
imull -0x10(%rbp), %ecx
cmpl %ecx, %eax
jge 0x347e9
movq -0x9088(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
imull -0x10(%rbp), %ecx
imull -0x14(%rbp), %ecx
addl -0x1024(%rbp), %ecx
movslq %ecx, %rcx
movss 0x3c839(%rip), %xmm0    # 0x7100c
movss %xmm0, (%rax,%rcx,4)
movl -0x1024(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1024(%rbp)
jmp 0x3479b
leaq -0x1020(%rbp), %rdi
leaq 0x41d76(%rip), %rsi     # 0x7656d
callq 0x3360
movq %rax, -0x1030(%rbp)
cmpq $0x0, -0x1030(%rbp)
jne 0x34819
leaq -0x1020(%rbp), %rdi
callq 0x4110
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
leaq -0x9070(%rbp), %rdi
movl $0x1, %ecx
callq 0xe3e0
movq -0x1030(%rbp), %rdi
leaq -0x9050(%rbp), %rcx
leaq 0x3fb23(%rip), %rsi     # 0x74368
leaq -0x9054(%rbp), %rdx
movb $0x0, %al
callq 0x3080
cmpl $0x2, %eax
jne 0x34985
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 -0x9088(%rbp), %rax
movl -0x9054(%rbp), %edi
leaq -0x9070(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rsp)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rsp)
movq (%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x20(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
callq 0x329c0
movl $0x0, -0x1024(%rbp)
movl -0x1024(%rbp), %eax
movl -0xc(%rbp), %ecx
imull -0x10(%rbp), %ecx
cmpl %ecx, %eax
jge 0x34974
movq -0x9060(%rbp), %rax
movslq -0x1024(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x3493a
jp 0x3493a
jmp 0x34961
movq -0x9088(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
imull -0x10(%rbp), %ecx
imull -0x14(%rbp), %ecx
addl -0x1024(%rbp), %ecx
movslq %ecx, %rcx
xorps %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
jmp 0x34963
movl -0x1024(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1024(%rbp)
jmp 0x3490a
movq -0x9080(%rbp), %rdi
callq 0x3030
jmp 0x34830
movq -0x1030(%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
movq -0x9090(%rbp), %rax
addq $0x90c0, %rsp           # imm = 0x90C0
popq %rbp
retq
nopw %cs:(%rax,%rax)