// File: /workspace/github_cpp_makefile_star2_O2/rurban[P]dgnlib/cpl_path.cpp
// Function: CPLFormCIFilename
const char *CPLFormCIFilename( const char * pszPath,
                               const char * pszBasename,
                               const char * pszExtension )

{
#ifdef WIN32
    return CPLFormFilename( pszPath, pszBasename, pszExtension );
#else
    const char  *pszAddedExtSep = "";
    char        *pszFilename;
    const char  *pszFullPath;
    int         nLen = strlen(pszBasename)+2, i;
    FILE        *fp;

    if( pszExtension != NULL )
        nLen += strlen(pszExtension);

    pszFilename = (char *) CPLMalloc(nLen);

    if( pszExtension == NULL )
        pszExtension = "";
    else if( pszExtension[0] != '.' && strlen(pszExtension) > 0 )
        pszAddedExtSep = ".";

    sprintf( pszFilename, "%s%s%s", 
             pszBasename, pszAddedExtSep, pszExtension );

    pszFullPath = CPLFormFilename( pszPath, pszFilename, NULL );
    fp = VSIFOpen( pszFullPath, "r" );
    if( fp == NULL )
    {
        for( i = 0; pszFilename[i] != '\0'; i++ )
        {
            if( islower(pszFilename[i]) )
                pszFilename[i] = toupper(pszFilename[i]);
        }

        pszFullPath = CPLFormFilename( pszPath, pszFilename, NULL );
        fp = VSIFOpen( pszFullPath, "r" );
    }

    if( fp == NULL )
    {
        for( i = 0; pszFilename[i] != '\0'; i++ )
        {
            if( isupper(pszFilename[i]) )
                pszFilename[i] = tolower(pszFilename[i]);
        }

        pszFullPath = CPLFormFilename( pszPath, pszFilename, NULL );
        fp = VSIFOpen( pszFullPath, "r" );
    }

    if( fp != NULL )
        VSIFClose( fp );
    else
        pszFullPath = CPLFormFilename( pszPath, pszBasename, pszExtension );

    CPLFree( pszFilename );

    return pszFullPath;
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
movq %rsi, %rdi
callq 0x2120
movq %rax, %rbx
addl $0x2, %ebx
testq %r15, %r15
je 0x522a
movq %r15, %rdi
callq 0x2120
addl %eax, %ebx
movslq %ebx, %rdi
callq 0x2cb3
movq %rax, %rbx
leaq 0x9db0(%rip), %rcx      # 0xefec
testq %r15, %r15
je 0x525e
movb (%r15), %al
cmpb $0x2e, %al
je 0x5261
testb %al, %al
leaq 0x9d9b(%rip), %rax      # 0xefec
leaq 0xabe8(%rip), %rcx      # 0xfe40
cmoveq %rax, %rcx
jmp 0x5261
movq %rcx, %r15
leaq 0x940d(%rip), %rsi      # 0xe675
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %r8
xorl %eax, %eax
callq 0x20a0
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x5112
movq %rax, %r13
leaq 0xa404(%rip), %rsi      # 0xf693
movq %rax, %rdi
callq 0x6970
testq %rax, %rax
jne 0x5336
movq %rbx, %r13
movsbl (%r13), %ebp
testl %ebp, %ebp
je 0x52c7
movl %ebp, %edi
callq 0x23c0
testl %eax, %eax
je 0x52c2
movl %ebp, %edi
callq 0x2540
movb %al, (%r13)
incq %r13
jmp 0x52a3
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x5112
movq %rax, %r13
leaq 0xa3b5(%rip), %rsi      # 0xf693
movq %rax, %rdi
callq 0x6970
testq %rax, %rax
jne 0x5336
movq %rbx, %r13
movsbl (%r13), %ebp
testl %ebp, %ebp
je 0x5312
movl %ebp, %edi
callq 0x21f0
testl %eax, %eax
je 0x530d
movl %ebp, %edi
callq 0x2420
movb %al, (%r13)
incq %r13
jmp 0x52ee
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x5112
movq %rax, %r13
leaq 0xa36a(%rip), %rsi      # 0xf693
movq %rax, %rdi
callq 0x6970
testq %rax, %rax
je 0x5358
movq %rax, %rdi
callq 0x6975
movq %rbx, %rdi
callq 0x6a49
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5112
movq %rax, %r13
jmp 0x533e