// File: mgronhol[P]Ullur/ullur.cpp
// Function: handle_get[abi:cxx11](double, double, double)
std::string handle_get( double x, double y, double r ){
	std::string out;

	std::vector< uint64_t > results_inter, /*results_final,*/ values;
	std::vector< std::pair< uint64_t, uint64_t > > areas;
	int N = -floor( log(r) / log(2) );
	uint64_t test_point_H = compute_hash( x, y );
	std::pair< double, double > test_point( x, y );
	char buffer[256];

/*	if( N < 4 ){
		// linear search is (probablyfaster
		for( std::set< uint64_t >::iterator it = hashes.begin() ; it != hashes.end() ; it++ ){}
		}
*/

	areas = get_near_indices( N, test_point_H );
	results_inter = extract_points( hashes, areas );

	double radius = r*r;
	std::pair< double, double > point;

	for( size_t i = 0 ; i < results_inter.size() ; ++i ){
		point = compute_position( results_inter[i] );

		if( get_squared_distance( point, test_point ) <= radius ){

			values = multiget( database, results_inter[i] );

			for( size_t j = 0 ; j < values.size() ; ++j ){
				memset( buffer, 0, 256 );
				sprintf( buffer, "%lu\n", values[j] );
				out += std::string( buffer );
				}
			}

		}

	return out + "\r\n";
	}

// Assembly:
subq $0x2e8, %rsp            # imm = 0x2E8
movq %rdi, 0x68(%rsp)
movq %rdi, %rax
movq %rax, 0x70(%rsp)
movq %rdi, 0x2e0(%rsp)
movsd %xmm0, 0x2d8(%rsp)
movsd %xmm1, 0x2d0(%rsp)
movsd %xmm2, 0x2c8(%rsp)
leaq 0x2a8(%rsp), %rdi
callq 0x23b0
leaq 0x290(%rsp), %rdi
callq 0x4a20
leaq 0x278(%rsp), %rdi
callq 0x4a20
leaq 0x260(%rsp), %rdi
callq 0x4cc0
movsd 0x2c8(%rsp), %xmm0
callq 0x2220
movsd %xmm0, 0x78(%rsp)
movsd 0xa399(%rip), %xmm0     # 0xd020
callq 0x2220
movaps %xmm0, %xmm1
movsd 0x78(%rsp), %xmm0
divsd %xmm1, %xmm0
callq 0x2420
movaps 0xa39b(%rip), %xmm1     # 0xd040
pxor %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x25c(%rsp)
movsd 0x2d8(%rsp), %xmm0
movsd 0x2d0(%rsp), %xmm1
callq 0xa5f0
movq %rax, 0x80(%rsp)
jmp 0x2cd5
movq 0x80(%rsp), %rax
movq %rax, 0x250(%rsp)
leaq 0x230(%rsp), %rdi
leaq 0x2d8(%rsp), %rsi
leaq 0x2d0(%rsp), %rdx
callq 0x4cd0
jmp 0x2d04
movslq 0x25c(%rsp), %rsi
movq 0x250(%rsp), %rdx
leaq 0x118(%rsp), %rdi
callq 0xa9b0
jmp 0x2d23
leaq 0x260(%rsp), %rdi
movq %rdi, 0x60(%rsp)
leaq 0x118(%rsp), %rsi
movq %rsi, 0x58(%rsp)
callq 0x4d00
movq 0x58(%rsp), %rdi
callq 0x4d40
movq 0x60(%rsp), %rdx
leaq 0x10560(%rip), %rsi     # 0x132b8
leaq 0x100(%rsp), %rdi
callq 0xabe0
jmp 0x2d67
leaq 0x290(%rsp), %rdi
leaq 0x100(%rsp), %rsi
movq %rsi, 0x50(%rsp)
callq 0x4c80
movq 0x50(%rsp), %rdi
callq 0x4b90
movsd 0x2c8(%rsp), %xmm0
mulsd %xmm0, %xmm0
movsd %xmm0, 0xf8(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x4da0
jmp 0x2db0
movq $0x0, 0xe0(%rsp)
movq 0xe0(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x290(%rsp), %rdi
callq 0x4ae0
movq %rax, %rcx
movq 0x48(%rsp), %rax
cmpq %rcx, %rax
jae 0x30af
movq 0xe0(%rsp), %rsi
leaq 0x290(%rsp), %rdi
callq 0x4b70
movq (%rax), %rdi
callq 0xa860
movsd %xmm1, 0x38(%rsp)
movsd %xmm0, 0x40(%rsp)
jmp 0x2e12
movsd 0x38(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movsd %xmm1, 0xd0(%rsp)
movsd %xmm0, 0xd8(%rsp)
leaq 0xe8(%rsp), %rdi
movq %rdi, 0x28(%rsp)
leaq 0xd0(%rsp), %rsi
callq 0x4dc0
movq 0x28(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0xab80
movsd %xmm0, 0x30(%rsp)
jmp 0x2e64
movsd 0x30(%rsp), %xmm1
movsd 0xf8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x3094
movq 0xe0(%rsp), %rsi
leaq 0x290(%rsp), %rdi
callq 0x4b70
movq (%rax), %rdx
leaq 0x1044c(%rip), %rsi     # 0x132e8
leaq 0xb8(%rsp), %rdi
callq 0x26c0
jmp 0x2eab
leaq 0x278(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x4c80
leaq 0xb8(%rsp), %rdi
callq 0x4b90
movq $0x0, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x278(%rsp), %rdi
callq 0x4ae0
movq %rax, %rcx
movq 0x20(%rsp), %rax
cmpq %rcx, %rax
jae 0x3092
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movaps %xmm0, 0x220(%rsp)
movaps %xmm0, 0x210(%rsp)
movaps %xmm0, 0x200(%rsp)
movaps %xmm0, 0x1f0(%rsp)
movaps %xmm0, 0x1e0(%rsp)
movaps %xmm0, 0x1d0(%rsp)
movaps %xmm0, 0x1c0(%rsp)
movaps %xmm0, 0x1b0(%rsp)
movaps %xmm0, 0x1a0(%rsp)
movaps %xmm0, 0x190(%rsp)
movaps %xmm0, 0x180(%rsp)
movaps %xmm0, 0x170(%rsp)
movaps %xmm0, 0x160(%rsp)
movaps %xmm0, 0x150(%rsp)
movaps %xmm0, 0x140(%rsp)
movaps %xmm0, 0x130(%rsp)
movq 0xb0(%rsp), %rsi
leaq 0x278(%rsp), %rdi
callq 0x4b70
movq (%rax), %rdx
leaq 0xa0bf(%rip), %rsi      # 0xd069
xorl %eax, %eax
leaq 0x130(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x2060
leaq 0x8f(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x2450
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x90(%rsp), %rdi
callq 0x2390
jmp 0x2fe9
leaq 0x2a8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x2360
jmp 0x3000
leaq 0x90(%rsp), %rdi
callq 0x21c0
leaq 0x8f(%rsp), %rdi
callq 0x2300
movq 0xb0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xb0(%rsp)
jmp 0x2ed9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x248(%rsp)
movl %eax, 0x244(%rsp)
jmp 0x310b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x248(%rsp)
movl %eax, 0x244(%rsp)
jmp 0x3083
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x248(%rsp)
movl %eax, 0x244(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x21c0
leaq 0x8f(%rsp), %rdi
callq 0x2300
jmp 0x310b
jmp 0x3094
jmp 0x3096
movq 0xe0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xe0(%rsp)
jmp 0x2dbc
movq 0x68(%rsp), %rdi
leaq 0x9fab(%rip), %rdx      # 0xd066
leaq 0x2a8(%rsp), %rsi
callq 0x4df0
jmp 0x30ca
leaq 0x260(%rsp), %rdi
callq 0x4d40
leaq 0x278(%rsp), %rdi
callq 0x4b90
leaq 0x290(%rsp), %rdi
callq 0x4b90
leaq 0x2a8(%rsp), %rdi
callq 0x21c0
movq 0x70(%rsp), %rax
addq $0x2e8, %rsp            # imm = 0x2E8
retq
leaq 0x260(%rsp), %rdi
callq 0x4d40
leaq 0x278(%rsp), %rdi
callq 0x4b90
leaq 0x290(%rsp), %rdi
callq 0x4b90
leaq 0x2a8(%rsp), %rdi
callq 0x21c0
movq 0x248(%rsp), %rdi
callq 0x2440
nopl (%rax)