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

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

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

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

21:                                               ; preds = %2
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._IP6_SERVICE, ptr %23, i32 0, i32 11
  %25 = call ptr @Ip6CreatePrefixListEntry(ptr noundef %22, i8 noundef zeroext 1, i32 noundef -1, i32 noundef -1, i8 noundef zeroext 64, ptr noundef %24)
  br label %26

26:                                               ; preds = %21, %2
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct._IP6_SERVICE, ptr %28, i32 0, i32 6
  %30 = load ptr, ptr %29, align 8, !tbaa !31
  %31 = getelementptr inbounds %struct._IP6_INTERFACE, ptr %30, i32 0, i32 3
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._IP6_SERVICE, ptr %32, i32 0, i32 6
  %34 = load ptr, ptr %33, align 8, !tbaa !31
  %35 = getelementptr inbounds %struct._IP6_INTERFACE, ptr %34, i32 0, i32 4
  %36 = call i64 @Ip6RemoveAddr(ptr noundef %27, ptr noundef %31, ptr noundef %35, ptr noundef null, i8 noundef zeroext 0)
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._IP6_SERVICE, ptr %37, i32 0, i32 5
  %39 = getelementptr inbounds %struct._LIST_ENTRY, ptr %38, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !32
  store ptr %40, ptr %5, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %116, %26
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._IP6_SERVICE, ptr %43, i32 0, i32 5
  %45 = icmp ne ptr %42, %44
  br i1 %45, label %46, label %120

46:                                               ; preds = %41
  %47 = call zeroext i8 @DebugAssertEnabled()
  %48 = zext i8 %47 to i32
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %60

50:                                               ; preds = %46
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = ptrtoint ptr %51 to i64
  %53 = sub i64 %52, ptrtoint (ptr getelementptr inbounds (%struct._IP6_INTERFACE, ptr null, i32 0, i32 1) to i64)
  %54 = inttoptr i64 %53 to ptr
  %55 = getelementptr inbounds %struct._IP6_INTERFACE, ptr %54, i32 0, i32 0
  %56 = load i32, ptr %55, align 8, !tbaa !33
  %57 = icmp ne i32 %56, 1228296265
  br i1 %57, label %58, label %60

58:                                               ; preds = %50
  call void @DebugAssert(ptr noundef @.str, i64 noundef 99, ptr noundef @.str.1)
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  br label %65

60:                                               ; preds = %50, %46
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = ptrtoint ptr %61 to i64
  %63 = sub i64 %62, ptrtoint (ptr getelementptr inbounds (%struct._IP6_INTERFACE, ptr null, i32 0, i32 1) to i64)
  %64 = inttoptr i64 %63 to ptr
  br label %65

65:                                               ; preds = %60, %58
  %66 = phi ptr [ %59, %58 ], [ %64, %60 ]
  store ptr %66, ptr %8, align 8, !tbaa !5
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._IP6_INTERFACE, ptr %67, i32 0, i32 12
  %69 = getelementptr inbounds %struct._LIST_ENTRY, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !35
  store ptr %70, ptr %6, align 8, !tbaa !5
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._LIST_ENTRY, ptr %71, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8, !tbaa !36
  store ptr %73, ptr %7, align 8, !tbaa !5
  br label %74

74:                                               ; preds = %110, %65
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._IP6_INTERFACE, ptr %76, i32 0, i32 12
  %78 = icmp ne ptr %75, %77
  br i1 %78, label %79, label %115

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

83:                                               ; preds = %79
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = ptrtoint ptr %84 to i64
  %86 = sub i64 %85, ptrtoint (ptr getelementptr inbounds (%struct._IP6_DAD_ENTRY, ptr null, i32 0, i32 1) to i64)
  %87 = inttoptr i64 %86 to ptr
  %88 = getelementptr inbounds %struct._IP6_DAD_ENTRY, ptr %87, i32 0, i32 0
  %89 = load i32, ptr %88, align 8, !tbaa !37
  %90 = icmp ne i32 %89, 1162104905
  br i1 %90, label %91, label %93

91:                                               ; preds = %83
  call void @DebugAssert(ptr noundef @.str, i64 noundef 102, ptr noundef @.str.1)
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  br label %98

93:                                               ; preds = %83, %79
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = ptrtoint ptr %94 to i64
  %96 = sub i64 %95, ptrtoint (ptr getelementptr inbounds (%struct._IP6_DAD_ENTRY, ptr null, i32 0, i32 1) to i64)
  %97 = inttoptr i64 %96 to ptr
  br label %98

98:                                               ; preds = %93, %91
  %99 = phi ptr [ %92, %91 ], [ %97, %93 ]
  store ptr %99, ptr %9, align 8, !tbaa !5
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct._IP6_DAD_ENTRY, ptr %100, i32 0, i32 6
  %102 = load ptr, ptr %101, align 8, !tbaa !39
  %103 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %102, i32 0, i32 2
  %104 = call zeroext i8 @NetIp6IsLinkLocalAddr(ptr noundef %103)
  %105 = icmp ne i8 %104, 0
  br i1 %105, label %109, label %106

106:                                              ; preds = %98
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  call void @Ip6OnDADFinished(i8 noundef zeroext 0, ptr noundef %107, ptr noundef %108)
  br label %109

109:                                              ; preds = %106, %98
  br label %110

110:                                              ; preds = %109
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %111, ptr %6, align 8, !tbaa !5
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._LIST_ENTRY, ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !36
  store ptr %114, ptr %7, align 8, !tbaa !5
  br label %74, !llvm.loop !40

115:                                              ; preds = %74
  br label %116

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

120:                                              ; preds = %41
  %121 = load i32, ptr %4, align 4, !tbaa !9
  %122 = icmp eq i32 %121, 1
  br i1 %122, label %123, label %130

123:                                              ; preds = %120
  %124 = load ptr, ptr %3, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._IP6_SERVICE, ptr %124, i32 0, i32 28
  store i8 0, ptr %125, align 8, !tbaa !43
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct._IP6_SERVICE, ptr %126, i32 0, i32 29
  store i8 3, ptr %127, align 1, !tbaa !44
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._IP6_SERVICE, ptr %128, i32 0, i32 30
  store i32 10, ptr %129, align 4, !tbaa !45
  br label %130

130:                                              ; preds = %123, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret void
}

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

declare void @Ip6CleanDefaultRouterList(ptr noundef) #2

declare void @Ip6CleanPrefixListTable(ptr noundef, ptr noundef) #2

declare ptr @Ip6CreatePrefixListEntry(ptr noundef, i8 noundef zeroext, i32 noundef, i32 noundef, i8 noundef zeroext, ptr noundef) #2

declare i64 @Ip6RemoveAddr(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext) #2

declare zeroext i8 @DebugAssertEnabled() #2

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

declare zeroext i8 @NetIp6IsLinkLocalAddr(ptr noundef) #2

declare void @Ip6OnDADFinished(i8 noundef zeroext, ptr 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 = !{!12, !6, i64 72}
!32 = !{!12, !6, i64 56}
!33 = !{!34, !10, i64 0}
!34 = !{!"_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}
!35 = !{!34, !6, i64 120}
!36 = !{!15, !6, i64 0}
!37 = !{!38, !10, i64 0}
!38 = !{!"_IP6_DAD_ENTRY", !10, i64 0, !15, i64 8, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !6, i64 40, !18, i64 48, !6, i64 64, !6, i64 72}
!39 = !{!38, !6, i64 40}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}
!42 = distinct !{!42, !41}
!43 = !{!12, !7, i64 2312}
!44 = !{!12, !7, i64 2313}
!45 = !{!12, !10, i64 2316}


; 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 [135 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @Ip6ConfigOnPolicyChanged(ptr noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  tail call void @Ip6CleanDefaultRouterList(ptr noundef %0) #2
  %3 = getelementptr inbounds i8, ptr %0, i64 2248
  tail call void @Ip6CleanPrefixListTable(ptr noundef %0, ptr noundef nonnull %3) #2
  %4 = getelementptr inbounds i8, ptr %0, i64 2264
  tail call void @Ip6CleanPrefixListTable(ptr noundef %0, ptr noundef nonnull %4) #2
  %5 = getelementptr inbounds i8, ptr %0, i64 2208
  %6 = load i8, ptr %5, align 8, !tbaa !5
  %.not = icmp eq i8 %6, 0
  br i1 %.not, label %10, label %7

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %0, i64 2192
  %9 = tail call ptr @Ip6CreatePrefixListEntry(ptr noundef nonnull %0, i8 noundef zeroext 1, i32 noundef -1, i32 noundef -1, i8 noundef zeroext 64, ptr noundef nonnull %8) #2
  br label %10

10:                                               ; preds = %7, %2
  %11 = getelementptr inbounds i8, ptr %0, i64 72
  %12 = load ptr, ptr %11, align 8, !tbaa !29
  %13 = getelementptr inbounds i8, ptr %12, i64 32
  %14 = getelementptr inbounds i8, ptr %12, i64 48
  %15 = tail call i64 @Ip6RemoveAddr(ptr noundef nonnull %0, ptr noundef nonnull %13, ptr noundef nonnull %14, ptr noundef null, i8 noundef zeroext 0) #2
  %16 = getelementptr inbounds i8, ptr %0, i64 56
  %.046 = load ptr, ptr %16, align 8, !tbaa !30
  %.not3547 = icmp eq ptr %.046, %16
  br i1 %.not3547, label %._crit_edge, label %.lr.ph49

.loopexit:                                        ; preds = %34, %.lr.ph49._crit_edge
  %.0 = load ptr, ptr %.048, align 8, !tbaa !30
  %.not35 = icmp eq ptr %.0, %16
  br i1 %.not35, label %._crit_edge, label %.lr.ph49, !llvm.loop !31

.lr.ph49:                                         ; preds = %10, %.loopexit
  %.048 = phi ptr [ %.0, %.loopexit ], [ %.046, %10 ]
  %17 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not36 = icmp eq i8 %17, 0
  %.pre = ptrtoint ptr %.048 to i64
  %.pre50 = add i64 %.pre, -8
  %.pre52 = inttoptr i64 %.pre50 to ptr
  br i1 %.not36, label %.lr.ph49._crit_edge, label %18

18:                                               ; preds = %.lr.ph49
  %19 = load i32, ptr %.pre52, align 8, !tbaa !33
  %.not37 = icmp eq i32 %19, 1228296265
  br i1 %.not37, label %.lr.ph49._crit_edge, label %20

20:                                               ; preds = %18
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 99, ptr noundef nonnull @.str.1) #2
  br label %.lr.ph49._crit_edge

.lr.ph49._crit_edge:                              ; preds = %.lr.ph49, %18, %20
  %21 = phi ptr [ %.048, %20 ], [ %.pre52, %18 ], [ %.pre52, %.lr.ph49 ]
  %22 = getelementptr inbounds i8, ptr %21, i64 120
  %23 = load ptr, ptr %22, align 8, !tbaa !35
  %.not3843 = icmp eq ptr %23, %22
  br i1 %.not3843, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph49._crit_edge, %34
  %.03344 = phi ptr [ %.03445, %34 ], [ %23, %.lr.ph49._crit_edge ]
  %.03445 = load ptr, ptr %.03344, align 8, !tbaa !30
  %24 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not39 = icmp eq i8 %24, 0
  %.pre54 = ptrtoint ptr %.03344 to i64
  %.pre56 = add i64 %.pre54, -8
  %.pre58 = inttoptr i64 %.pre56 to ptr
  br i1 %.not39, label %.lr.ph._crit_edge, label %25

25:                                               ; preds = %.lr.ph
  %26 = load i32, ptr %.pre58, align 8, !tbaa !36
  %.not40 = icmp eq i32 %26, 1162104905
  br i1 %.not40, label %.lr.ph._crit_edge, label %27

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

.lr.ph._crit_edge:                                ; preds = %.lr.ph, %25, %27
  %28 = phi ptr [ %.03344, %27 ], [ %.pre58, %25 ], [ %.pre58, %.lr.ph ]
  %29 = getelementptr inbounds i8, ptr %28, i64 40
  %30 = load ptr, ptr %29, align 8, !tbaa !38
  %31 = getelementptr inbounds i8, ptr %30, i64 24
  %32 = tail call zeroext i8 @NetIp6IsLinkLocalAddr(ptr noundef nonnull %31) #2
  %.not41 = icmp eq i8 %32, 0
  br i1 %.not41, label %33, label %34

33:                                               ; preds = %.lr.ph._crit_edge
  tail call void @Ip6OnDADFinished(i8 noundef zeroext 0, ptr noundef %21, ptr noundef nonnull %28) #2
  br label %34

34:                                               ; preds = %.lr.ph._crit_edge, %33
  %.not38 = icmp eq ptr %.03445, %22
  br i1 %.not38, label %.loopexit, label %.lr.ph, !llvm.loop !39

._crit_edge:                                      ; preds = %.loopexit, %10
  %35 = icmp eq i32 %1, 1
  br i1 %35, label %36, label %40

36:                                               ; preds = %._crit_edge
  %37 = getelementptr inbounds i8, ptr %0, i64 2312
  store i8 0, ptr %37, align 8, !tbaa !40
  %38 = getelementptr inbounds i8, ptr %0, i64 2313
  store i8 3, ptr %38, align 1, !tbaa !41
  %39 = getelementptr inbounds i8, ptr %0, i64 2316
  store i32 10, ptr %39, align 4, !tbaa !42
  br label %40

40:                                               ; preds = %36, %._crit_edge
  ret void
}

declare void @Ip6CleanDefaultRouterList(ptr noundef) local_unnamed_addr #1

declare void @Ip6CleanPrefixListTable(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @Ip6CreatePrefixListEntry(ptr noundef, i8 noundef zeroext, i32 noundef, i32 noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #1

declare i64 @Ip6RemoveAddr(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext) 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 zeroext i8 @NetIp6IsLinkLocalAddr(ptr noundef) local_unnamed_addr #1

declare void @Ip6OnDADFinished(i8 noundef zeroext, ptr 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 = !{!6, !11, i64 72}
!30 = !{!13, !11, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!34, !7, i64 0}
!34 = !{!"_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}
!35 = !{!34, !11, i64 120}
!36 = !{!37, !7, i64 0}
!37 = !{!"_IP6_DAD_ENTRY", !7, i64 0, !13, i64 8, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !11, i64 40, !16, i64 48, !11, i64 64, !11, i64 72}
!38 = !{!37, !11, i64 40}
!39 = distinct !{!39, !32}
!40 = !{!6, !8, i64 2312}
!41 = !{!6, !8, i64 2313}
!42 = !{!6, !7, i64 2316}


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