#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */
typedef struct TYPE_6__ TYPE_3__;
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_6__ {
  int /*<<< orphan*/ s6_addr;
};
struct sockaddr_in6 {
  TYPE_3__ sin6_addr;
};
struct TYPE_5__ {
  int member_10;
  int member_11;
  int member_12;
  int member_15;
  int /*<<< orphan*/ member_14;
  int /*<<< orphan*/ member_13;
  int /*<<< orphan*/ member_9;
  int /*<<< orphan*/ member_8;
  int /*<<< orphan*/ member_7;
  int /*<<< orphan*/ member_6;
  int /*<<< orphan*/ member_5;
  int /*<<< orphan*/ member_4;
  int /*<<< orphan*/ member_3;
  int /*<<< orphan*/ member_2;
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};
struct TYPE_4__ {
  TYPE_2__ member_0;
};
struct in6_addr {
  int /*<<< orphan*/ s6_addr;
  TYPE_1__ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ memcmp(int /*<<< orphan*/, int /*<<< orphan*/, int);
int is_acceptable_address(struct sockaddr_in6 *addr) {
  static const struct in6_addr ip4_localhost = {
      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 127, 0, 0, 1}}};
  if (!addr)
    return 0;
  if (!memcmp(ip4_localhost.s6_addr, addr->sin6_addr.s6_addr, 16)) {
    ({});
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_acceptable_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <is_acceptable_address+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1165 <is_acceptable_address+0x55>
mov    0xec7(%rip),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x10,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
jne    115e <is_acceptable_address+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1165 <is_acceptable_address+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_acceptable_address>:
test   %rdi,%rdi
je     1132 <is_acceptable_address+0x22>
push   %rax
mov    (%rdi),%esi
xor    %edi,%edi
mov    $0x10,%edx
call   1030 <memcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.in6_addr = type { i32, %struct.TYPE_4__ }
%struct.TYPE_4__ = type { %struct.TYPE_5__ }
%struct.TYPE_5__ = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.sockaddr_in6 = type { %struct.TYPE_6__ }
%struct.TYPE_6__ = type { i32 }
@is_acceptable_address.ip4_localhost = internal constant %struct.in6_addr zeroinitializer
define i32 @is_acceptable_address(%struct.sockaddr_in6* %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr_in6*
store %struct.sockaddr_in6* %0, %struct.sockaddr_in6** %3
%4 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %3
%5 = icmp ne %struct.sockaddr_in6* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 0, i32* %2
br label %17
7: ; preds = %1
%8 = load i32, i32* getelementptr inbounds (%struct.in6_addr, %struct.in6_addr* @is_acceptable_address.ip4_localhost, i32 0, i32 0)
%9 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %3
%10 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %9, i32 0, i32 0
%11 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @memcmp(i32 %8, i32 %12, i32 16)
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %7
store i32 0, i32* %2
br label %17
16: ; preds = %7
store i32 1, i32* %2
br label %17
17: ; preds = %16, %15, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.sockaddr_in6 = type { %struct.TYPE_6__ }
%struct.TYPE_6__ = type { i32 }
define i32 @is_acceptable_address(%struct.sockaddr_in6* %0) {
%2 = icmp eq %struct.sockaddr_in6* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %0, i64 0, i32 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @memcmp(i32 0, i32 %5, i32 16)
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %10
}