// File: /workspace/github_c_makefile_star2_O0/inflex[P]ripMIME/mime.c
// Function: MIME_generate_multiple_hardlink_filenames
int MIME_generate_multiple_hardlink_filenames(struct MIMEH_header_info *hinfo, char *unpackdir)
{
    char *name;
    char oldname[1024];

    if (glb.multiple_filenames == 0) return 0;

    //LOGGER_log("%s:%d:MIME_generate_multiple_hardlink_filenames:DEBUG: Generating hardlinks for %s",FL, hinfo->filename);
    snprintf(oldname,sizeof(oldname),"%s/%s",unpackdir, hinfo->filename);

    if (SS_count(&(hinfo->ss_names)) > 1){
        do {

            name = SS_pop(&(hinfo->ss_names));
            if (name != NULL)
            {
                char *np;
                char newname[1024];
                int rv;

                /** Strip off any leading path **/
                np = strrchr(name, '/');
                if (np) np++; else np = name;

                snprintf(newname,sizeof(newname),"%s/%s",unpackdir, np);
                //LOGGER_log("%s:%d:MIME_generate_multiple_hardlink_filenames:DEBUG: Linking %s->%s",FL,newname, oldname);
                rv = link(oldname, newname);
                if (rv == -1)
                {
                    if (errno != EEXIST)
                    {
                        LOGGER_log("%s:%d:MIME_generate_multiple_hardlink_filenames:WARNING: While trying to create '%s' link to '%s' (%s)",FL, newname, oldname,strerror(errno));
                    }

                } else {
                    if ((glb.filename_decoded_reporter != NULL)&&(MIME_VERBOSE))
                    {
                        glb.filename_decoded_reporter( name, (MIMEH_get_verbosity_contenttype()?hinfo->content_type_string:NULL));
                    }
                }
            }

        } while(name != NULL);
    }

    if (SS_count(&(hinfo->ss_filenames)) > 1) {
        do {

            name = SS_pop(&(hinfo->ss_filenames));
            if (name != NULL)
            {
                char newname[1024];
                int rv;

                snprintf(newname,sizeof(newname),"%s/%s",unpackdir, name);
                //LOGGER_log("%s:%d:MIME_generate_multiple_hardlink_filenames:DEBUG: Linking %s->%s",FL,newname, oldname);
                rv = link(oldname, newname);
                if (rv == -1)
                {
                    if (errno != EEXIST)
                    {
                        LOGGER_log("%s:%d:MIME_generate_multiple_hardlink_filenames:WARNING: While trying to create '%s' link to '%s' (%s)",FL, newname, oldname,strerror(errno));
                    }

                } else {
                    if ((glb.filename_decoded_reporter != NULL)&&(MIME_VERBOSE))
                    {
                        glb.filename_decoded_reporter( name, (MIMEH_get_verbosity_contenttype()?hinfo->content_type_string:NULL));
                    }
                }
            }

        } while(name != NULL);
    }

    return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xca0, %rsp            # imm = 0xCA0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpl $0x0, 0x2141e(%rip)     # 0x27f38
jne 0x6b28
movl $0x0, -0x4(%rbp)
jmp 0x6e4f
leaq -0x420(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %r8
addq $0x5efd, %r8            # imm = 0x5EFD
movl $0x400, %esi            # imm = 0x400
leaq 0x129b2(%rip), %rdx     # 0x194fc
movb $0x0, %al
callq 0x2130
movq -0x10(%rbp), %rdi
addq $0x162e0, %rdi          # imm = 0x162E0
callq 0x3ab0
cmpl $0x1, %eax
jle 0x6ced
jmp 0x6b6c
movq -0x10(%rbp), %rdi
addq $0x162e0, %rdi          # imm = 0x162E0
callq 0x39d0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x6cde
movq -0x20(%rbp), %rdi
movl $0x2f, %esi
callq 0x2140
movq %rax, -0x428(%rbp)
cmpq $0x0, -0x428(%rbp)
je 0x6bbe
movq -0x428(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x428(%rbp)
jmp 0x6bc9
movq -0x20(%rbp), %rax
movq %rax, -0x428(%rbp)
leaq -0x830(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq -0x428(%rbp), %r8
movl $0x400, %esi            # imm = 0x400
leaq 0x12915(%rip), %rdx     # 0x194fc
movb $0x0, %al
callq 0x2130
leaq -0x420(%rbp), %rdi
leaq -0x830(%rbp), %rsi
callq 0x2360
movl %eax, -0x834(%rbp)
cmpl $-0x1, -0x834(%rbp)
jne 0x6c6f
callq 0x2050
cmpl $0x11, (%rax)
je 0x6c6d
leaq -0x830(%rbp), %rax
movq %rax, -0xc58(%rbp)
leaq -0x420(%rbp), %rax
movq %rax, -0xc50(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x23a0
movq -0xc58(%rbp), %rcx
movq -0xc50(%rbp), %r8
movq %rax, %r9
leaq 0x13bd7(%rip), %rdi     # 0x1a831
leaq 0x1286e(%rip), %rsi     # 0x194cf
movl $0x879, %edx            # imm = 0x879
movb $0x0, %al
callq 0x117c0
jmp 0x6cdc
cmpq $0x0, 0x23ad1(%rip)     # 0x2a748
je 0x6cda
cmpl $0x0, 0x20a5c(%rip)     # 0x276dc
jle 0x6cda
movq 0x23abf(%rip), %rax     # 0x2a748
movq %rax, -0xc68(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xc60(%rbp)
callq 0xa500
cmpl $0x0, %eax
je 0x6cb8
movq -0x10(%rbp), %rax
addq $0x27fc, %rax           # imm = 0x27FC
movq %rax, -0xc70(%rbp)
jmp 0x6cc3
xorl %eax, %eax
movq %rax, -0xc70(%rbp)
jmp 0x6cc3
movq -0xc68(%rbp), %rax
movq -0xc60(%rbp), %rdi
movq -0xc70(%rbp), %rsi
callq *%rax
jmp 0x6cdc
jmp 0x6cde
jmp 0x6ce0
cmpq $0x0, -0x20(%rbp)
jne 0x6b6c
jmp 0x6ced
movq -0x10(%rbp), %rdi
addq $0x15ec8, %rdi          # imm = 0x15EC8
callq 0x3ab0
cmpl $0x1, %eax
jle 0x6e48
jmp 0x6d08
movq -0x10(%rbp), %rdi
addq $0x15ec8, %rdi          # imm = 0x15EC8
callq 0x39d0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x6e39
leaq -0xc40(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
movl $0x400, %esi            # imm = 0x400
leaq 0x127ba(%rip), %rdx     # 0x194fc
movb $0x0, %al
callq 0x2130
leaq -0x420(%rbp), %rdi
leaq -0xc40(%rbp), %rsi
callq 0x2360
movl %eax, -0xc44(%rbp)
cmpl $-0x1, -0xc44(%rbp)
jne 0x6dca
callq 0x2050
cmpl $0x11, (%rax)
je 0x6dc8
leaq -0xc40(%rbp), %rax
movq %rax, -0xc80(%rbp)
leaq -0x420(%rbp), %rax
movq %rax, -0xc78(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x23a0
movq -0xc80(%rbp), %rcx
movq -0xc78(%rbp), %r8
movq %rax, %r9
leaq 0x13a7c(%rip), %rdi     # 0x1a831
leaq 0x12713(%rip), %rsi     # 0x194cf
movl $0x897, %edx            # imm = 0x897
movb $0x0, %al
callq 0x117c0
jmp 0x6e37
cmpq $0x0, 0x23976(%rip)     # 0x2a748
je 0x6e35
cmpl $0x0, 0x20901(%rip)     # 0x276dc
jle 0x6e35
movq 0x23964(%rip), %rax     # 0x2a748
movq %rax, -0xc90(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xc88(%rbp)
callq 0xa500
cmpl $0x0, %eax
je 0x6e13
movq -0x10(%rbp), %rax
addq $0x27fc, %rax           # imm = 0x27FC
movq %rax, -0xc98(%rbp)
jmp 0x6e1e
xorl %eax, %eax
movq %rax, -0xc98(%rbp)
jmp 0x6e1e
movq -0xc90(%rbp), %rax
movq -0xc88(%rbp), %rdi
movq -0xc98(%rbp), %rsi
callq *%rax
jmp 0x6e37
jmp 0x6e39
jmp 0x6e3b
cmpq $0x0, -0x20(%rbp)
jne 0x6d08
jmp 0x6e48
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xca0, %rsp            # imm = 0xCA0
popq %rbp
retq
nopl (%rax,%rax)