// File: /workspace/github_c_makefile_star2_O2/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 0x58f9(%rip), %rdi      # 0x99f8
xorl %eax, %eax
callq 0x2100
cmpl $0x2, %ebp
je 0x4192
cmpl $0x1, %ebp
je 0x412f
testl %ebp, %ebp
jne 0x41d2
leaq 0x58dd(%rip), %rdi      # 0x9a00
xorl %eax, %eax
callq 0x2100
jmp 0x41d2
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 0x415f
movq %rsp, %rsi
movq %r15, %rdi
callq 0x2c8a
testq %r14, %r14
je 0x4171
leaq 0x30(%rsp), %rsi
movq %r14, %rdi
callq 0x2c8a
cmpl $0x2, %ebx
je 0x417f
cmpl $0x1, %ebx
je 0x41bc
testl %ebx, %ebx
jne 0x41d2
leaq 0x5893(%rip), %rdi      # 0x9a19
movq %rsp, %rsi
xorl %eax, %eax
callq 0x2100
jmp 0x41d2
movl 0x90(%rsp), %eax
cmpl $0x4, %eax
ja 0x41d2
movl %eax, %eax
leaq 0x5829(%rip), %rcx      # 0x99d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x58ae(%rip), %rdi      # 0x9a65
jmp 0x4123
leaq 0x5876(%rip), %rdi      # 0x9a39
leaq 0x30(%rsp), %rsi
movq %rsp, %rdx
xorl %eax, %eax
callq 0x2100
pushq $0xa
popq %rdi
callq 0x2050
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x58bb(%rip), %rdi      # 0x9aa7
jmp 0x4123
leaq 0x58d7(%rip), %rdi      # 0x9acf
jmp 0x4123
leaq 0x5878(%rip), %rdi      # 0x9a7c
jmp 0x4123
leaq 0x584a(%rip), %rdi      # 0x9a5a
leaq 0x4e14(%rip), %rcx      # 0x902b
pushq $0x50
popq %rsi
pushq $0x2
popq %rdx
xorl %eax, %eax
callq 0x4998
leaq 0x4e18(%rip), %rsi      # 0x9043
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x20f0