// File: /workspace/github_cpp_makefile_star2_O3/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, %r12
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0x2120
movq %rax, %rbx
addl $0x2, %ebx
testq %r12, %r12
je 0x5533
movq %r12, %rdi
callq 0x2120
addl %eax, %ebx
movslq %ebx, %rdi
callq 0x2d6b
movq %rax, %rbx
movb (%r12), %al
cmpb $0x2e, %al
jne 0x554a
leaq 0xaabb(%rip), %rcx      # 0xffec
jmp 0x555e
movslq %ebx, %rdi
callq 0x2d6b
movq %rax, %rbx
leaq 0xaaa7(%rip), %rcx      # 0xffec
movq %rcx, %r12
jmp 0x555e
testb %al, %al
leaq 0xaa99(%rip), %rax      # 0xffec
leaq 0xb8d6(%rip), %rcx      # 0x10e30
cmoveq %rax, %rcx
leaq 0xa110(%rip), %rsi      # 0xf675
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %r8
xorl %eax, %eax
callq 0x20a0
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x53ff
movq %rax, %r13
leaq 0xb107(%rip), %rsi      # 0x10693
movq %rax, %rdi
callq 0x6e04
testq %rax, %rax
jne 0x5641
movb (%rbx), %al
testb %al, %al
je 0x55cb
leaq 0x1(%rbx), %r13
movsbl %al, %ebp
movl %ebp, %edi
callq 0x23c0
testl %eax, %eax
je 0x55c0
movl %ebp, %edi
callq 0x2540
movb %al, -0x1(%r13)
movb (%r13), %al
incq %r13
testb %al, %al
jne 0x55a7
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x53ff
movq %rax, %r13
leaq 0xb0b1(%rip), %rsi      # 0x10693
movq %rax, %rdi
callq 0x6e04
testq %rax, %rax
jne 0x5641
movb (%rbx), %al
testb %al, %al
je 0x561d
leaq 0x1(%rbx), %r13
movsbl %al, %ebp
movl %ebp, %edi
callq 0x21f0
testl %eax, %eax
je 0x5612
movl %ebp, %edi
callq 0x2420
movb %al, -0x1(%r13)
movb (%r13), %al
incq %r13
testb %al, %al
jne 0x55f9
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x53ff
movq %rax, %r13
leaq 0xb05f(%rip), %rsi      # 0x10693
movq %rax, %rdi
callq 0x6e04
testq %rax, %rax
je 0x5663
movq %rax, %rdi
callq 0x6e09
movq %rbx, %rdi
callq 0x6edd
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x53ff
movq %rax, %r13
jmp 0x5649