// File: akshayrajput[P]ARMV8_Simulator/simulo.cpp
// Function: show_prompt()
void show_prompt()
{
	
	char inp[50],comm[20],arg[20],*split;

	while(1)
	{
		printf("DEBUG-PROMPT:>");
		fgets(inp,50,stdin);
		split = inp;
		while(*split != ' ' && *split != '\n' ) { split++;}

		*split = '\0';
		strcpy(comm,inp);
		split++;

		while(*split == ' ') split++ ;

		strcpy(arg, split);
		
		if(strcmp(comm,"p") == 0 || strcmp(comm,"print")== 0)
			printRegMem(arg);

		else if(strcmp(comm,"b")==0 || strcmp(comm,"break")==0 )
			setBreak(arg);

		else if(strcmp(comm,"d")==0 || strcmp(comm,"del")==0 )
			delBreak(arg);
	
		else if(strcmp(comm,"r")==0 || strcmp(comm,"run")==0 )
		{	
			debug_prompt = false;
			return;
		}

		else if(strcmp(comm,"q")==0 || strcmp(comm,"quit")==0 )
		{
			debug_prompt = false;
			printf("Exiting simulo...\n");
			exit(0);
			return;
		}

		else if(strcmp(comm,"n")==0 || strcmp(comm,"next")==0 )
		{
			return;
		}
		else if(strcmp(comm,"h")==0 || strcmp(comm,"help")==0 )
		{
			printHelp();
		}
		else
		{
			printf("Please enter a valid command\n");
			printf("Type h or help for details");
		}
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
leaq 0x285c(%rip), %rdi      # 0xbd7e
movb $0x0, %al
callq 0x1030
leaq -0x40(%rbp), %rdi
movq 0x4a9c(%rip), %rax      # 0xdfd0
movq (%rax), %rdx
movl $0x32, %esi
callq 0x1130
leaq -0x40(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x20, %ecx
movb %al, -0x89(%rbp)
je 0x9579
movq -0x88(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
setne %al
movb %al, -0x89(%rbp)
movb -0x89(%rbp), %al
testb $0x1, %al
jne 0x9585
jmp 0x9599
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x954c
movq -0x88(%rbp), %rax
movb $0x0, (%rax)
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1090
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x95e5
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x95c2
leaq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x1090
leaq -0x60(%rbp), %rdi
leaq 0x27c7(%rip), %rsi      # 0xbdc7
callq 0x10f0
cmpl $0x0, %eax
je 0x961f
leaq -0x60(%rbp), %rdi
leaq 0x2778(%rip), %rsi      # 0xbd8d
callq 0x10f0
cmpl $0x0, %eax
jne 0x962d
leaq -0x80(%rbp), %rdi
callq 0x8fa0
jmp 0x979e
leaq -0x60(%rbp), %rdi
leaq 0x275b(%rip), %rsi      # 0xbd93
callq 0x10f0
cmpl $0x0, %eax
je 0x9657
leaq -0x60(%rbp), %rdi
leaq 0x2748(%rip), %rsi      # 0xbd95
callq 0x10f0
cmpl $0x0, %eax
jne 0x9665
leaq -0x80(%rbp), %rdi
callq 0x93f0
jmp 0x979c
leaq -0x60(%rbp), %rdi
leaq 0x2a5b(%rip), %rsi      # 0xc0cb
callq 0x10f0
cmpl $0x0, %eax
je 0x968f
leaq -0x60(%rbp), %rdi
leaq 0x2716(%rip), %rsi      # 0xbd9b
callq 0x10f0
cmpl $0x0, %eax
jne 0x969d
leaq -0x80(%rbp), %rdi
callq 0x9440
jmp 0x979a
leaq -0x60(%rbp), %rdi
leaq 0x26f7(%rip), %rsi      # 0xbd9f
callq 0x10f0
cmpl $0x0, %eax
je 0x96c7
leaq -0x60(%rbp), %rdi
leaq 0x26e4(%rip), %rsi      # 0xbda1
callq 0x10f0
cmpl $0x0, %eax
jne 0x96d3
movb $0x0, 0x14b2e(%rip)     # 0x1e1fc
jmp 0x97a3
leaq -0x60(%rbp), %rdi
leaq 0x2684(%rip), %rsi      # 0xbd62
callq 0x10f0
cmpl $0x0, %eax
je 0x96fd
leaq -0x60(%rbp), %rdi
leaq 0x26b2(%rip), %rsi      # 0xbda5
callq 0x10f0
cmpl $0x0, %eax
jne 0x9719
movb $0x0, 0x14af8(%rip)     # 0x1e1fc
leaq 0x269f(%rip), %rdi      # 0xbdaa
movb $0x0, %al
callq 0x1030
xorl %edi, %edi
callq 0x10e0
leaq -0x60(%rbp), %rdi
leaq 0x27e5(%rip), %rsi      # 0xbf09
callq 0x10f0
cmpl $0x0, %eax
je 0x9743
leaq -0x60(%rbp), %rdi
leaq 0x2684(%rip), %rsi      # 0xbdbd
callq 0x10f0
cmpl $0x0, %eax
jne 0x9745
jmp 0x97a3
leaq -0x60(%rbp), %rdi
leaq 0x2672(%rip), %rsi      # 0xbdc2
callq 0x10f0
cmpl $0x0, %eax
je 0x976f
leaq -0x60(%rbp), %rdi
leaq 0x265f(%rip), %rsi      # 0xbdc4
callq 0x10f0
cmpl $0x0, %eax
jne 0x9776
callq 0x9490
jmp 0x9792
leaq 0x23e0(%rip), %rdi      # 0xbb5d
movb $0x0, %al
callq 0x1030
leaq 0x263e(%rip), %rdi      # 0xbdc9
movb $0x0, %al
callq 0x1030
jmp 0x9794
jmp 0x9796
jmp 0x9798
jmp 0x979a
jmp 0x979c
jmp 0x979e
jmp 0x951b
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)