// File: /workspace/github_cpp_makefile_star2_O1/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 0xcf60(%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 0x4a8f
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbx, -0x8(%rax)
movb %bl, (%rax)
leaq 0x7c4(%rip), %rax       # 0x4aee
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, 0xd4a5(%rip)     # 0x11808
je 0x4913
movq 0xcc50(%rip), %r13      # 0x10fc0
movq 0xcc29(%rip), %r12      # 0x10fa0
leaq 0xd3e2(%rip), %rbx      # 0x11760
leaq 0x20(%rsp), %r14
leaq 0x8d52(%rip), %r15      # 0xd0dc
movq (%r13), %rdi
callq 0x22c0
movq (%r12), %rdi
callq 0x22c0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2140
leaq 0xd3aa(%rip), %rax      # 0x11758
movl (%rax), %ebp
callq 0x2340
movl %eax, 0xd44d(%rip)      # 0x11808
cmpl $0x67, %eax
jg 0x440f
leal -0x3a(%rax), %ecx
cmpl $0xa, %ecx
ja 0x459c
movslq (%r15,%rcx,4), %rax
addq %r15, %rax
jmpq *%rax
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 0x61c0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rcx
jmp 0x48f3
cmpl $0x68, %eax
je 0x453d
cmpl $0x7f, %eax
jne 0x4906
leaq 0xd358(%rip), %rax      # 0x11780
movl $0x0, (%rax)
leaq 0xce27(%rip), %rax      # 0x1125c
movl $0x1, (%rax)
movq 0x8(%rbx), %rdx
leaq 0xd232(%rip), %rax      # 0x11678
cmpq 0x8(%rax), %rdx
jne 0x446f
testq %rdx, %rdx
je 0x453d
leaq 0xd21c(%rip), %rax      # 0x11678
movq (%rax), %rsi
movq (%rbx), %rdi
callq 0x2240
testl %eax, %eax
je 0x453d
movl $0x2, %ecx
movq %rbx, %rdi
leaq 0x8bd4(%rip), %rsi      # 0xd052
movq $-0x1, %rdx
callq 0x2470
leaq 0x140(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x2250
movq %rsp, %rdi
movq %rbp, %rsi
callq 0x22f0
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x44d2
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0xd22f(%rip), %rdi      # 0x11708
movq %rsp, %rsi
callq 0x4044
leaq 0x120(%rsp), %rbp
leaq 0xd1c8(%rip), %rdi      # 0x116b8
callq 0x4c64
leaq 0x130(%rsp), %rax
movq %rax, 0x120(%rsp)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x2aec
movq %rbp, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2fb8
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rcx
jmp 0x48f3
leaq 0xd23c(%rip), %rax      # 0x11780
movl $0x0, (%rax)
leaq 0xcd0b(%rip), %rax      # 0x1125c
movl $0x1, (%rax)
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0xd110(%rip), %rax      # 0x11678
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0x2aec
leaq 0x60(%rsp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2fb8
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rcx
jmp 0x48f3
cmpl $0xa, %eax
jne 0x4906
leaq 0xd10c(%rip), %rdi      # 0x116b8
movq %r14, %rsi
callq 0x4044
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 0xcc77(%rip), %rax      # 0x1125c
movl (%rax), %esi
leaq 0x80(%rsp), %rdi
xorl %edx, %edx
callq 0x2fb8
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rcx
jmp 0x48f3
leaq 0xd16e(%rip), %rax      # 0x11780
movl $0x0, (%rax)
leaq 0xcc3d(%rip), %rax      # 0x1125c
movl $0x1, (%rax)
movq (%r12), %rdi
callq 0x22c0
movq (%r13), %rdi
callq 0x22c0
leaq 0xd0ca(%rip), %rax      # 0x11708
movq 0x30(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x4906
leaq 0xd0b5(%rip), %rax      # 0x11708
cmpq 0x38(%rax), %rsi
jne 0x4670
leaq 0xd0a8(%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 0xd035(%rip), %rdi      # 0x116b8
movq %rsp, %rsi
callq 0x4044
leaq 0xd076(%rip), %rdi      # 0x11708
callq 0x4c64
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 0x2fb8
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rcx
jmp 0x48f3
leaq 0xcb6c(%rip), %rax      # 0x1125c
movl (%rax), %edi
cmpl %ebp, %edi
setl %cl
leaq 0xd08a(%rip), %rax      # 0x11788
movl (%rax), %eax
cmpl %eax, %edi
setl %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x4812
incl %edi
jmp 0x4728
leaq 0xcb41(%rip), %rax      # 0x1125c
movl (%rax), %edi
cmpl $0x2, %edi
jl 0x488a
decl %edi
leaq 0xcb2d(%rip), %rax      # 0x1125c
movl %edi, (%rax)
leaq 0xcb28(%rip), %rax      # 0x11260
movl (%rax), %esi
xorl %edx, %edx
callq 0x2c0c
jmp 0x4906
leaq 0xd033(%rip), %rax      # 0x11780
movl $0x0, (%rax)
leaq 0xcb02(%rip), %rax      # 0x1125c
movl $0x1, (%rax)
leaq 0xcf51(%rip), %rax      # 0x116b8
movq 0x30(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x4906
leaq 0xcf3c(%rip), %rax      # 0x116b8
cmpq 0x38(%rax), %rsi
jne 0x4799
leaq 0xcf2f(%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 0xcf5c(%rip), %rdi      # 0x11708
movq %rsp, %rsi
callq 0x4044
leaq 0xcefd(%rip), %rdi      # 0x116b8
callq 0x4c64
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 0x2fb8
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rcx
jmp 0x48f3
leaq 0xcf67(%rip), %rcx      # 0x11780
movl (%rcx), %ecx
addl %ecx, %eax
leaq 0xcf60(%rip), %rdx      # 0x11784
cmpl (%rdx), %eax
jge 0x4906
incl %ecx
leaq 0xcf4b(%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 0x2fb8
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rcx
jmp 0x48f3
leaq 0xceef(%rip), %rax      # 0x11780
movl (%rax), %eax
testl %eax, %eax
je 0x4906
decl %eax
leaq 0xcee0(%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 0x2fb8
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rcx
movq %rcx, %rax
cmpq %rcx, %rdi
je 0x4906
movq (%rax), %rsi
incq %rsi
callq 0x2230
cmpl $0x71, 0xcefb(%rip)     # 0x11808
jne 0x438a
leaq 0xce76(%rip), %rdx      # 0x11790
xorl %edi, %edi
xorl %esi, %esi
callq 0x2330
callq 0x4aee
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x4a50
movq 0xf0(%rsp), %rsi
jmp 0x4a3f
movq %rax, %rbx
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x4a50
movq 0x110(%rsp), %rsi
jmp 0x4a3f
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x4a50
movq 0xb0(%rsp), %rsi
jmp 0x4a3f
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x4a50
movq 0xd0(%rsp), %rsi
jmp 0x4a3f
movq %rax, %rbx
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x4a50
movq 0x130(%rsp), %rsi
jmp 0x4a3f
jmp 0x4a4d
movq %rax, %rbx
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x4a50
movq 0x90(%rsp), %rsi
jmp 0x4a3f
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x4a50
movq 0x50(%rsp), %rsi
jmp 0x4a3f
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x4a50
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x4a50
jmp 0x4a4d
jmp 0x4a4d
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4a6b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x4a87
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x2400