// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/cache1d.c
// Function: uninitsinglegroupfile
void uninitsinglegroupfile(int grphandle)
{
	int i, grpnum = -1;

	for(i=numgroupfiles-1;i>=0;i--)
		if (groupfil[i] != -1 && groupfil[i] == grphandle)
		{
			kfree(gfilelist[i]);
			kfree(gfileoffs[i]);
			Bclose(groupfil[i]);
			groupfil[i] = -1;
			grpnum = i;
			break;
		}

	if (grpnum == -1) return;

	// JBF 20040111
	numgroupfiles--;

	// move any group files following this one back
	for (i=grpnum+1; i<MAXGROUPFILES; i++)
		if (groupfil[i] != -1) {
			groupfil[i-1]    = groupfil[i];
			gnumfiles[i-1]   = gnumfiles[i];
			groupfilpos[i-1] = groupfilpos[i];
			gfilelist[i-1]   = gfilelist[i];
			gfileoffs[i-1]   = gfileoffs[i];
			groupfil[i] = -1;
		}

	// fix up the open files that need attention
	for(i=0;i<MAXOPENFILES;i++) {
		if (filegrp[i] >= 254)         // external file (255) or ZIPped file (254)
			continue;
		else if (filegrp[i] == grpnum)   // close file in group we closed
			filehan[i] = -1;
		else if (filegrp[i] > grpnum)   // move back a file in a group after the one we closed
			filegrp[i]--;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x19458d(%rip), %ebx    # 0x1b4718
leaq (,%rbx,4), %rax
movq $-0x1, %r15
xorl %r14d, %r14d
leaq 0x83e9c(%rip), %r12     # 0xa4040
leal (%rbx,%r15), %ecx
incl %ecx
testl %ecx, %ecx
jle 0x2030c
leaq (%rax,%r15,4), %rcx
movl (%r12,%rcx), %ecx
cmpl $-0x1, %ecx
sete %dl
cmpl %edi, %ecx
setne %cl
decq %r15
incq %r14
orb %dl, %cl
jne 0x201a4
leaq 0x19456a(%rip), %r13    # 0x1b4740
leaq (,%rbx,8), %rax
addq %r13, %rax
movq 0x8(%rax,%r15,8), %rdi
callq 0x2413d
leaq 0x19456e(%rip), %rbp    # 0x1b4760
leaq (,%rbx,8), %rax
addq %rbp, %rax
movq 0x8(%rax,%r15,8), %rdi
callq 0x2413d
leaq (%r12,%rbx,4), %rax
movq %rax, (%rsp)
movl 0x4(%rax,%r15,4), %edi
callq 0x6220
decl 0x1944f9(%rip)          # 0x1b4718
movq (%rsp), %rax
movl $0xffffffff, 0x4(%rax,%r15,4) # imm = 0xFFFFFFFF
leaq (%rbx,%r15), %rax
addq $0x2, %rax
cmpq $0x3, %rax
ja 0x202c0
incq %r15
leaq 0x8(,%rbx,8), %rcx
leaq 0x4(,%rbx,4), %rdx
leaq 0x1944d8(%rip), %rsi    # 0x1b4730
leaq 0x1944c1(%rip), %rdi    # 0x1b4720
leaq (%rdx,%r15,4), %r8
movl (%r12,%r8), %r9d
cmpl $-0x1, %r9d
je 0x202b3
leaq (%rbx,%r15), %r10
leaq (,%r15,4), %r11
movl %r10d, %r10d
movl %r9d, (%r12,%r10,4)
movl (%rsi,%r8), %r9d
movl %r9d, (%rsi,%r10,4)
movl (%rdi,%r8), %r8d
movl %r8d, (%rdi,%r10,4)
leaq (%rcx,%r15,8), %r8
movq (%r13,%r8), %r9
movq %r9, (%r13,%r10,8)
movq (%rbp,%r8), %r8
movq %r8, (%rbp,%r10,8)
addq %rdx, %r11
movl $0xffffffff, (%r12,%r11) # imm = 0xFFFFFFFF
incq %r15
leal (%rbx,%r15), %r8d
cmpl $0x3, %r8d
jl 0x2025f
leaq 0x1944b9(%rip), %rcx    # 0x1b4780
xorl %edx, %edx
leaq 0x83d80(%rip), %rsi     # 0xa4050
movzbl (%rcx), %edi
cmpl $0xfd, %edi
ja 0x202fc
movl %edi, %r8d
negl %r8d
addq %rbx, %r8
cmpl %r14d, %r8d
jne 0x202f2
movl $0xffffffff, (%rdx,%rsi) # imm = 0xFFFFFFFF
jmp 0x202fc
cmpl %edi, %eax
jg 0x202fc
decb %dil
movb %dil, (%rcx)
addq $0x4, %rdx
incq %rcx
cmpq $0x100, %rdx            # imm = 0x100
jne 0x202d0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq