// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_assv
static s7_pointer g_assv(s7_scheme *sc, s7_pointer args)        /* g_assv is called by g_assoc below */
                {
                    s7_pointer x, y, z;
#define H_assv "(assv obj alist) returns the key-value pair associated (via eqv?) with the key obj in the association list alist"
#define Q_assv Q_assq

                    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->assv_symbol, list_2(sc, x, y), an_association_list_string, 2));
                    }

                    if (is_simple(x))
                        return(s7_assq(sc, x, y));

                    z = y;
                    while (true)
                    {
                        /* here we can't play the assq == game because s7_is_eqv thinks it's getting a legit s7 object */
                        if ((is_pair(car(y))) && (s7_is_eqv(x, caar(y)))) return(car(y));
                        y = cdr(y);
                        if (!is_pair(y)) return(sc->F);

                        if ((is_pair(car(y))) && (s7_is_eqv(x, caar(y)))) return(car(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 0x90a65
movq 0x50(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq 0x110(%rcx), %rax
jne 0x90958
movq 0x68(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0x70(%rsp)
jmp 0x90bb4
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x68(%rsp), %rax
movq 0xc00(%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 0x909cf
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 0x194750(%rip), %r8     # 0x2251a0
movl $0x2, %r9d
callq 0x14130
movq %rax, 0x70(%rsp)
jmp 0x90bb4
movq 0x58(%rsp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x19217a(%rip), %rax    # 0x222bf0
testb $0x1, (%rax,%rcx)
je 0x90a9a
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq 0x31bb0
movq %rax, 0x70(%rsp)
jmp 0x90bb4
movq 0x50(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x90ae5
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x3e6b0
testb $0x1, %al
jne 0x90ad2
jmp 0x90ae5
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x70(%rsp)
jmp 0x90bb4
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
je 0x90b16
movq 0x68(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0x70(%rsp)
jmp 0x90bb4
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x90b54
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x3e6b0
testb $0x1, %al
jne 0x90b44
jmp 0x90b54
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x70(%rsp)
jmp 0x90bb4
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
je 0x90b82
movq 0x68(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0x70(%rsp)
jmp 0x90bb4
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x50(%rsp), %rax
jne 0x90baf
movq 0x68(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0x70(%rsp)
jmp 0x90bb4
jmp 0x90aa4
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nop