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

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

@.str = external hidden unnamed_addr constant [131 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1

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

19:                                               ; preds = %3
  %20 = call ptr @AllocatePool(i64 noundef 56)
  store ptr %20, ptr %12, align 8, !tbaa !5
  %21 = load ptr, ptr %12, align 8, !tbaa !5
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %24

23:                                               ; preds = %19
  store i64 -9223372036854775799, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %121

24:                                               ; preds = %19
  %25 = load ptr, ptr %12, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %25, i32 0, i32 0
  store i32 1229017161, ptr %26, align 8, !tbaa !31
  %27 = load ptr, ptr %12, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %27, i32 0, i32 2
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._IP6_SERVICE, ptr %29, i32 0, i32 11
  %31 = call ptr @CopyMem(ptr noundef %28, ptr noundef %30, i64 noundef 16)
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %32, i32 0, i32 3
  store i8 0, ptr %33, align 8, !tbaa !33
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %34, i32 0, i32 4
  store i8 64, ptr %35, align 1, !tbaa !34
  %36 = load ptr, ptr %12, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %36, i32 0, i32 5
  store i32 -1, ptr %37, align 4, !tbaa !35
  %38 = load ptr, ptr %12, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %38, i32 0, i32 6
  store i32 -1, ptr %39, align 8, !tbaa !36
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = load ptr, ptr %12, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %41, i32 0, i32 1
  %43 = call ptr @InsertTailList(ptr noundef %40, ptr noundef %42)
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = add i32 %45, 1
  store i32 %46, ptr %44, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %24, %3
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._IP6_SERVICE, ptr %48, i32 0, i32 5
  %50 = getelementptr inbounds %struct._LIST_ENTRY, ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !37
  store ptr %51, ptr %9, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %116, %47
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._IP6_SERVICE, ptr %54, i32 0, i32 5
  %56 = icmp ne ptr %53, %55
  br i1 %56, label %57, label %120

57:                                               ; preds = %52
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = ptrtoint ptr %58 to i64
  %60 = sub i64 %59, ptrtoint (ptr getelementptr inbounds (%struct._IP6_INTERFACE, ptr null, i32 0, i32 1) to i64)
  %61 = inttoptr i64 %60 to ptr
  store ptr %61, ptr %8, align 8, !tbaa !5
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._IP6_INTERFACE, ptr %62, i32 0, i32 3
  %64 = getelementptr inbounds %struct._LIST_ENTRY, ptr %63, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !38
  store ptr %65, ptr %10, align 8, !tbaa !5
  br label %66

66:                                               ; preds = %111, %57
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._IP6_INTERFACE, ptr %68, i32 0, i32 3
  %70 = icmp ne ptr %67, %69
  br i1 %70, label %71, label %115

71:                                               ; preds = %66
  %72 = call zeroext i8 @DebugAssertEnabled()
  %73 = zext i8 %72 to i32
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %85

75:                                               ; preds = %71
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = ptrtoint ptr %76 to i64
  %78 = sub i64 %77, ptrtoint (ptr getelementptr inbounds (%struct._IP6_ADDRESS_INFO, ptr null, i32 0, i32 1) to i64)
  %79 = inttoptr i64 %78 to ptr
  %80 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %79, i32 0, i32 0
  %81 = load i32, ptr %80, align 8, !tbaa !31
  %82 = icmp ne i32 %81, 1229017161
  br i1 %82, label %83, label %85

83:                                               ; preds = %75
  call void @DebugAssert(ptr noundef @.str, i64 noundef 71, ptr noundef @.str.1)
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  br label %90

85:                                               ; preds = %75, %71
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  %87 = ptrtoint ptr %86 to i64
  %88 = sub i64 %87, ptrtoint (ptr getelementptr inbounds (%struct._IP6_ADDRESS_INFO, ptr null, i32 0, i32 1) to i64)
  %89 = inttoptr i64 %88 to ptr
  br label %90

90:                                               ; preds = %85, %83
  %91 = phi ptr [ %84, %83 ], [ %89, %85 ]
  store ptr %91, ptr %11, align 8, !tbaa !5
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %92, i32 0, i32 3
  %94 = load i8, ptr %93, align 8, !tbaa !33
  %95 = icmp ne i8 %94, 0
  br i1 %95, label %96, label %97

96:                                               ; preds = %90
  br label %111

97:                                               ; preds = %90
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = call ptr @AllocateCopyPool(i64 noundef 56, ptr noundef %98)
  store ptr %99, ptr %12, align 8, !tbaa !5
  %100 = load ptr, ptr %12, align 8, !tbaa !5
  %101 = icmp eq ptr %100, null
  br i1 %101, label %102, label %103

102:                                              ; preds = %97
  store i64 -9223372036854775799, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %121

103:                                              ; preds = %97
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %105, i32 0, i32 1
  %107 = call ptr @InsertTailList(ptr noundef %104, ptr noundef %106)
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = load i32, ptr %108, align 4, !tbaa !9
  %110 = add i32 %109, 1
  store i32 %110, ptr %108, align 4, !tbaa !9
  br label %111

111:                                              ; preds = %103, %96
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._LIST_ENTRY, ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !40
  store ptr %114, ptr %10, align 8, !tbaa !5
  br label %66, !llvm.loop !41

115:                                              ; preds = %66
  br label %116

116:                                              ; preds = %115
  %117 = load ptr, ptr %9, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._LIST_ENTRY, ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !40
  store ptr %119, ptr %9, align 8, !tbaa !5
  br label %52, !llvm.loop !43

120:                                              ; preds = %52
  store i64 0, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %121

121:                                              ; preds = %120, %102, %23
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %122 = load i64, ptr %4, align 8
  ret i64 %122
}

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

declare ptr @AllocatePool(i64 noundef) #2

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

declare ptr @InsertTailList(ptr noundef, ptr noundef) #2

declare zeroext i8 @DebugAssertEnabled() #2

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

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


; 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"

@.str = external hidden unnamed_addr constant [131 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775799, 1) i64 @Ip6CandidateSource(ptr noundef %0, ptr noundef %1, ptr nocapture noundef %2) local_unnamed_addr #0 {
  store i32 0, ptr %2, align 4, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 2208
  %5 = load i8, ptr %4, align 8, !tbaa !9
  %.not = icmp eq i8 %5, 0
  br i1 %.not, label %21, label %6

6:                                                ; preds = %3
  %7 = tail call ptr @AllocatePool(i64 noundef 56) #2
  %8 = icmp eq ptr %7, null
  br i1 %8, label %.loopexit40, label %9

9:                                                ; preds = %6
  store i32 1229017161, ptr %7, align 8, !tbaa !30
  %10 = getelementptr inbounds i8, ptr %7, i64 24
  %11 = getelementptr inbounds i8, ptr %0, i64 2192
  %12 = tail call ptr @CopyMem(ptr noundef nonnull %10, ptr noundef nonnull %11, i64 noundef 16) #2
  %13 = getelementptr inbounds i8, ptr %7, i64 40
  store i8 0, ptr %13, align 8, !tbaa !32
  %14 = getelementptr inbounds i8, ptr %7, i64 41
  store i8 64, ptr %14, align 1, !tbaa !33
  %15 = getelementptr inbounds i8, ptr %7, i64 44
  store i32 -1, ptr %15, align 4, !tbaa !34
  %16 = getelementptr inbounds i8, ptr %7, i64 48
  store i32 -1, ptr %16, align 8, !tbaa !35
  %17 = getelementptr inbounds i8, ptr %7, i64 8
  %18 = tail call ptr @InsertTailList(ptr noundef %1, ptr noundef nonnull %17) #2
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = add i32 %19, 1
  store i32 %20, ptr %2, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %9, %3
  %22 = getelementptr inbounds i8, ptr %0, i64 56
  %.03245 = load ptr, ptr %22, align 8, !tbaa !36
  %.not3546 = icmp eq ptr %.03245, %22
  br i1 %.not3546, label %.loopexit40, label %.lr.ph48

.loopexit:                                        ; preds = %42, %.lr.ph48
  %.032 = load ptr, ptr %.03247, align 8, !tbaa !36
  %.not35 = icmp eq ptr %.032, %22
  br i1 %.not35, label %.loopexit40, label %.lr.ph48, !llvm.loop !37

.lr.ph48:                                         ; preds = %21, %.loopexit
  %.03247 = phi ptr [ %.032, %.loopexit ], [ %.03245, %21 ]
  %23 = ptrtoint ptr %.03247 to i64
  %24 = add i64 %23, -8
  %25 = inttoptr i64 %24 to ptr
  %26 = getelementptr inbounds i8, ptr %25, i64 32
  %.03142 = load ptr, ptr %26, align 8, !tbaa !36
  %.not3643 = icmp eq ptr %.03142, %26
  br i1 %.not3643, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph48, %42
  %.03144 = phi ptr [ %.031, %42 ], [ %.03142, %.lr.ph48 ]
  %27 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not37 = icmp eq i8 %27, 0
  %.pre = ptrtoint ptr %.03144 to i64
  %.pre50 = add i64 %.pre, -8
  %.pre52 = inttoptr i64 %.pre50 to ptr
  br i1 %.not37, label %.lr.ph._crit_edge, label %28

28:                                               ; preds = %.lr.ph
  %29 = load i32, ptr %.pre52, align 8, !tbaa !30
  %.not38 = icmp eq i32 %29, 1229017161
  br i1 %.not38, label %.lr.ph._crit_edge, label %30

30:                                               ; preds = %28
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 71, ptr noundef nonnull @.str.1) #2
  br label %.lr.ph._crit_edge

.lr.ph._crit_edge:                                ; preds = %.lr.ph, %28, %30
  %31 = phi ptr [ %.03144, %30 ], [ %.pre52, %28 ], [ %.pre52, %.lr.ph ]
  %32 = getelementptr inbounds i8, ptr %31, i64 40
  %33 = load i8, ptr %32, align 8, !tbaa !32
  %.not39 = icmp eq i8 %33, 0
  br i1 %.not39, label %34, label %42

34:                                               ; preds = %.lr.ph._crit_edge
  %35 = tail call ptr @AllocateCopyPool(i64 noundef 56, ptr noundef nonnull %31) #2
  %36 = icmp eq ptr %35, null
  br i1 %36, label %.loopexit40, label %37

37:                                               ; preds = %34
  %38 = getelementptr inbounds i8, ptr %35, i64 8
  %39 = tail call ptr @InsertTailList(ptr noundef %1, ptr noundef nonnull %38) #2
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = add i32 %40, 1
  store i32 %41, ptr %2, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %.lr.ph._crit_edge, %37
  %.031 = load ptr, ptr %.03144, align 8, !tbaa !36
  %.not36 = icmp eq ptr %.031, %26
  br i1 %.not36, label %.loopexit, label %.lr.ph, !llvm.loop !39

.loopexit40:                                      ; preds = %.loopexit, %34, %21, %6
  %.0 = phi i64 [ -9223372036854775799, %6 ], [ 0, %21 ], [ -9223372036854775799, %34 ], [ 0, %.loopexit ]
  ret i64 %.0
}

declare ptr @AllocatePool(i64 noundef) local_unnamed_addr #1

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

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

declare ptr @AllocateCopyPool(i64 noundef, 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !7, i64 2208}
!10 = !{!"_IP6_SERVICE", !6, i64 0, !11, i64 8, !13, i64 24, !13, i64 32, !14, i64 40, !14, i64 56, !12, i64 72, !12, 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, !6, i64 2216, !6, i64 2220, !6, i64 2224, !6, i64 2228, !14, i64 2232, !14, i64 2248, !14, i64 2264, !14, i64 2280, !6, i64 2296, !7, i64 2300, !12, i64 2304, !7, i64 2312, !7, i64 2313, !6, i64 2316, !12, i64 2320, !12, i64 2328, !12, i64 2336, !12, i64 2344, !19, i64 2352, !21, i64 2372, !12, i64 3032, !12, i64 3040, !22, i64 3048, !12, i64 4176, !6, i64 4184, !6, i64 4188}
!11 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !12, i64 0, !12, i64 8}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_LIST_ENTRY", !12, i64 0, !12, i64 8}
!15 = !{!"", !6, i64 0, !12, i64 8, !12, i64 16, !16, i64 24}
!16 = !{!"", !12, i64 0, !13, i64 8, !7, i64 16}
!17 = !{!"", !7, i64 0}
!18 = !{!"", !13, i64 0, !14, i64 8}
!19 = !{!"", !6, i64 0, !6, 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 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, 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", !6, i64 0, !7, i64 4, !14, i64 8, !20, i64 24, !23, i64 32, !17, i64 168, !6, i64 176, !24, i64 180, !7, i64 184, !25, i64 800, !25, i64 840, !26, i64 880, !12, i64 912, !12, i64 920, !12, i64 928, !12, i64 936, !7, i64 944, !6, i64 948, !12, i64 952, !6, i64 960, !12, i64 968, !6, i64 976, !27, i64 984, !29, i64 1040}
!23 = !{!"", !7, i64 0, !7, i64 64, !6, i64 68, !17, i64 72, !6, i64 104, !12, i64 112, !6, i64 120, !12, i64 128}
!24 = !{!"", !6, i64 0}
!25 = !{!"", !14, i64 0, !14, i64 16, !13, i64 32}
!26 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!27 = !{!"_IP6_FORM_CALLBACK_INFO", !6, i64 0, !12, i64 8, !28, i64 16, !12, i64 40, !12, i64 48}
!28 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !12, i64 0, !12, i64 8, !12, i64 16}
!29 = !{!"", !6, i64 0, !24, i64 4, !17, i64 8, !14, i64 16, !6, i64 32, !14, i64 40, !6, i64 56, !14, i64 64, !6, i64 80}
!30 = !{!31, !6, i64 0}
!31 = !{!"_IP6_ADDRESS_INFO", !6, i64 0, !14, i64 8, !17, i64 24, !7, i64 40, !7, i64 41, !6, i64 44, !6, i64 48}
!32 = !{!31, !7, i64 40}
!33 = !{!31, !7, i64 41}
!34 = !{!31, !6, i64 44}
!35 = !{!31, !6, i64 48}
!36 = !{!14, !12, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = distinct !{!39, !38}


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