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

; 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_IP6_ICMP_TYPE = type { i8, i8 }
%struct.EFI_BOOT_SERVICES = type { %struct.EFI_TABLE_HEADER, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }
%struct._IP6_PROTOCOL = type { i32, %struct._EFI_IP6_PROTOCOL, ptr, i64, ptr, %struct._LIST_ENTRY, i8, %struct.NET_MAP, %struct.NET_MAP, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct.EFI_LOCK, ptr, %struct._LIST_ENTRY, ptr, i32, %struct.EFI_IP6_CONFIG_DATA, i8 }
%struct._EFI_IP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%struct.EFI_LOCK = type { i64, i64, i32 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_IP6_CONFIG_DATA = type { i8, i8, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS, i8, i8, i32, i32, i32 }
%struct.EFI_IPv6_ADDRESS = type { [16 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.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._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.EFI_IP6_MODE_DATA = type { i8, i32, %struct.EFI_IP6_CONFIG_DATA, i8, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr }
%struct._IP6_INTERFACE = type { i32, %struct._LIST_ENTRY, i64, %struct._LIST_ENTRY, i32, i8, ptr, ptr, ptr, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i32, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i8 }
%struct._EFI_MANAGED_NETWORK_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@gBS = external global ptr, align 8
@.str = external hidden unnamed_addr constant [129 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@mIp6SupportedIcmp = external global [0 x %struct.EFI_IP6_ICMP_TYPE], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @EfiIp6GetModeData(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca i64, 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 ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, 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 8, ptr %15) #3
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %20

19:                                               ; preds = %4
  store i64 -9223372036854775806, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %293

20:                                               ; preds = %4
  %21 = load ptr, ptr @gBS, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %21, i32 0, i32 1
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  %24 = call i64 %23(i64 noundef 8)
  store i64 %24, ptr %15, align 8, !tbaa !14
  %25 = call zeroext i8 @DebugAssertEnabled()
  %26 = zext i8 %25 to i32
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %38

28:                                               ; preds = %20
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = ptrtoint ptr %29 to i64
  %31 = sub i64 %30, ptrtoint (ptr getelementptr inbounds (%struct._IP6_PROTOCOL, ptr null, i32 0, i32 1) to i64)
  %32 = inttoptr i64 %31 to ptr
  %33 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !15
  %35 = icmp ne i32 %34, 1345736777
  br i1 %35, label %36, label %38

36:                                               ; preds = %28
  call void @DebugAssert(ptr noundef @.str, i64 noundef 70, ptr noundef @.str.1)
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  br label %43

38:                                               ; preds = %28, %20
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = ptrtoint ptr %39 to i64
  %41 = sub i64 %40, ptrtoint (ptr getelementptr inbounds (%struct._IP6_PROTOCOL, ptr null, i32 0, i32 1) to i64)
  %42 = inttoptr i64 %41 to ptr
  br label %43

43:                                               ; preds = %38, %36
  %44 = phi ptr [ %37, %36 ], [ %42, %38 ]
  store ptr %44, ptr %10, align 8, !tbaa !5
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %45, i32 0, i32 4
  %47 = load ptr, ptr %46, align 8, !tbaa !23
  store ptr %47, ptr %11, align 8, !tbaa !5
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %48, i32 0, i32 12
  %50 = load ptr, ptr %49, align 8, !tbaa !24
  store ptr %50, ptr %12, align 8, !tbaa !5
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._IP6_SERVICE, ptr %51, i32 0, i32 13
  %53 = load i8, ptr %52, align 1, !tbaa !25
  %54 = icmp ne i8 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %43
  store i64 -9223372036854775806, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %293

56:                                               ; preds = %43
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = icmp ne ptr %57, null
  br i1 %58, label %59, label %216

59:                                               ; preds = %56
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %60, i32 0, i32 3
  %62 = load i64, ptr %61, align 8, !tbaa !41
  %63 = icmp eq i64 %62, 1
  %64 = zext i1 %63 to i32
  %65 = trunc i32 %64 to i8
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %66, i32 0, i32 0
  store i8 %65, ptr %67, align 8, !tbaa !42
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._IP6_SERVICE, ptr %68, i32 0, i32 41
  %70 = load i32, ptr %69, align 8, !tbaa !44
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %71, i32 0, i32 1
  store i32 %70, ptr %72, align 4, !tbaa !45
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %73, i32 0, i32 2
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %75, i32 0, i32 16
  %77 = call ptr @CopyMem(ptr noundef %74, ptr noundef %76, i64 noundef 52)
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %78, i32 0, i32 3
  store i8 0, ptr %79, align 4, !tbaa !46
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %80, i32 0, i32 4
  store i32 0, ptr %81, align 8, !tbaa !47
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %82, i32 0, i32 5
  store ptr null, ptr %83, align 8, !tbaa !48
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %84, i32 0, i32 15
  %86 = load i32, ptr %85, align 8, !tbaa !49
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %87, i32 0, i32 6
  store i32 %86, ptr %88, align 8, !tbaa !50
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %89, i32 0, i32 7
  store ptr null, ptr %90, align 8, !tbaa !51
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %91, i32 0, i32 8
  store i32 0, ptr %92, align 8, !tbaa !52
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %93, i32 0, i32 9
  store ptr null, ptr %94, align 8, !tbaa !53
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %95, i32 0, i32 10
  store i32 0, ptr %96, align 8, !tbaa !54
  %97 = load ptr, ptr %7, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %97, i32 0, i32 11
  store ptr null, ptr %98, align 8, !tbaa !55
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %99, i32 0, i32 12
  store i32 0, ptr %100, align 8, !tbaa !56
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %101, i32 0, i32 13
  store ptr null, ptr %102, align 8, !tbaa !57
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %103, i32 0, i32 14
  store i32 23, ptr %104, align 8, !tbaa !58
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %105, i32 0, i32 14
  %107 = load i32, ptr %106, align 8, !tbaa !58
  %108 = zext i32 %107 to i64
  %109 = mul i64 %108, 2
  %110 = call ptr @AllocateCopyPool(i64 noundef %109, ptr noundef @mIp6SupportedIcmp)
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %111, i32 0, i32 15
  store ptr %110, ptr %112, align 8, !tbaa !59
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %113, i32 0, i32 15
  %115 = load ptr, ptr %114, align 8, !tbaa !59
  %116 = icmp eq ptr %115, null
  br i1 %116, label %117, label %118

117:                                              ; preds = %59
  store i64 -9223372036854775799, ptr %14, align 8, !tbaa !14
  br label %228

118:                                              ; preds = %59
  %119 = load ptr, ptr %11, align 8, !tbaa !5
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %120, i32 0, i32 4
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %122, i32 0, i32 5
  %124 = call i64 @Ip6BuildEfiAddressList(ptr noundef %119, ptr noundef %121, ptr noundef %123)
  store i64 %124, ptr %14, align 8, !tbaa !14
  %125 = load i64, ptr %14, align 8, !tbaa !14
  %126 = icmp slt i64 %125, 0
  br i1 %126, label %127, label %128

127:                                              ; preds = %118
  br label %228

128:                                              ; preds = %118
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %129, i32 0, i32 0
  %131 = load i8, ptr %130, align 8, !tbaa !42
  %132 = icmp ne i8 %131, 0
  br i1 %132, label %133, label %166

133:                                              ; preds = %128
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %134, i32 0, i32 2
  store ptr %135, ptr %13, align 8, !tbaa !5
  %136 = load ptr, ptr %12, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct._IP6_INTERFACE, ptr %136, i32 0, i32 5
  %138 = load i8, ptr %137, align 4, !tbaa !60
  %139 = zext i8 %138 to i32
  %140 = icmp ne i32 %139, 0
  br i1 %140, label %147, label %141

141:                                              ; preds = %133
  %142 = load ptr, ptr %13, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.EFI_IP6_CONFIG_DATA, ptr %142, i32 0, i32 4
  %144 = call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef %143)
  %145 = zext i8 %144 to i32
  %146 = icmp ne i32 %145, 0
  br i1 %146, label %147, label %150

147:                                              ; preds = %141, %133
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %148, i32 0, i32 3
  store i8 1, ptr %149, align 4, !tbaa !46
  br label %153

150:                                              ; preds = %141
  %151 = load ptr, ptr %7, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %151, i32 0, i32 3
  store i8 0, ptr %152, align 4, !tbaa !46
  br label %153

153:                                              ; preds = %150, %147
  %154 = load ptr, ptr %11, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct._IP6_SERVICE, ptr %154, i32 0, i32 7
  %156 = load ptr, ptr %155, align 8, !tbaa !62
  %157 = load ptr, ptr %7, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %157, i32 0, i32 8
  %159 = load ptr, ptr %7, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %159, i32 0, i32 9
  %161 = call i64 @Ip6BuildEfiRouteTable(ptr noundef %156, ptr noundef %158, ptr noundef %160)
  store i64 %161, ptr %14, align 8, !tbaa !14
  %162 = load i64, ptr %14, align 8, !tbaa !14
  %163 = icmp slt i64 %162, 0
  br i1 %163, label %164, label %165

164:                                              ; preds = %153
  br label %228

165:                                              ; preds = %153
  br label %166

166:                                              ; preds = %165, %128
  %167 = load ptr, ptr %7, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %167, i32 0, i32 3
  %169 = load i8, ptr %168, align 4, !tbaa !46
  %170 = icmp ne i8 %169, 0
  br i1 %170, label %171, label %215

171:                                              ; preds = %166
  %172 = load ptr, ptr %10, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %172, i32 0, i32 15
  %174 = load i32, ptr %173, align 8, !tbaa !49
  %175 = icmp ne i32 %174, 0
  br i1 %175, label %176, label %194

176:                                              ; preds = %171
  %177 = load ptr, ptr %10, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %177, i32 0, i32 15
  %179 = load i32, ptr %178, align 8, !tbaa !49
  %180 = zext i32 %179 to i64
  %181 = mul i64 %180, 16
  %182 = load ptr, ptr %10, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %182, i32 0, i32 14
  %184 = load ptr, ptr %183, align 8, !tbaa !63
  %185 = call ptr @AllocateCopyPool(i64 noundef %181, ptr noundef %184)
  %186 = load ptr, ptr %7, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %186, i32 0, i32 7
  store ptr %185, ptr %187, align 8, !tbaa !51
  %188 = load ptr, ptr %7, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %188, i32 0, i32 7
  %190 = load ptr, ptr %189, align 8, !tbaa !51
  %191 = icmp eq ptr %190, null
  br i1 %191, label %192, label %193

192:                                              ; preds = %176
  store i64 -9223372036854775799, ptr %14, align 8, !tbaa !14
  br label %228

193:                                              ; preds = %176
  br label %194

194:                                              ; preds = %193, %171
  %195 = load ptr, ptr %10, align 8, !tbaa !5
  %196 = load ptr, ptr %7, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %196, i32 0, i32 10
  %198 = load ptr, ptr %7, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %198, i32 0, i32 11
  %200 = call i64 @Ip6BuildEfiNeighborCache(ptr noundef %195, ptr noundef %197, ptr noundef %199)
  store i64 %200, ptr %14, align 8, !tbaa !14
  %201 = load i64, ptr %14, align 8, !tbaa !14
  %202 = icmp slt i64 %201, 0
  br i1 %202, label %203, label %204

203:                                              ; preds = %194
  br label %228

204:                                              ; preds = %194
  %205 = load ptr, ptr %10, align 8, !tbaa !5
  %206 = load ptr, ptr %7, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %206, i32 0, i32 12
  %208 = load ptr, ptr %7, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %208, i32 0, i32 13
  %210 = call i64 @Ip6BuildPrefixTable(ptr noundef %205, ptr noundef %207, ptr noundef %209)
  store i64 %210, ptr %14, align 8, !tbaa !14
  %211 = load i64, ptr %14, align 8, !tbaa !14
  %212 = icmp slt i64 %211, 0
  br i1 %212, label %213, label %214

213:                                              ; preds = %204
  br label %228

214:                                              ; preds = %204
  br label %215

215:                                              ; preds = %214, %166
  br label %216

216:                                              ; preds = %215, %56
  %217 = load ptr, ptr %11, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct._IP6_SERVICE, ptr %217, i32 0, i32 34
  %219 = load ptr, ptr %218, align 8, !tbaa !64
  %220 = getelementptr inbounds %struct._EFI_MANAGED_NETWORK_PROTOCOL, ptr %219, i32 0, i32 0
  %221 = load ptr, ptr %220, align 8, !tbaa !65
  %222 = load ptr, ptr %11, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct._IP6_SERVICE, ptr %222, i32 0, i32 34
  %224 = load ptr, ptr %223, align 8, !tbaa !64
  %225 = load ptr, ptr %8, align 8, !tbaa !5
  %226 = load ptr, ptr %9, align 8, !tbaa !5
  %227 = call i64 %221(ptr noundef %224, ptr noundef %225, ptr noundef %226)
  store i64 %227, ptr %14, align 8, !tbaa !14
  br label %287

228:                                              ; preds = %213, %203, %192, %164, %127, %117
  %229 = load ptr, ptr %7, align 8, !tbaa !5
  %230 = icmp ne ptr %229, null
  br i1 %230, label %231, label %286

231:                                              ; preds = %228
  %232 = load ptr, ptr %7, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %232, i32 0, i32 5
  %234 = load ptr, ptr %233, align 8, !tbaa !48
  %235 = icmp ne ptr %234, null
  br i1 %235, label %236, label %240

236:                                              ; preds = %231
  %237 = load ptr, ptr %7, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %237, i32 0, i32 5
  %239 = load ptr, ptr %238, align 8, !tbaa !48
  call void @FreePool(ptr noundef %239)
  br label %240

240:                                              ; preds = %236, %231
  %241 = load ptr, ptr %7, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %241, i32 0, i32 7
  %243 = load ptr, ptr %242, align 8, !tbaa !51
  %244 = icmp ne ptr %243, null
  br i1 %244, label %245, label %249

245:                                              ; preds = %240
  %246 = load ptr, ptr %7, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %246, i32 0, i32 7
  %248 = load ptr, ptr %247, align 8, !tbaa !51
  call void @FreePool(ptr noundef %248)
  br label %249

249:                                              ; preds = %245, %240
  %250 = load ptr, ptr %7, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %250, i32 0, i32 9
  %252 = load ptr, ptr %251, align 8, !tbaa !53
  %253 = icmp ne ptr %252, null
  br i1 %253, label %254, label %258

254:                                              ; preds = %249
  %255 = load ptr, ptr %7, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %255, i32 0, i32 9
  %257 = load ptr, ptr %256, align 8, !tbaa !53
  call void @FreePool(ptr noundef %257)
  br label %258

258:                                              ; preds = %254, %249
  %259 = load ptr, ptr %7, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %259, i32 0, i32 11
  %261 = load ptr, ptr %260, align 8, !tbaa !55
  %262 = icmp ne ptr %261, null
  br i1 %262, label %263, label %267

263:                                              ; preds = %258
  %264 = load ptr, ptr %7, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %264, i32 0, i32 11
  %266 = load ptr, ptr %265, align 8, !tbaa !55
  call void @FreePool(ptr noundef %266)
  br label %267

267:                                              ; preds = %263, %258
  %268 = load ptr, ptr %7, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %268, i32 0, i32 13
  %270 = load ptr, ptr %269, align 8, !tbaa !57
  %271 = icmp ne ptr %270, null
  br i1 %271, label %272, label %276

272:                                              ; preds = %267
  %273 = load ptr, ptr %7, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %273, i32 0, i32 13
  %275 = load ptr, ptr %274, align 8, !tbaa !57
  call void @FreePool(ptr noundef %275)
  br label %276

276:                                              ; preds = %272, %267
  %277 = load ptr, ptr %7, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %277, i32 0, i32 15
  %279 = load ptr, ptr %278, align 8, !tbaa !59
  %280 = icmp ne ptr %279, null
  br i1 %280, label %281, label %285

281:                                              ; preds = %276
  %282 = load ptr, ptr %7, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %282, i32 0, i32 15
  %284 = load ptr, ptr %283, align 8, !tbaa !59
  call void @FreePool(ptr noundef %284)
  br label %285

285:                                              ; preds = %281, %276
  br label %286

286:                                              ; preds = %285, %228
  br label %287

287:                                              ; preds = %286, %216
  %288 = load ptr, ptr @gBS, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %288, i32 0, i32 2
  %290 = load ptr, ptr %289, align 8, !tbaa !67
  %291 = load i64, ptr %15, align 8, !tbaa !14
  call void %290(i64 noundef %291)
  %292 = load i64, ptr %14, align 8, !tbaa !14
  store i64 %292, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %293

293:                                              ; preds = %287, %55, %19
  call void @llvm.lifetime.end.p0(i64 8, 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 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  %294 = load i64, ptr %5, align 8
  ret i64 %294
}

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

declare zeroext i8 @DebugAssertEnabled() #2

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

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

declare ptr @AllocateCopyPool(i64 noundef, ptr noundef) #2

declare i64 @Ip6BuildEfiAddressList(ptr noundef, ptr noundef, ptr noundef) #2

declare zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef) #2

declare i64 @Ip6BuildEfiRouteTable(ptr noundef, ptr noundef, ptr noundef) #2

declare i64 @Ip6BuildEfiNeighborCache(ptr noundef, ptr noundef, ptr noundef) #2

declare i64 @Ip6BuildPrefixTable(ptr noundef, ptr noundef, ptr noundef) #2

declare void @FreePool(ptr noundef) #2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 24}
!10 = !{!"", !11, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368}
!11 = !{!"", !12, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !12, i64 0}
!15 = !{!16, !13, i64 0}
!16 = !{!"_IP6_PROTOCOL", !13, i64 0, !17, i64 8, !6, i64 80, !12, i64 88, !6, i64 96, !18, i64 104, !7, i64 120, !19, i64 128, !19, i64 168, !18, i64 208, !18, i64 224, !20, i64 240, !6, i64 264, !18, i64 272, !6, i64 288, !13, i64 296, !21, i64 300, !7, i64 352}
!17 = !{!"_EFI_IP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!18 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!19 = !{!"", !18, i64 0, !18, i64 16, !12, i64 32}
!20 = !{!"", !12, i64 0, !12, i64 8, !13, i64 16}
!21 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !22, i64 4, !22, i64 20, !7, i64 36, !7, i64 37, !13, i64 40, !13, i64 44, !13, i64 48}
!22 = !{!"", !7, i64 0}
!23 = !{!16, !6, i64 96}
!24 = !{!16, !6, i64 264}
!25 = !{!26, !7, i64 2209}
!26 = !{!"_IP6_SERVICE", !13, i64 0, !27, i64 8, !12, i64 24, !12, i64 32, !18, i64 40, !18, i64 56, !6, i64 72, !6, i64 80, !28, i64 88, !22, i64 136, !30, i64 2168, !22, i64 2192, !7, i64 2208, !7, i64 2209, !7, i64 2210, !7, i64 2211, !7, i64 2212, !13, i64 2216, !13, i64 2220, !13, i64 2224, !13, i64 2228, !18, i64 2232, !18, i64 2248, !18, i64 2264, !18, i64 2280, !13, i64 2296, !7, i64 2300, !6, i64 2304, !7, i64 2312, !7, i64 2313, !13, i64 2316, !6, i64 2320, !6, i64 2328, !6, i64 2336, !6, i64 2344, !31, i64 2352, !33, i64 2372, !6, i64 3032, !6, i64 3040, !34, i64 3048, !6, i64 4176, !13, i64 4184, !13, i64 4188}
!27 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!28 = !{!"", !13, i64 0, !6, i64 8, !6, i64 16, !29, i64 24}
!29 = !{!"", !6, i64 0, !12, i64 8, !7, i64 16}
!30 = !{!"", !12, i64 0, !18, i64 8}
!31 = !{!"", !13, i64 0, !13, i64 4, !32, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!32 = !{!"short", !7, i64 0}
!33 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !7, i64 40, !22, i64 552, !22, i64 584, !22, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!34 = !{!"_IP6_CONFIG_INSTANCE", !13, i64 0, !7, i64 4, !18, i64 8, !32, i64 24, !35, i64 32, !22, i64 168, !13, i64 176, !36, i64 180, !7, i64 184, !19, i64 800, !19, i64 840, !37, i64 880, !6, i64 912, !6, i64 920, !6, i64 928, !6, i64 936, !7, i64 944, !13, i64 948, !6, i64 952, !13, i64 960, !6, i64 968, !13, i64 976, !38, i64 984, !40, i64 1040}
!35 = !{!"", !7, i64 0, !7, i64 64, !13, i64 68, !22, i64 72, !13, i64 104, !6, i64 112, !13, i64 120, !6, i64 128}
!36 = !{!"", !13, i64 0}
!37 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!38 = !{!"_IP6_FORM_CALLBACK_INFO", !13, i64 0, !6, i64 8, !39, i64 16, !6, i64 40, !6, i64 48}
!39 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!40 = !{!"", !13, i64 0, !36, i64 4, !22, i64 8, !18, i64 16, !13, i64 32, !18, i64 40, !13, i64 56, !18, i64 64, !13, i64 80}
!41 = !{!16, !12, i64 88}
!42 = !{!43, !7, i64 0}
!43 = !{!"", !7, i64 0, !13, i64 4, !21, i64 8, !7, i64 60, !13, i64 64, !6, i64 72, !13, i64 80, !6, i64 88, !13, i64 96, !6, i64 104, !13, i64 112, !6, i64 120, !13, i64 128, !6, i64 136, !13, i64 144, !6, i64 152}
!44 = !{!26, !13, i64 4184}
!45 = !{!43, !13, i64 4}
!46 = !{!43, !7, i64 60}
!47 = !{!43, !13, i64 64}
!48 = !{!43, !6, i64 72}
!49 = !{!16, !13, i64 296}
!50 = !{!43, !13, i64 80}
!51 = !{!43, !6, i64 88}
!52 = !{!43, !13, i64 96}
!53 = !{!43, !6, i64 104}
!54 = !{!43, !13, i64 112}
!55 = !{!43, !6, i64 120}
!56 = !{!43, !13, i64 128}
!57 = !{!43, !6, i64 136}
!58 = !{!43, !13, i64 144}
!59 = !{!43, !6, i64 152}
!60 = !{!61, !7, i64 52}
!61 = !{!"_IP6_INTERFACE", !13, i64 0, !18, i64 8, !12, i64 24, !18, i64 32, !13, i64 48, !7, i64 52, !6, i64 56, !6, i64 64, !6, i64 72, !18, i64 80, !18, i64 96, !13, i64 112, !18, i64 120, !18, i64 136, !18, i64 152, !7, i64 168}
!62 = !{!26, !6, i64 80}
!63 = !{!16, !6, i64 288}
!64 = !{!26, !6, i64 2344}
!65 = !{!66, !6, i64 0}
!66 = !{!"_EFI_MANAGED_NETWORK_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!67 = !{!10, !6, i64 32}


; 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_IP6_ICMP_TYPE = type { i8, i8 }

@gBS = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [129 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@mIp6SupportedIcmp = external global [0 x %struct.EFI_IP6_ICMP_TYPE], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @EfiIp6GetModeData(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = icmp eq ptr %0, null
  br i1 %5, label %111, label %6

6:                                                ; preds = %4
  %7 = load ptr, ptr @gBS, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 24
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = tail call i64 %9(i64 noundef 8) #2
  %11 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %11, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre105 = add i64 %.pre, -8
  %.pre107 = inttoptr i64 %.pre105 to ptr
  br i1 %.not, label %._crit_edge, label %12

12:                                               ; preds = %6
  %13 = load i32, ptr %.pre107, align 8, !tbaa !14
  %.not91 = icmp eq i32 %13, 1345736777
  br i1 %.not91, label %._crit_edge, label %14

14:                                               ; preds = %12
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 70, ptr noundef nonnull @.str.1) #2
  br label %._crit_edge

._crit_edge:                                      ; preds = %6, %12, %14
  %15 = phi ptr [ %0, %14 ], [ %.pre107, %12 ], [ %.pre107, %6 ]
  %16 = getelementptr inbounds i8, ptr %15, i64 96
  %17 = load ptr, ptr %16, align 8, !tbaa !22
  %18 = getelementptr inbounds i8, ptr %15, i64 264
  %19 = load ptr, ptr %18, align 8, !tbaa !23
  %20 = getelementptr inbounds i8, ptr %17, i64 2209
  %21 = load i8, ptr %20, align 1, !tbaa !24
  %.not92 = icmp eq i8 %21, 0
  br i1 %.not92, label %22, label %111

22:                                               ; preds = %._crit_edge
  %.not93 = icmp eq ptr %1, null
  br i1 %.not93, label %84, label %23

23:                                               ; preds = %22
  %24 = getelementptr inbounds i8, ptr %15, i64 88
  %25 = load i64, ptr %24, align 8, !tbaa !40
  %26 = icmp eq i64 %25, 1
  %27 = zext i1 %26 to i8
  store i8 %27, ptr %1, align 8, !tbaa !41
  %28 = getelementptr inbounds i8, ptr %17, i64 4184
  %29 = load i32, ptr %28, align 8, !tbaa !43
  %30 = getelementptr inbounds i8, ptr %1, i64 4
  store i32 %29, ptr %30, align 4, !tbaa !44
  %31 = getelementptr inbounds i8, ptr %1, i64 8
  %32 = getelementptr inbounds i8, ptr %15, i64 300
  %33 = tail call ptr @CopyMem(ptr noundef nonnull %31, ptr noundef nonnull %32, i64 noundef 52) #2
  %34 = getelementptr inbounds i8, ptr %1, i64 60
  store i8 0, ptr %34, align 4, !tbaa !45
  %35 = getelementptr inbounds i8, ptr %1, i64 64
  store i32 0, ptr %35, align 8, !tbaa !46
  %36 = getelementptr inbounds i8, ptr %1, i64 72
  store ptr null, ptr %36, align 8, !tbaa !47
  %37 = getelementptr inbounds i8, ptr %15, i64 296
  %38 = load i32, ptr %37, align 8, !tbaa !48
  %39 = getelementptr inbounds i8, ptr %1, i64 80
  store i32 %38, ptr %39, align 8, !tbaa !49
  %40 = getelementptr inbounds i8, ptr %1, i64 88
  store ptr null, ptr %40, align 8, !tbaa !50
  %41 = getelementptr inbounds i8, ptr %1, i64 96
  store i32 0, ptr %41, align 8, !tbaa !51
  %42 = getelementptr inbounds i8, ptr %1, i64 104
  store ptr null, ptr %42, align 8, !tbaa !52
  %43 = getelementptr inbounds i8, ptr %1, i64 112
  store i32 0, ptr %43, align 8, !tbaa !53
  %44 = getelementptr inbounds i8, ptr %1, i64 120
  store ptr null, ptr %44, align 8, !tbaa !54
  %45 = getelementptr inbounds i8, ptr %1, i64 128
  store i32 0, ptr %45, align 8, !tbaa !55
  %46 = getelementptr inbounds i8, ptr %1, i64 136
  store ptr null, ptr %46, align 8, !tbaa !56
  %47 = getelementptr inbounds i8, ptr %1, i64 144
  store i32 23, ptr %47, align 8, !tbaa !57
  %48 = tail call ptr @AllocateCopyPool(i64 noundef 46, ptr noundef nonnull @mIp6SupportedIcmp) #2
  %49 = getelementptr inbounds i8, ptr %1, i64 152
  store ptr %48, ptr %49, align 8, !tbaa !58
  %50 = icmp eq ptr %48, null
  br i1 %50, label %89, label %51

51:                                               ; preds = %23
  %52 = tail call i64 @Ip6BuildEfiAddressList(ptr noundef nonnull %17, ptr noundef nonnull %35, ptr noundef nonnull %36) #2
  %53 = icmp slt i64 %52, 0
  br i1 %53, label %89, label %54

54:                                               ; preds = %51
  %55 = load i8, ptr %1, align 8, !tbaa !41
  %.not94 = icmp eq i8 %55, 0
  br i1 %.not94, label %67, label %56

56:                                               ; preds = %54
  %57 = getelementptr inbounds i8, ptr %19, i64 52
  %58 = load i8, ptr %57, align 4, !tbaa !59
  %.not95 = icmp eq i8 %58, 0
  br i1 %.not95, label %59, label %62

59:                                               ; preds = %56
  %60 = getelementptr inbounds i8, ptr %1, i64 12
  %61 = tail call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef nonnull %60) #2
  %.not96 = icmp ne i8 %61, 0
  %spec.select = zext i1 %.not96 to i8
  br label %62

62:                                               ; preds = %59, %56
  %storemerge = phi i8 [ 1, %56 ], [ %spec.select, %59 ]
  store i8 %storemerge, ptr %34, align 4, !tbaa !45
  %63 = getelementptr inbounds i8, ptr %17, i64 80
  %64 = load ptr, ptr %63, align 8, !tbaa !61
  %65 = tail call i64 @Ip6BuildEfiRouteTable(ptr noundef %64, ptr noundef nonnull %41, ptr noundef nonnull %42) #2
  %66 = icmp slt i64 %65, 0
  br i1 %66, label %89, label %67

67:                                               ; preds = %62, %54
  %68 = load i8, ptr %34, align 4, !tbaa !45
  %.not97 = icmp eq i8 %68, 0
  br i1 %.not97, label %84, label %69

69:                                               ; preds = %67
  %70 = load i32, ptr %37, align 8, !tbaa !48
  %.not98 = icmp eq i32 %70, 0
  br i1 %.not98, label %78, label %71

71:                                               ; preds = %69
  %72 = zext i32 %70 to i64
  %73 = shl nuw nsw i64 %72, 4
  %74 = getelementptr inbounds i8, ptr %15, i64 288
  %75 = load ptr, ptr %74, align 8, !tbaa !62
  %76 = tail call ptr @AllocateCopyPool(i64 noundef %73, ptr noundef %75) #2
  store ptr %76, ptr %40, align 8, !tbaa !50
  %77 = icmp eq ptr %76, null
  br i1 %77, label %89, label %78

78:                                               ; preds = %71, %69
  %79 = tail call i64 @Ip6BuildEfiNeighborCache(ptr noundef nonnull %15, ptr noundef nonnull %43, ptr noundef nonnull %44) #2
  %80 = icmp slt i64 %79, 0
  br i1 %80, label %89, label %81

81:                                               ; preds = %78
  %82 = tail call i64 @Ip6BuildPrefixTable(ptr noundef nonnull %15, ptr noundef nonnull %45, ptr noundef nonnull %46) #2
  %83 = icmp slt i64 %82, 0
  br i1 %83, label %89, label %84

84:                                               ; preds = %67, %81, %22
  %85 = getelementptr inbounds i8, ptr %17, i64 2344
  %86 = load ptr, ptr %85, align 8, !tbaa !63
  %87 = load ptr, ptr %86, align 8, !tbaa !64
  %88 = tail call i64 %87(ptr noundef nonnull %86, ptr noundef %2, ptr noundef %3) #2
  br label %107

89:                                               ; preds = %51, %62, %78, %81, %23, %71
  %.077 = phi i64 [ %52, %51 ], [ %65, %62 ], [ %79, %78 ], [ %82, %81 ], [ -9223372036854775799, %23 ], [ -9223372036854775799, %71 ]
  %90 = load ptr, ptr %36, align 8, !tbaa !47
  %.not99 = icmp eq ptr %90, null
  br i1 %.not99, label %92, label %91

91:                                               ; preds = %89
  tail call void @FreePool(ptr noundef nonnull %90) #2
  br label %92

92:                                               ; preds = %91, %89
  %93 = load ptr, ptr %40, align 8, !tbaa !50
  %.not100 = icmp eq ptr %93, null
  br i1 %.not100, label %95, label %94

94:                                               ; preds = %92
  tail call void @FreePool(ptr noundef nonnull %93) #2
  br label %95

95:                                               ; preds = %94, %92
  %96 = load ptr, ptr %42, align 8, !tbaa !52
  %.not101 = icmp eq ptr %96, null
  br i1 %.not101, label %98, label %97

97:                                               ; preds = %95
  tail call void @FreePool(ptr noundef nonnull %96) #2
  br label %98

98:                                               ; preds = %97, %95
  %99 = load ptr, ptr %44, align 8, !tbaa !54
  %.not102 = icmp eq ptr %99, null
  br i1 %.not102, label %101, label %100

100:                                              ; preds = %98
  tail call void @FreePool(ptr noundef nonnull %99) #2
  br label %101

101:                                              ; preds = %100, %98
  %102 = load ptr, ptr %46, align 8, !tbaa !56
  %.not103 = icmp eq ptr %102, null
  br i1 %.not103, label %104, label %103

103:                                              ; preds = %101
  tail call void @FreePool(ptr noundef nonnull %102) #2
  br label %104

104:                                              ; preds = %103, %101
  %105 = load ptr, ptr %49, align 8, !tbaa !58
  %.not104 = icmp eq ptr %105, null
  br i1 %.not104, label %107, label %106

106:                                              ; preds = %104
  tail call void @FreePool(ptr noundef nonnull %105) #2
  br label %107

107:                                              ; preds = %106, %104, %84
  %.1 = phi i64 [ %.077, %106 ], [ %.077, %104 ], [ %88, %84 ]
  %108 = load ptr, ptr @gBS, align 8, !tbaa !5
  %109 = getelementptr inbounds i8, ptr %108, i64 32
  %110 = load ptr, ptr %109, align 8, !tbaa !66
  tail call void %110(i64 noundef %10) #2
  br label %111

111:                                              ; preds = %._crit_edge, %4, %107
  %.0 = phi i64 [ %.1, %107 ], [ -9223372036854775806, %4 ], [ -9223372036854775806, %._crit_edge ]
  ret i64 %.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 @AllocateCopyPool(i64 noundef, ptr noundef) local_unnamed_addr #1

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

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

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

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

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

declare void @FreePool(ptr noundef) local_unnamed_addr #1

attributes #0 = { 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 #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 }

!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 24}
!10 = !{!"", !11, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368}
!11 = !{!"", !12, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !13, i64 0}
!15 = !{!"_IP6_PROTOCOL", !13, i64 0, !16, i64 8, !6, i64 80, !12, i64 88, !6, i64 96, !17, i64 104, !7, i64 120, !18, i64 128, !18, i64 168, !17, i64 208, !17, i64 224, !19, i64 240, !6, i64 264, !17, i64 272, !6, i64 288, !13, i64 296, !20, i64 300, !7, i64 352}
!16 = !{!"_EFI_IP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!17 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!18 = !{!"", !17, i64 0, !17, i64 16, !12, i64 32}
!19 = !{!"", !12, i64 0, !12, i64 8, !13, i64 16}
!20 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !21, i64 4, !21, i64 20, !7, i64 36, !7, i64 37, !13, i64 40, !13, i64 44, !13, i64 48}
!21 = !{!"", !7, i64 0}
!22 = !{!15, !6, i64 96}
!23 = !{!15, !6, i64 264}
!24 = !{!25, !7, i64 2209}
!25 = !{!"_IP6_SERVICE", !13, i64 0, !26, i64 8, !12, i64 24, !12, i64 32, !17, i64 40, !17, i64 56, !6, i64 72, !6, i64 80, !27, i64 88, !21, i64 136, !29, i64 2168, !21, i64 2192, !7, i64 2208, !7, i64 2209, !7, i64 2210, !7, i64 2211, !7, i64 2212, !13, i64 2216, !13, i64 2220, !13, i64 2224, !13, i64 2228, !17, i64 2232, !17, i64 2248, !17, i64 2264, !17, i64 2280, !13, i64 2296, !7, i64 2300, !6, i64 2304, !7, i64 2312, !7, i64 2313, !13, i64 2316, !6, i64 2320, !6, i64 2328, !6, i64 2336, !6, i64 2344, !30, i64 2352, !32, i64 2372, !6, i64 3032, !6, i64 3040, !33, i64 3048, !6, i64 4176, !13, i64 4184, !13, i64 4188}
!26 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!27 = !{!"", !13, i64 0, !6, i64 8, !6, i64 16, !28, i64 24}
!28 = !{!"", !6, i64 0, !12, i64 8, !7, i64 16}
!29 = !{!"", !12, i64 0, !17, i64 8}
!30 = !{!"", !13, i64 0, !13, i64 4, !31, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!31 = !{!"short", !7, i64 0}
!32 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !7, i64 40, !21, i64 552, !21, i64 584, !21, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!33 = !{!"_IP6_CONFIG_INSTANCE", !13, i64 0, !7, i64 4, !17, i64 8, !31, i64 24, !34, i64 32, !21, i64 168, !13, i64 176, !35, i64 180, !7, i64 184, !18, i64 800, !18, i64 840, !36, i64 880, !6, i64 912, !6, i64 920, !6, i64 928, !6, i64 936, !7, i64 944, !13, i64 948, !6, i64 952, !13, i64 960, !6, i64 968, !13, i64 976, !37, i64 984, !39, i64 1040}
!34 = !{!"", !7, i64 0, !7, i64 64, !13, i64 68, !21, i64 72, !13, i64 104, !6, i64 112, !13, i64 120, !6, i64 128}
!35 = !{!"", !13, i64 0}
!36 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!37 = !{!"_IP6_FORM_CALLBACK_INFO", !13, i64 0, !6, i64 8, !38, i64 16, !6, i64 40, !6, i64 48}
!38 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!39 = !{!"", !13, i64 0, !35, i64 4, !21, i64 8, !17, i64 16, !13, i64 32, !17, i64 40, !13, i64 56, !17, i64 64, !13, i64 80}
!40 = !{!15, !12, i64 88}
!41 = !{!42, !7, i64 0}
!42 = !{!"", !7, i64 0, !13, i64 4, !20, i64 8, !7, i64 60, !13, i64 64, !6, i64 72, !13, i64 80, !6, i64 88, !13, i64 96, !6, i64 104, !13, i64 112, !6, i64 120, !13, i64 128, !6, i64 136, !13, i64 144, !6, i64 152}
!43 = !{!25, !13, i64 4184}
!44 = !{!42, !13, i64 4}
!45 = !{!42, !7, i64 60}
!46 = !{!42, !13, i64 64}
!47 = !{!42, !6, i64 72}
!48 = !{!15, !13, i64 296}
!49 = !{!42, !13, i64 80}
!50 = !{!42, !6, i64 88}
!51 = !{!42, !13, i64 96}
!52 = !{!42, !6, i64 104}
!53 = !{!42, !13, i64 112}
!54 = !{!42, !6, i64 120}
!55 = !{!42, !13, i64 128}
!56 = !{!42, !6, i64 136}
!57 = !{!42, !13, i64 144}
!58 = !{!42, !6, i64 152}
!59 = !{!60, !7, i64 52}
!60 = !{!"_IP6_INTERFACE", !13, i64 0, !17, i64 8, !12, i64 24, !17, i64 32, !13, i64 48, !7, i64 52, !6, i64 56, !6, i64 64, !6, i64 72, !17, i64 80, !17, i64 96, !13, i64 112, !17, i64 120, !17, i64 136, !17, i64 152, !7, i64 168}
!61 = !{!25, !6, i64 80}
!62 = !{!15, !6, i64 288}
!63 = !{!25, !6, i64 2344}
!64 = !{!65, !6, i64 0}
!65 = !{!"_EFI_MANAGED_NETWORK_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!66 = !{!10, !6, i64 32}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass