// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x111a6(%rip), %rsi     # 0x15348
leaq 0xb251(%rip), %rdx      # 0xf3fa
leaq 0x8(%rsp), %rdi
movsd 0xb05a(%rip), %xmm0     # 0xf210
movl $0x76a, %ecx            # imm = 0x76A
callq 0x4ecc
cmpl $0x0, 0x11189(%rip)     # 0x15350
jle 0x41ef
movq 0x11188(%rip), %rcx     # 0x15358
xorl %eax, %eax
movq (%rcx), %rdx
cmpq %rbx, %rdx
je 0x41f1
incq %rax
movslq 0x1116c(%rip), %rdx     # 0x15350
addq $0x20, %rcx
cmpq %rdx, %rax
jl 0x41d2
jmp 0x41f1
xorl %eax, %eax
cmpl 0x11159(%rip), %eax     # 0x15350
jne 0x4219
leaq 0xb227(%rip), %rdx      # 0xf427
movl $0x3, %edi
movl $0x1, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x460c
jmp 0x42b5
movq 0x11138(%rip), %rcx     # 0x15358
movl %eax, %ebx
shlq $0x5, %rbx
movl 0x8(%rcx,%rbx), %eax
leal -0x1(%rax), %edx
movl %edx, 0x8(%rcx,%rbx)
cmpl $0x1, %eax
jg 0x42b5
cmpl $0x0, 0xc(%rcx,%rbx)
movq (%rcx,%rbx), %rdi
je 0x4248
callq 0x6dce
jmp 0x424d
callq 0x6e09
movq 0x11104(%rip), %rax     # 0x15358
movq 0x10(%rax,%rbx), %rdi
callq 0x6edd
movq 0x110f3(%rip), %rax     # 0x15358
movq 0x18(%rax,%rbx), %rdi
callq 0x6edd
movq 0x110e2(%rip), %rdi     # 0x15358
movslq 0x110d3(%rip), %rax     # 0x15350
decq %rax
movl %eax, 0x110ca(%rip)     # 0x15350
shlq $0x5, %rax
movups (%rdi,%rax), %xmm0
movups 0x10(%rdi,%rax), %xmm1
movups %xmm1, 0x10(%rdi,%rbx)
movups %xmm0, (%rdi,%rbx)
cmpl $0x0, 0x110ad(%rip)     # 0x15350
jne 0x42b5
callq 0x6edd
movq $0x0, 0x110a3(%rip) # 0x15358
leaq 0x8(%rsp), %rdi
callq 0x4ece
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4ece
movq %rbx, %rdi
callq 0x2500