// File: /workspace/github_cpp_makefile_star2_O2/mgronhol[P]Ullur/ullur.cpp
// Function: handle_message(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, int)
std::string handle_message( std::string& message, int sock ){
	std::string out = message.substr( message.find_first_of( '\r' ) + 1 );
	char command[32], dummy[32];
	float x, y, r, x0, y0, x1, y1;
	uint64_t id;
	sscanf( message.c_str(), "%s ", command );
	std::string cmd = std::string( command );
	std::string response;
	

	
	if( cmd == "PUT" ){
		sscanf( message.c_str(), "%s %f %f %lu", dummy, &x, &y, &id );

		response = handle_put( x, y, id );
		if( sock > 0 ){ fprintf( append_log, "PUT %f %f %lu\r\n", x, y, id ); }

		}
	if( cmd == "GEO-PUT" ){
		sscanf( message.c_str(), "%s %f %f %lu", dummy, &x, &y, &id );
		response = handle_geo_put( x, y, id );
		}
	
	if( cmd == "GET" ){
		sscanf( message.c_str(), "%s %f %f %f", dummy, &x, &y, &r );
		response = handle_get( x, y, r );
		}

	if( cmd == "GEO-GET" ){
		sscanf( message.c_str(), "%s %f %f %f", dummy, &x, &y, &r );
		response = handle_geo_get( x, y, r);
		}

	if( cmd == "GETR" ){
		sscanf( message.c_str(), "%s %f %f %f %f", dummy, &x0, &y0, &x1, &y1 );
		response = handle_getr( x0, y0, x1, y1 );
		}

	if( cmd == "GEO-GETR" ){
		sscanf( message.c_str(), "%s %f %f %f %f", dummy, &x0, &y0, &x1, &y1 );
		response = handle_geo_getr( x0, y0, x1, y1 );
		}

	if( cmd == "DEL" ){
		sscanf( message.c_str(), "%s %lu", dummy, &id );
		response = handle_del( id );
		if( sock > 0 ){ fprintf( append_log, "DEL %lu\r\n", id ); }
		}

//	std::cerr << "Response: '"<<response<<"'" << std::endl;
//	response = "response\r\n";
//	sleep( 1 );
	if( sock > 0 ){
		send_string( sock, response );
		}
	//return out;
	return std::string();
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
pushq $0xd
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x2300
leaq 0x1(%rax), %rdx
leaq 0xd0(%rsp), %rdi
pushq $-0x1
popq %rcx
movq %r14, %rsi
callq 0x2280
movq (%r14), %rdi
leaq 0x30b7(%rip), %rsi      # 0x606a
leaq 0xf0(%rsp), %r15
movq %r15, %rdx
xorl %eax, %eax
callq 0x2250
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rdx
movq %r15, %rsi
callq 0x2120
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x30a0(%rip), %rsi      # 0x608f
leaq 0x70(%rsp), %rdi
callq 0x398a
testb %al, %al
je 0x308f
movq (%r14), %rdi
leaq 0x3063(%rip), %rsi      # 0x606e
leaq 0x90(%rsp), %rdx
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
leaq 0x18(%rsp), %r13
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x2250
cvtss2sd (%r15), %xmm0
cvtss2sd (%r12), %xmm1
movq (%r13), %rsi
leaq 0x30(%rsp), %rdi
callq 0x276a
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %r15
movq %r15, %rsi
callq 0x22f0
movq %r15, %rdi
callq 0x2140
testl %ebp, %ebp
jle 0x308f
cvtss2sd 0x10(%rsp), %xmm0
movq 0x625a(%rip), %rdi      # 0x92d0
cvtss2sd 0xc(%rsp), %xmm1
movq 0x18(%rsp), %rdx
leaq 0x2ff3(%rip), %rsi      # 0x607b
movb $0x2, %al
callq 0x2340
leaq 0x2ff5(%rip), %rsi      # 0x608b
leaq 0x70(%rsp), %rdi
callq 0x398a
testb %al, %al
je 0x3108
movq (%r14), %rdi
leaq 0x2fc0(%rip), %rsi      # 0x606e
leaq 0x90(%rsp), %rdx
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
leaq 0x18(%rsp), %r13
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x2250
cvtss2sd (%r15), %xmm0
cvtss2sd (%r12), %xmm1
movq (%r13), %rsi
leaq 0x30(%rsp), %rdi
callq 0x2843
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %r15
movq %r15, %rsi
callq 0x22f0
movq %r15, %rdi
callq 0x2140
leaq 0x2f94(%rip), %rsi      # 0x60a3
leaq 0x70(%rsp), %rdi
callq 0x398a
testb %al, %al
je 0x3183
movq (%r14), %rdi
leaq 0x2f6c(%rip), %rsi      # 0x6093
leaq 0x90(%rsp), %rdx
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
leaq 0x2c(%rsp), %r13
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x2250
cvtss2sd (%r15), %xmm0
cvtss2sd (%r12), %xmm1
cvtss2sd (%r13), %xmm2
leaq 0x30(%rsp), %rdi
callq 0x2871
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %r15
movq %r15, %rsi
callq 0x22f0
movq %r15, %rdi
callq 0x2140
leaq 0x2f15(%rip), %rsi      # 0x609f
leaq 0x70(%rsp), %rdi
callq 0x398a
testb %al, %al
je 0x31fe
movq (%r14), %rdi
leaq 0x2ef1(%rip), %rsi      # 0x6093
leaq 0x90(%rsp), %rdx
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
leaq 0x2c(%rsp), %r13
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x2250
cvtss2sd (%r15), %xmm0
cvtss2sd (%r12), %xmm1
cvtss2sd (%r13), %xmm2
leaq 0x30(%rsp), %rdi
callq 0x2b82
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %r15
movq %r15, %rsi
callq 0x22f0
movq %r15, %rdi
callq 0x2140
leaq 0x2eb5(%rip), %rsi      # 0x60ba
leaq 0x70(%rsp), %rdi
callq 0x398a
leaq 0x14(%rsp), %r15
testb %al, %al
je 0x328d
movq (%r14), %rdi
movq %r15, (%rsp)
leaq 0x2e81(%rip), %rsi      # 0x60a7
leaq 0x90(%rsp), %rdx
leaq 0x28(%rsp), %r15
leaq 0x24(%rsp), %r12
leaq 0x20(%rsp), %r13
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x2250
cvtss2sd (%r15), %xmm0
cvtss2sd (%r12), %xmm1
cvtss2sd (%r13), %xmm2
cvtss2sd 0x14(%rsp), %xmm3
leaq 0x30(%rsp), %rdi
callq 0x2bb8
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %r15
movq %r15, %rsi
callq 0x22f0
movq %r15, %rdi
callq 0x2140
leaq 0x14(%rsp), %r15
leaq 0x2e22(%rip), %rsi      # 0x60b6
leaq 0x70(%rsp), %rdi
callq 0x398a
testb %al, %al
je 0x3312
movq (%r14), %rdi
movq %r15, (%rsp)
leaq 0x2df7(%rip), %rsi      # 0x60a7
leaq 0x90(%rsp), %rdx
leaq 0x28(%rsp), %r15
leaq 0x24(%rsp), %r12
leaq 0x20(%rsp), %r13
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x2250
cvtss2sd (%r15), %xmm0
cvtss2sd (%r12), %xmm1
cvtss2sd (%r13), %xmm2
cvtss2sd 0x14(%rsp), %xmm3
leaq 0x30(%rsp), %rdi
callq 0x2ebc
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %r15
movq %r15, %rsi
callq 0x22f0
movq %r15, %rdi
callq 0x2140
leaq 0x2da6(%rip), %rsi      # 0x60bf
leaq 0x70(%rsp), %rdi
callq 0x398a
testb %al, %al
je 0x338f
movq (%r14), %rdi
leaq 0x2d92(%rip), %rsi      # 0x60c3
leaq 0x90(%rsp), %rdx
leaq 0x18(%rsp), %r14
movq %r14, %rcx
xorl %eax, %eax
callq 0x2250
movq (%r14), %rsi
leaq 0x30(%rsp), %rdi
callq 0x2f02
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %r14
movq %r14, %rsi
callq 0x22f0
movq %r14, %rdi
callq 0x2140
testl %ebp, %ebp
jle 0x33c1
movq 0x5f56(%rip), %rdi      # 0x92d0
movq 0x18(%rsp), %rdx
leaq 0x2d44(%rip), %rsi      # 0x60ca
xorl %eax, %eax
callq 0x2340
jmp 0x3393
testl %ebp, %ebp
jle 0x33c1
leaq 0xb0(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x2320
leaq 0xb0(%rsp), %rsi
movl %ebp, %edi
callq 0x26bd
leaq 0xb0(%rsp), %rdi
callq 0x2140
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
leaq 0x50(%rsp), %rdi
callq 0x2140
leaq 0x70(%rsp), %rdi
callq 0x2140
leaq 0xd0(%rsp), %rdi
callq 0x2140
movq %rbx, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3427
jmp 0x3427
jmp 0x3427
jmp 0x3427
jmp 0x3427
jmp 0x3427
jmp 0x3427
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x2140
jmp 0x342a
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x2140
leaq 0x70(%rsp), %rdi
callq 0x2140
leaq 0xd0(%rsp), %rdi
callq 0x2140
movq %rbx, %rdi
callq 0x23a0
movq %rax, %rbx
jmp 0x343e