// File: /workspace/github_c_makefile_star2_O1/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 0x67fd(%rip), %rdi      # 0xa9f8
xorl %eax, %eax
callq 0x2100
cmpl $0x2, %ebp
je 0x428e
cmpl $0x1, %ebp
je 0x422b
testl %ebp, %ebp
jne 0x42ce
leaq 0x67e1(%rip), %rdi      # 0xaa00
xorl %eax, %eax
callq 0x2100
jmp 0x42ce
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 0x425b
movq %rsp, %rsi
movq %r15, %rdi
callq 0x2d08
testq %r14, %r14
je 0x426d
leaq 0x30(%rsp), %rsi
movq %r14, %rdi
callq 0x2d08
cmpl $0x2, %ebx
je 0x427b
cmpl $0x1, %ebx
je 0x42b8
testl %ebx, %ebx
jne 0x42ce
leaq 0x6797(%rip), %rdi      # 0xaa19
movq %rsp, %rsi
xorl %eax, %eax
callq 0x2100
jmp 0x42ce
movl 0x90(%rsp), %eax
cmpl $0x4, %eax
ja 0x42ce
movl %eax, %eax
leaq 0x672d(%rip), %rcx      # 0xa9d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x67b2(%rip), %rdi      # 0xaa65
jmp 0x421f
leaq 0x677a(%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 0x67bd(%rip), %rdi      # 0xaaa7
jmp 0x421f
leaq 0x67d9(%rip), %rdi      # 0xaacf
jmp 0x421f
leaq 0x677a(%rip), %rdi      # 0xaa7c
jmp 0x421f
leaq 0x674c(%rip), %rdi      # 0xaa5a
leaq 0x5d16(%rip), %rcx      # 0xa02b
movl $0x50, %esi
movl $0x2, %edx
xorl %eax, %eax
callq 0x4ada
leaq 0x5d16(%rip), %rsi      # 0xa043
movl $0x1, %edi
xorl %eax, %eax
callq 0x20f0