// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x4132
movq -0x18(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
callq 0x2db0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x3d40
cmpl $0x0, %eax
jne 0x4119
movq -0x30(%rbp), %rdi
callq 0x2670
cmpl $0x0, %eax
je 0x4014
movq -0x18(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movl $0x1, %edi
leaq 0xa313(%rip), %rsi      # 0xe320
movb $0x0, %al
callq 0x20d0
movq -0x30(%rbp), %rdi
callq 0x27e0
cmpl $0x0, %eax
je 0x4041
movq -0x18(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movl $0x1, %edi
leaq 0xa325(%rip), %rsi      # 0xe35f
movb $0x0, %al
callq 0x20d0
movl $0x98, %edi
callq 0x2250
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x4069
movl $0x1, %edi
leaq 0xa172(%rip), %rsi      # 0xe1d4
movb $0x0, %al
callq 0x20d0
movq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x98, %edx
callq 0x2150
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x38(%rbp), %rax
movq $0x0, 0x88(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x90(%rax)
movq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rcx
addq $0x88, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %r8
movl -0x3c(%rbp), %r9d
leaq 0xa0fc(%rip), %rdi      # 0xe1f2
movl $0x1a2, %esi            # imm = 0x1A2
movl $0x2, %edx
leaq 0xa2a3(%rip), %rcx      # 0xe3aa
movb $0x0, %al
callq 0x5dc0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x4122
movq -0x30(%rbp), %rdi
callq 0x2340
jmp 0x4124
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x3fa9
movl -0x3c(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)