// File: uclaopt[P]AsyncQVI/include/oracle.h
// Function: Sailing::apply(int)
void apply(int a){
			std::pair<int, int> dir = direction(a);
			x = max(0, min(x + dir.first, DIMX-1));
			y = max(0, min(y + dir.second, DIMY-1));
			
			// some noise in positioning
			// simulate wind
			x = max(0, min(x + (int)localNormalDouble(0.,0.1), DIMX-1));
			y = max(0, min(y + (int)localNormalDouble(0.,0.1), DIMY-1));

			// simulate vortex
			if(localUniformDouble(0,1) < probs){
				x = max(0, min(x + (int)localNormalDouble(0.,1.), DIMX-1));
				y = max(0, min(y + (int)localNormalDouble(0.,1.), DIMY-1));
			}
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x68(%rbp)
movl -0xc(%rbp), %esi
callq 0x7480
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl (%rax), %ecx
addl -0x14(%rbp), %ecx
movl %ecx, -0x1c(%rbp)
movl 0xc(%rax), %eax
subl $0x1, %eax
movl %eax, -0x20(%rbp)
leaq -0x1c(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x7640
movq %rax, %rsi
leaq -0x18(%rbp), %rdi
callq 0x7600
movq %rax, %rcx
movq -0x68(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, (%rax)
movl $0x0, -0x24(%rbp)
movl 0x4(%rax), %ecx
addl -0x10(%rbp), %ecx
movl %ecx, -0x28(%rbp)
movl 0x10(%rax), %eax
subl $0x1, %eax
movl %eax, -0x2c(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x7640
movq %rax, %rsi
leaq -0x24(%rbp), %rdi
callq 0x7600
movq -0x68(%rbp), %rdi
movl (%rax), %eax
movl %eax, 0x4(%rdi)
movl $0x0, -0x30(%rbp)
movl (%rdi), %eax
movl %eax, -0x70(%rbp)
xorps %xmm0, %xmm0
movsd 0x5eed(%rip), %xmm1     # 0xd058
callq 0x7680
movl -0x70(%rbp), %ecx
movq -0x68(%rbp), %rax
cvttsd2si %xmm0, %edx
addl %edx, %ecx
movl %ecx, -0x34(%rbp)
movl 0xc(%rax), %eax
subl $0x1, %eax
movl %eax, -0x38(%rbp)
leaq -0x34(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x7640
movq %rax, %rsi
leaq -0x30(%rbp), %rdi
callq 0x7600
movq -0x68(%rbp), %rdi
movl (%rax), %eax
movl %eax, (%rdi)
movl $0x0, -0x3c(%rbp)
movl 0x4(%rdi), %eax
movl %eax, -0x6c(%rbp)
xorps %xmm0, %xmm0
movsd 0x5e96(%rip), %xmm1     # 0xd058
callq 0x7680
movl -0x6c(%rbp), %ecx
movq -0x68(%rbp), %rax
cvttsd2si %xmm0, %edx
addl %edx, %ecx
movl %ecx, -0x40(%rbp)
movl 0x10(%rax), %eax
subl $0x1, %eax
movl %eax, -0x44(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x44(%rbp), %rsi
callq 0x7640
movq %rax, %rsi
leaq -0x3c(%rbp), %rdi
callq 0x7600
movq -0x68(%rbp), %rdi
movl (%rax), %eax
movl %eax, 0x4(%rdi)
xorps %xmm0, %xmm0
movsd 0x5e0b(%rip), %xmm1     # 0xd018
callq 0x76d0
movq -0x68(%rbp), %rax
movaps %xmm0, %xmm1
movsd 0x20(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x72dd
movq -0x68(%rbp), %rdi
movl $0x0, -0x48(%rbp)
movl (%rdi), %eax
movl %eax, -0x78(%rbp)
xorps %xmm0, %xmm0
movsd 0x5dd5(%rip), %xmm1     # 0xd018
callq 0x7680
movl -0x78(%rbp), %ecx
movq -0x68(%rbp), %rax
cvttsd2si %xmm0, %edx
addl %edx, %ecx
movl %ecx, -0x4c(%rbp)
movl 0xc(%rax), %eax
subl $0x1, %eax
movl %eax, -0x50(%rbp)
leaq -0x4c(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x7640
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x7600
movq -0x68(%rbp), %rdi
movl (%rax), %eax
movl %eax, (%rdi)
movl $0x0, -0x54(%rbp)
movl 0x4(%rdi), %eax
movl %eax, -0x74(%rbp)
xorps %xmm0, %xmm0
movsd 0x5d7e(%rip), %xmm1     # 0xd018
callq 0x7680
movl -0x74(%rbp), %ecx
movq -0x68(%rbp), %rax
cvttsd2si %xmm0, %edx
addl %edx, %ecx
movl %ecx, -0x58(%rbp)
movl 0x10(%rax), %eax
subl $0x1, %eax
movl %eax, -0x5c(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x5c(%rbp), %rsi
callq 0x7640
movq %rax, %rsi
leaq -0x54(%rbp), %rdi
callq 0x7600
movq %rax, %rcx
movq -0x68(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, 0x4(%rax)
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)