; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/NetworkPkg/Ip6Dxe (Ip6Nd)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.IP6_ICMP_INFORMATION_HEAD = type { %struct.IP6_ICMP_HEAD, i32 }
%struct.IP6_ICMP_HEAD = type { i8, i8, i16 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct._IP6_ETHE_ADDR_OPTION = type { i8, i8, [6 x i8] }
%struct._EFI_IP6_HEADER = type { i16, i16, i16, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS }
%struct._IP6_NEIGHBOR_ENTRY = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64, i8, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_MAC_ADDRESS, i32, i32, i32, %struct._LIST_ENTRY, ptr, ptr }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct._IP6_DEFAULT_ROUTER = type { %struct._LIST_ENTRY, i64, i16, %struct.EFI_IPv6_ADDRESS, ptr }
%struct._IP6_SERVICE = type { i32, %struct._EFI_SERVICE_BINDING_PROTOCOL, i64, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, ptr, %struct.IP6_LINK_RX_TOKEN, %struct.IP6_ASSEMBLE_TABLE, %struct.IP6_MLD_SERVICE_DATA, %struct.EFI_IPv6_ADDRESS, i8, i8, i8, i8, i8, i32, i32, i32, i32, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i32, i8, ptr, i8, i8, i32, ptr, ptr, ptr, ptr, %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, %struct.EFI_SIMPLE_NETWORK_MODE, ptr, ptr, %struct._IP6_CONFIG_INSTANCE, ptr, i32, i32 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct.IP6_LINK_RX_TOKEN = type { i32, ptr, ptr, %struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN }
%struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN = type { ptr, i64, %union.anon }
%union.anon = type { ptr }
%struct.IP6_ASSEMBLE_TABLE = type { [127 x %struct._LIST_ENTRY] }
%struct.IP6_MLD_SERVICE_DATA = type { i64, %struct._LIST_ENTRY }
%struct.EFI_MANAGED_NETWORK_CONFIG_DATA = type { i32, i32, i16, i8, i8, i8, i8, i8, i8, i8 }
%struct.EFI_SIMPLE_NETWORK_MODE = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [16 x %struct.EFI_MAC_ADDRESS], %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i8, i8, i8, i8, i8 }
%struct._IP6_CONFIG_INSTANCE = type { i32, i8, %struct._LIST_ENTRY, i16, %struct.EFI_IP6_CONFIG_INTERFACE_INFO, %struct.EFI_IP6_CONFIG_INTERFACE_ID, i32, %struct.EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS, [7 x %struct.IP6_CONFIG_DATA_ITEM], %struct.NET_MAP, %struct.NET_MAP, %struct._EFI_IP6_CONFIG_PROTOCOL, ptr, ptr, ptr, ptr, i8, i32, ptr, i32, ptr, i32, %struct._IP6_FORM_CALLBACK_INFO, %struct.IP6_CONFIG_NVDATA }
%struct.EFI_IP6_CONFIG_INTERFACE_INFO = type { [32 x i16], i8, i32, %struct.EFI_MAC_ADDRESS, i32, ptr, i32, ptr }
%struct.EFI_IP6_CONFIG_INTERFACE_ID = type { [8 x i8] }
%struct.EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS = type { i32 }
%struct.IP6_CONFIG_DATA_ITEM = type { ptr, ptr, i64, i8, %struct.NET_MAP, %union.IP6_CONFIG_DATA, i64 }
%union.IP6_CONFIG_DATA = type { ptr }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%struct._EFI_IP6_CONFIG_PROTOCOL = type { ptr, ptr, ptr, ptr }
%struct._IP6_FORM_CALLBACK_INFO = type { i32, ptr, %struct._EFI_HII_CONFIG_ACCESS_PROTOCOL, ptr, ptr }
%struct._EFI_HII_CONFIG_ACCESS_PROTOCOL = type { ptr, ptr, ptr }
%struct.IP6_CONFIG_NVDATA = type { i32, %struct.EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS, %struct.EFI_IP6_CONFIG_INTERFACE_ID, %struct._LIST_ENTRY, i32, %struct._LIST_ENTRY, i32, %struct._LIST_ENTRY, i32 }

@.str = external hidden unnamed_addr constant [127 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare zeroext i8 @DebugAssertEnabled() #1

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) #1

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) #1

declare i64 @CompareMem(ptr noundef, ptr noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @Ip6FindDefaultRouter(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @Ip6FindNeighborEntry(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @Ip6DestroyDefaultRouter(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @Ip6OnDADFinished(i8 noundef zeroext, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @Ip6FindDADEntry(ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @NetbufCopy(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #1

declare zeroext i8 @NetIp6IsValidUnicast(ptr noundef) #1

declare ptr @NetbufGetByte(ptr noundef, i32 noundef, ptr noundef) #1

declare zeroext i8 @Ip6IsNDOptionValid(ptr noundef, i16 noundef zeroext) #1

declare void @NetbufFree(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip6ProcessNeighborAdvertise(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %struct.IP6_ICMP_INFORMATION_HEAD, align 1
  %9 = alloca %struct.EFI_IPv6_ADDRESS, align 1
  %10 = alloca %struct._IP6_ETHE_ADDR_OPTION, align 1
  %11 = alloca i8, align 1
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i8, align 1
  %16 = alloca i8, align 1
  %17 = alloca i8, align 1
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i16, align 2
  %21 = alloca ptr, align 8
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = call i32 @NetbufCopy(ptr noundef %24, i32 noundef 0, i32 noundef 8, ptr noundef %8)
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.EFI_IPv6_ADDRESS, ptr %9, i32 0, i32 0
  %28 = getelementptr inbounds [16 x i8], ptr %27, i64 0, i64 0
  %29 = call i32 @NetbufCopy(ptr noundef %26, i32 noundef 8, i32 noundef 16, ptr noundef %28)
  store i64 -9223372036854775806, ptr %22, align 8, !tbaa !9
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %30, i32 0, i32 4
  %32 = load i8, ptr %31, align 1, !tbaa !11
  %33 = zext i8 %32 to i32
  %34 = icmp ne i32 %33, 255
  br i1 %34, label %44, label %35

35:                                               ; preds = %3
  %36 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %8, i32 0, i32 0
  %37 = getelementptr inbounds %struct.IP6_ICMP_HEAD, ptr %36, i32 0, i32 1
  %38 = load i8, ptr %37, align 1, !tbaa !15
  %39 = zext i8 %38 to i32
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %44, label %41

41:                                               ; preds = %35
  %42 = call zeroext i8 @NetIp6IsValidUnicast(ptr noundef %9)
  %43 = icmp ne i8 %42, 0
  br i1 %43, label %45, label %44

44:                                               ; preds = %41, %35, %3
  br label %300

45:                                               ; preds = %41
  store i8 0, ptr %11, align 1, !tbaa !19
  store i16 0, ptr %20, align 2, !tbaa !20
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %46, i32 0, i32 2
  %48 = load i16, ptr %47, align 1, !tbaa !21
  %49 = zext i16 %48 to i32
  %50 = icmp slt i32 %49, 24
  br i1 %50, label %51, label %52

51:                                               ; preds = %45
  br label %300

52:                                               ; preds = %45
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %53, i32 0, i32 2
  %55 = load i16, ptr %54, align 1, !tbaa !21
  %56 = zext i16 %55 to i32
  %57 = sub nsw i32 %56, 24
  %58 = trunc i32 %57 to i16
  store i16 %58, ptr %20, align 2, !tbaa !20
  %59 = load i16, ptr %20, align 2, !tbaa !20
  %60 = zext i16 %59 to i32
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %82

62:                                               ; preds = %52
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = call ptr @NetbufGetByte(ptr noundef %63, i32 noundef 24, ptr noundef null)
  store ptr %64, ptr %21, align 8, !tbaa !5
  br label %65

65:                                               ; preds = %62
  %66 = call zeroext i8 @DebugAssertEnabled()
  %67 = icmp ne i8 %66, 0
  br i1 %67, label %68, label %73

68:                                               ; preds = %65
  %69 = load ptr, ptr %21, align 8, !tbaa !5
  %70 = icmp ne ptr %69, null
  br i1 %70, label %72, label %71

71:                                               ; preds = %68
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1747, ptr noundef @.str.19)
  br label %72

72:                                               ; preds = %71, %68
  br label %73

73:                                               ; preds = %72, %65
  br label %74

74:                                               ; preds = %73
  br label %75

75:                                               ; preds = %74
  %76 = load ptr, ptr %21, align 8, !tbaa !5
  %77 = load i16, ptr %20, align 2, !tbaa !20
  %78 = call zeroext i8 @Ip6IsNDOptionValid(ptr noundef %76, i16 noundef zeroext %77)
  %79 = icmp ne i8 %78, 0
  br i1 %79, label %81, label %80

80:                                               ; preds = %75
  br label %300

81:                                               ; preds = %75
  br label %82

82:                                               ; preds = %81, %52
  br label %83

83:                                               ; preds = %82
  store i8 0, ptr %15, align 1, !tbaa !19
  %84 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %8, i32 0, i32 1
  %85 = load i32, ptr %84, align 1, !tbaa !22
  %86 = and i32 %85, 64
  %87 = icmp eq i32 %86, 64
  br i1 %87, label %88, label %89

88:                                               ; preds = %83
  store i8 1, ptr %15, align 1, !tbaa !19
  br label %89

89:                                               ; preds = %88, %83
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %90, i32 0, i32 6
  %92 = getelementptr inbounds %struct.EFI_IPv6_ADDRESS, ptr %91, i32 0, i32 0
  %93 = getelementptr inbounds [16 x i8], ptr %92, i64 0, i64 0
  %94 = load i8, ptr %93, align 1, !tbaa !19
  %95 = zext i8 %94 to i32
  %96 = icmp eq i32 %95, 255
  br i1 %96, label %97, label %102

97:                                               ; preds = %89
  %98 = load i8, ptr %15, align 1, !tbaa !19
  %99 = zext i8 %98 to i32
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %102

101:                                              ; preds = %97
  br label %300

102:                                              ; preds = %97, %89
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = call ptr @Ip6FindDADEntry(ptr noundef %103, ptr noundef %9, ptr noundef %19)
  store ptr %104, ptr %18, align 8, !tbaa !5
  %105 = load ptr, ptr %18, align 8, !tbaa !5
  %106 = icmp ne ptr %105, null
  br i1 %106, label %107, label %111

107:                                              ; preds = %102
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  call void @NetbufFree(ptr noundef %108)
  %109 = load ptr, ptr %19, align 8, !tbaa !5
  %110 = load ptr, ptr %18, align 8, !tbaa !5
  call void @Ip6OnDADFinished(i8 noundef zeroext 0, ptr noundef %109, ptr noundef %110)
  store i64 -9223372036854775786, ptr %4, align 8
  store i32 1, ptr %23, align 4
  br label %303

111:                                              ; preds = %102
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = call ptr @Ip6FindNeighborEntry(ptr noundef %112, ptr noundef %9)
  store ptr %113, ptr %13, align 8, !tbaa !5
  %114 = load ptr, ptr %13, align 8, !tbaa !5
  %115 = icmp eq ptr %114, null
  br i1 %115, label %116, label %117

116:                                              ; preds = %111
  br label %300

117:                                              ; preds = %111
  store i8 0, ptr %16, align 1, !tbaa !19
  store i8 0, ptr %17, align 1, !tbaa !19
  %118 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %8, i32 0, i32 1
  %119 = load i32, ptr %118, align 1, !tbaa !22
  %120 = and i32 %119, 128
  %121 = icmp eq i32 %120, 128
  br i1 %121, label %122, label %123

122:                                              ; preds = %117
  store i8 1, ptr %16, align 1, !tbaa !19
  br label %123

123:                                              ; preds = %122, %117
  %124 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %8, i32 0, i32 1
  %125 = load i32, ptr %124, align 1, !tbaa !22
  %126 = and i32 %125, 32
  %127 = icmp eq i32 %126, 32
  br i1 %127, label %128, label %129

128:                                              ; preds = %123
  store i8 1, ptr %17, align 1, !tbaa !19
  br label %129

129:                                              ; preds = %128, %123
  %130 = load i16, ptr %20, align 2, !tbaa !20
  %131 = zext i16 %130 to i64
  %132 = icmp uge i64 %131, 8
  br i1 %132, label %133, label %142

133:                                              ; preds = %129
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = call i32 @NetbufCopy(ptr noundef %134, i32 noundef 24, i32 noundef 8, ptr noundef %10)
  %136 = getelementptr inbounds %struct._IP6_ETHE_ADDR_OPTION, ptr %10, i32 0, i32 0
  %137 = load i8, ptr %136, align 1, !tbaa !23
  %138 = zext i8 %137 to i32
  %139 = icmp eq i32 %138, 2
  br i1 %139, label %140, label %141

140:                                              ; preds = %133
  store i8 1, ptr %11, align 1, !tbaa !19
  br label %141

141:                                              ; preds = %140, %133
  br label %142

142:                                              ; preds = %141, %129
  store i64 0, ptr %12, align 8, !tbaa !9
  %143 = load i8, ptr %11, align 1, !tbaa !19
  %144 = icmp ne i8 %143, 0
  br i1 %144, label %145, label %153

145:                                              ; preds = %142
  %146 = load ptr, ptr %13, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %146, i32 0, i32 7
  %148 = getelementptr inbounds %struct.EFI_MAC_ADDRESS, ptr %147, i32 0, i32 0
  %149 = getelementptr inbounds [32 x i8], ptr %148, i64 0, i64 0
  %150 = getelementptr inbounds %struct._IP6_ETHE_ADDR_OPTION, ptr %10, i32 0, i32 2
  %151 = getelementptr inbounds [6 x i8], ptr %150, i64 0, i64 0
  %152 = call i64 @CompareMem(ptr noundef %149, ptr noundef %151, i64 noundef 6)
  store i64 %152, ptr %12, align 8, !tbaa !9
  br label %153

153:                                              ; preds = %145, %142
  %154 = load ptr, ptr %13, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %154, i32 0, i32 3
  %156 = load i8, ptr %155, align 8, !tbaa !25
  %157 = icmp ne i8 %156, 0
  br i1 %157, label %172, label %158

158:                                              ; preds = %153
  %159 = load i8, ptr %16, align 1, !tbaa !19
  %160 = zext i8 %159 to i32
  %161 = icmp ne i32 %160, 0
  br i1 %161, label %162, label %172

162:                                              ; preds = %158
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = call ptr @Ip6FindDefaultRouter(ptr noundef %163, ptr noundef %9)
  store ptr %164, ptr %14, align 8, !tbaa !5
  %165 = load ptr, ptr %14, align 8, !tbaa !5
  %166 = icmp ne ptr %165, null
  br i1 %166, label %167, label %171

167:                                              ; preds = %162
  %168 = load ptr, ptr %13, align 8, !tbaa !5
  %169 = load ptr, ptr %14, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct._IP6_DEFAULT_ROUTER, ptr %169, i32 0, i32 4
  store ptr %168, ptr %170, align 8, !tbaa !28
  br label %171

171:                                              ; preds = %167, %162
  br label %172

172:                                              ; preds = %171, %158, %153
  %173 = load ptr, ptr %13, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %173, i32 0, i32 8
  %175 = load i32, ptr %174, align 4, !tbaa !30
  %176 = icmp eq i32 %175, 0
  br i1 %176, label %177, label %215

177:                                              ; preds = %172
  %178 = load i8, ptr %11, align 1, !tbaa !19
  %179 = icmp ne i8 %178, 0
  br i1 %179, label %181, label %180

180:                                              ; preds = %177
  br label %300

181:                                              ; preds = %177
  %182 = load ptr, ptr %13, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %182, i32 0, i32 7
  %184 = getelementptr inbounds %struct.EFI_MAC_ADDRESS, ptr %183, i32 0, i32 0
  %185 = getelementptr inbounds [32 x i8], ptr %184, i64 0, i64 0
  %186 = getelementptr inbounds %struct._IP6_ETHE_ADDR_OPTION, ptr %10, i32 0, i32 2
  %187 = getelementptr inbounds [6 x i8], ptr %186, i64 0, i64 0
  %188 = call ptr @CopyMem(ptr noundef %185, ptr noundef %187, i64 noundef 6)
  %189 = load i8, ptr %15, align 1, !tbaa !19
  %190 = icmp ne i8 %189, 0
  br i1 %190, label %191, label %202

191:                                              ; preds = %181
  %192 = load ptr, ptr %13, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %192, i32 0, i32 8
  store i32 1, ptr %193, align 4, !tbaa !30
  %194 = load ptr, ptr %5, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct._IP6_SERVICE, ptr %194, i32 0, i32 19
  %196 = load i32, ptr %195, align 8, !tbaa !31
  %197 = add i32 %196, 100
  %198 = sub i32 %197, 1
  %199 = udiv i32 %198, 100
  %200 = load ptr, ptr %13, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %200, i32 0, i32 10
  store i32 %199, ptr %201, align 4, !tbaa !47
  br label %211

202:                                              ; preds = %181
  %203 = load ptr, ptr %13, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %203, i32 0, i32 8
  store i32 2, ptr %204, align 4, !tbaa !30
  %205 = load ptr, ptr %13, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %205, i32 0, i32 10
  store i32 -1, ptr %206, align 4, !tbaa !47
  %207 = load ptr, ptr %13, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %207, i32 0, i32 13
  %209 = load ptr, ptr %208, align 8, !tbaa !48
  %210 = load ptr, ptr %13, align 8, !tbaa !5
  call void %209(ptr noundef %210)
  br label %211

211:                                              ; preds = %202, %191
  %212 = load i8, ptr %16, align 1, !tbaa !19
  %213 = load ptr, ptr %13, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %213, i32 0, i32 3
  store i8 %212, ptr %214, align 8, !tbaa !25
  br label %289

215:                                              ; preds = %172
  %216 = load i8, ptr %17, align 1, !tbaa !19
  %217 = icmp ne i8 %216, 0
  br i1 %217, label %232, label %218

218:                                              ; preds = %215
  %219 = load i64, ptr %12, align 8, !tbaa !9
  %220 = icmp ne i64 %219, 0
  br i1 %220, label %221, label %232

221:                                              ; preds = %218
  %222 = load ptr, ptr %13, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %222, i32 0, i32 8
  %224 = load i32, ptr %223, align 4, !tbaa !30
  %225 = icmp eq i32 %224, 1
  br i1 %225, label %226, label %231

226:                                              ; preds = %221
  %227 = load ptr, ptr %13, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %227, i32 0, i32 8
  store i32 2, ptr %228, align 4, !tbaa !30
  %229 = load ptr, ptr %13, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %229, i32 0, i32 10
  store i32 -1, ptr %230, align 4, !tbaa !47
  br label %231

231:                                              ; preds = %226, %221
  br label %288

232:                                              ; preds = %218, %215
  %233 = load i64, ptr %12, align 8, !tbaa !9
  %234 = icmp ne i64 %233, 0
  br i1 %234, label %235, label %243

235:                                              ; preds = %232
  %236 = load ptr, ptr %13, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %236, i32 0, i32 7
  %238 = getelementptr inbounds %struct.EFI_MAC_ADDRESS, ptr %237, i32 0, i32 0
  %239 = getelementptr inbounds [32 x i8], ptr %238, i64 0, i64 0
  %240 = getelementptr inbounds %struct._IP6_ETHE_ADDR_OPTION, ptr %10, i32 0, i32 2
  %241 = getelementptr inbounds [6 x i8], ptr %240, i64 0, i64 0
  %242 = call ptr @CopyMem(ptr noundef %239, ptr noundef %241, i64 noundef 6)
  br label %243

243:                                              ; preds = %235, %232
  %244 = load i8, ptr %15, align 1, !tbaa !19
  %245 = icmp ne i8 %244, 0
  br i1 %245, label %246, label %257

246:                                              ; preds = %243
  %247 = load ptr, ptr %13, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %247, i32 0, i32 8
  store i32 1, ptr %248, align 4, !tbaa !30
  %249 = load ptr, ptr %5, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct._IP6_SERVICE, ptr %249, i32 0, i32 19
  %251 = load i32, ptr %250, align 8, !tbaa !31
  %252 = add i32 %251, 100
  %253 = sub i32 %252, 1
  %254 = udiv i32 %253, 100
  %255 = load ptr, ptr %13, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %255, i32 0, i32 10
  store i32 %254, ptr %256, align 4, !tbaa !47
  br label %266

257:                                              ; preds = %243
  %258 = load i64, ptr %12, align 8, !tbaa !9
  %259 = icmp ne i64 %258, 0
  br i1 %259, label %260, label %265

260:                                              ; preds = %257
  %261 = load ptr, ptr %13, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %261, i32 0, i32 8
  store i32 2, ptr %262, align 4, !tbaa !30
  %263 = load ptr, ptr %13, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %263, i32 0, i32 10
  store i32 -1, ptr %264, align 4, !tbaa !47
  br label %265

265:                                              ; preds = %260, %257
  br label %266

266:                                              ; preds = %265, %246
  %267 = load ptr, ptr %13, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %267, i32 0, i32 3
  %269 = load i8, ptr %268, align 8, !tbaa !25
  %270 = zext i8 %269 to i32
  %271 = icmp ne i32 %270, 0
  br i1 %271, label %272, label %284

272:                                              ; preds = %266
  %273 = load i8, ptr %16, align 1, !tbaa !19
  %274 = icmp ne i8 %273, 0
  br i1 %274, label %284, label %275

275:                                              ; preds = %272
  %276 = load ptr, ptr %5, align 8, !tbaa !5
  %277 = call ptr @Ip6FindDefaultRouter(ptr noundef %276, ptr noundef %9)
  store ptr %277, ptr %14, align 8, !tbaa !5
  %278 = load ptr, ptr %14, align 8, !tbaa !5
  %279 = icmp ne ptr %278, null
  br i1 %279, label %280, label %283

280:                                              ; preds = %275
  %281 = load ptr, ptr %5, align 8, !tbaa !5
  %282 = load ptr, ptr %14, align 8, !tbaa !5
  call void @Ip6DestroyDefaultRouter(ptr noundef %281, ptr noundef %282)
  br label %283

283:                                              ; preds = %280, %275
  br label %284

284:                                              ; preds = %283, %272, %266
  %285 = load i8, ptr %16, align 1, !tbaa !19
  %286 = load ptr, ptr %13, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %286, i32 0, i32 3
  store i8 %285, ptr %287, align 8, !tbaa !25
  br label %288

288:                                              ; preds = %284, %231
  br label %289

289:                                              ; preds = %288, %211
  %290 = load ptr, ptr %13, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %290, i32 0, i32 8
  %292 = load i32, ptr %291, align 4, !tbaa !30
  %293 = icmp eq i32 %292, 1
  br i1 %293, label %294, label %299

294:                                              ; preds = %289
  %295 = load ptr, ptr %13, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %295, i32 0, i32 13
  %297 = load ptr, ptr %296, align 8, !tbaa !48
  %298 = load ptr, ptr %13, align 8, !tbaa !5
  call void %297(ptr noundef %298)
  br label %299

299:                                              ; preds = %294, %289
  store i64 0, ptr %22, align 8, !tbaa !9
  br label %300

300:                                              ; preds = %299, %180, %116, %101, %80, %51, %44
  %301 = load ptr, ptr %7, align 8, !tbaa !5
  call void @NetbufFree(ptr noundef %301)
  %302 = load i64, ptr %22, align 8, !tbaa !9
  store i64 %302, ptr %4, align 8
  store i32 1, ptr %23, align 4
  br label %303

303:                                              ; preds = %300, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %304 = load i64, ptr %4, align 8
  ret i64 %304
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !7, i64 7}
!12 = !{!"_EFI_IP6_HEADER", !7, i64 0, !7, i64 0, !7, i64 1, !7, i64 1, !13, i64 2, !13, i64 4, !7, i64 6, !7, i64 7, !14, i64 8, !14, i64 24}
!13 = !{!"short", !7, i64 0}
!14 = !{!"", !7, i64 0}
!15 = !{!16, !7, i64 1}
!16 = !{!"", !17, i64 0, !18, i64 4}
!17 = !{!"", !7, i64 0, !7, i64 1, !13, i64 2}
!18 = !{!"int", !7, i64 0}
!19 = !{!7, !7, i64 0}
!20 = !{!13, !13, i64 0}
!21 = !{!12, !13, i64 4}
!22 = !{!16, !18, i64 4}
!23 = !{!24, !7, i64 0}
!24 = !{!"_IP6_ETHE_ADDR_OPTION", !7, i64 0, !7, i64 1, !7, i64 2}
!25 = !{!26, !7, i64 40}
!26 = !{!"_IP6_NEIGHBOR_ENTRY", !27, i64 0, !27, i64 16, !10, i64 32, !7, i64 40, !7, i64 41, !7, i64 42, !14, i64 43, !14, i64 59, !18, i64 92, !18, i64 96, !18, i64 100, !27, i64 104, !6, i64 120, !6, i64 128}
!27 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!28 = !{!29, !6, i64 48}
!29 = !{!"_IP6_DEFAULT_ROUTER", !27, i64 0, !10, i64 16, !13, i64 24, !14, i64 26, !6, i64 48}
!30 = !{!26, !18, i64 92}
!31 = !{!32, !18, i64 2224}
!32 = !{!"_IP6_SERVICE", !18, i64 0, !33, i64 8, !10, i64 24, !10, i64 32, !27, i64 40, !27, i64 56, !6, i64 72, !6, i64 80, !34, i64 88, !14, i64 136, !36, i64 2168, !14, i64 2192, !7, i64 2208, !7, i64 2209, !7, i64 2210, !7, i64 2211, !7, i64 2212, !18, i64 2216, !18, i64 2220, !18, i64 2224, !18, i64 2228, !27, i64 2232, !27, i64 2248, !27, i64 2264, !27, i64 2280, !18, i64 2296, !7, i64 2300, !6, i64 2304, !7, i64 2312, !7, i64 2313, !18, i64 2316, !6, i64 2320, !6, i64 2328, !6, i64 2336, !6, i64 2344, !37, i64 2352, !38, i64 2372, !6, i64 3032, !6, i64 3040, !39, i64 3048, !6, i64 4176, !18, i64 4184, !18, i64 4188}
!33 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!34 = !{!"", !18, i64 0, !6, i64 8, !6, i64 16, !35, i64 24}
!35 = !{!"", !6, i64 0, !10, i64 8, !7, i64 16}
!36 = !{!"", !10, i64 0, !27, i64 8}
!37 = !{!"", !18, i64 0, !18, i64 4, !13, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!38 = !{!"", !18, i64 0, !18, i64 4, !18, i64 8, !18, i64 12, !18, i64 16, !18, i64 20, !18, i64 24, !18, i64 28, !18, i64 32, !18, i64 36, !7, i64 40, !14, i64 552, !14, i64 584, !14, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!39 = !{!"_IP6_CONFIG_INSTANCE", !18, i64 0, !7, i64 4, !27, i64 8, !13, i64 24, !40, i64 32, !14, i64 168, !18, i64 176, !41, i64 180, !7, i64 184, !42, i64 800, !42, i64 840, !43, i64 880, !6, i64 912, !6, i64 920, !6, i64 928, !6, i64 936, !7, i64 944, !18, i64 948, !6, i64 952, !18, i64 960, !6, i64 968, !18, i64 976, !44, i64 984, !46, i64 1040}
!40 = !{!"", !7, i64 0, !7, i64 64, !18, i64 68, !14, i64 72, !18, i64 104, !6, i64 112, !18, i64 120, !6, i64 128}
!41 = !{!"", !18, i64 0}
!42 = !{!"", !27, i64 0, !27, i64 16, !10, i64 32}
!43 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!44 = !{!"_IP6_FORM_CALLBACK_INFO", !18, i64 0, !6, i64 8, !45, i64 16, !6, i64 40, !6, i64 48}
!45 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!46 = !{!"", !18, i64 0, !41, i64 4, !14, i64 8, !27, i64 16, !18, i64 32, !27, i64 40, !18, i64 56, !27, i64 64, !18, i64 80}
!47 = !{!26, !18, i64 100}
!48 = !{!26, !6, i64 128}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.IP6_ICMP_INFORMATION_HEAD = type { %struct.IP6_ICMP_HEAD, i32 }
%struct.IP6_ICMP_HEAD = type { i8, i8, i16 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct._IP6_ETHE_ADDR_OPTION = type { i8, i8, [6 x i8] }

@.str = external hidden unnamed_addr constant [127 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare i64 @CompareMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @Ip6FindDefaultRouter(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @Ip6FindNeighborEntry(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @Ip6DestroyDefaultRouter(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @Ip6OnDADFinished(i8 noundef zeroext, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @Ip6FindDADEntry(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @NetbufCopy(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare zeroext i8 @NetIp6IsValidUnicast(ptr noundef) local_unnamed_addr #1

declare ptr @NetbufGetByte(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare zeroext i8 @Ip6IsNDOptionValid(ptr noundef, i16 noundef zeroext) local_unnamed_addr #1

declare void @NetbufFree(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @Ip6ProcessNeighborAdvertise(ptr noundef %0, ptr nocapture noundef readonly %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = alloca %struct.IP6_ICMP_INFORMATION_HEAD, align 1
  %5 = alloca %struct.EFI_IPv6_ADDRESS, align 1
  %6 = alloca %struct._IP6_ETHE_ADDR_OPTION, align 1
  %7 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  %8 = call i32 @NetbufCopy(ptr noundef %2, i32 noundef 0, i32 noundef 8, ptr noundef nonnull %4) #3
  %9 = call i32 @NetbufCopy(ptr noundef %2, i32 noundef 8, i32 noundef 16, ptr noundef nonnull %5) #3
  %10 = getelementptr inbounds i8, ptr %1, i64 7
  %11 = load i8, ptr %10, align 1, !tbaa !5
  %12 = icmp ne i8 %11, -1
  %13 = getelementptr inbounds i8, ptr %4, i64 1
  %14 = load i8, ptr %13, align 1
  %15 = icmp ne i8 %14, 0
  %or.cond = select i1 %12, i1 true, i1 %15
  br i1 %or.cond, label %112, label %16

16:                                               ; preds = %3
  %17 = call zeroext i8 @NetIp6IsValidUnicast(ptr noundef nonnull %5) #3
  %.not = icmp eq i8 %17, 0
  br i1 %.not, label %112, label %18

18:                                               ; preds = %16
  %19 = getelementptr inbounds i8, ptr %1, i64 4
  %20 = load i16, ptr %19, align 1, !tbaa !11
  %21 = icmp ult i16 %20, 24
  br i1 %21, label %112, label %22

22:                                               ; preds = %18
  %23 = add i16 %20, -24
  %.not95 = icmp eq i16 %23, 0
  br i1 %.not95, label %32, label %24

24:                                               ; preds = %22
  %25 = call ptr @NetbufGetByte(ptr noundef %2, i32 noundef 24, ptr noundef null) #3
  %26 = call zeroext i8 @DebugAssertEnabled() #3
  %27 = icmp eq i8 %26, 0
  %28 = icmp ne ptr %25, null
  %or.cond16 = select i1 %27, i1 true, i1 %28
  br i1 %or.cond16, label %30, label %29

29:                                               ; preds = %24
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1747, ptr noundef nonnull @.str.19) #3
  br label %30

30:                                               ; preds = %29, %24
  %31 = call zeroext i8 @Ip6IsNDOptionValid(ptr noundef %25, i16 noundef zeroext %23) #3
  %.not96 = icmp eq i8 %31, 0
  br i1 %.not96, label %112, label %32

32:                                               ; preds = %22, %30
  %33 = getelementptr inbounds i8, ptr %4, i64 4
  %34 = load i32, ptr %33, align 1, !tbaa !12
  %35 = and i32 %34, 64
  %36 = icmp ne i32 %35, 0
  %37 = getelementptr inbounds i8, ptr %1, i64 24
  %38 = load i8, ptr %37, align 1, !tbaa !16
  %39 = icmp eq i8 %38, -1
  %or.cond7 = select i1 %39, i1 %36, i1 false
  br i1 %or.cond7, label %112, label %40

40:                                               ; preds = %32
  %41 = call ptr @Ip6FindDADEntry(ptr noundef %0, ptr noundef nonnull %5, ptr noundef nonnull %7)
  %.not97 = icmp eq ptr %41, null
  br i1 %.not97, label %44, label %42

42:                                               ; preds = %40
  call void @NetbufFree(ptr noundef %2) #3
  %43 = load ptr, ptr %7, align 8, !tbaa !17
  call void @Ip6OnDADFinished(i8 noundef zeroext 0, ptr noundef %43, ptr noundef nonnull %41)
  br label %113

44:                                               ; preds = %40
  %45 = call ptr @Ip6FindNeighborEntry(ptr noundef %0, ptr noundef nonnull %5)
  %46 = icmp eq ptr %45, null
  br i1 %46, label %112, label %47

47:                                               ; preds = %44
  %48 = load i32, ptr %33, align 1, !tbaa !12
  %49 = and i32 %48, 128
  %.not98 = icmp ne i32 %49, 0
  %spec.select = zext i1 %.not98 to i8
  %50 = and i32 %48, 32
  %.not99 = icmp eq i32 %50, 0
  %51 = icmp ugt i16 %23, 7
  br i1 %51, label %52, label %.thread

52:                                               ; preds = %47
  %53 = call i32 @NetbufCopy(ptr noundef %2, i32 noundef 24, i32 noundef 8, ptr noundef nonnull %6) #3
  %54 = load i8, ptr %6, align 1, !tbaa !19
  %.not109 = icmp eq i8 %54, 2
  br i1 %.not109, label %55, label %.thread

55:                                               ; preds = %52
  %56 = getelementptr inbounds i8, ptr %45, i64 59
  %57 = getelementptr inbounds i8, ptr %6, i64 2
  %58 = call i64 @CompareMem(ptr noundef nonnull %56, ptr noundef nonnull %57, i64 noundef 6) #3
  %59 = icmp ne i64 %58, 0
  br label %.thread

.thread:                                          ; preds = %47, %55, %52
  %.not100105 = phi i1 [ false, %55 ], [ true, %52 ], [ true, %47 ]
  %.088 = phi i1 [ %59, %55 ], [ false, %52 ], [ false, %47 ]
  %60 = getelementptr inbounds i8, ptr %45, i64 40
  %61 = load i8, ptr %60, align 8, !tbaa !21
  %62 = icmp eq i8 %61, 0
  %or.cond10 = and i1 %.not98, %62
  br i1 %or.cond10, label %63, label %67

63:                                               ; preds = %.thread
  %64 = call ptr @Ip6FindDefaultRouter(ptr noundef %0, ptr noundef nonnull %5)
  %.not101 = icmp eq ptr %64, null
  br i1 %.not101, label %67, label %65

65:                                               ; preds = %63
  %66 = getelementptr inbounds i8, ptr %64, i64 48
  store ptr %45, ptr %66, align 8, !tbaa !25
  br label %67

67:                                               ; preds = %63, %65, %.thread
  %68 = getelementptr inbounds i8, ptr %45, i64 92
  %69 = load i32, ptr %68, align 4, !tbaa !27
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %86

71:                                               ; preds = %67
  br i1 %.not100105, label %112, label %72

72:                                               ; preds = %71
  %73 = getelementptr inbounds i8, ptr %45, i64 59
  %74 = getelementptr inbounds i8, ptr %6, i64 2
  %75 = call ptr @CopyMem(ptr noundef nonnull %73, ptr noundef nonnull %74, i64 noundef 6) #3
  br i1 %36, label %76, label %82

76:                                               ; preds = %72
  store i32 1, ptr %68, align 4, !tbaa !27
  %77 = getelementptr inbounds i8, ptr %0, i64 2224
  %78 = load i32, ptr %77, align 8, !tbaa !28
  %79 = add i32 %78, 99
  %80 = udiv i32 %79, 100
  %81 = getelementptr inbounds i8, ptr %45, i64 100
  store i32 %80, ptr %81, align 4, !tbaa !44
  br label %.sink.split

82:                                               ; preds = %72
  store i32 2, ptr %68, align 4, !tbaa !27
  %83 = getelementptr inbounds i8, ptr %45, i64 100
  store i32 -1, ptr %83, align 4, !tbaa !44
  %84 = getelementptr inbounds i8, ptr %45, i64 128
  %85 = load ptr, ptr %84, align 8, !tbaa !45
  call void %85(ptr noundef nonnull %45) #3
  br label %.sink.split

86:                                               ; preds = %67
  %or.cond12 = select i1 %.not99, i1 %.088, i1 false
  br i1 %or.cond12, label %87, label %90

87:                                               ; preds = %86
  %88 = icmp eq i32 %69, 1
  br i1 %88, label %.thread108, label %107

.thread108:                                       ; preds = %87
  store i32 2, ptr %68, align 4, !tbaa !27
  %89 = getelementptr inbounds i8, ptr %45, i64 100
  store i32 -1, ptr %89, align 4, !tbaa !44
  br label %112

90:                                               ; preds = %86
  br i1 %.088, label %91, label %.thread106

91:                                               ; preds = %90
  %92 = getelementptr inbounds i8, ptr %45, i64 59
  %93 = getelementptr inbounds i8, ptr %6, i64 2
  %94 = call ptr @CopyMem(ptr noundef nonnull %92, ptr noundef nonnull %93, i64 noundef 6) #3
  br i1 %36, label %95, label %100

.thread106:                                       ; preds = %90
  br i1 %36, label %95, label %.thread107

95:                                               ; preds = %.thread106, %91
  store i32 1, ptr %68, align 4, !tbaa !27
  %96 = getelementptr inbounds i8, ptr %0, i64 2224
  %97 = load i32, ptr %96, align 8, !tbaa !28
  %98 = add i32 %97, 99
  %99 = udiv i32 %98, 100
  br label %.thread107.sink.split

100:                                              ; preds = %91
  store i32 2, ptr %68, align 4, !tbaa !27
  br label %.thread107.sink.split

.thread107.sink.split:                            ; preds = %95, %100
  %.sink = phi i32 [ -1, %100 ], [ %99, %95 ]
  %101 = getelementptr inbounds i8, ptr %45, i64 100
  store i32 %.sink, ptr %101, align 4, !tbaa !44
  br label %.thread107

.thread107:                                       ; preds = %.thread107.sink.split, %.thread106
  %102 = load i8, ptr %60, align 8, !tbaa !21
  %103 = icmp eq i8 %102, 0
  %or.cond14 = or i1 %.not98, %103
  br i1 %or.cond14, label %.sink.split, label %104

104:                                              ; preds = %.thread107
  %105 = call ptr @Ip6FindDefaultRouter(ptr noundef %0, ptr noundef nonnull %5)
  %.not102 = icmp eq ptr %105, null
  br i1 %.not102, label %.sink.split, label %106

106:                                              ; preds = %104
  call void @Ip6DestroyDefaultRouter(ptr noundef %0, ptr noundef nonnull %105)
  br label %.sink.split

.sink.split:                                      ; preds = %.thread107, %106, %104, %76, %82
  store i8 %spec.select, ptr %60, align 8, !tbaa !21
  br label %107

107:                                              ; preds = %.sink.split, %87
  %.pr = load i32, ptr %68, align 4, !tbaa !27
  %108 = icmp eq i32 %.pr, 1
  br i1 %108, label %109, label %112

109:                                              ; preds = %107
  %110 = getelementptr inbounds i8, ptr %45, i64 128
  %111 = load ptr, ptr %110, align 8, !tbaa !45
  call void %111(ptr noundef nonnull %45) #3
  br label %112

112:                                              ; preds = %.thread108, %107, %109, %71, %44, %32, %30, %18, %3, %16
  %.0 = phi i64 [ -9223372036854775806, %3 ], [ -9223372036854775806, %18 ], [ -9223372036854775806, %32 ], [ -9223372036854775806, %44 ], [ -9223372036854775806, %71 ], [ -9223372036854775806, %30 ], [ -9223372036854775806, %16 ], [ 0, %109 ], [ 0, %107 ], [ 0, %.thread108 ]
  call void @NetbufFree(ptr noundef %2) #3
  br label %113

113:                                              ; preds = %112, %42
  %.084 = phi i64 [ %.0, %112 ], [ -9223372036854775786, %42 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret i64 %.084
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 7}
!6 = !{!"_EFI_IP6_HEADER", !7, i64 0, !7, i64 0, !7, i64 1, !7, i64 1, !9, i64 2, !9, i64 4, !7, i64 6, !7, i64 7, !10, i64 8, !10, i64 24}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"short", !7, i64 0}
!10 = !{!"", !7, i64 0}
!11 = !{!6, !9, i64 4}
!12 = !{!13, !15, i64 4}
!13 = !{!"", !14, i64 0, !15, i64 4}
!14 = !{!"", !7, i64 0, !7, i64 1, !9, i64 2}
!15 = !{!"int", !7, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !7, i64 0}
!19 = !{!20, !7, i64 0}
!20 = !{!"_IP6_ETHE_ADDR_OPTION", !7, i64 0, !7, i64 1, !7, i64 2}
!21 = !{!22, !7, i64 40}
!22 = !{!"_IP6_NEIGHBOR_ENTRY", !23, i64 0, !23, i64 16, !24, i64 32, !7, i64 40, !7, i64 41, !7, i64 42, !10, i64 43, !10, i64 59, !15, i64 92, !15, i64 96, !15, i64 100, !23, i64 104, !18, i64 120, !18, i64 128}
!23 = !{!"_LIST_ENTRY", !18, i64 0, !18, i64 8}
!24 = !{!"long long", !7, i64 0}
!25 = !{!26, !18, i64 48}
!26 = !{!"_IP6_DEFAULT_ROUTER", !23, i64 0, !24, i64 16, !9, i64 24, !10, i64 26, !18, i64 48}
!27 = !{!22, !15, i64 92}
!28 = !{!29, !15, i64 2224}
!29 = !{!"_IP6_SERVICE", !15, i64 0, !30, i64 8, !24, i64 24, !24, i64 32, !23, i64 40, !23, i64 56, !18, i64 72, !18, i64 80, !31, i64 88, !10, i64 136, !33, i64 2168, !10, i64 2192, !7, i64 2208, !7, i64 2209, !7, i64 2210, !7, i64 2211, !7, i64 2212, !15, i64 2216, !15, i64 2220, !15, i64 2224, !15, i64 2228, !23, i64 2232, !23, i64 2248, !23, i64 2264, !23, i64 2280, !15, i64 2296, !7, i64 2300, !18, i64 2304, !7, i64 2312, !7, i64 2313, !15, i64 2316, !18, i64 2320, !18, i64 2328, !18, i64 2336, !18, i64 2344, !34, i64 2352, !35, i64 2372, !18, i64 3032, !18, i64 3040, !36, i64 3048, !18, i64 4176, !15, i64 4184, !15, i64 4188}
!30 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !18, i64 0, !18, i64 8}
!31 = !{!"", !15, i64 0, !18, i64 8, !18, i64 16, !32, i64 24}
!32 = !{!"", !18, i64 0, !24, i64 8, !7, i64 16}
!33 = !{!"", !24, i64 0, !23, i64 8}
!34 = !{!"", !15, i64 0, !15, i64 4, !9, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!35 = !{!"", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36, !7, i64 40, !10, i64 552, !10, i64 584, !10, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!36 = !{!"_IP6_CONFIG_INSTANCE", !15, i64 0, !7, i64 4, !23, i64 8, !9, i64 24, !37, i64 32, !10, i64 168, !15, i64 176, !38, i64 180, !7, i64 184, !39, i64 800, !39, i64 840, !40, i64 880, !18, i64 912, !18, i64 920, !18, i64 928, !18, i64 936, !7, i64 944, !15, i64 948, !18, i64 952, !15, i64 960, !18, i64 968, !15, i64 976, !41, i64 984, !43, i64 1040}
!37 = !{!"", !7, i64 0, !7, i64 64, !15, i64 68, !10, i64 72, !15, i64 104, !18, i64 112, !15, i64 120, !18, i64 128}
!38 = !{!"", !15, i64 0}
!39 = !{!"", !23, i64 0, !23, i64 16, !24, i64 32}
!40 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !18, i64 0, !18, i64 8, !18, i64 16, !18, i64 24}
!41 = !{!"_IP6_FORM_CALLBACK_INFO", !15, i64 0, !18, i64 8, !42, i64 16, !18, i64 40, !18, i64 48}
!42 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !18, i64 0, !18, i64 8, !18, i64 16}
!43 = !{!"", !15, i64 0, !38, i64 4, !10, i64 8, !23, i64 16, !15, i64 32, !23, i64 40, !15, i64 56, !23, i64 64, !15, i64 80}
!44 = !{!22, !15, i64 100}
!45 = !{!22, !18, i64 128}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass