// File: /workspace/github_c_makefile_star2_O0/jfriesse[P]omping/omping.c
// Function: omping_send_client_msgs
static int
omping_send_client_msgs(struct omping_instance *instance)
{
	struct rh_item *remote_host;
	struct rh_item_ci *ci;
	int send_res;

	TAILQ_FOREACH(remote_host, &instance->remote_hosts, entries) {
		send_res = 0;
		ci = &remote_host->client_info;

		switch (ci->state) {
		case RH_CS_INITIAL:
			/*
			 * Initial message is send at most after DEFAULT_WAIT_TIME
			 */
			if (util_time_absdiff(ci->last_init_ts, util_get_time()) >
			    DEFAULT_WAIT_TIME) {
				if (instance->quiet < 2) {
					cliprint_client_state(remote_host->addr->host_name,
					    instance->hn_max_len, instance->transport_method, NULL,
					    &remote_host->addr->sas, RH_CS_INITIAL, RH_CSR_NONE);
				}

				send_res = ms_init(instance->ucast_socket, &remote_host->addr->sas,
				    &instance->mcast_addr.sas, ci->client_id,
				    (instance->op_mode == OMPING_OP_MODE_SHOW_VERSION ? 1 : 0));

				ci->last_init_ts = util_get_time();
			}
			break;
		case RH_CS_QUERY:
			if (instance->wait_time == 0) {
				/*
				 * Handle wait time zero specifically. Send query if answer for
				 * previous query received or after 1ms.
				 */
				if (ci->lru_seq_num == ci->seq_num ||
				    util_time_absdiff(ci->last_query_ts, util_get_time()) >= 1) {
					send_res = omping_send_client_query(instance, remote_host,
					    1);

					ci->last_query_ts = util_get_time();
				}
			} else {
				send_res = omping_send_client_query(instance, remote_host, 1);
			}
			break;
		case RH_CS_STOP:
			/*
			 * Do nothing
			 */
			break;
		}

		switch (send_res) {
		case -1:
			err(2, "Cannot send message");
			/* NOTREACHED */
			break;
		case -2:
			return (-2);
			/* NOTREACHED */
			break;
		case -3:
			warn("Send message error");
			ci->no_err_msgs++;
			break;
		case -4:
			DEBUG_PRINTF("Cannot send message. Buffer too small");
			break;
		}
	}

	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x130(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x7e30
movl $0x0, -0x24(%rbp)
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x6c(%rbp)
testl %eax, %eax
je 0x7bca
jmp 0x7bab
movl -0x6c(%rbp), %eax
subl $0x1, %eax
je 0x7cc8
jmp 0x7bb9
movl -0x6c(%rbp), %eax
subl $0x2, %eax
je 0x7d8c
jmp 0x7d8e
movq -0x20(%rbp), %rax
movq %rax, -0x78(%rbp)
callq 0xcb30
movq %rax, %rcx
movq -0x78(%rbp), %rax
movq %rcx, -0x38(%rbp)
movq %rdx, -0x30(%rbp)
movq 0x20(%rax), %rdi
movq 0x28(%rax), %rsi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0xcbe0
cmpq $0x3e8, %rax            # imm = 0x3E8
jbe 0x7cc3
movq -0x10(%rbp), %rax
cmpl $0x2, 0x180(%rax)
jge 0x7c50
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x80(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x174(%rax), %esi
movq -0x10(%rbp), %rax
movl 0x154(%rax), %edx
movq -0x18(%rbp), %rax
movq (%rax), %r8
xorl %eax, %eax
movl %eax, %ecx
xorl %r9d, %r9d
movl $0x0, (%rsp)
callq 0x50f0
movq -0x10(%rbp), %rax
movl 0x198(%rax), %edi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rdx
addq $0x98, %rdx
movq -0x20(%rbp), %rcx
addq $0x4, %rcx
movq -0x10(%rbp), %rax
movl 0x150(%rax), %r9d
xorl %r8d, %r8d
movl $0x1, %eax
cmpl $0x3, %r9d
cmovel %eax, %r8d
callq 0x7150
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x80(%rbp)
callq 0xcb30
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, -0x48(%rbp)
movq %rdx, -0x40(%rbp)
movq -0x48(%rbp), %rcx
movq %rcx, 0x20(%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x28(%rax)
jmp 0x7d8e
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1a0(%rax)
jne 0x7d75
movq -0x20(%rbp), %rax
movl 0xe4(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0xe8(%rcx), %eax
je 0x7d2c
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
callq 0xcb30
movq %rax, %rcx
movq -0x88(%rbp), %rax
movq %rcx, -0x58(%rbp)
movq %rdx, -0x50(%rbp)
movq 0x30(%rax), %rdi
movq 0x38(%rax), %rsi
movq -0x58(%rbp), %rdx
movq -0x50(%rbp), %rcx
callq 0xcbe0
cmpq $0x1, %rax
jb 0x7d73
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x1, %edx
callq 0x8110
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x90(%rbp)
callq 0xcb30
movq %rax, %rcx
movq -0x90(%rbp), %rax
movq %rcx, -0x68(%rbp)
movq %rdx, -0x60(%rbp)
movq -0x68(%rbp), %rcx
movq %rcx, 0x30(%rax)
movq -0x60(%rbp), %rcx
movq %rcx, 0x38(%rax)
jmp 0x7d8a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x1, %edx
callq 0x8110
movl %eax, -0x24(%rbp)
jmp 0x7d8e
jmp 0x7d8e
movl -0x24(%rbp), %eax
addl $0x4, %eax
movl %eax, %ecx
movq %rcx, -0x98(%rbp)
subl $0x3, %eax
ja 0x7e1a
movq -0x98(%rbp), %rax
leaq 0x7174(%rip), %rcx      # 0xef24
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x2, %edi
leaq 0x72e4(%rip), %rsi      # 0xf0a9
movb $0x0, %al
callq 0x2240
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7e37
leaq 0x72e1(%rip), %rdi      # 0xf0bd
movb $0x0, %al
callq 0x2070
movq -0x20(%rbp), %rax
movq 0xb0(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0xb0(%rax)
jmp 0x7e1a
leaq 0x719e(%rip), %rdi      # 0xefa0
movl $0x402, %esi            # imm = 0x402
movl $0x2, %edx
leaq 0x72bd(%rip), %rcx      # 0xf0d0
movb $0x0, %al
callq 0x5dc0
jmp 0x7e1c
movq -0x18(%rbp), %rax
movq 0x138(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x7b7e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)