// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_directory_to_list
static s7_pointer g_directory_to_list(s7_scheme *sc, s7_pointer args)
    {
        s7_pointer name;
        DIR *dpos;
        s7_pointer result;

#define H_directory_to_list "(directory->list directory) returns the contents of the directory as a list of strings (filenames)."
#define Q_directory_to_list s7_make_signature(sc, 2, sc->is_list_symbol, sc->is_string_symbol)   /* can return nil */

        name = car(args);
        if (!is_string(name))
            return(method_or_bust_one_arg(sc, name, sc->directory_to_list_symbol, list_1(sc, name), T_STRING));

        sc->w = sc->nil;
        if ((dpos = opendir(string_value(name))))
        {
            struct dirent *dirp;
            while ((dirp = readdir(dpos)))
                sc->w = cons(sc, s7_make_string(sc, dirp->d_name), sc->w);
            closedir(dpos);
        }

        result = sc->w;
        sc->w = sc->nil;
        return(result);
    }

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x88(%rsp)
movq %rsi, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x13, %eax
je 0x6fb33
movq 0x88(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x88(%rsp), %rax
movq 0x1e98(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x88(%rsp), %rax
movq 0x110(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x88(%rsp), %rax
movq 0x90(%rax), %rax
movq 0x88(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x6faaf
movq 0x88(%rsp), %rdi
callq 0xc670
movq 0x88(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq 0x18(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq 0x58(%rsp), %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x50(%rsp), %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x60(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rcx
movl $0x13, %r8d
callq 0xcfd30
movq %rax, 0x90(%rsp)
jmp 0x6fc9f
movq 0x88(%rsp), %rax
movq 0x110(%rax), %rcx
movq 0x88(%rsp), %rax
movq %rcx, 0x4d8(%rax)
movq 0x78(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x9190
movq %rax, 0x70(%rsp)
cmpq $0x0, %rax
je 0x6fc60
jmp 0x6fb70
movq 0x70(%rsp), %rdi
callq 0x9440
movq %rax, 0x40(%rsp)
cmpq $0x0, %rax
je 0x6fc56
movq 0x88(%rsp), %rdi
movq 0x40(%rsp), %rsi
addq $0x13, %rsi
callq 0x14630
movq %rax, 0x30(%rsp)
movq 0x88(%rsp), %rax
movq 0x4d8(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x88(%rsp), %rax
movq 0x90(%rax), %rax
movq 0x88(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x6fbe5
movq 0x88(%rsp), %rdi
callq 0xc670
movq 0x88(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x28(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x38(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rcx
movq 0x88(%rsp), %rax
movq %rcx, 0x4d8(%rax)
jmp 0x6fb70
movq 0x70(%rsp), %rdi
callq 0x92e0
movq 0x88(%rsp), %rax
movq 0x4d8(%rax), %rax
movq %rax, 0x68(%rsp)
movq 0x88(%rsp), %rax
movq 0x110(%rax), %rcx
movq 0x88(%rsp), %rax
movq %rcx, 0x4d8(%rax)
movq 0x68(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rax
addq $0x98, %rsp
retq
nop