// File: /workspace/github_cpp_makefile_star2_O1/tomsmeding[P]MarioLANG/mariolang.cpp
// Function: Level::execcommandSingle(mario*)
bool execcommandSingle(mario *m){
		int num;
		char c;
		SHOW_DEBUG("ECS at %d,%d: '%c'",m->ipx,m->ipy,code[m->ipy][m->ipx]);
		if(animate){
			animationFrameStart(m->ipx,m->ipy,code[m->ipy][m->ipx]);
		}
		//if(animate)cout<<"\x1B[s\x1B["<<m->ipy+1<<";"<<m->ipx+1<<"H\x1B[41;1m"<<code[m->ipy][m->ipx]<<"\x1B[0m\x1B[u"<<flush;
		char codechar=code[m->ipy][m->ipx];
		if(m->skip){
			if(strchr("=|#\")(+-.:,;><^![@w",codechar)!=NULL)m->skip=false;
			codechar='\0';
		}
		switch(codechar){
		case '=': case '|': case '#': case '"':
			FATAL_FALSE("Mario somehow got stuck.");
		case ')':
			m->memp++;
			if(m->memp>memory.sizepos()-1){
				SHOW_MESSAGE("Resizing memory to the right...");
				memory.resizepos(memory.sizepos()*2);
			}
			break;
		case '(':
			m->memp--;
			if(m->memp<-memory.sizeneg()){
				SHOW_MESSAGE("Resizing memory to the left...");
				memory.resizeneg(memory.sizeneg()*2);
			}
			break;
		case '+':
			memory[m->memp]++;
			break;
		case '-':
			memory[m->memp]--;
			break;
		case '.':
			if(animate){
				c=memory[m->memp];
				if(c=='\r')outputx=0;
				else if(c=='\n'){outputx=0;outputy++;}
				else if(c=='\t'){outputx=TABWIDTH*(outputx/TABWIDTH+1);}
				else if(c>=0&&c<32){printf("^%c",'@'+c);outputx+=2;}
				else if(c==127){printf("^?");outputx+=2;}
				else {printf("%c",c);outputx++;}
			} else printf("%c",(char)memory[m->memp]);
			fflush(stdout);
			break;
		case ':':
			num=printf("%d ",memory[m->memp]);
			if(num<0)ERROR_FALSE("FATAL: IO error, printf returned a negative value!");
			fflush(stdout);
			outputx+=num;
			break;
		case ',':
			if(animate){
				moveto(0,inputy);
				printf("\x1B[34mInput char?\x1B[0m "); fflush(stdout);
				memory[m->memp]=getch();
			} else {
				memory[m->memp]=getchar();
			}
			if(animate){
				printf("\x1B[2K"); fflush(stdout);
				moveto(outputx,outputy);
			}
			SHOW_MESSAGE("Read input: char %c",(unsigned char)memory[m->memp]);
			break;
		case ';':
			if(animate){
				moveto(0,inputy);
				printf("\x1B[34mInput number?\x1B[0m "); fflush(stdout);
				c=getch();
				num=0;
				while(c!='\r'&&c!='\n'){
					if(c>='0'&&c<='9'){
						num=10*num+c-'0';
						printf("%c",c); fflush(stdout);
					} else if(c==127&&num!=0){ //backspace
						printf("\x1B[D \x1B[D"); fflush(stdout);
						num/=10;
					}
					c=getch();
				}
				memory[m->memp]=num;
				printf("\x1B[2K"); fflush(stdout);
				moveto(outputx,outputy);
			} else {
				scanf("%d",&memory[m->memp]);
			}
			SHOW_MESSAGE("Read input: number %d",(int)memory[m->memp]);
			break;
		case '>':
			m->dir=DIRRIGHT;
			m->walking=true;
			break;
		case '<':
			m->dir=DIRLEFT;
			m->walking=true;
			break;
		case '^':
			if(m->ipy!=0)m->ipy--;
			if(code[m->ipy][m->ipx]=='<'){
				m->dir=DIRLEFT;
				if(m->ipx==0)ERROR_FALSE("Mario walked out of the world.");
			} else if(code[m->ipy][m->ipx]=='>'){
				m->dir=DIRRIGHT;
				if(m->ipx>=(int)code[m->ipy].size())ERROR_FALSE("Mario walked out of the world.");
			} else ERROR_FALSE("Mario is exhausted of jumping infinitely.");
			m->walking=true;
			break;
		case '!':
			m->walking=false;m->dir=DIRNONE;
			break;
		case '[':
			if(memory[m->memp]==0)m->skip=true;
			break;
		case '@':
			if(m->dir==DIRRIGHT)m->dir=DIRLEFT;
			else if(m->dir==DIRLEFT)m->dir=DIRRIGHT;
			else ERROR_FALSE("The world glitched.");
			break;
		case 'w':
			animatedelay+=200000;
			break;
		default:
			break;
		}
		if(animate){
			animationFrameEnd(m,m->ipx,m->ipy,code[m->ipy][m->ipx]);
		}
		//if(animate)cout<<"\x1B[s\x1B["<<m->ipy+1+(code[m->ipy+1][m->ipx]=='^')<<";"<<m->ipx+1<<"H"<<code[m->ipy+(code[m->ipy+1][m->ipx]=='^')][m->ipx]<<"\x1B[u"<<flush;
		return true;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x3, 0x47ae(%rip)      # 0x816c
jge 0x3aee
cmpb $0x1, 0x47a9(%rip)      # 0x8174
jne 0x39ef
movslq (%rbx), %rsi
movslq 0x4(%rbx), %rdx
movq 0x30(%r14), %rax
movq %rdx, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %rax
movsbl (%rax,%rsi), %ecx
movq %r14, %rdi
callq 0x40f6
movslq 0x4(%rbx), %r13
movq 0x30(%r14), %r12
movq %r13, %rax
shlq $0x5, %rax
movslq (%rbx), %r15
movq (%r12,%rax), %rax
movb (%rax,%r15), %al
cmpb $0x1, 0x11(%rbx)
jne 0x3a2e
movsbl %al, %esi
leaq 0x1aa8(%rip), %rdi      # 0x54c1
movl $0x14, %edx
callq 0x2120
testq %rax, %rax
je 0x3a2c
movb $0x0, 0x11(%rbx)
xorl %eax, %eax
movzbl %al, %eax
cmpl $0x5a, %eax
jg 0x3a62
addl $-0x21, %eax
cmpl $0x1f, %eax
ja 0x3fc8
leaq 0x15bb(%rip), %rcx      # 0x5004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x0, 0x10(%rbx)
movl $0x3, 0xc(%rbx)
jmp 0x3fc8
cmpl $0x76, %eax
jg 0x3ac8
cmpl $0x5b, %eax
je 0x3e17
cmpl $0x5e, %eax
jne 0x3fc8
testl %r13d, %r13d
je 0x3a85
decl %r13d
movl %r13d, 0x4(%rbx)
movslq 0x4(%rbx), %rax
shlq $0x5, %rax
movq (%r12,%rax), %rcx
movzbl (%rcx,%r15), %ecx
cmpl $0x3e, %ecx
je 0x4022
cmpl $0x3c, %ecx
jne 0x404e
movl $0x2, 0xc(%rbx)
testl %r15d, %r15d
jne 0x3e0e
cmpl $0x0, 0x46ad(%rip)      # 0x816c
jle 0x3ae7
callq 0x26e7
jmp 0x3ae7
cmpl $0x77, %eax
je 0x3e4b
cmpl $0x7c, %eax
jne 0x3fc8
cmpl $0x0, 0x468b(%rip)      # 0x816c
jns 0x4065
xorl %ebp, %ebp
jmp 0x3ffa
movq %rbx, %rdi
movq %r14, %rsi
callq 0x25b8
jmp 0x39c4
movslq 0x8(%rbx), %rax
movl %eax, %ecx
notl %ecx
shlq $0x2, %rcx
addq 0x18(%r14), %rcx
leaq (,%rax,4), %rdx
addq (%r14), %rdx
testq %rax, %rax
cmovsq %rcx, %rdx
movl (%rdx), %esi
leaq 0x1a0b(%rip), %rdi      # 0x5534
xorl %eax, %eax
callq 0x2030
testl %eax, %eax
js 0x3faa
movl %eax, %ebp
movq 0x4477(%rip), %rax      # 0x7fb8
movq (%rax), %rdi
callq 0x2160
addl %ebp, 0x48(%r14)
jmp 0x3fc8
movslq 0x8(%rbx), %rax
movl %eax, %ecx
notl %ecx
shlq $0x2, %rcx
addq 0x18(%r14), %rcx
leaq (,%rax,4), %rdx
addq (%r14), %rdx
testq %rax, %rax
cmovsq %rcx, %rdx
movl (%rdx), %eax
movsbl %al, %esi
cmpb $0x1, 0x45f4(%rip)      # 0x8174
jne 0x3e5a
shll $0x18, %eax
cmpl $0x9000000, %eax        # imm = 0x9000000
je 0x4080
cmpl $0xa000000, %eax        # imm = 0xA000000
je 0x406f
cmpl $0xd000000, %eax        # imm = 0xD000000
jne 0x409b
movl $0x0, 0x48(%r14)
jmp 0x3e61
movl $0x0, 0xc(%rbx)
jmp 0x3e0e
cmpb $0x1, 0x45aa(%rip)      # 0x8174
jne 0x3e75
movl 0x50(%r14), %esi
incl %esi
leaq 0x14f1(%rip), %rdi      # 0x50ce
movl $0x1, %edx
xorl %eax, %eax
callq 0x2030
movq 0x43c8(%rip), %r12      # 0x7fb8
movq (%r12), %rdi
callq 0x2160
leaq 0x199a(%rip), %rdi      # 0x559a
xorl %eax, %eax
callq 0x2030
movq (%r12), %rdi
callq 0x2160
leaq 0x199b(%rip), %r15      # 0x55b2
xorl %r13d, %r13d
callq 0x2b1c
cmpb $0xa, %al
je 0x3ea7
movzbl %al, %edi
cmpl $0xd, %edi
je 0x3ea7
leal -0x30(%rax), %ecx
cmpb $0x9, %cl
jbe 0x3c79
testl %r13d, %r13d
setne %cl
cmpb $0x7f, %al
sete %al
andb %cl, %al
cmpb $0x1, %al
jne 0x3c1a
movq %r15, %rdi
xorl %eax, %eax
callq 0x2030
movq (%r12), %rdi
callq 0x2160
movslq %r13d, %rax
imulq $0x66666667, %rax, %r13 # imm = 0x66666667
movq %r13, %rax
shrq $0x3f, %rax
sarq $0x22, %r13
addl %eax, %r13d
jmp 0x3c1a
leal (%r13,%r13,4), %eax
leal (%rdi,%rax,2), %r13d
addl $-0x30, %r13d
callq 0x21b0
movq (%r12), %rdi
callq 0x2160
jmp 0x3c1a
movl 0x8(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x8(%rbx)
movq 0x8(%r14), %rcx
subq (%r14), %rcx
shrq $0x2, %rcx
decl %ecx
cmpl %ecx, %eax
jl 0x3fc8
cmpl $0x2, 0x44b1(%rip)      # 0x816c
jge 0x40e2
movq 0x8(%r14), %rax
subq (%r14), %rax
movq %rsp, %rdx
movl $0x0, (%rdx)
shrq %rax
movslq %eax, %rsi
andq $-0x2, %rsi
movq %r14, %rdi
jmp 0x3dfd
movslq 0x8(%rbx), %rax
movl %eax, %ecx
notl %ecx
shlq $0x2, %rcx
addq 0x18(%r14), %rcx
leaq (,%rax,4), %rdx
addq (%r14), %rdx
testq %rax, %rax
cmovsq %rcx, %rdx
decl (%rdx)
jmp 0x3fc8
movl 0xc(%rbx), %eax
cmpl $0x2, %eax
je 0x3fc1
testl %eax, %eax
jne 0x400b
movl $0x2, 0xc(%rbx)
jmp 0x3fc8
cmpb $0x1, 0x4441(%rip)      # 0x8174
jne 0x3f23
movl 0x50(%r14), %esi
incl %esi
leaq 0x1388(%rip), %rdi      # 0x50ce
movl $0x1, %edx
xorl %eax, %eax
callq 0x2030
movq 0x425f(%rip), %r15      # 0x7fb8
movq (%r15), %rdi
callq 0x2160
leaq 0x1803(%rip), %rdi      # 0x556b
xorl %eax, %eax
callq 0x2030
movq (%r15), %rdi
callq 0x2160
callq 0x2b1c
movsbl %al, %eax
jmp 0x3f28
movslq 0x8(%rbx), %rax
movl %eax, %ecx
notl %ecx
shlq $0x2, %rcx
addq 0x18(%r14), %rcx
leaq (,%rax,4), %rdx
addq (%r14), %rdx
testq %rax, %rax
cmovsq %rcx, %rdx
incl (%rdx)
jmp 0x3fc8
movl 0x8(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x8(%rbx)
movq 0x20(%r14), %rcx
subq 0x18(%r14), %rcx
shrq $0x2, %rcx
negl %ecx
cmpl %ecx, %eax
jg 0x3fc8
leaq 0x18(%r14), %r15
cmpl $0x2, 0x4395(%rip)      # 0x816c
jge 0x40ec
movq 0x20(%r14), %rax
subq 0x18(%r14), %rax
leaq 0x4(%rsp), %rdx
movl $0x0, (%rdx)
shrq %rax
movslq %eax, %rsi
andq $-0x2, %rsi
movq %r15, %rdi
callq 0x374c
jmp 0x3fc8
movl $0x2, 0xc(%rbx)
movb $0x1, 0x10(%rbx)
jmp 0x3fc8
movslq 0x8(%rbx), %rax
movl %eax, %ecx
notl %ecx
shlq $0x2, %rcx
addq 0x18(%r14), %rcx
leaq (,%rax,4), %rdx
addq (%r14), %rdx
testq %rax, %rax
cmovsq %rcx, %rdx
cmpl $0x0, (%rdx)
jne 0x3fc8
movb $0x1, 0x11(%rbx)
jmp 0x3fc8
addl $0x30d40, 0x431b(%rip)  # imm = 0x30D40
jmp 0x3fc8
movl %esi, %edi
callq 0x21b0
movq 0x4150(%rip), %rax      # 0x7fb8
movq (%rax), %rdi
callq 0x2160
jmp 0x3fc8
movslq 0x8(%rbx), %rax
movl %eax, %ecx
notl %ecx
shlq $0x2, %rcx
addq 0x18(%r14), %rcx
leaq (,%rax,4), %rsi
addq (%r14), %rsi
testq %rax, %rax
cmovsq %rcx, %rsi
leaq 0x172f(%rip), %rdi      # 0x55cd
xorl %eax, %eax
callq 0x2150
jmp 0x3f06
movslq 0x8(%rbx), %rax
movl %eax, %ecx
notl %ecx
shlq $0x2, %rcx
addq 0x18(%r14), %rcx
leaq (,%rax,4), %rdx
addq (%r14), %rdx
testq %rax, %rax
cmovsq %rcx, %rdx
movl %r13d, (%rdx)
leaq 0x16ae(%rip), %rdi      # 0x5581
xorl %eax, %eax
callq 0x2030
movq (%r12), %rdi
callq 0x2160
movl 0x48(%r14), %edx
movl 0x4c(%r14), %esi
incl %esi
incl %edx
leaq 0x11d8(%rip), %rdi      # 0x50ce
xorl %eax, %eax
callq 0x2030
movq (%r12), %rdi
callq 0x2160
cmpl $0x2, 0x425f(%rip)      # 0x816c
jl 0x3fc8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2795
jmp 0x3fc8
callq 0x21a0
movslq 0x8(%rbx), %rcx
movl %ecx, %edx
notl %edx
shlq $0x2, %rdx
addq 0x18(%r14), %rdx
leaq (,%rcx,4), %rsi
addq (%r14), %rsi
testq %rcx, %rcx
cmovsq %rdx, %rsi
movl %eax, (%rsi)
cmpb $0x1, 0x4221(%rip)      # 0x8174
jne 0x3f94
leaq 0x1625(%rip), %rdi      # 0x5581
xorl %eax, %eax
callq 0x2030
movq 0x404e(%rip), %r15      # 0x7fb8
movq (%r15), %rdi
callq 0x2160
movl 0x48(%r14), %edx
movl 0x4c(%r14), %esi
incl %esi
incl %edx
leaq 0x1149(%rip), %rdi      # 0x50ce
xorl %eax, %eax
callq 0x2030
movq (%r15), %rdi
callq 0x2160
cmpl $0x2, 0x41d1(%rip)      # 0x816c
jl 0x3fc8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x281e
jmp 0x3fc8
cmpl $0x0, 0x41bb(%rip)      # 0x816c
jle 0x3ae7
callq 0x28a8
jmp 0x3ae7
movl $0x0, 0xc(%rbx)
movb $0x1, %bpl
cmpb $0x1, 0x41a2(%rip)      # 0x8174
jne 0x3ffa
movslq (%rbx), %rdx
movslq 0x4(%rbx), %rcx
movq 0x30(%r14), %rax
movq %rcx, %rsi
shlq $0x5, %rsi
movq (%rax,%rsi), %rax
movsbl (%rax,%rdx), %r8d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4168
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x415a(%rip)      # 0x816c
jle 0x3ae7
callq 0x2639
jmp 0x3ae7
addq %rax, %r12
movl $0x0, 0xc(%rbx)
cmpl 0x8(%r12), %r15d
jl 0x3e0e
cmpl $0x0, 0x412e(%rip)      # 0x816c
jle 0x3ae7
callq 0x2690
jmp 0x3ae7
cmpl $0x0, 0x4117(%rip)      # 0x816c
jle 0x3ae7
callq 0x273e
jmp 0x3ae7
callq 0x29ad
jmp 0x3ae7
movl $0x0, 0x48(%r14)
incl 0x4c(%r14)
jmp 0x3e61
movl 0x48(%r14), %eax
leal 0x7(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
andl $-0x8, %ecx
addl $0x8, %ecx
movl %ecx, 0x48(%r14)
jmp 0x3e61
cmpl $0x1f, %esi
ja 0x40b3
orl $0x40, %esi
leaq 0x1483(%rip), %rdi      # 0x552d
xorl %eax, %eax
callq 0x2030
jmp 0x40c8
cmpl $0x7f000000, %eax       # imm = 0x7F000000
jne 0x40d2
leaq 0x1470(%rip), %rdi      # 0x5531
xorl %eax, %eax
callq 0x2030
addl $0x2, 0x48(%r14)
jmp 0x3e61
movl %esi, %edi
callq 0x21b0
incl 0x48(%r14)
jmp 0x3e61
callq 0x2956
jmp 0x3cc1
callq 0x28ff
jmp 0x3ddd