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

; 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_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._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_IP6_CONFIG_INTERFACE_INFO = type { [32 x i16], i8, i32, %struct.EFI_MAC_ADDRESS, i32, ptr, i32, ptr }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%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_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.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 }

@.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
declare dso_local void @Ip6ConfigOnPolicyChanged(ptr noundef, i32 noundef) #0

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

declare zeroext i8 @DebugAssertEnabled() #2

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Ip6ConfigSignalEvent(ptr noundef, ptr noundef, ptr noundef) #0

declare void @FreePool(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip6ConfigSetPolicy(ptr noundef %0, i64 noundef %1, ptr noundef %2) #0 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  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
  %12 = load i64, ptr %6, align 8, !tbaa !9
  %13 = icmp ne i64 %12, 4
  br i1 %13, label %14, label %15

14:                                               ; preds = %3
  store i64 -9223372036854775804, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %121

15:                                               ; preds = %3
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  %17 = load i32, ptr %16, align 4, !tbaa !11
  store i32 %17, ptr %8, align 4, !tbaa !11
  %18 = load i32, ptr %8, align 4, !tbaa !11
  %19 = icmp ugt i32 %18, 1
  br i1 %19, label %20, label %21

20:                                               ; preds = %15
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %121

21:                                               ; preds = %15
  %22 = load i32, ptr %8, align 4, !tbaa !11
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._IP6_CONFIG_INSTANCE, ptr %23, i32 0, i32 6
  %25 = load i32, ptr %24, align 8, !tbaa !13
  %26 = icmp eq i32 %22, %25
  br i1 %26, label %27, label %28

27:                                               ; preds = %21
  store i64 -9223372036854775787, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %121

28:                                               ; preds = %21
  %29 = load i32, ptr %8, align 4, !tbaa !11
  %30 = icmp eq i32 %29, 1
  br i1 %30, label %31, label %86

31:                                               ; preds = %28
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._IP6_CONFIG_INSTANCE, ptr %32, i32 0, i32 8
  %34 = getelementptr inbounds [7 x %struct.IP6_CONFIG_DATA_ITEM], ptr %33, i64 0, i64 4
  store ptr %34, ptr %9, align 8, !tbaa !5
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %35, i32 0, i32 5
  %37 = load ptr, ptr %36, align 8, !tbaa !25
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %43

39:                                               ; preds = %31
  %40 = load ptr, ptr %9, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %40, i32 0, i32 5
  %42 = load ptr, ptr %41, align 8, !tbaa !25
  call void @FreePool(ptr noundef %42)
  br label %43

43:                                               ; preds = %39, %31
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %44, i32 0, i32 5
  store ptr null, ptr %45, align 8, !tbaa !25
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %46, i32 0, i32 6
  store i64 0, ptr %47, align 8, !tbaa !26
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %48, i32 0, i32 2
  store i64 -9223372036854775794, ptr %49, align 8, !tbaa !28
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %50, i32 0, i32 4
  %52 = call i64 @NetMapIterate(ptr noundef %51, ptr noundef @Ip6ConfigSignalEvent, ptr noundef null)
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._IP6_CONFIG_INSTANCE, ptr %53, i32 0, i32 8
  %55 = getelementptr inbounds [7 x %struct.IP6_CONFIG_DATA_ITEM], ptr %54, i64 0, i64 5
  store ptr %55, ptr %9, align 8, !tbaa !5
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %56, i32 0, i32 5
  %58 = load ptr, ptr %57, align 8, !tbaa !25
  %59 = icmp ne ptr %58, null
  br i1 %59, label %60, label %64

60:                                               ; preds = %43
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %61, i32 0, i32 5
  %63 = load ptr, ptr %62, align 8, !tbaa !25
  call void @FreePool(ptr noundef %63)
  br label %64

64:                                               ; preds = %60, %43
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %65, i32 0, i32 5
  store ptr null, ptr %66, align 8, !tbaa !25
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %67, i32 0, i32 6
  store i64 0, ptr %68, align 8, !tbaa !26
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %69, i32 0, i32 2
  store i64 -9223372036854775794, ptr %70, align 8, !tbaa !28
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %71, i32 0, i32 4
  %73 = call i64 @NetMapIterate(ptr noundef %72, ptr noundef @Ip6ConfigSignalEvent, ptr noundef null)
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct._IP6_CONFIG_INSTANCE, ptr %74, i32 0, i32 8
  %76 = getelementptr inbounds [7 x %struct.IP6_CONFIG_DATA_ITEM], ptr %75, i64 0, i64 6
  store ptr %76, ptr %9, align 8, !tbaa !5
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %77, i32 0, i32 5
  store ptr null, ptr %78, align 8, !tbaa !25
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %79, i32 0, i32 6
  store i64 0, ptr %80, align 8, !tbaa !26
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %81, i32 0, i32 2
  store i64 -9223372036854775794, ptr %82, align 8, !tbaa !28
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %83, i32 0, i32 4
  %85 = call i64 @NetMapIterate(ptr noundef %84, ptr noundef @Ip6ConfigSignalEvent, ptr noundef null)
  br label %95

86:                                               ; preds = %28
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._IP6_CONFIG_INSTANCE, ptr %87, i32 0, i32 14
  %89 = load ptr, ptr %88, align 8, !tbaa !29
  %90 = icmp ne ptr %89, null
  br i1 %90, label %91, label %94

91:                                               ; preds = %86
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = call i64 @Ip6ConfigDestroyDhcp6(ptr noundef %92)
  br label %94

94:                                               ; preds = %91, %86
  br label %95

95:                                               ; preds = %94, %64
  %96 = call zeroext i8 @DebugAssertEnabled()
  %97 = zext i8 %96 to i32
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %109

99:                                               ; preds = %95
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = ptrtoint ptr %100 to i64
  %102 = sub i64 %101, ptrtoint (ptr getelementptr inbounds (%struct._IP6_SERVICE, ptr null, i32 0, i32 39) to i64)
  %103 = inttoptr i64 %102 to ptr
  %104 = getelementptr inbounds %struct._IP6_SERVICE, ptr %103, i32 0, i32 0
  %105 = load i32, ptr %104, align 8, !tbaa !30
  %106 = icmp ne i32 %105, 1396068425
  br i1 %106, label %107, label %109

107:                                              ; preds = %99
  call void @DebugAssert(ptr noundef @.str, i64 noundef 698, ptr noundef @.str.1)
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  br label %114

109:                                              ; preds = %99, %95
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = ptrtoint ptr %110 to i64
  %112 = sub i64 %111, ptrtoint (ptr getelementptr inbounds (%struct._IP6_SERVICE, ptr null, i32 0, i32 39) to i64)
  %113 = inttoptr i64 %112 to ptr
  br label %114

114:                                              ; preds = %109, %107
  %115 = phi ptr [ %108, %107 ], [ %113, %109 ]
  store ptr %115, ptr %10, align 8, !tbaa !5
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  %117 = load i32, ptr %8, align 4, !tbaa !11
  call void @Ip6ConfigOnPolicyChanged(ptr noundef %116, i32 noundef %117)
  %118 = load i32, ptr %8, align 4, !tbaa !11
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._IP6_CONFIG_INSTANCE, ptr %119, i32 0, i32 6
  store i32 %118, ptr %120, align 8, !tbaa !13
  store i64 0, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %121

121:                                              ; preds = %114, %27, %20, %14
  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
  %122 = load i64, ptr %4, align 8
  ret i64 %122
}

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Ip6ConfigDestroyDhcp6(ptr noundef) #0

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


; 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
declare dso_local void @Ip6ConfigOnPolicyChanged(ptr noundef, i32 noundef) local_unnamed_addr #0

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Ip6ConfigSignalEvent(ptr noundef, ptr noundef, ptr noundef) #0

declare void @FreePool(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @Ip6ConfigSetPolicy(ptr noundef %0, i64 noundef %1, ptr nocapture noundef readonly %2) local_unnamed_addr #0 {
  %.not = icmp eq i64 %1, 4
  br i1 %.not, label %4, label %43

4:                                                ; preds = %3
  %5 = load i32, ptr %2, align 4, !tbaa !5
  %6 = icmp ugt i32 %5, 1
  br i1 %6, label %43, label %7

7:                                                ; preds = %4
  %8 = getelementptr inbounds i8, ptr %0, i64 176
  %9 = load i32, ptr %8, align 8, !tbaa !9
  %10 = icmp eq i32 %5, %9
  br i1 %10, label %43, label %11

11:                                               ; preds = %7
  %12 = icmp eq i32 %5, 1
  br i1 %12, label %13, label %32

13:                                               ; preds = %11
  %14 = getelementptr inbounds i8, ptr %0, i64 608
  %15 = load ptr, ptr %14, align 8, !tbaa !23
  %.not38 = icmp eq ptr %15, null
  br i1 %.not38, label %17, label %16

16:                                               ; preds = %13
  tail call void @FreePool(ptr noundef nonnull %15) #3
  br label %17

17:                                               ; preds = %16, %13
  %18 = getelementptr inbounds i8, ptr %0, i64 552
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %14, i8 0, i64 16, i1 false)
  store i64 -9223372036854775794, ptr %18, align 8, !tbaa !24
  %19 = getelementptr inbounds i8, ptr %0, i64 568
  %20 = tail call i64 @NetMapIterate(ptr noundef nonnull %19, ptr noundef nonnull @Ip6ConfigSignalEvent, ptr noundef null) #3
  %21 = getelementptr inbounds i8, ptr %0, i64 696
  %22 = load ptr, ptr %21, align 8, !tbaa !23
  %.not39 = icmp eq ptr %22, null
  br i1 %.not39, label %24, label %23

23:                                               ; preds = %17
  tail call void @FreePool(ptr noundef nonnull %22) #3
  br label %24

24:                                               ; preds = %23, %17
  %25 = getelementptr inbounds i8, ptr %0, i64 640
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %21, i8 0, i64 16, i1 false)
  store i64 -9223372036854775794, ptr %25, align 8, !tbaa !24
  %26 = getelementptr inbounds i8, ptr %0, i64 656
  %27 = tail call i64 @NetMapIterate(ptr noundef nonnull %26, ptr noundef nonnull @Ip6ConfigSignalEvent, ptr noundef null) #3
  %28 = getelementptr inbounds i8, ptr %0, i64 784
  %29 = getelementptr inbounds i8, ptr %0, i64 728
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %28, i8 0, i64 16, i1 false)
  store i64 -9223372036854775794, ptr %29, align 8, !tbaa !24
  %30 = getelementptr inbounds i8, ptr %0, i64 744
  %31 = tail call i64 @NetMapIterate(ptr noundef nonnull %30, ptr noundef nonnull @Ip6ConfigSignalEvent, ptr noundef null) #3
  br label %37

32:                                               ; preds = %11
  %33 = getelementptr inbounds i8, ptr %0, i64 928
  %34 = load ptr, ptr %33, align 8, !tbaa !26
  %.not37 = icmp eq ptr %34, null
  br i1 %.not37, label %37, label %35

35:                                               ; preds = %32
  %36 = tail call i64 @Ip6ConfigDestroyDhcp6(ptr noundef nonnull %0)
  br label %37

37:                                               ; preds = %32, %35, %24
  %38 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not40 = icmp eq i8 %38, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre42 = add i64 %.pre, -3048
  %.pre44 = inttoptr i64 %.pre42 to ptr
  br i1 %.not40, label %._crit_edge, label %39

39:                                               ; preds = %37
  %40 = load i32, ptr %.pre44, align 8, !tbaa !27
  %.not41 = icmp eq i32 %40, 1396068425
  br i1 %.not41, label %._crit_edge, label %41

41:                                               ; preds = %39
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 698, ptr noundef nonnull @.str.1) #3
  br label %._crit_edge

._crit_edge:                                      ; preds = %37, %39, %41
  %42 = phi ptr [ %0, %41 ], [ %.pre44, %39 ], [ %.pre44, %37 ]
  tail call void @Ip6ConfigOnPolicyChanged(ptr noundef %42, i32 noundef %5)
  store i32 %5, ptr %8, align 8, !tbaa !9
  br label %43

43:                                               ; preds = %7, %4, %3, %._crit_edge
  %.0 = phi i64 [ 0, %._crit_edge ], [ -9223372036854775804, %3 ], [ -9223372036854775806, %4 ], [ -9223372036854775787, %7 ]
  ret i64 %.0
}

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Ip6ConfigDestroyDhcp6(ptr noundef) local_unnamed_addr #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 176}
!10 = !{!"_IP6_CONFIG_INSTANCE", !6, i64 0, !7, i64 4, !11, i64 8, !13, i64 24, !14, i64 32, !15, i64 168, !6, i64 176, !16, i64 180, !7, i64 184, !17, i64 800, !17, i64 840, !19, 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, !20, i64 984, !22, i64 1040}
!11 = !{!"_LIST_ENTRY", !12, i64 0, !12, i64 8}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!"", !7, i64 0, !7, i64 64, !6, i64 68, !15, i64 72, !6, i64 104, !12, i64 112, !6, i64 120, !12, i64 128}
!15 = !{!"", !7, i64 0}
!16 = !{!"", !6, i64 0}
!17 = !{!"", !11, i64 0, !11, i64 16, !18, i64 32}
!18 = !{!"long long", !7, i64 0}
!19 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!20 = !{!"_IP6_FORM_CALLBACK_INFO", !6, i64 0, !12, i64 8, !21, i64 16, !12, i64 40, !12, i64 48}
!21 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !12, i64 0, !12, i64 8, !12, i64 16}
!22 = !{!"", !6, i64 0, !16, i64 4, !15, i64 8, !11, i64 16, !6, i64 32, !11, i64 40, !6, i64 56, !11, i64 64, !6, i64 80}
!23 = !{!7, !7, i64 0}
!24 = !{!25, !18, i64 16}
!25 = !{!"", !12, i64 0, !12, i64 8, !18, i64 16, !7, i64 24, !17, i64 32, !7, i64 72, !18, i64 80}
!26 = !{!10, !12, i64 928}
!27 = !{!28, !6, i64 0}
!28 = !{!"_IP6_SERVICE", !6, i64 0, !29, i64 8, !18, i64 24, !18, i64 32, !11, i64 40, !11, i64 56, !12, i64 72, !12, i64 80, !30, i64 88, !15, i64 136, !32, i64 2168, !15, 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, !11, i64 2232, !11, i64 2248, !11, i64 2264, !11, 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, !33, i64 2352, !34, i64 2372, !12, i64 3032, !12, i64 3040, !10, i64 3048, !12, i64 4176, !6, i64 4184, !6, i64 4188}
!29 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !12, i64 0, !12, i64 8}
!30 = !{!"", !6, i64 0, !12, i64 8, !12, i64 16, !31, i64 24}
!31 = !{!"", !12, i64 0, !18, i64 8, !7, i64 16}
!32 = !{!"", !18, i64 0, !11, i64 8}
!33 = !{!"", !6, i64 0, !6, i64 4, !13, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!34 = !{!"", !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, !15, i64 552, !15, i64 584, !15, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}


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