// File: pointwiseproduct[P]untyped_lambda/untyped_lambda.cpp
// Function: launch_interpreter()
void launch_interpreter(){
    while(true){
        internal_data::lines.clear();
        std::string line;
        std::getline(std::cin, line);
        if(line == "exit" || line == "quit"){
            break;
        }

        try{
            std::vector<char> line_raw(line.begin(), line.end());
            auto b = tokenize_phase2::tokenize(tokenize_phase1::tokenize(line_raw));
            if(!parsing_phase::lines(b.begin())){
                throw parsing_failed();
            }
            for(auto &i : internal_data::lines){
                bool mod;
                std::unique_ptr<internal_data::expr> q(i->replace(internal_data::expr::variable_map(), internal_data::assignment_table, mod));
                internal_data::global_variable_replace(q);

                while(true){
                    try{
                        int nest_level = 0;
                        if(internal_data::lo_most_reduction(q)){
                            std::cout << " = " << q->to_str() << "." << std::endl;
                            throw internal_data::step_out();
                        }
                    }catch(internal_data::step_out){
                        std::cout << " = " << q->to_str() << "." << std::endl;
                        if(waiting() == 'c'){
                            break;
                        }
                        continue;
                    }
                    break;
                }
            }
        }catch(app_exception e){
            std::cerr << e.what() << std::endl;
        }
    }
}

// Assembly:
subq $0x208, %rsp            # imm = 0x208
leaq 0x1d4b2(%rip), %rdi     # 0x263d0
callq 0xbfc0
leaq 0x1e8(%rsp), %rdi
movq %rdi, 0x98(%rsp)
callq 0x54e0
movq 0x98(%rsp), %rsi
movq 0x1d091(%rip), %rdi     # 0x25fd8
callq 0x5080
jmp 0x8f4e
leaq 0x12240(%rip), %rsi     # 0x1b195
leaq 0x1e8(%rsp), %rdi
callq 0xc730
movb %al, 0x97(%rsp)
jmp 0x8f6b
movb 0x97(%rsp), %al
testb $0x1, %al
jne 0x8fa2
jmp 0x8f78
leaq 0x1221b(%rip), %rsi     # 0x1b19a
leaq 0x1e8(%rsp), %rdi
callq 0xc730
movb %al, 0x96(%rsp)
jmp 0x8f95
movb 0x96(%rsp), %al
testb $0x1, %al
jne 0x8fa2
jmp 0x8fcb
movl $0x3, 0x1d8(%rsp)
jmp 0x9638
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0x9683
leaq 0x1e8(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0x5320
movq 0x80(%rsp), %rdi
movq %rax, 0x1b8(%rsp)
callq 0x51e0
movq %rax, 0x1b0(%rsp)
leaq 0x1af(%rsp), %rdi
movq %rdi, 0x88(%rsp)
callq 0x55d0
movq 0x88(%rsp), %rcx
movq 0x1b8(%rsp), %rsi
movq 0x1b0(%rsp), %rdx
leaq 0x1c0(%rsp), %rdi
callq 0xc760
jmp 0x9039
leaq 0x1af(%rsp), %rdi
callq 0x53c0
leaq 0x178(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0x5e90
jmp 0x905d
leaq 0x190(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0x6520
jmp 0x9074
leaq 0x178(%rsp), %rdi
callq 0xb5c0
leaq 0x190(%rsp), %rdi
callq 0xc7f0
movq %rax, 0x168(%rsp)
leaq 0x170(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0xc820
movq 0x170(%rsp), %rdi
callq 0x8e30
movb %al, 0x7f(%rsp)
jmp 0x90be
movb 0x7f(%rsp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x90cd
jmp 0x91a7
movl $0x10, %edi
callq 0x5180
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x70(%rsp)
callq 0xc860
jmp 0x90e9
movq 0x70(%rsp), %rdi
leaq 0x1c823(%rip), %rsi     # 0x25918
leaq 0x3824(%rip), %rdx      # 0xc920
callq 0x5590
jmp 0x96af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
leaq 0x1af(%rsp), %rdi
callq 0x53c0
jmp 0x95a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0x9594
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
leaq 0x178(%rsp), %rdi
callq 0xb5c0
jmp 0x9594
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0x9587
movq 0x70(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
callq 0x52a0
jmp 0x9587
leaq 0x1d222(%rip), %rax     # 0x263d0
movq %rax, 0x160(%rsp)
leaq 0x1d213(%rip), %rdi     # 0x263d0
callq 0xbad0
movq %rax, 0x158(%rsp)
leaq 0x1d1ff(%rip), %rdi     # 0x263d0
callq 0xbb00
movq %rax, 0x150(%rsp)
leaq 0x158(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0xbb30
testb $0x1, %al
jne 0x91fc
jmp 0x9568
leaq 0x158(%rsp), %rdi
callq 0xbb70
movq %rax, 0x148(%rsp)
movq 0x148(%rsp), %rdi
callq 0xb9c0
movq %rax, 0x58(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x120(%rsp)
movaps %xmm0, 0x110(%rsp)
movaps %xmm0, 0x100(%rsp)
leaq 0x100(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0xbc10
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq (%rdi), %rax
movq 0x10(%rax), %rax
leaq 0x1d138(%rip), %rdx     # 0x263a0
leaq 0x147(%rsp), %rcx
callq *%rax
movq %rax, 0x68(%rsp)
jmp 0x9279
movq 0x68(%rsp), %rsi
leaq 0x138(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0xbeb0
leaq 0x100(%rsp), %rdi
callq 0xbc20
movq 0x50(%rsp), %rdi
callq 0x6c90
jmp 0x92a9
jmp 0x92ab
jmp 0x92ad
movl $0x0, 0xfc(%rsp)
leaq 0x138(%rsp), %rdi
callq 0x6e20
movb %al, 0x4f(%rsp)
jmp 0x92cb
movb 0x4f(%rsp), %al
testb $0x1, %al
jne 0x92d8
jmp 0x94ce
movq 0x1cce9(%rip), %rdi     # 0x25fc8
leaq 0x11eb9(%rip), %rsi     # 0x1b19f
callq 0x5370
movq %rax, 0x40(%rsp)
jmp 0x92f2
leaq 0x138(%rsp), %rdi
callq 0xb9c0
movq %rax, %rsi
movq (%rsi), %rax
movq 0x20(%rax), %rax
leaq 0xd8(%rsp), %rdi
callq *%rax
jmp 0x9315
movq 0x40(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x5340
movq %rax, 0x38(%rsp)
jmp 0x932e
movq 0x38(%rsp), %rdi
leaq 0x11ffd(%rip), %rsi     # 0x1b337
callq 0x5370
movq %rax, 0x30(%rsp)
jmp 0x9346
movq 0x30(%rsp), %rdi
movq 0x1cc56(%rip), %rsi     # 0x25fa8
callq 0x53a0
jmp 0x9359
leaq 0xd8(%rsp), %rdi
callq 0x5210
movl $0x1, %edi
callq 0x5180
movq %rax, %rdi
leaq 0x1c5b6(%rip), %rsi     # 0x25930
xorl %eax, %eax
movl %eax, %edx
callq 0x5590
jmp 0x96af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
leaq 0x100(%rsp), %rdi
callq 0xbc20
jmp 0x9587
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0x9559
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0x93fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x5210
movl 0x1dc(%rsp), %eax
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0x9559
movq 0x1e0(%rsp), %rdi
callq 0x5130
movq 0x1cba2(%rip), %rdi     # 0x25fc8
leaq 0x11d72(%rip), %rsi     # 0x1b19f
callq 0x5370
movq %rax, 0x28(%rsp)
jmp 0x9439
leaq 0x138(%rsp), %rdi
callq 0xb9c0
movq %rax, %rsi
movq (%rsi), %rax
movq 0x20(%rax), %rax
leaq 0xb0(%rsp), %rdi
callq *%rax
jmp 0x945c
movq 0x28(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x5340
movq %rax, 0x20(%rsp)
jmp 0x9475
movq 0x20(%rsp), %rdi
leaq 0x11eb6(%rip), %rsi     # 0x1b337
callq 0x5370
movq %rax, 0x18(%rsp)
jmp 0x948d
movq 0x18(%rsp), %rdi
movq 0x1cb0f(%rip), %rsi     # 0x25fa8
callq 0x53a0
jmp 0x94a0
leaq 0xb0(%rsp), %rdi
callq 0x5210
callq 0x8f00
movl %eax, 0x14(%rsp)
jmp 0x94b8
movl 0x14(%rsp), %eax
cmpl $0x63, %eax
jne 0x9509
movl $0x7, 0x1d8(%rsp)
jmp 0x9514
jmp 0x9538
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0x952f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x5210
jmp 0x952f
movl $0x6, 0x1d8(%rsp)
callq 0x5570
jmp 0x951b
movl 0x1d8(%rsp), %eax
subl $0x6, %eax
je 0x92ab
jmp 0x952d
jmp 0x953a
callq 0x5570
jmp 0x9536
jmp 0x9559
jmp 0x953a
leaq 0x138(%rsp), %rdi
callq 0xbee0
leaq 0x158(%rsp), %rdi
callq 0xbb80
jmp 0x91de
leaq 0x138(%rsp), %rdi
callq 0xbee0
jmp 0x9587
leaq 0x190(%rsp), %rdi
callq 0xb940
leaq 0x1c0(%rsp), %rdi
callq 0xb140
jmp 0x962d
leaq 0x190(%rsp), %rdi
callq 0xb940
leaq 0x1c0(%rsp), %rdi
callq 0xb140
movl 0x1dc(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x9683
movq 0x1e0(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x5440
movq %rax, %rsi
leaq 0xa0(%rsp), %rdi
callq 0xc930
jmp 0x95d9
movq 0x8(%rsp), %rdi
callq 0x5130
leaq 0xa0(%rsp), %rdi
callq 0x54c0
movq %rax, %rsi
movq 0x1c9f6(%rip), %rdi     # 0x25ff0
callq 0x5370
movq %rax, (%rsp)
jmp 0x9605
movq (%rsp), %rdi
movq 0x1c998(%rip), %rsi     # 0x25fa8
callq 0x53a0
jmp 0x9617
leaq 0xa0(%rsp), %rdi
callq 0xb2e0
callq 0x5570
jmp 0x962b
jmp 0x962d
movl $0x0, 0x1d8(%rsp)
leaq 0x1e8(%rsp), %rdi
callq 0x5210
movl 0x1d8(%rsp), %eax
testl %eax, %eax
je 0x9654
jmp 0x9652
jmp 0x9692
jmp 0x8f17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0xb2e0
callq 0x5570
jmp 0x9681
jmp 0x9683
leaq 0x1e8(%rsp), %rdi
callq 0x5210
jmp 0x969a
addq $0x208, %rsp            # imm = 0x208
retq
movq 0x1e0(%rsp), %rdi
callq 0x55c0
movq %rax, %rdi
callq 0xae60
nop