LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/addrfunc.c
// Function: af_sa_port
uint16_t
af_sa_port(const struct sockaddr *addr)
{
	uint16_t port;

	switch (addr->sa_family) {
	case AF_INET:
		port = (((struct sockaddr_in *)addr)->sin_port);
		break;
	case AF_INET6:
		port = (((struct sockaddr_in6 *)addr)->sin6_port);
		break;
	default:
		DEBUG_PRINTF("Internal program error");
		err(1, "Internal program error");
		break;
	}

	return (port);
}

// Assembly:
movzwl (%rdi), %eax
orl $0x8, %eax
cmpl $0xa, %eax
jne 0x2bbe
movzwl 0x2(%rdi), %eax
retq
pushq %rbx
leaq 0x645a(%rip), %rdi      # 0x9020
leaq 0x6476(%rip), %rbx      # 0x9043
pushq $0x2
popq %rdx
movl $0x1e2, %esi            # imm = 0x1E2
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4998
pushq $0x1
popq %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2240
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/addrfunc.c
// Function: af_sa_to_any_addr
void
af_sa_to_any_addr(struct sockaddr *dest, const struct sockaddr *src)
{
	uint16_t port;

	switch (src->sa_family) {
	case PF_INET:
		port = ntohs(((struct sockaddr_in *)src)->sin_port);
		break;
	case PF_INET6:
		port = ntohs(((struct sockaddr_in6 *)src)->sin6_port);
		break;
	default:
		DEBUG_PRINTF("Unknown ai family %d", src->sa_family);
		errx(1, "Unknown ai family %d", src->sa_family);
	}

	af_create_any_addr(dest, src->sa_family, port);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movzwl (%rsi), %r8d
movl %r8d, %eax
orl $0x8, %eax
cmpl $0xa, %eax
jne 0x2c5a
movzwl 0x2(%rbx), %eax
rolw $0x8, %ax
movzwl %ax, %edx
movl %r8d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x282b
leaq 0x63bf(%rip), %rdi      # 0x9020
leaq 0x63f2(%rip), %r14      # 0x905a
pushq $0x2
popq %rdx
movl $0x226, %esi            # imm = 0x226
movq %r14, %rcx
xorl %eax, %eax
callq 0x4998
movzwl (%rbx), %edx
pushq $0x1
popq %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/aiifunc.c
// Function: aii_list_free
void
aii_list_free(struct aii_list *aii_list)
{
	struct ai_item *ai_item;
	struct ai_item *ai_item_next;

	ai_item = TAILQ_FIRST(aii_list);

	while (ai_item != NULL) {
		ai_item_next = TAILQ_NEXT(ai_item, entries);

		free(ai_item->host_name);
		free(ai_item);

		ai_item = ai_item_next;
	}

	TAILQ_INIT(aii_list);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0x2cf8
movq 0x80(%r14), %rdi
movq 0x88(%r14), %r15
callq 0x2040
movq %r14, %rdi
callq 0x2040
movq %r15, %r14
jmp 0x2cd3
andq $0x0, (%rbx)
movq %rbx, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/aiifunc.c
// Function: aii_list_ai_to_sa
void
aii_list_ai_to_sa(struct aii_list *aii_list, int ip_ver)
{
	struct sockaddr_storage tmp_sas;
	struct addrinfo *ai_i;
	struct ai_item *ai_item_i;
	char *hn;

	TAILQ_FOREACH(ai_item_i, aii_list, entries) {
		hn = (char *)malloc(strlen(ai_item_i->host_name) + 1);
		if (hn == NULL) {
			errx(1, "Can't alloc memory");
		}

		memcpy(hn, ai_item_i->host_name, strlen(ai_item_i->host_name) + 1);
		ai_item_i->host_name = hn;

		for (ai_i = ai_item_i->ai; ai_i != NULL; ai_i = ai_i->ai_next) {
			if (af_ai_supported_ipv(ai_i) == ip_ver) {
				memset(&tmp_sas, 0, sizeof(tmp_sas));

				memcpy(&tmp_sas, ai_i->ai_addr, ai_i->ai_addrlen);

				freeaddrinfo(ai_item_i->ai);

				memcpy(&ai_item_i->sas, &tmp_sas, sizeof(tmp_sas));
				break;
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %esi, %ebx
movq %rdi, %r14
movq %rsp, %r15
movq (%r14), %r14
testq %r14, %r14
je 0x2de1
movq 0x80(%r14), %r13
movq %r13, %rdi
callq 0x20e0
movq %rax, %rbp
incq %rbp
movq %rbp, %rdi
callq 0x2250
testq %rax, %rax
je 0x2df3
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x2200
movq %r12, 0x80(%r14)
movq %r14, %r13
movq (%r13), %r13
testq %r13, %r13
je 0x2dd5
movq %r13, %rdi
callq 0x26d2
cmpl %ebx, %eax
je 0x2d87
addq $0x28, %r13
jmp 0x2d6c
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq 0x18(%r13), %rsi
movl 0x10(%r13), %edx
movq %r15, %rdi
callq 0x2200
movq (%r14), %rdi
callq 0x2330
pushq $0x10
popq %rcx
movq %r14, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
addq $0x88, %r14
jmp 0x2d1f
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x63f6(%rip), %rsi      # 0x91f0
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/aiifunc.c
// Function: aii_ifa_local_to_ai
void
aii_ifa_local_to_ai(struct aii_list *aii_list, struct ai_item *ai_local,
    const struct ifaddrs *ifa_local, int ip_ver, struct ai_item *local_addr, int *single_addr)
{
	size_t addr_len;
	uint16_t port;

	switch (ifa_local->ifa_addr->sa_family) {
	case AF_INET:
		addr_len = sizeof(struct sockaddr_in);
		port = ((struct sockaddr_in *)&ai_local->sas)->sin_port;
		break;
	case AF_INET6:
		addr_len = sizeof(struct sockaddr_in6);
		port = ((struct sockaddr_in6 *)&ai_local->sas)->sin6_port;
		break;
	default:
		DEBUG_PRINTF("Internal program error");
		err(1, "Internal program error");
		break;
	}

	memcpy(&local_addr->sas, ifa_local->ifa_addr, addr_len);
	local_addr->host_name = strdup(ai_local->host_name);
	if (local_addr->host_name == NULL) {
		err(1, "Can't alloc memory");
		/* NOTREACHED */
	}

	switch (ifa_local->ifa_addr->sa_family) {
	case AF_INET:
		((struct sockaddr_in *)&local_addr->sas)->sin_port = port;
		break;
	case AF_INET6:
		((struct sockaddr_in6 *)&local_addr->sas)->sin6_port = port;
		break;
	default:
		DEBUG_PRINTF("Internal program error");
		err(1, "Internal program error");
		break;
	}

	*single_addr = (TAILQ_NEXT(TAILQ_FIRST(aii_list), entries) == NULL);

	if (!*single_addr) {
		TAILQ_REMOVE(aii_list, ai_local, entries);

		free(ai_local->host_name);
		free(ai_local);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movq %r8, %r12
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdx), %rsi
movzwl (%rsi), %eax
cmpl $0x2, %eax
je 0x30d2
cmpl $0xa, %eax
jne 0x318f
pushq $0x1c
jmp 0x30d4
pushq $0x10
popq %rdx
movzwl 0x2(%rbx), %ebp
movq %r12, %rdi
callq 0x2200
movq 0x80(%rbx), %rdi
callq 0x2320
movq %rax, 0x80(%r12)
testq %rax, %rax
je 0x3183
movq 0x18(%r13), %rax
movzwl (%rax), %eax
orl $0x8, %eax
cmpl $0xa, %eax
jne 0x31a7
movw %bp, 0x2(%r12)
movq (%r14), %rax
xorl %ecx, %ecx
cmpq $0x0, 0x88(%rax)
sete %cl
movl %ecx, (%r15)
je 0x3174
movq 0x88(%rbx), %rax
addq $0x8, %r14
leaq 0x90(%rax), %rcx
testq %rax, %rax
cmoveq %r14, %rcx
movq 0x90(%rbx), %rdx
movq %rdx, (%rcx)
movq %rax, (%rdx)
movq 0x80(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2040
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6066(%rip), %rsi      # 0x91f0
pushq $0x1
popq %rdi
jmp 0x31cd
leaq 0x6078(%rip), %rdi      # 0x920e
leaq 0x5ea6(%rip), %rbx      # 0x9043
pushq $0x2
popq %rdx
movl $0xda, %esi
jmp 0x31bd
leaq 0x6060(%rip), %rdi      # 0x920e
leaq 0x5e8e(%rip), %rbx      # 0x9043
pushq $0x2
popq %rdx
movl $0xee, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4998
pushq $0x1
popq %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2240
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/aiifunc.c
// Function: aii_ipbc_to_ai
int
aii_ipbc_to_ai(struct ai_item *ipbc_addr, const char *ipbc_addr_s, const char *port_s,
    const struct ifaddrs *ifa_local)
{
	struct addrinfo *ai_res, *ai_i;
	char ifa_ipbc_addr_s[INET6_ADDRSTRLEN];
	int ip_ver;

	ip_ver = 4;

	if (ifa_local->ifa_broadaddr == NULL) {
		errx(1, "selected local interface isn't broadcast aware");
	}

	if (ipbc_addr_s == NULL) {
		af_sa_to_str(ifa_local->ifa_broadaddr, ifa_ipbc_addr_s);
		ipbc_addr_s = ifa_ipbc_addr_s;
	}

	ipbc_addr->host_name = (char *)malloc(strlen(ipbc_addr_s) + 1);
	if (ipbc_addr->host_name == NULL) {
		errx(1, "Can't alloc memory");
	}
	memcpy(ipbc_addr->host_name, ipbc_addr_s, strlen(ipbc_addr_s) + 1);

	ai_res = af_host_to_ai(ipbc_addr_s, port_s, ip_ver);

	for (ai_i = ai_res; ai_i != NULL; ai_i = ai_i->ai_next) {
		if (af_ai_supported_ipv(ai_i) == ip_ver) {
			memcpy(&ipbc_addr->sas, ai_i->ai_addr, ai_i->ai_addrlen);
			break;
		}
	}

	if (ai_i == NULL) {
		DEBUG_PRINTF("Internal program error");
		err(1, "Internal program error");
	}

	freeaddrinfo(ai_res);

	/*
	 * Test if interface broadcast addr is same as returned broadcast addr
	 */
	if (!af_sockaddr_eq(ifa_local->ifa_broadaddr, AF_CAST_SA(&ipbc_addr->sas))) {
		return (-1);
	}

	return (0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq 0x28(%rcx), %rdi
testq %rdi, %rdi
je 0x32dc
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
testq %rsi, %rsi
jne 0x320a
movq %rsp, %r12
movq %r12, %rsi
callq 0x2c8a
movq %r12, %rdi
callq 0x20e0
leaq 0x1(%rax), %rdi
callq 0x2250
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x32e5
movq %rax, %r13
movq %r12, %rdi
callq 0x20e0
leaq 0x1(%rax), %rdx
movq %r13, %rdi
movq %r12, %rsi
callq 0x2200
pushq $0x4
popq %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x28d2
movq %rax, %r15
movq %rax, %r12
testq %r12, %r12
je 0x32af
movq %r12, %rdi
callq 0x26d2
cmpl $0x4, %eax
je 0x3272
movq 0x28(%r12), %r12
jmp 0x3259
movq 0x18(%r12), %rsi
movl 0x10(%r12), %edx
movq %rbx, %rdi
callq 0x2200
movq %r15, %rdi
callq 0x2330
movq 0x28(%r14), %rdi
movq %rbx, %rsi
callq 0x2474
xorl %ecx, %ecx
cmpl $0x1, %eax
sbbl %ecx, %ecx
movl %ecx, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x5f58(%rip), %rdi      # 0x920e
leaq 0x5d86(%rip), %rbx      # 0x9043
pushq $0x2
popq %rdx
movl $0x124, %esi            # imm = 0x124
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4998
pushq $0x1
popq %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2240
leaq 0x5fdb(%rip), %rsi      # 0x92be
jmp 0x32ec
leaq 0x5f04(%rip), %rsi      # 0x91f0
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/aiifunc.c
// Function: aii_is_ai_in_list
int
aii_is_ai_in_list(const struct addrinfo *a1, const struct aii_list *aii_list)
{
	struct ai_item *aip;

	TAILQ_FOREACH(aip, aii_list, entries) {
		if (af_ai_deep_eq(a1, aip->ai))
			return (1);
	}

	return (0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
pushq $0x1
popq %rbx
movq (%r14), %r14
testq %r14, %r14
je 0x3324
movq (%r14), %rsi
movq %r15, %rdi
callq 0x24c5
addq $0x88, %r14
testl %eax, %eax
je 0x3304
jmp 0x3326
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/aiifunc.c
// Function: aii_mcast_to_ai
void
aii_mcast_to_ai(int ip_ver, struct ai_item *mcast_addr, const char *mcast_addr_s,
    const char *port_s)
{
	struct addrinfo *ai_res, *ai_i;

	if (mcast_addr_s == NULL) {
		switch (ip_ver) {
		case 4:
			mcast_addr_s = DEFAULT_MCAST4_ADDR;
			break;
		case 6:
			mcast_addr_s = DEFAULT_MCAST6_ADDR;
			break;
		default:
			DEBUG_PRINTF("Internal program error");
			err(1, "Internal program error");
			break;
		}
	}

	mcast_addr->host_name = (char *)malloc(strlen(mcast_addr_s) + 1);
	if (mcast_addr->host_name == NULL) {
		errx(1, "Can't alloc memory");
	}
	memcpy(mcast_addr->host_name, mcast_addr_s, strlen(mcast_addr_s) + 1);

	ai_res = af_host_to_ai(mcast_addr_s, port_s, ip_ver);

	for (ai_i = ai_res; ai_i != NULL; ai_i = ai_i->ai_next) {
		if (af_ai_supported_ipv(ai_i) == ip_ver) {
			memcpy(&mcast_addr->sas, ai_i->ai_addr, ai_i->ai_addrlen);
			break;
		}
	}

	if (ai_i == NULL) {
		DEBUG_PRINTF("Internal program error");
		err(1, "Internal program error");
	}

	freeaddrinfo(ai_res);

	/*
	 * Test if addr is really multicast
	 */
	if (!af_is_sa_mcast(AF_CAST_SA(&mcast_addr->sas))) {
		errx(1, "Given address %s is not valid multicast address", mcast_addr_s);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
testq %rdx, %rdx
jne 0x3364
cmpl $0x4, %ebp
je 0x335d
cmpl $0x6, %ebp
jne 0x344b
leaq 0x5fa1(%rip), %rbx      # 0x92fc
jmp 0x3364
leaq 0x5f89(%rip), %rbx      # 0x92ed
movq %rbx, %rdi
callq 0x20e0
leaq 0x1(%rax), %rdi
callq 0x2250
movq %rax, 0x80(%r14)
testq %rax, %rax
je 0x3426
movq %rax, %r12
movq %rbx, %rdi
callq 0x20e0
leaq 0x1(%rax), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2200
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x28d2
movq %rax, %r15
movq %rax, %r12
testq %r12, %r12
je 0x33f9
movq %r12, %rdi
callq 0x26d2
cmpl %ebp, %eax
je 0x33ca
movq 0x28(%r12), %r12
jmp 0x33b2
movq 0x18(%r12), %rsi
movl 0x10(%r12), %edx
movq %r14, %rdi
callq 0x2200
movq %r15, %rdi
callq 0x2330
movq %r14, %rdi
callq 0x25ea
testl %eax, %eax
je 0x3437
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5e0e(%rip), %rdi      # 0x920e
leaq 0x5c3c(%rip), %rbx      # 0x9043
pushq $0x2
popq %rdx
movl $0x16c, %esi            # imm = 0x16C
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4998
pushq $0x1
popq %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2240
leaq 0x5dc3(%rip), %rsi      # 0x91f0
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x20f0
leaq 0x5ece(%rip), %rsi      # 0x930c
pushq $0x1
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x20f0
leaq 0x5dbc(%rip), %rdi      # 0x920e
leaq 0x5bea(%rip), %rbx      # 0x9043
pushq $0x2
popq %rdx
movl $0x156, %esi            # imm = 0x156
jmp 0x340f
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/aiifunc.c
// Function: aii_parse_remote_addrs
int
aii_parse_remote_addrs(struct aii_list *aii_list, int argc, char * const argv[], const char *port,
    int ip_ver)
{
	struct addrinfo *ai_res;
	struct ai_item *ai_item;
	int no_ai;
	int i;

	no_ai = 0;

	for (i = 0; i < argc; i++) {
		ai_res = af_host_to_ai(argv[i], port, ip_ver);
		if (!aii_is_ai_in_list(ai_res, aii_list)) {
			if (af_ai_deep_is_loopback(ai_res)) {
				errx(1,"Address %s looks like loopback. Loopback ping is not "
				    "supported", argv[i]);
			}

			if (af_ai_deep_is_mcast(ai_res)) {
				errx(1,"Address %s looks like multicast. To set multicast address "
				    "use -m parameter", argv[i]);
			}

			ai_item = (struct ai_item *)malloc(sizeof(struct ai_item));
			if (ai_item == NULL) {
				errx(1, "Can't alloc memory");
			}

			memset(ai_item, 0, sizeof(struct ai_item));
			ai_item->ai = ai_res;
			ai_item->host_name = argv[i];

			TAILQ_INSERT_TAIL(aii_list, ai_item, entries);
			DEBUG_PRINTF("new address \"%s\" added to list (position %d)", argv[i],
			    no_ai);
			no_ai++;
		} else {
			freeaddrinfo(ai_res);
		}
	}

	return (no_ai);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, 0xc(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, %rbx
movl %esi, %r15d
movq %rdi, %r12
xorl %eax, %eax
testl %esi, %esi
cmovlel %eax, %r15d
xorl %r14d, %r14d
xorl %r13d, %r13d
cmpq %r14, %r15
je 0x3561
movq (%rbx,%r14,8), %rdi
movq 0x10(%rsp), %rsi
movl 0xc(%rsp), %edx
callq 0x28d2
movq %rax, %rbp
movq %rax, %rdi
movq %r12, %rsi
callq 0x32f6
testl %eax, %eax
je 0x34cc
movq %rbp, %rdi
callq 0x2330
jmp 0x3559
movq %rbp, %rdi
callq 0x250f
testl %eax, %eax
jne 0x3584
movq %rbp, %rdi
callq 0x25bc
testl %eax, %eax
jne 0x3591
movl $0x98, %esi
pushq $0x1
popq %rdi
callq 0x2190
testq %rax, %rax
je 0x3573
movq %rbp, (%rax)
movq (%rbx,%r14,8), %rcx
movq %rcx, 0x80(%rax)
movq %rax, %rcx
addq $0x88, %rcx
andq $0x0, 0x88(%rax)
movq 0x8(%r12), %rdx
movq %rdx, 0x90(%rax)
movq %rax, (%rdx)
movq %rcx, 0x8(%r12)
movq (%rbx,%r14,8), %r8
leaq 0x5cd1(%rip), %rdi      # 0x920e
movl $0x1a2, %esi            # imm = 0x1A2
pushq $0x2
popq %rdx
leaq 0x5e7a(%rip), %rcx      # 0x93c6
movl %r13d, %r9d
xorl %eax, %eax
callq 0x4998
incl %r13d
incq %r14
jmp 0x3492
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5c76(%rip), %rsi      # 0x91f0
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x20f0
movq (%rbx,%r14,8), %rdx
leaq 0x5dad(%rip), %rsi      # 0x933c
jmp 0x359c
movq (%rbx,%r14,8), %rdx
leaq 0x5ddf(%rip), %rsi      # 0x937b
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/cliprint.c
// Function: cliprint_final_remote_version
void
cliprint_final_remote_version(const struct rh_list *remote_hosts, int host_name_len)
{
	struct rh_item *rh_item;
	struct rh_item_ci *ci;
	size_t i;
	unsigned char ch;

	printf("\n");

	TAILQ_FOREACH(rh_item, remote_hosts, entries) {
			ci = &rh_item->client_info;

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

			if (ci->server_info_len == 0) {
				printf("response message not received\n");
			} else {
				for (i = 0; i < ci->server_info_len; i++) {
					ch = ci->server_info[i];

				if (ch >= ' ' && ch < 0x7f && ch != '\\') {
					fputc(ch, stdout);
				} else {
					if (ch == '\\') {
						printf("\\\\");
					} else {
						printf("\\x%02X", ch);
					}
				}
			}

			printf("\n");
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
pushq $0xa
popq %rdi
callq 0x2050
movq 0xad6c(%rip), %rbp      # 0xefc0
leaq 0x588c(%rip), %r13      # 0x9ae7
leaq 0x5888(%rip), %r12      # 0x9aea
movq (%r14), %r14
testq %r14, %r14
je 0x430a
movq (%r14), %rax
movq 0x80(%rax), %rdx
leaq 0x5779(%rip), %rdi      # 0x99f8
movl %ebx, %esi
xorl %eax, %eax
callq 0x2100
movq 0x68(%r14), %rax
testq %rax, %rax
je 0x42f2
xorl %r15d, %r15d
cmpq %rax, %r15
jae 0x42e8
movq 0x48(%r14), %rax
movzbl (%rax,%r15), %eax
cmpl $0x5c, %eax
sete %cl
leal -0x20(%rax), %edx
cmpb $0x5f, %dl
setae %dl
orb %cl, %dl
jne 0x42c2
movq (%rbp), %rsi
movl %eax, %edi
callq 0x2170
jmp 0x42df
cmpl $0x5c, %eax
jne 0x42d3
movq %r13, %rdi
xorl %eax, %eax
callq 0x2100
jmp 0x42df
movq %r12, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x2100
incq %r15
movq 0x68(%r14), %rax
jmp 0x4294
pushq $0xa
popq %rdi
callq 0x2050
jmp 0x42fe
leaq 0x59c6(%rip), %rdi      # 0x9cbf
callq 0x2090
addq $0x138, %r14            # imm = 0x138
jmp 0x4262
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/cliprint.c
// Function: cliprint_packet_stats
void
cliprint_packet_stats(const char *host_name, int host_name_len, uint32_t seq, int is_dup,
    size_t msg_len, int dist_set, uint8_t dist, int rtt_set, double rtt, double avg_rtt, int loss,
    enum sf_cast_type cast_type, int cont_stat)
{
	const char *cast_str;

	cast_str = sf_cast_type_to_str(cast_type);

	printf("%-*s : ", host_name_len, host_name);
	printf("%5scast, ", cast_str);
	printf("seq=%"PRIu32, seq);

	if (is_dup) {
		printf(" (dup)");
	}

	printf(", ");
	printf("size=%zu bytes", msg_len);

	if (dist_set) {
		printf(", dist=%"PRIu8, dist);
	}

	if (rtt_set) {
		printf(", time=%.3fms", rtt);
	}

	if (cont_stat) {
		printf(" (");

		if (rtt_set) {
			printf("%.3f avg, ", avg_rtt);
		}

		printf("%d%% loss)", loss);
	}

	printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movsd %xmm1, 0x18(%rsp)
movsd %xmm0, 0x20(%rsp)
movl %r9d, 0xc(%rsp)
movq %r8, %r14
movl %ecx, %r15d
movl %edx, %r12d
movl %esi, %r13d
movq %rdi, %rbx
movl 0x80(%rsp), %eax
movl %eax, 0x10(%rsp)
movl 0x70(%rsp), %eax
movl %eax, 0x8(%rsp)
movl 0x68(%rsp), %eax
movl %eax, 0x14(%rsp)
movb 0x60(%rsp), %al
movb %al, 0x7(%rsp)
movl 0x78(%rsp), %edi
callq 0x7ad9
movq %rax, %rbp
leaq 0x5412(%rip), %rdi      # 0x99f8
movl %r13d, %esi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2100
leaq 0x5521(%rip), %rdi      # 0x9b1b
movq %rbp, %rsi
xorl %eax, %eax
callq 0x2100
leaq 0x557c(%rip), %rdi      # 0x9b87
movl %r12d, %esi
xorl %eax, %eax
callq 0x2100
testl %r15d, %r15d
je 0x4628
leaq 0x556d(%rip), %rdi      # 0x9b8e
xorl %eax, %eax
callq 0x2100
leaq 0x5598(%rip), %rdi      # 0x9bc7
xorl %eax, %eax
callq 0x2100
leaq 0x5558(%rip), %rdi      # 0x9b95
movq %r14, %rsi
xorl %eax, %eax
callq 0x2100
cmpl $0x0, 0xc(%rsp)
je 0x4661
movzbl 0x7(%rsp), %esi
leaq 0x554a(%rip), %rdi      # 0x9ba4
xorl %eax, %eax
callq 0x2100
movl 0x14(%rsp), %ebx
testl %ebx, %ebx
je 0x467d
leaq 0x553e(%rip), %rdi      # 0x9bae
movsd 0x20(%rsp), %xmm0
movb $0x1, %al
callq 0x2100
cmpl $0x0, 0x10(%rsp)
je 0x46bc
leaq 0x5531(%rip), %rdi      # 0x9bbc
xorl %eax, %eax
callq 0x2100
testl %ebx, %ebx
je 0x46aa
leaq 0x5522(%rip), %rdi      # 0x9bbf
movsd 0x18(%rsp), %xmm0
movb $0x1, %al
callq 0x2100
leaq 0x5519(%rip), %rdi      # 0x9bca
movl 0x8(%rsp), %esi
xorl %eax, %eax
callq 0x2100
pushq $0xa
popq %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/clisig.c
// Function: clisig_register_handlers
void
clisig_register_handlers(void)
{
	struct sigaction act;

	act.sa_handler = sigint_handler;
	sigemptyset(&act.sa_mask);
	act.sa_flags = 0;

	sigaction(SIGINT, &act, NULL);

	act.sa_handler = siginfo_handler;
#ifdef SIGINFO
	sigaction(SIGINFO, &act, NULL);
#endif
	sigaction(SIGUSR1, &act, NULL);
}

// Assembly:
pushq %rbx
subq $0xa0, %rsp
leaq 0x4a(%rip), %rax        # 0x4789
leaq 0x10(%rsp), %rbx
movq %rax, -0x8(%rbx)
movq %rbx, %rdi
callq 0x21d0
andl $0x0, 0x80(%rbx)
pushq $0x2
popq %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
xorl %edx, %edx
callq 0x20a0
leaq 0x1e(%rip), %rax        # 0x478e
movq %rax, (%rbx)
pushq $0xa
popq %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x20a0
addq $0xa0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/clistate.c
// Function: clistate_request_exit
void
clistate_request_exit(void)
{

	exit_requested++;
	DEBUG2_PRINTF("Exit requested %d times", exit_requested);

	if (exit_requested > MAX_EXIT_REQUESTS) {
		signal(SIGINT, SIG_DFL);
		kill(getpid(), SIGINT);
	}
}

// Assembly:
pushq %rbx
movl 0xaa02(%rip), %r8d      # 0xf1bc
incl %r8d
movl %r8d, 0xa9f8(%rip)      # 0xf1bc
leaq 0x5532(%rip), %rdi      # 0x9cfd
leaq 0x5536(%rip), %rcx      # 0x9d08
pushq $0x5d
popq %rsi
pushq $0x3
popq %rdx
xorl %eax, %eax
callq 0x4998
cmpl $0x3, 0xa9d6(%rip)      # 0xf1bc
jl 0x4803
pushq $0x2
popq %rbx
movl %ebx, %edi
xorl %esi, %esi
callq 0x21b0
callq 0x20d0
movl %eax, %edi
movl %ebx, %esi
popq %rbx
jmp 0x2210
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/logging.c
// Function: logging_hexdump
int
logging_hexdump(const char *file_name, int line, int log_level, const char *prefix_str,
    const void *data, size_t data_len)
{
	size_t i;
	int res;
	uint8_t u8;

	res = 0;

	if (logging_get_verbose() >= log_level) {
		if (logging_get_verbose() >= LOGGING_LEVEL_DEBUG) {
			res += fprintf(stderr, "%s:%d ", file_name, line);
		}

		if (prefix_str != NULL) {
			res += fprintf(stderr, "%s", prefix_str);
		}

		for (i = 0; i < data_len; i++)	{
			u8 = ((const unsigned char *)data)[i];

			res += fprintf(stderr, "%02"PRIX8, u8);
		}
		res += fprintf(stderr, "\n");
	}

	return (res);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movl %esi, %ecx
movl 0xa8d9(%rip), %esi      # 0xf1c4
xorl %eax, %eax
cmpl %edx, %esi
jge 0x4900
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r9, %rbx
movq %r8, %r14
xorl %ebp, %ebp
cmpl $0x2, %esi
jl 0x492d
movq %rdi, %r8
movq 0xa6e1(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x53ff(%rip), %rsi      # 0x9d20
movq %r8, %rdx
xorl %eax, %eax
callq 0x21c0
movl %eax, %ebp
testq %r15, %r15
je 0x494f
movq 0xa6bf(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x4dab(%rip), %rsi      # 0x96ee
movq %r15, %rdx
xorl %eax, %eax
callq 0x21c0
addl %eax, %ebp
movq 0xa6a2(%rip), %r12      # 0xeff8
leaq 0x518f(%rip), %r15      # 0x9aec
xorl %r13d, %r13d
cmpq %r13, %rbx
je 0x497f
movzbl (%r14,%r13), %edx
movq (%r12), %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x21c0
addl %eax, %ebp
incq %r13
jmp 0x4960
movq (%r12), %rdi
leaq 0x5324(%rip), %rsi      # 0x9cae
xorl %eax, %eax
callq 0x21c0
addl %ebp, %eax
jmp 0x48f1
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/logging.c
// Function: logging_printf
int
logging_printf(const char *file_name, int line, int log_level, const char *format, ...)
{
	va_list ap;
	int res;

	res = 0;

	if (logging_verbose >= log_level) {
		va_start(ap, format);
		if (logging_verbose >= LOGGING_LEVEL_DEBUG) {
			res += fprintf(stderr, "%s:%d ", file_name, line);
		}
		res += vfprintf(stderr, format, ap);
		res += fprintf(stderr, "\n");
		va_end(ap);
	}

	return (res);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rcx, %rbx
movl %esi, %ecx
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x49ed
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movl 0xa7d1(%rip), %esi      # 0xf1c4
xorl %eax, %eax
cmpl %edx, %esi
jge 0x4a05
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000020, %rax     # imm = 0x3000000020
movq %rax, (%rsp)
xorl %ebp, %ebp
cmpl $0x2, %esi
jl 0x4a51
movq %rdi, %r10
movq 0xa5bd(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x52db(%rip), %rsi      # 0x9d20
movq %r10, %rdx
xorl %eax, %eax
callq 0x21c0
movl %eax, %ebp
movq 0xa5a0(%rip), %r14      # 0xeff8
movq (%r14), %rdi
movq %rsp, %rdx
movq %rbx, %rsi
callq 0x22d0
movl %eax, %ebx
addl %ebp, %ebx
movq (%r14), %rdi
leaq 0x523a(%rip), %rsi      # 0x9cae
xorl %eax, %eax
callq 0x21c0
addl %ebx, %eax
jmp 0x49f9
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/msg.c
// Function: msg_answer_create
size_t
msg_answer_create(const char *orig_msg, size_t orig_msg_len, char *new_msg, size_t new_msg_len,
    uint8_t ttl, int server_tstamp)
{
	struct tlv_iterator tlv_iter;
	enum tlv_opt_type opt_type;
	size_t pos;

	pos = 0;

	new_msg[pos++] = (unsigned char)MSG_TYPE_ANSWER;

	memset(&tlv_iter, 0, sizeof(tlv_iter));
	tlv_iter_init(orig_msg, orig_msg_len, &tlv_iter);

	while (tlv_iter_next(&tlv_iter) != -1) {
		opt_type = tlv_iter_get_type(&tlv_iter);
		if (opt_type != TLV_OPT_TYPE_SERVER_INFO &&
		    opt_type != TLV_OPT_TYPE_MCAST_PREFIX &&
		    opt_type != TLV_OPT_TYPE_SES_ID &&
		    opt_type != TLV_OPT_TYPE_TTL &&
		    opt_type != TLV_OPT_TYPE_SERVER_TSTAMP) {
			tlv_iter_item_copy(&tlv_iter, new_msg, new_msg_len, &pos);
		}
	}

	if (tlv_add_ttl(new_msg, new_msg_len, &pos, ttl) == -1)
		goto small_buf_err;

	if (server_tstamp) {
		if (tlv_add_server_tstamp(new_msg, new_msg_len, &pos) == -1)
			goto small_buf_err;
	}

	return (pos);

small_buf_err:
	return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, 0xc(%rsp)
movl %r8d, %r15d
movq %rcx, %rbx
movq %rdx, %r14
movq %rsp, %r12
movq $0x1, (%r12)
movb $0x41, (%rdx)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r13
movaps %xmm0, (%r13)
andq $0x0, 0x10(%r13)
movq %r13, %rdx
callq 0x85d0
movl $0x1e40, %ebp           # imm = 0x1E40
movq %r13, %rdi
callq 0x86aa
cmpl $-0x1, %eax
je 0x4b07
movq %r13, %rdi
callq 0x85bd
cmpl $0xc, %eax
ja 0x4af4
btl %eax, %ebp
jb 0x4ad5
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r12, %rcx
callq 0x85dd
jmp 0x4ad5
movzbl %r15b, %ecx
movq %rsp, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8579
cmpl $-0x1, %eax
je 0x4b3e
cmpl $0x0, 0xc(%rsp)
je 0x4b38
movq %rsp, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8571
cmpl $-0x1, %eax
je 0x4b3e
movq (%rsp), %rax
jmp 0x4b40
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/msg.c
// Function: msg_has_prefix
int
msg_has_prefix(const char *msg, size_t msg_len, const struct sockaddr_storage *mcast_addr)
{
	struct tlv_iterator tlv_iter;
	int has_prefix;

	has_prefix = 0;

	tlv_iter_init(msg, msg_len, &tlv_iter);
	while (tlv_iter_next(&tlv_iter) == 0) {
		if (tlv_iter_get_type(&tlv_iter) == TLV_OPT_TYPE_MCAST_PREFIX) {
			if (tlv_iter_pref_eq(&tlv_iter, mcast_addr)) {
				has_prefix = 1;

				break;
			}
		}
	}

	return (has_prefix);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
leaq 0x8(%rsp), %r14
movq %r14, %rdx
callq 0x85d0
pushq $0x1
popq %rbp
movq %r14, %rdi
callq 0x86aa
testl %eax, %eax
jne 0x50d7
movq %r14, %rdi
callq 0x85bd
cmpl $0xa, %eax
jne 0x50ad
movq %r14, %rdi
movq %rbx, %rsi
callq 0x86dd
testl %eax, %eax
je 0x50ad
jmp 0x50d9
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/msg.c
// Function: msg_init_create
size_t
msg_init_create(char *msg, size_t msg_len, int req_si, const struct sockaddr_storage *mcast_addr,
    const char *client_id, size_t client_id_len)
{
	size_t pos;
	uint16_t u16;

	pos = 0;

	if (client_id == NULL) {
		return (0);
	}

	msg[pos++] = (unsigned char)MSG_TYPE_INIT;

	if (tlv_add_version(msg, msg_len, &pos) == -1)
		goto small_buf_err;

	if (tlv_add(msg, msg_len, &pos, TLV_OPT_TYPE_CLIENT_ID, client_id_len, client_id) == -1)
		goto small_buf_err;


	if (req_si) {
		u16 = TLV_OPT_TYPE_SERVER_INFO;

		if (tlv_add_opt_request(msg, msg_len, &pos, &u16, 1) == -1)
			goto small_buf_err;
	}


	if (tlv_add_mcast_prefix(msg, msg_len, &pos, mcast_addr) == -1)
		goto small_buf_err;

	return (pos);

small_buf_err:
	return (0);
}

// Assembly:
testq %r8, %r8
je 0x519b
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r13
movq %r8, %r12
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %rdx
movq $0x1, (%rdx)
movb $0x49, (%rdi)
callq 0x8595
cmpl $-0x1, %eax
je 0x518a
movzwl %r13w, %r8d
leaq 0x8(%rsp), %rdx
pushq $0x1
popq %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %r9
callq 0x8288
cmpl $-0x1, %eax
je 0x518a
testl %ebp, %ebp
je 0x516b
leaq 0x16(%rsp), %rcx
movw $0x6, (%rcx)
leaq 0x8(%rsp), %rdx
pushq $0x1
popq %r8
movq %r15, %rdi
movq %r14, %rsi
callq 0x84af
cmpl $-0x1, %eax
je 0x518a
leaq 0x8(%rsp), %rdx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rcx
callq 0x84a0
cmpl $-0x1, %eax
je 0x518a
movq 0x8(%rsp), %rax
jmp 0x518c
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/msg.c
// Function: msg_query_create
size_t
msg_query_create(char *msg, size_t msg_len, const struct sockaddr_storage *mcast_addr,
    uint32_t seq_num, int server_tstamp, const char *client_id, size_t client_id_len,
    const char *session_id, size_t session_id_len)
{
	size_t pos;
	uint16_t u16;

	pos = 0;

	msg[pos++] = (unsigned char)MSG_TYPE_QUERY;

	if (tlv_add_version(msg, msg_len, &pos) == -1)
		goto small_buf_err;

	if (client_id) {
		if (tlv_add(msg, msg_len, &pos, TLV_OPT_TYPE_CLIENT_ID, client_id_len,
		    client_id) == -1) {
			goto small_buf_err;
		}
	}

	if (tlv_add_seq_num(msg, msg_len, &pos, seq_num) == -1)
		goto small_buf_err;

	if (tlv_add_client_tstamp(msg, msg_len, &pos) == -1)
		goto small_buf_err;

	if (tlv_add_mcast_grp(msg, msg_len, &pos, mcast_addr) == -1)
		goto small_buf_err;

	if (server_tstamp) {
		u16 = TLV_OPT_TYPE_SERVER_TSTAMP;

		if (tlv_add_opt_request(msg, msg_len, &pos, &u16, 1) == -1)
			goto small_buf_err;
	}

	if (tlv_add(msg, msg_len, &pos, TLV_OPT_TYPE_SES_ID, session_id_len, session_id) == -1)
		goto small_buf_err;

	return (pos);

small_buf_err:
	return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r13
movl %r8d, %ebp
movl %ecx, %r12d
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %rdx
movq $0x1, (%rdx)
movb $0x51, (%rdi)
callq 0x8595
cmpl $-0x1, %eax
je 0x52a5
testq %r13, %r13
je 0x5208
movq 0x50(%rsp), %rax
movzwl %ax, %r8d
leaq 0x8(%rsp), %rdx
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %r9
callq 0x8288
cmpl $-0x1, %eax
je 0x52a5
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %ecx
callq 0x8505
cmpl $-0x1, %eax
je 0x52a5
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8357
cmpl $-0x1, %eax
je 0x52a5
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rcx
callq 0x83a2
cmpl $-0x1, %eax
je 0x52a5
testl %ebp, %ebp
je 0x5278
leaq 0x16(%rsp), %rcx
movw $0xc, (%rcx)
leaq 0x8(%rsp), %rdx
pushq $0x1
popq %r8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x84af
cmpl $-0x1, %eax
je 0x52a5
movq 0x60(%rsp), %rax
movq 0x58(%rsp), %r9
movzwl %ax, %r8d
leaq 0x8(%rsp), %rdx
pushq $0xb
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8288
cmpl $-0x1, %eax
je 0x52a5
movq 0x8(%rsp), %rax
jmp 0x52a7
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/msg.c
// Function: msg_response_create
size_t
msg_response_create(char *msg, size_t msg_len, const struct msg_decoded *msg_decoded,
    int mcast_grp, int mcast_prefix, const struct sockaddr_storage *mcast_addr,
    const char *session_id, size_t session_id_len)
{
	size_t pos;

	pos = 0;

	msg[pos++] = (unsigned char)MSG_TYPE_RESPONSE;
	if (tlv_add_version(msg, msg_len, &pos) == -1)
		goto small_buf_err;

	if (msg_decoded->client_id) {
		if (tlv_add(msg, msg_len, &pos, TLV_OPT_TYPE_CLIENT_ID, msg_decoded->client_id_len,
		    msg_decoded->client_id) == -1)
			goto small_buf_err;
	}

	if (msg_decoded->seq_num_isset) {
		if (tlv_add_seq_num(msg, msg_len, &pos, msg_decoded->seq_num) == -1)
			goto small_buf_err;
	}

	if (mcast_grp) {
		if (tlv_add_mcast_grp(msg, msg_len, &pos, mcast_addr) == -1)
			goto small_buf_err;
	}

	if (msg_decoded->request_opt_server_info) {
		if (tlv_add_server_info(msg, msg_len, &pos, PROGRAM_SERVER_INFO) == -1)
			goto small_buf_err;
	}

	if (mcast_prefix) {
		if (tlv_add_mcast_prefix(msg, msg_len, &pos, mcast_addr) == -1)
			goto small_buf_err;
	}

	if (session_id) {
		if (tlv_add(msg, msg_len, &pos, TLV_OPT_TYPE_SES_ID, session_id_len,
		    session_id) == -1) {
			goto small_buf_err;
		}
	}

	return (pos);

small_buf_err:
	return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movl %r8d, %ebp
movl %ecx, %r13d
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %rdx
movq $0x1, (%rdx)
movb $0x53, (%rdi)
callq 0x8595
cmpl $-0x1, %eax
je 0x53c2
movq 0x70(%r12), %r9
testq %r9, %r9
je 0x5318
movzwl 0x28(%r12), %r8d
movq %rsp, %rdx
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8288
cmpl $-0x1, %eax
je 0x53c2
cmpl $0x0, 0x64(%r12)
je 0x533c
movl 0x50(%r12), %ecx
movq %rsp, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8505
cmpl $-0x1, %eax
je 0x53c2
testl %r13d, %r13d
je 0x5357
movq %rsp, %rdx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rcx
callq 0x83a2
cmpl $-0x1, %eax
je 0x53c2
cmpl $0x0, 0x5c(%r12)
je 0x5379
leaq 0x4add(%rip), %rcx      # 0x9e43
movq %rsp, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x851e
cmpl $-0x1, %eax
je 0x53c2
testl %ebp, %ebp
je 0x5393
movq %rsp, %rdx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rcx
callq 0x84a0
cmpl $-0x1, %eax
je 0x53c2
movq 0x40(%rsp), %r9
testq %r9, %r9
je 0x53bc
movq 0x48(%rsp), %rax
movzwl %ax, %r8d
movq %rsp, %rdx
pushq $0xb
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8288
cmpl $-0x1, %eax
je 0x53c2
movq (%rsp), %rax
jmp 0x53c4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/msg.c
// Function: msg_update_server_tstamp
int
msg_update_server_tstamp(char *msg, size_t msg_len)
{
	struct tlv_iterator tlv_iter;
	size_t pos;

	memset(&tlv_iter, 0, sizeof(tlv_iter));
	tlv_iter_init(msg, msg_len, &tlv_iter);

	while (tlv_iter_next(&tlv_iter) != -1) {
		if (tlv_iter_get_type(&tlv_iter) == TLV_OPT_TYPE_SERVER_TSTAMP) {
			pos = tlv_iter.pos;

			if (tlv_add_server_tstamp(msg, msg_len, &pos) == -1)
				goto add_tstamp_err;
		}
	}

	return (0);

add_tstamp_err:
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r15
movaps %xmm0, (%r15)
andq $0x0, 0x10(%r15)
movq %r15, %rdx
callq 0x85d0
leaq 0x8(%rsp), %r12
pushq $-0x1
popq %rbp
movq %r15, %rdi
callq 0x86aa
cmpl $-0x1, %eax
je 0x543f
movq %r15, %rdi
callq 0x85bd
cmpl $0xc, %eax
jne 0x5406
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x8571
cmpl $-0x1, %eax
jne 0x5406
jmp 0x5441
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/msgsend.c
// Function: ms_answer
int
ms_answer(int ucast_socket, const struct sockaddr_storage *mcast_addr, const char *orig_msg,
    size_t orig_msg_len, const struct msg_decoded *decoded, const struct sockaddr_storage *to,
    uint8_t ttl, enum ms_answer_type answer_type)
{
	char addr_str[INET6_ADDRSTRLEN];
	char new_msg[MAX_MSG_SIZE];
	struct sockaddr_storage to_mcast;
	size_t new_msg_len;
	ssize_t sent;

	new_msg_len = msg_answer_create(orig_msg, orig_msg_len, new_msg, sizeof(new_msg),
	    ttl, decoded->request_opt_server_tstamp);

	if (new_msg_len == 0) {
		return (-4);
	}

	if (answer_type == MS_ANSWER_UCAST || answer_type == MS_ANSWER_BOTH) {
		af_sa_to_str(AF_CAST_SA(to), addr_str);
		DEBUG_PRINTF("Sending unicast answer msg to %s", addr_str);

		msg_update_server_tstamp(new_msg, new_msg_len);

		sent = rs_sendto(ucast_socket, new_msg, new_msg_len, to);

		if (sent < 0) {
			return (sent);
		}
	}

	if (answer_type == MS_ANSWER_MCAST || answer_type == MS_ANSWER_BOTH) {
		af_copy_addr(mcast_addr, to, 1, 2, &to_mcast);

		af_sa_to_str(AF_CAST_SA(&to_mcast), addr_str);
		DEBUG_PRINTF("Sending multicast answer msg to %s", addr_str);

		msg_update_server_tstamp(new_msg, new_msg_len);

		sent = rs_sendto(ucast_socket, new_msg, new_msg_len, &to_mcast);

		if (sent < 0) {
			return (sent);
		}
	}

	return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x100b8, %rsp          # imm = 0x100B8
movq %r9, %r15
movq %rcx, %rax
movq %rdx, %r11
movq %rsi, %r12
movl %edi, %ebx
movzbl 0x100f0(%rsp), %r10d
movl 0x60(%r8), %r9d
leaq 0xb0(%rsp), %rdx
movl $0xffff, %ecx           # imm = 0xFFFF
movq %r11, %rdi
movq %rax, %rsi
movl %r10d, %r8d
callq 0x4a8c
testq %rax, %rax
je 0x558a
movq %rax, %r14
movl 0x100f8(%rsp), %ebp
movl %ebp, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
jne 0x550c
movq %rsp, %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x2c8a
leaq 0x4987(%rip), %rdi      # 0x9e50
leaq 0x498a(%rip), %rcx      # 0x9e5a
pushq $0x43
popq %rsi
pushq $0x2
popq %rdx
movq %r13, %r8
xorl %eax, %eax
callq 0x4998
leaq 0xb0(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x53d3
movl %ebx, %edi
movq %r13, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x7342
testq %rax, %rax
js 0x558d
andl $-0x2, %ebp
xorl %eax, %eax
cmpl $0x2, %ebp
jne 0x558d
pushq $0x1
popq %rdx
pushq $0x2
popq %rbp
leaq 0x30(%rsp), %r13
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %ecx
movq %r13, %r8
callq 0x2721
movq %rsp, %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x2c8a
leaq 0x490a(%rip), %rdi      # 0x9e50
leaq 0x492e(%rip), %rcx      # 0x9e7b
pushq $0x52
popq %rsi
movl %ebp, %edx
movq %r15, %r8
xorl %eax, %eax
callq 0x4998
leaq 0xb0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x53d3
movl %ebx, %edi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x7342
movq %rax, %rcx
sarq $0x3f, %rax
andl %ecx, %eax
jmp 0x558d
pushq $-0x4
popq %rax
addq $0x100b8, %rsp          # imm = 0x100B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/msgsend.c
// Function: ms_init
int
ms_init(int ucast_socket, const struct sockaddr_storage *remote_addr,
    const struct sockaddr_storage *mcast_addr, const char *client_id, int req_si)
{
	char addr_str[INET6_ADDRSTRLEN];
	char msg[MAX_MSG_SIZE];
	size_t msg_len;
	ssize_t sent;

	af_sa_to_str(AF_CAST_SA(remote_addr), addr_str);
	DEBUG_PRINTF("Sending init msg to %s", addr_str);

	msg_len = msg_init_create(msg, sizeof(msg), req_si, mcast_addr, client_id, CLIENTID_LEN);

	if (msg_len == 0) {
		return (-4);
	}

	sent = rs_sendto(ucast_socket, msg, msg_len, remote_addr);

	return (sent);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10038, %rsp          # imm = 0x10038
movl %r8d, %r15d
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %rbx
movl %edi, %ebp
movq %rsp, %r13
movq %rsi, %rdi
movq %r13, %rsi
callq 0x2c8a
leaq 0x487d(%rip), %rdi      # 0x9e50
leaq 0x48c4(%rip), %rcx      # 0x9e9e
pushq $0x71
popq %rsi
pushq $0x2
popq %rdx
movq %r13, %r8
xorl %eax, %eax
callq 0x4998
leaq 0x30(%rsp), %rdi
pushq $0x18
popq %r9
movl $0xffff, %esi           # imm = 0xFFFF
movl %r15d, %edx
movq %r12, %rcx
movq %r14, %r8
callq 0x50e4
testq %rax, %rax
je 0x561f
leaq 0x30(%rsp), %rsi
movl %ebp, %edi
movq %rax, %rdx
movq %rbx, %rcx
callq 0x7342
jmp 0x5622
pushq $-0x4
popq %rax
addq $0x10038, %rsp          # imm = 0x10038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/msgsend.c
// Function: ms_query
int
ms_query(int ucast_socket, const struct sockaddr_storage *remote_addr,
    const struct sockaddr_storage *mcast_addr, uint32_t seq_num, const char *client_id,
    const char *ses_id, size_t ses_id_len)
{
	char addr_str[INET6_ADDRSTRLEN];
	char msg[MAX_MSG_SIZE];
	size_t msg_len;
	ssize_t sent;

	af_sa_to_str(AF_CAST_SA(remote_addr), addr_str);
	DEBUG_PRINTF("Sending query msg to %s", addr_str);

	msg_len = msg_query_create(msg, sizeof(msg), mcast_addr, seq_num, 0, client_id,
	    CLIENTID_LEN, ses_id, SESSIONID_LEN);

	if (msg_len == 0) {
		return (-4);
	}

	sent = rs_sendto(ucast_socket, msg, msg_len, remote_addr);

	return (sent);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10048, %rsp          # imm = 0x10048
movq %r9, %r14
movq %r8, %r15
movl %ecx, %r12d
movq %rdx, %r13
movq %rsi, %rbx
movl %edi, 0xc(%rsp)
leaq 0x10(%rsp), %rbp
movq %rsi, %rdi
movq %rbp, %rsi
callq 0x2c8a
leaq 0x47e1(%rip), %rdi      # 0x9e50
leaq 0x483f(%rip), %rcx      # 0x9eb5
pushq $0x2
popq %rdx
movl $0x91, %esi
movq %rbp, %r8
xorl %eax, %eax
callq 0x4998
subq $0x8, %rsp
leaq 0x48(%rsp), %rdi
movl $0xffff, %esi           # imm = 0xFFFF
movq %r13, %rdx
movl %r12d, %ecx
xorl %r8d, %r8d
movq %r15, %r9
pushq $0x10
pushq %r14
pushq $0x18
callq 0x519e
addq $0x20, %rsp
testq %rax, %rax
je 0x56cc
leaq 0x40(%rsp), %rsi
movl 0xc(%rsp), %edi
movq %rax, %rdx
movq %rbx, %rcx
callq 0x7342
jmp 0x56cf
pushq $-0x4
popq %rax
addq $0x10048, %rsp          # imm = 0x10048
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/msgsend.c
// Function: ms_response
int
ms_response(int ucast_socket, const struct sockaddr_storage *mcast_addr,
    const struct msg_decoded *decoded, const struct sockaddr_storage *to, int mcast_grp,
    int mcast_prefix, const char *session_id, size_t session_id_len)
{
	char addr_str[INET6_ADDRSTRLEN];
	char msg[MAX_MSG_SIZE];
	size_t msg_len;
	ssize_t sent;

	af_sa_to_str((struct sockaddr *)to, addr_str);
	DEBUG_PRINTF("Sending response msg to %s", addr_str);

	msg_len = msg_response_create(msg, sizeof(msg), decoded, mcast_grp, mcast_prefix,
	    mcast_addr, session_id, session_id_len);

	if (msg_len == 0) {
		return (-4);
	}

	sent = rs_sendto(ucast_socket, msg, msg_len, to);

	return (sent);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10058, %rsp          # imm = 0x10058
movl %r9d, %r14d
movl %r8d, %r15d
movq %rcx, %rbx
movq %rdx, %r13
movq %rsi, %r12
movl %edi, 0x1c(%rsp)
leaq 0x20(%rsp), %rbp
movq %rcx, %rdi
movq %rbp, %rsi
callq 0x2c8a
leaq 0x4734(%rip), %rdi      # 0x9e50
leaq 0x47aa(%rip), %rcx      # 0x9ecd
pushq $0x2
popq %rdx
movl $0xb2, %esi
movq %rbp, %r8
xorl %eax, %eax
callq 0x4998
movaps 0x10090(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x50(%rsp), %rdi
movl $0xffff, %esi           # imm = 0xFFFF
movq %r13, %rdx
movl %r15d, %ecx
movl %r14d, %r8d
movq %r12, %r9
callq 0x52b6
testq %rax, %rax
je 0x5777
leaq 0x50(%rsp), %rsi
movl 0x1c(%rsp), %edi
movq %rax, %rdx
movq %rbx, %rcx
callq 0x7342
jmp 0x577a
pushq $-0x4
popq %rax
addq $0x10058, %rsp          # imm = 0x10058
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/omping.c
// Function: omping_send_client_query
static int
omping_send_client_query(struct omping_instance *instance, struct rh_item *ri, int increase)
{
	struct rh_item_ci *ci;
	int send_res;

	ci = &ri->client_info;

	if (increase) {
		if (ci->no_sent + 1 == ((uint64_t)~0)) {
			omping_client_move_to_stop(instance, ri, RH_CSR_SEND_MAXIMUM);
			DEBUG_PRINTF("Maximum number of sent messages for %s exhausted. "
			    "Moving to stop state.", ri->addr->host_name);

			return (0);
		}

		if (instance->send_count_queries > 0 &&
		    ci->no_sent + 1 > instance->send_count_queries) {
			omping_client_move_to_stop(instance, ri, RH_CSR_TO_SEND_EXHAUSTED);
			DEBUG_PRINTF("Number of messages to be sent by %s exhausted. "
			    "Moving to stop state.", ri->addr->host_name);

			return (0);
		}

		ci->seq_num++;
		ci->no_sent++;

		if (ci->seq_num == 0) {
			ci->seq_num_overflow = 1;
			ci->seq_num++;
		}
	}

	send_res = ms_query(instance->ucast_socket, &ri->addr->sas, &instance->mcast_addr.sas,
	    ci->seq_num, ci->client_id, ci->ses_id, ci->ses_id_len);

	return (send_res);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %rax
testl %edx, %edx
je 0x6c83
movq 0xe0(%rbx), %rdx
incq %rdx
cmpq $-0x1, %rdx
je 0x6c8b
movq 0x160(%rax), %rcx
testq %rcx, %rcx
sete %sil
cmpq %rcx, %rdx
setbe %cl
orb %sil, %cl
jne 0x6cc4
pushq $0x2
popq %rbp
movq %rax, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x6d21
movq (%rbx), %rax
movq 0x80(%rax), %r8
leaq 0x32fd(%rip), %rdi      # 0x9f70
leaq 0x3453(%rip), %rcx      # 0xa0cd
movl $0x3a5, %esi            # imm = 0x3A5
movl %ebp, %edx
jmp 0x6cb9
movl 0xf0(%rbx), %ecx
jmp 0x6cf3
pushq $0x3
popq %rdx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x6d21
movq (%rbx), %rax
movq 0x80(%rax), %r8
leaq 0x32c6(%rip), %rdi      # 0x9f70
leaq 0x33d4(%rip), %rcx      # 0xa085
pushq $0x2
popq %rdx
movl $0x39c, %esi            # imm = 0x39C
xorl %eax, %eax
callq 0x4998
xorl %eax, %eax
jmp 0x6d1a
movl 0xf0(%rbx), %esi
movl %esi, %ecx
incl %ecx
movl %ecx, 0xf0(%rbx)
movq %rdx, 0xe0(%rbx)
jne 0x6cf3
movl $0x1, 0xf8(%rbx)
addl $0x2, %esi
movl %esi, 0xf0(%rbx)
pushq $0x1
popq %rcx
movl 0x198(%rax), %edi
addq $0x98, %rax
leaq 0xc(%rbx), %r8
movq (%rbx), %rsi
movq 0x50(%rbx), %r9
movq 0x70(%rbx), %rdx
movq %rdx, (%rsp)
movq %rax, %rdx
callq 0x5634
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/omping.c
// Function: omping_client_move_to_stop
static void
omping_client_move_to_stop(struct omping_instance *instance, struct rh_item *ri,
    enum rh_client_stop_reason stop_reason)
{
	ri->client_info.state = RH_CS_STOP;
	instance->rh_no_active--;

	if (instance->quiet < 2) {
		cliprint_client_state(ri->addr->host_name, instance->hn_max_len,
		    instance->transport_method, NULL, &ri->addr->sas,
		    RH_CS_STOP, stop_reason);
	}
}

// Assembly:
movl $0x2, 0x8(%rsi)
decl 0x1a4(%rdi)
cmpl $0x1, 0x180(%rdi)
jg 0x6d62
pushq %rax
movq (%rsi), %r8
movq 0x80(%r8), %rax
movl 0x154(%rdi), %ecx
movl 0x174(%rdi), %esi
movl %edx, (%rsp)
pushq $0x2
popq %r9
movq %rax, %rdi
movl %ecx, %edx
xorl %ecx, %ecx
callq 0x40e0
popq %rax
retq
nop