// File: Konano[P]UselessDatabase/Database.cpp
// Function: showDatabases()
void showDatabases() {
    std::vector<std::pair<std::string, int> > v;
    v.push_back(std::pair<std::string, int>("Database", 20));
    Print::title(v);
    Anys d;

    DIR *dirp;
    struct dirent *dp;
    struct stat dir_stat;
    
    stat("db", &dir_stat);
    if (S_ISDIR(dir_stat.st_mode)) {
        dirp = opendir("db");
        while ((dp=readdir(dirp)) != NULL) {
            if ((0 == strcmp(".", dp->d_name)) || (0 == strcmp("..", dp->d_name))) { // Ignore . & ..
                continue;
            }
            stat(dp->d_name, &dir_stat);
            if (S_ISDIR(dir_stat.st_mode)) {
                if (checkFile(dirPath(dp->d_name, ".storage")) == 1) {
                    d.push_back(Any((char*)dp->d_name));
                    Print::row(d);
                    d.clear();
                }
            }
        }
        closedir(dirp);
    }
    
    Print::end();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
leaq -0x18(%rbp), %rdi
callq 0xc0d0
movl $0x14, -0x44(%rbp)
leaq 0x74012(%rip), %rsi     # 0x7eac4
leaq -0x40(%rbp), %rdi
leaq -0x44(%rbp), %rdx
callq 0xd780
jmp 0xaac1
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xc0f0
jmp 0xaad0
leaq -0x40(%rbp), %rdi
callq 0xc1a0
leaq -0x70(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xc1c0
jmp 0xaae8
leaq -0x70(%rbp), %rdi
callq 0x45590
jmp 0xaaf3
leaq -0x70(%rbp), %rdi
callq 0xc2b0
leaq -0x88(%rbp), %rdi
callq 0xc310
jmp 0xab0a
leaq 0x79337(%rip), %rdi     # 0x83e48
leaq -0x128(%rbp), %rsi
callq 0x6450
movl -0x110(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0xad5b
leaq 0x7930e(%rip), %rdi     # 0x83e48
callq 0x6750
movq %rax, -0x158(%rbp)
jmp 0xab48
movq -0x158(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rdi
callq 0x6760
movq %rax, -0x160(%rbp)
jmp 0xab6b
movq -0x160(%rbp), %rax
movq %rax, -0x98(%rbp)
cmpq $0x0, %rax
je 0xad4b
movq -0x98(%rbp), %rsi
addq $0x13, %rsi
leaq 0x73f39(%rip), %rdi     # 0x7eace
callq 0x66e0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0xabc1
movq -0x98(%rbp), %rsi
addq $0x13, %rsi
leaq 0x73f19(%rip), %rdi     # 0x7eacd
callq 0x66e0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xac19
jmp 0xab56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xad8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xc1a0
jmp 0xad8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x70(%rbp), %rdi
callq 0xc2b0
jmp 0xad8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xad80
movq -0x98(%rbp), %rdi
addq $0x13, %rdi
leaq -0x128(%rbp), %rsi
callq 0x6450
movl -0x110(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0xad46
movq -0x98(%rbp), %rdi
addq $0x13, %rdi
leaq 0x73dd1(%rip), %rsi     # 0x7ea29
callq 0x351b0
movq %rax, -0x168(%rbp)
jmp 0xac66
movq -0x168(%rbp), %rdi
callq 0x35820
movl %eax, -0x16c(%rbp)
jmp 0xac7a
movl -0x16c(%rbp), %eax
cmpl $0x1, %eax
jne 0xad44
movq -0x98(%rbp), %rax
addq $0x13, %rax
movq %rax, -0x138(%rbp)
leaq -0x130(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0xc350
jmp 0xacb0
leaq -0x88(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xc330
jmp 0xacc5
leaq -0x130(%rbp), %rdi
callq 0xc3c0
leaq -0x150(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xc400
jmp 0xace6
leaq -0x150(%rbp), %rdi
callq 0x45a80
jmp 0xacf4
leaq -0x150(%rbp), %rdi
callq 0xc430
leaq -0x88(%rbp), %rdi
callq 0xc450
jmp 0xad0e
jmp 0xad44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x130(%rbp), %rdi
callq 0xc3c0
jmp 0xad80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x150(%rbp), %rdi
callq 0xc430
jmp 0xad80
jmp 0xad46
jmp 0xab56
movq -0x90(%rbp), %rdi
callq 0x67d0
jmp 0xad59
jmp 0xad5b
callq 0x45cd0
jmp 0xad62
leaq -0x88(%rbp), %rdi
callq 0xc430
leaq -0x18(%rbp), %rdi
callq 0xc2b0
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
leaq -0x88(%rbp), %rdi
callq 0xc430
leaq -0x18(%rbp), %rdi
callq 0xc2b0
movq -0x50(%rbp), %rdi
callq 0x6890
nop