// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: get_segmentation_image
image get_segmentation_image(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);
    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);
        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 $0x9058, %rsp           # imm = 0x9058
movl %r8d, %r14d
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x2b1f2(%rip), %rsi     # 0x5694f
leaq 0x2b20f(%rip), %r13     # 0x56973
leaq 0x40(%rsp), %r12
movq %rax, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0xe842
leaq 0x2b1df(%rip), %rsi     # 0x5695d
movq %r12, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0xe842
leaq 0x29fc1(%rip), %rsi     # 0x55754
leaq 0x2d01f(%rip), %r13     # 0x587b9
movq %r12, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0xe842
leaq 0x2b1b9(%rip), %rsi     # 0x56968
movq %r12, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0xe842
leaq 0x2b1a9(%rip), %rsi     # 0x5696d
movq %r12, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0xe842
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl %r14d, %ecx
callq 0x1529e
leaq 0x2d4e8(%rip), %rsi     # 0x58cd1
movq %r12, %rdi
callq 0x33a0
movq %rax, %r14
testq %rax, %rax
jne 0x2b803
leaq 0x40(%rsp), %rdi
callq 0xe142
leaq 0x28(%rsp), %rdi
movl %r15d, %esi
movl %ebp, %edx
movl $0x1, %ecx
callq 0x1529e
leaq 0x2b15a(%rip), %rsi     # 0x56978
leaq 0x24(%rsp), %rdx
leaq 0x1040(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x30b0
cmpl $0x2, %eax
jne 0x2b8f9
leaq 0x1040(%rsp), %r15
leaq 0x2b12b(%rip), %r13     # 0x56978
leaq 0x24(%rsp), %rbp
movl $0x0, 0x20(%rsp)
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
xorl %edx, %edx
callq 0xe017
movq %rax, %r12
movl 0x20(%rsp), %esi
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
callq 0x2a37e
movl 0x2c(%rsp), %edx
imull 0x28(%rsp), %edx
testl %edx, %edx
xorps %xmm1, %xmm1
jle 0x2b8d5
movq 0x38(%rsp), %rax
movl (%rbx), %ecx
imull 0x4(%rbx), %ecx
imull 0x24(%rsp), %ecx
movslq %ecx, %rcx
movl %edx, %edx
shlq $0x2, %rcx
addq 0x10(%rbx), %rcx
xorl %esi, %esi
movss (%rax,%rsi,4), %xmm0
ucomiss %xmm1, %xmm0
jne 0x2b8c6
jnp 0x2b8cd
movl $0x3f800000, (%rcx,%rsi,4) # imm = 0x3F800000
incq %rsi
cmpq %rsi, %rdx
jne 0x2b8ba
movq %r12, %rdi
callq 0x3040
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x30b0
cmpl $0x2, %eax
je 0x2b852
movq %r14, %rdi
callq 0x3140
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
movq %rbx, %rax
addq $0x9058, %rsp           # imm = 0x9058
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq