// File: iTruth[P]klotski/klotski_board.cpp
// Function: klotski_board::klotski_board(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int, char)
klotski_board::klotski_board(std::string situation_string, int dx, int dy, const char split):
	dx(dx), dy(dy),
	x_distribution(std::uniform_int_distribution<>(0, dx-1)),
	y_distribution(std::uniform_int_distribution<>(0, dy-1)){
		resize_board_to_fit();
		std::replace(situation_string.begin(), situation_string.end(), split, ' ');
		std::stringstream ss(situation_string);
		for(auto& i: situation){
			for(int& n: i){
				if(ss.eof()){
					std::stringstream ss;
					ss<<"situation is not fit for "<<dx<<"x"<<dy<<" board";
					throw std::runtime_error(ss.str().c_str());
				}
				ss>>n;
				if(ss.fail()){
					throw std::runtime_error("situation is not valid");
				}

			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x420, %rsp            # imm = 0x420
movq %rsi, -0x3d8(%rbp)
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x3c8(%rbp)
leaq 0x17970(%rip), %rax     # 0x23ca8
movq %rax, (%rdi)
movl -0x14(%rbp), %eax
movl %eax, 0x8(%rdi)
movl -0x18(%rbp), %eax
movl %eax, 0xc(%rdi)
movl $0x0, 0x10(%rdi)
movl $0x0, 0x14(%rdi)
addq $0x18, %rdi
movq %rdi, -0x3d0(%rbp)
callq 0xb7d0
movq -0x3c8(%rbp), %rdi
addq $0x30, %rdi
movl -0x14(%rbp), %edx
decl %edx
xorl %esi, %esi
callq 0xb7f0
jmp 0xc37e
movq -0x3c8(%rbp), %rdi
addq $0x38, %rdi
movl -0x18(%rbp), %edx
decl %edx
xorl %esi, %esi
callq 0xb7f0
jmp 0xc397
movq -0x3c8(%rbp), %rdi
addq $0x40, %rdi
movsd 0xbd46(%rip), %xmm0     # 0x180f0
callq 0xb820
jmp 0xc3b1
movq -0x3c8(%rbp), %rdi
callq 0xc7a0
jmp 0xc3bf
movq -0x3d8(%rbp), %rdi
callq 0x3280
movq -0x3d8(%rbp), %rdi
movq %rax, -0x38(%rbp)
callq 0x3170
movq %rax, -0x40(%rbp)
movb $0x20, -0x41(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
leaq -0x19(%rbp), %rdx
leaq -0x41(%rbp), %rcx
callq 0xe6b0
jmp 0xc3fa
movl $0x10, %edi
movl $0x8, %esi
callq 0x5be0
movl %eax, -0x3dc(%rbp)
jmp 0xc411
movl -0x3dc(%rbp), %edx
movq -0x3d8(%rbp), %rsi
leaq -0x1d0(%rbp), %rdi
callq 0x3460
jmp 0xc42c
movq -0x3c8(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x1d8(%rbp)
movq -0x1d8(%rbp), %rdi
callq 0x8f50
movq %rax, -0x1e0(%rbp)
movq -0x1d8(%rbp), %rdi
callq 0x8f80
movq %rax, -0x1e8(%rbp)
leaq -0x1e0(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0xb880
testb $0x1, %al
jne 0xc480
jmp 0xc762
leaq -0x1e0(%rbp), %rdi
callq 0x9800
movq %rax, -0x1f0(%rbp)
movq -0x1f0(%rbp), %rax
movq %rax, -0x1f8(%rbp)
movq -0x1f8(%rbp), %rdi
callq 0xafb0
movq %rax, -0x200(%rbp)
movq -0x1f8(%rbp), %rdi
callq 0xae40
movq %rax, -0x208(%rbp)
leaq -0x200(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0xb8c0
testb $0x1, %al
jne 0xc4e3
jmp 0xc74f
leaq -0x200(%rbp), %rdi
callq 0xb900
movq %rax, -0x210(%rbp)
movq -0x1d0(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x1d0(%rbp,%rax), %rdi
callq 0x3510
movb %al, -0x3dd(%rbp)
jmp 0xc516
movb -0x3dd(%rbp), %al
testb $0x1, %al
jne 0xc525
jmp 0xc6a0
leaq -0x398(%rbp), %rdi
callq 0x31f0
jmp 0xc533
leaq -0x388(%rbp), %rdi
leaq 0xc1bf(%rip), %rsi      # 0x18700
callq 0x32e0
movq %rax, -0x3e8(%rbp)
jmp 0xc54f
movq -0x3e8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x34d0
movq %rax, -0x3f0(%rbp)
jmp 0xc567
movq -0x3f0(%rbp), %rdi
leaq 0xbe2a(%rip), %rsi      # 0x1839f
callq 0x32e0
movq %rax, -0x3f8(%rbp)
jmp 0xc583
movq -0x3f8(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x34d0
movq %rax, -0x400(%rbp)
jmp 0xc59b
movq -0x400(%rbp), %rdi
leaq 0xbce9(%rip), %rsi      # 0x18292
callq 0x32e0
jmp 0xc5b0
movb $0x1, -0x3b9(%rbp)
movl $0x10, %edi
callq 0x3130
movq %rax, -0x408(%rbp)
leaq -0x3b8(%rbp), %rdi
leaq -0x398(%rbp), %rsi
callq 0x32d0
jmp 0xc5dd
leaq -0x3b8(%rbp), %rdi
callq 0x30f0
movq -0x408(%rbp), %rdi
movq %rax, %rsi
callq 0x30d0
jmp 0xc5fa
movq -0x408(%rbp), %rdi
movb $0x0, -0x3b9(%rbp)
movq 0x179e1(%rip), %rsi     # 0x23ff0
movq 0x1797a(%rip), %rdx     # 0x23f90
callq 0x34b0
jmp 0xc798
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0xc783
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0xc777
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0xc68f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0xc676
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x3b8(%rbp), %rdi
callq 0x31a0
testb $0x1, -0x3b9(%rbp)
jne 0xc681
jmp 0xc68d
movq -0x408(%rbp), %rdi
callq 0x3210
jmp 0xc68f
leaq -0x398(%rbp), %rdi
callq 0x3230
jmp 0xc777
movq -0x210(%rbp), %rsi
leaq -0x1d0(%rbp), %rdi
callq 0x3190
jmp 0xc6b5
movq -0x1d0(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x1d0(%rbp,%rax), %rdi
callq 0x3030
movb %al, -0x409(%rbp)
jmp 0xc6d5
movb -0x409(%rbp), %al
testb $0x1, %al
jne 0xc6e1
jmp 0xc73c
movl $0x10, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x418(%rbp)
leaq 0xc01b(%rip), %rsi      # 0x1871a
callq 0x30d0
jmp 0xc706
movq -0x418(%rbp), %rdi
movq 0x178dc(%rip), %rsi     # 0x23ff0
movq 0x17875(%rip), %rdx     # 0x23f90
callq 0x34b0
jmp 0xc798
movq -0x418(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3210
jmp 0xc777
jmp 0xc73e
leaq -0x200(%rbp), %rdi
callq 0xb9f0
jmp 0xc4c7
jmp 0xc751
leaq -0x1e0(%rbp), %rdi
callq 0x9820
jmp 0xc464
leaq -0x1d0(%rbp), %rdi
callq 0x3230
addq $0x420, %rsp            # imm = 0x420
popq %rbp
retq
leaq -0x1d0(%rbp), %rdi
callq 0x3230
movq -0x3d0(%rbp), %rdi
callq 0x74b0
movq -0x28(%rbp), %rdi
callq 0x34e0
nopl (%rax,%rax)