// File: /workspace/github_cpp_makefile_star2_O1/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, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %rdi
callq 0x2120
movq %rax, %r12
addl $0x2, %r12d
testq %r14, %r14
je 0x55d0
movq %r14, %rdi
callq 0x2120
addl %eax, %r12d
movslq %r12d, %rdi
callq 0x2d9b
movq %rax, %r12
leaq 0xb9d2(%rip), %rcx      # 0x10fb4
testq %r14, %r14
je 0x5604
movb (%r14), %al
cmpb $0x2e, %al
je 0x5607
testb %al, %al
leaq 0xb9bd(%rip), %rax      # 0x10fb4
leaq 0xc772(%rip), %rcx      # 0x11d70
cmoveq %rax, %rcx
jmp 0x5607
movq %rcx, %r14
leaq 0xb047(%rip), %rsi      # 0x10655
movq %r12, %rdi
movq %rbx, %rdx
movq %r14, %r8
xorl %eax, %eax
callq 0x20a0
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x54b6
movq %rax, %r13
leaq 0xa9d6(%rip), %rsi      # 0x1000b
movq %rax, %rdi
callq 0x6f44
testq %rax, %rax
jne 0x5692
movb (%r12), %al
testb %al, %al
je 0x5673
leaq 0x1(%r12), %r13
movsbl %al, %ebp
movl %ebp, %edi
callq 0x23d0
testl %eax, %eax
je 0x5668
movl %ebp, %edi
callq 0x2550
movb %al, -0x1(%r13)
movb (%r13), %al
incq %r13
testb %al, %al
jne 0x564f
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x54b6
movq %rax, %r13
leaq 0xa981(%rip), %rsi      # 0x1000b
movq %rax, %rdi
callq 0x6f44
testq %rax, %rax
jne 0x56e8
movb (%r12), %al
testb %al, %al
je 0x56c9
movq %r12, %r13
incq %r13
movsbl %al, %ebp
movl %ebp, %edi
callq 0x2200
testl %eax, %eax
je 0x56be
movl %ebp, %edi
callq 0x2430
movb %al, -0x1(%r13)
movb (%r13), %al
incq %r13
testb %al, %al
jne 0x56a5
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x54b6
movq %rax, %r13
leaq 0xa92b(%rip), %rsi      # 0x1000b
movq %rax, %rdi
callq 0x6f44
testq %rax, %rax
je 0x56f7
movq %rax, %rdi
callq 0x6f49
jmp 0x5708
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x54b6
movq %rax, %r13
movq %r12, %rdi
callq 0x701d
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq