// File: /workspace/github_c_makefile_star2_O0/jech[P]dht/dht.c
// Function: expire_storage
static int
expire_storage(void)
{
    struct storage *st = storage, *previous = NULL;
    while(st) {
        int i = 0;
        while(i < st->numpeers) {
            if(st->peers[i].time < now.tv_sec - 32 * 60) {
                if(i != st->numpeers - 1)
                    st->peers[i] = st->peers[st->numpeers - 1];
                st->numpeers--;
            } else {
                i++;
            }
        }

        if(st->numpeers == 0) {
            free(st->peers);
            if(previous)
                previous->next = st->next;
            else
                storage = st->next;
            free(st);
            if(previous)
                st = previous->next;
            else
                st = storage;
            numstorage--;
            if(numstorage < 0) {
                debugf("Eek... numstorage became negative.\n");
                numstorage = 0;
            }
        } else {
            previous = st;
            st = st->next;
        }
    }
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq 0x7eb1(%rip), %rax      # 0x10c60
movq %rax, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x8f38
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jge 0x8e81
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq 0x7e16(%rip), %rcx      # 0x10c10
subq $0x780, %rcx            # imm = 0x780
cmpq %rcx, %rax
jge 0x8e73
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x14(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x8e64
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq -0x8(%rbp), %rcx
movq 0x20(%rcx), %rcx
movq -0x8(%rbp), %rdx
movl 0x14(%rdx), %edx
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x14(%rax)
jmp 0x8e7c
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x8dcd
movq -0x8(%rbp), %rax
cmpl $0x0, 0x14(%rax)
jne 0x8f1f
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2040
cmpq $0x0, -0x10(%rbp)
je 0x8eb5
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
jmp 0x8ec4
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x7d9c(%rip)      # 0x10c60
movq -0x8(%rbp), %rdi
callq 0x2040
cmpq $0x0, -0x10(%rbp)
je 0x8ee2
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x8eed
movq 0x7d77(%rip), %rax      # 0x10c60
movq %rax, -0x8(%rbp)
movl 0x7d79(%rip), %eax      # 0x10c6c
addl $-0x1, %eax
movl %eax, 0x7d70(%rip)      # 0x10c6c
cmpl $0x0, 0x7d69(%rip)      # 0x10c6c
jge 0x8f1d
leaq 0x39e7(%rip), %rdi      # 0xc8f3
movb $0x0, %al
callq 0x3aa0
movl $0x0, 0x7d4f(%rip)      # 0x10c6c
jmp 0x8f33
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x8dbb
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)