// File: /workspace/github_c_makefile_star2_O0/inflex[P]ripMIME/filename-filters.c
// Function: FNFILTER_paranoid_filter
int FNFILTER_paranoid_filter( char *fname, int size )
{
    char tmp[1024];
    char *p;


    /* Scan for . and .. filenames
        ** 20040727-12H54
        ** Patch supplied by Marco Ariano
        ** Patch modified by Paul L Daniels
        **
    */
    if ((1 == size)&&('.' == *fname))
    {
        *fname = '_';
        return 0;
    } else if ((2 == size)&&(0 == strncmp(fname,"..",2))) {
        snprintf(fname,3,"__");
        return 0;
    }


    /* scan out any directory separators */

    p = strrchr(fname,'/');
    if (p)
    {
        // Check to see that this seperator isn't the -last- char in the string
        if (*(p+1) == '\0') *p = '\0';
        else
        {
            p++;
            PLD_strncpy(tmp,p,sizeof(tmp));
            PLD_strncpy(fname,tmp,size);
        }
    }
    else if ( (p = strrchr(fname,'\\')))
    {
        // Check to see that this seperator isn't the -last- char in the string
        if (*(p+1) == '\0') *p = '\0';
        else
        {
            p++;
            PLD_strncpy(tmp,p,sizeof(tmp));
            PLD_strncpy(fname,tmp,size);
        }
    }


    if ( glb.paranoid > 0 )
    {
        // If we're really paranoid, then we go along and convert anything we don't like
        //  the look of into 7-bit
        //
        //  These days we shouldn't be using this any more as there are many filenames
        //  which require > 7-bit charsets.

        while (*fname)
        {
            if( !isalnum((int)*fname) && (*fname != '.') ) *fname='_';
            if( (*fname < ' ')||(*fname > '~') ) *fname='_';
            fname++;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x430, %rsp            # imm = 0x430
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x1, %eax
cmpl -0x14(%rbp), %eax
jne 0x1430f
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
movl $0x2e, %eax
cmpl %ecx, %eax
jne 0x1430f
movq -0x10(%rbp), %rax
movb $0x5f, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x144ca
movl $0x2, %eax
cmpl -0x14(%rbp), %eax
jne 0x14359
movq -0x10(%rbp), %rdi
leaq 0x6af8(%rip), %rsi      # 0x1ae1c
movl $0x2, %edx
callq 0x2090
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x14359
movq -0x10(%rbp), %rdi
movl $0x3, %esi
leaq 0xb70c(%rip), %rdx      # 0x1fa52
movb $0x0, %al
callq 0x2130
movl $0x0, -0x4(%rbp)
jmp 0x144ca
jmp 0x1435b
movq -0x10(%rbp), %rdi
movl $0x2f, %esi
callq 0x2140
movq %rax, -0x428(%rbp)
cmpq $0x0, -0x428(%rbp)
je 0x143d6
movq -0x428(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x14396
movq -0x428(%rbp), %rax
movb $0x0, (%rax)
jmp 0x143d4
movq -0x428(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x428(%rbp)
leaq -0x420(%rbp), %rdi
movq -0x428(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x10640
movq -0x10(%rbp), %rdi
leaq -0x420(%rbp), %rsi
movslq -0x14(%rbp), %rdx
callq 0x10640
jmp 0x1444f
movq -0x10(%rbp), %rdi
movl $0x5c, %esi
callq 0x2140
movq %rax, -0x428(%rbp)
cmpq $0x0, %rax
je 0x1444d
movq -0x428(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x1440d
movq -0x428(%rbp), %rax
movb $0x0, (%rax)
jmp 0x1444b
movq -0x428(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x428(%rbp)
leaq -0x420(%rbp), %rdi
movq -0x428(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x10640
movq -0x10(%rbp), %rdi
leaq -0x420(%rbp), %rsi
movslq -0x14(%rbp), %rdx
callq 0x10640
jmp 0x1444d
jmp 0x1444f
cmpl $0x0, 0x21946(%rip)     # 0x35d9c
jle 0x144c3
jmp 0x1445a
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x144c1
callq 0x23c0
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x14494
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
je 0x14494
movq -0x10(%rbp), %rax
movb $0x5f, (%rax)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jl 0x144ac
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x7e, %eax
jle 0x144b3
movq -0x10(%rbp), %rax
movb $0x5f, (%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x1445a
jmp 0x144c3
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x430, %rsp            # imm = 0x430
popq %rbp
retq
nopw %cs:(%rax,%rax)