// File: /workspace/github_cpp_makefile_star2_O2/aman-agrawal[P]Terminal-based-file-explorer/aman.cpp
// Function: main
int main(int argc, char* argv[])
{
	clear2();		//to clear terminal
	string hmd=mycwd();

	stack<string>l;
	stack<string>r;
	l.push(string(argv[1]));
	while(r.empty()!=1)
    			{r.pop();}

	filename = list(argv[1],1);	//to print ls 
    x=1;y=1;
    mov(x,y);
    off_keyboard();
    while(1) {
    	int i = cursor_handle(x, y);
    if(i==1)
    {
		//enter key is tapped

    	//f status
    	if(filename[x-1].second != 'd')
    	{
			system(("xdg-open " + filename[x-1].first).c_str());
    	}
		
    
    	//d status
    	else
    	{
            sonu=sonu+"/"+filename[x-1].first;

    	const char *ye = filename[x-1].first.c_str();
    	char* z= (char*)ye; 		//converting const char* into char*
    	string largepath(z);	//converting char* into string

    	int len=largepath.size();
    	if(largepath[len-1]=='.' && largepath[len-2]=='.')
    	{
    		if(largepath!=hmd)
    		{
    			string trimpath=trim1(largepath);
    			char *trimstring = (char*)trimpath.c_str();

    			l.push(trimpath);	///////push into l stack
    			while(r.empty()!=1)
    			{r.pop();}
    			filename= list(trimstring, filename[x-1].second);
    		}
    		else
    		{
    			// when .. is pressed and we r in home directory
    			filename = list(argv[1],1);	//to print ls

    		}
            x=1;y=1;
            mov(x,y);

    	}
    	else
    	{	
    		l.push(largepath);	///////push into l stack
    		while(r.empty()!=1)
    			{r.pop();}
    		filename=list(z, filename[x-1].second);	//refer line 67 for z
                x=1;y=1;
            mov(x,y);
    	}
    	}
    		
    	
    }

    if(i==2)
    {
    	//home key is tapped
    	filename = list(argv[1], filename[x-1].second);	//to print home directory 	
        x=1;y=1;
            mov(x,y);
    }

   
    if(i==3)
    {
    	//left key is pressed
    	if(l.empty()==0)
    	{string pl=l.top();
    	l.pop();
    	r.push(pl);
    	string pll=l.top();
    	const char *o1 = pll.c_str();
    	char* o11= (char*)o1;
    	filename=list(o11, filename[x-1].second);
        x=1;y=1;
            mov(x,y);
    	}

    }
   
    if(i==4)
    {
    	//right key is pressed
    	if(r.empty()==0)
    	{string pr=r.top();
    	const char *o2 = pr.c_str();
    	char* o22= (char*)o2;

    	r.pop();
    	l.push(pr);
    	filename=list(o22, filename[x-1].second);
        x=1;y=1;
        mov(x,y);
    	}
    }

    if(i==5)
    {	//backspace key is pressed
    	const char *y4 = filename[x-1].first.c_str();
    	char* z2= (char*)y4; 		//converting const char* into char*
    	string originalpath(z2);	//converting char* into string
    	string parentpath=originalpath.substr(0, originalpath.find_last_of("\\/"));
    	parentpath=originalpath.substr(0, parentpath.find_last_of("\\/"));

    	const char *o3 = parentpath.c_str();

    	char* parentpointer= (char*)o3;
    	filename = list(parentpointer, filename[x-1].second);
        x=1;y=1;
            mov(x,y);
    }

    if(i==6)
    {
    	//colon is pressed

    	on_keyboard();
        x=28,y=1;
    	mov(x,y);
    	printf("\033[27;1H");
    	cout<<"*******************************************"<<endl<<"enter command : ";
        vector<string> v;
            string s1 ;
            getline(cin,s1);
            auto i = s1.begin() ;
            string::iterator start = s1.begin() ;

            if(s1[0]==27)
                {
                    //escape is pressed
                     x=1,y=1;
                     mov(x,y);
                    printf("\033[27;1H");
                    cout<<"                                                           "<<endl;
                    cout<<"                                                           "<<endl;
                    cout<<"                                                           ";
                }  
        else{

        while(i!= s1.end())
        {
            if(*i == ' ')
            {
                string s2(start, i) ;
                v.push_back(s2) ;
                start = ++i ;
            }
            else 
                i++ ;
        }
        string s2(start,i) ;
        v.push_back(s2) ;
        if(v[0]=="copy")
        {
            int vectorsize1=v.size();
            int vectorsize2=vectorsize1-2;
            int i=1;
            while(vectorsize2--)
            {   copyfile(sonu+"/"+v[i],v[vectorsize1-1]+"/"+v[i]);
                i++;
            }
            cout << "all file(s) Copied done successfully";
        }
        else if(v[0]=="create_file")
        {
            createfile(v[1],v[2]);
        }
        else if(v[0]=="create_dir")
        {
            createdir(v[1],v[2]);
        }
        else if(v[0]=="move")
        {
            int vectorsize1=v.size();
            int vectorsize2=vectorsize1-2;
            int i=1;
            while(vectorsize2--)
            {   movefile(v[i],v[vectorsize1-1]+v[i]);
                i++;
            }
            cout << "all file(s) moved successfully";
        }
        else if(v[0]=="rename")
        {
            renamefile(v[1],v[2]);
        }
        else if(v[0]=="delete_file")
        {
            int result=deletefile(v[1]);
            if (result == 1)
                cout<<"File successfully deleted";
            else
                cout<<"wrong input";
        }
        else if(v[0]=="delete_dir")
        {
            int result=deletedir(v[1]);
            if(result==0)
                cout<<"wrong input";
            else
                cout<<"directory successfully deleted";
        }
        else if(v[0]=="goto")
        {
            go_to(v[1]);
        }
      }
    	
      }  
    }	
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x328, %rsp            # imm = 0x328
movq %rsi, 0x60(%rsp)
leaq 0x27e1(%rip), %rdi      # 0x6030
xorl %eax, %eax
callq 0x2030
leaq 0x268(%rsp), %rdi
callq 0x2f40
leaq 0xd8(%rsp), %rdi
callq 0x46d6
leaq 0x68(%rsp), %rdi
callq 0x46d6
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rsi
movq %rsp, %rdi
leaq 0x40(%rsp), %rdx
callq 0x2a22
leaq 0xd8(%rsp), %rdi
movq %rsp, %rsi
callq 0x4b2c
movq %rsp, %rdi
callq 0x2418
leaq 0x68(%rsp), %rbx
movq 0x98(%rsp), %rax
cmpq 0x78(%rsp), %rax
je 0x38c6
movq %rbx, %rdi
callq 0x4d8e
jmp 0x38ad
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rsi
movq %rsp, %rdi
pushq $0x1
popq %rbp
movl %ebp, %edx
callq 0x263c
leaq 0x59f5(%rip), %rdi      # 0x92d8
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x4dee
movq %rbx, %rdi
callq 0x2ab4
movl %ebp, 0x5924(%rip)      # 0x9220
movl %ebp, 0x5922(%rip)      # 0x9224
movl %ebp, %edi
movl %ebp, %esi
callq 0x2ddc
callq 0x2e9c
leaq 0x248(%rsp), %r13
leaq 0x128(%rsp), %r12
leaq 0x58f9(%rip), %rdi      # 0x9220
leaq 0x58f6(%rip), %rsi      # 0x9224
callq 0x2dee
decl %eax
cmpl $0x5, %eax
ja 0x3920
leaq 0x275f(%rip), %rcx      # 0x60a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movslq 0x58cf(%rip), %rax      # 0x9220
movq 0x5980(%rip), %rdx      # 0x92d8
imulq $0x28, %rax, %rax
cmpb $0x64, -0x8(%rdx,%rax)
jne 0x3f08
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
leaq 0x5942(%rip), %rsi      # 0x92b8
leaq 0x27e3(%rip), %rdx      # 0x6160
callq 0x2a7c
movslq 0x5897(%rip), %rax      # 0x9220
movq 0x5948(%rip), %rcx      # 0x92d8
imulq $0x28, %rax, %rax
leaq (%rcx,%rax), %rdx
addq $-0x28, %rdx
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2a5d
leaq 0x5907(%rip), %rdi      # 0x92b8
movq %r14, %rsi
callq 0x2290
movq %r14, %rdi
callq 0x2418
movq %rbx, %rdi
callq 0x2418
movslq 0x5850(%rip), %rax      # 0x9220
movq 0x5901(%rip), %rcx      # 0x92d8
imulq $0x28, %rax, %rax
movq -0x28(%rcx,%rax), %rbp
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x2a22
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
shlq $0x20, %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
addq %rcx, %rdx
sarq $0x20, %rdx
cmpb $0x2e, (%rax,%rdx)
jne 0x4052
movabsq $-0x200000000, %rdx     # imm = 0xFFFFFFFE00000000
addq %rdx, %rcx
sarq $0x20, %rcx
cmpb $0x2e, (%rax,%rcx)
jne 0x4052
movq %rsp, %rbx
movq %rbx, %rdi
leaq 0x268(%rsp), %rsi
callq 0x4767
testb %al, %al
je 0x41d9
leaq 0x308(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x22c0
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2f0c
movq %r14, %rdi
callq 0x2418
movq 0x40(%rsp), %rbp
leaq 0xd8(%rsp), %rdi
movq %rbx, %rsi
callq 0x4e74
movq 0x98(%rsp), %rax
cmpq 0x78(%rsp), %rax
je 0x41f7
leaq 0x68(%rsp), %rdi
callq 0x4d8e
jmp 0x3a8c
leaq 0xb8(%rsp), %r15
movslq 0x5766(%rip), %rax      # 0x9220
movq 0x5817(%rip), %rcx      # 0x92d8
imulq $0x28, %rax, %rax
movq -0x28(%rcx,%rax), %rsi
movq %rsp, %r14
movq %r14, %rdi
leaq 0x40(%rsp), %rbx
movq %rbx, %rdx
callq 0x2a22
movq %r14, %rdi
leaq 0x2678(%rip), %rbp      # 0x615f
movq %rbp, %rsi
pushq $-0x1
popq %r12
movq %r12, %rdx
callq 0x21f0
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x2240
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x21f0
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x2240
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2290
movq %r15, %rdi
callq 0x2418
movq 0x40(%rsp), %rsi
movslq 0x56dd(%rip), %rax      # 0x9220
movq 0x578e(%rip), %rcx      # 0x92d8
imulq $0x28, %rax, %rax
movsbl -0x8(%rcx,%rax), %edx
movq %r15, %rdi
callq 0x263c
leaq 0x5776(%rip), %rdi      # 0x92d8
movq %r15, %rsi
callq 0x4dee
movq %r15, %rdi
callq 0x2ab4
pushq $0x1
popq %rdi
movl %edi, 0x56a5(%rip)      # 0x9220
movl %edi, 0x56a3(%rip)      # 0x9224
movl %edi, %esi
callq 0x2ddc
leaq 0x248(%rsp), %r13
leaq 0x128(%rsp), %r12
jmp 0x3c87
movq 0x108(%rsp), %rsi
cmpq 0xe8(%rsp), %rsi
je 0x3920
cmpq 0x110(%rsp), %rsi
jne 0x3bd1
movq 0x120(%rsp), %rax
movq -0x8(%rax), %rsi
movl $0x200, %eax            # imm = 0x200
addq %rax, %rsi
addq $-0x20, %rsi
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x22c0
leaq 0xd8(%rsp), %rdi
callq 0x4d8e
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
callq 0x4e74
movq 0x108(%rsp), %rsi
cmpq 0x110(%rsp), %rsi
jne 0x3c20
movq 0x120(%rsp), %rax
movq -0x8(%rax), %rsi
movl $0x200, %eax            # imm = 0x200
addq %rax, %rsi
addq $-0x20, %rsi
leaq 0x40(%rsp), %rdi
callq 0x22c0
movq 0x40(%rsp), %rsi
movslq 0x55e6(%rip), %rax      # 0x9220
movq 0x5697(%rip), %rcx      # 0x92d8
imulq $0x28, %rax, %rax
movsbl -0x8(%rcx,%rax), %edx
leaq 0xb8(%rsp), %rbx
movq %rbx, %rdi
callq 0x263c
leaq 0x5677(%rip), %rdi      # 0x92d8
movq %rbx, %rsi
callq 0x4dee
movq %rbx, %rdi
callq 0x2ab4
pushq $0x1
popq %rdi
movl %edi, 0x55a6(%rip)      # 0x9220
movl %edi, 0x55a4(%rip)      # 0x9224
movl %edi, %esi
callq 0x2ddc
leaq 0x40(%rsp), %rdi
callq 0x2418
jmp 0x40d1
movq 0x98(%rsp), %rsi
cmpq 0x78(%rsp), %rsi
je 0x3920
cmpq 0xa0(%rsp), %rsi
jne 0x3cc7
movq 0xb0(%rsp), %rax
movq -0x8(%rax), %rsi
movl $0x200, %eax            # imm = 0x200
addq %rax, %rsi
addq $-0x20, %rsi
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x22c0
movq (%rsp), %rbp
leaq 0x68(%rsp), %rdi
callq 0x4d8e
leaq 0xd8(%rsp), %rdi
movq %rbx, %rsi
callq 0x4e74
movslq 0x5525(%rip), %rax      # 0x9220
movq 0x55d6(%rip), %rcx      # 0x92d8
imulq $0x28, %rax, %rax
movsbl -0x8(%rcx,%rax), %edx
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x263c
leaq 0x55b6(%rip), %rdi      # 0x92d8
movq %rbx, %rsi
callq 0x4dee
movq %rbx, %rdi
callq 0x2ab4
pushq $0x1
popq %rdi
movl %edi, 0x54e5(%rip)      # 0x9220
movl %edi, 0x54e3(%rip)      # 0x9224
movl %edi, %esi
callq 0x2ddc
jmp 0x40d1
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rsi
movslq 0x54c3(%rip), %rax      # 0x9220
movq 0x5574(%rip), %rcx      # 0x92d8
imulq $0x28, %rax, %rax
movsbl -0x8(%rcx,%rax), %edx
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x263c
leaq 0x5559(%rip), %rdi      # 0x92d8
movq %rbx, %rsi
callq 0x4dee
movq %rbx, %rdi
callq 0x2ab4
pushq $0x1
popq %rdi
movl %edi, 0x5488(%rip)      # 0x9220
movl %edi, 0x5486(%rip)      # 0x9224
movl %edi, %esi
callq 0x2ddc
jmp 0x3920
callq 0x2efb
movl $0x1c, 0x5467(%rip)     # 0x9220
movl $0x1, 0x5461(%rip)      # 0x9224
pushq $0x1c
popq %rdi
pushq $0x1
popq %rsi
callq 0x2ddc
leaq 0x238d(%rip), %rdi      # 0x6162
xorl %eax, %eax
callq 0x2030
movq 0x51ed(%rip), %rdi      # 0x8fd0
leaq 0x2380(%rip), %rsi      # 0x616a
callq 0x2210
movq %rax, %rdi
callq 0x2130
movq %rax, %rdi
leaq 0x2395(%rip), %rsi      # 0x6196
callq 0x2210
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
andq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq 0x51b1(%rip), %rdi      # 0x8fe0
movq %rsp, %rsi
callq 0x2060
movq (%rsp), %rax
cmpb $0x1b, (%rax)
movq %rax, %rsi
jne 0x3eb5
pushq $0x1
popq %rdi
movl %edi, 0x53d4(%rip)      # 0x9220
movl %edi, 0x53d2(%rip)      # 0x9224
movl %edi, %esi
callq 0x2ddc
leaq 0x2302(%rip), %rdi      # 0x6162
xorl %eax, %eax
callq 0x2030
movq 0x5162(%rip), %rdi      # 0x8fd0
leaq 0x2332(%rip), %rsi      # 0x61a7
callq 0x2210
movq %rax, %rdi
callq 0x2130
movq 0x5147(%rip), %rdi      # 0x8fd0
leaq 0x2317(%rip), %rsi      # 0x61a7
callq 0x2210
movq %rax, %rdi
callq 0x2130
movq 0x512c(%rip), %rdi      # 0x8fd0
leaq 0x22fc(%rip), %rsi      # 0x61a7
callq 0x2210
jmp 0x41c2
addq 0x8(%rsp), %rax
movq %rsi, %rbp
cmpq %rax, %rbp
je 0x3f2c
cmpb $0x20, (%rbp)
je 0x3ecd
incq %rbp
jmp 0x3ebd
leaq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x4f86
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x4772
incq %rbp
movq %rbx, %rdi
callq 0x2418
movq (%rsp), %rax
movq %rbp, %rsi
jmp 0x3eb5
addq %rax, %rdx
addq $-0x28, %rdx
movq %rsp, %rdi
leaq 0x223c(%rip), %rsi      # 0x6155
callq 0x46f1
movq (%rsp), %rdi
callq 0x21a0
jmp 0x40d1
leaq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x4f86
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x4772
movq 0x20(%rsp), %rdi
leaq 0x2284(%rip), %rsi      # 0x61e3
callq 0x46a9
testb %al, %al
je 0x40de
movq 0x28(%rsp), %r14
subq 0x20(%rsp), %r14
movq %r14, %rbp
shrq $0x5, %rbp
addl $-0x2, %ebp
shlq $0x1b, %r14
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %r14
sarq $0x1b, %r14
pushq $0x20
popq %rbx
subl $0x1, %ebp
jb 0x413a
leaq 0xb8(%rsp), %r15
movq %r15, %rdi
leaq 0x5305(%rip), %rsi      # 0x92b8
leaq 0x21a6(%rip), %rdx      # 0x6160
callq 0x2a7c
movq 0x20(%rsp), %rdx
addq %rbx, %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x2a5d
movq 0x20(%rsp), %rsi
addq %r14, %rsi
leaq 0x228(%rsp), %r12
movq %r12, %rdi
leaq 0x2174(%rip), %rdx      # 0x6160
callq 0x2a7c
movq 0x20(%rsp), %rdx
addq %rbx, %rdx
leaq 0x2e8(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x2a5d
movq %r13, %rdi
movq %r15, %rsi
callq 0x2f86
movq %r15, %rdi
callq 0x2418
leaq 0x228(%rsp), %rdi
callq 0x2418
movq %r13, %rdi
callq 0x2418
leaq 0xb8(%rsp), %rdi
callq 0x2418
addq $0x20, %rbx
leaq 0x128(%rsp), %r12
jmp 0x3f98
leaq 0xd8(%rsp), %rdi
movq %rsp, %rsi
callq 0x4e74
movq 0x98(%rsp), %rax
cmpq 0x78(%rsp), %rax
je 0x407d
leaq 0x68(%rsp), %rdi
callq 0x4d8e
jmp 0x4062
movslq 0x519c(%rip), %rax      # 0x9220
movq 0x524d(%rip), %rcx      # 0x92d8
imulq $0x28, %rax, %rax
movsbl -0x8(%rcx,%rax), %edx
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x263c
leaq 0x522d(%rip), %rdi      # 0x92d8
movq %rbx, %rsi
callq 0x4dee
movq %rbx, %rdi
callq 0x2ab4
pushq $0x1
popq %rdi
movl %edi, 0x515c(%rip)      # 0x9220
movl %edi, 0x515a(%rip)      # 0x9224
movl %edi, %esi
callq 0x2ddc
movq %rsp, %rdi
callq 0x2418
jmp 0x3920
movq 0x20(%rsp), %rdi
leaq 0x2123(%rip), %rsi      # 0x620d
callq 0x46a9
movq 0x20(%rsp), %rsi
testb %al, %al
je 0x414f
addq $0x20, %rsi
leaq 0x208(%rsp), %rdi
callq 0x22c0
movq 0x20(%rsp), %rsi
addq $0x40, %rsi
leaq 0x2c8(%rsp), %rbx
movq %rbx, %rdi
callq 0x22c0
leaq 0x208(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x30de
movq %rbx, %rdi
jmp 0x41ab
movq 0x4e8f(%rip), %rdi      # 0x8fd0
leaq 0x20a0(%rip), %rsi      # 0x61e8
callq 0x2210
jmp 0x41b8
movq %rsi, %rdi
leaq 0x20c0(%rip), %rsi      # 0x6219
callq 0x46a9
movq 0x20(%rsp), %rsi
testb %al, %al
je 0x4247
addq $0x20, %rsi
leaq 0x1e8(%rsp), %rdi
callq 0x22c0
movq 0x20(%rsp), %rsi
addq $0x40, %rsi
leaq 0x2a8(%rsp), %rbx
movq %rbx, %rdi
callq 0x22c0
leaq 0x1e8(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x32dd
movq %rbx, %rdi
callq 0x2418
movq %rbp, %rdi
callq 0x2418
leaq 0x40(%rsp), %rdi
callq 0x2418
movq %rsp, %rdi
callq 0x2418
leaq 0x20(%rsp), %rdi
callq 0x47d6
jmp 0x3920
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rsi
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
pushq $0x1
popq %rdx
callq 0x263c
jmp 0x40a4
movslq 0x5022(%rip), %rax      # 0x9220
movq 0x50d3(%rip), %rcx      # 0x92d8
imulq $0x28, %rax, %rax
movsbl -0x8(%rcx,%rax), %edx
leaq 0xb8(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x263c
leaq 0x50b0(%rip), %rdi      # 0x92d8
movq %rbx, %rsi
callq 0x4dee
movq %rbx, %rdi
callq 0x2ab4
leaq 0x40(%rsp), %rdi
callq 0x2418
jmp 0x40bb
movq %rsi, %rdi
leaq 0x1fd3(%rip), %rsi      # 0x6224
callq 0x46a9
testb %al, %al
je 0x42f7
movq 0x28(%rsp), %rbx
subq 0x20(%rsp), %rbx
movq %rbx, %r14
shrq $0x5, %r14
addl $-0x2, %r14d
shlq $0x1b, %rbx
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %rbx
sarq $0x1b, %rbx
pushq $0x20
popq %rbp
subl $0x1, %r14d
jb 0x434e
movq 0x20(%rsp), %rsi
addq %rbp, %rsi
leaq 0x1c8(%rsp), %rdi
callq 0x22c0
movq 0x20(%rsp), %rdx
leaq (%rdx,%rbx), %rsi
addq %rbp, %rdx
leaq 0x288(%rsp), %r12
movq %r12, %rdi
callq 0x479e
leaq 0x1c8(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x35b7
movq %r12, %rdi
callq 0x2418
movq %r15, %rdi
callq 0x2418
addq $0x20, %rbp
leaq 0x128(%rsp), %r12
jmp 0x428b
movq 0x20(%rsp), %rdi
leaq 0x1f45(%rip), %rsi      # 0x6248
callq 0x46a9
movq 0x20(%rsp), %rsi
testb %al, %al
je 0x4366
addq $0x20, %rsi
leaq 0x1a8(%rsp), %rdi
callq 0x22c0
movq 0x20(%rsp), %rsi
addq $0x40, %rsi
movq %r12, %rdi
callq 0x22c0
leaq 0x1a8(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
callq 0x34b8
movq %r12, %rdi
jmp 0x41ab
movq 0x4c7b(%rip), %rdi      # 0x8fd0
leaq 0x1ecd(%rip), %rsi      # 0x6229
callq 0x2210
jmp 0x41b8
movq %rsi, %rdi
leaq 0x1edf(%rip), %rsi      # 0x624f
callq 0x46a9
movq 0x20(%rsp), %rsi
testb %al, %al
je 0x43ce
addq $0x20, %rsi
leaq 0x188(%rsp), %rdi
callq 0x22c0
leaq 0x188(%rsp), %rbx
movq %rbx, %rdi
callq 0x3651
movl %eax, %ebp
movq %rbx, %rdi
callq 0x2418
testl %ebp, %ebp
leaq 0x1ea9(%rip), %rsi      # 0x625b
leaq 0x1d8a(%rip), %rax      # 0x6143
cmoveq %rax, %rsi
movq 0x4c0c(%rip), %rdi      # 0x8fd0
callq 0x2210
jmp 0x41b8
movq %rsi, %rdi
leaq 0x1e9d(%rip), %rsi      # 0x6275
callq 0x46a9
movq 0x20(%rsp), %rsi
testb %al, %al
je 0x4436
addq $0x20, %rsi
leaq 0x168(%rsp), %rdi
callq 0x22c0
leaq 0x168(%rsp), %rbx
movq %rbx, %rdi
callq 0x36db
movl %eax, %ebp
movq %rbx, %rdi
callq 0x2418
testl %ebp, %ebp
leaq 0x1e66(%rip), %rsi      # 0x6280
leaq 0x1d22(%rip), %rax      # 0x6143
cmoveq %rax, %rsi
movq 0x4ba4(%rip), %rdi      # 0x8fd0
callq 0x2210
jmp 0x41b8
movq %rsi, %rdi
leaq 0x1e5f(%rip), %rsi      # 0x629f
callq 0x46a9
testb %al, %al
je 0x41b8
movq 0x20(%rsp), %rsi
addq $0x20, %rsi
leaq 0x148(%rsp), %rdi
callq 0x22c0
leaq 0x148(%rsp), %rbp
movq %rbp, %rdi
callq 0x37f5
jmp 0x41b0
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
jmp 0x4635
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
jmp 0x4635
jmp 0x463c
movq %rax, %rbx
leaq 0x188(%rsp), %rdi
jmp 0x4635
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x2418
jmp 0x44c7
jmp 0x463c
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
jmp 0x4635
jmp 0x463c
movq %rax, %rbx
leaq 0x2a8(%rsp), %rdi
callq 0x2418
jmp 0x44ee
movq %rax, %rbx
leaq 0x1e8(%rsp), %rdi
jmp 0x4635
jmp 0x45cc
jmp 0x45cc
movq %rax, %rbx
leaq 0x308(%rsp), %rdi
jmp 0x45d4
jmp 0x4663
jmp 0x4663
movq %rax, %rbx
leaq 0x2c8(%rsp), %rdi
callq 0x2418
jmp 0x4534
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
jmp 0x4635
jmp 0x463c
jmp 0x4663
jmp 0x463c
jmp 0x45ef
jmp 0x45ef
jmp 0x4670
jmp 0x4663
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
jmp 0x4669
jmp 0x4670
jmp 0x4670
jmp 0x45cc
jmp 0x45cc
jmp 0x4663
jmp 0x4663
jmp 0x4663
jmp 0x4670
jmp 0x4670
jmp 0x463c
jmp 0x4663
jmp 0x463c
movq %rax, %rbx
jmp 0x45bc
movq %rax, %rbx
leaq 0x288(%rsp), %rdi
callq 0x2418
leaq 0x1c8(%rsp), %rdi
jmp 0x4635
jmp 0x45ef
jmp 0x45cc
jmp 0x45cc
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x2418
jmp 0x4666
jmp 0x4663
jmp 0x4670
jmp 0x4670
jmp 0x4663
movq %rax, %rbx
jmp 0x4649
movq %rax, %rbx
jmp 0x462d
movq %rax, %rbx
jmp 0x4620
movq %rax, %rbx
jmp 0x4613
movq %rax, %rbx
leaq 0x2e8(%rsp), %rdi
callq 0x2418
leaq 0x228(%rsp), %rdi
callq 0x2418
leaq 0x248(%rsp), %rdi
callq 0x2418
leaq 0xb8(%rsp), %rdi
callq 0x2418
jmp 0x463f
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x2418
movq %rsp, %rdi
callq 0x2418
leaq 0x20(%rsp), %rdi
callq 0x47d6
jmp 0x4673
jmp 0x4670
jmp 0x4670
jmp 0x4670
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2418
jmp 0x4673
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x47f8
jmp 0x4682
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x47f8
jmp 0x4694
movq %rax, %rbx
leaq 0x268(%rsp), %rdi
callq 0x2418
movq %rbx, %rdi
callq 0x23b0