// File: /workspace/github_cpp_makefile_star2_O1/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLOpenShared
FILE *CPLOpenShared( const char *pszFilename, const char *pszAccess,
                     int bLarge )

{
    int i;
    int bReuse;
    CPLMutexHolderD( &hSharedFileMutex );

/* -------------------------------------------------------------------- */
/*      Is there an existing file we can use?                           */
/* -------------------------------------------------------------------- */
    bReuse = EQUAL(pszAccess,"rb") || EQUAL(pszAccess, "rb+");

    for( i = 0; bReuse && i < nSharedFileCount; i++ )
    {
        if( strcmp(pasSharedFileList[i].pszFilename,pszFilename) == 0 
            && !bLarge == !pasSharedFileList[i].bLarge
            && EQUAL(pasSharedFileList[i].pszAccess,pszAccess) )
        {
            pasSharedFileList[i].nRefCount++;
            return pasSharedFileList[i].fp;
        }
    }

/* -------------------------------------------------------------------- */
/*      Open the file.                                                  */
/* -------------------------------------------------------------------- */
    FILE *fp;

    if( bLarge )
        fp = VSIFOpenL( pszFilename, pszAccess );
    else
        fp = VSIFOpen( pszFilename, pszAccess );

    if( fp == NULL )
        return NULL;

/* -------------------------------------------------------------------- */
/*      Add an entry to the list.                                       */
/* -------------------------------------------------------------------- */
    nSharedFileCount++;

    pasSharedFileList = (CPLSharedFileInfo *)
        CPLRealloc( (void *) pasSharedFileList, 
                    sizeof(CPLSharedFileInfo) * nSharedFileCount );

    pasSharedFileList[nSharedFileCount-1].fp = fp;
    pasSharedFileList[nSharedFileCount-1].nRefCount = 1;
    pasSharedFileList[nSharedFileCount-1].bLarge = bLarge;
    pasSharedFileList[nSharedFileCount-1].pszFilename =CPLStrdup(pszFilename);
    pasSharedFileList[nSharedFileCount-1].pszAccess = CPLStrdup(pszAccess);

    return fp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x122c1(%rip), %rsi     # 0x16348
leaq 0xc34c(%rip), %rdx      # 0x103da
movq %rsp, %rdi
movsd 0xc17f(%rip), %xmm0     # 0x10218
movl $0x728, %ecx            # imm = 0x728
callq 0x4f80
leaq 0xc356(%rip), %rsi      # 0x10400
movq %rbx, %rdi
callq 0x22f0
testl %eax, %eax
je 0x40cd
leaq 0xc346(%rip), %rsi      # 0x10403
movq %rbx, %rdi
callq 0x22f0
testl %eax, %eax
sete %r15b
jmp 0x40d0
movb $0x1, %r15b
testb %r15b, %r15b
je 0x4136
movq 0x1227c(%rip), %r12     # 0x16358
addq $0x18, %r12
movq $-0x1, %r13
movslq 0x12262(%rip), %rax     # 0x16350
incq %r13
cmpq %rax, %r13
jge 0x4136
movq -0x8(%r12), %rdi
movq %r14, %rsi
callq 0x2410
testl %eax, %eax
jne 0x412d
testl %ebp, %ebp
sete %al
cmpl $0x0, -0xc(%r12)
setne %cl
cmpb %cl, %al
je 0x412d
movq (%r12), %rdi
movq %rbx, %rsi
callq 0x22f0
testl %eax, %eax
je 0x4211
addq $0x20, %r12
testb %r15b, %r15b
jne 0x40e7
testl %ebp, %ebp
je 0x4147
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6f09
jmp 0x4152
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6f44
movq %rax, %r15
testq %rax, %rax
je 0x41f4
incl 0x121ec(%rip)           # 0x16350
movq 0x121ed(%rip), %rdi     # 0x16358
movslq 0x121de(%rip), %rsi     # 0x16350
shlq $0x5, %rsi
callq 0x2df9
movq %rax, 0x121d6(%rip)     # 0x16358
movslq 0x121c7(%rip), %rcx     # 0x16350
shlq $0x5, %rcx
movq %r15, -0x20(%rax,%rcx)
movslq 0x121b7(%rip), %rcx     # 0x16350
shlq $0x5, %rcx
movl $0x1, -0x18(%rax,%rcx)
movslq 0x121a4(%rip), %rcx     # 0x16350
shlq $0x5, %rcx
movl %ebp, -0x14(%rax,%rcx)
movq %r14, %rdi
callq 0x2e6c
movq 0x12195(%rip), %rcx     # 0x16358
movslq 0x12186(%rip), %rdx     # 0x16350
shlq $0x5, %rdx
movq %rax, -0x10(%rcx,%rdx)
movq %rbx, %rdi
callq 0x2e6c
movq 0x12176(%rip), %rcx     # 0x16358
movslq 0x12167(%rip), %rdx     # 0x16350
shlq $0x5, %rdx
movq %rax, -0x8(%rcx,%rdx)
jmp 0x41f7
xorl %r15d, %r15d
movq %rsp, %rdi
callq 0x4f82
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incl -0x10(%r12)
movq -0x18(%r12), %r15
jmp 0x41f7
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4f82
movq %rbx, %rdi
callq 0x2510