// File: /workspace/github_c_makefile_star2_O3/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 $0x38, %rsp
movl %esi, %ebx
movq %rdi, %rbp
leaq 0x4eac2(%rip), %rdi     # 0x90978
leaq 0x58ae6(%rip), %rsi     # 0x9a9a3
xorl %r12d, %r12d
xorl %edx, %edx
callq 0x34c13
testq %rax, %rax
je 0x4208b
movq %rax, %r15
leaq 0x53312(%rip), %r14     # 0x951ec
xorl %r12d, %r12d
movl %ebx, 0xc(%rsp)
movq %rbp, 0x20(%rsp)
leaq 0x20(%r15), %r13
cmpb $0x0, 0x10(%r15)
je 0x41f41
movq %r13, %rdi
callq 0x347f3
movq %rbp, %rdi
movl %ebx, %esi
callq 0x41e9c
movq %rax, %r14
leaq 0x518be(%rip), %rdi     # 0x937cb
callq 0x347f3
testq %r14, %r14
je 0x41f2d
testl %ebx, %ebx
jne 0x41f23
movq %r13, %rdi
callq 0x6da0
addq %r12, %r14
addq 0x8(%r15), %r14
movq %r14, %r12
leaq 0x532b8(%rip), %r14     # 0x951ec
movq (%r15), %r15
testq %r15, %r15
jne 0x41ee6
jmp 0x4208b
movq %r13, %rdi
leaq 0x5328f(%rip), %rsi     # 0x951da
callq 0x6a50
testl %eax, %eax
je 0x41f72
movq %r13, %rdi
leaq 0x53283(%rip), %rsi     # 0x951e1
callq 0x6a50
testl %eax, %eax
jne 0x41f34
testq %r12, %r12
je 0x41f34
addq 0x8(%r15), %r12
jmp 0x41f34
cmpq $0x41, 0x8(%r15)
jl 0x42040
movq %r13, %rdi
callq 0x41523
movq %rax, %r14
movq %rax, 0x30(%rsp)
movslq 0x8(%rax), %rcx
movq 0x18(%rax), %rax
addq %rcx, %rax
decq %rax
xorl %edx, %edx
divq %rcx
movl $0x0, %ebp
testl %eax, %eax
jle 0x41ffc
movl %eax, %ebp
addl $0x7, %ebp
shrl $0x3, %ebp
movq %rbp, %rdi
movq %rcx, 0x18(%rsp)
movq %rax, 0x10(%rsp)
callq 0x2ddfc
movq %rax, %rbx
movq %rax, 0x28(%rsp)
movl 0x3c(%r14), %edi
movq %rax, %rsi
movq %rbp, %rdx
callq 0x234a5
movq %rbx, %rdi
xorl %esi, %esi
movq 0x10(%rsp), %rdx
callq 0x1bc92
movslq %eax, %rbp
imulq 0x18(%rsp), %rbp
leaq 0x28(%rsp), %rdi
callq 0x2e0b0
leaq 0x30(%rsp), %rdi
callq 0x41195
movq 0x8(%r15), %rbx
xorl %eax, %eax
callq 0x347c5
movl $0x4, %edi
leaq 0x53527(%rip), %rsi     # 0x95544
movq %rbp, %rdx
movq %rbx, %rcx
movq %rax, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x427e5
movl 0xc(%rsp), %ebx
movq 0x20(%rsp), %rbp
leaq 0x531ac(%rip), %r14     # 0x951ec
cmpq %rbp, 0x18(%r15)
jge 0x41f34
addq 0x8(%r15), %r12
testl %ebx, %ebx
jne 0x41f34
leaq 0x5317d(%rip), %rdi     # 0x951da
callq 0x6da0
leaq 0x53178(%rip), %rdi     # 0x951e1
callq 0x6da0
movq %r14, %rdi
callq 0x23c5d
testl %eax, %eax
je 0x41f34
movq %r14, %rdi
callq 0x6da0
jmp 0x41f34
movq %r12, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq