// File: /workspace/github_c_makefile_star2_O1/BernardTatin[P]s7sh/s7.c
// Function: opt_cell_cond
static bool opt_cell_cond(s7_scheme *sc, s7_pointer car_x)
                {
                    /* top->v[2].p gets result, top->v[1].i is end index, clause->v[3].i is end of current clause,
                     *   clause->v[1].i = clause result len, clause->v[5].obj = top
                     */
                    s7_pointer p, last_clause = NULL;
                    opt_info *top;
                    int32_t branches = 0, max_blen = 0, start_pc;
                    top = alloc_opo(sc, car_x);
                    start_pc = sc->pc;
                    for (p = cdr(car_x); is_pair(p); p = cdr(p), branches++)
                    {
                        opt_info *opc;
                        s7_pointer clause, cp;
                        int32_t blen;
                        clause = car(p);
                        if ((!is_pair(clause)) ||
                                (!is_pair(cdr(clause))) || /* leave the test->result case for later */
                                (cadr(clause) == sc->feed_to_symbol))
                            return(return_false(sc, clause, __func__, __LINE__));

                        last_clause = clause;
                        opc = alloc_opo(sc, car_x);
                        oo_set_type_0(opc, 6);
                        if ((car(clause) == sc->else_symbol) ||
                                (car(clause) == sc->T))
                        {
                            opt_info *opb;
                            opb = alloc_opo(sc, clause);
                            opb->v[0].fb = opt_b_t;
                            oo_set_type_0(opb, 1);
                        }
                        else
                        {
                            if (!bool_optimize(sc, clause))
                                return(return_false(sc, clause, __func__, __LINE__));
                        }
                        for (blen = 0, cp = cdr(clause); is_pair(cp); blen++, cp = cdr(cp))
                            if (!cell_optimize(sc, cp))
                                return(return_false(sc, cp, __func__, __LINE__));
                        if (!is_null(cp))
                            return(return_false(sc, cp, __func__, __LINE__));
                        opc->v[1].i = blen;
                        if (max_blen < blen) max_blen = blen;
                        opc->v[3].i = sc->pc - 1;
                        opc->v[5].obj = (void *)top;
                        opc->v[0].fp = opt_cond_clause;
                    }
                    top->v[1].i = sc->pc - 1;
                    top->v[0].fp = opt_cond;
                    if (branches == 1)
                        top->v[0].fp = opt_cond_1;
                    else
                    {
                        if (branches == 2)
                        {
                            if ((max_blen == 1) &&
                                    ((car(last_clause) == sc->else_symbol) ||
                                     (car(last_clause) == sc->T)))
                            {
                                opt_info *o1;
                                o1 = sc->opts[start_pc];
                                top->v[3].i = o1->v[3].i + 2;
                                top->v[0].fp = opt_cond_2;
                            }
                        }
                    }
                    return(oo_set_type_0(top, 6));
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movslq 0x2258(%rdi), %rax
cmpq $0x100, %rax            # imm = 0x100
jge 0xad741
leal 0x1(%rax), %ecx
movl %ecx, 0x2258(%rdi)
movq 0x2260(%rdi,%rax,8), %r8
movq $0x0, 0x38(%r8)
movslq 0x2258(%rdi), %rax
movq %rax, 0x18(%rsp)
movq 0x10(%rsi), %r12
cmpb $0x1, (%r12)
setne %bpl
je 0xad519
xorl %ecx, %ecx
xorl %r13d, %r13d
xorl %eax, %eax
jmp 0xad6b6
movq %r8, 0x10(%rsp)
xorl %eax, %eax
xorl %r13d, %r13d
movl $0x0, 0x4(%rsp)
movq %rdi, 0x8(%rsp)
movq 0x8(%r12), %r14
cmpb $0x1, (%r14)
jne 0xad5b6
movq 0x10(%r14), %rcx
cmpb $0x1, (%rcx)
jne 0xad5b6
movq 0x8(%rcx), %rcx
cmpq 0x18f0(%rdi), %rcx
je 0xad5b6
movslq 0x2258(%rdi), %rax
cmpq $0x100, %rax            # imm = 0x100
jge 0xad741
leal 0x1(%rax), %ecx
movl %ecx, 0x2258(%rdi)
movq 0x2260(%rdi,%rax,8), %rbx
movq $0x0, 0x38(%rbx)
movq $0x6, 0x60(%rbx)
movq 0x8(%r14), %rax
cmpq 0x1790(%rdi), %rax
je 0xad5dc
cmpq 0x118(%rdi), %rax
je 0xad5dc
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0xb0a63
movq 0x8(%rsp), %rdi
testb %al, %al
jne 0xad61a
jmp 0xad653
xorl %ecx, %ecx
testb %cl, %cl
je 0xad72c
incl %r13d
movq 0x10(%r12), %r12
cmpb $0x1, (%r12)
setne %bpl
je 0xad530
jmp 0xad6a9
movslq 0x2258(%rdi), %rax
cmpq $0x100, %rax            # imm = 0x100
jge 0xad741
leal 0x1(%rax), %ecx
movl %ecx, 0x2258(%rdi)
movq 0x2260(%rdi,%rax,8), %rax
movq $0x0, 0x38(%rax)
leaq 0x4997(%rip), %rcx      # 0xb1fa6
movq %rcx, (%rax)
movq $0x1, 0x60(%rax)
movq %rbx, 0x20(%rsp)
movq 0x10(%r14), %r15
xorl %ebx, %ebx
cmpb $0x1, (%r15)
jne 0xad64a
xorl %ebx, %ebx
movq %r15, %rsi
callq 0xa8bbb
testb %al, %al
je 0xad69a
incl %ebx
movq 0x10(%r15), %r15
cmpb $0x1, (%r15)
movq 0x8(%rsp), %rdi
je 0xad62d
cmpq 0x110(%rdi), %r15
je 0xad657
xorl %ecx, %ecx
jmp 0xad692
movl %ebx, %eax
movl 0x4(%rsp), %ecx
cmpl %ebx, %ecx
cmovlel %ebx, %ecx
movl %ecx, 0x4(%rsp)
movq 0x20(%rsp), %rcx
movq %rax, 0x8(%rcx)
movslq 0x2258(%rdi), %rax
decq %rax
movq %rax, 0x18(%rcx)
movq 0x10(%rsp), %rax
movq %rax, 0x28(%rcx)
leaq 0x56bc(%rip), %rax      # 0xb2d49
movq %rax, (%rcx)
movb $0x1, %cl
movq %r14, %rax
jmp 0xad5b8
xorl %ecx, %ecx
movq %r14, %rax
movq 0x8(%rsp), %rdi
jmp 0xad5b8
cmpl $0x1, 0x4(%rsp)
sete %cl
movq 0x10(%rsp), %r8
movslq 0x2258(%rdi), %rdx
decq %rdx
movq %rdx, 0x8(%r8)
leaq 0x56c4(%rip), %rdx      # 0xb2d8f
movq %rdx, (%r8)
cmpl $0x1, %r13d
jne 0xad6dd
leaq 0x5704(%rip), %rax      # 0xb2ddf
jmp 0xad721
cmpl $0x2, %r13d
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xad724
movq 0x8(%rax), %rax
cmpq 0x1790(%rdi), %rax
je 0xad701
cmpq 0x118(%rdi), %rax
jne 0xad724
movq 0x18(%rsp), %rax
movq 0x2260(%rdi,%rax,8), %rax
movq 0x18(%rax), %rax
addq $0x2, %rax
movq %rax, 0x18(%r8)
leaq 0x56f2(%rip), %rax      # 0xb2e13
movq %rax, (%r8)
movq $0x6, 0x60(%r8)
andb $0x1, %bpl
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x2190, %rdi           # imm = 0x2190
movl $0x1, %esi
callq 0x9530