LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x3396
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
testq %rsi, %rsi
jne 0x32bb
movq %rsp, %r12
movq %r12, %rsi
callq 0x2d08
movq %r12, %rdi
callq 0x20e0
leaq 0x1(%rax), %rdi
callq 0x2240
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x339f
movq %rax, %r13
movq %r12, %rdi
callq 0x20e0
leaq 0x1(%rax), %rdx
movq %r13, %rdi
movq %r12, %rsi
callq 0x21f0
movq %r12, %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x2928
testq %rax, %rax
je 0x3328
movq %rax, %r15
movq %rax, %r12
movq %r12, %rdi
callq 0x270a
cmpl $0x4, %eax
je 0x3359
movq 0x28(%r12), %r12
testq %r12, %r12
jne 0x3311
leaq 0x6edf(%rip), %rdi      # 0xa20e
leaq 0x6d0d(%rip), %rbx      # 0xa043
movl $0x124, %esi            # imm = 0x124
movl $0x2, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4ada
movl $0x1, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2230
movq 0x18(%r12), %rsi
movl 0x10(%r12), %edx
movq %rbx, %rdi
callq 0x21f0
movq %r15, %rdi
callq 0x2320
movq 0x28(%r14), %rdi
movq %rbx, %rsi
callq 0x2464
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 0x6f21(%rip), %rsi      # 0xa2be
jmp 0x33a6
leaq 0x6e4a(%rip), %rsi      # 0xa1f0
movl $0x1, %edi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O1/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 0x3424
cmpl $0x4, %ebp
je 0x341d
cmpl $0x6, %ebp
jne 0x3516
leaq 0x6ee1(%rip), %rbx      # 0xa2fc
jmp 0x3424
leaq 0x6ec9(%rip), %rbx      # 0xa2ed
movq %rbx, %rdi
callq 0x20e0
leaq 0x1(%rax), %rdi
callq 0x2240
movq %rax, 0x80(%r14)
testq %rax, %rax
je 0x34ed
movq %rax, %r12
movq %rbx, %rdi
callq 0x20e0
leaq 0x1(%rax), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x21f0
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x2928
testq %rax, %rax
je 0x348d
movq %rax, %r15
movq %rax, %r12
movq %r12, %rdi
callq 0x270a
cmpl %ebp, %eax
je 0x34be
movq 0x28(%r12), %r12
testq %r12, %r12
jne 0x3477
leaq 0x6d7a(%rip), %rdi      # 0xa20e
leaq 0x6ba8(%rip), %rbx      # 0xa043
movl $0x16c, %esi            # imm = 0x16C
movl $0x2, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4ada
movl $0x1, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2230
movq 0x18(%r12), %rsi
movl 0x10(%r12), %edx
movq %r14, %rdi
callq 0x21f0
movq %r15, %rdi
callq 0x2320
movq %r14, %rdi
callq 0x25fb
testl %eax, %eax
je 0x3500
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6cfc(%rip), %rsi      # 0xa1f0
movl $0x1, %edi
xorl %eax, %eax
callq 0x20f0
leaq 0x6e05(%rip), %rsi      # 0xa30c
movl $0x1, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x20f0
leaq 0x6cf1(%rip), %rdi      # 0xa20e
leaq 0x6b1f(%rip), %rbx      # 0xa043
movl $0x156, %esi            # imm = 0x156
jmp 0x34a0
// File: /workspace/github_c_makefile_star2_O1/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, 0x4(%rsp)
movq %rcx, 0x10(%rsp)
testl %esi, %esi
jle 0x3658
movq %rdx, %rbx
movq %rdi, %r15
movl %esi, %eax
movq %rax, 0x8(%rsp)
xorl %r14d, %r14d
xorl %r12d, %r12d
movq (%rbx,%r14,8), %rdi
movq 0x10(%rsp), %rsi
movl 0x4(%rsp), %edx
callq 0x2928
movq %rax, %r13
movq (%r15), %rbp
testq %rbp, %rbp
je 0x359b
movq (%rbp), %rsi
movq %r13, %rdi
callq 0x24ba
testl %eax, %eax
jne 0x3640
movq 0x88(%rbp), %rbp
jmp 0x3579
movq %r13, %rdi
callq 0x250e
testl %eax, %eax
jne 0x368d
movq %r13, %rdi
callq 0x25c6
testl %eax, %eax
jne 0x3680
movl $0x98, %edi
callq 0x2240
testq %rax, %rax
je 0x366d
movq %rax, %rbp
movl $0x98, %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x2150
movq %r13, (%rbp)
movq (%rbx,%r14,8), %rax
movq %rax, 0x80(%rbp)
movq %rbp, %rax
addq $0x88, %rax
movq $0x0, 0x88(%rbp)
movq 0x8(%r15), %rcx
movq %rcx, 0x90(%rbp)
movq %rbp, (%rcx)
movq %rax, 0x8(%r15)
movq (%rbx,%r14,8), %r8
leaq 0x6bee(%rip), %rdi      # 0xa20e
movl $0x1a2, %esi            # imm = 0x1A2
movl $0x2, %edx
leaq 0x6d95(%rip), %rcx      # 0xa3c6
movl %r12d, %r9d
xorl %eax, %eax
callq 0x4ada
incl %r12d
jmp 0x3648
movq %r13, %rdi
callq 0x2320
incq %r14
cmpq 0x8(%rsp), %r14
jne 0x3561
jmp 0x365b
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6b7c(%rip), %rsi      # 0xa1f0
movl $0x1, %edi
xorl %eax, %eax
callq 0x20f0
movq (%rbx,%r14,8), %rdx
leaq 0x6cf0(%rip), %rsi      # 0xa37b
jmp 0x3698
movq (%rbx,%r14,8), %rdx
leaq 0x6ca4(%rip), %rsi      # 0xa33c
movl $0x1, %edi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O1/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
movl $0xa, %edi
callq 0x2050
movq (%r14), %rbp
testq %rbp, %rbp
je 0x4416
movq 0xac5a(%rip), %r15      # 0xefc0
leaq 0x677a(%rip), %r12      # 0xaae7
leaq 0x6776(%rip), %r13      # 0xaaea
movq (%rbp), %rax
movq 0x80(%rax), %rdx
leaq 0x6672(%rip), %rdi      # 0xa9f8
movl %ebx, %esi
xorl %eax, %eax
callq 0x2100
cmpq $0x0, 0x68(%rbp)
je 0x43fa
cmpq $0x0, 0x68(%rbp)
je 0x43ee
xorl %r14d, %r14d
movq 0x48(%rbp), %rax
movzbl (%rax,%r14), %eax
cmpl $0x5c, %eax
sete %cl
leal -0x20(%rax), %edx
cmpb $0x5f, %dl
setae %dl
orb %cl, %dl
jne 0x43c8
movq (%r15), %rsi
movl %eax, %edi
callq 0x2170
jmp 0x43e5
cmpl $0x5c, %eax
jne 0x43d9
movq %r12, %rdi
xorl %eax, %eax
callq 0x2100
jmp 0x43e5
movq %r13, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x2100
incq %r14
cmpq 0x68(%rbp), %r14
jb 0x43a0
movl $0xa, %edi
callq 0x2050
jmp 0x4406
leaq 0x68be(%rip), %rdi      # 0xacbf
callq 0x2090
movq 0x138(%rbp), %rbp
testq %rbp, %rbp
jne 0x4374
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x7f57
movq %rax, %rbp
leaq 0x62fc(%rip), %rdi      # 0xa9f8
movl %r13d, %esi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2100
leaq 0x640b(%rip), %rdi      # 0xab1b
movq %rbp, %rsi
xorl %eax, %eax
callq 0x2100
leaq 0x6466(%rip), %rdi      # 0xab87
movl %r12d, %esi
xorl %eax, %eax
callq 0x2100
testl %r15d, %r15d
je 0x473e
leaq 0x6457(%rip), %rdi      # 0xab8e
xorl %eax, %eax
callq 0x2100
leaq 0x6482(%rip), %rdi      # 0xabc7
xorl %eax, %eax
callq 0x2100
leaq 0x6442(%rip), %rdi      # 0xab95
movq %r14, %rsi
xorl %eax, %eax
callq 0x2100
cmpl $0x0, 0xc(%rsp)
je 0x4777
movzbl 0x7(%rsp), %esi
leaq 0x6434(%rip), %rdi      # 0xaba4
xorl %eax, %eax
callq 0x2100
movl 0x14(%rsp), %ebx
testl %ebx, %ebx
je 0x4793
leaq 0x6428(%rip), %rdi      # 0xabae
movsd 0x20(%rsp), %xmm0
movb $0x1, %al
callq 0x2100
cmpl $0x0, 0x10(%rsp)
je 0x47d2
leaq 0x641b(%rip), %rdi      # 0xabbc
xorl %eax, %eax
callq 0x2100
testl %ebx, %ebx
je 0x47c0
leaq 0x640c(%rip), %rdi      # 0xabbf
movsd 0x18(%rsp), %xmm0
movb $0x1, %al
callq 0x2100
leaq 0x6403(%rip), %rdi      # 0xabca
movl 0x8(%rsp), %esi
xorl %eax, %eax
callq 0x2100
movl $0xa, %edi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O1/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 0x51(%rip), %rax        # 0x48a8
leaq 0x10(%rsp), %rbx
movq %rax, -0x8(%rbx)
movq %rbx, %rdi
callq 0x21c0
movl $0x0, 0x80(%rbx)
leaq 0x8(%rsp), %rbx
movl $0x2, %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x20a0
leaq 0x20(%rip), %rax        # 0x48ad
movq %rax, (%rbx)
movl $0xa, %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x20a0
addq $0xa0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rax
movl 0xa8d4(%rip), %r8d      # 0xf1b4
incl %r8d
movl %r8d, 0xa8ca(%rip)      # 0xf1b4
leaq 0x640c(%rip), %rdi      # 0xacfd
leaq 0x6410(%rip), %rcx      # 0xad08
movl $0x5d, %esi
movl $0x3, %edx
xorl %eax, %eax
callq 0x4ada
cmpl $0x3, 0xa8a4(%rip)      # 0xf1b4
jl 0x4930
movl $0x2, %edi
xorl %esi, %esi
callq 0x21a0
callq 0x20d0
movl %eax, %edi
movl $0x2, %esi
popq %rax
jmp 0x2200
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xa798(%rip), %esi      # 0xf1bc
xorl %eax, %eax
cmpl %edx, %esi
jge 0x4a39
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 0x4a66
movq %rdi, %r8
movq 0xa5a8(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x62c6(%rip), %rsi      # 0xad20
movq %r8, %rdx
xorl %eax, %eax
callq 0x21b0
movl %eax, %ebp
testq %r15, %r15
je 0x4a88
movq 0xa586(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x5c72(%rip), %rsi      # 0xa6ee
movq %r15, %rdx
xorl %eax, %eax
callq 0x21b0
addl %eax, %ebp
testq %rbx, %rbx
je 0x4abb
movq 0xa564(%rip), %r12      # 0xeff8
leaq 0x6051(%rip), %r15      # 0xaaec
xorl %r13d, %r13d
movzbl (%r14,%r13), %edx
movq (%r12), %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x21b0
addl %eax, %ebp
incq %r13
cmpq %r13, %rbx
jne 0x4a9e
movq 0xa536(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x61e2(%rip), %rsi      # 0xacae
xorl %eax, %eax
callq 0x21b0
addl %ebp, %eax
jmp 0x4a2a
// File: /workspace/github_c_makefile_star2_O1/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 0x4b2f
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 0xa687(%rip), %esi      # 0xf1bc
xorl %eax, %eax
cmpl %edx, %esi
jge 0x4b47
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 0x4b93
movq %rdi, %r10
movq 0xa47b(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x6199(%rip), %rsi      # 0xad20
movq %r10, %rdx
xorl %eax, %eax
callq 0x21b0
movl %eax, %ebp
movq 0xa45e(%rip), %r14      # 0xeff8
movq (%r14), %rdi
movq %rsp, %rdx
movq %rbx, %rsi
callq 0x22c0
movl %eax, %ebx
addl %ebp, %ebx
movq (%r14), %rdi
leaq 0x60f8(%rip), %rsi      # 0xacae
xorl %eax, %eax
callq 0x21b0
addl %ebx, %eax
jmp 0x4b3b
// File: /workspace/github_c_makefile_star2_O1/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, %ebp
movl %r8d, %r15d
movq %rcx, %rbx
movq %rdx, %r14
movq $0x1, 0x8(%rsp)
movb $0x41, (%rdx)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r12
movaps %xmm0, (%r12)
movq $0x0, 0x10(%r12)
movq %r12, %rdx
callq 0x8b67
movq %r12, %rdi
callq 0x8c4a
cmpl $-0x1, %eax
je 0x4c5a
leaq 0x10(%rsp), %r12
leaq 0x8(%rsp), %r13
movq %r12, %rdi
callq 0x8b54
leal -0x9(%rax), %ecx
cmpl $0x4, %ecx
jb 0x4c4d
cmpl $0x6, %eax
je 0x4c4d
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x8b77
movq %r12, %rdi
callq 0x8c4a
cmpl $-0x1, %eax
jne 0x4c27
movzbl %r15b, %ecx
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8b00
cmpl $-0x1, %eax
je 0x4c93
testl %ebp, %ebp
je 0x4c8c
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8ab6
cmpl $-0x1, %eax
je 0x4c93
movq 0x8(%rsp), %rax
jmp 0x4c95
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_O1/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 0x8b67
movq %r14, %rdi
callq 0x8c4a
xorl %ebp, %ebp
testl %eax, %eax
jne 0x526c
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x8b54
cmpl $0xa, %eax
jne 0x5259
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8c81
testl %eax, %eax
jne 0x5267
movq %r14, %rdi
callq 0x8c4a
testl %eax, %eax
je 0x523d
jmp 0x526c
movl $0x1, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq $0x0, 0x8(%rsp)
testq %r8, %r8
je 0x532a
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 0x8b1b
cmpl $-0x1, %eax
je 0x532a
movzwl %r13w, %r8d
leaq 0x8(%rsp), %rdx
movq %r15, %rdi
movq %r14, %rsi
movl $0x1, %ecx
movq %r12, %r9
callq 0x87a8
cmpl $-0x1, %eax
je 0x532a
testl %ebp, %ebp
je 0x530b
leaq 0x16(%rsp), %rcx
movw $0x6, (%rcx)
leaq 0x8(%rsp), %rdx
movl $0x1, %r8d
movq %r15, %rdi
movq %r14, %rsi
callq 0x89ea
cmpl $-0x1, %eax
je 0x532a
leaq 0x8(%rsp), %rdx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rcx
callq 0x89d7
cmpl $-0x1, %eax
je 0x532a
movq 0x8(%rsp), %rax
jmp 0x532c
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_O1/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 0x8b1b
cmpl $-0x1, %eax
je 0x5448
testq %r13, %r13
je 0x53a7
movq 0x50(%rsp), %rax
movzwl %ax, %r8d
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %ecx
movq %r13, %r9
callq 0x87a8
cmpl $-0x1, %eax
je 0x5448
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %ecx
callq 0x8a42
cmpl $-0x1, %eax
je 0x5448
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8881
cmpl $-0x1, %eax
je 0x5448
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rcx
callq 0x88cb
cmpl $-0x1, %eax
je 0x5448
testl %ebp, %ebp
je 0x5419
leaq 0x16(%rsp), %rcx
movw $0xc, (%rcx)
leaq 0x8(%rsp), %rdx
movl $0x1, %r8d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x89ea
cmpl $-0x1, %eax
je 0x5448
movq 0x60(%rsp), %rax
movq 0x58(%rsp), %r9
movzwl %ax, %r8d
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
movl $0xb, %ecx
callq 0x87a8
cmpl $-0x1, %eax
je 0x5448
movq 0x8(%rsp), %rax
jmp 0x544a
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_O1/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 0x8b1b
cmpl $-0x1, %eax
je 0x5569
movq 0x70(%r12), %r9
testq %r9, %r9
je 0x54bd
movzwl 0x28(%r12), %r8d
movq %rsp, %rdx
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %ecx
callq 0x87a8
cmpl $-0x1, %eax
je 0x5569
cmpl $0x0, 0x64(%r12)
je 0x54e1
movl 0x50(%r12), %ecx
movq %rsp, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8a42
cmpl $-0x1, %eax
je 0x5569
testl %r13d, %r13d
je 0x54fc
movq %rsp, %rdx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rcx
callq 0x88cb
cmpl $-0x1, %eax
je 0x5569
cmpl $0x0, 0x5c(%r12)
je 0x551e
leaq 0x5938(%rip), %rcx      # 0xae43
movq %rsp, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8a5f
cmpl $-0x1, %eax
je 0x5569
testl %ebp, %ebp
je 0x5538
movq %rsp, %rdx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rcx
callq 0x89d7
cmpl $-0x1, %eax
je 0x5569
movq 0x40(%rsp), %r9
testq %r9, %r9
je 0x5563
movq 0x48(%rsp), %rax
movzwl %ax, %r8d
movq %rsp, %rdx
movq %r14, %rdi
movq %rbx, %rsi
movl $0xb, %ecx
callq 0x87a8
cmpl $-0x1, %eax
je 0x5569
movq (%rsp), %rax
jmp 0x556b
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_O1/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)
movq $0x0, 0x10(%r15)
movq %r15, %rdx
callq 0x8b67
movq %r15, %rdi
callq 0x8c4a
xorl %ebp, %ebp
cmpl $-0x1, %eax
je 0x55ff
leaq 0x10(%rsp), %r15
leaq 0x8(%rsp), %r12
movq %r15, %rdi
callq 0x8b54
cmpl $0xc, %eax
jne 0x55eb
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x8ab6
cmpl $-0x1, %eax
je 0x55fa
movq %r15, %rdi
callq 0x8c4a
cmpl $-0x1, %eax
jne 0x55c1
jmp 0x55ff
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x4bcc
testq %rax, %rax
je 0x5759
movq %rax, %r14
movl 0x100f8(%rsp), %ebp
movl %ebp, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
jne 0x56d0
movq %rsp, %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x2d08
leaq 0x57c7(%rip), %rdi      # 0xae50
leaq 0x57ca(%rip), %rcx      # 0xae5a
movl $0x43, %esi
movl $0x2, %edx
movq %r13, %r8
xorl %eax, %eax
callq 0x4ada
leaq 0xb0(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x557a
movl %ebx, %edi
movq %r13, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x773e
testq %rax, %rax
js 0x575e
andl $-0x2, %ebp
xorl %eax, %eax
cmpl $0x2, %ebp
jne 0x575e
leaq 0x30(%rsp), %r13
movq %r12, %rdi
movq %r15, %rsi
movl $0x1, %edx
movl $0x2, %ecx
movq %r13, %r8
callq 0x2767
movq %rsp, %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x2d08
leaq 0x5740(%rip), %rdi      # 0xae50
leaq 0x5764(%rip), %rcx      # 0xae7b
movl $0x52, %esi
movl $0x2, %edx
movq %r15, %r8
xorl %eax, %eax
callq 0x4ada
leaq 0xb0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x557a
movl %ebx, %edi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x773e
movq %rax, %rcx
sarq $0x3f, %rax
andl %ecx, %eax
jmp 0x575e
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
addq $0x100b8, %rsp          # imm = 0x100B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2d08
leaq 0x56ac(%rip), %rdi      # 0xae50
leaq 0x56f3(%rip), %rcx      # 0xae9e
movl $0x71, %esi
movl $0x2, %edx
movq %r13, %r8
xorl %eax, %eax
callq 0x4ada
leaq 0x30(%rsp), %rdi
movl $0xffff, %esi           # imm = 0xFFFF
movl $0x18, %r9d
movl %r15d, %edx
movq %r12, %rcx
movq %r14, %r8
callq 0x5277
testq %rax, %rax
je 0x57f6
leaq 0x30(%rsp), %rsi
movl %ebp, %edi
movq %rax, %rdx
movq %rbx, %rcx
callq 0x773e
jmp 0x57fb
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
addq $0x10038, %rsp          # imm = 0x10038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2d08
leaq 0x5608(%rip), %rdi      # 0xae50
leaq 0x5666(%rip), %rcx      # 0xaeb5
movl $0x91, %esi
movl $0x2, %edx
movq %rbp, %r8
xorl %eax, %eax
callq 0x4ada
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 0x533b
addq $0x20, %rsp
testq %rax, %rax
je 0x58a7
leaq 0x40(%rsp), %rsi
movl 0xc(%rsp), %edi
movq %rax, %rdx
movq %rbx, %rcx
callq 0x773e
jmp 0x58ac
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
addq $0x10048, %rsp          # imm = 0x10048
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2d08
leaq 0x5557(%rip), %rdi      # 0xae50
leaq 0x55cd(%rip), %rcx      # 0xaecd
movl $0xb2, %esi
movl $0x2, %edx
movq %rbp, %r8
xorl %eax, %eax
callq 0x4ada
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 0x5459
testq %rax, %rax
je 0x5956
leaq 0x50(%rsp), %rsi
movl 0x1c(%rsp), %edi
movq %rax, %rdx
movq %rbx, %rcx
callq 0x773e
jmp 0x595b
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
addq $0x10058, %rsp          # imm = 0x10058
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %rax
testl %edx, %edx
je 0x7080
movq 0xe0(%rbx), %rcx
incq %rcx
cmpq $-0x1, %rcx
je 0x7017
movq 0x160(%rax), %rdx
testq %rdx, %rdx
sete %sil
cmpq %rdx, %rcx
setbe %dl
orb %sil, %dl
jne 0x7054
movq %rax, %rdi
movq %rbx, %rsi
movl $0x2, %edx
callq 0x70b3
movq (%rbx), %rax
movq 0x80(%rax), %r8
leaq 0x3f67(%rip), %rdi      # 0xaf70
leaq 0x40fe(%rip), %rcx      # 0xb10e
movl $0x3a5, %esi            # imm = 0x3A5
jmp 0x7044
movq %rax, %rdi
movq %rbx, %rsi
movl $0x3, %edx
callq 0x70b3
movq (%rbx), %rax
movq 0x80(%rax), %r8
leaq 0x3f38(%rip), %rdi      # 0xaf70
leaq 0x4087(%rip), %rcx      # 0xb0c6
movl $0x39c, %esi            # imm = 0x39C
movl $0x2, %edx
xorl %eax, %eax
callq 0x4ada
xorl %eax, %eax
jmp 0x70ad
movl 0xf0(%rbx), %edx
movl %edx, %esi
incl %esi
movl %esi, 0xf0(%rbx)
movq %rcx, 0xe0(%rbx)
jne 0x7080
movl $0x1, 0xf8(%rbx)
addl $0x2, %edx
movl %edx, 0xf0(%rbx)
movl 0x198(%rax), %edi
addq $0x98, %rax
movl 0xf0(%rbx), %ecx
leaq 0xc(%rbx), %r8
movq (%rbx), %rsi
movq 0x50(%rbx), %r9
movq 0x70(%rbx), %rdx
movq %rdx, (%rsp)
movq %rax, %rdx
callq 0x580d
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x70f6
pushq %rax
movq (%rsi), %r8
movq 0x80(%r8), %rax
movl 0x154(%rdi), %ecx
movl 0x174(%rdi), %esi
movl %edx, (%rsp)
movq %rax, %rdi
movl %ecx, %edx
xorl %ecx, %ecx
movl $0x2, %r9d
callq 0x41dc
popq %rax
retq
nop
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/rhfunc.c
// Function: rh_list_add_item
struct rh_item *
rh_list_add_item(struct rh_list *rh_list, struct ai_item *addr, int dup_buf_items,
    int rate_limit_time)
{
	struct rh_item *rh_item;
	struct rh_item_ci *ci;
	int i;

	rh_item = (struct rh_item *)malloc(sizeof(struct rh_item));
	if (rh_item == NULL) {
		return (NULL);
	}

	memset(rh_item, 0, sizeof(struct rh_item));

	rh_item->addr = addr;
	ci = &rh_item->client_info;

	if (dup_buf_items > 0) {
		ci->dup_buf_items = dup_buf_items;

		for (i = 0; i < 2; i++) {
			ci->dup_buffer[i] = (uint32_t *)malloc(dup_buf_items * sizeof(uint32_t));

			if (ci->dup_buffer[i] == NULL) {
				goto malloc_error;
			}

			memset(ci->dup_buffer[i], 0, dup_buf_items * sizeof(uint32_t));
		}
	}

	if (rate_limit_time > 0) {
		gcra_init(&rh_item->server_info.gcra, rate_limit_time, GCRA_BURST);
	}

	TAILQ_INSERT_TAIL(rh_list, rh_item, entries);

	return (rh_item);

malloc_error:
	for (i = 0; i < 2; i++) {
		free(rh_item->client_info.dup_buffer[i]);
	}
	free(rh_item);

	return (NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %r14
movl $0x148, %edi            # imm = 0x148
callq 0x2240
testq %rax, %rax
je 0x71f4
movq %rax, %rbx
movl $0x148, %edx            # imm = 0x148
movq %rax, %rdi
xorl %esi, %esi
callq 0x2150
movq %r12, (%rbx)
testl %r15d, %r15d
jle 0x7195
movl %r15d, 0xf4(%rbx)
movl %r15d, %r15d
shlq $0x2, %r15
movl $0xb, %r12d
movq %r15, %rdi
callq 0x2240
movq %rax, (%rbx,%r12,8)
testq %rax, %rax
je 0x71d4
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2150
incq %r12
cmpq $0xc, %r12
je 0x716e
testl %ebp, %ebp
jle 0x71ac
leaq 0x118(%rbx), %rdi
movl %ebp, %esi
movl $0x5, %edx
callq 0x493c
movq %rbx, %rax
addq $0x138, %rax            # imm = 0x138
movq $0x0, 0x138(%rbx)
movq 0x8(%r14), %rcx
movq %rcx, 0x140(%rbx)
movq %rbx, (%rcx)
movq %rax, 0x8(%r14)
jmp 0x71f6
movl $0xb, %r14d
movq (%rbx,%r14,8), %rdi
callq 0x2040
incq %r14
cmpq $0xc, %r14
je 0x71da
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/rhfunc.c
// Function: rh_list_create
void
rh_list_create(struct rh_list *rh_list, struct aii_list *remote_addrs, int dup_buf_items,
    int rate_limit_time)
{
	struct ai_item *addr;
	struct rh_item *rh_item;

	TAILQ_INIT(rh_list);

	if (remote_addrs != NULL) {
		TAILQ_FOREACH(addr, remote_addrs, entries) {
			rh_item = rh_list_add_item(rh_list, addr, dup_buf_items, rate_limit_time);
			if (rh_item == NULL) {
				errx(1, "Can't alloc memory");
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq $0x0, (%rdi)
movq %rdi, 0x8(%rdi)
testq %rsi, %rsi
je 0x7248
movq (%rsi), %r15
testq %r15, %r15
je 0x7248
movl %ecx, %ebx
movl %edx, %ebp
movq %rdi, %r14
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x711a
testq %rax, %rax
je 0x7253
movq 0x88(%r15), %r15
testq %r15, %r15
jne 0x7228
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2f96(%rip), %rsi      # 0xa1f0
movl $0x1, %edi
xorl %eax, %eax
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/rhfunc.c
// Function: rh_list_free
void
rh_list_free(struct rh_list *rh_list)
{
	struct rh_item *rh_item;
	struct rh_item *rh_item_next;
	int i;

	rh_item = TAILQ_FIRST(rh_list);

	while (rh_item != NULL) {
		rh_item_next = TAILQ_NEXT(rh_item, entries);

		free(rh_item->client_info.server_info);
		free(rh_item->client_info.ses_id);

		for (i = 0; i < 2; i++) {
			free(rh_item->client_info.dup_buffer[i]);
		}

		free(rh_item);

		rh_item = rh_item_next;
	}

	TAILQ_INIT(rh_list);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0x72f1
movq 0x48(%r14), %rdi
movq 0x138(%r14), %r15
callq 0x2040
movq 0x50(%r14), %rdi
callq 0x2040
movl $0xb, %r12d
movq (%r14,%r12,8), %rdi
callq 0x2040
incq %r12
cmpq $0xc, %r12
je 0x72cf
movq %r14, %rdi
callq 0x2040
movq %r15, %r14
testq %r15, %r15
jne 0x72b0
movq $0x0, (%rbx)
movq %rbx, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/rhfunc.c
// Function: rh_list_hn_max_len
int
rh_list_hn_max_len(struct rh_list *rh_list)
{
	struct rh_item *rh_item;
	size_t max_len;

	max_len = 0;
	TAILQ_FOREACH(rh_item, rh_list, entries) {
		if (strlen(rh_item->addr->host_name) > max_len) {
			max_len = strlen(rh_item->addr->host_name);
		}
	}

	return (max_len > INT_MAX ? INT_MAX : (int)max_len);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
xorl %ebx, %ebx
testq %r14, %r14
je 0x7364
movq (%r14), %rax
movq 0x80(%rax), %rdi
callq 0x20e0
cmpq %rbx, %rax
cmovaq %rax, %rbx
movq 0x138(%r14), %r14
jmp 0x7340
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %rbx
cmovbq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/rhfunc.c
// Function: rh_list_put_to_finish_state
void
rh_list_put_to_finish_state(struct rh_list *rh_list, enum rh_list_finish_state fs)
{
	struct rh_item *rh_item;

	TAILQ_FOREACH(rh_item, rh_list, entries) {
		if (fs == RH_LFS_SERVER || fs == RH_LFS_BOTH) {
			rh_item->server_info.state = RH_SS_FINISHING;
		}
		if (fs == RH_LFS_CLIENT || fs == RH_LFS_BOTH) {
			rh_item->client_info.state = RH_CS_STOP;
		}
	}
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x73c3
leal -0x1(%rsi), %ecx
cmpl $0x1, %ecx
ja 0x73a8
movl $0x2, 0x100(%rax)
testl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
jne 0x73b7
movl $0x2, 0x8(%rax)
movq 0x138(%rax), %rax
testq %rax, %rax
jne 0x7399
retq
// File: /workspace/github_c_makefile_star2_O1/jfriesse[P]omping/rsfunc.c
// Function: rs_sendto
ssize_t
rs_sendto(int sock, const char *msg, size_t msg_size, const struct sockaddr_storage *to)
{
	ssize_t sent;

	sent = sendto(sock, msg, msg_size, 0, (struct sockaddr *)to, af_sas_len(to));

	if (sent == -1) {
		if (errno == EINTR) {
			DEBUG2_PRINTF("sendto error - EINTR");
			return (-2);
		}

		if (errno == EHOSTUNREACH || errno == EHOSTDOWN || errno == ENETDOWN ||
		    errno == ENOBUFS) {
			DEBUG2_PRINTF("sendto error - EHOSTUNREACH || EHOSTDOWN || ENETDOWN ||"
			    "ENOBUFS");
			return (-3);
		}

		DEBUG2_PRINTF("sendto error - errno = %d", errno);
		return (-1);
	}

	if ((size_t)sent != msg_size) {
		DEBUG2_PRINTF("sendto error - sent != msg_size");

		return (-1);
	}

	return (sent);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movl %edi, %ebp
movq %rcx, %rdi
callq 0x2d49
movl %ebp, %edi
movq %r15, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
movq %r14, %r8
movl %eax, %r9d
callq 0x2160
cmpq $-0x1, %rax
je 0x77a4
cmpq %rbx, %rax
je 0x7813
leaq 0x3eb9(%rip), %rdi      # 0xb63c
leaq 0x4032(%rip), %rcx      # 0xb7bc
movl $0x100, %esi            # imm = 0x100
movl $0x3, %edx
xorl %eax, %eax
callq 0x4ada
movq $-0x1, %rax
jmp 0x7813
callq 0x2060
movl (%rax), %r8d
leal -0x64(%r8), %eax
cmpl $0xd, %eax
ja 0x77e7
movl $0x3021, %ecx           # imm = 0x3021
btl %eax, %ecx
jae 0x77e7
leaq 0x3e76(%rip), %rdi      # 0xb63c
leaq 0x3f96(%rip), %rcx      # 0xb763
movl $0xf7, %esi
movl $0x3, %edx
xorl %eax, %eax
callq 0x4ada
movq $-0x3, %rax
jmp 0x7813
leaq 0x3e4e(%rip), %rdi      # 0xb63c
cmpl $0x4, %r8d
jne 0x781e
leaq 0x3f53(%rip), %rcx      # 0xb74e
movl $0xf0, %esi
movl $0x3, %edx
xorl %eax, %eax
callq 0x4ada
movq $-0x2, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3f7d(%rip), %rcx      # 0xb7a2
movl $0xfb, %esi
movl $0x3, %edx
xorl %eax, %eax
callq 0x4ada
jmp 0x779b
nop