// File: /workspace/github_cpp_makefile_star2_O2/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLCloseShared
void CPLCloseShared( FILE * fp )

{
    CPLMutexHolderD( &hSharedFileMutex );
    int i;

/* -------------------------------------------------------------------- */
/*      Search for matching information.                                */
/* -------------------------------------------------------------------- */
    for( i = 0; i < nSharedFileCount && fp != pasSharedFileList[i].fp; i++ ){}

    if( i == nSharedFileCount )
    {
        CPLError( CE_Failure, CPLE_AppDefined, 
                  "Unable to find file handle %p in CPLCloseShared().",
                  fp );
        return;
    }

/* -------------------------------------------------------------------- */
/*      Dereference and return if there are still some references.      */
/* -------------------------------------------------------------------- */
    if( --pasSharedFileList[i].nRefCount > 0 )
        return;

/* -------------------------------------------------------------------- */
/*      Close the file, and remove the information.                     */
/* -------------------------------------------------------------------- */
    if( pasSharedFileList[i].bLarge )
        VSIFCloseL( pasSharedFileList[i].fp );
    else
        VSIFClose( pasSharedFileList[i].fp );

    CPLFree( pasSharedFileList[i].pszFilename );
    CPLFree( pasSharedFileList[i].pszAccess );

//    pasSharedFileList[i] = pasSharedFileList[--nSharedFileCount];
    memcpy( (void *) (pasSharedFileList + i), 
            (void *) (pasSharedFileList + --nSharedFileCount), 
            sizeof(CPLSharedFileInfo) );

    if( nSharedFileCount == 0 )
    {
        CPLFree( (void *) pasSharedFileList );
        pasSharedFileList = NULL;
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x113db(%rip), %rsi     # 0x15348
leaq 0xa486(%rip), %rdx      # 0xe3fa
movq %rsp, %rdi
movsd 0xa291(%rip), %xmm0     # 0xe210
movl $0x76a, %ecx            # imm = 0x76A
callq 0x4c40
xorl %r14d, %r14d
movq 0x113c5(%rip), %rax     # 0x15358
xorl %ecx, %ecx
movslq 0x113b4(%rip), %rdx     # 0x15350
cmpq %rdx, %rcx
jge 0x3fb3
movq (%rax,%r14), %rdx
cmpq %rbx, %rdx
je 0x3fb3
incq %rcx
addq $0x20, %r14
jmp 0x3f95
movl 0x11397(%rip), %edx     # 0x15350
cmpl %ecx, %edx
jne 0x3fd9
leaq 0xa463(%rip), %rdx      # 0xe427
pushq $0x3
popq %rdi
pushq $0x1
popq %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x439c
jmp 0x406a
movl 0x8(%rax,%r14), %ecx
leal -0x1(%rcx), %edx
movl %edx, 0x8(%rax,%r14)
cmpl $0x1, %ecx
jg 0x406a
cmpl $0x0, 0xc(%rax,%r14)
movq (%rax,%r14), %rdi
je 0x3ffe
callq 0x693a
jmp 0x4003
callq 0x6975
movq 0x1134e(%rip), %rax     # 0x15358
movq 0x10(%rax,%r14), %rdi
callq 0x6a49
movq 0x1133d(%rip), %rax     # 0x15358
movq 0x18(%rax,%r14), %rdi
callq 0x6a49
movq 0x1132c(%rip), %rdi     # 0x15358
movslq 0x1131d(%rip), %rax     # 0x15350
decq %rax
movl %eax, 0x11314(%rip)     # 0x15350
shlq $0x5, %rax
movups (%rdi,%rax), %xmm0
movups 0x10(%rdi,%rax), %xmm1
movups %xmm1, 0x10(%rdi,%r14)
movups %xmm0, (%rdi,%r14)
cmpl $0x0, 0x112f5(%rip)     # 0x15350
jne 0x406a
callq 0x6a49
andq $0x0, 0x112ee(%rip)     # 0x15358
movq %rsp, %rdi
callq 0x4c42
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4c42
movq %rbx, %rdi
callq 0x2500