// File: /workspace/github_c_makefile_star2_O3/jfriesse[P]omping/cliprint.c
// Function: cliprint_client_state
void
cliprint_client_state(const char *host_name, int host_name_len,
    enum sf_transport_method transport_method, const struct sockaddr_storage *mcast_addr,
    const struct sockaddr_storage *remote_addr, enum rh_client_state state,
    enum rh_client_stop_reason stop_reason)
{
	char mcast_addr_str[INET6_ADDRSTRLEN];
	char rh_addr_str[INET6_ADDRSTRLEN];

	printf("%-*s : ", host_name_len, host_name);

	switch (state) {
	case RH_CS_INITIAL:
		printf("waiting for response msg");
		break;
	case RH_CS_QUERY:
		memset(mcast_addr_str, 0, sizeof(mcast_addr_str));
		memset(rh_addr_str, 0, sizeof(rh_addr_str));

		if (mcast_addr != NULL) {
			af_sa_to_str(AF_CAST_SA(mcast_addr), mcast_addr_str);
		}

		if (remote_addr != NULL) {
			af_sa_to_str(AF_CAST_SA(remote_addr), rh_addr_str);
		}

		switch (transport_method) {
		case SF_TM_ASM:
			printf("joined (S,G) = (*, %s), pinging", mcast_addr_str);
			break;
		case SF_TM_SSM:
			printf("joined (S,G) = (%s, %s), pinging", rh_addr_str, mcast_addr_str);
			break;
		case SF_TM_IPBC:
			printf("joined (S,G) = (*, %s), pinging", mcast_addr_str);
			break;
		}
		break;
	case RH_CS_STOP:
		switch (stop_reason) {
		case RH_CSR_NONE:
			DEBUG_PRINTF("internal program error.");
			errx(1, "Internal program error");
			break;
		case RH_CSR_SERVER:
			printf("server told us to stop");
			break;
		case RH_CSR_SEND_MAXIMUM:
			printf("maximum number of query messages exhausted");
			break;
		case RH_CSR_TO_SEND_EXHAUSTED:
			printf("given amount of query messages was sent");
			break;
		case RH_CSR_REMOTE_VERSION_RECEIVED:
			printf("remote version received");
			break;
		}
		break;
	}
	printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movl %r9d, %ebp
movq %r8, %r14
movq %rcx, %r15
movl %edx, %ebx
movq %rdi, %rdx
leaq 0x681d(%rip), %rdi      # 0xa9f8
xorl %eax, %eax
callq 0x2100
cmpl $0x2, %ebp
je 0x426e
cmpl $0x1, %ebp
je 0x420b
testl %ebp, %ebp
jne 0x42ae
leaq 0x6801(%rip), %rdi      # 0xaa00
xorl %eax, %eax
callq 0x2100
jmp 0x42ae
xorps %xmm0, %xmm0
movups %xmm0, 0x1e(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
movups %xmm0, 0x4e(%rsp)
testq %r15, %r15
je 0x423b
movq %rsp, %rsi
movq %r15, %rdi
callq 0x2d0c
testq %r14, %r14
je 0x424d
leaq 0x30(%rsp), %rsi
movq %r14, %rdi
callq 0x2d0c
cmpl $0x2, %ebx
je 0x425b
cmpl $0x1, %ebx
je 0x4298
testl %ebx, %ebx
jne 0x42ae
leaq 0x67b7(%rip), %rdi      # 0xaa19
movq %rsp, %rsi
xorl %eax, %eax
callq 0x2100
jmp 0x42ae
movl 0x90(%rsp), %eax
cmpl $0x4, %eax
ja 0x42ae
movl %eax, %eax
leaq 0x674d(%rip), %rcx      # 0xa9d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x67d2(%rip), %rdi      # 0xaa65
jmp 0x41ff
leaq 0x679a(%rip), %rdi      # 0xaa39
leaq 0x30(%rsp), %rsi
movq %rsp, %rdx
xorl %eax, %eax
callq 0x2100
movl $0xa, %edi
callq 0x2050
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x67dd(%rip), %rdi      # 0xaaa7
jmp 0x41ff
leaq 0x67f9(%rip), %rdi      # 0xaacf
jmp 0x41ff
leaq 0x679a(%rip), %rdi      # 0xaa7c
jmp 0x41ff
leaq 0x676c(%rip), %rdi      # 0xaa5a
leaq 0x5d36(%rip), %rcx      # 0xa02b
movl $0x50, %esi
movl $0x2, %edx
xorl %eax, %eax
callq 0x4ad6
leaq 0x5d36(%rip), %rsi      # 0xa043
movl $0x1, %edi
xorl %eax, %eax
callq 0x20f0