LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLScanPointer
void *CPLScanPointer( const char *pszString, int nMaxLength )
{
    void  *pResult;
    char  szTemp[128];

/* -------------------------------------------------------------------- */
/*      Compute string into local buffer, and terminate it.             */
/* -------------------------------------------------------------------- */
    if( nMaxLength > (int) sizeof(szTemp)-1 )
        nMaxLength = sizeof(szTemp)-1;

    strncpy( szTemp, pszString, nMaxLength );
    szTemp[nMaxLength] = '\0';

/* -------------------------------------------------------------------- */
/*      On MSVC we have to scanf pointer values without the 0x          */
/*      prefix.                                                         */
/* -------------------------------------------------------------------- */
    if( EQUALN(szTemp,"0x",2) )
    {
        pResult = NULL;

#if defined(WIN32) && defined(_MSC_VER)
        sscanf( szTemp+2, "%p", &pResult );
#else
        sscanf( szTemp, "%p", &pResult );
#endif
    }
    
    else
    {
        pResult = (void *) CPLScanUIntBig( szTemp, nMaxLength );
    }

    return pResult;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rax
cmpl $0x7f, %esi
movl $0x7f, %ebx
cmovll %esi, %ebx
movslq %ebx, %r14
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x2150
movb $0x0, 0x10(%rsp,%r14)
leaq 0xd096(%rip), %rsi      # 0x104f0
movl $0x2, %edx
movq %r15, %rdi
callq 0x23b0
testl %eax, %eax
je 0x3479
leaq 0x10(%rsp), %rdi
movl %ebx, %esi
callq 0x33d3
jmp 0x349e
leaq 0x8(%rsp), %rbx
movq $0x0, (%rbx)
leaq 0xbf6b(%rip), %rsi      # 0xf3f7
leaq 0x10(%rsp), %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x22c0
movq (%rbx), %rax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLPrintString
int CPLPrintString( char *pszDest, const char *pszSrc, int nMaxLen )
{
    char    *pszTemp = pszDest;
    int     nChars = 0;

    if ( !pszDest )
        return 0;

    if ( !pszSrc )
    {
        *pszDest = '\0';
        return 1;
    }

    while ( nChars < nMaxLen && *pszSrc )
    {
        *pszTemp++ = *pszSrc++;
        nChars++;
    }

    return nChars;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x354b
testq %rsi, %rsi
je 0x354c
testl %edx, %edx
jle 0x354b
movl %edx, %eax
xorl %ecx, %ecx
movb (%rsi,%rcx), %dl
testb %dl, %dl
je 0x3555
movb %dl, (%rdi,%rcx)
incq %rcx
cmpl %ecx, %eax
jne 0x353a
retq
movb $0x0, (%rdi)
movl $0x1, %eax
retq
movl %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLPrintStringFill
int CPLPrintStringFill( char *pszDest, const char *pszSrc, int nMaxLen )
{
    char    *pszTemp = pszDest;

    if ( !pszDest )
        return 0;

    if ( !pszSrc )
    {
        memset( pszDest, ' ', nMaxLen );
        return nMaxLen;
    }

    while ( nMaxLen && *pszSrc )
    {
        *pszTemp++ = *pszSrc++;
        nMaxLen--;
    }

    if ( nMaxLen )
        memset( pszTemp, ' ', nMaxLen );

    return nMaxLen;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x35b9
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
testq %rsi, %rsi
je 0x358b
testl %ebx, %ebx
je 0x35b2
movl %ebx, %eax
xorl %r14d, %r14d
movb (%rsi,%r14), %cl
testb %cl, %cl
je 0x359a
movb %cl, (%rdi,%r14)
incq %r14
cmpl %r14d, %eax
jne 0x3573
xorl %eax, %eax
jmp 0x35b2
movslq %ebx, %rdx
movl $0x20, %esi
callq 0x2160
jmp 0x35b0
addq %r14, %rdi
movslq %ebx, %rdx
subq %r14, %rdx
movl $0x20, %esi
callq 0x2160
subl %r14d, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLPrintInt32
int CPLPrintInt32( char *pszBuffer, GInt32 iValue, int nMaxLen )
{
    char    szTemp[64];

    if ( !pszBuffer )
        return 0;

    if ( nMaxLen >= 64 )
        nMaxLen = 63;

#if UINT_MAX == 65535
    sprintf( szTemp, "%*ld", nMaxLen, iValue );
#else
    sprintf( szTemp, "%*d", nMaxLen, iValue );
#endif

    return CPLPrintString( pszBuffer, szTemp, nMaxLen );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
testq %rdi, %rdi
je 0x3623
movl %edx, %r15d
movl %esi, %ecx
movq %rdi, %rbx
cmpl $0x3f, %edx
movl $0x3f, %ebp
cmovll %edx, %ebp
leaq 0xbe09(%rip), %rsi      # 0xf3ec
xorl %r14d, %r14d
movq %rsp, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x20a0
testl %r15d, %r15d
jle 0x3626
movslq %r15d, %rcx
cmpq $0x3f, %rcx
movl $0x3f, %eax
cmovlq %rcx, %rax
xorl %r14d, %r14d
movb (%rsp,%r14), %cl
testb %cl, %cl
je 0x3626
movb %cl, (%rbx,%r14)
incq %r14
cmpl %r14d, %eax
jne 0x360a
movl %ebp, %r14d
jmp 0x3626
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLPrintUIntBig
int CPLPrintUIntBig( char *pszBuffer, GUIntBig iValue, int nMaxLen )
{
    char    szTemp[64];

    if ( !pszBuffer )
        return 0;

    if ( nMaxLen >= 64 )
        nMaxLen = 63;

#if defined(WIN32) && defined(_MSC_VER)
    sprintf( szTemp, "%*I64d", nMaxLen, iValue );
# elif HAVE_LONG_LONG
    sprintf( szTemp, "%*lld", nMaxLen, (long long) iValue );
//    sprintf( szTemp, "%*Ld", nMaxLen, (long long) iValue );
#else
    sprintf( szTemp, "%*ld", nMaxLen, iValue );
#endif

    return CPLPrintString( pszBuffer, szTemp, nMaxLen );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
testq %rdi, %rdi
je 0x369e
movl %edx, %r15d
movq %rsi, %rcx
movq %rdi, %rbx
cmpl $0x3f, %edx
movl $0x3f, %ebp
cmovll %edx, %ebp
leaq 0xbd92(%rip), %rsi      # 0xf3f0
xorl %r14d, %r14d
movq %rsp, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x20a0
testl %r15d, %r15d
jle 0x36a1
movslq %r15d, %rcx
cmpq $0x3f, %rcx
movl $0x3f, %eax
cmovlq %rcx, %rax
xorl %r14d, %r14d
movb (%rsp,%r14), %cl
testb %cl, %cl
je 0x36a1
movb %cl, (%rbx,%r14)
incq %r14
cmpl %r14d, %eax
jne 0x3685
movl %ebp, %r14d
jmp 0x36a1
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLPrintPointer
int CPLPrintPointer( char *pszBuffer, void *pValue, int nMaxLen )
{
    char    szTemp[64];

    if ( !pszBuffer )
        return 0;

    if ( nMaxLen >= 64 )
        nMaxLen = 63;

    sprintf( szTemp, "%p", pValue );

    // On windows, and possibly some other platforms the sprintf("%p")
    // does not prefix things with 0x so it is hard to know later if the
    // value is hex encoded.  Fix this up here. 

    if( !EQUALN(szTemp,"0x",2) )
        sprintf( szTemp, "0x%p", pValue );

    return CPLPrintString( pszBuffer, szTemp, nMaxLen );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
testq %rdi, %rdi
je 0x3751
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
cmpl $0x3f, %edx
movl $0x3f, %r13d
cmovll %edx, %r13d
leaq 0xbd15(%rip), %rsi      # 0xf3f7
xorl %r14d, %r14d
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x20a0
leaq 0xcdf4(%rip), %rsi      # 0x104f0
movl $0x2, %edx
movq %r12, %rdi
callq 0x23b0
testl %eax, %eax
je 0x3721
leaq 0xbce1(%rip), %rsi      # 0xf3f5
movq %rsp, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x20a0
testl %ebp, %ebp
jle 0x3754
movslq %ebp, %rcx
cmpq $0x3f, %rcx
movl $0x3f, %eax
cmovlq %rcx, %rax
xorl %r14d, %r14d
movb (%rsp,%r14), %cl
testb %cl, %cl
je 0x3754
movb %cl, (%rbx,%r14)
incq %r14
cmpl %r14d, %eax
jne 0x3738
movl %r13d, %r14d
jmp 0x3754
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLPrintTime
int CPLPrintTime( char *pszBuffer, int nMaxLen, const char *pszFormat,
                  const struct tm *poBrokenTime, char *pszLocale )
{
    char    *pszTemp = (char *)CPLMalloc( (nMaxLen + 1) * sizeof(char) );
    int     nChars;

#if defined(HAVE_LOCALE_H) && defined(HAVE_SETLOCALE)
    char        *pszCurLocale = NULL;

    if ( pszLocale || EQUAL( pszLocale, "" ) )
    {
        // Save the current locale
        pszCurLocale = setlocale(LC_ALL, NULL );
        // Set locale to the specified value
        setlocale( LC_ALL, pszLocale );
    }
#endif
    
    if ( !strftime( pszTemp, nMaxLen + 1, pszFormat, poBrokenTime ) )
        memset( pszTemp, 0, nMaxLen + 1);

#if defined(HAVE_LOCALE_H) && defined(HAVE_SETLOCALE)
    // Restore stored locale back
    if ( pszCurLocale )
        setlocale( LC_ALL, pszCurLocale );
#endif

    nChars = CPLPrintString( pszBuffer, pszTemp, nMaxLen );

    CPLFree( pszTemp );

    return nChars;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r13
movq %rdx, %rbp
movl %esi, %r12d
movq %rdi, %r14
leal 0x1(%r12), %eax
movslq %eax, %r15
movq %r15, %rdi
callq 0x2d6b
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
callq 0x2220
testq %rax, %rax
jne 0x381d
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2160
xorl %r15d, %r15d
testq %r14, %r14
je 0x3858
testq %rbx, %rbx
je 0x3849
testl %r12d, %r12d
jle 0x3858
movl %r12d, %r15d
xorl %eax, %eax
movb (%rbx,%rax), %cl
testb %cl, %cl
je 0x3855
movb %cl, (%r14,%rax)
incq %rax
cmpl %eax, %r15d
jne 0x3834
jmp 0x3858
movb $0x0, (%r14)
movl $0x1, %r15d
jmp 0x3858
movl %eax, %r15d
movq %rbx, %rdi
callq 0x6edd
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLGetConfigOption
const char * CPL_STDCALL
CPLGetConfigOption( const char *pszKey, const char *pszDefault )

{
    const char *pszResult = NULL;

    {
        CPLMutexHolderD( &hConfigMutex );

        pszResult = CSLFetchNameValue( (char **) papszConfigOptions, pszKey );
    }

#if !defined(WIN32CE) 
    if( pszResult == NULL )
        pszResult = getenv( pszKey );
#endif
    
    if( pszResult == NULL )
        return pszDefault;
    else
        return pszResult;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x11a70(%rip), %rsi     # 0x152f8
leaq 0xbb6b(%rip), %rdx      # 0xf3fa
leaq 0x8(%rsp), %rdi
movsd 0xb974(%rip), %xmm0     # 0xf210
movl $0x5b3, %ecx            # imm = 0x5B3
callq 0x4ecc
movq 0x11a53(%rip), %rdi     # 0x15300
movq %r14, %rsi
callq 0x64e9
movq %rax, %r15
leaq 0x8(%rsp), %rdi
callq 0x4ece
testq %r15, %r15
jne 0x38d2
movq %r14, %rdi
callq 0x2380
movq %rax, %r15
testq %r15, %r15
cmovneq %r15, %rbx
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4ece
movq %rbx, %rdi
callq 0x2500
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLStat
int CPLStat( const char *pszPath, VSIStatBuf *psStatBuf )

{
    if( strlen(pszPath) == 2 && pszPath[1] == ':' )
    {
        char    szAltPath[10];
        
        strncpy( szAltPath, pszPath, 10 );
        strcat( szAltPath, "\\" );
        return VSIStat( szAltPath, psStatBuf );
    }
    else
        return VSIStat( pszPath, psStatBuf );
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2120
cmpq $0x2, %rax
jne 0x3a27
cmpb $0x3a, 0x1(%r14)
jne 0x3a27
leaq 0x6(%rsp), %r15
movl $0xa, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x2150
movq %r15, %rdi
callq 0x2120
movw $0x5c, 0x6(%rsp,%rax)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6eec
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x6eec
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLDecToDMS
const char *CPLDecToDMS( double dfAngle, const char * pszAxis,
                         int nPrecision )

{
    int         nDegrees, nMinutes;
    double      dfSeconds, dfABSAngle, dfEpsilon;
    char        szFormat[30];
    static CPL_THREADLOCAL char szBuffer[50];
    const char  *pszHemisphere;
    
    dfEpsilon = (0.5/3600.0) * pow(0.1,nPrecision);

    dfABSAngle = ABS(dfAngle) + dfEpsilon;

    nDegrees = (int) dfABSAngle;
    nMinutes = (int) ((dfABSAngle - nDegrees) * 60);
    dfSeconds = dfABSAngle * 3600 - nDegrees*3600 - nMinutes*60;

    if( dfSeconds > dfEpsilon * 3600.0 )
        dfSeconds -= dfEpsilon * 3600.0;

    if( EQUAL(pszAxis,"Long") && dfAngle < 0.0 )
        pszHemisphere = "W";
    else if( EQUAL(pszAxis,"Long") )
        pszHemisphere = "E";
    else if( dfAngle < 0.0 )
        pszHemisphere = "S";
    else
        pszHemisphere = "N";

    sprintf( szFormat, "%%3dd%%2d\'%%.%df\"%s", nPrecision, pszHemisphere );
    sprintf( szBuffer, szFormat, nDegrees, nMinutes, dfSeconds );

    return( szBuffer );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %esi, %ebx
movq %rdi, %r15
movaps %xmm0, 0x10(%rsp)
cvtsi2sd %esi, %xmm1
movsd 0xb59e(%rip), %xmm0     # 0xf220
callq 0x24f0
mulsd 0xb599(%rip), %xmm0     # 0xf228
movapd %xmm0, (%rsp)
movapd 0xb5b4(%rip), %xmm2     # 0xf250
movapd 0x10(%rsp), %xmm1
xorpd %xmm1, %xmm2
movapd %xmm2, 0x30(%rsp)
maxsd %xmm1, %xmm2
addsd %xmm0, %xmm2
movapd %xmm2, 0x20(%rsp)
cvttsd2si %xmm2, %ebp
cvttpd2dq %xmm2, %xmm0
cvtdq2pd %xmm0, %xmm0
movapd %xmm2, %xmm1
subsd %xmm0, %xmm1
mulsd 0xb55a(%rip), %xmm1     # 0xf230
cvttsd2si %xmm1, %r14d
imull $0xe10, %ebp, %r12d     # imm = 0xE10
imull $0x3c, %r14d, %r13d
leaq 0xb71a(%rip), %rsi      # 0xf407
movq %r15, %rdi
callq 0x22e0
movapd 0x30(%rsp), %xmm0
ucomisd 0x10(%rsp), %xmm0
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
movsd 0xb527(%rip), %xmm1     # 0xf238
movapd 0x20(%rsp), %xmm3
mulsd %xmm1, %xmm3
subsd %xmm0, %xmm3
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
subsd %xmm0, %xmm3
movapd (%rsp), %xmm2
mulsd %xmm1, %xmm2
movapd %xmm3, %xmm0
subsd %xmm2, %xmm0
cmpltsd %xmm3, %xmm2
andpd %xmm2, %xmm0
andnpd %xmm3, %xmm2
leaq 0xbfc5(%rip), %rcx      # 0xfd15
leaq 0xbfb2(%rip), %rdx      # 0xfd09
cmovaq %rcx, %rdx
leaq 0xbfc2(%rip), %rsi      # 0xfd24
leaq 0xbf8b(%rip), %rcx      # 0xfcf4
cmovaq %rsi, %rcx
orpd %xmm0, %xmm2
movapd %xmm2, (%rsp)
testl %eax, %eax
cmovneq %rdx, %rcx
leaq 0xb689(%rip), %rsi      # 0xf40c
leaq 0x40(%rsp), %r15
movq %r15, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x20a0
leaq 0x11575(%rip), %rbx     # 0x15310
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %r14d, %ecx
movaps (%rsp), %xmm0
movb $0x1, %al
callq 0x20a0
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLPackedDMSToDec
double CPLPackedDMSToDec( double dfPacked )
{
    double  dfDegrees, dfMinutes, dfSeconds, dfSign;

    dfSign = ( dfPacked < 0.0 )? -1 : 1;
        
    dfSeconds = ABS( dfPacked );
    dfDegrees = floor(dfSeconds / 1000000.0);
    dfSeconds = dfSeconds - dfDegrees * 1000000.0;
    dfMinutes = floor(dfSeconds / 1000.0);
    dfSeconds = dfSeconds - dfMinutes * 1000.0;
    dfSeconds = dfSign * ( dfDegrees * 3600.0 + dfMinutes * 60.0 + dfSeconds);
    dfDegrees = dfSeconds / 3600.0;

    return dfDegrees;
}

// Assembly:
subq $0x48, %rsp
movapd %xmm0, 0x20(%rsp)
movapd %xmm0, %xmm2
xorpd 0xb477(%rip), %xmm2     # 0xf250
movapd %xmm2, 0x30(%rsp)
maxsd %xmm0, %xmm2
movapd %xmm2, (%rsp)
movapd %xmm2, %xmm0
divsd 0xb44c(%rip), %xmm0     # 0xf240
callq 0x24e0
movapd %xmm0, 0x10(%rsp)
movsd 0xb439(%rip), %xmm1     # 0xf240
mulsd %xmm0, %xmm1
movapd (%rsp), %xmm0
subsd %xmm1, %xmm0
movapd %xmm0, (%rsp)
divsd 0xb3ef(%rip), %xmm0     # 0xf210
callq 0x24e0
movapd %xmm0, %xmm1
movapd 0xb41e(%rip), %xmm3     # 0xf250
xorpd %xmm3, %xmm1
mulsd 0xb3f2(%rip), %xmm0     # 0xf230
unpcklpd 0x10(%rsp), %xmm1       # xmm1 = xmm1[0],mem[0]
movapd (%rsp), %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
mulpd 0xb40b(%rip), %xmm1     # 0xf260
addpd %xmm2, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
xorpd %xmm2, %xmm3
movapd 0x20(%rsp), %xmm0
cmpltsd 0x30(%rsp), %xmm0
movapd %xmm0, %xmm1
andnpd %xmm2, %xmm1
andpd %xmm3, %xmm0
orpd %xmm1, %xmm0
divsd 0xb3aa(%rip), %xmm0     # 0xf238
addq $0x48, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLDecToPackedDMS
double CPLDecToPackedDMS( double dfDec )
{
    double  dfDegrees, dfMinutes, dfSeconds, dfSign;

    dfSign = ( dfDec < 0.0 )? -1 : 1;

    dfDec = ABS( dfDec );
    dfDegrees = floor( dfDec );
    dfMinutes = floor( ( dfDec - dfDegrees ) * 60.0 );
    dfSeconds = ( dfDec - dfDegrees ) * 3600.0 - dfMinutes * 60.0;

    return dfSign * (dfDegrees * 1000000.0 + dfMinutes * 1000.0 + dfSeconds);
}

// Assembly:
subq $0x48, %rsp
movapd %xmm0, 0x20(%rsp)
movapd %xmm0, %xmm2
xorpd 0xb3a7(%rip), %xmm2     # 0xf250
movapd %xmm2, 0x30(%rsp)
maxsd %xmm0, %xmm2
movapd %xmm2, (%rsp)
movapd %xmm2, %xmm0
callq 0x24e0
movapd %xmm0, 0x10(%rsp)
movapd (%rsp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
movsd 0xb353(%rip), %xmm0     # 0xf230
mulsd %xmm1, %xmm0
callq 0x24e0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd 0xb37e(%rip), %xmm0     # 0xf270
movapd 0x10(%rsp), %xmm1
unpcklpd (%rsp), %xmm1           # xmm1 = xmm1[0],mem[0]
mulpd 0xb37b(%rip), %xmm1     # 0xf280
addpd %xmm0, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movapd 0xb333(%rip), %xmm3     # 0xf250
xorpd %xmm0, %xmm3
movapd 0x20(%rsp), %xmm2
cmpltsd 0x30(%rsp), %xmm2
movapd %xmm2, %xmm1
andnpd %xmm0, %xmm1
andpd %xmm3, %xmm2
orpd %xmm1, %xmm2
movapd %xmm2, %xmm0
addq $0x48, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLStringToComplex
void CPL_DLL CPLStringToComplex( const char *pszString, 
                                 double *pdfReal, double *pdfImag )

{
    int  i;
    int  iPlus = -1, iImagEnd = -1;

    while( *pszString == ' ' )
        pszString++;

    *pdfReal = atof(pszString);
    *pdfImag = 0.0;

    for( i = 0; pszString[i] != '\0' && pszString[i] != ' ' && i < 100; i++ )
    {
        if( pszString[i] == '+' && i > 0 )
            iPlus = i;
        if( pszString[i] == '-' && i > 0 )
            iPlus = i;
        if( pszString[i] == 'i' )
            iImagEnd = i;
    }

    if( iPlus > -1 && iImagEnd > -1 && iPlus < iImagEnd )
    {
        *pdfImag = atof(pszString + iPlus);
    }

    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
decq %r14
cmpb $0x20, 0x1(%r14)
leaq 0x1(%r14), %r14
je 0x3f58
movq %r14, %rdi
callq 0x2390
movsd %xmm0, (%r15)
movq $0x0, (%rbx)
movb (%r14), %dl
testb %dl, %dl
je 0x3fd6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %esi, %esi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq $0x63, %rsi
ja 0x3fb9
cmpb $0x20, %dl
je 0x3fb9
leal -0x2b(%rdx), %edi
testb $-0x3, %dil
movl %ecx, %edi
cmovel %esi, %edi
testq %rsi, %rsi
cmovnel %edi, %ecx
cmpb $0x69, %dl
cmovel %esi, %eax
movb 0x1(%r14,%rsi), %dl
incq %rsi
testb %dl, %dl
jne 0x3f8a
testl %ecx, %ecx
js 0x3fd6
testl %eax, %eax
js 0x3fd6
cmpl %eax, %ecx
jge 0x3fd6
movl %ecx, %eax
addq %rax, %r14
movq %r14, %rdi
callq 0x2390
movsd %xmm0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLDumpSharedList
void CPLDumpSharedList( FILE *fp )

{
    int i;

    if( nSharedFileCount > 0 )
    {
        if( fp == NULL )
            CPLDebug( "CPL", "%d Shared files open.", nSharedFileCount );
        else
            fprintf( fp, "%d Shared files open.", nSharedFileCount );
    }

    for( i = 0; i < nSharedFileCount; i++ )
    {
        if( fp == NULL )
            CPLDebug( "CPL", 
                      "%2d %d %4s %s", 
                      pasSharedFileList[i].nRefCount, 
                      pasSharedFileList[i].bLarge,
                      pasSharedFileList[i].pszAccess,
                      pasSharedFileList[i].pszFilename );
        else
            fprintf( fp, "%2d %d %4s %s", 
                     pasSharedFileList[i].nRefCount, 
                     pasSharedFileList[i].bLarge,
                     pasSharedFileList[i].pszAccess,
                     pasSharedFileList[i].pszFilename );
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x1104e(%rip)     # 0x15350
jle 0x4337
movl 0x11046(%rip), %edx     # 0x15350
testq %rbx, %rbx
je 0x4322
leaq 0xb144(%rip), %rsi      # 0xf45a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2410
jmp 0x4337
leaq 0xb07d(%rip), %rdi      # 0xf3a6
leaq 0xb12a(%rip), %rsi      # 0xf45a
xorl %eax, %eax
callq 0x4844
cmpl $0x0, 0x11012(%rip)     # 0x15350
jle 0x43a5
movl $0x18, %r12d
leaq 0xb059(%rip), %r14      # 0xf3a6
leaq 0xb11c(%rip), %r15      # 0xf470
xorl %r13d, %r13d
movq 0x10ffa(%rip), %rax     # 0x15358
movl -0x10(%rax,%r12), %edx
movl -0xc(%rax,%r12), %ecx
movq (%rax,%r12), %r8
movq -0x8(%rax,%r12), %r9
testq %rbx, %rbx
je 0x4385
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2410
jmp 0x4392
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x4844
incq %r13
movslq 0x10fb4(%rip), %rax     # 0x15350
addq $0x20, %r12
cmpq %rax, %r13
jl 0x4357
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_dir.cpp
// Function: CPLReadDir
char **CPLReadDir(const char *pszPath)
{
    DIR           *hDir;
    struct dirent *psDirEntry;
    char          **papszDir = NULL;

    if (strlen(pszPath) == 0)
        pszPath = ".";

    if ( (hDir = opendir(pszPath)) != NULL )
    {
        while( (psDirEntry = readdir(hDir)) != NULL )
        {
            papszDir = CSLAddString(papszDir, psDirEntry->d_name);
        }

        closedir( hDir );
    }
    else
    {
        /* Should we generate an error???  
         * For now we'll just return NULL (at the end of the function)
         */
    }

    return papszDir;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x0, (%rdi)
leaq 0xc87a(%rip), %rax      # 0x10e30
cmoveq %rax, %rdi
callq 0x2440
testq %rax, %rax
je 0x45fd
movq %rax, %rbx
movq %rax, %rdi
callq 0x2450
xorl %r14d, %r14d
testq %rax, %rax
je 0x45f3
addq $0x13, %rax
movq %r14, %rdi
movq %rax, %rsi
callq 0x57e8
movq %rax, %r14
movq %rbx, %rdi
callq 0x2450
jmp 0x45d2
movq %rbx, %rdi
callq 0x24c0
jmp 0x4600
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_error.cpp
// Function: CPLGetErrorContext()
static CPLErrorContext *CPLGetErrorContext()

{
    CPLErrorContext *psCtx = 
        (CPLErrorContext *) CPLGetTLS( CTLS_ERRORCONTEXT );

    if( psCtx == NULL )
    {
        psCtx = (CPLErrorContext *) CPLCalloc(sizeof(CPLErrorContext),1);
        psCtx->eLastErrType = CE_None;
        psCtx->nLastErrMsgMax = sizeof(psCtx->szLastErrMsg);
        CPLSetTLS( CTLS_ERRORCONTEXT, psCtx, TRUE );
    }

    return psCtx;
}

// Assembly:
pushq %rbx
movl $0x5, %edi
callq 0x50c3
movq %rax, %rbx
testq %rax, %rax
jne 0x483f
movl $0x208, %edi            # imm = 0x208
movl $0x1, %esi
callq 0x2d20
movq %rax, %rbx
movl $0x0, 0x4(%rax)
movl $0x1f4, 0x10(%rax)      # imm = 0x1F4
movl $0x5, %edi
movq %rax, %rsi
movl $0x1, %edx
callq 0x50f1
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_error.cpp
// Function: CPLDefaultErrorHandler
void CPL_STDCALL CPLDefaultErrorHandler( CPLErr eErrClass, int nError, 
                             const char * pszErrorMsg )

{
    static int       bLogInit = FALSE;
    static FILE *    fpLog = stderr;

    if( !bLogInit )
    {
        bLogInit = TRUE;

        fpLog = stderr;
        if( CPLGetConfigOption( "CPL_LOG", NULL ) != NULL )
        {
            fpLog = fopen( CPLGetConfigOption("CPL_LOG",""), "wt" );
            if( fpLog == NULL )
                fpLog = stderr;
        }
    }

    if( eErrClass == CE_Debug )
        fprintf( fpLog, "%s\n", pszErrorMsg );
    else if( eErrClass == CE_Warning )
        fprintf( fpLog, "Warning %d: %s\n", nError, pszErrorMsg );
    else
        fprintf( fpLog, "ERROR %d: %s\n", nError, pszErrorMsg );

    fflush( fpLog );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movl %edi, %r14d
movb 0x10898(%rip), %al      # 0x15378
testb %al, %al
je 0x4bac
cmpb $0x0, 0x10879(%rip)     # 0x15368
jne 0x4b54
movb $0x1, 0x10870(%rip)     # 0x15368
movq 0x104e1(%rip), %r15     # 0x14fe0
movq (%r15), %rax
movq %rax, 0x10867(%rip)     # 0x15370
leaq 0xaa59(%rip), %rdi      # 0xf569
xorl %esi, %esi
callq 0x3872
testq %rax, %rax
je 0x4b54
leaq 0xaa46(%rip), %rdi      # 0xf569
leaq 0xb4c2(%rip), %rsi      # 0xffec
callq 0x3872
leaq 0xaa3b(%rip), %rsi      # 0xf571
movq %rax, %rdi
callq 0x2340
movq %rax, 0x1082b(%rip)     # 0x15370
testq %rax, %rax
jne 0x4b54
movq (%r15), %rax
movq %rax, 0x1081c(%rip)     # 0x15370
movq 0x10815(%rip), %rdi     # 0x15370
cmpl $0x2, %r14d
je 0x4b7a
cmpl $0x1, %r14d
jne 0x4b83
leaq 0xaa20(%rip), %rsi      # 0xf58e
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2410
jmp 0x4b96
leaq 0xa9f3(%rip), %rsi      # 0xf574
jmp 0x4b8a
leaq 0xa9fa(%rip), %rsi      # 0xf584
movl %ebp, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2410
movq 0x107d3(%rip), %rdi     # 0x15370
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2330
callq 0x2580
jmp 0x4ae8
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_error.cpp
// Function: CPLSetErrorHandler
CPLErrorHandler CPL_STDCALL 
CPLSetErrorHandler( CPLErrorHandler pfnErrorHandlerNew )
{
    CPLErrorHandler     pfnOldHandler = pfnErrorHandler;
    CPLErrorContext *psCtx = CPLGetErrorContext();

    if( psCtx->psHandlerStack != NULL )
    {
        CPLDebug( "CPL", 
                  "CPLSetErrorHandler() called with an error handler on\n"
                  "the local stack.  New error handler will not be used immediately.\n" );
    }


    {
        CPLMutexHolderD( &hErrorMutex );

        pfnOldHandler = pfnErrorHandler;
        
        if( pfnErrorHandler == NULL )
            pfnErrorHandler = CPLDefaultErrorHandler;
        else
            pfnErrorHandler = pfnErrorHandlerNew;
    }

    return pfnOldHandler;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
callq 0x47fa
cmpq $0x0, 0x8(%rax)
je 0x4e03
leaq 0xa5b1(%rip), %rdi      # 0xf3a6
leaq 0xa7a7(%rip), %rsi      # 0xf5a3
xorl %eax, %eax
callq 0x4844
leaq 0x10556(%rip), %rsi     # 0x15360
leaq 0xa72f(%rip), %rdx      # 0xf540
leaq 0x8(%rsp), %r14
movsd 0xa3f2(%rip), %xmm0     # 0xf210
movq %r14, %rdi
movl $0x26b, %ecx            # imm = 0x26B
callq 0x4ecc
movq 0x1049e(%rip), %r15     # 0x152d0
testq %r15, %r15
leaq -0x371(%rip), %rax      # 0x4acb
cmoveq %rax, %rbx
movq %rbx, 0x10489(%rip)     # 0x152d0
movq %r14, %rdi
callq 0x4ece
movq %r15, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_error.cpp
// Function: CPLPushErrorHandler
void CPL_STDCALL CPLPushErrorHandler( CPLErrorHandler pfnErrorHandlerNew )

{
    CPLErrorContext *psCtx = CPLGetErrorContext();
    CPLErrorHandlerNode         *psNode;

    psNode = (CPLErrorHandlerNode *) VSIMalloc(sizeof(CPLErrorHandlerNode));
    psNode->psNext = psCtx->psHandlerStack;
    psNode->pfnHandler = pfnErrorHandlerNew;

    psCtx->psHandlerStack = psNode;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x47fa
movq %rax, %r14
movl $0x10, %edi
callq 0x6ed3
movq 0x8(%r14), %rcx
movq %rcx, (%rax)
movq %rbx, 0x8(%rax)
movq %rax, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_multiproc.cpp
// Function: CPLLockFile
void *CPLLockFile( const char *pszPath, double dfWaitInSeconds )

{
    FILE      *fpLock;
    char      *pszLockFilename;
    
/* -------------------------------------------------------------------- */
/*      We use a lock file with a name derived from the file we want    */
/*      to lock to represent the file being locked.  Note that for      */
/*      the stub implementation the target file does not even need      */
/*      to exist to be locked.                                          */
/* -------------------------------------------------------------------- */
    pszLockFilename = (char *) CPLMalloc(strlen(pszPath) + 30);
    sprintf( pszLockFilename, "%s.lock", pszPath );

    fpLock = fopen( pszLockFilename, "r" );
    while( fpLock != NULL && dfWaitInSeconds > 0.0 )
    {
        fclose( fpLock );
        CPLSleep( MIN(dfWaitInSeconds,0.5) );
        dfWaitInSeconds -= 0.5;

        fpLock = fopen( pszLockFilename, "r" );
    }
        
    if( fpLock != NULL )
    {
        fclose( fpLock );
        CPLFree( pszLockFilename );
        return NULL;
    }

    fpLock = fopen( pszLockFilename, "w" );

    if( fpLock == NULL )
    {
        CPLFree( pszLockFilename );
        return NULL;
    }

    fwrite( "held\n", 1, 5, fpLock );
    fclose( fpLock );

    return pszLockFilename;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movsd %xmm0, (%rsp)
movq %rdi, %r14
callq 0x2120
leaq 0x1e(%rax), %rdi
callq 0x2d6b
movq %rax, %rbx
leaq 0xa756(%rip), %rsi      # 0xf665
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x20a0
leaq 0xb770(%rip), %rsi      # 0x10693
movq %rbx, %rdi
callq 0x2340
testq %rax, %rax
setne %cl
je 0x4fa0
xorpd %xmm0, %xmm0
movsd (%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x4fa0
movapd %xmm1, %xmm0
leaq 0xb746(%rip), %r14      # 0x10693
movsd %xmm0, (%rsp)
movq %rax, %rdi
callq 0x22d0
movsd (%rsp), %xmm0
minsd 0xa6e1(%rip), %xmm0     # 0xf648
callq 0x4ffd
movsd (%rsp), %xmm0
addsd 0xa6d7(%rip), %xmm0     # 0xf650
movsd %xmm0, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2340
testq %rax, %rax
setne %cl
je 0x4fa0
movsd (%rsp), %xmm0
ucomisd 0xa6ba(%rip), %xmm0     # 0xf658
ja 0x4f4d
testb %cl, %cl
je 0x4fae
movq %rax, %rdi
callq 0x22d0
jmp 0x4fe8
leaq 0xa555(%rip), %rsi      # 0xf50a
movq %rbx, %rdi
callq 0x2340
testq %rax, %rax
je 0x4fe8
movq %rax, %r14
leaq 0xa6a1(%rip), %rdi      # 0xf66d
movl $0x1, %esi
movl $0x5, %edx
movq %rax, %rcx
callq 0x2560
movq %r14, %rdi
callq 0x22d0
jmp 0x4ff2
movq %rbx, %rdi
callq 0x6edd
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_multiproc.cpp
// Function: CPLSleep
void CPLSleep( double dfWaitInSeconds )

{
    time_t  ltime;
    time_t  ttime;

    time( &ltime );
    ttime = ltime + (int) (dfWaitInSeconds+0.5);

    for( ; ltime < ttime; time(&ltime) )
    {
        /* currently we just busy wait.  Perhaps we could at least block on 
           io? */
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movsd %xmm0, 0x10(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x2280
movsd 0x10(%rsp), %xmm0
addsd 0xa626(%rip), %xmm0     # 0xf648
cvttsd2si %xmm0, %eax
testl %eax, %eax
jle 0x5044
movslq %eax, %r14
leaq 0x8(%rsp), %rbx
addq (%rbx), %r14
movq %rbx, %rdi
callq 0x2280
cmpq %r14, 0x8(%rsp)
jl 0x5035
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_multiproc.cpp
// Function: CPLSetTLS
void CPLSetTLS( int nIndex, void *pData, int bFreeOnExit )

{
    void **papTLSList = CPLGetTLSList();

    CPLAssert( nIndex >= 0 && nIndex < CTLS_MAX );

    papTLSList[nIndex] = pData;
    papTLSList[CTLS_MAX + nIndex] = (void *) bFreeOnExit;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movl %edi, %ebp
movq 0x10295(%rip), %rax     # 0x15398
testq %rax, %rax
jne 0x511e
movl $0x8, %edi
movl $0x40, %esi
callq 0x2d20
movq %rax, 0x1027a(%rip)     # 0x15398
movslq %ebp, %rcx
movq %r14, (%rax,%rcx,8)
movslq %ebx, %rdx
movq %rdx, 0x100(%rax,%rcx,8)
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_path.cpp
// Function: CPLGetPath
const char *CPLGetPath( const char *pszFilename )

{
    int         iFileStart = CPLFindFilenameStart(pszFilename);
    char       *pszStaticResult = CPLGetStaticResult();

    CPLAssert( iFileStart < CPL_PATH_BUF_SIZE );

    if( iFileStart == 0 )
    {
        strcpy( pszStaticResult, "" );
        return pszStaticResult;
    }

    strncpy( pszStaticResult, pszFilename, iFileStart );
    pszStaticResult[iFileStart] = '\0';

    if( iFileStart > 1
        && (pszStaticResult[iFileStart-1] == '/'
            || pszStaticResult[iFileStart-1] == '\\') )
        pszStaticResult[iFileStart-1] = '\0';

    return pszStaticResult;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x5199
movl %eax, %ebp
callq 0x51cb
movq %rax, %rbx
testl %ebp, %ebp
je 0x5188
movslq %ebp, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2150
movb $0x0, (%rbx,%r15)
cmpl $0x2, %ebp
jl 0x518b
movl %ebp, %ecx
leaq (%rbx,%rcx), %rax
decq %rax
movzbl -0x1(%rbx,%rcx), %ecx
cmpl $0x5c, %ecx
je 0x5188
cmpl $0x2f, %ecx
jne 0x518b
movb $0x0, (%rax)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_path.cpp
// Function: CPLFindFilenameStart(char const*)
static int CPLFindFilenameStart( const char * pszFilename )

{
    int         iFileStart;

    for( iFileStart = strlen(pszFilename);
         iFileStart > 0
             && pszFilename[iFileStart-1] != '/'
             && pszFilename[iFileStart-1] != '\\';
         iFileStart-- ) {}

    return iFileStart;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2120
testl %eax, %eax
jle 0x51c9
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movzbl -0x1(%rbx,%rax), %ecx
cmpl $0x2f, %ecx
je 0x51c9
cmpl $0x5c, %ecx
je 0x51c9
leaq -0x1(%rax), %rcx
cmpq $0x1, %rax
movq %rcx, %rax
jg 0x51ab
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_path.cpp
// Function: CPLGetStaticResult()
static char *CPLGetStaticResult()

{
    char *pszStaticResult = (char *) CPLGetTLS( CTLS_PATHBUF );
    if( pszStaticResult == NULL )
    {
        pszStaticResult = (char *) CPLMalloc(CPL_PATH_BUF_SIZE);
        CPLSetTLS( CTLS_PATHBUF, pszStaticResult, TRUE );
    }

    return pszStaticResult;
}

// Assembly:
pushq %rbx
movl $0x7, %edi
callq 0x50c3
movq %rax, %rbx
testq %rax, %rax
jne 0x51fd
movl $0x800, %edi            # imm = 0x800
callq 0x2d6b
movq %rax, %rbx
movl $0x7, %edi
movq %rax, %rsi
movl $0x1, %edx
callq 0x50f1
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_path.cpp
// Function: CPLGetFilename
const char *CPLGetFilename( const char *pszFullFilename )

{
    int iFileStart = CPLFindFilenameStart( pszFullFilename );
    char       *pszStaticResult = CPLGetStaticResult();

    strncpy( pszStaticResult, pszFullFilename + iFileStart, 
             CPL_PATH_BUF_SIZE );
    pszStaticResult[CPL_PATH_BUF_SIZE - 1] = '\0';

    return pszStaticResult;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x5199
movl %eax, %ebp
callq 0x51cb
movq %rax, %r14
movslq %ebp, %rsi
addq %rbx, %rsi
movl $0x800, %edx            # imm = 0x800
movq %rax, %rdi
callq 0x2150
movb $0x0, 0x7ff(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_path.cpp
// Function: CPLGetBasename
const char *CPLGetBasename( const char *pszFullFilename )

{
    int iFileStart = CPLFindFilenameStart( pszFullFilename );
    int iExtStart, nLength;
    char *pszStaticResult = CPLGetStaticResult();

    for( iExtStart = strlen(pszFullFilename);
         iExtStart > iFileStart && pszFullFilename[iExtStart] != '.';
         iExtStart-- ) {}

    if( iExtStart == iFileStart )
        iExtStart = strlen(pszFullFilename);

    nLength = iExtStart - iFileStart;

    CPLAssert( nLength < CPL_PATH_BUF_SIZE );

    strncpy( pszStaticResult, pszFullFilename + iFileStart, nLength );
    pszStaticResult[nLength] = '\0';

    return pszStaticResult;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x5199
movl %eax, %ebp
callq 0x51cb
movq %rax, %r14
movq %rbx, %rdi
callq 0x2120
cmpl %eax, %ebp
jge 0x52db
movslq %eax, %rdx
movslq %ebp, %rcx
cmpb $0x2e, (%rbx,%rdx)
je 0x52e0
decq %rdx
cmpq %rcx, %rdx
jg 0x52c9
movl %ebp, %edx
jmp 0x52e0
movslq %ebp, %rcx
movl %eax, %edx
cmpl %ebp, %edx
cmovnel %edx, %eax
subl %ebp, %eax
addq %rcx, %rbx
movslq %eax, %r15
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2150
movb $0x0, (%r14,%r15)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_path.cpp
// Function: CPLGetExtension
const char *CPLGetExtension( const char *pszFullFilename )

{
    int iFileStart = CPLFindFilenameStart( pszFullFilename );
    int iExtStart;
    char *pszStaticResult = CPLGetStaticResult();

    for( iExtStart = strlen(pszFullFilename);
         iExtStart > iFileStart && pszFullFilename[iExtStart] != '.';
         iExtStart-- ) {}

    if( iExtStart == iFileStart )
        iExtStart = strlen(pszFullFilename)-1;

    strncpy( pszStaticResult, pszFullFilename+iExtStart+1, CPL_PATH_BUF_SIZE );
    pszStaticResult[CPL_PATH_BUF_SIZE - 1] = '\0';

    return pszStaticResult;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x5199
movl %eax, %ebp
callq 0x51cb
movq %rax, %rbx
movq %r14, %rdi
callq 0x2120
movl %eax, %ecx
cmpl %eax, %ebp
jge 0x5349
movslq %eax, %rcx
movslq %ebp, %rdx
cmpb $0x2e, (%r14,%rcx)
je 0x5349
decq %rcx
cmpq %rdx, %rcx
jg 0x5338
movl %ebp, %ecx
decl %eax
cmpl %ebp, %ecx
cmovnel %ecx, %eax
cltq
leaq (%r14,%rax), %rsi
incq %rsi
movl $0x800, %edx            # imm = 0x800
movq %rbx, %rdi
callq 0x2150
movb $0x0, 0x7ff(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_path.cpp
// Function: CPLResetExtension
const char *CPLResetExtension( const char *pszPath, const char *pszExt )

{
    char *pszStaticResult = CPLGetStaticResult();
    int         i;

/* -------------------------------------------------------------------- */
/*      First, try and strip off any existing extension.                */
/* -------------------------------------------------------------------- */
    strncpy( pszStaticResult, pszPath, CPL_PATH_BUF_SIZE );
    pszStaticResult[CPL_PATH_BUF_SIZE - 1] = '\0';
    for( i = strlen(pszStaticResult) - 1; i > 0; i-- )
    {
        if( pszStaticResult[i] == '.' )
        {
            pszStaticResult[i] = '\0';
            break;
        }

        if( pszStaticResult[i] == '/' || pszStaticResult[i] == '\\' 
            || pszStaticResult[i] == ':' )
            break;
    }

/* -------------------------------------------------------------------- */
/*      Append the new extension.                                       */
/* -------------------------------------------------------------------- */
    CPLAssert( strlen(pszExt) + 2 < CPL_PATH_BUF_SIZE );
    
    strcat( pszStaticResult, "." );
    strcat( pszStaticResult, pszExt );

    return pszStaticResult;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
callq 0x51cb
movq %rax, %r14
movl $0x800, %edx            # imm = 0x800
movq %rax, %rdi
movq %r15, %rsi
callq 0x2150
movb $0x0, 0x7ff(%r14)
movq %r14, %rdi
callq 0x2120
movl %eax, %eax
decq %rax
testl %eax, %eax
jle 0x53e0
movl %eax, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movzbl (%r14,%rdx), %ecx
cmpl $0x39, %ecx
jg 0x53cf
cmpl $0x2e, %ecx
je 0x53db
cmpl $0x2f, %ecx
jne 0x53aa
jmp 0x53e0
cmpl $0x3a, %ecx
je 0x53e0
cmpl $0x5c, %ecx
jne 0x53aa
jmp 0x53e0
movb $0x0, (%r14,%rdx)
movq %r14, %rdi
callq 0x2120
movw $0x2e, (%r14,%rax)
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2510
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_path.cpp
// Function: CPLFormFilename
const char *CPLFormFilename( const char * pszPath,
                             const char * pszBasename,
                             const char * pszExtension )

{
    char *pszStaticResult = CPLGetStaticResult();
    const char  *pszAddedPathSep = "";
    const char  *pszAddedExtSep = "";

    if( pszPath == NULL )
        pszPath = "";
    else if( strlen(pszPath) > 0
             && pszPath[strlen(pszPath)-1] != '/'
             && pszPath[strlen(pszPath)-1] != '\\' )
        pszAddedPathSep = SEP_STRING;

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

    CPLAssert( strlen(pszPath) + strlen(pszAddedPathSep) +
               strlen(pszBasename) + strlen(pszAddedExtSep) +
               strlen(pszExtension) + 1 < CPL_PATH_BUF_SIZE );

    strncpy( pszStaticResult, pszPath, CPL_PATH_BUF_SIZE );
    strncat( pszStaticResult, pszAddedPathSep, CPL_PATH_BUF_SIZE);
    strncat( pszStaticResult, pszBasename, CPL_PATH_BUF_SIZE);
    strncat( pszStaticResult, pszAddedExtSep, CPL_PATH_BUF_SIZE);
    strncat( pszStaticResult, pszExtension, CPL_PATH_BUF_SIZE);
    pszStaticResult[CPL_PATH_BUF_SIZE - 1] = '\0';

    return pszStaticResult;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %rbp
callq 0x51cb
movq %rax, %r14
leaq 0xabca(%rip), %r12      # 0xffec
movq %r12, %rsi
movq %r12, %r13
testq %rbp, %rbp
je 0x545b
movq %rbp, %rdi
callq 0x2120
testq %rax, %rax
je 0x5449
movzbl -0x1(%rbp,%rax), %eax
cmpl $0x2f, %eax
je 0x5449
cmpl $0x5c, %eax
jne 0x5451
movq %rbp, %rsi
movq %r12, %r13
jmp 0x545b
leaq 0xa21b(%rip), %r13      # 0xf673
movq %rbp, %rsi
testq %rbx, %rbx
je 0x547c
movb (%rbx), %al
cmpb $0x2e, %al
je 0x547f
testb %al, %al
leaq 0xab7d(%rip), %rax      # 0xffec
leaq 0xb9ba(%rip), %r12      # 0x10e30
cmoveq %rax, %r12
jmp 0x547f
movq %r12, %rbx
movl $0x800, %edx            # imm = 0x800
movq %r14, %rdi
callq 0x2150
movl $0x800, %edx            # imm = 0x800
movq %r14, %rdi
movq %r13, %rsi
callq 0x21d0
movl $0x800, %edx            # imm = 0x800
movq %r14, %rdi
movq %r15, %rsi
callq 0x21d0
movl $0x800, %edx            # imm = 0x800
movq %r14, %rdi
movq %r12, %rsi
callq 0x21d0
movl $0x800, %edx            # imm = 0x800
movq %r14, %rdi
movq %rbx, %rsi
callq 0x21d0
movb $0x0, 0x7ff(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_path.cpp
// Function: CPLProjectRelativeFilename
const char *CPLProjectRelativeFilename( const char *pszProjectDir, 
                                        const char *pszSecondaryFilename )

{
    char *pszStaticResult = CPLGetStaticResult();

    if( !CPLIsFilenameRelative( pszSecondaryFilename ) )
        return pszSecondaryFilename;

    if( pszProjectDir == NULL || strlen(pszProjectDir) == 0 )
        return pszSecondaryFilename;

    strncpy( pszStaticResult, pszProjectDir, CPL_PATH_BUF_SIZE );
    pszStaticResult[CPL_PATH_BUF_SIZE - 1] = '\0';

    if( pszProjectDir[strlen(pszProjectDir)-1] != '/' 
        && pszProjectDir[strlen(pszProjectDir)-1] != '\\' )
    {
        CPLAssert( strlen(SEP_STRING) + 1 < CPL_PATH_BUF_SIZE );

        strcat( pszStaticResult, SEP_STRING );
    }

    CPLAssert( strlen(pszSecondaryFilename) + 1 < CPL_PATH_BUF_SIZE );

    strcat( pszStaticResult, pszSecondaryFilename );
        
    return pszStaticResult;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
callq 0x51cb
movq %rax, %r14
movq %rbx, %rdi
callq 0x56f8
testq %r15, %r15
je 0x56ef
testl %eax, %eax
je 0x56ef
cmpb $0x0, (%r15)
je 0x56ef
movl $0x800, %edx            # imm = 0x800
movq %r14, %rdi
movq %r15, %rsi
callq 0x2150
movb $0x0, 0x7ff(%r14)
movq %r15, %rdi
callq 0x2120
movzbl -0x1(%r15,%rax), %eax
cmpl $0x2f, %eax
je 0x56df
cmpl $0x5c, %eax
je 0x56df
movq %r14, %rdi
callq 0x2120
movw $0x2f, (%r14,%rax)
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2510
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_path.cpp
// Function: CPLIsFilenameRelative
int CPLIsFilenameRelative( const char *pszFilename )

{
    if( (strlen(pszFilename) > 2 && strncmp(pszFilename+1,":\\",2) == 0)
        || pszFilename[0] == '\\'
        || pszFilename[0] == '/' )
        return FALSE;
    else
        return TRUE;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2120
cmpq $0x3, %rax
jb 0x5715
cmpb $0x3a, 0x1(%rbx)
jne 0x5715
xorl %eax, %eax
cmpb $0x5c, 0x2(%rbx)
je 0x5726
movb (%rbx), %al
cmpb $0x5c, %al
setne %cl
cmpb $0x2f, %al
setne %al
andb %cl, %al
movzbl %al, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_string.cpp
// Function: CSLAddString
char **CSLAddString(char **papszStrList, const char *pszNewString)
{
    int nItems=0;

    if (pszNewString == NULL)
        return papszStrList;    /* Nothing to do!*/

    /* Allocate room for the new string */
    if (papszStrList == NULL)
        papszStrList = (char**) CPLCalloc(2,sizeof(char*));
    else
    {
        nItems = CSLCount(papszStrList);
        papszStrList = (char**)CPLRealloc(papszStrList, 
                                          (nItems+2)*sizeof(char*));
    }

    /* Copy the string in the list */
    papszStrList[nItems] = CPLStrdup(pszNewString);
    papszStrList[nItems+1] = NULL;

    return papszStrList;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
testq %rsi, %rsi
je 0x585c
movq %rsi, %r14
testq %rbx, %rbx
je 0x5814
cmpq $0x0, (%rbx)
je 0x582b
xorl %r15d, %r15d
cmpq $0x0, 0x8(%rbx,%r15,8)
leaq 0x1(%r15), %r15
jne 0x5806
jmp 0x582e
movl $0x2, %edi
movl $0x8, %esi
callq 0x2d20
movq %rax, %rbx
xorl %r15d, %r15d
jmp 0x5844
xorl %r15d, %r15d
movslq %r15d, %rax
leaq 0x10(,%rax,8), %rsi
movq %rbx, %rdi
callq 0x2dcb
movq %rax, %rbx
movq %r14, %rdi
callq 0x2e41
movslq %r15d, %rcx
movq %rax, (%rbx,%rcx,8)
movq $0x0, 0x8(%rbx,%rcx,8)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_string.cpp
// Function: CSLGetField
const char * CSLGetField( char ** papszStrList, int iField )

{
    int         i;

    if( papszStrList == NULL || iField < 0 )
        return( "" );

    for( i = 0; i < iField+1; i++ )
    {
        if( papszStrList[i] == NULL )
            return "";
    }

    return( papszStrList[iField] );
}

// Assembly:
testq %rdi, %rdi
sete %al
testl %esi, %esi
sets %cl
orb %al, %cl
leaq 0xa757(%rip), %rax      # 0xffec
jne 0x58b1
leal 0x1(%rsi), %ecx
xorl %edx, %edx
cmpq $0x0, (%rdi,%rdx,8)
je 0x58b1
incq %rdx
cmpq %rdx, %rcx
jne 0x589c
movl %esi, %eax
movq (%rdi,%rax,8), %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_string.cpp
// Function: CSLDestroy
void CPL_STDCALL CSLDestroy(char **papszStrList)
{
    char **papszPtr;

    if (papszStrList)
    {
        papszPtr = papszStrList;
        while(*papszPtr != NULL)
        {
            CPLFree(*papszPtr);
            papszPtr++;
        }

        CPLFree(papszStrList);
    }
}

// Assembly:
testq %rdi, %rdi
je 0x58ea
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x58db
leaq 0x8(%rbx), %r14
callq 0x6edd
movq (%r14), %rdi
addq $0x8, %r14
testq %rdi, %rdi
jne 0x58ca
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6edd
retq