// File: pointwiseproduct[P]untyped_lambda/untyped_lambda.cpp
// Function: internal_data::lo_most_reduction(std::unique_ptr<internal_data::expr, std::default_delete<internal_data::expr>>&)
bool lo_most_reduction(std::unique_ptr<expr> &e){
        if(e->get_kind() == expr::kind::sequence){
            sequence *seq = static_cast<sequence*>(e.get());
            if(seq->vec.size() == 1){
                e.swap(seq->vec[0]);
                return true;
            }else{
                bool mod = false;
                seq->vec[0].reset(seq->vec[0]->replace(expr::variable_map(), assignment_table, mod));
                if(seq->vec[0]->get_kind() == expr::kind::lambda){
                    lambda &lam = *static_cast<lambda*>(seq->vec[0].get());
                    std::size_t s = (std::min)(lam.variable_seq.size(), seq->vec.size() - 1);
                    expr::variable_map map;
                    if(lam.variable_seq.size() <= s){
                        for(std::size_t i = 0; i < lam.variable_seq.size(); ++i){
                            map.insert(std::make_pair(lam.variable_seq[i].str, seq->vec[i + 1].get()));
                        }
                        {
                            expr *f = lam.seq->replace(map, assignment_table, mod);
                            seq->vec.erase(seq->vec.begin(), seq->vec.begin() + s + 1);
                            seq->vec.insert(seq->vec.begin(), std::move(std::unique_ptr<expr>(f)));
                        }
                        if(seq->vec.size() > 1){
                            return true;
                        }else{
                            std::unique_ptr<expr> f(std::move(*seq->vec.begin()));
                            *seq->vec.begin() = nullptr;
                            e.swap(f);
                            return true;
                        }
                    }else{
                        if(s > 0){
                            for(std::size_t i = 0; i < s; ++i){
                                map.insert(std::make_pair(lam.variable_seq[i].str, seq->vec[i + 1].get()));
                            }
                            std::unique_ptr<expr> f(lam.seq->replace(map, assignment_table, mod));
                            if(f->get_kind() == expr::kind::sequence){
                                lam.seq.swap(f);
                            }else{
                                lam.get_seq()->vec.clear();
                                lam.get_seq()->vec.push_back(std::move(f));
                            }
                            lam.variable_seq.erase(lam.variable_seq.begin(), lam.variable_seq.begin() + s);
                        }
                        e.swap(seq->vec[0]);
                        return true;
                    }
                }else{
                    if(seq->vec[0]->get_kind() == expr::kind::variable){
                        return lo_most_reduction(seq->vec[0]);
                    }else{
                        return lo_most_reduction(seq->vec[0]);
                    }
                }
            }
        }else if(e->get_kind() == expr::kind::lambda){
            return lo_most_reduction(static_cast<lambda*>(e.get())->seq);
        }else if(e->get_kind() == expr::kind::variable){
            variable *var = static_cast<variable*>(e.get());
            auto iter = assignment_table.find(var->str);
            if(iter != assignment_table.end()){
                e.reset(iter->second->copy());
                return true;
            }else{
                return false;
            }
        }

        // unreached point.
        return false;
    }

// Assembly:
subq $0x2f8, %rsp            # imm = 0x2F8
movq %rdi, 0x2e8(%rsp)
movq 0x2e8(%rsp), %rdi
callq 0xb9c0
movq %rax, %rdi
movq (%rdi), %rax
callq *(%rax)
cmpl $0x1, %eax
jne 0x7845
movq 0x2e8(%rsp), %rdi
callq 0xb9d0
movq %rax, 0x2e0(%rsp)
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
callq 0xbba0
cmpq $0x1, %rax
jne 0x6ebb
movq 0x2e8(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xbbf0
movq 0xd8(%rsp), %rdi
movq %rax, %rsi
callq 0xbbc0
movb $0x1, 0x2f7(%rsp)
jmp 0x7962
movb $0x0, 0x2df(%rsp)
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
movq %rsi, 0xb0(%rsp)
callq 0xbbf0
movq 0xb0(%rsp), %rsi
movq %rax, 0xb8(%rsp)
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
callq 0xbbf0
movq %rax, %rdi
callq 0xb9c0
movq %rax, 0xc0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x2c0(%rsp)
movaps %xmm0, 0x2b0(%rsp)
movaps %xmm0, 0x2a0(%rsp)
leaq 0x2a0(%rsp), %rdi
movq %rdi, 0xc8(%rsp)
callq 0xbc10
movq 0xc0(%rsp), %rdi
movq 0xc8(%rsp), %rsi
movq (%rdi), %rax
movq 0x10(%rax), %rax
leaq 0x1f441(%rip), %rdx     # 0x263a0
leaq 0x2df(%rsp), %rcx
callq *%rax
movq %rax, 0xd0(%rsp)
jmp 0x6f73
movq 0xd0(%rsp), %rsi
movq 0xb8(%rsp), %rdi
callq 0xba80
leaq 0x2a0(%rsp), %rdi
callq 0xbc20
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xbbf0
movq %rax, %rdi
callq 0xb9c0
movq %rax, %rdi
movq (%rdi), %rax
callq *(%rax)
cmpl $0x2, %eax
jne 0x77c5
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xbbf0
movq %rax, %rdi
callq 0xb9d0
movq %rax, 0x288(%rsp)
movq 0x288(%rsp), %rdi
addq $0x8, %rdi
callq 0xbc70
movq %rax, 0x278(%rsp)
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
callq 0xbba0
subq $0x1, %rax
movq %rax, 0x270(%rsp)
leaq 0x278(%rsp), %rdi
leaq 0x270(%rsp), %rsi
callq 0xbc30
movq (%rax), %rax
movq %rax, 0x280(%rsp)
leaq 0x240(%rsp), %rdi
callq 0xbc10
movq 0x288(%rsp), %rdi
addq $0x8, %rdi
callq 0xbc70
cmpq 0x280(%rsp), %rax
ja 0x7480
movq $0x0, 0x238(%rsp)
movq 0x238(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0x288(%rsp), %rdi
addq $0x8, %rdi
callq 0xbc70
movq %rax, %rcx
movq 0xa8(%rsp), %rax
cmpq %rcx, %rax
jae 0x71ea
movq 0x288(%rsp), %rdi
addq $0x8, %rdi
movq 0x238(%rsp), %rsi
callq 0xbd20
addq $0x8, %rax
movq %rax, 0xa0(%rsp)
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
movq 0x238(%rsp), %rsi
incq %rsi
callq 0xbbf0
movq %rax, %rdi
callq 0xb9d0
movq 0xa0(%rsp), %rsi
movq %rax, 0x208(%rsp)
leaq 0x210(%rsp), %rdi
leaq 0x208(%rsp), %rdx
callq 0xbce0
jmp 0x711b
leaq 0x240(%rsp), %rdi
leaq 0x210(%rsp), %rsi
callq 0xbc90
movb %dl, 0x97(%rsp)
movq %rax, 0x98(%rsp)
jmp 0x7141
movb 0x97(%rsp), %al
movq 0x98(%rsp), %rcx
movq %rcx, 0x1f8(%rsp)
movb %al, 0x200(%rsp)
leaq 0x210(%rsp), %rdi
callq 0xbd40
movq 0x238(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x238(%rsp)
jmp 0x7076
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x298(%rsp)
movl %eax, 0x294(%rsp)
leaq 0x2a0(%rsp), %rdi
callq 0xbc20
jmp 0x7973
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x298(%rsp)
movl %eax, 0x294(%rsp)
jmp 0x77b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x298(%rsp)
movl %eax, 0x294(%rsp)
leaq 0x210(%rsp), %rdi
callq 0xbd40
jmp 0x77b3
movq 0x288(%rsp), %rdi
addq $0x20, %rdi
callq 0xb9c0
movq %rax, %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
leaq 0x1f194(%rip), %rdx     # 0x263a0
leaq 0x240(%rsp), %rsi
leaq 0x2df(%rsp), %rcx
callq *%rax
movq %rax, 0x88(%rsp)
jmp 0x7228
movq 0x88(%rsp), %rax
movq %rax, 0x1f0(%rsp)
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
movq %rdi, 0x78(%rsp)
callq 0xbad0
movq %rax, 0x1e0(%rsp)
leaq 0x1e8(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
callq 0xbdf0
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
callq 0xbad0
movq %rax, 0x1c0(%rsp)
movq 0x280(%rsp), %rsi
leaq 0x1c0(%rsp), %rdi
callq 0xbe30
movq %rax, 0x1c8(%rsp)
leaq 0x1c8(%rsp), %rdi
movl $0x1, %esi
callq 0xbe30
movq %rax, 0x1d0(%rsp)
leaq 0x1d8(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0xbdf0
movq 0x78(%rsp), %rdi
movq 0x1e8(%rsp), %rsi
movq 0x1d8(%rsp), %rdx
callq 0xbd50
movq %rax, 0x80(%rsp)
jmp 0x72f4
movq 0x80(%rsp), %rax
movq %rax, 0x1b8(%rsp)
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
movq %rdi, 0x60(%rsp)
callq 0xbad0
movq %rax, 0x1a8(%rsp)
leaq 0x1b0(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0xbdf0
movq 0x1f0(%rsp), %rsi
leaq 0x1a0(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0xbeb0
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rdx
movq 0x1b0(%rsp), %rsi
callq 0xbe70
movq %rax, 0x70(%rsp)
jmp 0x736f
movq 0x70(%rsp), %rax
movq %rax, 0x198(%rsp)
leaq 0x1a0(%rsp), %rdi
callq 0xbee0
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
callq 0xbba0
cmpq $0x1, %rax
jbe 0x73de
movb $0x1, 0x2f7(%rsp)
movl $0x1, 0x194(%rsp)
jmp 0x77a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x298(%rsp)
movl %eax, 0x294(%rsp)
leaq 0x1a0(%rsp), %rdi
callq 0xbee0
jmp 0x77b3
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
callq 0xbad0
movq %rax, 0x180(%rsp)
leaq 0x180(%rsp), %rdi
callq 0xbb70
movq %rax, %rsi
leaq 0x188(%rsp), %rdi
callq 0xbf40
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
callq 0xbad0
movq %rax, 0x178(%rsp)
leaq 0x178(%rsp), %rdi
callq 0xbb70
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xbf70
movq 0x2e8(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0xbbc0
movb $0x1, 0x2f7(%rsp)
movl $0x1, 0x194(%rsp)
leaq 0x188(%rsp), %rdi
callq 0xbee0
jmp 0x77a1
cmpq $0x0, 0x280(%rsp)
jbe 0x775f
movq $0x0, 0x170(%rsp)
movq 0x170(%rsp), %rax
cmpq 0x280(%rsp), %rax
jae 0x759f
movq 0x288(%rsp), %rdi
addq $0x8, %rdi
movq 0x170(%rsp), %rsi
callq 0xbd20
addq $0x8, %rax
movq %rax, 0x58(%rsp)
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
movq 0x170(%rsp), %rsi
incq %rsi
callq 0xbbf0
movq %rax, %rdi
callq 0xb9d0
movq 0x58(%rsp), %rsi
movq %rax, 0x140(%rsp)
leaq 0x148(%rsp), %rdi
leaq 0x140(%rsp), %rdx
callq 0xbce0
jmp 0x751b
leaq 0x240(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0xbc90
movb %dl, 0x4f(%rsp)
movq %rax, 0x50(%rsp)
jmp 0x753b
movb 0x4f(%rsp), %al
movq 0x50(%rsp), %rcx
movq %rcx, 0x130(%rsp)
movb %al, 0x138(%rsp)
leaq 0x148(%rsp), %rdi
callq 0xbd40
movq 0x170(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x170(%rsp)
jmp 0x749b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x298(%rsp)
movl %eax, 0x294(%rsp)
leaq 0x148(%rsp), %rdi
callq 0xbd40
jmp 0x77b3
movq 0x288(%rsp), %rdi
addq $0x20, %rdi
callq 0xb9c0
movq %rax, %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
leaq 0x1eddf(%rip), %rdx     # 0x263a0
leaq 0x240(%rsp), %rsi
leaq 0x2df(%rsp), %rcx
callq *%rax
movq %rax, 0x40(%rsp)
jmp 0x75da
movq 0x40(%rsp), %rsi
leaq 0x128(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xbeb0
movq 0x30(%rsp), %rdi
callq 0xb9c0
movq %rax, %rdi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movl %eax, 0x3c(%rsp)
jmp 0x760c
movl 0x3c(%rsp), %eax
cmpl $0x1, %eax
jne 0x7656
movq 0x288(%rsp), %rdi
addq $0x20, %rdi
leaq 0x128(%rsp), %rsi
callq 0xbbc0
jmp 0x76a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x298(%rsp)
movl %eax, 0x294(%rsp)
leaq 0x128(%rsp), %rdi
callq 0xbee0
jmp 0x77b3
movq 0x288(%rsp), %rdi
callq 0xbfa0
movq %rax, 0x28(%rsp)
jmp 0x766a
movq 0x28(%rsp), %rdi
addq $0x8, %rdi
callq 0xbfc0
movq 0x288(%rsp), %rdi
callq 0xbfa0
movq %rax, 0x20(%rsp)
jmp 0x768c
movq 0x20(%rsp), %rdi
addq $0x8, %rdi
leaq 0x128(%rsp), %rsi
callq 0xbfe0
jmp 0x76a4
jmp 0x76a6
movq 0x288(%rsp), %rdi
addq $0x8, %rdi
movq %rdi, 0x10(%rsp)
callq 0xc0b0
movq %rax, 0x118(%rsp)
leaq 0x120(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0xc0e0
movq 0x288(%rsp), %rdi
addq $0x8, %rdi
callq 0xc0b0
movq %rax, 0x100(%rsp)
movq 0x280(%rsp), %rsi
leaq 0x100(%rsp), %rdi
callq 0xc120
movq %rax, 0x108(%rsp)
leaq 0x110(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0xc0e0
movq 0x10(%rsp), %rdi
movq 0x120(%rsp), %rsi
movq 0x110(%rsp), %rdx
callq 0xc010
movq %rax, 0x18(%rsp)
jmp 0x7745
movq 0x18(%rsp), %rax
movq %rax, 0xf8(%rsp)
leaq 0x128(%rsp), %rdi
callq 0xbee0
movq 0x2e8(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xbbf0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0xbbc0
movb $0x1, 0x2f7(%rsp)
movl $0x1, 0x194(%rsp)
leaq 0x240(%rsp), %rdi
callq 0xbc20
jmp 0x7962
leaq 0x240(%rsp), %rdi
callq 0xbc20
jmp 0x7973
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xbbf0
movq %rax, %rdi
callq 0xb9c0
movq %rax, %rdi
movq (%rdi), %rax
callq *(%rax)
cmpl $0x0, %eax
jne 0x781a
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xbbf0
movq %rax, %rdi
callq 0x6e20
andb $0x1, %al
movb %al, 0x2f7(%rsp)
jmp 0x7962
movq 0x2e0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xbbf0
movq %rax, %rdi
callq 0x6e20
andb $0x1, %al
movb %al, 0x2f7(%rsp)
jmp 0x7962
movq 0x2e8(%rsp), %rdi
callq 0xb9c0
movq %rax, %rdi
movq (%rdi), %rax
callq *(%rax)
cmpl $0x2, %eax
jne 0x7886
movq 0x2e8(%rsp), %rdi
callq 0xb9d0
movq %rax, %rdi
addq $0x20, %rdi
callq 0x6e20
andb $0x1, %al
movb %al, 0x2f7(%rsp)
jmp 0x7962
movq 0x2e8(%rsp), %rdi
callq 0xb9c0
movq %rax, %rdi
movq (%rdi), %rax
callq *(%rax)
cmpl $0x0, %eax
jne 0x7956
movq 0x2e8(%rsp), %rdi
callq 0xb9d0
movq %rax, 0xf0(%rsp)
movq 0xf0(%rsp), %rsi
addq $0x8, %rsi
leaq 0x1ead4(%rip), %rdi     # 0x263a0
callq 0xba00
movq %rax, 0xe8(%rsp)
leaq 0x1eac0(%rip), %rdi     # 0x263a0
callq 0xba50
movq %rax, 0xe0(%rsp)
leaq 0xe8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0xba30
testb $0x1, %al
jne 0x7908
jmp 0x794c
movq 0x2e8(%rsp), %rax
movq %rax, (%rsp)
leaq 0xe8(%rsp), %rdi
callq 0xbab0
movq %rax, %rdi
addq $0x20, %rdi
callq 0xb9c0
movq %rax, %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq (%rsp), %rdi
movq %rax, %rsi
callq 0xba80
movb $0x1, 0x2f7(%rsp)
jmp 0x7962
movb $0x0, 0x2f7(%rsp)
jmp 0x7962
jmp 0x7958
jmp 0x795a
movb $0x0, 0x2f7(%rsp)
movb 0x2f7(%rsp), %al
andb $0x1, %al
addq $0x2f8, %rsp            # imm = 0x2F8
retq
movq 0x298(%rsp), %rdi
callq 0x55c0