// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl $0xffffffff, -0xc(%rbp) # imm = 0xFFFFFFFF
movl 0x1c16c0(%rip), %eax    # 0x1f1278
subl $0x1, %eax
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jl 0x2fc51
movslq -0x8(%rbp), %rcx
leaq 0xb092d(%rip), %rax     # 0xe0500
cmpl $-0x1, (%rax,%rcx,4)
je 0x2fc41
movslq -0x8(%rbp), %rcx
leaq 0xb091c(%rip), %rax     # 0xe0500
movl (%rax,%rcx,4), %eax
cmpl -0x4(%rbp), %eax
jne 0x2fc41
movslq -0x8(%rbp), %rcx
leaq 0x1c16a9(%rip), %rax    # 0x1f12a0
movq (%rax,%rcx,8), %rdi
callq 0x35f10
movslq -0x8(%rbp), %rcx
leaq 0x1c16b5(%rip), %rax    # 0x1f12c0
movq (%rax,%rcx,8), %rdi
callq 0x35f10
movslq -0x8(%rbp), %rcx
leaq 0xb08e1(%rip), %rax     # 0xe0500
movl (%rax,%rcx,4), %edi
callq 0x6220
movslq -0x8(%rbp), %rcx
leaq 0xb08ce(%rip), %rax     # 0xe0500
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
movl -0x8(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x2fc51
jmp 0x2fc43
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x2fbbe
cmpl $-0x1, -0xc(%rbp)
jne 0x2fc5c
jmp 0x2fdf2
movl 0x1c1616(%rip), %eax    # 0x1f1278
addl $-0x1, %eax
movl %eax, 0x1c160d(%rip)    # 0x1f1278
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
cmpl $0x4, -0x8(%rbp)
jge 0x2fd5e
movslq -0x8(%rbp), %rcx
leaq 0xb0877(%rip), %rax     # 0xe0500
cmpl $-0x1, (%rax,%rcx,4)
je 0x2fd4e
movslq -0x8(%rbp), %rcx
leaq 0xb0862(%rip), %rax     # 0xe0500
movl (%rax,%rcx,4), %edx
movl -0x8(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xb084f(%rip), %rax     # 0xe0500
movl %edx, (%rax,%rcx,4)
movslq -0x8(%rbp), %rcx
leaq 0x1c15d1(%rip), %rax    # 0x1f1290
movl (%rax,%rcx,4), %edx
movl -0x8(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x1c15be(%rip), %rax    # 0x1f1290
movl %edx, (%rax,%rcx,4)
movslq -0x8(%rbp), %rcx
leaq 0x1c15a0(%rip), %rax    # 0x1f1280
movl (%rax,%rcx,4), %edx
movl -0x8(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x1c158d(%rip), %rax    # 0x1f1280
movl %edx, (%rax,%rcx,4)
movslq -0x8(%rbp), %rcx
leaq 0x1c159f(%rip), %rax    # 0x1f12a0
movq (%rax,%rcx,8), %rdx
movl -0x8(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x1c158b(%rip), %rax    # 0x1f12a0
movq %rdx, (%rax,%rcx,8)
movslq -0x8(%rbp), %rcx
leaq 0x1c159c(%rip), %rax    # 0x1f12c0
movq (%rax,%rcx,8), %rdx
movl -0x8(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x1c1588(%rip), %rax    # 0x1f12c0
movq %rdx, (%rax,%rcx,8)
movslq -0x8(%rbp), %rcx
leaq 0xb07b9(%rip), %rax     # 0xe0500
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
jmp 0x2fd50
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x2fc74
movl $0x0, -0x8(%rbp)
cmpl $0x40, -0x8(%rbp)
jge 0x2fdf2
movslq -0x8(%rbp), %rcx
leaq 0x1c1566(%rip), %rax    # 0x1f12e0
movzbl (%rax,%rcx), %eax
cmpl $0xfe, %eax
jl 0x2fd87
jmp 0x2fde4
movslq -0x8(%rbp), %rcx
leaq 0x1c154e(%rip), %rax    # 0x1f12e0
movzbl (%rax,%rcx), %eax
cmpl -0xc(%rbp), %eax
jne 0x2fdaf
movslq -0x8(%rbp), %rcx
leaq 0xb076a(%rip), %rax     # 0xe0510
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
jmp 0x2fde0
movslq -0x8(%rbp), %rcx
leaq 0x1c1526(%rip), %rax    # 0x1f12e0
movzbl (%rax,%rcx), %eax
cmpl -0xc(%rbp), %eax
jle 0x2fdde
movslq -0x8(%rbp), %rcx
leaq 0x1c1512(%rip), %rax    # 0x1f12e0
movb (%rax,%rcx), %dl
addb $-0x1, %dl
leaq 0x1c1505(%rip), %rax    # 0x1f12e0
movb %dl, (%rax,%rcx)
jmp 0x2fde0
jmp 0x2fde2
jmp 0x2fde4
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x2fd65
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)