// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/udc.c
// Function: rCleanup
static bits64 rCleanup(time_t deleteTime, boolean testOnly)
/* Delete any bitmap or sparseData files last accessed before deleteTime */
{
struct fileInfo *file, *fileList = listDirX(".", "*", FALSE);
bits64 results = 0;
for (file = fileList; file != NULL; file = file->next)
    {
    if (file->isDir)
        {
	setCurrentDir(file->name);
	bits64 oneResult = rCleanup(deleteTime, testOnly);
	setCurrentDir("..");
	if (oneResult > 0)
	    {
	    if (!testOnly)
		remove(file->name);
	    results += oneResult;
	    results += file->size;
	    }
	}
    else if (sameString(file->name, bitmapName))
        {
	if (file->size > udcBitmapHeaderSize) /* prevent failure on bitmap files of size 0 or less than header size */
	    verbose(4, "%ld (%ld) %s/%s\n", bitRealDataSize(file->name), (long)file->size, getCurrentDir(), file->name);
	if (file->lastAccess < deleteTime)
	    {
	    /* Remove all files when get bitmap, so that can ensure they are deleted in 
	     * right order. */
	    results += file->size;
	    if (!testOnly)
		{
		remove(bitmapName);
		remove(sparseDataName);
		if (fileExists(redirName))
		    remove(redirName);
		}
	    }
	}
    else if (sameString(file->name, sparseDataName))
        {
	if (results > 0)
	    results += file->size;
	}
    }
return results;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebx
movq %rdi, %rbp
leaq 0x4ed19(%rip), %rdi     # 0x90888
leaq 0x58c05(%rip), %rsi     # 0x9a77b
xorl %r12d, %r12d
xorl %edx, %edx
callq 0x34969
testq %rax, %rax
je 0x41d3b
movq %rax, %r15
leaq 0x53571(%rip), %r14     # 0x95104
xorl %r12d, %r12d
movq %rbp, 0x20(%rsp)
leaq 0x20(%r15), %r13
cmpb $0x0, 0x10(%r15)
je 0x41bf6
movq %r13, %rdi
callq 0x344ca
movq %rbp, %rdi
movl %ebx, %esi
callq 0x41b55
movq %rax, %r14
leaq 0x51b3c(%rip), %rdi     # 0x936fe
callq 0x344ca
testq %r14, %r14
je 0x41be2
testl %ebx, %ebx
jne 0x41bd8
movq %r13, %rdi
callq 0x6da0
addq %r12, %r14
addq 0x8(%r15), %r14
movq %r14, %r12
leaq 0x5351b(%rip), %r14     # 0x95104
movq (%r15), %r15
testq %r15, %r15
jne 0x41b9b
jmp 0x41d3b
movq %r13, %rdi
leaq 0x534f2(%rip), %rsi     # 0x950f2
callq 0x6a50
testl %eax, %eax
je 0x41c27
movq %r13, %rdi
leaq 0x534e6(%rip), %rsi     # 0x950f9
callq 0x6a50
testl %eax, %eax
jne 0x41be9
testq %r12, %r12
je 0x41be9
addq 0x8(%r15), %r12
jmp 0x41be9
cmpq $0x41, 0x8(%r15)
jl 0x41cf0
movq %r13, %rdi
callq 0x411b6
movq %rax, 0x10(%rsp)
movslq 0x8(%rax), %rcx
movq 0x18(%rax), %rax
addq %rcx, %rax
decq %rax
xorl %edx, %edx
divq %rcx
movq %rax, %rbp
movl $0x0, %r14d
testl %ebp, %ebp
jle 0x41cb0
movl %ebp, %r14d
addl $0x7, %r14d
shrl $0x3, %r14d
movq %r14, %rdi
movq %rcx, 0x18(%rsp)
callq 0x2da9d
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rcx
movl 0x3c(%rcx), %edi
movq %rax, %rsi
movq %r14, %rdx
callq 0x23186
movq 0x8(%rsp), %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x1b931
movslq %eax, %r14
imulq 0x18(%rsp), %r14
leaq 0x8(%rsp), %rdi
callq 0x2dd51
leaq 0x10(%rsp), %rdi
callq 0x40e28
movq 0x8(%r15), %rbp
xorl %eax, %eax
callq 0x3449c
movl $0x4, %edi
leaq 0x5378b(%rip), %rsi     # 0x9545c
movq %r14, %rdx
movq %rbp, %rcx
movq %rax, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x4246e
movq 0x20(%rsp), %rbp
leaq 0x53414(%rip), %r14     # 0x95104
cmpq %rbp, 0x18(%r15)
jge 0x41be9
addq 0x8(%r15), %r12
testl %ebx, %ebx
jne 0x41be9
leaq 0x533e5(%rip), %rdi     # 0x950f2
callq 0x6da0
leaq 0x533e0(%rip), %rdi     # 0x950f9
callq 0x6da0
movq %r14, %rdi
callq 0x23942
testl %eax, %eax
je 0x41be9
movq %r14, %rdi
callq 0x6da0
jmp 0x41be9
movq %r12, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq