; 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_PREFIX_LIST_ENTRY = type { %struct._LIST_ENTRY, i64, i32, i32, i8, %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] }

@.str = external hidden unnamed_addr constant [127 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [107 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 @AllocatePool(i64 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local ptr @Ip6CreatePrefixListEntry(ptr noundef %0, i8 noundef zeroext %1, i32 noundef %2, i32 noundef %3, i8 noundef zeroext %4, ptr noundef %5) #2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i8 %1, ptr %9, align 1, !tbaa !9
  store i32 %2, ptr %10, align 4, !tbaa !10
  store i32 %3, ptr %11, align 4, !tbaa !10
  store i8 %4, ptr %12, align 1, !tbaa !9
  store ptr %5, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %20 = load ptr, ptr %13, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %30, label %22

22:                                               ; preds = %6
  %23 = load i32, ptr %11, align 4, !tbaa !10
  %24 = load i32, ptr %10, align 4, !tbaa !10
  %25 = icmp ugt i32 %23, %24
  br i1 %25, label %30, label %26

26:                                               ; preds = %22
  %27 = load i8, ptr %12, align 1, !tbaa !9
  %28 = zext i8 %27 to i32
  %29 = icmp sge i32 %28, 129
  br i1 %29, label %30, label %31

30:                                               ; preds = %26, %22, %6
  store ptr null, ptr %7, align 8
  store i32 1, ptr %19, align 4
  br label %155

31:                                               ; preds = %26
  br label %32

32:                                               ; preds = %31
  %33 = call zeroext i8 @DebugAssertEnabled()
  %34 = icmp ne i8 %33, 0
  br i1 %34, label %35, label %45

35:                                               ; preds = %32
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = icmp ne ptr %36, null
  br i1 %37, label %38, label %43

38:                                               ; preds = %35
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._IP6_SERVICE, ptr %39, i32 0, i32 0
  %41 = load i32, ptr %40, align 8, !tbaa !12
  %42 = icmp eq i32 %41, 1396068425
  br i1 %42, label %44, label %43

43:                                               ; preds = %38, %35
  call void @DebugAssert(ptr noundef @.str, i64 noundef 205, ptr noundef @.str.6)
  br label %44

44:                                               ; preds = %43, %38
  br label %45

45:                                               ; preds = %44, %32
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = load i8, ptr %9, align 1, !tbaa !9
  %50 = load i8, ptr %12, align 1, !tbaa !9
  %51 = load ptr, ptr %13, align 8, !tbaa !5
  %52 = call ptr @Ip6FindPrefixListEntry(ptr noundef %48, i8 noundef zeroext %49, i8 noundef zeroext %50, ptr noundef %51)
  store ptr %52, ptr %14, align 8, !tbaa !5
  %53 = load ptr, ptr %14, align 8, !tbaa !5
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %61

55:                                               ; preds = %47
  %56 = load ptr, ptr %14, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %56, i32 0, i32 1
  %58 = load i64, ptr %57, align 8, !tbaa !32
  %59 = add nsw i64 %58, 1
  store i64 %59, ptr %57, align 8, !tbaa !32
  %60 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %60, ptr %7, align 8
  store i32 1, ptr %19, align 4
  br label %155

61:                                               ; preds = %47
  %62 = call ptr @AllocatePool(i64 noundef 56)
  store ptr %62, ptr %14, align 8, !tbaa !5
  %63 = load ptr, ptr %14, align 8, !tbaa !5
  %64 = icmp eq ptr %63, null
  br i1 %64, label %65, label %66

65:                                               ; preds = %61
  store ptr null, ptr %7, align 8
  store i32 1, ptr %19, align 4
  br label %155

66:                                               ; preds = %61
  %67 = load ptr, ptr %14, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %67, i32 0, i32 1
  store i64 1, ptr %68, align 8, !tbaa !32
  %69 = load i32, ptr %10, align 4, !tbaa !10
  %70 = load ptr, ptr %14, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %70, i32 0, i32 2
  store i32 %69, ptr %71, align 8, !tbaa !34
  %72 = load i32, ptr %11, align 4, !tbaa !10
  %73 = load ptr, ptr %14, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %73, i32 0, i32 3
  store i32 %72, ptr %74, align 4, !tbaa !35
  %75 = load i8, ptr %12, align 1, !tbaa !9
  %76 = load ptr, ptr %14, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %76, i32 0, i32 4
  store i8 %75, ptr %77, align 8, !tbaa !36
  %78 = load ptr, ptr %14, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %78, i32 0, i32 5
  %80 = load ptr, ptr %13, align 8, !tbaa !5
  %81 = call ptr @CopyMem(ptr noundef %79, ptr noundef %80, i64 noundef 16)
  %82 = load i8, ptr %9, align 1, !tbaa !9
  %83 = zext i8 %82 to i32
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %88

85:                                               ; preds = %66
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._IP6_SERVICE, ptr %86, i32 0, i32 22
  br label %91

88:                                               ; preds = %66
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._IP6_SERVICE, ptr %89, i32 0, i32 23
  br label %91

91:                                               ; preds = %88, %85
  %92 = phi ptr [ %87, %85 ], [ %90, %88 ]
  store ptr %92, ptr %16, align 8, !tbaa !5
  %93 = load i8, ptr %9, align 1, !tbaa !9
  %94 = icmp ne i8 %93, 0
  br i1 %94, label %95, label %122

95:                                               ; preds = %91
  %96 = load ptr, ptr %13, align 8, !tbaa !5
  %97 = load i8, ptr %12, align 1, !tbaa !9
  %98 = call ptr @Ip6CreateRouteEntry(ptr noundef %96, i8 noundef zeroext %97, ptr noundef null)
  store ptr %98, ptr %15, align 8, !tbaa !5
  %99 = load ptr, ptr %15, align 8, !tbaa !5
  %100 = icmp eq ptr %99, null
  br i1 %100, label %101, label %103

101:                                              ; preds = %95
  %102 = load ptr, ptr %14, align 8, !tbaa !5
  call void @FreePool(ptr noundef %102)
  store ptr null, ptr %7, align 8
  store i32 1, ptr %19, align 4
  br label %155

103:                                              ; preds = %95
  %104 = load ptr, ptr %15, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.IP6_ROUTE_ENTRY, ptr %104, i32 0, i32 2
  store i32 1, ptr %105, align 8, !tbaa !37
  %106 = load ptr, ptr %8, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._IP6_SERVICE, ptr %106, i32 0, i32 7
  %108 = load ptr, ptr %107, align 8, !tbaa !39
  %109 = getelementptr inbounds %struct._IP6_ROUTE_TABLE, ptr %108, i32 0, i32 2
  %110 = load i8, ptr %12, align 1, !tbaa !9
  %111 = zext i8 %110 to i64
  %112 = getelementptr inbounds [129 x %struct._LIST_ENTRY], ptr %109, i64 0, i64 %111
  %113 = load ptr, ptr %15, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.IP6_ROUTE_ENTRY, ptr %113, i32 0, i32 0
  %115 = call ptr @InsertHeadList(ptr noundef %112, ptr noundef %114)
  %116 = load ptr, ptr %8, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct._IP6_SERVICE, ptr %116, i32 0, i32 7
  %118 = load ptr, ptr %117, align 8, !tbaa !39
  %119 = getelementptr inbounds %struct._IP6_ROUTE_TABLE, ptr %118, i32 0, i32 1
  %120 = load i32, ptr %119, align 8, !tbaa !40
  %121 = add i32 %120, 1
  store i32 %121, ptr %119, align 8, !tbaa !40
  br label %122

122:                                              ; preds = %103, %91
  %123 = load ptr, ptr %16, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._LIST_ENTRY, ptr %123, i32 0, i32 0
  %125 = load ptr, ptr %124, align 8, !tbaa !43
  store ptr %125, ptr %17, align 8, !tbaa !5
  br label %126

126:                                              ; preds = %146, %122
  %127 = load ptr, ptr %17, align 8, !tbaa !5
  %128 = load ptr, ptr %16, align 8, !tbaa !5
  %129 = icmp ne ptr %127, %128
  br i1 %129, label %130, label %150

130:                                              ; preds = %126
  %131 = load ptr, ptr %17, align 8, !tbaa !5
  %132 = ptrtoint ptr %131 to i64
  %133 = sub i64 %132, 0
  %134 = inttoptr i64 %133 to ptr
  store ptr %134, ptr %18, align 8, !tbaa !5
  %135 = load ptr, ptr %18, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %135, i32 0, i32 4
  %137 = load i8, ptr %136, align 8, !tbaa !36
  %138 = zext i8 %137 to i32
  %139 = load ptr, ptr %14, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %139, i32 0, i32 4
  %141 = load i8, ptr %140, align 8, !tbaa !36
  %142 = zext i8 %141 to i32
  %143 = icmp slt i32 %138, %142
  br i1 %143, label %144, label %145

144:                                              ; preds = %130
  br label %150

145:                                              ; preds = %130
  br label %146

146:                                              ; preds = %145
  %147 = load ptr, ptr %17, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct._LIST_ENTRY, ptr %147, i32 0, i32 0
  %149 = load ptr, ptr %148, align 8, !tbaa !43
  store ptr %149, ptr %17, align 8, !tbaa !5
  br label %126, !llvm.loop !44

150:                                              ; preds = %144, %126
  %151 = load ptr, ptr %17, align 8, !tbaa !5
  %152 = load ptr, ptr %14, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %152, i32 0, i32 0
  call void @NetListInsertBefore(ptr noundef %151, ptr noundef %153)
  %154 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %154, ptr %7, align 8
  store i32 1, ptr %19, align 4
  br label %155

155:                                              ; preds = %150, %101, %65, %55, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  %156 = load ptr, ptr %7, align 8
  ret ptr %156
}

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

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

declare void @FreePool(ptr noundef) #1

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

declare void @NetListInsertBefore(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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 0}
!13 = !{!"_IP6_SERVICE", !11, i64 0, !14, i64 8, !15, i64 24, !15, i64 32, !16, i64 40, !16, i64 56, !6, i64 72, !6, i64 80, !17, i64 88, !19, i64 136, !20, i64 2168, !19, 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, !16, i64 2232, !16, i64 2248, !16, i64 2264, !16, 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, !21, i64 2352, !23, i64 2372, !6, i64 3032, !6, i64 3040, !24, i64 3048, !6, i64 4176, !11, i64 4184, !11, i64 4188}
!14 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!17 = !{!"", !11, i64 0, !6, i64 8, !6, i64 16, !18, i64 24}
!18 = !{!"", !6, i64 0, !15, i64 8, !7, i64 16}
!19 = !{!"", !7, i64 0}
!20 = !{!"", !15, i64 0, !16, i64 8}
!21 = !{!"", !11, i64 0, !11, i64 4, !22, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!22 = !{!"short", !7, i64 0}
!23 = !{!"", !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, !19, i64 552, !19, i64 584, !19, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!24 = !{!"_IP6_CONFIG_INSTANCE", !11, i64 0, !7, i64 4, !16, i64 8, !22, i64 24, !25, i64 32, !19, i64 168, !11, i64 176, !26, i64 180, !7, i64 184, !27, i64 800, !27, i64 840, !28, 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, !29, i64 984, !31, i64 1040}
!25 = !{!"", !7, i64 0, !7, i64 64, !11, i64 68, !19, i64 72, !11, i64 104, !6, i64 112, !11, i64 120, !6, i64 128}
!26 = !{!"", !11, i64 0}
!27 = !{!"", !16, i64 0, !16, i64 16, !15, i64 32}
!28 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!29 = !{!"_IP6_FORM_CALLBACK_INFO", !11, i64 0, !6, i64 8, !30, i64 16, !6, i64 40, !6, i64 48}
!30 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!"", !11, i64 0, !26, i64 4, !19, i64 8, !16, i64 16, !11, i64 32, !16, i64 40, !11, i64 56, !16, i64 64, !11, i64 80}
!32 = !{!33, !15, i64 16}
!33 = !{!"_IP6_PREFIX_LIST_ENTRY", !16, i64 0, !15, i64 16, !11, i64 24, !11, i64 28, !7, i64 32, !19, i64 33}
!34 = !{!33, !11, i64 24}
!35 = !{!33, !11, i64 28}
!36 = !{!33, !7, i64 32}
!37 = !{!38, !11, i64 24}
!38 = !{!"", !16, i64 0, !15, i64 16, !11, i64 24, !7, i64 28, !19, i64 29, !19, i64 45}
!39 = !{!13, !6, i64 80}
!40 = !{!41, !11, i64 8}
!41 = !{!"_IP6_ROUTE_TABLE", !15, i64 0, !11, i64 8, !7, i64 16, !42, i64 2080}
!42 = !{!"", !7, i64 0, !7, i64 496}
!43 = !{!16, !6, i64 0}
!44 = distinct !{!44, !45}
!45 = !{!"llvm.loop.mustprogress"}


; 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.6 = external hidden unnamed_addr constant [107 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

declare ptr @AllocatePool(i64 noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local ptr @Ip6CreatePrefixListEntry(ptr noundef %0, i8 noundef zeroext %1, i32 noundef %2, i32 noundef %3, i8 noundef zeroext %4, ptr noundef %5) local_unnamed_addr #1 {
  %7 = icmp eq ptr %5, null
  br i1 %7, label %58, label %8

8:                                                ; preds = %6
  %9 = icmp ugt i32 %3, %2
  %10 = icmp ugt i8 %4, -128
  %or.cond = or i1 %9, %10
  br i1 %or.cond, label %58, label %11

11:                                               ; preds = %8
  %12 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %12, 0
  br i1 %.not, label %18, label %13

13:                                               ; preds = %11
  %.not56 = icmp eq ptr %0, null
  br i1 %.not56, label %17, label %14

14:                                               ; preds = %13
  %15 = load i32, ptr %0, align 8, !tbaa !5
  %16 = icmp eq i32 %15, 1396068425
  br i1 %16, label %18, label %17

17:                                               ; preds = %14, %13
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 205, ptr noundef nonnull @.str.6) #2
  br label %18

18:                                               ; preds = %14, %17, %11
  %19 = tail call ptr @Ip6FindPrefixListEntry(ptr noundef %0, i8 noundef zeroext %1, i8 noundef zeroext %4, ptr noundef nonnull %5)
  %.not57 = icmp eq ptr %19, null
  br i1 %.not57, label %24, label %20

20:                                               ; preds = %18
  %21 = getelementptr inbounds i8, ptr %19, i64 16
  %22 = load i64, ptr %21, align 8, !tbaa !29
  %23 = add nsw i64 %22, 1
  store i64 %23, ptr %21, align 8, !tbaa !29
  br label %58

24:                                               ; preds = %18
  %25 = tail call ptr @AllocatePool(i64 noundef 56) #2
  %26 = icmp eq ptr %25, null
  br i1 %26, label %58, label %27

27:                                               ; preds = %24
  %28 = getelementptr inbounds i8, ptr %25, i64 16
  store i64 1, ptr %28, align 8, !tbaa !29
  %29 = getelementptr inbounds i8, ptr %25, i64 24
  store i32 %2, ptr %29, align 8, !tbaa !31
  %30 = getelementptr inbounds i8, ptr %25, i64 28
  store i32 %3, ptr %30, align 4, !tbaa !32
  %31 = getelementptr inbounds i8, ptr %25, i64 32
  store i8 %4, ptr %31, align 8, !tbaa !33
  %32 = getelementptr inbounds i8, ptr %25, i64 33
  %33 = tail call ptr @CopyMem(ptr noundef nonnull %32, ptr noundef nonnull %5, i64 noundef 16) #2
  %.not58 = icmp eq i8 %1, 0
  %.v = select i1 %.not58, i64 2264, i64 2248
  %34 = getelementptr inbounds i8, ptr %0, i64 %.v
  br i1 %.not58, label %.preheader, label %35

35:                                               ; preds = %27
  %36 = tail call ptr @Ip6CreateRouteEntry(ptr noundef nonnull %5, i8 noundef zeroext %4, ptr noundef null) #2
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %39

38:                                               ; preds = %35
  tail call void @FreePool(ptr noundef nonnull %25) #2
  br label %58

39:                                               ; preds = %35
  %40 = getelementptr inbounds i8, ptr %36, i64 24
  store i32 1, ptr %40, align 8, !tbaa !34
  %41 = getelementptr inbounds i8, ptr %0, i64 80
  %42 = load ptr, ptr %41, align 8, !tbaa !36
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  %44 = zext i8 %4 to i64
  %45 = getelementptr inbounds [129 x %struct._LIST_ENTRY], ptr %43, i64 0, i64 %44
  %46 = tail call ptr @InsertHeadList(ptr noundef nonnull %45, ptr noundef nonnull %36) #2
  %47 = load ptr, ptr %41, align 8, !tbaa !36
  %48 = getelementptr inbounds i8, ptr %47, i64 8
  %49 = load i32, ptr %48, align 8, !tbaa !37
  %50 = add i32 %49, 1
  store i32 %50, ptr %48, align 8, !tbaa !37
  br label %.preheader

.preheader:                                       ; preds = %39, %27
  br label %51

51:                                               ; preds = %.preheader, %52
  %.048.in = phi ptr [ %.048, %52 ], [ %34, %.preheader ]
  %.048 = load ptr, ptr %.048.in, align 8, !tbaa !40
  %.not60 = icmp eq ptr %.048, %34
  br i1 %.not60, label %57, label %52

52:                                               ; preds = %51
  %53 = getelementptr inbounds i8, ptr %.048, i64 32
  %54 = load i8, ptr %53, align 8, !tbaa !33
  %55 = load i8, ptr %31, align 8, !tbaa !33
  %56 = icmp ult i8 %54, %55
  br i1 %56, label %57, label %51, !llvm.loop !41

57:                                               ; preds = %52, %51
  tail call void @NetListInsertBefore(ptr noundef %.048, ptr noundef nonnull %25) #2
  br label %58

58:                                               ; preds = %24, %6, %8, %57, %38, %20
  %.0 = phi ptr [ %19, %20 ], [ null, %38 ], [ %25, %57 ], [ null, %8 ], [ null, %6 ], [ null, %24 ]
  ret ptr %.0
}

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

declare ptr @Ip6CreateRouteEntry(ptr noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #0

declare void @FreePool(ptr noundef) local_unnamed_addr #0

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

declare void @NetListInsertBefore(ptr noundef, 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, !7, i64 0}
!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 = !{!30, !12, i64 16}
!30 = !{!"_IP6_PREFIX_LIST_ENTRY", !13, i64 0, !12, i64 16, !7, i64 24, !7, i64 28, !8, i64 32, !16, i64 33}
!31 = !{!30, !7, i64 24}
!32 = !{!30, !7, i64 28}
!33 = !{!30, !8, i64 32}
!34 = !{!35, !7, i64 24}
!35 = !{!"", !13, i64 0, !12, i64 16, !7, i64 24, !8, i64 28, !16, i64 29, !16, i64 45}
!36 = !{!6, !11, i64 80}
!37 = !{!38, !7, i64 8}
!38 = !{!"_IP6_ROUTE_TABLE", !12, i64 0, !7, i64 8, !8, i64 16, !39, i64 2080}
!39 = !{!"", !8, i64 0, !8, i64 496}
!40 = !{!13, !11, i64 0}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass