; 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.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct._EFI_IP6_HEADER = type { i16, i16, i16, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct.IP6_ICMP_INFORMATION_HEAD = type { %struct.IP6_ICMP_HEAD, i32 }
%struct.IP6_ICMP_HEAD = type { i8, i8, i16 }
%struct.NET_BUF = type { i32, i64, %struct._LIST_ENTRY, %union.NET_IP_HEAD, ptr, ptr, [64 x i8], ptr, i32, i32, [1 x %struct.NET_BLOCK_OP] }
%struct._LIST_ENTRY = type { ptr, ptr }
%union.NET_IP_HEAD = type { ptr }
%struct.NET_BLOCK_OP = type { ptr, ptr, ptr, ptr, i32 }
%struct._IP6_ETHE_ADDR_OPTION = type { i8, i8, [6 x i8] }
%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 }
%struct.IP6_ROUTE_CACHE_ENTRY = type { %struct._LIST_ENTRY, i64, i64, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS }
%struct.IP6_ROUTE_ENTRY = type { %struct._LIST_ENTRY, i64, i32, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS }
%struct._IP6_ROUTE_TABLE = type { i64, i32, [129 x %struct._LIST_ENTRY], %struct.IP6_ROUTE_CACHE }
%struct.IP6_ROUTE_CACHE = type { [31 x %struct._LIST_ENTRY], [31 x i8] }
%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 }

@.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 ptr @Ip6CreateRouteEntry(ptr noundef, i8 noundef zeroext, ptr noundef) #1

declare ptr @InsertHeadList(ptr noundef, ptr noundef) #1

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

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

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

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

declare zeroext i8 @NetIp6IsLinkLocalAddr(ptr noundef) #1

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

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

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

declare zeroext i8 @Ip6IsOneOfSetAddress(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare void @NetbufFree(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip6ProcessRedirect(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i16, align 2
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = alloca ptr, align 8
  %18 = alloca %struct.EFI_MAC_ADDRESS, align 1
  %19 = alloca i32, align 4
  %20 = alloca i8, align 1
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 2, 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 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 1, 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
  store i64 -9223372036854775806, ptr %21, align 8, !tbaa !9
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = call ptr @NetbufGetByte(ptr noundef %23, i32 noundef 0, ptr noundef null)
  store ptr %24, ptr %7, align 8, !tbaa !5
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %28

27:                                               ; preds = %3
  br label %330

28:                                               ; preds = %3
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %29, i32 0, i32 4
  %31 = load i8, ptr %30, align 1, !tbaa !11
  %32 = zext i8 %31 to i32
  %33 = icmp ne i32 %32, 255
  br i1 %33, label %47, label %34

34:                                               ; preds = %28
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %35, 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 %47, label %41

41:                                               ; preds = %34
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %42, i32 0, i32 2
  %44 = load i16, ptr %43, align 1, !tbaa !19
  %45 = zext i16 %44 to i32
  %46 = icmp slt i32 %45, 40
  br i1 %46, label %47, label %48

47:                                               ; preds = %41, %34, %28
  br label %330

48:                                               ; preds = %41
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %49, i32 0, i32 5
  %51 = call zeroext i8 @NetIp6IsLinkLocalAddr(ptr noundef %50)
  %52 = icmp ne i8 %51, 0
  br i1 %52, label %54, label %53

53:                                               ; preds = %48
  br label %330

54:                                               ; preds = %48
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %56, i32 0, i32 6
  %58 = call zeroext i8 @Ip6IsOneOfSetAddress(ptr noundef %55, ptr noundef %57, ptr noundef null, ptr noundef null)
  %59 = icmp ne i8 %58, 0
  br i1 %59, label %61, label %60

60:                                               ; preds = %54
  br label %330

61:                                               ; preds = %54
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %62, i32 0, i32 2
  %64 = load i16, ptr %63, align 1, !tbaa !19
  %65 = zext i16 %64 to i32
  %66 = sub nsw i32 %65, 40
  %67 = trunc i32 %66 to i16
  store i16 %67, ptr %11, align 2, !tbaa !20
  %68 = load i16, ptr %11, align 2, !tbaa !20
  %69 = zext i16 %68 to i32
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %91

71:                                               ; preds = %61
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = call ptr @NetbufGetByte(ptr noundef %72, i32 noundef 40, ptr noundef null)
  store ptr %73, ptr %10, align 8, !tbaa !5
  br label %74

74:                                               ; preds = %71
  %75 = call zeroext i8 @DebugAssertEnabled()
  %76 = icmp ne i8 %75, 0
  br i1 %76, label %77, label %82

77:                                               ; preds = %74
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = icmp ne ptr %78, null
  br i1 %79, label %81, label %80

80:                                               ; preds = %77
  call void @DebugAssert(ptr noundef @.str, i64 noundef 2448, ptr noundef @.str.19)
  br label %81

81:                                               ; preds = %80, %77
  br label %82

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

83:                                               ; preds = %82
  br label %84

84:                                               ; preds = %83
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = load i16, ptr %11, align 2, !tbaa !20
  %87 = call zeroext i8 @Ip6IsNDOptionValid(ptr noundef %85, i16 noundef zeroext %86)
  %88 = icmp ne i8 %87, 0
  br i1 %88, label %90, label %89

89:                                               ; preds = %84
  br label %330

90:                                               ; preds = %84
  br label %91

91:                                               ; preds = %90, %61
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %92, i64 1
  store ptr %93, ptr %8, align 8, !tbaa !5
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.EFI_IPv6_ADDRESS, ptr %94, i64 1
  store ptr %95, ptr %9, align 8, !tbaa !5
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.EFI_IPv6_ADDRESS, ptr %96, i32 0, i32 0
  %98 = getelementptr inbounds [16 x i8], ptr %97, i64 0, i64 0
  %99 = load i8, ptr %98, align 1, !tbaa !21
  %100 = zext i8 %99 to i32
  %101 = icmp eq i32 %100, 255
  br i1 %101, label %102, label %103

102:                                              ; preds = %91
  br label %330

103:                                              ; preds = %91
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = call i64 @CompareMem(ptr noundef %104, ptr noundef %105, i64 noundef 16)
  %107 = icmp eq i64 %106, 0
  %108 = xor i1 %107, true
  %109 = zext i1 %108 to i32
  %110 = trunc i32 %109 to i8
  store i8 %110, ptr %20, align 1, !tbaa !21
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = call zeroext i8 @NetIp6IsLinkLocalAddr(ptr noundef %111)
  %113 = icmp ne i8 %112, 0
  br i1 %113, label %119, label %114

114:                                              ; preds = %103
  %115 = load i8, ptr %20, align 1, !tbaa !21
  %116 = zext i8 %115 to i32
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %119

118:                                              ; preds = %114
  br label %330

119:                                              ; preds = %114, %103
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.NET_BUF, ptr %120, i32 0, i32 9
  %122 = load i32, ptr %121, align 4, !tbaa !22
  %123 = sub i32 %122, 40
  store i32 %123, ptr %15, align 4, !tbaa !25
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.EFI_IPv6_ADDRESS, ptr %124, i64 1
  store ptr %125, ptr %10, align 8, !tbaa !5
  store ptr null, ptr %17, align 8, !tbaa !5
  br label %126

126:                                              ; preds = %152, %119
  %127 = load i32, ptr %15, align 4, !tbaa !25
  %128 = icmp sgt i32 %127, 0
  br i1 %128, label %129, label %164

129:                                              ; preds = %126
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = load i8, ptr %130, align 1, !tbaa !21
  %132 = zext i8 %131 to i32
  switch i32 %132, label %143 [
    i32 2, label %133
  ]

133:                                              ; preds = %129
  %134 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %134, ptr %17, align 8, !tbaa !5
  %135 = load ptr, ptr %17, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._IP6_ETHE_ADDR_OPTION, ptr %135, i32 0, i32 1
  %137 = load i8, ptr %136, align 1, !tbaa !26
  store i8 %137, ptr %16, align 1, !tbaa !21
  %138 = load i8, ptr %16, align 1, !tbaa !21
  %139 = zext i8 %138 to i32
  %140 = icmp ne i32 %139, 1
  br i1 %140, label %141, label %142

141:                                              ; preds = %133
  br label %330

142:                                              ; preds = %133
  br label %152

143:                                              ; preds = %129
  %144 = load ptr, ptr %10, align 8, !tbaa !5
  %145 = getelementptr inbounds i8, ptr %144, i64 1
  %146 = load i8, ptr %145, align 1, !tbaa !21
  store i8 %146, ptr %16, align 1, !tbaa !21
  %147 = load i8, ptr %16, align 1, !tbaa !21
  %148 = zext i8 %147 to i32
  %149 = icmp eq i32 %148, 0
  br i1 %149, label %150, label %151

150:                                              ; preds = %143
  br label %330

151:                                              ; preds = %143
  br label %152

152:                                              ; preds = %151, %142
  %153 = load i8, ptr %16, align 1, !tbaa !21
  %154 = zext i8 %153 to i32
  %155 = mul nsw i32 8, %154
  %156 = load i32, ptr %15, align 4, !tbaa !25
  %157 = sub nsw i32 %156, %155
  store i32 %157, ptr %15, align 4, !tbaa !25
  %158 = load i8, ptr %16, align 1, !tbaa !21
  %159 = zext i8 %158 to i32
  %160 = mul nsw i32 8, %159
  %161 = load ptr, ptr %10, align 8, !tbaa !5
  %162 = sext i32 %160 to i64
  %163 = getelementptr inbounds i8, ptr %161, i64 %162
  store ptr %163, ptr %10, align 8, !tbaa !5
  br label %126, !llvm.loop !28

164:                                              ; preds = %126
  %165 = load i32, ptr %15, align 4, !tbaa !25
  %166 = icmp ne i32 %165, 0
  br i1 %166, label %167, label %168

167:                                              ; preds = %164
  br label %330

168:                                              ; preds = %164
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct._IP6_SERVICE, ptr %169, i32 0, i32 7
  %171 = load ptr, ptr %170, align 8, !tbaa !30
  %172 = load ptr, ptr %9, align 8, !tbaa !5
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %173, i32 0, i32 6
  %175 = call ptr @Ip6FindRouteCache(ptr noundef %171, ptr noundef %172, ptr noundef %174)
  store ptr %175, ptr %13, align 8, !tbaa !5
  %176 = load ptr, ptr %13, align 8, !tbaa !5
  %177 = icmp ne ptr %176, null
  br i1 %177, label %178, label %205

178:                                              ; preds = %168
  %179 = load ptr, ptr %13, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.IP6_ROUTE_CACHE_ENTRY, ptr %179, i32 0, i32 5
  %181 = load ptr, ptr %5, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %181, i32 0, i32 5
  %183 = call i64 @CompareMem(ptr noundef %180, ptr noundef %182, i64 noundef 16)
  %184 = icmp eq i64 %183, 0
  br i1 %184, label %186, label %185

185:                                              ; preds = %178
  br label %330

186:                                              ; preds = %178
  %187 = load ptr, ptr %13, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.IP6_ROUTE_CACHE_ENTRY, ptr %187, i32 0, i32 5
  %189 = load ptr, ptr %8, align 8, !tbaa !5
  %190 = call ptr @CopyMem(ptr noundef %188, ptr noundef %189, i64 noundef 16)
  %191 = load i8, ptr %20, align 1, !tbaa !21
  %192 = icmp ne i8 %191, 0
  br i1 %192, label %204, label %193

193:                                              ; preds = %186
  %194 = load ptr, ptr %13, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.IP6_ROUTE_CACHE_ENTRY, ptr %194, i32 0, i32 2
  %196 = load i64, ptr %195, align 8, !tbaa !46
  %197 = inttoptr i64 %196 to ptr
  store ptr %197, ptr %12, align 8, !tbaa !5
  %198 = load ptr, ptr %12, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.IP6_ROUTE_ENTRY, ptr %198, i32 0, i32 2
  %200 = load i32, ptr %199, align 8, !tbaa !48
  %201 = or i32 %200, 1
  %202 = load ptr, ptr %12, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.IP6_ROUTE_ENTRY, ptr %202, i32 0, i32 2
  store i32 %201, ptr %203, align 8, !tbaa !48
  br label %204

204:                                              ; preds = %193, %186
  br label %253

205:                                              ; preds = %168
  %206 = load ptr, ptr %4, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct._IP6_SERVICE, ptr %206, i32 0, i32 7
  %208 = load ptr, ptr %207, align 8, !tbaa !30
  %209 = load ptr, ptr %9, align 8, !tbaa !5
  %210 = call ptr @Ip6FindRouteEntry(ptr noundef %208, ptr noundef %209, ptr noundef null)
  store ptr %210, ptr %12, align 8, !tbaa !5
  %211 = load ptr, ptr %12, align 8, !tbaa !5
  %212 = icmp eq ptr %211, null
  br i1 %212, label %213, label %220

213:                                              ; preds = %205
  %214 = load ptr, ptr %9, align 8, !tbaa !5
  %215 = call ptr @Ip6CreateRouteEntry(ptr noundef %214, i8 noundef zeroext 0, ptr noundef null)
  store ptr %215, ptr %12, align 8, !tbaa !5
  %216 = load ptr, ptr %12, align 8, !tbaa !5
  %217 = icmp eq ptr %216, null
  br i1 %217, label %218, label %219

218:                                              ; preds = %213
  store i64 -9223372036854775799, ptr %21, align 8, !tbaa !9
  br label %330

219:                                              ; preds = %213
  br label %220

220:                                              ; preds = %219, %205
  %221 = load i8, ptr %20, align 1, !tbaa !21
  %222 = icmp ne i8 %221, 0
  br i1 %222, label %226, label %223

223:                                              ; preds = %220
  %224 = load ptr, ptr %12, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.IP6_ROUTE_ENTRY, ptr %224, i32 0, i32 2
  store i32 1, ptr %225, align 8, !tbaa !48
  br label %226

226:                                              ; preds = %223, %220
  %227 = load ptr, ptr %9, align 8, !tbaa !5
  %228 = load ptr, ptr %5, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %228, i32 0, i32 6
  %230 = load ptr, ptr %8, align 8, !tbaa !5
  %231 = load ptr, ptr %12, align 8, !tbaa !5
  %232 = ptrtoint ptr %231 to i64
  %233 = call ptr @Ip6CreateRouteCacheEntry(ptr noundef %227, ptr noundef %229, ptr noundef %230, i64 noundef %232)
  store ptr %233, ptr %13, align 8, !tbaa !5
  %234 = load ptr, ptr %13, align 8, !tbaa !5
  %235 = icmp eq ptr %234, null
  br i1 %235, label %236, label %237

236:                                              ; preds = %226
  store i64 -9223372036854775799, ptr %21, align 8, !tbaa !9
  br label %330

237:                                              ; preds = %226
  %238 = load ptr, ptr %9, align 8, !tbaa !5
  %239 = load ptr, ptr %5, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %239, i32 0, i32 6
  %241 = call i32 @Ip6RouteCacheHash(ptr noundef %238, ptr noundef %240)
  store i32 %241, ptr %19, align 4, !tbaa !25
  %242 = load ptr, ptr %4, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct._IP6_SERVICE, ptr %242, i32 0, i32 7
  %244 = load ptr, ptr %243, align 8, !tbaa !30
  %245 = getelementptr inbounds %struct._IP6_ROUTE_TABLE, ptr %244, i32 0, i32 3
  %246 = getelementptr inbounds %struct.IP6_ROUTE_CACHE, ptr %245, i32 0, i32 0
  %247 = load i32, ptr %19, align 4, !tbaa !25
  %248 = zext i32 %247 to i64
  %249 = getelementptr inbounds [31 x %struct._LIST_ENTRY], ptr %246, i64 0, i64 %248
  %250 = load ptr, ptr %13, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.IP6_ROUTE_CACHE_ENTRY, ptr %250, i32 0, i32 0
  %252 = call ptr @InsertHeadList(ptr noundef %249, ptr noundef %251)
  br label %253

253:                                              ; preds = %237, %204
  %254 = load ptr, ptr %4, align 8, !tbaa !5
  %255 = load ptr, ptr %8, align 8, !tbaa !5
  %256 = call ptr @Ip6FindNeighborEntry(ptr noundef %254, ptr noundef %255)
  store ptr %256, ptr %14, align 8, !tbaa !5
  %257 = load ptr, ptr %17, align 8, !tbaa !5
  %258 = icmp ne ptr %257, null
  br i1 %258, label %259, label %319

259:                                              ; preds = %253
  %260 = load ptr, ptr %14, align 8, !tbaa !5
  %261 = icmp eq ptr %260, null
  br i1 %261, label %262, label %279

262:                                              ; preds = %259
  %263 = call ptr @ZeroMem(ptr noundef %18, i64 noundef 32)
  %264 = load ptr, ptr %17, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct._IP6_ETHE_ADDR_OPTION, ptr %264, i32 0, i32 2
  %266 = getelementptr inbounds [6 x i8], ptr %265, i64 0, i64 0
  %267 = call ptr @CopyMem(ptr noundef %18, ptr noundef %266, i64 noundef 6)
  %268 = load ptr, ptr %4, align 8, !tbaa !5
  %269 = load ptr, ptr %8, align 8, !tbaa !5
  %270 = call ptr @Ip6CreateNeighborEntry(ptr noundef %268, ptr noundef @Ip6OnArpResolved, ptr noundef %269, ptr noundef %18)
  store ptr %270, ptr %14, align 8, !tbaa !5
  %271 = load ptr, ptr %14, align 8, !tbaa !5
  %272 = icmp eq ptr %271, null
  br i1 %272, label %273, label %274

273:                                              ; preds = %262
  store i64 0, ptr %21, align 8, !tbaa !9
  br label %330

274:                                              ; preds = %262
  %275 = load ptr, ptr %14, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %275, i32 0, i32 8
  store i32 2, ptr %276, align 4, !tbaa !50
  %277 = load ptr, ptr %14, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %277, i32 0, i32 10
  store i32 -1, ptr %278, align 4, !tbaa !52
  br label %318

279:                                              ; preds = %259
  %280 = load ptr, ptr %17, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct._IP6_ETHE_ADDR_OPTION, ptr %280, i32 0, i32 2
  %282 = getelementptr inbounds [6 x i8], ptr %281, i64 0, i64 0
  %283 = load ptr, ptr %14, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %283, i32 0, i32 7
  %285 = call i64 @CompareMem(ptr noundef %282, ptr noundef %284, i64 noundef 6)
  store i64 %285, ptr %22, align 8, !tbaa !9
  %286 = load ptr, ptr %14, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %286, i32 0, i32 8
  %288 = load i32, ptr %287, align 4, !tbaa !50
  %289 = icmp eq i32 %288, 0
  br i1 %289, label %293, label %290

290:                                              ; preds = %279
  %291 = load i64, ptr %22, align 8, !tbaa !9
  %292 = icmp ne i64 %291, 0
  br i1 %292, label %293, label %317

293:                                              ; preds = %290, %279
  %294 = load ptr, ptr %14, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %294, i32 0, i32 7
  %296 = load ptr, ptr %17, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct._IP6_ETHE_ADDR_OPTION, ptr %296, i32 0, i32 2
  %298 = getelementptr inbounds [6 x i8], ptr %297, i64 0, i64 0
  %299 = call ptr @CopyMem(ptr noundef %295, ptr noundef %298, i64 noundef 6)
  %300 = load ptr, ptr %14, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %300, i32 0, i32 10
  store i32 -1, ptr %301, align 4, !tbaa !52
  %302 = load ptr, ptr %14, align 8, !tbaa !5
  %303 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %302, i32 0, i32 8
  %304 = load i32, ptr %303, align 4, !tbaa !50
  %305 = icmp eq i32 %304, 0
  br i1 %305, label %306, label %313

306:                                              ; preds = %293
  %307 = load ptr, ptr %14, align 8, !tbaa !5
  %308 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %307, i32 0, i32 8
  store i32 2, ptr %308, align 4, !tbaa !50
  %309 = load ptr, ptr %14, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %309, i32 0, i32 13
  %311 = load ptr, ptr %310, align 8, !tbaa !53
  %312 = load ptr, ptr %14, align 8, !tbaa !5
  call void %311(ptr noundef %312)
  br label %316

313:                                              ; preds = %293
  %314 = load ptr, ptr %14, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %314, i32 0, i32 8
  store i32 2, ptr %315, align 4, !tbaa !50
  br label %316

316:                                              ; preds = %313, %306
  br label %317

317:                                              ; preds = %316, %290
  br label %318

318:                                              ; preds = %317, %274
  br label %319

319:                                              ; preds = %318, %253
  %320 = load ptr, ptr %14, align 8, !tbaa !5
  %321 = icmp ne ptr %320, null
  br i1 %321, label %322, label %329

322:                                              ; preds = %319
  %323 = load i8, ptr %20, align 1, !tbaa !21
  %324 = zext i8 %323 to i32
  %325 = icmp ne i32 %324, 0
  br i1 %325, label %326, label %329

326:                                              ; preds = %322
  %327 = load ptr, ptr %14, align 8, !tbaa !5
  %328 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %327, i32 0, i32 3
  store i8 1, ptr %328, align 8, !tbaa !54
  br label %329

329:                                              ; preds = %326, %322, %319
  store i64 0, ptr %21, align 8, !tbaa !9
  br label %330

330:                                              ; preds = %329, %273, %236, %218, %185, %167, %150, %141, %118, %102, %89, %60, %53, %47, %27
  %331 = load ptr, ptr %6, align 8, !tbaa !5
  call void @NetbufFree(ptr noundef %331)
  %332 = load i64, ptr %21, align 8, !tbaa !9
  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 1, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, 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 2, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret i64 %332
}

declare ptr @Ip6FindRouteCache(ptr noundef, ptr noundef, ptr noundef) #1

declare ptr @Ip6FindRouteEntry(ptr noundef, ptr noundef, ptr noundef) #1

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

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

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 = !{!12, !13, i64 4}
!20 = !{!13, !13, i64 0}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !18, i64 132}
!23 = !{!"", !18, i64 0, !10, i64 8, !24, i64 16, !7, i64 32, !6, i64 40, !6, i64 48, !7, i64 56, !6, i64 120, !18, i64 128, !18, i64 132, !7, i64 136}
!24 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!25 = !{!18, !18, i64 0}
!26 = !{!27, !7, i64 1}
!27 = !{!"_IP6_ETHE_ADDR_OPTION", !7, i64 0, !7, i64 1, !7, i64 2}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!31, !6, i64 80}
!31 = !{!"_IP6_SERVICE", !18, i64 0, !32, i64 8, !10, i64 24, !10, i64 32, !24, i64 40, !24, i64 56, !6, i64 72, !6, i64 80, !33, i64 88, !14, i64 136, !35, 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, !24, i64 2232, !24, i64 2248, !24, i64 2264, !24, 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, !36, i64 2352, !37, i64 2372, !6, i64 3032, !6, i64 3040, !38, i64 3048, !6, i64 4176, !18, i64 4184, !18, i64 4188}
!32 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!33 = !{!"", !18, i64 0, !6, i64 8, !6, i64 16, !34, i64 24}
!34 = !{!"", !6, i64 0, !10, i64 8, !7, i64 16}
!35 = !{!"", !10, i64 0, !24, i64 8}
!36 = !{!"", !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}
!37 = !{!"", !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}
!38 = !{!"_IP6_CONFIG_INSTANCE", !18, i64 0, !7, i64 4, !24, i64 8, !13, i64 24, !39, i64 32, !14, i64 168, !18, i64 176, !40, i64 180, !7, i64 184, !41, i64 800, !41, i64 840, !42, 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, !43, i64 984, !45, i64 1040}
!39 = !{!"", !7, i64 0, !7, i64 64, !18, i64 68, !14, i64 72, !18, i64 104, !6, i64 112, !18, i64 120, !6, i64 128}
!40 = !{!"", !18, i64 0}
!41 = !{!"", !24, i64 0, !24, i64 16, !10, i64 32}
!42 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!43 = !{!"_IP6_FORM_CALLBACK_INFO", !18, i64 0, !6, i64 8, !44, i64 16, !6, i64 40, !6, i64 48}
!44 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!45 = !{!"", !18, i64 0, !40, i64 4, !14, i64 8, !24, i64 16, !18, i64 32, !24, i64 40, !18, i64 56, !24, i64 64, !18, i64 80}
!46 = !{!47, !10, i64 24}
!47 = !{!"", !24, i64 0, !10, i64 16, !10, i64 24, !14, i64 32, !14, i64 48, !14, i64 64}
!48 = !{!49, !18, i64 24}
!49 = !{!"", !24, i64 0, !10, i64 16, !18, i64 24, !7, i64 28, !14, i64 29, !14, i64 45}
!50 = !{!51, !18, i64 92}
!51 = !{!"_IP6_NEIGHBOR_ENTRY", !24, i64 0, !24, 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, !24, i64 104, !6, i64 120, !6, i64 128}
!52 = !{!51, !18, i64 100}
!53 = !{!51, !6, i64 128}
!54 = !{!51, !7, i64 40}


; 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.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct._LIST_ENTRY = type { ptr, ptr }

@.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 ptr @Ip6CreateRouteEntry(ptr noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #1

declare ptr @InsertHeadList(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @Ip6CreateNeighborEntry(ptr noundef, ptr noundef, 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

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

declare ptr @ZeroMem(ptr noundef, i64 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 zeroext i8 @Ip6IsOneOfSetAddress(ptr noundef, ptr noundef, ptr noundef, ptr noundef) 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 @Ip6ProcessRedirect(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = alloca %struct.EFI_MAC_ADDRESS, align 1
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #3
  %5 = tail call ptr @NetbufGetByte(ptr noundef %2, i32 noundef 0, ptr noundef null) #3
  %6 = icmp eq ptr %5, null
  br i1 %6, label %.loopexit, label %7

7:                                                ; preds = %3
  %8 = getelementptr inbounds i8, ptr %1, i64 7
  %9 = load i8, ptr %8, align 1, !tbaa !5
  %.not = icmp eq i8 %9, -1
  br i1 %.not, label %10, label %.loopexit

10:                                               ; preds = %7
  %11 = getelementptr inbounds i8, ptr %5, i64 1
  %12 = load i8, ptr %11, align 1, !tbaa !11
  %.not112 = icmp eq i8 %12, 0
  br i1 %.not112, label %13, label %.loopexit

13:                                               ; preds = %10
  %14 = getelementptr inbounds i8, ptr %1, i64 4
  %15 = load i16, ptr %14, align 1, !tbaa !15
  %16 = icmp ult i16 %15, 40
  br i1 %16, label %.loopexit, label %17

17:                                               ; preds = %13
  %18 = getelementptr inbounds i8, ptr %1, i64 8
  %19 = tail call zeroext i8 @NetIp6IsLinkLocalAddr(ptr noundef nonnull %18) #3
  %.not113 = icmp eq i8 %19, 0
  br i1 %.not113, label %.loopexit, label %20

20:                                               ; preds = %17
  %21 = getelementptr inbounds i8, ptr %1, i64 24
  %22 = tail call zeroext i8 @Ip6IsOneOfSetAddress(ptr noundef %0, ptr noundef nonnull %21, ptr noundef null, ptr noundef null) #3
  %.not114 = icmp eq i8 %22, 0
  br i1 %.not114, label %.loopexit, label %23

23:                                               ; preds = %20
  %24 = load i16, ptr %14, align 1, !tbaa !15
  %25 = add i16 %24, -40
  %.not115 = icmp eq i16 %25, 0
  br i1 %.not115, label %34, label %26

26:                                               ; preds = %23
  %27 = tail call ptr @NetbufGetByte(ptr noundef %2, i32 noundef 40, ptr noundef null) #3
  %28 = tail call zeroext i8 @DebugAssertEnabled() #3
  %29 = icmp eq i8 %28, 0
  %30 = icmp ne ptr %27, null
  %or.cond9 = select i1 %29, i1 true, i1 %30
  br i1 %or.cond9, label %32, label %31

31:                                               ; preds = %26
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 2448, ptr noundef nonnull @.str.19) #3
  br label %32

32:                                               ; preds = %31, %26
  %33 = tail call zeroext i8 @Ip6IsNDOptionValid(ptr noundef %27, i16 noundef zeroext %25) #3
  %.not116 = icmp eq i8 %33, 0
  br i1 %.not116, label %.loopexit, label %34

34:                                               ; preds = %32, %23
  %35 = getelementptr inbounds i8, ptr %5, i64 8
  %36 = getelementptr inbounds i8, ptr %5, i64 24
  %37 = load i8, ptr %36, align 1, !tbaa !16
  %38 = icmp eq i8 %37, -1
  br i1 %38, label %.loopexit, label %39

39:                                               ; preds = %34
  %40 = tail call i64 @CompareMem(ptr noundef nonnull %35, ptr noundef nonnull %36, i64 noundef 16) #3
  %41 = icmp ne i64 %40, 0
  %42 = tail call zeroext i8 @NetIp6IsLinkLocalAddr(ptr noundef nonnull %35) #3
  %43 = icmp eq i8 %42, 0
  %or.cond = select i1 %43, i1 %41, i1 false
  br i1 %or.cond, label %.loopexit, label %44

44:                                               ; preds = %39
  %45 = getelementptr inbounds i8, ptr %2, i64 132
  %46 = load i32, ptr %45, align 4, !tbaa !17
  %47 = add i32 %46, -40
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %44
  %49 = getelementptr inbounds i8, ptr %5, i64 40
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %56
  %.0125 = phi ptr [ %61, %56 ], [ %49, %.lr.ph.preheader ]
  %.0101124 = phi ptr [ %.1, %56 ], [ null, %.lr.ph.preheader ]
  %.0103123 = phi i32 [ %59, %56 ], [ %47, %.lr.ph.preheader ]
  %50 = load i8, ptr %.0125, align 1, !tbaa !16
  %cond = icmp eq i8 %50, 2
  %51 = getelementptr inbounds i8, ptr %.0125, i64 1
  %52 = load i8, ptr %51, align 1, !tbaa !16
  br i1 %cond, label %53, label %54

53:                                               ; preds = %.lr.ph
  %.not120 = icmp eq i8 %52, 1
  br i1 %.not120, label %56, label %.loopexit

54:                                               ; preds = %.lr.ph
  %55 = icmp eq i8 %52, 0
  br i1 %55, label %.loopexit, label %56

56:                                               ; preds = %54, %53
  %.0102 = phi i8 [ 1, %53 ], [ %52, %54 ]
  %.1 = phi ptr [ %.0125, %53 ], [ %.0101124, %54 ]
  %57 = zext i8 %.0102 to i32
  %58 = shl nuw nsw i32 %57, 3
  %59 = sub nsw i32 %.0103123, %58
  %60 = zext nneg i32 %58 to i64
  %61 = getelementptr inbounds i8, ptr %.0125, i64 %60
  %62 = icmp sgt i32 %59, 0
  br i1 %62, label %.lr.ph, label %._crit_edge, !llvm.loop !22

._crit_edge:                                      ; preds = %56, %44
  %.0103.lcssa = phi i32 [ %47, %44 ], [ %59, %56 ]
  %.0101.lcssa = phi ptr [ null, %44 ], [ %.1, %56 ]
  %.not117 = icmp eq i32 %.0103.lcssa, 0
  br i1 %.not117, label %63, label %.loopexit

63:                                               ; preds = %._crit_edge
  %64 = getelementptr inbounds i8, ptr %0, i64 80
  %65 = load ptr, ptr %64, align 8, !tbaa !24
  %66 = tail call ptr @Ip6FindRouteCache(ptr noundef %65, ptr noundef nonnull %36, ptr noundef nonnull %21) #3
  %.not118 = icmp eq ptr %66, null
  br i1 %.not118, label %80, label %67

67:                                               ; preds = %63
  %68 = getelementptr inbounds i8, ptr %66, i64 64
  %69 = tail call i64 @CompareMem(ptr noundef nonnull %68, ptr noundef nonnull %18, i64 noundef 16) #3
  %70 = icmp eq i64 %69, 0
  br i1 %70, label %71, label %.loopexit

71:                                               ; preds = %67
  %72 = tail call ptr @CopyMem(ptr noundef nonnull %68, ptr noundef nonnull %35, i64 noundef 16) #3
  br i1 %41, label %101, label %73

73:                                               ; preds = %71
  %74 = getelementptr inbounds i8, ptr %66, i64 24
  %75 = load i64, ptr %74, align 8, !tbaa !40
  %76 = inttoptr i64 %75 to ptr
  %77 = getelementptr inbounds i8, ptr %76, i64 24
  %78 = load i32, ptr %77, align 8, !tbaa !42
  %79 = or i32 %78, 1
  store i32 %79, ptr %77, align 8, !tbaa !42
  br label %101

80:                                               ; preds = %63
  %81 = load ptr, ptr %64, align 8, !tbaa !24
  %82 = tail call ptr @Ip6FindRouteEntry(ptr noundef %81, ptr noundef nonnull %36, ptr noundef null) #3
  %83 = icmp eq ptr %82, null
  br i1 %83, label %84, label %87

84:                                               ; preds = %80
  %85 = tail call ptr @Ip6CreateRouteEntry(ptr noundef nonnull %36, i8 noundef zeroext 0, ptr noundef null) #3
  %86 = icmp eq ptr %85, null
  br i1 %86, label %.loopexit, label %87

87:                                               ; preds = %84, %80
  %.0100 = phi ptr [ %85, %84 ], [ %82, %80 ]
  br i1 %41, label %90, label %88

88:                                               ; preds = %87
  %89 = getelementptr inbounds i8, ptr %.0100, i64 24
  store i32 1, ptr %89, align 8, !tbaa !42
  br label %90

90:                                               ; preds = %88, %87
  %91 = ptrtoint ptr %.0100 to i64
  %92 = tail call ptr @Ip6CreateRouteCacheEntry(ptr noundef nonnull %36, ptr noundef nonnull %21, ptr noundef nonnull %35, i64 noundef %91) #3
  %93 = icmp eq ptr %92, null
  br i1 %93, label %.loopexit, label %94

94:                                               ; preds = %90
  %95 = tail call i32 @Ip6RouteCacheHash(ptr noundef nonnull %36, ptr noundef nonnull %21) #3
  %96 = load ptr, ptr %64, align 8, !tbaa !24
  %97 = getelementptr inbounds i8, ptr %96, i64 2080
  %98 = zext i32 %95 to i64
  %99 = getelementptr inbounds [31 x %struct._LIST_ENTRY], ptr %97, i64 0, i64 %98
  %100 = tail call ptr @InsertHeadList(ptr noundef nonnull %99, ptr noundef nonnull %92) #3
  br label %101

101:                                              ; preds = %71, %73, %94
  %102 = tail call ptr @Ip6FindNeighborEntry(ptr noundef nonnull %0, ptr noundef nonnull %35)
  %.not119 = icmp eq ptr %.0101.lcssa, null
  br i1 %.not119, label %130, label %103

103:                                              ; preds = %101
  %104 = icmp eq ptr %102, null
  br i1 %104, label %105, label %114

105:                                              ; preds = %103
  %106 = call ptr @ZeroMem(ptr noundef nonnull %4, i64 noundef 32) #3
  %107 = getelementptr inbounds i8, ptr %.0101.lcssa, i64 2
  %108 = call ptr @CopyMem(ptr noundef nonnull %4, ptr noundef nonnull %107, i64 noundef 6) #3
  %109 = call ptr @Ip6CreateNeighborEntry(ptr noundef nonnull %0, ptr noundef nonnull @Ip6OnArpResolved, ptr noundef nonnull %35, ptr noundef nonnull %4)
  %110 = icmp eq ptr %109, null
  br i1 %110, label %.loopexit, label %111

111:                                              ; preds = %105
  %112 = getelementptr inbounds i8, ptr %109, i64 92
  store i32 2, ptr %112, align 4, !tbaa !44
  %113 = getelementptr inbounds i8, ptr %109, i64 100
  store i32 -1, ptr %113, align 4, !tbaa !46
  br label %130

114:                                              ; preds = %103
  %115 = getelementptr inbounds i8, ptr %.0101.lcssa, i64 2
  %116 = getelementptr inbounds i8, ptr %102, i64 59
  %117 = tail call i64 @CompareMem(ptr noundef nonnull %115, ptr noundef nonnull %116, i64 noundef 6) #3
  %118 = getelementptr inbounds i8, ptr %102, i64 92
  %119 = load i32, ptr %118, align 4, !tbaa !44
  %120 = icmp eq i32 %119, 0
  %121 = icmp ne i64 %117, 0
  %or.cond4 = select i1 %120, i1 true, i1 %121
  br i1 %or.cond4, label %122, label %130

122:                                              ; preds = %114
  %123 = tail call ptr @CopyMem(ptr noundef nonnull %116, ptr noundef nonnull %115, i64 noundef 6) #3
  %124 = getelementptr inbounds i8, ptr %102, i64 100
  store i32 -1, ptr %124, align 4, !tbaa !46
  %125 = load i32, ptr %118, align 4, !tbaa !44
  %126 = icmp eq i32 %125, 0
  store i32 2, ptr %118, align 4, !tbaa !44
  br i1 %126, label %127, label %130

127:                                              ; preds = %122
  %128 = getelementptr inbounds i8, ptr %102, i64 128
  %129 = load ptr, ptr %128, align 8, !tbaa !47
  tail call void %129(ptr noundef nonnull %102) #3
  br label %130

130:                                              ; preds = %122, %111, %127, %114, %101
  %.0104 = phi ptr [ %109, %111 ], [ %102, %127 ], [ %102, %114 ], [ %102, %101 ], [ %102, %122 ]
  %131 = icmp ne ptr %.0104, null
  %or.cond7 = select i1 %131, i1 %41, i1 false
  br i1 %or.cond7, label %132, label %.loopexit

132:                                              ; preds = %130
  %133 = getelementptr inbounds i8, ptr %.0104, i64 40
  store i8 1, ptr %133, align 8, !tbaa !48
  br label %.loopexit

.loopexit:                                        ; preds = %54, %53, %130, %132, %105, %90, %84, %67, %._crit_edge, %39, %34, %32, %20, %17, %7, %10, %13, %3
  %.099 = phi i64 [ -9223372036854775806, %3 ], [ -9223372036854775806, %7 ], [ -9223372036854775806, %10 ], [ -9223372036854775806, %13 ], [ -9223372036854775806, %34 ], [ -9223372036854775806, %39 ], [ -9223372036854775806, %._crit_edge ], [ -9223372036854775806, %67 ], [ -9223372036854775806, %32 ], [ -9223372036854775806, %20 ], [ -9223372036854775806, %17 ], [ -9223372036854775799, %84 ], [ -9223372036854775799, %90 ], [ 0, %105 ], [ 0, %132 ], [ 0, %130 ], [ -9223372036854775806, %53 ], [ -9223372036854775806, %54 ]
  call void @NetbufFree(ptr noundef %2) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #3
  ret i64 %.099
}

declare ptr @Ip6FindRouteCache(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @Ip6FindRouteEntry(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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 = !{!12, !7, i64 1}
!12 = !{!"", !13, i64 0, !14, i64 4}
!13 = !{!"", !7, i64 0, !7, i64 1, !9, i64 2}
!14 = !{!"int", !7, i64 0}
!15 = !{!6, !9, i64 4}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !14, i64 132}
!18 = !{!"", !14, i64 0, !19, i64 8, !20, i64 16, !7, i64 32, !21, i64 40, !21, i64 48, !7, i64 56, !21, i64 120, !14, i64 128, !14, i64 132, !7, i64 136}
!19 = !{!"long long", !7, i64 0}
!20 = !{!"_LIST_ENTRY", !21, i64 0, !21, i64 8}
!21 = !{!"any pointer", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!25, !21, i64 80}
!25 = !{!"_IP6_SERVICE", !14, i64 0, !26, i64 8, !19, i64 24, !19, i64 32, !20, i64 40, !20, i64 56, !21, i64 72, !21, i64 80, !27, i64 88, !10, i64 136, !29, i64 2168, !10, i64 2192, !7, i64 2208, !7, i64 2209, !7, i64 2210, !7, i64 2211, !7, i64 2212, !14, i64 2216, !14, i64 2220, !14, i64 2224, !14, i64 2228, !20, i64 2232, !20, i64 2248, !20, i64 2264, !20, i64 2280, !14, i64 2296, !7, i64 2300, !21, i64 2304, !7, i64 2312, !7, i64 2313, !14, i64 2316, !21, i64 2320, !21, i64 2328, !21, i64 2336, !21, i64 2344, !30, i64 2352, !31, i64 2372, !21, i64 3032, !21, i64 3040, !32, i64 3048, !21, i64 4176, !14, i64 4184, !14, i64 4188}
!26 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !21, i64 0, !21, i64 8}
!27 = !{!"", !14, i64 0, !21, i64 8, !21, i64 16, !28, i64 24}
!28 = !{!"", !21, i64 0, !19, i64 8, !7, i64 16}
!29 = !{!"", !19, i64 0, !20, i64 8}
!30 = !{!"", !14, i64 0, !14, 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}
!31 = !{!"", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, 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}
!32 = !{!"_IP6_CONFIG_INSTANCE", !14, i64 0, !7, i64 4, !20, i64 8, !9, i64 24, !33, i64 32, !10, i64 168, !14, i64 176, !34, i64 180, !7, i64 184, !35, i64 800, !35, i64 840, !36, i64 880, !21, i64 912, !21, i64 920, !21, i64 928, !21, i64 936, !7, i64 944, !14, i64 948, !21, i64 952, !14, i64 960, !21, i64 968, !14, i64 976, !37, i64 984, !39, i64 1040}
!33 = !{!"", !7, i64 0, !7, i64 64, !14, i64 68, !10, i64 72, !14, i64 104, !21, i64 112, !14, i64 120, !21, i64 128}
!34 = !{!"", !14, i64 0}
!35 = !{!"", !20, i64 0, !20, i64 16, !19, i64 32}
!36 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !21, i64 0, !21, i64 8, !21, i64 16, !21, i64 24}
!37 = !{!"_IP6_FORM_CALLBACK_INFO", !14, i64 0, !21, i64 8, !38, i64 16, !21, i64 40, !21, i64 48}
!38 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !21, i64 0, !21, i64 8, !21, i64 16}
!39 = !{!"", !14, i64 0, !34, i64 4, !10, i64 8, !20, i64 16, !14, i64 32, !20, i64 40, !14, i64 56, !20, i64 64, !14, i64 80}
!40 = !{!41, !19, i64 24}
!41 = !{!"", !20, i64 0, !19, i64 16, !19, i64 24, !10, i64 32, !10, i64 48, !10, i64 64}
!42 = !{!43, !14, i64 24}
!43 = !{!"", !20, i64 0, !19, i64 16, !14, i64 24, !7, i64 28, !10, i64 29, !10, i64 45}
!44 = !{!45, !14, i64 92}
!45 = !{!"_IP6_NEIGHBOR_ENTRY", !20, i64 0, !20, i64 16, !19, i64 32, !7, i64 40, !7, i64 41, !7, i64 42, !10, i64 43, !10, i64 59, !14, i64 92, !14, i64 96, !14, i64 100, !20, i64 104, !21, i64 120, !21, i64 128}
!46 = !{!45, !14, i64 100}
!47 = !{!45, !21, i64 128}
!48 = !{!45, !7, i64 40}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass