// File: /workspace/github_c_makefile_star2_O0/jfriesse[P]omping/addrfunc.c
// Function: af_is_supported_local_ifa
int
af_is_supported_local_ifa(const struct ifaddrs *ifa, int ip_ver, unsigned int if_flags)
{
	char ai_s[LOGGING_SA_TO_STR_LEN];

	logging_sa_to_str(ifa->ifa_addr, ai_s, sizeof(ai_s));

	if (ifa->ifa_flags & IFF_LOOPBACK) {
		DEBUG2_PRINTF("%s with addr %s is loopback", ifa->ifa_name, ai_s);

		return (0);
	}

	if (!(ifa->ifa_flags & IFF_UP)) {
		DEBUG2_PRINTF("%s with addr %s is not up", ifa->ifa_name, ai_s);

		return (0);
	}

	if (if_flags & IFF_MULTICAST) {
		if (!(ifa->ifa_flags & IFF_MULTICAST)) {
			DEBUG2_PRINTF("%s with addr %s doesn't support mcast", ifa->ifa_name, ai_s);

			return (0);
		}
	}

	if (if_flags & IFF_BROADCAST) {
		if (!(ifa->ifa_flags & IFF_BROADCAST)) {
			DEBUG2_PRINTF("%s with addr %s doesn't support broadcast", ifa->ifa_name,
			    ai_s);

			return (0);
		}
	}

	if (ip_ver != 0 && af_sa_supported_ipv(ifa->ifa_addr) != ip_ver) {
		DEBUG2_PRINTF("%s doesn't support requested ipv%d", ai_s, ip_ver);

		return (0);
	}


	if (ip_ver == 0 && af_sa_supported_ipv(ifa->ifa_addr) == 4) {
		DEBUG2_PRINTF("%s doesn't support ipv6. Saving ipv4 as fallback", ai_s);

		return (2);
	}

	DEBUG_PRINTF("Found local addr %s as device %s", ai_s, ifa->ifa_name);
	return (1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x60(%rbp), %rsi
movl $0x3e, %edx
callq 0x5c10
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x2f9e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %r8
leaq -0x60(%rbp), %r9
leaq 0xb08a(%rip), %rdi      # 0xe004
movl $0x18d, %esi            # imm = 0x18D
movl $0x3, %edx
leaq 0xb14e(%rip), %rcx      # 0xe0d9
movb $0x0, %al
callq 0x5dc0
movl $0x0, -0x4(%rbp)
jmp 0x314c
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x2fe4
movq -0x10(%rbp), %rax
movq 0x8(%rax), %r8
leaq -0x60(%rbp), %r9
leaq 0xb044(%rip), %rdi      # 0xe004
movl $0x193, %esi            # imm = 0x193
movl $0x3, %edx
leaq 0xb124(%rip), %rcx      # 0xe0f5
movb $0x0, %al
callq 0x5dc0
movl $0x0, -0x4(%rbp)
jmp 0x314c
movl -0x18(%rbp), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0x303b
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
jne 0x3039
movq -0x10(%rbp), %rax
movq 0x8(%rax), %r8
leaq -0x60(%rbp), %r9
leaq 0xafef(%rip), %rdi      # 0xe004
movl $0x19a, %esi            # imm = 0x19A
movl $0x3, %edx
leaq 0xb0e9(%rip), %rcx      # 0xe10f
movb $0x0, %al
callq 0x5dc0
movl $0x0, -0x4(%rbp)
jmp 0x314c
jmp 0x303b
movl -0x18(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x308e
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x308c
movq -0x10(%rbp), %rax
movq 0x8(%rax), %r8
leaq -0x60(%rbp), %r9
leaq 0xaf9c(%rip), %rdi      # 0xe004
movl $0x1a3, %esi            # imm = 0x1A3
movl $0x3, %edx
leaq 0xb0bc(%rip), %rcx      # 0xe135
movb $0x0, %al
callq 0x5dc0
movl $0x0, -0x4(%rbp)
jmp 0x314c
jmp 0x308e
cmpl $0x0, -0x14(%rbp)
je 0x30d6
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x3160
cmpl -0x14(%rbp), %eax
je 0x30d6
leaq -0x60(%rbp), %r8
movl -0x14(%rbp), %r9d
leaq 0xaf4f(%rip), %rdi      # 0xe004
movl $0x1aa, %esi            # imm = 0x1AA
movl $0x3, %edx
leaq 0xb099(%rip), %rcx      # 0xe15f
movb $0x0, %al
callq 0x5dc0
movl $0x0, -0x4(%rbp)
jmp 0x314c
cmpl $0x0, -0x14(%rbp)
jne 0x311a
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x3160
cmpl $0x4, %eax
jne 0x311a
leaq -0x60(%rbp), %r8
leaq 0xaf0b(%rip), %rdi      # 0xe004
movl $0x1b1, %esi            # imm = 0x1B1
movl $0x3, %edx
leaq 0xb078(%rip), %rcx      # 0xe182
movb $0x0, %al
callq 0x5dc0
movl $0x2, -0x4(%rbp)
jmp 0x314c
leaq -0x60(%rbp), %r8
movq -0x10(%rbp), %rax
movq 0x8(%rax), %r9
leaq 0xaed7(%rip), %rdi      # 0xe004
movl $0x1b6, %esi            # imm = 0x1B6
movl $0x2, %edx
leaq 0xb075(%rip), %rcx      # 0xe1b3
movb $0x0, %al
callq 0x5dc0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)