// File: /workspace/github_cpp_makefile_star2_O3/girdhari9[P]TEXPLORER/pointer_move.cpp
// Function: pointer_move()
int pointer_move(){
    mode = 1;
    string path;
    int cur_pos;
    init_setting();
    string path1;

    //To handle ctlr+c signal
    struct sigaction sigIntHandler;
    sigIntHandler.sa_handler = my_handler;
    sigemptyset(&sigIntHandler.sa_mask);
    sigIntHandler.sa_flags = 0;
    sigaction(SIGINT, &sigIntHandler, NULL);

    while(c != 'q'){
        fflush(stdin);
        fflush(stdout);
        path = new_path;
        cur_pos = itemCounter;
    		switch(c = getchar()){
    		    case 'A': if(x > 1) screen_point(--x,y,0);
                        else if(up != 0){ 
                            up--; list_print(path,1,1);
                        } break;
    		    case 'B': if(x < cur_pos && x < screen_limit) screen_point(++x,y,0); 
                          else if(up + screen_limit < n){
                                up++; list_print(path,1,2);
                          } break;
    		    case 'C':{ up = 0, x = 1;
                        fflush(stdout); fflush(stdin);
                        if(!forword_st.empty()){
                            path1 = forword_st.top();
                            back_st.push(path1);
                            forword_st.pop(); list_print(path1,1,0); 
                        }
                        break;
                    } 
    		    case 'D':{ up = 0, x = 1;
                        if(!back_st.empty()){
                            path1 = back_st.top(); forword_st.push(path1);
                            back_st.pop(); list_print(path1,1,0); 
                        }
                        break;
                    }
                case 10:{
                        back_st.push(path);
                        list_print(path,x,0);  
                    break;
                } 
                case 127:{ up = 0, x = 1;
                        if(new_path != home_path){
                        size_t found = new_path.find_last_of("/\\");
                        path1 = new_path.substr(0,found);
                        forword_st.push(path1);
                        back_st.pop(); list_print(path1,1,0); break;
                    }
                }
                case 104: up = 0, x = 1;
                        list_print(home_path,1,0); break;
                case 58:  cmd_main(path); break;
    		    default: break;
    	    }
    }
    re_init_setting();
    my_handler(1);
    exit(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
leaq 0xcf34(%rip), %rax      # 0x11258
movl $0x1, (%rax)
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
xorl %ebx, %ebx
movq %rbx, -0x8(%rax)
movb %bl, (%rax)
callq 0x4ae4
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbx, -0x8(%rax)
movb %bl, (%rax)
leaq 0x7ed(%rip), %rax       # 0x4b43
leaq 0x168(%rsp), %rbx
movq %rax, -0x8(%rbx)
movq %rbx, %rdi
callq 0x2310
movl $0x0, 0x80(%rbx)
leaq 0x160(%rsp), %rsi
movl $0x2, %edi
xorl %edx, %edx
callq 0x2320
cmpl $0x71, 0xd479(%rip)     # 0x11808
jne 0x43a6
leaq 0xd3f8(%rip), %rdx      # 0x11790
xorl %edi, %edi
xorl %esi, %esi
callq 0x2330
callq 0x4b43
movq 0xcbf3(%rip), %r15      # 0x10fa0
leaq 0xd3ac(%rip), %rbx      # 0x11760
leaq 0x20(%rsp), %r13
leaq 0x8d4c(%rip), %r14      # 0xd10c
leaq 0x120(%rsp), %rbp
movq 0xcbf1(%rip), %rax      # 0x10fc0
movq (%rax), %rdi
callq 0x22c0
movq (%r15), %rdi
callq 0x22c0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2140
leaq 0xd367(%rip), %rax      # 0x11758
movl (%rax), %r12d
callq 0x2340
movl %eax, 0xd409(%rip)      # 0x11808
cmpl $0x67, %eax
jg 0x4453
leal -0x3a(%rax), %ecx
cmpl $0xa, %ecx
ja 0x44cf
movslq (%r14,%rcx,4), %rcx
addq %r14, %rcx
jmpq *%rcx
leaq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rdi
callq 0x2aec
leaq 0x40(%rsp), %rdi
callq 0x6208
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rcx
jmp 0x494e
cmpl $0x7f, %eax
je 0x474b
cmpl $0x68, %eax
jne 0x4967
leaq 0xd20c(%rip), %rax      # 0x11678
movq (%rax), %r12
movq 0x8(%rax), %r13
leaq 0xd306(%rip), %rax      # 0x11780
movl $0x0, (%rax)
leaq 0xcdd5(%rip), %rax      # 0x1125c
movl $0x1, (%rax)
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
addq %r12, %r13
leaq 0x60(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2aec
leaq 0x20(%rsp), %r13
leaq 0x60(%rsp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2fcc
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rcx
jmp 0x494e
cmpl $0xa, %eax
jne 0x4967
leaq 0xd1d9(%rip), %rdi      # 0x116b8
movq %r13, %rsi
callq 0x4072
leaq 0x90(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0x80(%rsp), %rdi
callq 0x2aec
leaq 0xcd44(%rip), %rax      # 0x1125c
movl (%rax), %esi
leaq 0x80(%rsp), %rdi
xorl %edx, %edx
callq 0x2fcc
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rcx
jmp 0x494e
leaq 0xd23b(%rip), %rax      # 0x11780
movl $0x0, (%rax)
leaq 0xcd0a(%rip), %rax      # 0x1125c
movl $0x1, (%rax)
movq (%r15), %rdi
callq 0x22c0
movq 0xca59(%rip), %rax      # 0x10fc0
movq (%rax), %rdi
callq 0x22c0
leaq 0xd192(%rip), %rax      # 0x11708
movq 0x30(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x4961
leaq 0xd17d(%rip), %rax      # 0x11708
cmpq 0x38(%rax), %rsi
jne 0x45a8
leaq 0xd170(%rip), %rax      # 0x11708
movq 0x48(%rax), %rax
movq -0x8(%rax), %rsi
movl $0x200, %eax            # imm = 0x200
addq %rax, %rsi
addq $-0x20, %rsi
movq %rsp, %rdi
callq 0x2140
leaq 0xd0fd(%rip), %rdi      # 0x116b8
movq %rsp, %rsi
callq 0x4072
leaq 0xd13e(%rip), %rdi      # 0x11708
callq 0x4cc2
leaq 0xd0(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc0(%rsp), %rdi
callq 0x2aec
leaq 0xc0(%rsp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2fcc
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rcx
jmp 0x494e
leaq 0xcc34(%rip), %rax      # 0x1125c
movl (%rax), %edi
cmpl %r12d, %edi
setl %cl
leaq 0xd151(%rip), %rax      # 0x11788
movl (%rax), %eax
cmpl %eax, %edi
setl %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x486d
incl %edi
jmp 0x4661
leaq 0xcc08(%rip), %rax      # 0x1125c
movl (%rax), %edi
cmpl $0x2, %edi
jl 0x48e5
decl %edi
leaq 0xcbf4(%rip), %rax      # 0x1125c
movl %edi, (%rax)
leaq 0xcbef(%rip), %rax      # 0x11260
movl (%rax), %esi
xorl %edx, %edx
callq 0x2c18
jmp 0x4961
leaq 0xd0fa(%rip), %rax      # 0x11780
movl $0x0, (%rax)
leaq 0xcbc9(%rip), %rax      # 0x1125c
movl $0x1, (%rax)
leaq 0xd018(%rip), %rax      # 0x116b8
movq 0x30(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x4961
leaq 0xd003(%rip), %rax      # 0x116b8
cmpq 0x38(%rax), %rsi
jne 0x46d2
leaq 0xcff6(%rip), %rax      # 0x116b8
movq 0x48(%rax), %rax
movq -0x8(%rax), %rsi
movl $0x200, %eax            # imm = 0x200
addq %rax, %rsi
addq $-0x20, %rsi
movq %rsp, %rdi
callq 0x2140
leaq 0xd023(%rip), %rdi      # 0x11708
movq %rsp, %rsi
callq 0x4072
leaq 0xcfc4(%rip), %rdi      # 0x116b8
callq 0x4cc2
leaq 0xb0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa0(%rsp), %rdi
callq 0x2aec
leaq 0xa0(%rsp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2fcc
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rcx
jmp 0x494e
leaq 0xd02e(%rip), %rax      # 0x11780
movl $0x0, (%rax)
leaq 0xcafd(%rip), %rax      # 0x1125c
movl $0x1, (%rax)
movq 0x8(%rbx), %r13
leaq 0xcf08(%rip), %rax      # 0x11678
cmpq 0x8(%rax), %r13
jne 0x479f
leaq 0xcefb(%rip), %rax      # 0x11678
movq (%rax), %r12
testq %r13, %r13
je 0x4975
movq (%rbx), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2240
testl %eax, %eax
je 0x4473
movl $0x2, %ecx
movq %rbx, %rdi
leaq 0x88d2(%rip), %rsi      # 0xd080
movq $-0x1, %rdx
callq 0x2470
leaq 0x140(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x2250
movq %rsp, %rdi
movq %r12, %rsi
callq 0x22f0
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x4802
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0xceff(%rip), %rdi      # 0x11708
movq %rsp, %rsi
callq 0x4072
leaq 0x20(%rsp), %r13
movq %rbp, %r12
leaq 0xce98(%rip), %rdi      # 0x116b8
callq 0x4cc2
leaq 0x130(%rsp), %rax
movq %rax, 0x120(%rsp)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x2aec
movq %r12, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2fcc
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rcx
jmp 0x494e
leaq 0xcf0c(%rip), %rcx      # 0x11780
movl (%rcx), %ecx
addl %ecx, %eax
leaq 0xcf05(%rip), %rdx      # 0x11784
cmpl (%rdx), %eax
jge 0x4961
incl %ecx
leaq 0xcef0(%rip), %rax      # 0x11780
movl %ecx, (%rax)
leaq 0xf0(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0xe0(%rsp), %rdi
callq 0x2aec
leaq 0xe0(%rsp), %rdi
movl $0x1, %esi
movl $0x2, %edx
callq 0x2fcc
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rcx
jmp 0x494e
leaq 0xce94(%rip), %rax      # 0x11780
movl (%rax), %eax
testl %eax, %eax
je 0x4961
decl %eax
leaq 0xce85(%rip), %rcx      # 0x11780
movl %eax, (%rcx)
leaq 0x110(%rsp), %rax
movq %rax, 0x100(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0x100(%rsp), %rdi
callq 0x2aec
leaq 0x100(%rsp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x2fcc
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rcx
movq %rcx, %rax
cmpq %rcx, %rdi
je 0x4961
movq (%rax), %rsi
incq %rsi
callq 0x2230
movl 0xcea1(%rip), %eax      # 0x11808
cmpl $0x71, %eax
jne 0x43c8
jmp 0x4391
xorl %r13d, %r13d
jmp 0x4473
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x4aa5
movq 0xf0(%rsp), %rsi
jmp 0x4a94
movq %rax, %rbx
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x4aa5
movq 0x110(%rsp), %rsi
jmp 0x4a94
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x4aa5
movq 0xb0(%rsp), %rsi
jmp 0x4a94
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x4aa5
movq 0xd0(%rsp), %rsi
jmp 0x4a94
movq %rax, %rbx
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x4aa5
movq 0x130(%rsp), %rsi
jmp 0x4a94
jmp 0x4aa2
movq %rax, %rbx
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x4aa5
movq 0x90(%rsp), %rsi
jmp 0x4a94
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x4aa5
movq 0x50(%rsp), %rsi
jmp 0x4a94
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x4aa5
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x4aa5
jmp 0x4aa2
jmp 0x4aa2
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4ac0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x4adc
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x2400