// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_memv
static s7_pointer g_memv(s7_scheme *sc, s7_pointer args)
                {
#define H_memv "(memv obj list) looks for obj in list and returns the list from that point if it is found, otherwise #f. memv uses eqv?"
#define Q_memv sc->pl_tl
                    s7_pointer x, y, z;

                    x = car(args);
                    y = cadr(args);
                    if (!is_pair(y))
                    {
                        if (is_null(y)) return(sc->F);
                        return(method_or_bust_with_type(sc, y, sc->memv_symbol, list_2(sc, x, y), a_list_string, 2));
                    }

                    if (is_simple(x)) return(s7_memq(sc, x, y));
                    if (s7_is_number(x)) return(memv_number(sc, x, y));

                    z = y;
                    while (true)
                    {
                        if (s7_is_eqv(x, car(y))) return(y);
                        y = cdr(y);
                        if (!is_pair(y)) return(sc->F);

                        if (s7_is_eqv(x, car(y))) return(y);
                        y = cdr(y);
                        if (!is_pair(y)) return(sc->F);

                        z = cdr(z);
                        if (z == y) return(sc->F);
                    }
                    return(sc->F); /* not reached */
                }

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
je 0x922e5
movq 0x50(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq 0x110(%rcx), %rax
jne 0x921d8
movq 0x68(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0x70(%rsp)
jmp 0x92430
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x68(%rsp), %rax
movq 0x1340(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %rax
movq 0x110(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x68(%rsp), %rax
movq 0x90(%rax), %rax
movq 0x68(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x9224f
movq 0x68(%rsp), %rdi
callq 0xc670
movq 0x68(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdi
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x30(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x40(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdx
callq 0xd9f0
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rax, %rcx
movq 0x192ec0(%rip), %r8     # 0x225190
movl $0x2, %r9d
callq 0x14130
movq %rax, 0x70(%rsp)
jmp 0x92430
movq 0x58(%rsp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1908fa(%rip), %rax    # 0x222bf0
testb $0x1, (%rax,%rcx)
je 0x9231a
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq 0x31f50
movq %rax, 0x70(%rsp)
jmp 0x92430
movq 0x58(%rsp), %rdi
callq 0x11320
testb $0x1, %al
jne 0x9232a
jmp 0x92348
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq 0x1c97d0
movq %rax, 0x70(%rsp)
jmp 0x92430
movq 0x50(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0x3e6b0
testb $0x1, %al
jne 0x9236b
jmp 0x9237a
movq 0x50(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x92430
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
je 0x923ab
movq 0x68(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0x70(%rsp)
jmp 0x92430
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0x3e6b0
testb $0x1, %al
jne 0x923c4
jmp 0x923d0
movq 0x50(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x92430
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
je 0x923fe
movq 0x68(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0x70(%rsp)
jmp 0x92430
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x50(%rsp), %rax
jne 0x9242b
movq 0x68(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0x70(%rsp)
jmp 0x92430
jmp 0x92352
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopw (%rax,%rax)