// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_reverse
static s7_pointer g_reverse(s7_scheme *sc, s7_pointer args)
                {
#define H_reverse "(reverse lst) returns a list with the elements of lst in reverse order.  reverse \
                    also accepts a string or vector argument."
#define Q_reverse s7_make_signature(sc, 2, sc->is_sequence_symbol, sc->is_sequence_symbol)

                    s7_pointer p, np;

                    p = car(args);
                    sc->temp3 = p;
                    np = sc->nil;

                    switch (type(p))
                    {
                        case T_NIL:
                            return(sc->nil);

                        case T_PAIR:
                            return(s7_reverse(sc, p));

                        case T_STRING:
                            {
                                char *source, *dest, *end;
                                s7_int len;
                                len = string_length(p);
                                source = string_value(p);
                                end = (char *)(source + len);
                                np = make_empty_string(sc, len, '\0');
                                dest = (char *)(string_value(np) + len);
                                while (source < end) *(--dest) = *source++;
                            }
                            break;

                        case T_BYTE_VECTOR:
                            {
                                uint8_t *source, *dest, *end;
                                s7_int len;
                                len = byte_vector_length(p);
                                source = byte_vector_bytes(p);
                                end = (uint8_t *)(source + len);
                                np = make_simple_byte_vector(sc, len);
                                dest = (uint8_t *)(byte_vector_bytes(np) + len);
                                while (source < end) *(--dest) = *source++;
                            }
                            break;

                        case T_INT_VECTOR:
                            {
                                s7_int *source, *dest, *end;
                                s7_int len;
                                len = vector_length(p);
                                if (vector_rank(p) > 1)
                                    np = g_make_vector_1(sc, set_plist_2(sc, g_vector_dimensions(sc, set_plist_1(sc, p)), small_int(0)), sc->make_int_vector_symbol);
                                else np = make_simple_int_vector(sc, len);
                                source = int_vector_ints(p);
                                end = (s7_int *)(source + len);
                                dest = (s7_int *)(int_vector_ints(np) + len);
                                while (source < end) *(--dest) = *source++;
                            }
                            break;

                        case T_FLOAT_VECTOR:
                            {
                                s7_double *source, *dest, *end;
                                s7_int len;
                                len = vector_length(p);
                                if (vector_rank(p) > 1)
                                    np = g_make_vector_1(sc, set_plist_2(sc, g_vector_dimensions(sc, set_plist_1(sc, p)), real_zero), sc->make_float_vector_symbol);
                                else np = make_simple_float_vector(sc, len);
                                source = float_vector_floats(p);
                                end = (s7_double *)(source + len);
                                dest = (s7_double *)(float_vector_floats(np) + len);
                                while (source < end) *(--dest) = *source++;
                            }
                            break;

                        case T_VECTOR:
                            {
                                s7_pointer *source, *dest, *end;
                                s7_int len;
                                len = vector_length(p);
                                if (vector_rank(p) > 1)
                                    np = g_make_vector(sc, set_plist_1(sc, g_vector_dimensions(sc, set_plist_1(sc, p))));
                                else np = make_simple_vector(sc, len);
                                source = vector_elements(p);
                                end = (s7_pointer *)(source + len);
                                dest = (s7_pointer *)(vector_elements(np) + len);
                                while (source < end) *(--dest) = *source++;
                            }
                            break;

                        case T_HASH_TABLE:
                            return(hash_table_reverse(sc, p));

                        case T_C_OBJECT:
                            check_method(sc, p, sc->reverse_symbol, args);
                            if (c_object_reverse(sc, p))
                                return((*(c_object_reverse(sc, p)))(sc, args));
                            eval_error(sc, "attempt to reverse ~S?", 22, p);

                        case T_LET:
                            check_method(sc, p, sc->reverse_symbol, args);
                            return(s7_error(sc, sc->wrong_type_arg_symbol, set_elist_2(sc, wrap_string(sc, "can't reverse let: ~S", 21), p)));

                        default:
                            return(method_or_bust_with_type_one_arg(sc, p, sc->reverse_symbol, args, a_sequence_string));
                    }
                    return(np);
                }

// Assembly:
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, 0x198(%rsp)
movq %rsi, 0x190(%rsp)
movq 0x190(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x188(%rsp)
movq 0x188(%rsp), %rcx
movq 0x198(%rsp), %rax
movq %rcx, 0x508(%rax)
movq 0x198(%rsp), %rax
movq 0x110(%rax), %rax
movq %rax, 0x180(%rsp)
movq 0x188(%rsp), %rax
movzbl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, 0xc8(%rsp)
subl $0x1b, %eax
ja 0x948ac
movq 0xc8(%rsp), %rax
leaq 0x14ade4(%rip), %rcx    # 0x1dec8c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x198(%rsp), %rax
movq 0x110(%rax), %rax
movq %rax, 0x1a0(%rsp)
jmp 0x948f9
movq 0x198(%rsp), %rdi
movq 0x188(%rsp), %rsi
callq 0x310b0
movq %rax, 0x1a0(%rsp)
jmp 0x948f9
movq 0x188(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x160(%rsp)
movq 0x188(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x178(%rsp)
movq 0x178(%rsp), %rax
addq 0x160(%rsp), %rax
movq %rax, 0x168(%rsp)
movq 0x198(%rsp), %rdi
movq 0x160(%rsp), %rsi
xorl %edx, %edx
callq 0x146a0
movq %rax, 0x180(%rsp)
movq 0x180(%rsp), %rax
movq 0x10(%rax), %rax
addq 0x160(%rsp), %rax
movq %rax, 0x170(%rsp)
movq 0x178(%rsp), %rax
cmpq 0x168(%rsp), %rax
jae 0x93fb1
movq 0x178(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x178(%rsp)
movb (%rax), %cl
movq 0x170(%rsp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, 0x170(%rsp)
movb %cl, -0x1(%rax)
jmp 0x93f6a
jmp 0x948e9
movq 0x188(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x140(%rsp)
movq 0x188(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x158(%rsp)
movq 0x158(%rsp), %rax
addq 0x140(%rsp), %rax
movq %rax, 0x148(%rsp)
movq 0x198(%rsp), %rdi
movq 0x140(%rsp), %rsi
callq 0x371c0
movq %rax, 0x180(%rsp)
movq 0x180(%rsp), %rax
movq 0x10(%rax), %rax
addq 0x140(%rsp), %rax
movq %rax, 0x150(%rsp)
movq 0x158(%rsp), %rax
cmpq 0x148(%rsp), %rax
jae 0x94076
movq 0x158(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x158(%rsp)
movb (%rax), %cl
movq 0x150(%rsp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, 0x150(%rsp)
movb %cl, -0x1(%rax)
jmp 0x9402f
jmp 0x948e9
movq 0x188(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x120(%rsp)
movq 0x188(%rsp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x20(%rax)
je 0x940c0
movq 0x188(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0xc0(%rsp)
jmp 0x940cf
movl $0x1, %eax
movq %rax, 0xc0(%rsp)
jmp 0x940cf
movq 0xc0(%rsp), %rax
cmpq $0x1, %rax
jle 0x94176
movq 0x198(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x198(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x198(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0x198(%rsp), %rdi
movq 0x188(%rsp), %rsi
callq 0x35ea0
movq 0xa8(%rsp), %rdi
movq %rax, %rsi
callq 0x359e0
movq 0xb0(%rsp), %rdi
movq %rax, %rsi
movq 0x182338(%rip), %rdx    # 0x216480
callq 0x36f70
movq 0xb8(%rsp), %rdi
movq %rax, %rsi
movq 0x198(%rsp), %rax
movq 0x12f0(%rax), %rdx
callq 0x35ed0
movq %rax, 0x180(%rsp)
jmp 0x94193
movq 0x198(%rsp), %rdi
movq 0x120(%rsp), %rsi
callq 0x370c0
movq %rax, 0x180(%rsp)
movq 0x188(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x138(%rsp)
movq 0x138(%rsp), %rax
movq 0x120(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x128(%rsp)
movq 0x180(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x120(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x130(%rsp)
movq 0x138(%rsp), %rax
cmpq 0x128(%rsp), %rax
jae 0x94232
movq 0x138(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x138(%rsp)
movq (%rax), %rcx
movq 0x130(%rsp), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x130(%rsp)
movq %rcx, -0x8(%rax)
jmp 0x941e9
jmp 0x948e9
movq 0x188(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x100(%rsp)
movq 0x188(%rsp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x20(%rax)
je 0x9427c
movq 0x188(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0xa0(%rsp)
jmp 0x9428b
movl $0x1, %eax
movq %rax, 0xa0(%rsp)
jmp 0x9428b
movq 0xa0(%rsp), %rax
cmpq $0x1, %rax
jle 0x94332
movq 0x198(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x198(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x198(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x198(%rsp), %rdi
movq 0x188(%rsp), %rsi
callq 0x35ea0
movq 0x88(%rsp), %rdi
movq %rax, %rsi
callq 0x359e0
movq 0x90(%rsp), %rdi
movq %rax, %rsi
movq 0x186484(%rip), %rdx    # 0x21a788
callq 0x36f70
movq 0x98(%rsp), %rdi
movq %rax, %rsi
movq 0x198(%rsp), %rax
movq 0x12d8(%rax), %rdx
callq 0x35ed0
movq %rax, 0x180(%rsp)
jmp 0x9434f
movq 0x198(%rsp), %rdi
movq 0x100(%rsp), %rsi
callq 0x36fc0
movq %rax, 0x180(%rsp)
movq 0x188(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x118(%rsp)
movq 0x118(%rsp), %rax
movq 0x100(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x108(%rsp)
movq 0x180(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x100(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x110(%rsp)
movq 0x118(%rsp), %rax
cmpq 0x108(%rsp), %rax
jae 0x943f0
movq 0x118(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x118(%rsp)
movsd (%rax), %xmm0
movq 0x110(%rsp), %rax
movq %rax, %rcx
addq $-0x8, %rcx
movq %rcx, 0x110(%rsp)
movsd %xmm0, -0x8(%rax)
jmp 0x943a5
jmp 0x948e9
movq 0x188(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0xe0(%rsp)
movq 0x188(%rsp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x20(%rax)
je 0x9443a
movq 0x188(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0x80(%rsp)
jmp 0x94449
movl $0x1, %eax
movq %rax, 0x80(%rsp)
jmp 0x94449
movq 0x80(%rsp), %rax
cmpq $0x1, %rax
jle 0x944c4
movq 0x198(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x198(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x198(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x198(%rsp), %rdi
movq 0x188(%rsp), %rsi
callq 0x35ea0
movq 0x68(%rsp), %rdi
movq %rax, %rsi
callq 0x359e0
movq 0x70(%rsp), %rdi
movq %rax, %rsi
callq 0x35ea0
movq 0x78(%rsp), %rdi
movq %rax, %rsi
callq 0x35970
movq %rax, 0x180(%rsp)
jmp 0x944e1
movq 0x198(%rsp), %rdi
movq 0xe0(%rsp), %rsi
callq 0x34da0
movq %rax, 0x180(%rsp)
movq 0x188(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0xf8(%rsp)
movq 0xf8(%rsp), %rax
movq 0xe0(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0xe8(%rsp)
movq 0x180(%rsp), %rax
movq 0x10(%rax), %rax
movq 0xe0(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0xf0(%rsp)
movq 0xf8(%rsp), %rax
cmpq 0xe8(%rsp), %rax
jae 0x94580
movq 0xf8(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0xf8(%rsp)
movq (%rax), %rcx
movq 0xf0(%rsp), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0xf0(%rsp)
movq %rcx, -0x8(%rax)
jmp 0x94537
jmp 0x948e9
movq 0x198(%rsp), %rdi
movq 0x188(%rsp), %rsi
callq 0x1c9cf0
movq %rax, 0x1a0(%rsp)
jmp 0x948f9
movq 0x188(%rsp), %rax
movq (%rax), %rax
andq $0x40000000, %rax       # imm = 0x40000000
cmpq $0x0, %rax
je 0x9467c
movq 0x198(%rsp), %rax
testb $0x1, 0x24c(%rax)
je 0x9467c
movq 0x198(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x198(%rsp), %rdi
movq 0x188(%rsp), %rsi
callq 0x9a10
movq 0x60(%rsp), %rdi
movq %rax, %rsi
movq 0x198(%rsp), %rax
movq 0x1480(%rax), %rdx
callq 0x98d0
movq %rax, 0xd8(%rsp)
movq 0x198(%rsp), %rcx
cmpq 0x128(%rcx), %rax
je 0x9467c
movq 0x198(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0xd8(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x198(%rsp), %rdi
movq 0x190(%rsp), %rsi
callq 0x44270
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq %rax, %rdx
callq 0xda50
movq %rax, 0x1a0(%rsp)
jmp 0x948f9
movq 0x198(%rsp), %rax
movq 0x8d8(%rax), %rax
movq 0x188(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x60(%rax)
je 0x946e4
movq 0x198(%rsp), %rax
movq 0x8d8(%rax), %rax
movq 0x188(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq 0x60(%rax), %rax
movq 0x198(%rsp), %rdi
movq 0x190(%rsp), %rsi
callq *%rax
movq %rax, 0x1a0(%rsp)
jmp 0x948f9
movq 0x198(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x198(%rsp), %rax
movq 0x1918(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x198(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x198(%rsp), %rdi
leaq 0x15f15f(%rip), %rsi    # 0x1f3880
movl $0x16, %edx
callq 0xb880
movq 0x38(%rsp), %rdi
movq %rax, %rsi
movq 0x188(%rsp), %rdx
callq 0xb830
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
movq %rax, 0x1a0(%rsp)
jmp 0x948f9
movq 0x188(%rsp), %rax
movq (%rax), %rax
andq $0x40000000, %rax       # imm = 0x40000000
cmpq $0x0, %rax
je 0x94834
movq 0x198(%rsp), %rax
testb $0x1, 0x24c(%rax)
je 0x94834
movq 0x198(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x198(%rsp), %rdi
movq 0x188(%rsp), %rsi
callq 0x9a10
movq 0x30(%rsp), %rdi
movq %rax, %rsi
movq 0x198(%rsp), %rax
movq 0x1480(%rax), %rdx
callq 0x98d0
movq %rax, 0xd0(%rsp)
movq 0x198(%rsp), %rcx
cmpq 0x128(%rcx), %rax
je 0x94834
movq 0x198(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0xd0(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x198(%rsp), %rdi
movq 0x190(%rsp), %rsi
callq 0x44270
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %rax, %rdx
callq 0xda50
movq %rax, 0x1a0(%rsp)
jmp 0x948f9
movq 0x198(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x198(%rsp), %rax
movq 0x1940(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x198(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x198(%rsp), %rdi
leaq 0x15f026(%rip), %rsi    # 0x1f3897
movl $0x15, %edx
callq 0xb880
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq 0x188(%rsp), %rdx
callq 0xb830
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
movq %rax, 0x1a0(%rsp)
jmp 0x948f9
movq 0x198(%rsp), %rdi
movq 0x188(%rsp), %rsi
movq 0x198(%rsp), %rax
movq 0x1480(%rax), %rdx
movq 0x190(%rsp), %rcx
movq 0x185e66(%rip), %r8     # 0x21a740
callq 0x1ba7e0
movq %rax, 0x1a0(%rsp)
jmp 0x948f9
movq 0x180(%rsp), %rax
movq %rax, 0x1a0(%rsp)
movq 0x1a0(%rsp), %rax
addq $0x1a8, %rsp            # imm = 0x1A8
retq
nopl (%rax)