// File: /workspace/github_c_makefile_star2_O0/jfriesse[P]omping/omping.c
// Function: omping_process_query_msg
static int
omping_process_query_msg(struct omping_instance *instance, const char *msg, size_t msg_len,
    const struct msg_decoded *msg_decoded, const struct sockaddr_storage *from,
    struct timeval rp_timestamp)
{
	struct rh_item *rh_item;

	rh_item = rh_list_find(&instance->remote_hosts, (const struct sockaddr *)from);
	if (rh_item == NULL) {
		DEBUG_PRINTF("Received message from unknown address");

		return (ms_stop(instance->ucast_socket, &instance->mcast_addr.sas,
		    msg_decoded, from));
	}

	if (rh_item->server_info.state != RH_SS_ANSWER) {
		DEBUG_PRINTF("Server is not in answer state");

		return (ms_stop(instance->ucast_socket, &instance->mcast_addr.sas,
		    msg_decoded, from));
	}

	if (!msg_decoded->seq_num_isset || msg_decoded->mcast_grp == NULL) {
		DEBUG_PRINTF("Received message doesn't have mcast group set");

		return (ms_stop(instance->ucast_socket, &instance->mcast_addr.sas,
		    msg_decoded, from));
	}

	if (msg_decoded->ses_id_len != SESSIONID_LEN ||
	    memcmp(msg_decoded->ses_id, rh_item->server_info.ses_id, SESSIONID_LEN) != 0) {
		DEBUG_PRINTF("Received message session id isn't expected");

		return (ms_stop(instance->ucast_socket, &instance->mcast_addr.sas,
		    msg_decoded, from));
	}

	/*
	 * Rate limiting
	 */
	if (instance->rate_limit_time > 0) {
		if (gcra_rl(&rh_item->server_info.gcra, rp_timestamp) == 0) {
			DEBUG_PRINTF("Received message rate limited");
			return (0);
		}
	}

	/*
	 * Answer to query message
	 */
	return (ms_answer(instance->ucast_socket, &instance->mcast_addr.sas, msg, msg_len,
	    msg_decoded, from, instance->ttl, MS_ANSWER_BOTH));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
movq -0x30(%rbp), %rsi
callq 0x9b40
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x910c
leaq 0x5ed6(%rip), %rdi      # 0xefa0
movl $0x2d0, %esi            # imm = 0x2D0
movl $0x2, %edx
leaq 0x6144(%rip), %rcx      # 0xf21f
movb $0x0, %al
callq 0x5dc0
movq -0x10(%rbp), %rax
movl 0x198(%rax), %edi
movq -0x10(%rbp), %rsi
addq $0x98, %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x73e0
movl %eax, -0x4(%rbp)
jmp 0x92ea
movq -0x38(%rbp), %rax
cmpl $0x1, 0x100(%rax)
je 0x9162
leaq 0x5e80(%rip), %rdi      # 0xefa0
movl $0x2d7, %esi            # imm = 0x2D7
movl $0x2, %edx
leaq 0x6427(%rip), %rcx      # 0xf558
movb $0x0, %al
callq 0x5dc0
movq -0x10(%rbp), %rax
movl 0x198(%rax), %edi
movq -0x10(%rbp), %rsi
addq $0x98, %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x73e0
movl %eax, -0x4(%rbp)
jmp 0x92ea
movq -0x28(%rbp), %rax
cmpl $0x0, 0x64(%rax)
je 0x9177
movq -0x28(%rbp), %rax
cmpq $0x0, 0x78(%rax)
jne 0x91c0
leaq 0x5e22(%rip), %rdi      # 0xefa0
movl $0x2de, %esi            # imm = 0x2DE
movl $0x2, %edx
leaq 0x63e7(%rip), %rcx      # 0xf576
movb $0x0, %al
callq 0x5dc0
movq -0x10(%rbp), %rax
movl 0x198(%rax), %edi
movq -0x10(%rbp), %rsi
addq $0x98, %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x73e0
movl %eax, -0x4(%rbp)
jmp 0x92ea
movq -0x28(%rbp), %rax
cmpq $0x10, 0x48(%rax)
jne 0x9203
movq -0x28(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rcx
addq $0x100, %rcx            # imm = 0x100
addq $0x4, %rcx
movups (%rcx), %xmm1
movups (%rax), %xmm0
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
subl $0xffff, %eax           # imm = 0xFFFF
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x924c
leaq 0x5d96(%rip), %rdi      # 0xefa0
movl $0x2e6, %esi            # imm = 0x2E6
movl $0x2, %edx
leaq 0x6389(%rip), %rcx      # 0xf5a4
movb $0x0, %al
callq 0x5dc0
movq -0x10(%rbp), %rax
movl 0x198(%rax), %edi
movq -0x10(%rbp), %rsi
addq $0x98, %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x73e0
movl %eax, -0x4(%rbp)
jmp 0x92ea
movq -0x10(%rbp), %rax
cmpl $0x0, 0x184(%rax)
jle 0x92a7
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
addq $0x18, %rdi
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0x5b10
cmpl $0x0, %eax
jne 0x92a5
leaq 0x5d1c(%rip), %rdi      # 0xefa0
movl $0x2f1, %esi            # imm = 0x2F1
movl $0x2, %edx
leaq 0x633a(%rip), %rcx      # 0xf5cf
movb $0x0, %al
callq 0x5dc0
movl $0x0, -0x4(%rbp)
jmp 0x92ea
jmp 0x92a7
movq -0x10(%rbp), %rax
movl 0x198(%rax), %edi
movq -0x10(%rbp), %rsi
addq $0x98, %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
movq -0x10(%rbp), %rax
movzbl 0x1aa(%rax), %eax
movl %eax, (%rsp)
movl $0x3, 0x8(%rsp)
callq 0x6f90
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)