// File: /workspace/github_cpp_makefile_star2_O1/AlphaTechnolog[P]fsls/fsls.cpp
// Function: main
int main(int argc, char * argv[]) {
    DIR *dir; struct dirent * entry;
    vector<string> filenames;
    string path;
    bool show_hidden = false;

    for (int i = 0; i < argc; i++) {
        if (argv[i][0] == '-' && argv[i][1] == 'h') {
            show_usage(argv);
            exit(0);
        }
        if (argc < 2 || (argv[i][0] == '-' && argc == 2)) {
            path = "./";
        } else {
            path = argv[1];
        }
        if (argv[i][0] == '-' && argv[i][1] == 'l') {
            show_hidden = true;
        }
    }

    if ((dir = opendir(path.c_str())) != NULL) {
        while ((entry = readdir(dir)) != NULL) {
            filenames.push_back(entry->d_name);
        }
        closedir(dir);
    } else {
        perror("opendir");
        return 1;
    }

    for (string filename : filenames) {
        if (filename == ".") continue;
        if (filename == "..") continue;
        if (filename[0] == '.' && !show_hidden) continue;
        cout << filename << endl;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, -0x90(%rbp)
xorl %r15d, %r15d
movq %r15, -0x80(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
movq %r15, -0x8(%rax)
movb $0x0, (%rax)
testl %edi, %edi
jle 0x2497
movq %rsi, %rbx
movl %edi, %r14d
movl %edi, %r13d
xorl %r12d, %r12d
xorl %r15d, %r15d
movq %rsi, -0x30(%rbp)
movq %r13, -0x98(%rbp)
movq (%rbx,%r12,8), %rcx
movb (%rcx), %al
cmpb $0x2d, %al
jne 0x2402
cmpb $0x68, 0x1(%rcx)
je 0x262d
cmpb $0x2d, %al
sete %al
cmpl $0x2, %r14d
sete %cl
cmpl $0x1, %r14d
je 0x2455
andb %al, %cl
jne 0x2455
movq 0x8(%rbx), %r13
movl %r14d, %ebx
movq %r15, %r14
movq -0x48(%rbp), %r15
movq %r13, %rdi
callq 0x2060
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r14, %r15
movl %ebx, %r14d
movq -0x30(%rbp), %rbx
movq %r13, %rcx
movq -0x98(%rbp), %r13
movq %rax, %r8
callq 0x2160
jmp 0x2471
movq -0x48(%rbp), %rdx
movl $0x2, %r8d
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
leaq 0xbbc(%rip), %rcx       # 0x3028
callq 0x2160
movq (%rbx,%r12,8), %rax
cmpb $0x2d, (%rax)
jne 0x248b
cmpb $0x6c, 0x1(%rax)
movzbl %r15b, %r15d
movl $0x1, %eax
cmovel %eax, %r15d
incq %r12
cmpq %r12, %r13
jne 0x23ee
movq -0x50(%rbp), %rdi
callq 0x2130
testq %rax, %rax
je 0x261a
movq %rax, %rbx
movq %r15, -0x30(%rbp)
leaq -0x60(%rbp), %r15
leaq -0x70(%rbp), %r14
movq %rbx, %rdi
callq 0x2140
movq %rax, %r12
testq %rax, %rax
je 0x2512
leaq 0x13(%r12), %r13
movq %r15, -0x70(%rbp)
movq %r13, %rdi
callq 0x2060
leaq (%r12,%rax), %rdx
addq $0x13, %rdx
movq %r14, %rdi
movq %r13, %rsi
callq 0x2a12
leaq -0x90(%rbp), %rdi
movq %r14, %rsi
callq 0x2794
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x24b8
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2100
jmp 0x24b8
movq %rbx, %rdi
callq 0x2170
movq -0x90(%rbp), %r12
movq -0x88(%rbp), %r13
xorl %ebx, %ebx
cmpq %r13, %r12
je 0x25e4
leaq -0x70(%rbp), %r14
movq %r15, -0x70(%rbp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x26fa
movq %r14, %rdi
leaq 0xadb(%rip), %rsi       # 0x3034
callq 0x2040
testl %eax, %eax
je 0x25c0
movq %r14, %rdi
leaq 0xac7(%rip), %rsi       # 0x3033
callq 0x2040
testl %eax, %eax
je 0x25c0
movq -0x70(%rbp), %rsi
cmpb $0x2e, (%rsi)
setne %al
orb -0x30(%rbp), %al
testb $0x1, %al
je 0x25c0
movq -0x68(%rbp), %rdx
movq 0x2a47(%rip), %rdi      # 0x4fd8
callq 0x2110
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2080
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x25d5
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2100
addq $0x20, %r12
cmpq %r13, %r12
jne 0x2537
xorl %ebx, %ebx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x25fd
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2100
leaq -0x90(%rbp), %rdi
callq 0x2690
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa0a(%rip), %rdi       # 0x302b
callq 0x20c0
movl $0x1, %ebx
jmp 0x25e4
movq %rbx, %rdi
callq 0x22fc
xorl %edi, %edi
callq 0x2120
jmp 0x2660
jmp 0x2646
jmp 0x2660
jmp 0x2660
jmp 0x2660
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x2663
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2100
jmp 0x2663
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x50(%rbp), %rdi
cmpq %rax, %rdi
je 0x267c
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2100
leaq -0x90(%rbp), %rdi
callq 0x2690
movq %rbx, %rdi
callq 0x2190