// File: 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
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
leaq 0x11726(%rip), %rax     # 0x182f8
movl $0x1, (%rax)
leaq -0x20(%rbp), %rdi
callq 0x3460
callq 0x7300
jmp 0x6be8
leaq -0x58(%rbp), %rdi
callq 0x3460
leaq 0x768(%rip), %rax       # 0x7360
movq %rax, -0xf0(%rbp)
leaq -0xf0(%rbp), %rdi
addq $0x8, %rdi
callq 0x3410
movl $0x0, -0x68(%rbp)
movl $0x2, %edi
leaq -0xf0(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x3420
cmpl $0x71, 0x11c76(%rip)    # 0x188a8
je 0x72c1
movq 0x11381(%rip), %rax     # 0x17fc0
movq (%rax), %rdi
callq 0x33b0
jmp 0x6c49
movq 0x11350(%rip), %rax     # 0x17fa0
movq (%rax), %rdi
callq 0x33b0
jmp 0x6c5a
leaq 0x11b9f(%rip), %rsi     # 0x18800
leaq -0x20(%rbp), %rdi
callq 0x3050
jmp 0x6c6c
leaq 0x11b85(%rip), %rax     # 0x187f8
movl (%rax), %eax
movl %eax, -0x24(%rbp)
callq 0x3470
movl %eax, -0x21c(%rbp)
jmp 0x6c85
movl -0x21c(%rbp), %eax
movl %eax, 0x11c17(%rip)     # 0x188a8
subl $0xa, %eax
je 0x7079
jmp 0x6c9c
movl -0x21c(%rbp), %eax
subl $0x3a, %eax
je 0x7272
jmp 0x6cad
movl -0x21c(%rbp), %eax
subl $0x41, %eax
je 0x6d34
jmp 0x6cba
movl -0x21c(%rbp), %eax
subl $0x42, %eax
je 0x6dd3
jmp 0x6ccb
movl -0x21c(%rbp), %eax
subl $0x43, %eax
je 0x6e9f
jmp 0x6cdc
movl -0x21c(%rbp), %eax
subl $0x44, %eax
je 0x6f9d
jmp 0x6ced
movl -0x21c(%rbp), %eax
subl $0x68, %eax
je 0x7206
jmp 0x6cfe
movl -0x21c(%rbp), %eax
subl $0x7f, %eax
je 0x70e4
jmp 0x72ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x72e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x72db
leaq 0x115c1(%rip), %rax     # 0x182fc
cmpl $0x1, (%rax)
jle 0x6d61
leaq 0x115b5(%rip), %rax     # 0x182fc
movl (%rax), %edi
decl %edi
movl %edi, (%rax)
leaq 0x115ac(%rip), %rax     # 0x18300
movl (%rax), %esi
xorl %edx, %edx
callq 0x4020
jmp 0x6d5f
jmp 0x6dce
leaq 0x11ab8(%rip), %rax     # 0x18820
cmpl $0x0, (%rax)
je 0x6dcc
leaq 0x11aac(%rip), %rax     # 0x18820
movl (%rax), %ecx
decl %ecx
movl %ecx, (%rax)
leaq -0x110(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x3130
jmp 0x6d8c
leaq -0x110(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x4360
jmp 0x6da1
leaq -0x110(%rbp), %rdi
callq 0x35c8
jmp 0x6dcc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x35c8
jmp 0x72db
jmp 0x6dce
jmp 0x72bc
leaq 0x11522(%rip), %rax     # 0x182fc
movl (%rax), %eax
cmpl -0x24(%rbp), %eax
jge 0x6e19
leaq 0x11514(%rip), %rax     # 0x182fc
movl (%rax), %eax
leaq 0x11a37(%rip), %rcx     # 0x18828
cmpl (%rcx), %eax
jge 0x6e19
leaq 0x11500(%rip), %rax     # 0x182fc
movl (%rax), %edi
incl %edi
movl %edi, (%rax)
leaq 0x114f7(%rip), %rax     # 0x18300
movl (%rax), %esi
xorl %edx, %edx
callq 0x4020
jmp 0x6e14
jmp 0x6e9a
leaq 0x11a00(%rip), %rax     # 0x18820
movl (%rax), %eax
leaq 0x119ff(%rip), %rcx     # 0x18828
addl (%rcx), %eax
leaq 0x119f2(%rip), %rcx     # 0x18824
cmpl (%rcx), %eax
jge 0x6e98
leaq 0x119e3(%rip), %rax     # 0x18820
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
leaq -0x130(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x3130
jmp 0x6e55
leaq -0x130(%rbp), %rdi
movl $0x1, %esi
movl $0x2, %edx
callq 0x4360
jmp 0x6e6d
leaq -0x130(%rbp), %rdi
callq 0x35c8
jmp 0x6e98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x35c8
jmp 0x72db
jmp 0x6e9a
jmp 0x72bc
leaq 0x1197a(%rip), %rax     # 0x18820
movl $0x0, (%rax)
leaq 0x11449(%rip), %rax     # 0x182fc
movl $0x1, (%rax)
movq 0x110e0(%rip), %rax     # 0x17fa0
movq (%rax), %rdi
callq 0x33b0
jmp 0x6eca
movq 0x110ef(%rip), %rax     # 0x17fc0
movq (%rax), %rdi
callq 0x33b0
jmp 0x6edb
leaq 0x118c6(%rip), %rdi     # 0x187a8
callq 0x74f0
movb %al, -0x21d(%rbp)
jmp 0x6eef
movb -0x21d(%rbp), %al
testb $0x1, %al
jne 0x6f98
jmp 0x6eff
leaq 0x118a2(%rip), %rdi     # 0x187a8
callq 0x7510
movq %rax, -0x228(%rbp)
jmp 0x6f14
movq -0x228(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x3050
jmp 0x6f26
leaq 0x1182b(%rip), %rdi     # 0x18758
leaq -0x58(%rbp), %rsi
callq 0x5510
jmp 0x6f38
leaq 0x11869(%rip), %rdi     # 0x187a8
callq 0x7530
jmp 0x6f46
leaq -0x150(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3130
jmp 0x6f58
leaq -0x150(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x4360
jmp 0x6f6d
leaq -0x150(%rbp), %rdi
callq 0x35c8
jmp 0x6f98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x35c8
jmp 0x72db
jmp 0x72bc
leaq 0x1187c(%rip), %rax     # 0x18820
movl $0x0, (%rax)
leaq 0x1134b(%rip), %rax     # 0x182fc
movl $0x1, (%rax)
leaq 0x1179a(%rip), %rdi     # 0x18758
callq 0x74f0
movb %al, -0x229(%rbp)
jmp 0x6fcb
movb -0x229(%rbp), %al
testb $0x1, %al
jne 0x7074
jmp 0x6fdb
leaq 0x11776(%rip), %rdi     # 0x18758
callq 0x7510
movq %rax, -0x238(%rbp)
jmp 0x6ff0
movq -0x238(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x3050
jmp 0x7002
leaq 0x1179f(%rip), %rdi     # 0x187a8
leaq -0x58(%rbp), %rsi
callq 0x5510
jmp 0x7014
leaq 0x1173d(%rip), %rdi     # 0x18758
callq 0x7530
jmp 0x7022
leaq -0x170(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3130
jmp 0x7034
leaq -0x170(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x4360
jmp 0x7049
leaq -0x170(%rbp), %rdi
callq 0x35c8
jmp 0x7074
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x35c8
jmp 0x72db
jmp 0x72bc
leaq 0x116d8(%rip), %rdi     # 0x18758
leaq -0x20(%rbp), %rsi
callq 0x5510
jmp 0x708b
leaq -0x190(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x3130
jmp 0x709d
leaq 0x11258(%rip), %rax     # 0x182fc
movl (%rax), %esi
leaq -0x190(%rbp), %rdi
xorl %edx, %edx
callq 0x4360
jmp 0x70b6
leaq -0x190(%rbp), %rdi
callq 0x35c8
jmp 0x72bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x35c8
jmp 0x72db
leaq 0x11735(%rip), %rax     # 0x18820
movl $0x0, (%rax)
leaq 0x11204(%rip), %rax     # 0x182fc
movl $0x1, (%rax)
leaq 0x116fb(%rip), %rdi     # 0x18800
leaq 0x1160c(%rip), %rsi     # 0x18718
callq 0x7550
testb $0x1, %al
jne 0x711a
jmp 0x7204
leaq 0x116df(%rip), %rdi     # 0x18800
movq %rdi, -0x240(%rbp)
leaq 0x9f23(%rip), %rsi      # 0x11052
movq $-0x1, %rdx
callq 0x32b0
movq -0x240(%rbp), %rsi
movq %rax, -0x198(%rbp)
movq -0x198(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x1b8(%rbp), %rdi
callq 0x3310
jmp 0x7162
leaq -0x58(%rbp), %rdi
movq %rdi, -0x248(%rbp)
leaq -0x1b8(%rbp), %rsi
movq %rsi, -0x250(%rbp)
callq 0x33e0
movq -0x250(%rbp), %rdi
callq 0x35c8
movq -0x248(%rbp), %rsi
leaq 0x1160e(%rip), %rdi     # 0x187a8
callq 0x5510
jmp 0x71a1
leaq 0x115b0(%rip), %rdi     # 0x18758
callq 0x7530
jmp 0x71af
leaq -0x1d8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3130
jmp 0x71c1
leaq -0x1d8(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x4360
jmp 0x71d6
leaq -0x1d8(%rbp), %rdi
callq 0x35c8
jmp 0x72bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x35c8
jmp 0x72db
jmp 0x7206
leaq 0x11613(%rip), %rax     # 0x18820
movl $0x0, (%rax)
leaq 0x110e2(%rip), %rax     # 0x182fc
movl $0x1, (%rax)
leaq 0x114f1(%rip), %rsi     # 0x18718
leaq -0x1f8(%rbp), %rdi
callq 0x3130
jmp 0x7235
leaq -0x1f8(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x4360
jmp 0x724a
leaq -0x1f8(%rbp), %rdi
callq 0x35c8
jmp 0x72bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0x35c8
jmp 0x72db
leaq -0x218(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x3130
jmp 0x7284
leaq -0x218(%rbp), %rdi
callq 0x9690
jmp 0x7292
leaq -0x218(%rbp), %rdi
callq 0x35c8
jmp 0x72bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x35c8
jmp 0x72db
jmp 0x72bc
jmp 0x6c2b
callq 0x74d0
jmp 0x72c8
movl $0x1, %edi
callq 0x7360
jmp 0x72d4
xorl %edi, %edi
callq 0x33d0
leaq -0x58(%rbp), %rdi
callq 0x35c8
leaq -0x20(%rbp), %rdi
callq 0x35c8
movq -0x30(%rbp), %rdi
callq 0x3530
nopw %cs:(%rax,%rax)