// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: g_string_to_list
static s7_pointer g_string_to_list(s7_scheme *sc, s7_pointer args)
    {
#define H_string_to_list "(string->list str start end) returns the elements of the string str in a list; (map values str)"
#define Q_string_to_list s7_make_circular_signature(sc, 2, 3, sc->is_proper_list_symbol, sc->is_string_symbol, sc->is_integer_symbol)

        s7_int i, start = 0, end;
        s7_pointer p, str;

        str = car(args);
        if (!is_string(str))
            return(method_or_bust_one_arg(sc, str, sc->string_to_list_symbol, args, T_STRING));

        end = string_length(str);
        if (!is_null(cdr(args)))
        {
            p = start_and_end(sc, sc->string_to_list_symbol, args, 2, &start, &end);
            if (p != sc->unused) return(p);
            if (start == end) return(sc->nil);
        }
        else
        {
            if (end == 0) return(sc->nil);
        }
        if ((end - start) > sc->max_list_length)
            return(out_of_range(sc, sc->string_to_list_symbol, small_int(1), car(args), its_too_large_string));

        if ((start == 0) && (end == string_length(str)))
            return(s7_string_to_list(sc, string_value(str), string_length(str)));

        sc->w = sc->nil;
        for (i = end - 1; i >= start; i--)
            sc->w = cons(sc, s7_make_character(sc, ((uint8_t)string_value(str)[i])), sc->w);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r12
movq %rdi, %rbx
movq $0x0, 0x10(%rsp)
movq 0x8(%rsi), %r14
cmpb $0x13, (%r14)
jne 0x712c8
movq 0x8(%r14), %r15
movq %r15, 0x8(%rsp)
movq 0x110(%rbx), %r13
cmpq %r13, 0x10(%r12)
je 0x712f1
movq 0x1748(%rbx), %rsi
leaq 0x10(%rsp), %r8
leaq 0x8(%rsp), %r9
movq %rbx, %rdi
movq %r12, %rdx
movl $0x2, %ecx
callq 0x9a55e
movq %rax, %r13
cmpq 0x140(%rbx), %rax
jne 0x7143b
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %r15
movq %r15, %rax
subq %rsi, %rax
jne 0x7132a
movq 0x110(%rbx), %r13
jmp 0x7143b
movq 0x1748(%rbx), %rdx
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rcx
movl $0x13, %r8d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x95069
testq %r15, %r15
je 0x7143b
cmpq 0x2b0(%rbx), %r15
jg 0x71333
cmpq 0x8(%r14), %r15
jne 0x71396
movq 0x10(%r14), %rsi
movq %rbx, %rdi
movq %r15, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x99491
cmpq 0x2b0(%rbx), %rax
jle 0x7139a
movq 0x1748(%rbx), %rax
movq 0x8(%rax), %rax
movq 0xd5613(%rip), %rcx     # 0x146958
movq 0x8(%r12), %rdx
movq 0xd96ef(%rip), %rsi     # 0x14aa40
movq 0x1ee8(%rbx), %rdi
movq 0x10(%rdi), %rdi
movq %rax, 0x8(%rdi)
movq 0x10(%rdi), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rdx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rsi, 0x8(%rax)
movq 0x1948(%rbx), %r13
movq 0x1ee8(%rbx), %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x38dfa
jmp 0x7143b
xorl %esi, %esi
jmp 0x713a3
testq %rsi, %rsi
je 0x71303
movq 0x110(%rbx), %r12
movq %r12, 0x4d8(%rbx)
cmpq %rsi, %r15
jle 0x71431
movq 0xd969b(%rip), %rax     # 0x14aa58
movq 0x10(%r14), %rcx
movzbl -0x1(%rcx,%r15), %ecx
movq (%rax,%rcx,8), %rbp
movq 0x90(%rbx), %rcx
cmpq 0x98(%rbx), %rcx
ja 0x713f7
movq %rbx, %rdi
movq %rsi, %r13
callq 0xa550
movq %r13, %rsi
movq 0xd9668(%rip), %rax     # 0x14aa58
movq 0x90(%rbx), %rcx
decq %r15
leaq -0x8(%rcx), %rdx
movq %rdx, 0x90(%rbx)
movq -0x8(%rcx), %r13
movq $0x200001, (%r13)       # imm = 0x200001
movq %rbp, 0x8(%r13)
movq %r12, 0x10(%r13)
movq %r13, 0x4d8(%rbx)
movq %r13, %r12
cmpq %rsi, %r15
jg 0x713bd
movq 0x110(%rbx), %r12
jmp 0x71434
movq %r12, %r13
movq %r12, 0x4d8(%rbx)
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq