// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: combine_ops
static int32_t combine_ops(s7_scheme *sc, s7_pointer func, s7_pointer expr, combine_op_t cop, s7_pointer e1, s7_pointer e2) /* sc needed for debugger stuff */
                {
                    int32_t arg_op;
                    s7_pointer arg;

                    switch (cop)
                    {
                        case E_C_P:
                            arg_op = op_no_hop(e1);
                            switch (arg_op)
                            {
                                case OP_SAFE_C_S:      return(OP_SAFE_C_opSq);
                                case OP_SAFE_C_D:      return(OP_SAFE_C_opDq);
                                case OP_SAFE_C_SS:     return(OP_SAFE_C_opSSq);
                                case OP_SAFE_C_SC:     return(OP_SAFE_C_opSCq);
                                case OP_SAFE_C_CS:     return(OP_SAFE_C_opCSq);
                                case OP_SAFE_C_opSq:   return(OP_SAFE_C_op_opSq_q);
                                case OP_SAFE_C_S_opSq: return(OP_SAFE_C_op_S_opSq_q);
                                case OP_SAFE_C_opSq_S: return(OP_SAFE_C_op_opSq_S_q);
                                case OP_SAFE_C_A:      return(OP_SAFE_C_opAq);
                                case OP_SAFE_C_AA:     return(OP_SAFE_C_opAAq);
                                case OP_SAFE_C_AAA:    return(OP_SAFE_C_opAAAq);
                                                       /* deeper opA...q nestings are rare */
                            }
                            return(OP_SAFE_C_P); /* this splits out to A in optimize_func one_arg */

                        case E_C_SP:
                            arg = e2;
                            arg_op = op_no_hop(arg);
                            switch (arg_op)
                            {
                                case OP_SAFE_C_S:
                                    set_opt1_sym(cdr(expr), cadr(arg));
                                    return(OP_SAFE_C_S_opSq);

                                case OP_SAFE_C_D:
                                    set_opt1_pair(cdr(expr), cdr(arg));
                                    return(OP_SAFE_C_S_opDq);

                                case OP_SAFE_C_SC:
                                    set_opt1_sym(cdr(expr), cadr(arg));
                                    set_opt2_con(cdr(expr), caddr(arg));
                                    return(OP_SAFE_C_S_opSCq);

                                case OP_SAFE_C_CS:	  /* expr is (* a (- 1 b)), e2 is (- 1 b) */
                                    /* set_opt1_con(cdr(expr), cadr(arg)); */
                                    set_opt2_sym(cdr(expr), caddr(arg));
                                    return(OP_SAFE_C_S_opCSq);

                                case OP_SAFE_C_SS:	  /* (* a (- b c)) */
                                    set_opt1_sym(cdr(expr), cadr(arg));
                                    set_opt2_sym(cdr(expr), caddr(arg));
                                    return(OP_SAFE_C_S_opSSq);

                                case OP_SAFE_C_opSq_C:      return(OP_SAFE_C_S_op_opSq_Cq);
                                case OP_SAFE_C_S_opSSq:	    return(OP_SAFE_C_S_op_S_opSSqq);
                                case OP_SAFE_C_S_opSq:	    return(OP_SAFE_C_S_op_S_opSqq);
                                case OP_SAFE_C_opSSq_opSSq: return(OP_SAFE_C_S_op_opSSq_opSSqq);
                                case OP_SAFE_C_A:	    return(OP_SAFE_C_S_opAq);
                                case OP_SAFE_C_AA:	    return(OP_SAFE_C_S_opAAq);
                                case OP_SAFE_C_AAA:  	    return(OP_SAFE_C_S_opAAAq);
                            }
                            return(OP_SAFE_C_SP); /* if fxable -> AA later */

                        case E_C_PS:
                            arg = e1;
                            arg_op = op_no_hop(arg);
                            switch (arg_op)
                            {
                                case OP_SAFE_C_S:     return(OP_SAFE_C_opSq_S);
                                case OP_SAFE_C_SS:    return(OP_SAFE_C_opSSq_S);
                                case OP_SAFE_C_D:     return(OP_SAFE_C_opDq_S);
                                case OP_SAFE_C_CS:    return(OP_SAFE_C_opCSq_S);
                                case OP_SAFE_C_A:     return(OP_SAFE_C_opAq_S);
                                case OP_SAFE_C_opSSq:
                                                      set_opt1_pair(cdr(expr), cadadr(expr));
                                                      return(OP_SAFE_C_op_opSSq_q_S);
                                case OP_SAFE_C_opSSq_S:
                                                      set_opt3_pair(expr, cadadr(expr));
                                                      return(OP_SAFE_C_op_opSSq_Sq_S);
                            }
                            return(OP_SAFE_C_PS);

                        case E_C_PC:
                            arg = e1;
                            arg_op = op_no_hop(arg);
                            switch (arg_op)
                            {
                                case OP_SAFE_C_S:
                                    set_opt1_con(cdr(expr), (is_quoted_pair(cadr(e1))) ? cadadr(e1) : cadr(e1));
                                    set_opt2_con(cdr(expr), e2);
                                    return(OP_SAFE_C_opSq_C);
                                case OP_SAFE_C_CS:    return(OP_SAFE_C_opCSq_C);
                                case OP_SAFE_C_SC:    return(OP_SAFE_C_opSCq_C);
                                case OP_SAFE_C_opSq:  return(OP_SAFE_C_op_opSq_q_C);
                                case OP_SAFE_C_opSSq: return(OP_SAFE_C_op_opSSq_q_C);
                                case OP_SAFE_C_SS:    return(OP_SAFE_C_opSSq_C);
                            }
                            set_opt2_con(cdr(expr), caddr(expr));
                            return(OP_SAFE_C_PC);

                        case E_C_CP:
                            arg = e2;
                            arg_op = op_no_hop(arg);
                            switch (arg_op)
                            {
                                case OP_SAFE_C_D:
                                    set_opt1_pair(cdr(expr), cdr(arg));
                                    return(OP_SAFE_C_C_opDq);

                                case OP_SAFE_C_S:
                                    set_opt1_sym(cdr(expr), cadr(arg));
                                    return(OP_SAFE_C_C_opSq);

                                case OP_SAFE_C_CS:
                                    /* set_opt1_con(cdr(expr), cadr(arg)); */
                                    set_opt2_sym(cdr(expr), caddr(arg));
                                    return(OP_SAFE_C_C_opCSq);

                                case OP_SAFE_C_SC:
                                    set_opt1_sym(cdr(expr), cadr(arg));
                                    set_opt2_con(cdr(expr), caddr(arg));
                                    return(OP_SAFE_C_C_opSCq);

                                case OP_SAFE_C_SS:
                                    set_opt1_sym(cdr(expr), cadr(arg));
                                    if ((is_real(e1)) &&
                                            (symbol_id(car(arg)) == 0) &&
                                            (s7_d_pd_function(slot_value(global_slot(car(arg))))))
                                    {
                                        s7_p_dd_t fp;
                                        fp = s7_p_dd_function(func);
                                        if (fp)
                                        {
                                            /* direct_c_c_opssq calls number_to_real on e1 */
                                            set_opt3_direct(cddr(expr), s7_d_pd_function(slot_value(global_slot(car(arg)))));
                                            set_opt2_direct(cdr(expr), fp);
                                            set_direct_opt(expr);
                                        }
                                    }
                                    return(OP_SAFE_C_C_opSSq);
                            }
                            return(OP_SAFE_C_CP);

                        case E_C_PP:
                            arg = e2;
                            arg_op = op_no_hop(arg);
                            switch (arg_op)
                            {
                                case OP_SAFE_C_S:
                                    if (is_safe_c_s(e1))
                                    {
                                        s7_p_dd_t fp;
                                        fp = s7_p_dd_function(func);
                                        if (fp)
                                        {
                                            if ((symbol_id(car(e1)) == 0) && (s7_d_p_function(slot_value(global_slot(car(e1))))) &&
                                                    (symbol_id(car(e2)) == 0) && (s7_d_p_function(slot_value(global_slot(car(e2))))))
                                            {
                                                set_opt3_direct(cdr(expr), s7_d_p_function(slot_value(global_slot(car(e1)))));
                                                set_opt3_direct(cddr(expr), s7_d_p_function(slot_value(global_slot(car(e2)))));
                                                set_opt2_direct(cdr(expr), fp);
                                                set_direct_opt(expr);
                                            }
                                        }
                                        return(OP_SAFE_C_opSq_opSq);
                                    }
                                    if (optimize_op_match(e1, OP_SAFE_C_SS))
                                        return(OP_SAFE_C_opSSq_opSq);
                                    break;

                                case OP_SAFE_C_SS:
                                    if (optimize_op_match(e1, OP_SAFE_C_SS))
                                        return(OP_SAFE_C_opSSq_opSSq);
                                    if (is_safe_c_s(e1))
                                        return(OP_SAFE_C_opSq_opSSq);
                                    break;
                            }
                            return(OP_SAFE_C_PP);

                        default:
                            break;
                    }
                    /* fprintf(stderr, "%s[%d]: unopt %s\n", __func__, __LINE__, DISPLAY(expr)); */
                    return(OP_UNOPT);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r9, %r14
movq %r8, %r15
movq %rdx, %rbx
movq %rsi, %r12
movl %ecx, %eax
leaq 0x229fe(%rip), %rcx     # 0xd4b3c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzwl 0x4(%r15), %eax
andl $-0x2, %eax
leal -0x2(%rax), %ecx
cmpl $0x8, %ecx
jbe 0xb239c
cmpl $0x20, %eax
je 0xb26a1
cmpl $0x28, %eax
je 0xb268b
cmpl $0x30, %eax
je 0xb268f
cmpl $0x6c, %eax
je 0xb2693
cmpl $0x6e, %eax
je 0xb269a
cmpl $0x74, %eax
jne 0xb25dc
movl $0x8a, %ebp
jmp 0xb26c2
movzwl 0x4(%r15), %eax
andl $-0x2, %eax
leal -0x4(%rax), %ecx
cmpl $0x6, %ecx
ja 0xb23fb
leaq 0x229c2(%rip), %rax     # 0xd4b78
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x10(%r15), %rax
movq 0x8(%rax), %rax
cmpb $0x1, (%rax)
jne 0xb21ea
addq $0x10, %r15
movq 0x8(%rax), %rcx
addq $0x10, %rax
cmpq 0x17b0(%rdi), %rcx
cmovneq %r15, %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbx), %rcx
movq %rax, 0x18(%rcx)
movq 0x10(%rbx), %rax
movq %r14, 0x20(%rax)
pushq $0x32
jmp 0xb26c1
movzwl 0x4(%r14), %eax
andl $-0x2, %eax
movl $0x156, %ebp            # imm = 0x156
addl $-0x2, %eax
cmpl $0x8, %eax
ja 0xb26c2
leaq 0x22933(%rip), %rcx     # 0xd4b54
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%r14), %rax
movq 0x10(%rbx), %rcx
movq %rax, 0x18(%rcx)
pushq $0x44
jmp 0xb26c1
movzwl 0x4(%r14), %eax
andl $-0x2, %eax
leal -0x2(%rax), %ecx
cmpl $0x8, %ecx
jbe 0xb23d8
cmpl $0x28, %eax
je 0xb26bf
cmpl $0x32, %eax
je 0xb26a9
cmpl $0x36, %eax
je 0xb26bb
cmpl $0x48, %eax
je 0xb26a5
cmpl $0x6c, %eax
je 0xb26ad
cmpl $0x6e, %eax
je 0xb26b4
cmpl $0x74, %eax
jne 0xb25e6
movl $0x92, %ebp
jmp 0xb26c2
movzwl 0x4(%r14), %eax
andl $-0x2, %eax
cmpl $0x6, %eax
je 0xb2410
cmpl $0x4, %eax
jne 0xb2517
movzwl 0x4(%r15), %eax
andl $-0x2, %eax
cmpw $0x4, %ax
jne 0xb24de
movq %r12, %rdi
callq 0x8b82a
pushq $0x34
popq %rbp
testq %rax, %rax
je 0xb26c2
movq %rax, %r12
movq 0x8(%r15), %rax
cmpq $0x0, 0x20(%rax)
jne 0xb26c2
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
callq 0x36782
testq %rax, %rax
je 0xb26c2
movq %rax, %r15
movq 0x8(%r14), %rax
cmpq $0x0, 0x20(%rax)
jne 0xb26c2
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
callq 0x36782
testq %rax, %rax
je 0xb26c2
movq 0x10(%rbx), %rax
movq %r15, 0x28(%rax)
movq 0x10(%rbx), %rax
movq $-0x40001, %r15         # imm = 0xFFFBFFFF
andq %r15, (%rax)
movq 0x8(%r14), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
callq 0x36782
movq 0x10(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq %rax, 0x28(%rcx)
movq 0x10(%rbx), %rax
movq 0x10(%rax), %rax
andq %r15, (%rax)
movq 0x10(%rbx), %rax
movq %r12, 0x20(%rax)
jmp 0xb24d5
movzwl 0x4(%r15), %eax
andl $-0x2, %eax
leal -0x2(%rax), %ecx
cmpl $0x8, %ecx
ja 0xb23b3
leaq 0x22808(%rip), %rax     # 0xd4b94
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
pushq $0x46
jmp 0xb26c1
leaq 0x22839(%rip), %rax     # 0xd4bdc
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
pushq $0x1e
jmp 0xb26c1
cmpl $0x22, %eax
je 0xb25c1
cmpl $0x4e, %eax
je 0xb25a2
cmpl $0x6c, %eax
jne 0xb2567
movl $0x8e, %ebp
jmp 0xb26c2
leaq 0x227d9(%rip), %rax     # 0xd4bb8
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x10(%r14), %rax
movq 0x10(%rbx), %rcx
movq %rax, 0x18(%rcx)
pushq $0x3e
jmp 0xb26c1
cmpl $0x20, %eax
je 0xb259b
cmpl $0x22, %eax
jne 0xb2437
pushq $0x5a
jmp 0xb26c1
movl $0x801, %ecx            # imm = 0x801
xorl (%r15), %ecx
movzwl 0x4(%r15), %eax
andl $0xfffe, %eax           # imm = 0xFFFE
movl %eax, %edx
xorl $0x6, %edx
orw %cx, %dx
jne 0xb250a
pushq $0x48
jmp 0xb26c1
movq 0x10(%rbx), %rax
movq 0x10(%rax), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x20(%rax)
movl $0x15e, %ebp            # imm = 0x15E
jmp 0xb26c2
movq 0x10(%r14), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbx), %rcx
movq %rax, 0x18(%rcx)
movzbl (%r15), %eax
leaq 0x67544(%rip), %rcx     # 0x1199b0
pushq $0x42
popq %rbp
cmpb $0x1, (%rax,%rcx)
jne 0xb26c2
movq 0x8(%r14), %rax
cmpq $0x0, 0x20(%rax)
jne 0xb26c2
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
callq 0x3676f
testq %rax, %rax
je 0xb26c2
movq %rax, %r14
movq %r12, %rdi
callq 0x8b82a
testq %rax, %rax
je 0xb26c2
movq 0x10(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq %r14, 0x28(%rcx)
movq 0x10(%rbx), %rcx
movq 0x10(%rcx), %rcx
andq $-0x40001, (%rcx)       # imm = 0xFFFBFFFF
movq 0x10(%rbx), %rcx
movq %rax, 0x20(%rcx)
orb $0x8, 0x3(%rbx)
jmp 0xb26c2
cmpw $0x6, %ax
jne 0xb2517
cmpw $0x801, (%r15)          # imm = 0x801
jne 0xb2517
pushq $0x4a
jmp 0xb26c1
movq 0x10(%r14), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbx), %rcx
movq %rax, 0x18(%rcx)
pushq $0x38
jmp 0xb26c1
cmpw $0x4, %ax
jne 0xb2517
pushq $0x4c
jmp 0xb26c1
movl $0x150, %ebp            # imm = 0x150
jmp 0xb26c2
movq 0x10(%r14), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbx), %rcx
movq %rax, 0x18(%rcx)
movq 0x10(%r14), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbx), %rcx
movq %rax, 0x20(%rcx)
pushq $0x2a
jmp 0xb26c1
movq 0x10(%r14), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbx), %rcx
movq %rax, 0x20(%rcx)
pushq $0x3a
jmp 0xb26c1
movl $0x15c, %ebp            # imm = 0x15C
jmp 0xb26c2
pushq $0x3c
jmp 0xb26c1
pushq $0x40
jmp 0xb26c1
pushq $0x52
jmp 0xb26c1
pushq $0x30
jmp 0xb26c1
pushq $0x50
jmp 0xb26c1
pushq $0x4e
jmp 0xb26c1
pushq $0x5c
jmp 0xb26c1
movq 0x10(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x28(%rbx)
andb $-0x5, 0x2(%rbx)
pushq $0x62
jmp 0xb26c1
movq 0x10(%rbx), %rax
movq 0x8(%rax), %rcx
movq 0x10(%rcx), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x18(%rax)
pushq $0x5e
jmp 0xb26c1
movl $0x9c, %ebp
jmp 0xb26c2
movl $0x154, %ebp            # imm = 0x154
jmp 0xb26c2
pushq $0x20
jmp 0xb26c1
pushq $0x24
jmp 0xb26c1
pushq $0x22
jmp 0xb26c1
pushq $0x26
jmp 0xb26c1
movq 0x10(%r14), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbx), %rcx
movq %rax, 0x18(%rcx)
movq 0x10(%r14), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbx), %rcx
movq %rax, 0x20(%rcx)
pushq $0x2c
jmp 0xb26c1
movq 0x10(%r14), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbx), %rcx
movq %rax, 0x18(%rcx)
pushq $0x28
jmp 0xb26c1
movq 0x10(%r14), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbx), %rcx
movq %rax, 0x18(%rcx)
movq 0x10(%r14), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbx), %rcx
movq %rax, 0x20(%rcx)
pushq $0x36
jmp 0xb26c1
movq 0x10(%r14), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbx), %rcx
movq %rax, 0x20(%rcx)
pushq $0x2e
jmp 0xb26c1
pushq $0x66
jmp 0xb26c1
pushq $0x68
jmp 0xb26c1
movl $0x86, %ebp
jmp 0xb26c2
movl $0x88, %ebp
jmp 0xb26c2
pushq $0x64
jmp 0xb26c1
pushq $0x60
jmp 0xb26c1
pushq $0x54
jmp 0xb26c1
movl $0x8c, %ebp
jmp 0xb26c2
movl $0x90, %ebp
jmp 0xb26c2
pushq $0x56
jmp 0xb26c1
pushq $0x58
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq