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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip6BuildEfiAddressList(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 i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = 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 4, 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
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = icmp eq ptr %13, null
  br i1 %14, label %15, label %16

15:                                               ; preds = %3
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %131

16:                                               ; preds = %3
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct._IP6_SERVICE, ptr %17, i32 0, i32 12
  %19 = load i8, ptr %18, align 8, !tbaa !9
  %20 = icmp ne i8 %19, 0
  br i1 %20, label %21, label %28

21:                                               ; preds = %16
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct._IP6_SERVICE, ptr %22, i32 0, i32 6
  %24 = load ptr, ptr %23, align 8, !tbaa !30
  %25 = getelementptr inbounds %struct._IP6_INTERFACE, ptr %24, i32 0, i32 4
  %26 = load i32, ptr %25, align 8, !tbaa !31
  %27 = add i32 1, %26
  store i32 %27, ptr %8, align 4, !tbaa !33
  br label %29

28:                                               ; preds = %16
  store i32 0, ptr %8, align 4, !tbaa !33
  br label %29

29:                                               ; preds = %28, %21
  %30 = load i32, ptr %8, align 4, !tbaa !33
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 %30, ptr %31, align 4, !tbaa !33
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = icmp eq ptr %32, null
  br i1 %33, label %37, label %34

34:                                               ; preds = %29
  %35 = load i32, ptr %8, align 4, !tbaa !33
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %34, %29
  store i64 0, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %131

38:                                               ; preds = %34
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = load ptr, ptr %39, align 8, !tbaa !5
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %53

42:                                               ; preds = %38
  %43 = load i32, ptr %8, align 4, !tbaa !33
  %44 = zext i32 %43 to i64
  %45 = mul i64 17, %44
  %46 = call ptr @AllocatePool(i64 noundef %45)
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %46, ptr %47, align 8, !tbaa !5
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  %50 = icmp eq ptr %49, null
  br i1 %50, label %51, label %52

51:                                               ; preds = %42
  store i64 -9223372036854775799, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %131

52:                                               ; preds = %42
  br label %53

53:                                               ; preds = %52, %38
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = load ptr, ptr %54, align 8, !tbaa !5
  store ptr %55, ptr %10, align 8, !tbaa !5
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.EFI_IP6_ADDRESS_INFO, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._IP6_SERVICE, ptr %58, i32 0, i32 11
  %60 = call ptr @CopyMem(ptr noundef %57, ptr noundef %59, i64 noundef 16)
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.EFI_IP6_ADDRESS_INFO, ptr %61, i32 0, i32 1
  store i8 64, ptr %62, align 1, !tbaa !34
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.EFI_IP6_ADDRESS_INFO, ptr %63, i32 1
  store ptr %64, ptr %10, align 8, !tbaa !5
  store i32 1, ptr %8, align 4, !tbaa !33
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._IP6_SERVICE, ptr %65, i32 0, i32 6
  %67 = load ptr, ptr %66, align 8, !tbaa !30
  %68 = getelementptr inbounds %struct._IP6_INTERFACE, ptr %67, i32 0, i32 3
  %69 = getelementptr inbounds %struct._LIST_ENTRY, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !36
  store ptr %70, ptr %9, align 8, !tbaa !5
  br label %71

71:                                               ; preds = %113, %53
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._IP6_SERVICE, ptr %73, i32 0, i32 6
  %75 = load ptr, ptr %74, align 8, !tbaa !30
  %76 = getelementptr inbounds %struct._IP6_INTERFACE, ptr %75, i32 0, i32 3
  %77 = icmp ne ptr %72, %76
  br i1 %77, label %78, label %117

78:                                               ; preds = %71
  %79 = call zeroext i8 @DebugAssertEnabled()
  %80 = zext i8 %79 to i32
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %92

82:                                               ; preds = %78
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = ptrtoint ptr %83 to i64
  %85 = sub i64 %84, ptrtoint (ptr getelementptr inbounds (%struct._IP6_ADDRESS_INFO, ptr null, i32 0, i32 1) to i64)
  %86 = inttoptr i64 %85 to ptr
  %87 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %86, i32 0, i32 0
  %88 = load i32, ptr %87, align 8, !tbaa !37
  %89 = icmp ne i32 %88, 1229017161
  br i1 %89, label %90, label %92

90:                                               ; preds = %82
  call void @DebugAssert(ptr noundef @.str, i64 noundef 78, ptr noundef @.str.1)
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  br label %97

92:                                               ; preds = %82, %78
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = ptrtoint ptr %93 to i64
  %95 = sub i64 %94, ptrtoint (ptr getelementptr inbounds (%struct._IP6_ADDRESS_INFO, ptr null, i32 0, i32 1) to i64)
  %96 = inttoptr i64 %95 to ptr
  br label %97

97:                                               ; preds = %92, %90
  %98 = phi ptr [ %91, %90 ], [ %96, %92 ]
  store ptr %98, ptr %11, align 8, !tbaa !5
  %99 = load ptr, ptr %10, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.EFI_IP6_ADDRESS_INFO, ptr %99, i32 0, i32 0
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %101, i32 0, i32 2
  %103 = call ptr @CopyMem(ptr noundef %100, ptr noundef %102, i64 noundef 16)
  %104 = load ptr, ptr %11, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %104, i32 0, i32 4
  %106 = load i8, ptr %105, align 1, !tbaa !39
  %107 = load ptr, ptr %10, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.EFI_IP6_ADDRESS_INFO, ptr %107, i32 0, i32 1
  store i8 %106, ptr %108, align 1, !tbaa !34
  %109 = load ptr, ptr %10, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.EFI_IP6_ADDRESS_INFO, ptr %109, i32 1
  store ptr %110, ptr %10, align 8, !tbaa !5
  %111 = load i32, ptr %8, align 4, !tbaa !33
  %112 = add i32 %111, 1
  store i32 %112, ptr %8, align 4, !tbaa !33
  br label %113

113:                                              ; preds = %97
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._LIST_ENTRY, ptr %114, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !40
  store ptr %116, ptr %9, align 8, !tbaa !5
  br label %71, !llvm.loop !41

117:                                              ; preds = %71
  br label %118

118:                                              ; preds = %117
  %119 = call zeroext i8 @DebugAssertEnabled()
  %120 = icmp ne i8 %119, 0
  br i1 %120, label %121, label %128

121:                                              ; preds = %118
  %122 = load i32, ptr %8, align 4, !tbaa !33
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = load i32, ptr %123, align 4, !tbaa !33
  %125 = icmp eq i32 %122, %124
  br i1 %125, label %127, label %126

126:                                              ; preds = %121
  call void @DebugAssert(ptr noundef @.str, i64 noundef 87, ptr noundef @.str.2)
  br label %127

127:                                              ; preds = %126, %121
  br label %128

128:                                              ; preds = %127, %118
  br label %129

129:                                              ; preds = %128
  br label %130

130:                                              ; preds = %129
  store i64 0, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %131

131:                                              ; preds = %130, %51, %37, %15
  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 4, ptr %8) #3
  %132 = load i64, ptr %4, align 8
  ret i64 %132
}

; 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 zeroext i8 @DebugAssertEnabled() #2

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @Ip6BuildEfiAddressList(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = icmp eq ptr %1, null
  br i1 %4, label %49, label %5

5:                                                ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 2208
  %7 = load i8, ptr %6, align 8, !tbaa !5
  %.not = icmp eq i8 %7, 0
  br i1 %.not, label %.thread, label %8

.thread:                                          ; preds = %5
  store i32 0, ptr %1, align 4, !tbaa !29
  br label %49

8:                                                ; preds = %5
  %9 = getelementptr inbounds i8, ptr %0, i64 72
  %10 = load ptr, ptr %9, align 8, !tbaa !30
  %11 = getelementptr inbounds i8, ptr %10, i64 48
  %12 = load i32, ptr %11, align 8, !tbaa !31
  %13 = add i32 %12, 1
  store i32 %13, ptr %1, align 4, !tbaa !29
  %14 = icmp eq ptr %2, null
  %15 = icmp eq i32 %13, 0
  %or.cond = select i1 %14, i1 true, i1 %15
  br i1 %or.cond, label %49, label %16

16:                                               ; preds = %8
  %17 = load ptr, ptr %2, align 8, !tbaa !33
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %24

19:                                               ; preds = %16
  %20 = zext i32 %13 to i64
  %21 = mul nuw nsw i64 %20, 17
  %22 = tail call ptr @AllocatePool(i64 noundef %21) #2
  store ptr %22, ptr %2, align 8, !tbaa !33
  %23 = icmp eq ptr %22, null
  br i1 %23, label %49, label %24

24:                                               ; preds = %19, %16
  %25 = phi ptr [ %22, %19 ], [ %17, %16 ]
  %26 = getelementptr inbounds i8, ptr %0, i64 2192
  %27 = tail call ptr @CopyMem(ptr noundef nonnull %25, ptr noundef nonnull %26, i64 noundef 16) #2
  %28 = getelementptr inbounds i8, ptr %25, i64 16
  store i8 64, ptr %28, align 1, !tbaa !34
  %29 = load ptr, ptr %9, align 8, !tbaa !30
  %30 = getelementptr inbounds i8, ptr %29, i64 32
  %.03344 = load ptr, ptr %30, align 8, !tbaa !36
  %.not3745 = icmp eq ptr %.03344, %30
  br i1 %.not3745, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %24, %.lr.ph._crit_edge
  %.03349 = phi ptr [ %.033, %.lr.ph._crit_edge ], [ %.03344, %24 ]
  %.pn47 = phi ptr [ %.03248, %.lr.ph._crit_edge ], [ %25, %24 ]
  %.146 = phi i32 [ %41, %.lr.ph._crit_edge ], [ 1, %24 ]
  %.03248 = getelementptr inbounds i8, ptr %.pn47, i64 17
  %31 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not39 = icmp eq i8 %31, 0
  %.pre = ptrtoint ptr %.03349 to i64
  %.pre50 = add i64 %.pre, -8
  %.pre52 = inttoptr i64 %.pre50 to ptr
  br i1 %.not39, label %.lr.ph._crit_edge, label %32

32:                                               ; preds = %.lr.ph
  %33 = load i32, ptr %.pre52, align 8, !tbaa !37
  %.not40 = icmp eq i32 %33, 1229017161
  br i1 %.not40, label %.lr.ph._crit_edge, label %34

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

.lr.ph._crit_edge:                                ; preds = %.lr.ph, %32, %34
  %35 = phi ptr [ %.03349, %34 ], [ %.pre52, %32 ], [ %.pre52, %.lr.ph ]
  %36 = getelementptr inbounds i8, ptr %35, i64 24
  %37 = tail call ptr @CopyMem(ptr noundef nonnull %.03248, ptr noundef nonnull %36, i64 noundef 16) #2
  %38 = getelementptr inbounds i8, ptr %35, i64 41
  %39 = load i8, ptr %38, align 1, !tbaa !39
  %40 = getelementptr inbounds i8, ptr %.pn47, i64 33
  store i8 %39, ptr %40, align 1, !tbaa !34
  %41 = add i32 %.146, 1
  %.033 = load ptr, ptr %.03349, align 8, !tbaa !36
  %42 = load ptr, ptr %9, align 8, !tbaa !30
  %43 = getelementptr inbounds i8, ptr %42, i64 32
  %.not37 = icmp eq ptr %.033, %43
  br i1 %.not37, label %._crit_edge, label %.lr.ph, !llvm.loop !40

._crit_edge:                                      ; preds = %.lr.ph._crit_edge, %24
  %.1.lcssa = phi i32 [ 1, %24 ], [ %41, %.lr.ph._crit_edge ]
  %44 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not38 = icmp eq i8 %44, 0
  br i1 %.not38, label %49, label %45

45:                                               ; preds = %._crit_edge
  %46 = load i32, ptr %1, align 4, !tbaa !29
  %47 = icmp eq i32 %.1.lcssa, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %45
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 87, ptr noundef nonnull @.str.2) #2
  br label %49

49:                                               ; preds = %.thread, %._crit_edge, %48, %45, %19, %8, %3
  %.0 = phi i64 [ -9223372036854775806, %3 ], [ 0, %8 ], [ -9223372036854775799, %19 ], [ 0, %45 ], [ 0, %48 ], [ 0, %._crit_edge ], [ 0, %.thread ]
  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 zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

declare void @DebugAssert(ptr noundef, 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, !8, i64 2208}
!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 = !{!7, !7, i64 0}
!30 = !{!6, !11, i64 72}
!31 = !{!32, !7, i64 48}
!32 = !{!"_IP6_INTERFACE", !7, i64 0, !13, i64 8, !12, i64 24, !13, i64 32, !7, i64 48, !8, i64 52, !11, i64 56, !11, i64 64, !11, i64 72, !13, i64 80, !13, i64 96, !7, i64 112, !13, i64 120, !13, i64 136, !13, i64 152, !8, i64 168}
!33 = !{!11, !11, i64 0}
!34 = !{!35, !8, i64 16}
!35 = !{!"", !16, i64 0, !8, i64 16}
!36 = !{!13, !11, i64 0}
!37 = !{!38, !7, i64 0}
!38 = !{!"_IP6_ADDRESS_INFO", !7, i64 0, !13, i64 8, !16, i64 24, !8, i64 40, !8, i64 41, !7, i64 44, !7, i64 48}
!39 = !{!38, !8, i64 41}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}


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