// File: Wheatwizard[P]Waldo/Reactor.cpp
// Function: Reactor::Reactor(unsigned int, unsigned int, unsigned int)
Reactor:: Reactor(unsigned width, unsigned height, unsigned num_waldos)
	: w(width), h(height), waldo_num(num_waldos), sensorx(height+1), sensory(width+1),
	   board(new Tile*[height]), waldos(new Waldo[num_waldos]) {
	for (unsigned i = 0; i < height; ++i) {
		board[i] = new Tile[width];
		for (unsigned j = 0; j < width; ++j) {
			board[i][j].initialize(num_waldos);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movl -0xc(%rbp), %ecx
movl %ecx, (%rax)
movl -0x10(%rbp), %ecx
movl %ecx, 0x4(%rax)
movl -0x14(%rbp), %ecx
movl %ecx, 0x8(%rax)
movl -0x10(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rax)
movl -0x10(%rbp), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x18(%rax)
addq $0x20, %rax
movq %rax, -0x58(%rbp)
movl -0x14(%rbp), %eax
movq %rax, -0x48(%rbp)
movl $0x40, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x50(%rbp)
callq 0x2030
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, -0x40(%rbp)
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x38(%rbp)
cmpq $0x0, %rax
je 0x52b9
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rdx
shlq $0x6, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x70(%rbp)
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x7960
jmp 0x52a4
movq -0x70(%rbp), %rcx
movq -0x78(%rbp), %rax
addq $0x40, %rax
cmpq %rcx, %rax
movq %rax, -0x68(%rbp)
jne 0x5295
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, (%rax)
addq $0x28, %rdi
movq %rdi, -0x80(%rbp)
callq 0x65a0
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x10(%rbp), %eax
jae 0x54d1
movl -0xc(%rbp), %eax
movq %rax, -0x98(%rbp)
leaq (%rax,%rax,4), %rax
leaq 0x8(,%rax,8), %rdi
movq %rdi, -0x90(%rbp)
callq 0x2030
movq %rax, -0x88(%rbp)
jmp 0x5313
movq -0x98(%rbp), %rax
movq -0x88(%rbp), %rcx
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0xa0(%rbp)
cmpq $0x0, %rax
je 0x538e
movq -0xa0(%rbp), %rax
movq -0x98(%rbp), %rcx
imulq $0x28, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0xb0(%rbp)
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x6ba0
jmp 0x5370
movq -0xb0(%rbp), %rcx
movq -0xb8(%rbp), %rax
addq $0x28, %rax
cmpq %rcx, %rax
movq %rax, -0xa8(%rbp)
jne 0x535b
movq -0xa0(%rbp), %rdx
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x28(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x54c1
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x28(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x2c(%rbp), %ecx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %rdi
movl -0x14(%rbp), %esi
callq 0x6d00
jmp 0x53db
jmp 0x53dd
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x53ab
movq -0x38(%rbp), %rcx
movq %rax, %rsi
movq -0x78(%rbp), %rax
movq %rsi, -0x20(%rbp)
movl %edx, -0x24(%rbp)
cmpq %rax, %rcx
movq %rax, -0xc0(%rbp)
je 0x5434
movq -0xc0(%rbp), %rdi
addq $-0x40, %rdi
movq %rdi, -0xc8(%rbp)
callq 0x6580
movq -0x38(%rbp), %rcx
movq -0xc8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0xc0(%rbp)
jne 0x5406
movq -0x50(%rbp), %rsi
movq -0x40(%rbp), %rdi
callq 0x22c0
jmp 0x54e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x54da
movq -0xa0(%rbp), %rcx
movq %rax, %rsi
movq -0xb8(%rbp), %rax
movq %rsi, -0x20(%rbp)
movl %edx, -0x24(%rbp)
cmpq %rax, %rcx
movq %rax, -0xd0(%rbp)
je 0x54ac
movq -0xd0(%rbp), %rdi
addq $-0x28, %rdi
movq %rdi, -0xd8(%rbp)
callq 0x6e60
movq -0xa0(%rbp), %rcx
movq -0xd8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0xd0(%rbp)
jne 0x547b
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdi
callq 0x22c0
jmp 0x54da
jmp 0x54c3
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x52dc
addq $0xe0, %rsp
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x65c0
movq -0x20(%rbp), %rdi
callq 0x2290
nopl (%rax)