// File: /workspace/github_cpp_makefile_star2_O3/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
leaq 0x1273(%rip), %rbx      # 0x622d
movq 0x500f(%rip), %rbp      # 0x9fd0
leaq 0x40(%rsp), %r13
movq %rsp, %r15
leaq 0x20(%rsp), %r12
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1040
movq (%rbp), %rdx
movq %r13, %rdi
movl $0x32, %esi
callq 0x1160
movq %r13, %r14
movzbl (%r14), %eax
cmpl $0xa, %eax
je 0x4fff
cmpl $0x20, %eax
je 0x4fff
incq %r14
jmp 0x4fec
movb $0x0, (%r14)
movq %r15, %rdi
movq %r13, %rsi
callq 0x10b0
cmpb $0x20, 0x1(%r14)
leaq 0x1(%r14), %r14
je 0x500e
movq %r12, %rdi
movq %r14, %rsi
callq 0x10b0
movzwl (%rsp), %eax
cmpw $0x70, %ax
je 0x5086
movl (%rsp), %ecx
movl $0x6e697270, %edx       # imm = 0x6E697270
xorl %edx, %ecx
movzwl 0x4(%rsp), %edx
xorl $0x74, %edx
orl %ecx, %edx
je 0x5086
cmpw $0x62, %ax
je 0x5093
movl (%rsp), %ecx
movl $0x61657262, %edx       # imm = 0x61657262
xorl %edx, %ecx
movzwl 0x4(%rsp), %edx
xorl $0x6b, %edx
orl %ecx, %edx
je 0x5093
cmpw $0x64, %ax
sete %cl
movl (%rsp), %eax
cmpl $0x6c6564, %eax         # imm = 0x6C6564
sete %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0x50a0
movq %r12, %rdi
callq 0x4f12
jmp 0x4fce
movq %r12, %rdi
callq 0x4d07
jmp 0x4fce
movq %r12, %rdi
callq 0x4ee3
jmp 0x4fce
cmpw $0x72, %ax
je 0x5125
cmpl $0x6e7572, %eax         # imm = 0x6E7572
je 0x5125
cmpw $0x71, %ax
je 0x513b
movl (%rsp), %ecx
movl $0x74697571, %edx       # imm = 0x74697571
xorl %edx, %ecx
movzbl 0x4(%rsp), %edx
orl %ecx, %edx
je 0x513b
cmpw $0x6e, %ax
je 0x512c
movl (%rsp), %ecx
movl $0x7478656e, %edx       # imm = 0x7478656E
xorl %edx, %ecx
movzbl 0x4(%rsp), %edx
orl %ecx, %edx
je 0x512c
cmpw $0x68, %ax
je 0x511b
movl (%rsp), %eax
movl $0x706c6568, %ecx       # imm = 0x706C6568
xorl %ecx, %eax
movzbl 0x4(%rsp), %ecx
orl %eax, %ecx
je 0x511b
leaq 0x1c88(%rip), %rdi      # 0x6d8b
callq 0x1140
leaq 0x1148(%rip), %rdi      # 0x6257
xorl %eax, %eax
callq 0x1040
jmp 0x4fce
callq 0x4f41
jmp 0x4fce
movb $0x0, 0x150e0(%rip)     # 0x1a20c
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x0, 0x150ca(%rip)     # 0x1a20c
leaq 0x1c5f(%rip), %rdi      # 0x6da8
callq 0x1140
xorl %edi, %edi
callq 0x1100