// File: /workspace/github_cpp_makefile_star2_O2/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 $0x28, %rsp
movq %rcx, %r12
movq %rdx, %r13
movl %esi, 0x8(%rsp)
movl %edi, 0xc(%rsp)
callq 0x4569
movq %rax, %r15
pushq $0x5
popq %rbp
pushq $0x1
popq %rbx
leaq 0x14(%r15), %r14
movslq 0x10(%r15), %rsi
movq %r14, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0x2190
cmpl $-0x1, %eax
sete %dl
movl 0x10(%r15), %ecx
leal -0x1(%rcx), %esi
cmpl %esi, %eax
setge %al
orb %dl, %al
cmpb $0x1, %al
jne 0x44a8
cmpl $0xf423f, %ecx          # imm = 0xF423F
jg 0x44a8
movslq %ecx, %rax
leaq (%rax,%rax,2), %rcx
movl %ecx, 0x10(%r15)
leaq (%rax,%rax,2), %rsi
addq $0x15, %rsi
movq %r15, %rdi
callq 0x2d0a
movq %rax, %r15
movl %ebp, %edi
movq %rax, %rsi
movl %ebx, %edx
callq 0x4e33
jmp 0x4446
movl 0x8(%rsp), %ebp
movl %ebp, (%r15)
movl 0xc(%rsp), %ebx
movl %ebx, 0x4(%r15)
leaq 0xa06a(%rip), %rdi      # 0xe528
xorl %esi, %esi
callq 0x367f
testq %rax, %rax
je 0x44e2
leaq 0xa066(%rip), %rdi      # 0xe537
leaq 0x9fee(%rip), %rsi      # 0xe4c6
movq %r14, %rdx
xorl %eax, %eax
callq 0x45a8
movq 0x8(%r15), %rax
testq %rax, %rax
je 0x44f7
movl %ebx, %edi
movl %ebp, %esi
movq %r14, %rdx
callq *0x8(%rax)
jmp 0x453b
leaq 0x10e62(%rip), %rsi     # 0x15360
leaq 0xa03b(%rip), %rdx      # 0xe540
leaq 0x10(%rsp), %rdi
movsd 0x9cfe(%rip), %xmm0     # 0xe210
movl $0xe5, %ecx
callq 0x4c40
movq 0x10dad(%rip), %rax     # 0x152d0
testq %rax, %rax
je 0x4531
movl %ebx, %edi
movl %ebp, %esi
movq %r14, %rdx
callq *%rax
leaq 0x10(%rsp), %rdi
callq 0x4c42
cmpl $0x4, %ebx
je 0x454f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2170
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4c42
movq %rbx, %rdi
callq 0x2500