// File: /workspace/github_cpp_makefile_star2_O2/tomsmeding[P]MarioLANG/mariolang.cpp
// Function: Level::execcommandStep(mario*)
bool execcommandStep(mario *m){
		static bool lastTurnWasStanding=false;
		SHOW_MESSAGE("EC\tinstr=%c\tip=%d,%d\tmemp=%d\tmem[memp]=%d\tdir=%d\twalking=%d\tskip=%d",code[m->ipy][m->ipx],m->ipx,m->ipy,m->memp,memory[m->memp],m->dir,m->walking,m->skip);
		/*if(m->ipx<0||m->ipx>=code[m->ipy].size()){
			ERROR_FALSE("Mario walked out of the world.");
		}*/
		while(m->ipy<(int)code.size()-1
			&&code[m->ipy+1][m->ipx]!='='
			&&code[m->ipy+1][m->ipx]!='|'
			&&code[m->ipy+1][m->ipx]!='#'
			&&code[m->ipy+1][m->ipx]!='"'){
			if(!execcommandSingle(m))return false;
			m->ipy++;
		}
		if(m->ipy==(int)code.size()-1)ERROR_FALSE("Mario fell out of the world.");
		if(code[m->ipy+1][m->ipx]=='#'&&!m->walking){
			int newipy=m->ipy;
			while(newipy>0&&code[newipy][m->ipx]!='"')newipy--;
			if(newipy>0){
				newipy--;
				for(m->ipy-=1;m->ipy>newipy+1;m->ipy--)if(!execcommandSingle(m))return false;
				m->ipy=newipy;
			} else {
				newipy=m->ipy+2;
				while(newipy<(int)code.size()&&code[newipy][m->ipx]!='"')newipy++;
				if(newipy==(int)code.size())FATAL_FALSE("Elevator without ending.");
				newipy--;
				for(m->ipy+=2;m->ipy<newipy;m->ipy++)if(!execcommandSingle(m))return false;
				//now m->ipy == newipy
			}
		}
		if(!execcommandSingle(m))return false;
		if(m->walking){
			if(m->dir==DIRRIGHT){
				if(m->ipx<(int)code[m->ipy].size()-1)m->ipx++;
				else ERROR_FALSE("Mario walked out of the world.");
			} else if(m->dir==DIRLEFT){
				if(m->ipx>0)m->ipx--;
				else ERROR_FALSE("Mario walked out of the world.");
			} else FATAL_FALSE("The world glitched!");
			lastTurnWasStanding=false;
		} else {
			if(!lastTurnWasStanding)lastTurnWasStanding=true;
			else ERROR_FALSE("Mario got tired of standing still.");
		}
		return true;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x2, 0x4416(%rip)      # 0x718c
jge 0x2f4a
movl 0x4(%rbx), %eax
movq 0x30(%r14), %rdx
movq 0x38(%r14), %rcx
subq %rdx, %rcx
shrq $0x5, %rcx
leal -0x1(%rcx), %esi
movslq %eax, %rdi
cmpl %esi, %eax
jge 0x2ddf
movq %rdi, %r8
shlq $0x5, %r8
movslq (%rbx), %r9
movq 0x20(%rdx,%r8), %r8
movzbl (%r8,%r9), %r8d
leal -0x22(%r8), %r9d
cmpl $0x2, %r9d
jb 0x2ddf
cmpl $0x3d, %r8d
je 0x2ddf
cmpl $0x7c, %r8d
je 0x2ddf
movq %r14, %rdi
movq %rbx, %rsi
callq 0x33f4
testb %al, %al
je 0x3106
movl 0x4(%rbx), %eax
incl %eax
movl %eax, 0x4(%rbx)
jmp 0x2d7f
cmpl %esi, %eax
jne 0x2e42
cmpl $0x0, 0x43a2(%rip)      # 0x718c
jle 0x3106
movq 0x41d9(%rip), %r15      # 0x6fd0
movq (%r15), %rcx
leaq 0x160b(%rip), %rdi      # 0x440c
pushq $0x5
popq %rbx
pushq $0x1
popq %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x22b0
movq (%r15), %rcx
leaq 0x15f5(%rip), %rdi      # 0x4412
pushq $0x1c
popq %rsi
movq %r14, %rdx
callq 0x22b0
movq (%r15), %rcx
leaq 0x15d4(%rip), %rdi      # 0x4406
movq %rbx, %rsi
movq %r14, %rdx
callq 0x22b0
jmp 0x3106
shlq $0x5, %rdi
movslq (%rbx), %rsi
movq 0x20(%rdx,%rdi), %rdi
cmpb $0x23, (%rdi,%rsi)
jne 0x2e5a
cmpb $0x0, 0x10(%rbx)
je 0x2eae
movq %r14, %rdi
movq %rbx, %rsi
callq 0x33f4
testb %al, %al
je 0x3106
cmpb $0x1, 0x10(%rbx)
jne 0x2efa
movl 0xc(%rbx), %eax
cmpl $0x2, %eax
je 0x3022
testl %eax, %eax
jne 0x303f
movl (%rbx), %eax
movslq 0x4(%rbx), %rcx
movq 0x30(%r14), %rdx
shlq $0x5, %rcx
movl 0x8(%rdx,%rcx), %ecx
decl %ecx
cmpl %ecx, %eax
jge 0x30fd
incl %eax
jmp 0x302e
movl %eax, %r15d
testl %r15d, %r15d
jle 0x2ff0
movl %r15d, %edi
shlq $0x5, %rdi
movq (%rdx,%rdi), %rdi
decl %r15d
cmpb $0x22, (%rdi,%rsi)
jne 0x2eb1
leal 0x1(%r15), %ebp
movl 0x4(%rbx), %eax
decl %eax
movl %eax, 0x4(%rbx)
cmpl %ebp, %eax
jle 0x3079
movq %r14, %rdi
movq %rbx, %rsi
callq 0x33f4
movl %eax, %ecx
xorl %eax, %eax
testb %cl, %cl
jne 0x2ed2
jmp 0x3108
movb $0x1, %al
cmpb $0x1, 0x429d(%rip)      # 0x71a0
jne 0x3032
cmpl $0x0, 0x427c(%rip)      # 0x718c
jle 0x3106
movq 0x40b3(%rip), %r15      # 0x6fd0
movq (%r15), %rcx
leaq 0x14e5(%rip), %rdi      # 0x440c
pushq $0x5
popq %rbx
pushq $0x1
popq %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x22b0
movq (%r15), %rcx
leaq 0x1540(%rip), %rdi      # 0x4483
pushq $0x22
jmp 0x2e1f
movq 0x407f(%rip), %r13      # 0x6fd0
movq (%r13), %rcx
leaq 0x1460(%rip), %rdi      # 0x43bc
pushq $0x5
popq %rsi
pushq $0x1
popq %r12
movq %r12, %rdx
callq 0x22b0
movq (%r13), %rdi
movslq 0x4(%rbx), %r8
movq 0x30(%r14), %rax
movq %r8, %rdx
shlq $0x5, %rdx
movslq (%rbx), %rcx
movslq 0x8(%rbx), %r9
movl %r9d, %esi
notl %esi
shlq $0x2, %rsi
addq 0x18(%r14), %rsi
movq (%rax,%rdx), %rax
leaq (,%r9,4), %r10
addq (%r14), %r10
movsbl (%rax,%rcx), %edx
testq %r9, %r9
cmovsq %rsi, %r10
movl (%r10), %r15d
movl 0xc(%rbx), %r11d
movzbl 0x10(%rbx), %ebp
movzbl 0x11(%rbx), %r10d
leaq 0x13ff(%rip), %rsi      # 0x43c2
xorl %eax, %eax
pushq %r10
pushq %rbp
pushq %r11
pushq %r15
callq 0x2220
addq $0x20, %rsp
movq (%r13), %rcx
leaq 0x1426(%rip), %rdi      # 0x4406
pushq $0x5
popq %rsi
movq %r12, %rdx
callq 0x22b0
jmp 0x2d7c
addl $0x2, %eax
movslq %eax, %rdi
cmpl %ecx, %edi
movl %ecx, %ebp
cmovgl %edi, %ebp
movslq %ecx, %r8
movq %rdi, %r9
shlq $0x5, %r9
addq %r9, %rdx
cmpq %r8, %rdi
jge 0x3084
movq (%rdx), %r9
cmpb $0x22, (%r9,%rsi)
je 0x3082
incq %rdi
addq $0x20, %rdx
jmp 0x300a
movl (%rbx), %eax
testl %eax, %eax
jle 0x30fd
decl %eax
movl %eax, (%rbx)
xorl %eax, %eax
movb %al, 0x4168(%rip)       # 0x71a0
movb $0x1, %al
jmp 0x3108
cmpl $0x0, 0x4146(%rip)      # 0x718c
js 0x3106
movq 0x3f7d(%rip), %r14      # 0x6fd0
movq (%r14), %rcx
leaq 0x13d2(%rip), %rdi      # 0x442f
pushq $0x7
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x22b0
movq (%r14), %rcx
leaq 0x13fa(%rip), %rdi      # 0x446f
pushq $0x13
jmp 0x30bc
movl %r15d, 0x4(%rbx)
jmp 0x2e5a
movl %edi, %ebp
cmpl %ecx, %ebp
jne 0x30da
cmpl $0x0, 0x40fd(%rip)      # 0x718c
js 0x3106
movq 0x3f38(%rip), %r14      # 0x6fd0
movq (%r14), %rcx
leaq 0x138d(%rip), %rdi      # 0x442f
pushq $0x7
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x22b0
movq (%r14), %rcx
leaq 0x137d(%rip), %rdi      # 0x4437
pushq $0x18
popq %rsi
movq %rbx, %rdx
callq 0x22b0
movq (%r14), %rcx
leaq 0x1337(%rip), %rdi      # 0x4406
pushq $0x5
popq %rsi
movq %rbx, %rdx
jmp 0x2e38
decl %ebp
movl %eax, 0x4(%rbx)
cmpl %ebp, %eax
jge 0x2e5a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x33f4
testb %al, %al
je 0x3106
movl 0x4(%rbx), %eax
incl %eax
jmp 0x30dc
cmpl $0x0, 0x4088(%rip)      # 0x718c
jg 0x3117
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3eb2(%rip), %r15      # 0x6fd0
movq (%r15), %rcx
leaq 0x12e4(%rip), %rdi      # 0x440c
pushq $0x5
popq %rbx
pushq $0x1
popq %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x22b0
movq (%r15), %rcx
leaq 0x130c(%rip), %rdi      # 0x4450
pushq $0x1e
jmp 0x2e1f
nop