// File: /workspace/github_cpp_makefile_star2_O1/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 0x12bf(%rip), %rbx      # 0x622d
movq 0x505b(%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 0x4fb3
cmpl $0x20, %eax
je 0x4fb3
incq %r14
jmp 0x4fa0
movb $0x0, (%r14)
movq %r15, %rdi
movq %r13, %rsi
callq 0x10b0
cmpb $0x20, 0x1(%r14)
leaq 0x1(%r14), %r14
je 0x4fc2
movq %r12, %rdi
movq %r14, %rsi
callq 0x10b0
movzwl (%rsp), %eax
cmpw $0x70, %ax
je 0x50cd
movl (%rsp), %ecx
movl $0x6e697270, %edx       # imm = 0x6E697270
xorl %edx, %ecx
movzwl 0x4(%rsp), %edx
xorl $0x74, %edx
orl %ecx, %edx
je 0x50cd
cmpw $0x62, %ax
je 0x50da
movl (%rsp), %ecx
movl $0x61657262, %edx       # imm = 0x61657262
xorl %edx, %ecx
movzwl 0x4(%rsp), %edx
xorl $0x6b, %edx
orl %ecx, %edx
je 0x50da
cmpw $0x64, %ax
je 0x50e7
cmpl $0x6c6564, (%rsp)       # imm = 0x6C6564
je 0x50e7
cmpw $0x72, (%rsp)
je 0x50fe
cmpl $0x6e7572, (%rsp)       # imm = 0x6E7572
je 0x50fe
movzwl (%rsp), %eax
cmpw $0x71, %ax
je 0x5114
movl (%rsp), %ecx
movl $0x74697571, %edx       # imm = 0x74697571
xorl %edx, %ecx
movzbl 0x4(%rsp), %edx
orl %ecx, %edx
je 0x5114
cmpw $0x6e, %ax
je 0x5105
movl (%rsp), %ecx
movl $0x7478656e, %edx       # imm = 0x7478656E
xorl %edx, %ecx
movzbl 0x4(%rsp), %edx
orl %ecx, %edx
je 0x5105
cmpw $0x68, %ax
je 0x50f4
movl (%rsp), %eax
movl $0x706c6568, %ecx       # imm = 0x706C6568
xorl %ecx, %eax
movzbl 0x4(%rsp), %ecx
orl %eax, %ecx
je 0x50f4
leaq 0x1cd6(%rip), %rdi      # 0x6d8b
callq 0x1140
leaq 0x1196(%rip), %rdi      # 0x6257
xorl %eax, %eax
callq 0x1040
jmp 0x4f82
movq %r12, %rdi
callq 0x4cc6
jmp 0x4f82
movq %r12, %rdi
callq 0x4e97
jmp 0x4f82
movq %r12, %rdi
callq 0x4ec6
jmp 0x4f82
callq 0x4ef5
jmp 0x4f82
movb $0x0, 0x15107(%rip)     # 0x1a20c
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x0, 0x150f1(%rip)     # 0x1a20c
leaq 0x1c86(%rip), %rdi      # 0x6da8
callq 0x1140
xorl %edi, %edi
callq 0x1100