; 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_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_IPv6_ADDRESS = type { [16 x i8] }
%struct._LIST_ENTRY = type { ptr, ptr }
%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.EFI_MAC_ADDRESS = type { [32 x 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_DEFAULT_ROUTER = type { %struct._LIST_ENTRY, i64, i16, %struct.EFI_IPv6_ADDRESS, ptr }
%struct._IP6_PREFIX_LIST_ENTRY = type { %struct._LIST_ENTRY, i64, i32, i32, i8, %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] }

@.str = external hidden unnamed_addr constant [127 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [44 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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @Ip6NdTimerTicking(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct._IP6_SERVICE, ptr %9, i32 0, i32 24
  %11 = getelementptr inbounds %struct._LIST_ENTRY, ptr %10, i32 0, i32 0
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  store ptr %12, ptr %3, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct._LIST_ENTRY, ptr %13, i32 0, i32 0
  %15 = load ptr, ptr %14, align 8, !tbaa !30
  store ptr %15, ptr %4, align 8, !tbaa !5
  br label %16

16:                                               ; preds = %49, %1
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct._IP6_SERVICE, ptr %18, i32 0, i32 24
  %20 = icmp ne ptr %17, %19
  br i1 %20, label %21, label %54

21:                                               ; preds = %16
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = ptrtoint ptr %22 to i64
  %24 = sub i64 %23, 0
  %25 = inttoptr i64 %24 to ptr
  store ptr %25, ptr %5, align 8, !tbaa !5
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct._IP6_DEFAULT_ROUTER, ptr %26, i32 0, i32 2
  %28 = load i16, ptr %27, align 8, !tbaa !31
  %29 = zext i16 %28 to i32
  %30 = icmp ne i32 %29, 65535
  br i1 %30, label %31, label %48

31:                                               ; preds = %21
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._IP6_DEFAULT_ROUTER, ptr %32, i32 0, i32 2
  %34 = load i16, ptr %33, align 8, !tbaa !31
  %35 = zext i16 %34 to i32
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %44, label %37

37:                                               ; preds = %31
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._IP6_DEFAULT_ROUTER, ptr %38, i32 0, i32 2
  %40 = load i16, ptr %39, align 8, !tbaa !31
  %41 = add i16 %40, -1
  store i16 %41, ptr %39, align 8, !tbaa !31
  %42 = zext i16 %41 to i32
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %44, label %47

44:                                               ; preds = %37, %31
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  call void @Ip6DestroyDefaultRouter(ptr noundef %45, ptr noundef %46)
  br label %47

47:                                               ; preds = %44, %37
  br label %48

48:                                               ; preds = %47, %21
  br label %49

49:                                               ; preds = %48
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %50, ptr %3, align 8, !tbaa !5
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._LIST_ENTRY, ptr %51, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8, !tbaa !30
  store ptr %53, ptr %4, align 8, !tbaa !5
  br label %16, !llvm.loop !33

54:                                               ; preds = %16
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct._IP6_SERVICE, ptr %55, i32 0, i32 23
  %57 = getelementptr inbounds %struct._LIST_ENTRY, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !35
  store ptr %58, ptr %3, align 8, !tbaa !5
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._LIST_ENTRY, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !30
  store ptr %61, ptr %4, align 8, !tbaa !5
  br label %62

62:                                               ; preds = %108, %54
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._IP6_SERVICE, ptr %64, i32 0, i32 23
  %66 = icmp ne ptr %63, %65
  br i1 %66, label %67, label %113

67:                                               ; preds = %62
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = ptrtoint ptr %68 to i64
  %70 = sub i64 %69, 0
  %71 = inttoptr i64 %70 to ptr
  store ptr %71, ptr %6, align 8, !tbaa !5
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %72, i32 0, i32 2
  %74 = load i32, ptr %73, align 8, !tbaa !36
  %75 = icmp ne i32 %74, -1
  br i1 %75, label %76, label %107

76:                                               ; preds = %67
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %77, i32 0, i32 2
  %79 = load i32, ptr %78, align 8, !tbaa !36
  %80 = icmp ugt i32 %79, 0
  br i1 %80, label %81, label %103

81:                                               ; preds = %76
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %82, i32 0, i32 2
  %84 = load i32, ptr %83, align 8, !tbaa !36
  %85 = add i32 %84, -1
  store i32 %85, ptr %83, align 8, !tbaa !36
  %86 = icmp ugt i32 %85, 0
  br i1 %86, label %87, label %103

87:                                               ; preds = %81
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %88, i32 0, i32 3
  %90 = load i32, ptr %89, align 4, !tbaa !38
  %91 = icmp ne i32 %90, -1
  br i1 %91, label %92, label %102

92:                                               ; preds = %87
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %93, i32 0, i32 3
  %95 = load i32, ptr %94, align 4, !tbaa !38
  %96 = icmp ugt i32 %95, 0
  br i1 %96, label %97, label %102

97:                                               ; preds = %92
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %98, i32 0, i32 3
  %100 = load i32, ptr %99, align 4, !tbaa !38
  %101 = add i32 %100, -1
  store i32 %101, ptr %99, align 4, !tbaa !38
  br label %102

102:                                              ; preds = %97, %92, %87
  br label %106

103:                                              ; preds = %81, %76
  %104 = load ptr, ptr %2, align 8, !tbaa !5
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  call void @Ip6DestroyPrefixListEntry(ptr noundef %104, ptr noundef %105, i8 noundef zeroext 0, i8 noundef zeroext 1)
  br label %106

106:                                              ; preds = %103, %102
  br label %107

107:                                              ; preds = %106, %67
  br label %108

108:                                              ; preds = %107
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %109, ptr %3, align 8, !tbaa !5
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct._LIST_ENTRY, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !30
  store ptr %112, ptr %4, align 8, !tbaa !5
  br label %62, !llvm.loop !39

113:                                              ; preds = %62
  %114 = load ptr, ptr %2, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._IP6_SERVICE, ptr %114, i32 0, i32 22
  %116 = getelementptr inbounds %struct._LIST_ENTRY, ptr %115, i32 0, i32 0
  %117 = load ptr, ptr %116, align 8, !tbaa !40
  store ptr %117, ptr %3, align 8, !tbaa !5
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._LIST_ENTRY, ptr %118, i32 0, i32 0
  %120 = load ptr, ptr %119, align 8, !tbaa !30
  store ptr %120, ptr %4, align 8, !tbaa !5
  br label %121

121:                                              ; preds = %151, %113
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = load ptr, ptr %2, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._IP6_SERVICE, ptr %123, i32 0, i32 22
  %125 = icmp ne ptr %122, %124
  br i1 %125, label %126, label %156

126:                                              ; preds = %121
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = ptrtoint ptr %127 to i64
  %129 = sub i64 %128, 0
  %130 = inttoptr i64 %129 to ptr
  store ptr %130, ptr %6, align 8, !tbaa !5
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %131, i32 0, i32 2
  %133 = load i32, ptr %132, align 8, !tbaa !36
  %134 = icmp ne i32 %133, -1
  br i1 %134, label %135, label %150

135:                                              ; preds = %126
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %136, i32 0, i32 2
  %138 = load i32, ptr %137, align 8, !tbaa !36
  %139 = icmp eq i32 %138, 0
  br i1 %139, label %146, label %140

140:                                              ; preds = %135
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %141, i32 0, i32 2
  %143 = load i32, ptr %142, align 8, !tbaa !36
  %144 = add i32 %143, -1
  store i32 %144, ptr %142, align 8, !tbaa !36
  %145 = icmp eq i32 %144, 0
  br i1 %145, label %146, label %149

146:                                              ; preds = %140, %135
  %147 = load ptr, ptr %2, align 8, !tbaa !5
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  call void @Ip6DestroyPrefixListEntry(ptr noundef %147, ptr noundef %148, i8 noundef zeroext 1, i8 noundef zeroext 1)
  br label %149

149:                                              ; preds = %146, %140
  br label %150

150:                                              ; preds = %149, %126
  br label %151

151:                                              ; preds = %150
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %152, ptr %3, align 8, !tbaa !5
  %153 = load ptr, ptr %3, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct._LIST_ENTRY, ptr %153, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8, !tbaa !30
  store ptr %155, ptr %4, align 8, !tbaa !5
  br label %121, !llvm.loop !41

156:                                              ; preds = %121
  store i8 0, ptr %7, align 1, !tbaa !42
  br label %157

157:                                              ; preds = %224, %156
  %158 = load i8, ptr %7, align 1, !tbaa !42
  %159 = zext i8 %158 to i32
  %160 = icmp slt i32 %159, 31
  br i1 %160, label %161, label %227

161:                                              ; preds = %157
  br label %162

162:                                              ; preds = %212, %161
  %163 = load ptr, ptr %2, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct._IP6_SERVICE, ptr %163, i32 0, i32 7
  %165 = load ptr, ptr %164, align 8, !tbaa !43
  %166 = getelementptr inbounds %struct._IP6_ROUTE_TABLE, ptr %165, i32 0, i32 3
  %167 = getelementptr inbounds %struct.IP6_ROUTE_CACHE, ptr %166, i32 0, i32 1
  %168 = load i8, ptr %7, align 1, !tbaa !42
  %169 = zext i8 %168 to i64
  %170 = getelementptr inbounds [31 x i8], ptr %167, i64 0, i64 %169
  %171 = load i8, ptr %170, align 1, !tbaa !42
  %172 = zext i8 %171 to i32
  %173 = icmp sgt i32 %172, 32
  br i1 %173, label %174, label %223

174:                                              ; preds = %162
  %175 = load ptr, ptr %2, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct._IP6_SERVICE, ptr %175, i32 0, i32 7
  %177 = load ptr, ptr %176, align 8, !tbaa !43
  %178 = getelementptr inbounds %struct._IP6_ROUTE_TABLE, ptr %177, i32 0, i32 3
  %179 = getelementptr inbounds %struct.IP6_ROUTE_CACHE, ptr %178, i32 0, i32 0
  %180 = load i8, ptr %7, align 1, !tbaa !42
  %181 = zext i8 %180 to i64
  %182 = getelementptr inbounds [31 x %struct._LIST_ENTRY], ptr %179, i64 0, i64 %181
  %183 = call ptr @NetListRemoveTail(ptr noundef %182)
  store ptr %183, ptr %3, align 8, !tbaa !5
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = icmp eq ptr %184, null
  br i1 %185, label %186, label %187

186:                                              ; preds = %174
  br label %223

187:                                              ; preds = %174
  %188 = load ptr, ptr %3, align 8, !tbaa !5
  %189 = ptrtoint ptr %188 to i64
  %190 = sub i64 %189, 0
  %191 = inttoptr i64 %190 to ptr
  store ptr %191, ptr %8, align 8, !tbaa !5
  %192 = load ptr, ptr %8, align 8, !tbaa !5
  call void @Ip6FreeRouteCacheEntry(ptr noundef %192)
  br label %193

193:                                              ; preds = %187
  %194 = call zeroext i8 @DebugAssertEnabled()
  %195 = icmp ne i8 %194, 0
  br i1 %195, label %196, label %210

196:                                              ; preds = %193
  %197 = load ptr, ptr %2, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct._IP6_SERVICE, ptr %197, i32 0, i32 7
  %199 = load ptr, ptr %198, align 8, !tbaa !43
  %200 = getelementptr inbounds %struct._IP6_ROUTE_TABLE, ptr %199, i32 0, i32 3
  %201 = getelementptr inbounds %struct.IP6_ROUTE_CACHE, ptr %200, i32 0, i32 1
  %202 = load i8, ptr %7, align 1, !tbaa !42
  %203 = zext i8 %202 to i64
  %204 = getelementptr inbounds [31 x i8], ptr %201, i64 0, i64 %203
  %205 = load i8, ptr %204, align 1, !tbaa !42
  %206 = zext i8 %205 to i32
  %207 = icmp sgt i32 %206, 0
  br i1 %207, label %209, label %208

208:                                              ; preds = %196
  call void @DebugAssert(ptr noundef @.str, i64 noundef 3153, ptr noundef @.str.20)
  br label %209

209:                                              ; preds = %208, %196
  br label %210

210:                                              ; preds = %209, %193
  br label %211

211:                                              ; preds = %210
  br label %212

212:                                              ; preds = %211
  %213 = load ptr, ptr %2, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct._IP6_SERVICE, ptr %213, i32 0, i32 7
  %215 = load ptr, ptr %214, align 8, !tbaa !43
  %216 = getelementptr inbounds %struct._IP6_ROUTE_TABLE, ptr %215, i32 0, i32 3
  %217 = getelementptr inbounds %struct.IP6_ROUTE_CACHE, ptr %216, i32 0, i32 1
  %218 = load i8, ptr %7, align 1, !tbaa !42
  %219 = zext i8 %218 to i64
  %220 = getelementptr inbounds [31 x i8], ptr %217, i64 0, i64 %219
  %221 = load i8, ptr %220, align 1, !tbaa !42
  %222 = add i8 %221, -1
  store i8 %222, ptr %220, align 1, !tbaa !42
  br label %162, !llvm.loop !44

223:                                              ; preds = %186, %162
  br label %224

224:                                              ; preds = %223
  %225 = load i8, ptr %7, align 1, !tbaa !42
  %226 = add i8 %225, 1
  store i8 %226, ptr %7, align 1, !tbaa !42
  br label %157, !llvm.loop !45

227:                                              ; preds = %157
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret void
}

declare ptr @NetListRemoveTail(ptr noundef) #1

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


; 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._LIST_ENTRY = type { ptr, ptr }

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #0

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @Ip6NdTimerTicking(ptr noundef %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 2280
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %.not73 = icmp eq ptr %3, %2
  br i1 %.not73, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1, %10
  %.074 = phi ptr [ %.05275, %10 ], [ %3, %1 ]
  %.05275 = load ptr, ptr %.074, align 8, !tbaa !29
  %4 = getelementptr inbounds i8, ptr %.074, i64 24
  %5 = load i16, ptr %4, align 8, !tbaa !30
  switch i16 %5, label %6 [
    i16 -1, label %10
    i16 0, label %9
  ]

6:                                                ; preds = %.lr.ph
  %7 = add i16 %5, -1
  store i16 %7, ptr %4, align 8, !tbaa !30
  %8 = icmp eq i16 %7, 0
  br i1 %8, label %9, label %10

9:                                                ; preds = %.lr.ph, %6
  tail call void @Ip6DestroyDefaultRouter(ptr noundef %0, ptr noundef nonnull %.074)
  br label %10

10:                                               ; preds = %.lr.ph, %9, %6
  %.not = icmp eq ptr %.05275, %2
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !32

._crit_edge:                                      ; preds = %10, %1
  %11 = getelementptr inbounds i8, ptr %0, i64 2264
  %12 = load ptr, ptr %11, align 8, !tbaa !34
  %.not6077 = icmp eq ptr %12, %11
  br i1 %.not6077, label %._crit_edge82, label %.lr.ph81

.lr.ph81:                                         ; preds = %._crit_edge, %23
  %.178 = phi ptr [ %.15379, %23 ], [ %12, %._crit_edge ]
  %.15379 = load ptr, ptr %.178, align 8, !tbaa !29
  %13 = getelementptr inbounds i8, ptr %.178, i64 24
  %14 = load i32, ptr %13, align 8, !tbaa !35
  switch i32 %14, label %15 [
    i32 -1, label %23
    i32 0, label %22
  ]

15:                                               ; preds = %.lr.ph81
  %16 = add i32 %14, -1
  store i32 %16, ptr %13, align 8, !tbaa !35
  %.not67 = icmp eq i32 %16, 0
  br i1 %.not67, label %22, label %17

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %.178, i64 28
  %19 = load i32, ptr %18, align 4, !tbaa !37
  switch i32 %19, label %20 [
    i32 -1, label %23
    i32 0, label %23
  ]

20:                                               ; preds = %17
  %21 = add i32 %19, -1
  store i32 %21, ptr %18, align 4, !tbaa !37
  br label %23

22:                                               ; preds = %.lr.ph81, %15
  tail call void @Ip6DestroyPrefixListEntry(ptr noundef %0, ptr noundef nonnull %.178, i8 noundef zeroext 0, i8 noundef zeroext 1)
  br label %23

23:                                               ; preds = %17, %17, %.lr.ph81, %20, %22
  %.not60 = icmp eq ptr %.15379, %11
  br i1 %.not60, label %._crit_edge82, label %.lr.ph81, !llvm.loop !38

._crit_edge82:                                    ; preds = %23, %._crit_edge
  %24 = getelementptr inbounds i8, ptr %0, i64 2248
  %25 = load ptr, ptr %24, align 8, !tbaa !39
  %.not6184 = icmp eq ptr %25, %24
  br i1 %.not6184, label %.preheader71, label %.lr.ph88

.preheader71:                                     ; preds = %33, %._crit_edge82
  %26 = getelementptr inbounds i8, ptr %0, i64 80
  br label %.preheader

.lr.ph88:                                         ; preds = %._crit_edge82, %33
  %.285 = phi ptr [ %.25486, %33 ], [ %25, %._crit_edge82 ]
  %.25486 = load ptr, ptr %.285, align 8, !tbaa !29
  %27 = getelementptr inbounds i8, ptr %.285, i64 24
  %28 = load i32, ptr %27, align 8, !tbaa !35
  switch i32 %28, label %29 [
    i32 -1, label %33
    i32 0, label %32
  ]

29:                                               ; preds = %.lr.ph88
  %30 = add i32 %28, -1
  store i32 %30, ptr %27, align 8, !tbaa !35
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %33

32:                                               ; preds = %.lr.ph88, %29
  tail call void @Ip6DestroyPrefixListEntry(ptr noundef %0, ptr noundef nonnull %.285, i8 noundef zeroext 1, i8 noundef zeroext 1)
  br label %33

33:                                               ; preds = %.lr.ph88, %32, %29
  %.not61 = icmp eq ptr %.25486, %24
  br i1 %.not61, label %.preheader71, label %.lr.ph88, !llvm.loop !40

.preheader:                                       ; preds = %.preheader71, %._crit_edge90
  %indvars.iv = phi i64 [ 0, %.preheader71 ], [ %indvars.iv.next, %._crit_edge90 ]
  %34 = load ptr, ptr %26, align 8, !tbaa !41
  %35 = getelementptr inbounds i8, ptr %34, i64 2576
  %36 = getelementptr inbounds [31 x i8], ptr %35, i64 0, i64 %indvars.iv
  %37 = load i8, ptr %36, align 1, !tbaa !42
  %38 = icmp ugt i8 %37, 32
  br i1 %38, label %.lr.ph89, label %._crit_edge90

.lr.ph89:                                         ; preds = %.preheader, %51
  %39 = phi ptr [ %57, %51 ], [ %34, %.preheader ]
  %40 = getelementptr inbounds i8, ptr %39, i64 2080
  %41 = getelementptr inbounds [31 x %struct._LIST_ENTRY], ptr %40, i64 0, i64 %indvars.iv
  %42 = tail call ptr @NetListRemoveTail(ptr noundef nonnull %41) #2
  %43 = icmp eq ptr %42, null
  br i1 %43, label %._crit_edge90, label %44

44:                                               ; preds = %.lr.ph89
  tail call void @Ip6FreeRouteCacheEntry(ptr noundef nonnull %42) #2
  %45 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not62 = icmp eq i8 %45, 0
  %.pre94 = load ptr, ptr %26, align 8, !tbaa !41
  br i1 %.not62, label %51, label %46

46:                                               ; preds = %44
  %47 = getelementptr inbounds i8, ptr %.pre94, i64 2576
  %48 = getelementptr inbounds [31 x i8], ptr %47, i64 0, i64 %indvars.iv
  %49 = load i8, ptr %48, align 1, !tbaa !42
  %.not63 = icmp eq i8 %49, 0
  br i1 %.not63, label %50, label %51

50:                                               ; preds = %46
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 3153, ptr noundef nonnull @.str.20) #2
  %.pre = load ptr, ptr %26, align 8, !tbaa !41
  br label %51

51:                                               ; preds = %46, %50, %44
  %52 = phi ptr [ %.pre94, %46 ], [ %.pre, %50 ], [ %.pre94, %44 ]
  %53 = getelementptr inbounds i8, ptr %52, i64 2576
  %54 = getelementptr inbounds [31 x i8], ptr %53, i64 0, i64 %indvars.iv
  %55 = load i8, ptr %54, align 1, !tbaa !42
  %56 = add i8 %55, -1
  store i8 %56, ptr %54, align 1, !tbaa !42
  %57 = load ptr, ptr %26, align 8, !tbaa !41
  %58 = getelementptr inbounds i8, ptr %57, i64 2576
  %59 = getelementptr inbounds [31 x i8], ptr %58, i64 0, i64 %indvars.iv
  %60 = load i8, ptr %59, align 1, !tbaa !42
  %61 = icmp ugt i8 %60, 32
  br i1 %61, label %.lr.ph89, label %._crit_edge90, !llvm.loop !43

._crit_edge90:                                    ; preds = %.lr.ph89, %51, %.preheader
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 31
  br i1 %exitcond.not, label %62, label %.preheader, !llvm.loop !44

62:                                               ; preds = %._crit_edge90
  ret void
}

declare ptr @NetListRemoveTail(ptr noundef) local_unnamed_addr #0

declare void @Ip6FreeRouteCacheEntry(ptr noundef) local_unnamed_addr #0

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass