// File: /workspace/github_cpp_makefile_star2_O1/rurban[P]dgnlib/cpl_error.cpp
// Function: CPLErrorV
void    CPLErrorV(CPLErr eErrClass, int err_no, const char *fmt, va_list args )
{
    CPLErrorContext *psCtx = CPLGetErrorContext();

/* -------------------------------------------------------------------- */
/*      Expand the error message                                        */
/* -------------------------------------------------------------------- */
#if defined(HAVE_VSNPRINTF)
    {
        int nPR;

        while( ((nPR = vsnprintf( psCtx->szLastErrMsg, 
                                 psCtx->nLastErrMsgMax, fmt, args )) == -1
                || nPR >= psCtx->nLastErrMsgMax-1)
               && psCtx->nLastErrMsgMax < 1000000 )
        {
            psCtx->nLastErrMsgMax *= 3;
            psCtx = (CPLErrorContext *) 
                CPLRealloc(psCtx, sizeof(CPLErrorContext) - DEFAULT_LAST_ERR_MSG_SIZE + psCtx->nLastErrMsgMax + 1);
            CPLSetTLS( CTLS_ERRORCONTEXT, psCtx, TRUE );
        }
    }
#else
    vsprintf( psCtx->szLastErrMsg, fmt, args);
#endif

/* -------------------------------------------------------------------- */
/*      If the user provided his own error handling function, then      */
/*      call it, otherwise print the error to stderr and return.        */
/* -------------------------------------------------------------------- */
    psCtx->nLastErrNo = err_no;
    psCtx->eLastErrType = eErrClass;

    if( CPLGetConfigOption("CPL_LOG_ERRORS",NULL) != NULL )
        CPLDebug( "CPLError", "%s", psCtx->szLastErrMsg );

/* -------------------------------------------------------------------- */
/*      Invoke the current error handler.                               */
/* -------------------------------------------------------------------- */
    if( psCtx->psHandlerStack != NULL )
    {
        psCtx->psHandlerStack->pfnHandler(eErrClass, err_no, 
                                          psCtx->szLastErrMsg);
    }
    else
    {
        CPLMutexHolderD( &hErrorMutex );
        if( pfnErrorHandler != NULL )
            pfnErrorHandler(eErrClass, err_no, psCtx->szLastErrMsg);
    }

    if( eErrClass == CE_Fatal )
        abort();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r12
movq %rdx, %r13
movl %esi, %ebp
movl %edi, %ebx
callq 0x488f
movq %rax, %r15
leaq 0x14(%r15), %r14
movslq 0x10(%r15), %rsi
movq %r14, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0x21a0
cmpl $-0x1, %eax
je 0x47a1
movl 0x10(%r15), %ecx
decl %ecx
cmpl %ecx, %eax
jl 0x47dc
movslq 0x10(%r15), %rax
cmpq $0xf423f, %rax          # imm = 0xF423F
jg 0x47dc
leaq (%rax,%rax,2), %rcx
movl %ecx, 0x10(%r15)
leaq (%rax,%rax,2), %rsi
addq $0x15, %rsi
movq %r15, %rdi
callq 0x2df9
movq %rax, %r15
movl $0x5, %edi
movq %rax, %rsi
movl $0x1, %edx
callq 0x51aa
jmp 0x477c
movl %ebp, (%r15)
movl %ebx, 0x4(%r15)
leaq 0xbd1e(%rip), %rdi      # 0x10508
xorl %esi, %esi
callq 0x38e7
testq %rax, %rax
je 0x480e
leaq 0xbd1a(%rip), %rdi      # 0x10517
leaq 0xbca2(%rip), %rsi      # 0x104a6
movq %r14, %rdx
xorl %eax, %eax
callq 0x48d9
movq 0x8(%r15), %rax
testq %rax, %rax
je 0x4823
movl %ebx, %edi
movl %ebp, %esi
movq %r14, %rdx
callq *0x8(%rax)
jmp 0x4863
leaq 0x11b36(%rip), %rsi     # 0x16360
leaq 0xbcef(%rip), %rdx      # 0x10520
movq %rsp, %rdi
movsd 0xb9dc(%rip), %xmm0     # 0x10218
movl $0xe5, %ecx
callq 0x4f80
movq 0x11a8b(%rip), %rax     # 0x162d8
testq %rax, %rax
je 0x485b
movl %ebx, %edi
movl %ebp, %esi
movq %r14, %rdx
callq *%rax
movq %rsp, %rdi
callq 0x4f82
cmpl $0x4, %ebx
je 0x4877
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2180
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4f82
movq %rbx, %rdi
callq 0x2510