// File: /workspace/github_c_makefile_star2_O1/BernardTatin[P]s7sh/s7.c
// Function: do_let
static goto_t do_let(s7_scheme *sc, s7_pointer step_slot, s7_pointer scc)
                {
                    s7_pointer let_body, p = NULL, let_vars, let_code, ip;
                    bool let_star;
                    s7_pointer old_e, stepper;
                    s7_int body_len, var_len, k, end;

                    /* do_let with non-float vars doesn't get many fixable hits */
                    let_code = caddr(scc);
                    if ((!is_pair(cdr(let_code))) || (!is_list(cadr(let_code)))) /* (do ((j 0 (+ j 1))) ((= j 1)) (let name 123)) */
                        return(fall_through);
                    let_body = cddr(let_code);
                    body_len = s7_list_length(sc, let_body);
                    if (body_len <= 0) return(fall_through);
                    let_star = (symbol_syntax_op_checked(let_code) == OP_LET_STAR);
                    let_vars = cadr(let_code);
                    set_safe_stepper(step_slot);
                    stepper = slot_value(step_slot);

                    old_e = sc->envir;
                    sc->envir = new_frame_in_env(sc, sc->envir);

                    if (setjmp(sc->opt_exit) != 0)
                        return(fall_through);

                    sc->pc = 0;
                    reset_opts(sc);
                    for (var_len = 0, p = let_vars; is_pair(p); var_len++, p = cdr(p))
                    {
                        s7_pointer expr;
                        if ((!is_pair(car(p))) ||
                                (!is_normal_symbol(caar(p))) ||
                                (!is_pair(cdar(p))))
                            return(fall_through);
                        expr = cdar(p);
                        if (!float_optimize(sc, expr))   /* each of these needs to set the associated variable */
                        {
                            sc->envir = old_e;
                            return(fall_through);
                        }
                        if (let_star)
                            make_slot_1(sc, sc->envir, caar(p), s7_make_mutable_real(sc, 1.5));
                    }

                    if (!let_star)
                        for (p = let_vars; is_pair(p); p = cdr(p))
                            make_slot_1(sc, sc->envir, caar(p), s7_make_mutable_real(sc, 1.5));

                    for (p = let_body; is_pair(p); p = cdr(p))
                        if (!float_optimize(sc, p))
                        {
                            sc->envir = old_e;
                            return(fall_through);
                        }

                    if (!is_null(p)) /* no hits in s7test or snd-test */
                    {
                        sc->envir = old_e;
                        return(fall_through);
                    }

                    end = denominator(stepper);
                    let_set_slots(sc->envir, reverse_slots(sc, let_slots(sc->envir)));
                    ip = slot_value(step_slot);

                    if (body_len == 1)
                    {
                        if (var_len == 1)
                        {
                            s7_pointer xp;
                            int32_t pc2;
                            opt_info *first, *o;
                            s7_double (*f1)(opt_info *o);
                            s7_double (*f2)(opt_info *o);
                            xp = slot_value(let_slots(sc->envir));
                            first = sc->opts[0];
                            f1 = first->v[0].fd;
                            integer(ip) = numerator(stepper);
                            sc->pc = 0;
                            set_real(xp, f1(first));
                            pc2 = ++sc->pc;
                            o = sc->opts[pc2];
                            f2 = o->v[0].fd;
                            f2(o);
                            if ((f2 == opt_fmv) &&
                                    (f1 == opt_d_dd_ff_o2) &&
                                    (first->v[3].d_dd_f == add_d_dd) &&
                                    (slot_symbol(step_slot) == slot_symbol(o->v[2].p))) /* and _dv et al throughout (so sc->pc ignored) etc */
                            {
                                /* gcc now refuses to inline opt_fmv -- we are not amused... */
                                opt_info *o1, *o2, *o3;
                                s7_d_v_t vf1, vf2, vf3, vf4;
                                s7_d_vd_t vf5, vf6;
                                s7_d_vid_t vf7;
                                void *obj1, *obj2, *obj3, *obj4, *obj5, *obj6, *obj7;

                                sc->pc = pc2;
                                o1 = o->sc->opts[o->sc->pc + 1];
                                o2 = o->sc->opts[o->sc->pc + 3];
                                o3 = o->sc->opts[o->sc->pc + 5];
                                vf1 = first->v[4].d_v_f;
                                vf2 = first->v[5].d_v_f;
                                vf3 = o1->v[2].d_v_f;
                                vf4 = o3->v[5].d_v_f;
                                vf5 = o2->v[3].d_vd_f;
                                vf6 = o3->v[6].d_vd_f;
                                vf7 = o->v[4].d_vid_f;
                                obj1 = first->v[1].obj;
                                obj2 = first->v[2].obj;
                                obj3 = o1->v[1].obj;
                                obj4 = o3->v[1].obj;
                                obj5 = o->v[5].obj;
                                obj6 = o2->v[5].obj;
                                obj7 = o3->v[2].obj;

                                for (k = numerator(stepper) + 1; k < end; k++)
                                {
                                    s7_double amp_env, vib;
                                    vib = vf1(obj1) + vf2(obj2);
                                    amp_env = vf3(obj3);
                                    vf7(obj5, k, amp_env * vf5(obj6, vib + (vf4(obj4) * vf6(obj7, vib))));
                                }
                            }
                            else
                            {
                                for (k = numerator(stepper) + 1; k < end; k++)
                                {
                                    integer(ip) = k;
                                    sc->pc = 0;
                                    set_real(xp, f1(first));
                                    sc->pc = pc2;
                                    f2(o);
                                }
                            }
                        } /* body_len == 1 and var_len == 1 */
                        else
                        {
                            if (var_len == 2)
                            {
                                s7_pointer s1, s2;
                                s1 = let_slots(sc->envir);
                                s2 = next_slot(s1);
                                for (k = numerator(stepper); k < end; k++)
                                {
                                    integer(ip) = k;
                                    sc->pc = 0;
                                    set_real(slot_value(s1), sc->opts[sc->pc]->v[0].fd(sc->opts[sc->pc]));
                                    sc->pc++;
                                    set_real(slot_value(s2), sc->opts[sc->pc]->v[0].fd(sc->opts[sc->pc]));
                                    sc->pc++;
                                    sc->opts[sc->pc]->v[0].fd(sc->opts[sc->pc]);
                                }
                            } /* body_len == 1 and var_len == 2 */
                            else
                            {
                                for (k = numerator(stepper); k < end; k++)
                                {
                                    integer(ip) = k;
                                    sc->pc = 0;
                                    for (p = let_slots(sc->envir); tis_slot(p); p = next_slot(p))
                                    {
                                        set_real(slot_value(p), sc->opts[sc->pc]->v[0].fd(sc->opts[sc->pc]));
                                        sc->pc++;
                                    }
                                    sc->opts[sc->pc]->v[0].fd(sc->opts[sc->pc]);
                                }
                            }
                        }
                    } /* body_len == 1 */
                    else
                    {
                        if ((body_len == 2) && (var_len == 1))
                        {
                            s7_pointer s1;
                            s1 = let_slots(sc->envir);
                            for (k = numerator(stepper); k < end; k++)
                            {
                                integer(ip) = k;
                                sc->pc = 0;
                                set_real(slot_value(s1), sc->opts[sc->pc]->v[0].fd(sc->opts[sc->pc]));
                                sc->pc++;
                                sc->opts[sc->pc]->v[0].fd(sc->opts[sc->pc]);
                                sc->pc++;
                                sc->opts[sc->pc]->v[0].fd(sc->opts[sc->pc]);
                            }
                        }
                        else
                        {
                            for (k = numerator(stepper); k < end; k++)
                            {
                                int32_t i;
                                integer(ip) = k;
                                sc->pc = 0;
                                for (p = let_slots(sc->envir); tis_slot(p); p = next_slot(p))
                                {
                                    set_real(slot_value(p), sc->opts[sc->pc]->v[0].fd(sc->opts[sc->pc]));
                                    sc->pc++;
                                }
                                for (i = 0; i < body_len; i++)
                                {
                                    sc->opts[sc->pc]->v[0].fd(sc->opts[sc->pc]);
                                    sc->pc++;
                                }
                            }
                        }
                    }
                    sc->envir = old_e;
                    sc->value = sc->T;
                    sc->code = cdadr(scc);
                    return(goto_safe_do_end_clauses);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq 0x10(%rdx), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %r12
movq 0x10(%r12), %rax
movl $0x2, %r13d
cmpb $0x1, (%rax)
jne 0xe05e3
movq 0x8(%rax), %r14
movb (%r14), %cl
decb %cl
cmpb $0x1, %cl
ja 0xe05e3
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x10(%rax), %rsi
movq %rsi, 0xd8(%rsp)
callq 0x3c299
testq %rax, %rax
jle 0xe05e3
cmpw $0x201, (%r12)          # imm = 0x201
movq %rax, 0x48(%rsp)
jne 0xe0390
movzwl 0x4(%r12), %eax
jmp 0xe03a1
movq 0x8(%r12), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0x38(%rsp)
orb $0x8, 0x3(%r15)
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rbx), %r12
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0xe03d0
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0x20001c, (%rax)       # imm = 0x20001C
movq 0x250(%rbx), %rcx
incq %rcx
movq %rcx, 0x250(%rbx)
movq %rcx, 0x18(%rax)
movq $0x0, 0x8(%rax)
movq %r12, 0x10(%rax)
movq %rax, 0x8(%rbx)
leaq 0x2190(%rbx), %rdi
callq 0x9350
testl %eax, %eax
jne 0xe05e3
movq %r12, 0x8(%rsp)
movq %rbp, 0xe0(%rsp)
movl $0x0, 0x2258(%rbx)
cmpb $0x1, (%r14)
jne 0xe051c
xorl %eax, %eax
movl %eax, %r12d
movq %r14, %rbp
movq 0x8(%rbp), %rax
cmpb $0x1, (%rax)
jne 0xe05e3
movq 0x8(%rax), %rcx
cmpb $0xa, (%rcx)
jne 0xe05e3
testb $-0x80, 0x6(%rcx)
jne 0xe05e3
movq 0x10(%rax), %rsi
cmpb $0x1, (%rsi)
jne 0xe05e3
movq %rbx, %rdi
callq 0x47b96
testb %al, %al
je 0xe05da
cmpq $0x1af, 0x38(%rsp)      # imm = 0x1AF
jne 0xe0506
movq 0x8(%rbx), %rsi
movq 0x90(%rbx), %rax
movq 0x8(%rbp), %rcx
movq 0x8(%rcx), %rdx
cmpq 0x98(%rbx), %rax
ja 0xe04d3
movq %rbx, %rdi
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
callq 0xb389
movq 0x60(%rsp), %rdx
movq 0x68(%rsp), %rsi
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rcx
movq $0x500000d, (%rcx)      # imm = 0x500000D
movabsq $0x3ff8000000000000, %rax # imm = 0x3FF8000000000000
movq %rax, 0x8(%rcx)
movq %rbx, %rdi
callq 0xb169
incq %r12
movq 0x10(%rbp), %rbp
cmpb $0x1, (%rbp)
movq %r12, %rax
je 0xe044f
jmp 0xe051e
xorl %eax, %eax
movq %rax, 0x40(%rsp)
cmpq $0x1af, 0x38(%rsp)      # imm = 0x1AF
jne 0xe0565
movq 0xd8(%rsp), %r12
cmpb $0x1, (%r12)
jne 0xe05ce
movq %rbx, %rdi
movq %r12, %rsi
callq 0x47b96
testb %al, %al
je 0xe05da
movq 0x10(%r12), %r12
cmpb $0x1, (%r12)
movq %r12, %rax
je 0xe0541
jmp 0xe05d1
cmpb $0x1, (%r14)
jne 0xe052e
movq 0x8(%rbx), %rbp
movq 0x90(%rbx), %rax
movq 0x8(%r14), %rcx
movq 0x8(%rcx), %r12
cmpq 0x98(%rbx), %rax
ja 0xe058f
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rcx
movq $0x500000d, (%rcx)      # imm = 0x500000D
movabsq $0x3ff8000000000000, %rax # imm = 0x3FF8000000000000
movq %rax, 0x8(%rcx)
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0xb169
movq 0x10(%r14), %r14
jmp 0xe0565
movq %r12, %rax
cmpq 0x110(%rbx), %rax
je 0xe05f8
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rbx)
movl %r13d, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %r9
movq 0x10(%r9), %rdi
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0xe062f
movl %eax, %edx
movq 0x48(%rsp), %r8
movq 0x18(%rcx), %rsi
movq %rdx, 0x18(%rcx)
movq %rcx, %rax
movq %rcx, %rdx
movq %rsi, %rcx
testq %rsi, %rsi
jne 0xe0617
jmp 0xe0634
movq 0x48(%rsp), %r8
movq 0x8(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%r15), %r12
cmpq $0x1, %r8
movq %rdi, (%rsp)
jne 0xe0781
movq 0x40(%rsp), %rax
cmpq $0x2, %rax
je 0xe08b7
cmpq $0x1, %rax
jne 0xe0944
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %r14
movq 0x2260(%rbx), %rdi
movq %r12, %rcx
movq (%rdi), %r12
movq 0x8(%r9), %rax
movq %rcx, 0x30(%rsp)
movq %rax, 0x8(%rcx)
movl $0x0, 0x2258(%rbx)
movq %rdi, %r13
callq *%r12
movq %r14, 0xd0(%rsp)
movsd %xmm0, 0x8(%r14)
movslq 0x2258(%rbx), %rax
leaq 0x1(%rax), %rcx
movl %ecx, %ebp
movl %ecx, 0x2258(%rbx)
movq 0x2268(%rbx,%rax,8), %rdi
movq (%rdi), %rax
movq %rdi, %r14
movq %rax, 0x28(%rsp)
callq *%rax
leaq -0x1c99e(%rip), %rax    # 0xc3d3c
cmpq %rax, %r12
jne 0xe070c
leaq -0x1bead(%rip), %rax    # 0xc4839
cmpq %rax, 0x28(%rsp)
jne 0xe070c
leaq -0x53706(%rip), %rax    # 0x8cfee
cmpq %rax, 0x18(%r13)
jne 0xe070c
movq 0x8(%r15), %rax
movq 0x10(%r14), %rcx
cmpq 0x8(%rcx), %rax
je 0xe09ed
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
incq %rax
cmpq (%rsp), %rax
movq %r14, 0x78(%rsp)
movl %ebp, 0x1c(%rsp)
movq 0xd0(%rsp), %rbp
movq 0x30(%rsp), %rcx
movq 0x28(%rsp), %r14
jge 0xe09b8
movq %rax, %r15
movq %rax, 0x8(%rcx)
movl $0x0, 0x2258(%rbx)
movq %r13, %rdi
callq *%r12
movsd %xmm0, 0x8(%rbp)
movl 0x1c(%rsp), %eax
movl %eax, 0x2258(%rbx)
movq 0x78(%rsp), %rdi
callq *%r14
movq 0x30(%rsp), %rcx
incq %r15
movq %r15, %rax
cmpq %r15, (%rsp)
jne 0xe073d
jmp 0xe09b8
movq %r8, %rcx
xorq $0x2, %rcx
movq 0x40(%rsp), %rdx
xorq $0x1, %rdx
movq 0x8(%r9), %rax
orq %rcx, %rdx
jne 0xe0819
cmpq %rdi, %rax
jge 0xe09b8
movq 0x8(%rbx), %rcx
movq 0x8(%rcx), %r14
movq %rax, %r15
movq %r15, 0x8(%r12)
movl $0x0, 0x2258(%rbx)
movq 0x2260(%rbx), %rdi
callq *(%rdi)
movq 0x10(%r14), %rax
movsd %xmm0, 0x8(%rax)
movslq 0x2258(%rbx), %rax
movl %eax, %ecx
incl %ecx
movl %ecx, 0x2258(%rbx)
movq 0x2268(%rbx,%rax,8), %rdi
callq *(%rdi)
movslq 0x2258(%rbx), %rax
movl %eax, %ecx
incl %ecx
movl %ecx, 0x2258(%rbx)
movq 0x2268(%rbx,%rax,8), %rdi
callq *(%rdi)
movq %r15, %rax
incq %rax
movq %rax, %r15
cmpq %rax, (%rsp)
jne 0xe07ae
jmp 0xe09b8
cmpq %rdi, %rax
jge 0xe09b8
cmpq $0x2, %r8
movl $0x1, %r14d
cmovgeq %r8, %r14
movq %rax, %r15
movq %r15, 0x8(%r12)
movl $0x0, 0x2258(%rbx)
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
testq %rax, %rax
je 0xe087e
movq %rax, %r13
movslq 0x2258(%rbx), %rax
movq 0x2260(%rbx,%rax,8), %rdi
callq *(%rdi)
movq 0x10(%r13), %rax
movsd %xmm0, 0x8(%rax)
incl 0x2258(%rbx)
movq 0x18(%r13), %rcx
movq %rcx, %rax
testq %rcx, %rcx
jne 0xe084f
movq %r14, %rax
movq %rax, %r13
movslq 0x2258(%rbx), %rax
movq 0x2260(%rbx,%rax,8), %rdi
callq *(%rdi)
incl 0x2258(%rbx)
decq %r13
movq %r13, %rax
jne 0xe0881
movq %r15, %rax
incq %rax
movq %rax, %r15
cmpq (%rsp), %rax
jne 0xe0833
jmp 0xe09b8
movq 0x8(%r9), %rax
cmpq %rdi, %rax
jge 0xe09b8
movq 0x8(%rbx), %rcx
movq 0x8(%rcx), %r14
movq 0x18(%r14), %r15
movq %rax, %r13
movq %r13, 0x8(%r12)
movl $0x0, 0x2258(%rbx)
movq 0x2260(%rbx), %rdi
callq *(%rdi)
movq 0x10(%r14), %rax
movsd %xmm0, 0x8(%rax)
movslq 0x2258(%rbx), %rax
movl %eax, %ecx
incl %ecx
movl %ecx, 0x2258(%rbx)
movq 0x2268(%rbx,%rax,8), %rdi
callq *(%rdi)
movq 0x10(%r15), %rax
movsd %xmm0, 0x8(%rax)
movslq 0x2258(%rbx), %rax
movl %eax, %ecx
incl %ecx
movl %ecx, 0x2258(%rbx)
movq 0x2268(%rbx,%rax,8), %rdi
callq *(%rdi)
movq %r13, %rax
incq %rax
movq %rax, %r13
cmpq %rax, (%rsp)
jne 0xe08d3
jmp 0xe09b8
movq 0x8(%r9), %r14
cmpq %rdi, %r14
jge 0xe09b8
movq %r14, 0x8(%r12)
movl $0x0, 0x2258(%rbx)
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
testq %rax, %rax
je 0xe0998
movq %rax, %r15
movslq 0x2258(%rbx), %rax
movq 0x2260(%rbx,%rax,8), %rdi
callq *(%rdi)
movq 0x10(%r15), %rax
movsd %xmm0, 0x8(%rax)
incl 0x2258(%rbx)
movq 0x18(%r15), %rcx
movq %rcx, %rax
testq %rcx, %rcx
jne 0xe0969
movslq 0x2258(%rbx), %rax
movq 0x2260(%rbx,%rax,8), %rdi
callq *(%rdi)
movq %r14, %rax
incq %rax
movq %rax, %r14
cmpq (%rsp), %rax
jne 0xe094d
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rbx)
movq 0x118(%rbx), %rax
movq %rax, 0x20(%rbx)
movq 0xe0(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, (%rbx)
movl $0x4, %eax
jmp 0xe05e6
movl %ebp, 0x2258(%rbx)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
incq %rax
cmpq (%rsp), %rax
jge 0xe09b8
movq %r14, %r8
movq 0x68(%r14), %rcx
movslq 0x2258(%rcx), %rdx
movq 0x2268(%rcx,%rdx,8), %rsi
movq 0x2278(%rcx,%rdx,8), %rdi
movq 0x2288(%rcx,%rdx,8), %rcx
movq 0x20(%r13), %rbp
movq 0x28(%r13), %rdx
movq %rdx, 0xc8(%rsp)
movq 0x8(%rsi), %rdx
movq %rdx, 0xc0(%rsp)
movq 0x10(%rsi), %rdx
movq %rdx, 0xb8(%rsp)
movq 0x28(%rcx), %rdx
movq %rdx, 0xb0(%rsp)
movq 0x18(%rdi), %rdx
movq %rdx, 0xa8(%rsp)
movq 0x28(%rdi), %rdx
movq %rdx, 0xa0(%rsp)
movq 0x30(%rcx), %rdx
movq %rdx, 0x98(%rsp)
movq 0x20(%r14), %r14
movq 0x28(%r8), %rdx
movq %rdx, 0x90(%rsp)
movq 0x8(%r13), %rdx
movq %rdx, 0x88(%rsp)
movq 0x10(%r13), %rdx
movq %rdx, 0x80(%rsp)
movq 0x8(%rcx), %r12
movq 0x10(%rcx), %r13
movq %rax, %r15
movq 0x88(%rsp), %rdi
callq *%rbp
movsd %xmm0, 0x50(%rsp)
movq 0x80(%rsp), %rdi
callq *0xc8(%rsp)
addsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0xc0(%rsp), %rdi
callq *0xb8(%rsp)
movsd %xmm0, 0x70(%rsp)
movq %r12, %rdi
callq *0xb0(%rsp)
movsd %xmm0, 0x58(%rsp)
movq %r13, %rdi
movsd 0x20(%rsp), %xmm0
callq *0x98(%rsp)
mulsd 0x58(%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
movq 0xa0(%rsp), %rdi
callq *0xa8(%rsp)
mulsd 0x70(%rsp), %xmm0
movq 0x90(%rsp), %rdi
movq %r15, %rsi
callq *%r14
movq %r15, %rax
incq %rax
movq %rax, %r15
cmpq %rax, (%rsp)
jne 0xe0ab6
jmp 0xe09b8