// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq 0x5175(%rip), %rbx      # 0x9fd0
leaq 0x40(%rsp), %r13
pushq $0x32
popq %rbp
movq %rsp, %r15
leaq 0x20(%rsp), %r12
leaq 0x13bb(%rip), %rdi      # 0x622d
xorl %eax, %eax
callq 0x1030
movq (%rbx), %rdx
movq %r13, %rdi
movl %ebp, %esi
callq 0x1140
movq %r13, %r14
movzbl (%r14), %eax
cmpl $0xa, %eax
je 0x4e9c
cmpl $0x20, %eax
je 0x4e9c
incq %r14
jmp 0x4e89
movb $0x0, (%r14)
movq %r15, %rdi
movq %r13, %rsi
callq 0x1090
cmpb $0x20, 0x1(%r14)
leaq 0x1(%r14), %r14
je 0x4eab
movq %r12, %rdi
movq %r14, %rsi
callq 0x1090
movzwl (%rsp), %r14d
cmpw $0x70, %r14w
je 0x4f2a
movq %r15, %rdi
leaq 0x1365(%rip), %rsi      # 0x623c
pushq $0x6
popq %rdx
callq 0x10c0
testl %eax, %eax
je 0x4f2a
cmpw $0x62, %r14w
je 0x4f37
movq %r15, %rdi
leaq 0x134e(%rip), %rsi      # 0x6242
pushq $0x6
popq %rdx
callq 0x10c0
testl %eax, %eax
je 0x4f37
cmpw $0x64, %r14w
sete %al
movl (%rsp), %r14d
cmpl $0x6c6564, %r14d        # imm = 0x6C6564
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x4f44
movq %r12, %rdi
callq 0x4dc0
jmp 0x4e6b
movq %r12, %rdi
callq 0x4bd8
jmp 0x4e6b
movq %r12, %rdi
callq 0x4d9e
jmp 0x4e6b
cmpw $0x72, %r14w
je 0x4fe0
cmpl $0x6e7572, %r14d        # imm = 0x6E7572
je 0x4fe0
cmpw $0x71, %r14w
je 0x4ff6
movq %r15, %rdi
leaq 0x12d7(%rip), %rsi      # 0x6248
pushq $0x5
popq %rdx
callq 0x10c0
testl %eax, %eax
je 0x4ff6
cmpw $0x6e, %r14w
je 0x4fe7
movq %r15, %rdi
leaq 0x12bf(%rip), %rsi      # 0x624d
pushq $0x5
popq %rdx
callq 0x10c0
testl %eax, %eax
je 0x4fe7
cmpw $0x68, %r14w
je 0x4fd6
movq %r15, %rdi
leaq 0x12a7(%rip), %rsi      # 0x6252
pushq $0x5
popq %rdx
callq 0x10c0
testl %eax, %eax
je 0x4fd6
leaq 0x1dcd(%rip), %rdi      # 0x6d8b
callq 0x1120
leaq 0x128d(%rip), %rdi      # 0x6257
xorl %eax, %eax
callq 0x1030
jmp 0x4e6b
callq 0x4de2
jmp 0x4e6b
movb $0x0, 0x15215(%rip)     # 0x1a1fc
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x0, 0x151ff(%rip)     # 0x1a1fc
leaq 0x1da4(%rip), %rdi      # 0x6da8
callq 0x1120
xorl %edi, %edi
callq 0x10e0