// File: /workspace/github_cpp_makefile_star2_O3/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 -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq %r15, -0x8(%rax)
movb $0x0, (%rax)
testl %edi, %edi
jle 0x249a
movq %rsi, %rbx
movl %edi, %r14d
movl %edi, %r13d
xorl %r12d, %r12d
xorl %r15d, %r15d
movq %rsi, -0x50(%rbp)
movq %r13, -0x98(%rbp)
movq (%rbx,%r12,8), %rcx
movb (%rcx), %al
cmpb $0x2d, %al
jne 0x2402
cmpb $0x68, 0x1(%rcx)
je 0x2630
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 -0x40(%rbp), %r15
movq %r13, %rdi
callq 0x2060
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r14, %r15
movl %ebx, %r14d
movq -0x50(%rbp), %rbx
movq %r13, %rcx
movq -0x98(%rbp), %r13
movq %rax, %r8
callq 0x2160
jmp 0x2471
movq -0x40(%rbp), %rdx
movl $0x2, %r8d
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
leaq 0xbbc(%rip), %rcx       # 0x3028
callq 0x2160
movq (%rbx,%r12,8), %rax
cmpb $0x2d, (%rax)
jne 0x2484
cmpb $0x6c, 0x1(%rax)
sete %al
orb %al, %r15b
incq %r12
cmpq %r12, %r13
jne 0x23ee
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %r14
jmp 0x24a0
movq %rax, %rdi
movq %rax, %r14
callq 0x2130
testq %rax, %rax
je 0x261d
movq %rax, %rbx
movq %r15, -0x50(%rbp)
leaq -0x60(%rbp), %r15
leaq -0x70(%rbp), %r14
movq %rbx, %rdi
callq 0x2140
movq %rax, %r12
testq %rax, %rax
je 0x2517
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 0x2a26
leaq -0x90(%rbp), %rdi
movq %r14, %rsi
callq 0x27a0
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x24bd
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2100
jmp 0x24bd
movq %rbx, %rdi
callq 0x2170
movq -0x90(%rbp), %r12
movq -0x88(%rbp), %r13
cmpq %r13, %r12
je 0x25e5
leaq -0x70(%rbp), %r14
movq %r15, -0x70(%rbp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x2702
movq %r14, %rdi
leaq 0xad8(%rip), %rsi       # 0x3034
callq 0x2040
testl %eax, %eax
je 0x25c3
movq %r14, %rdi
leaq 0xac4(%rip), %rsi       # 0x3033
callq 0x2040
testl %eax, %eax
je 0x25c3
movq -0x70(%rbp), %rsi
cmpb $0x2e, (%rsi)
setne %al
orb -0x50(%rbp), %al
testb $0x1, %al
je 0x25c3
movq -0x68(%rbp), %rdx
movq 0x2a44(%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 0x25d8
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2100
addq $0x20, %r12
cmpq %r13, %r12
jne 0x253a
leaq -0x38(%rbp), %r14
xorl %ebx, %ebx
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x2600
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2100
leaq -0x90(%rbp), %rdi
callq 0x2694
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa07(%rip), %rdi       # 0x302b
callq 0x20c0
movl $0x1, %ebx
jmp 0x25eb
movq %rbx, %rdi
callq 0x22fc
xorl %edi, %edi
callq 0x2120
jmp 0x2663
jmp 0x2649
jmp 0x2663
jmp 0x2663
jmp 0x2663
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x2666
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2100
jmp 0x2666
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x48(%rbp), %rdi
cmpq %rax, %rdi
je 0x267f
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2100
leaq -0x90(%rbp), %rdi
callq 0x2694
movq %rbx, %rdi
callq 0x2190
nop