// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x9068, %rsp           # imm = 0x9068
movl %r8d, %r15d
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x310f3(%rip), %rsi     # 0x4f99f
leaq 0x31110(%rip), %r13     # 0x4f9c3
leaq 0x50(%rsp), %r12
movq %rax, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0x42ea
leaq 0x310e0(%rip), %rsi     # 0x4f9ad
movq %r12, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0x42ea
leaq 0x2fe6a(%rip), %rsi     # 0x4e74c
leaq 0x32ee0(%rip), %r13     # 0x517c9
movq %r12, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0x42ea
leaq 0x310ba(%rip), %rsi     # 0x4f9b8
movq %r12, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0x42ea
leaq 0x310aa(%rip), %rsi     # 0x4f9bd
movq %r12, %rdi
movq %r13, %rdx
movl %ebp, %r13d
movq %r12, %rcx
callq 0x42ea
leal 0x1(%r15), %ecx
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0xb45a
imull %r14d, %ebp
imull %ebp, %r15d
xorl %eax, %eax
testl %ebp, %ebp
cmovlel %eax, %ebp
movslq %r15d, %r12
shlq $0x2, %r12
movq 0x10(%rbx), %rcx
addq %r12, %rcx
cmpq %rax, %rbp
je 0x1e963
movl $0x3f800000, (%rcx,%rax,4) # imm = 0x3F800000
incq %rax
jmp 0x1e952
leaq 0x3337f(%rip), %rsi     # 0x51ce9
leaq 0x50(%rsp), %rdi
callq 0x3390
movq %rax, %r15
testq %rax, %rax
jne 0x1e986
leaq 0x50(%rsp), %rdi
callq 0x3d0f
leaq 0x38(%rsp), %rdi
pushq $0x1
popq %rcx
movl %r14d, %esi
movl %r13d, %edx
callq 0xb45a
leaq 0x1050(%rsp), %r13
movq %r15, %rdi
leaq 0x3101d(%rip), %rsi     # 0x4f9c8
leaq 0x34(%rsp), %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x30a0
cmpl $0x2, %eax
jne 0x1ea5e
andl $0x0, 0x30(%rsp)
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
xorl %edx, %edx
callq 0x3bfb
movq %rax, %r14
movl 0x30(%rsp), %esi
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0x1d445
movl 0x34(%rsp), %edi
movq 0x10(%rbx), %rax
movq %rax, 0x28(%rsp)
movups (%rbx), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x1d4d1
movq 0x48(%rsp), %rax
movq 0x10(%rbx), %rcx
addq %r12, %rcx
xorl %edx, %edx
xorps %xmm1, %xmm1
cmpq %rdx, %rbp
je 0x1ea51
movss (%rax,%rdx,4), %xmm0
ucomiss %xmm1, %xmm0
jne 0x1ea48
jnp 0x1ea4c
andl $0x0, (%rcx,%rdx,4)
incq %rdx
jmp 0x1ea37
movq %r14, %rdi
callq 0x3040
jmp 0x1e9a1
movq %r15, %rdi
callq 0x3130
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xba88
movq %rbx, %rax
addq $0x9068, %rsp           # imm = 0x9068
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq