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

; 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 }
%struct.EFI_BOOT_SERVICES = type { %struct.EFI_TABLE_HEADER, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, 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
@gBS = external global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [107 x i8], align 1

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

declare zeroext i8 @DebugAssertEnabled() #1

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

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

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

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

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

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

17:                                               ; preds = %4
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %21

20:                                               ; preds = %17, %4
  store i64 -9223372036854775806, ptr %5, align 8
  store i32 1, ptr %14, align 4
  br label %159

21:                                               ; preds = %17
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = icmp uge i32 %22, 7
  br i1 %23, label %24, label %25

24:                                               ; preds = %21
  store i64 -9223372036854775805, ptr %5, align 8
  store i32 1, ptr %14, align 4
  br label %159

25:                                               ; preds = %21
  %26 = call zeroext i8 @DebugAssertEnabled()
  %27 = zext i8 %26 to i32
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %39

29:                                               ; preds = %25
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = ptrtoint ptr %30 to i64
  %32 = sub i64 %31, ptrtoint (ptr getelementptr inbounds (%struct._IP6_CONFIG_INSTANCE, ptr null, i32 0, i32 11) to i64)
  %33 = inttoptr i64 %32 to ptr
  %34 = getelementptr inbounds %struct._IP6_CONFIG_INSTANCE, ptr %33, i32 0, i32 0
  %35 = load i32, ptr %34, align 8, !tbaa !13
  %36 = icmp ne i32 %35, 1127632969
  br i1 %36, label %37, label %39

37:                                               ; preds = %29
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1848, ptr noundef @.str.1)
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  br label %44

39:                                               ; preds = %29, %25
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = ptrtoint ptr %40 to i64
  %42 = sub i64 %41, ptrtoint (ptr getelementptr inbounds (%struct._IP6_CONFIG_INSTANCE, ptr null, i32 0, i32 11) to i64)
  %43 = inttoptr i64 %42 to ptr
  br label %44

44:                                               ; preds = %39, %37
  %45 = phi ptr [ %38, %37 ], [ %43, %39 ]
  store ptr %45, ptr %12, align 8, !tbaa !5
  %46 = call zeroext i8 @DebugAssertEnabled()
  %47 = zext i8 %46 to i32
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %59

49:                                               ; preds = %44
  %50 = load ptr, ptr %12, align 8, !tbaa !5
  %51 = ptrtoint ptr %50 to i64
  %52 = sub i64 %51, ptrtoint (ptr getelementptr inbounds (%struct._IP6_SERVICE, ptr null, i32 0, i32 39) to i64)
  %53 = inttoptr i64 %52 to ptr
  %54 = getelementptr inbounds %struct._IP6_SERVICE, ptr %53, i32 0, i32 0
  %55 = load i32, ptr %54, align 8, !tbaa !25
  %56 = icmp ne i32 %55, 1396068425
  br i1 %56, label %57, label %59

57:                                               ; preds = %49
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1849, ptr noundef @.str.1)
  %58 = load ptr, ptr %12, align 8, !tbaa !5
  br label %64

59:                                               ; preds = %49, %44
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  %61 = ptrtoint ptr %60 to i64
  %62 = sub i64 %61, ptrtoint (ptr getelementptr inbounds (%struct._IP6_SERVICE, ptr null, i32 0, i32 39) to i64)
  %63 = inttoptr i64 %62 to ptr
  br label %64

64:                                               ; preds = %59, %57
  %65 = phi ptr [ %58, %57 ], [ %63, %59 ]
  store ptr %65, ptr %13, align 8, !tbaa !5
  br label %66

66:                                               ; preds = %64
  %67 = call zeroext i8 @DebugAssertEnabled()
  %68 = icmp ne i8 %67, 0
  br i1 %68, label %69, label %79

69:                                               ; preds = %66
  %70 = load ptr, ptr %13, align 8, !tbaa !5
  %71 = icmp ne ptr %70, null
  br i1 %71, label %72, label %77

72:                                               ; preds = %69
  %73 = load ptr, ptr %13, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._IP6_SERVICE, ptr %73, i32 0, i32 0
  %75 = load i32, ptr %74, align 8, !tbaa !25
  %76 = icmp eq i32 %75, 1396068425
  br i1 %76, label %78, label %77

77:                                               ; preds = %72, %69
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1850, ptr noundef @.str.12)
  br label %78

78:                                               ; preds = %77, %72
  br label %79

79:                                               ; preds = %78, %66
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  %82 = load ptr, ptr %13, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._IP6_SERVICE, ptr %82, i32 0, i32 13
  %84 = load i8, ptr %83, align 1, !tbaa !33
  %85 = icmp ne i8 %84, 0
  br i1 %85, label %86, label %87

86:                                               ; preds = %81
  store i64 -9223372036854775801, ptr %5, align 8
  store i32 1, ptr %14, align 4
  br label %159

87:                                               ; preds = %81
  %88 = load ptr, ptr @gBS, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %88, i32 0, i32 1
  %90 = load ptr, ptr %89, align 8, !tbaa !34
  %91 = call i64 %90(i64 noundef 8)
  store i64 %91, ptr %10, align 8, !tbaa !11
  %92 = load ptr, ptr %12, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._IP6_CONFIG_INSTANCE, ptr %92, i32 0, i32 8
  %94 = load i32, ptr %7, align 4, !tbaa !9
  %95 = zext i32 %94 to i64
  %96 = getelementptr inbounds [7 x %struct.IP6_CONFIG_DATA_ITEM], ptr %93, i64 0, i64 %95
  %97 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %96, i32 0, i32 2
  %98 = load i64, ptr %97, align 8, !tbaa !37
  store i64 %98, ptr %11, align 8, !tbaa !11
  %99 = load i64, ptr %11, align 8, !tbaa !11
  %100 = icmp ne i64 %99, -9223372036854775802
  br i1 %100, label %101, label %152

101:                                              ; preds = %87
  %102 = load ptr, ptr %12, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._IP6_CONFIG_INSTANCE, ptr %102, i32 0, i32 8
  %104 = load i32, ptr %7, align 4, !tbaa !9
  %105 = zext i32 %104 to i64
  %106 = getelementptr inbounds [7 x %struct.IP6_CONFIG_DATA_ITEM], ptr %103, i64 0, i64 %105
  %107 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %106, i32 0, i32 0
  %108 = load ptr, ptr %107, align 8, !tbaa !39
  %109 = icmp eq ptr %108, null
  br i1 %109, label %110, label %111

110:                                              ; preds = %101
  store i64 -9223372036854775800, ptr %11, align 8, !tbaa !11
  br label %151

111:                                              ; preds = %101
  %112 = load ptr, ptr %12, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._IP6_CONFIG_INSTANCE, ptr %112, i32 0, i32 8
  %114 = load i32, ptr %7, align 4, !tbaa !9
  %115 = zext i32 %114 to i64
  %116 = getelementptr inbounds [7 x %struct.IP6_CONFIG_DATA_ITEM], ptr %113, i64 0, i64 %115
  %117 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %116, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8, !tbaa !39
  %119 = load ptr, ptr %12, align 8, !tbaa !5
  %120 = load i64, ptr %8, align 8, !tbaa !11
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = call i64 %118(ptr noundef %119, i64 noundef %120, ptr noundef %121)
  store i64 %122, ptr %11, align 8, !tbaa !11
  %123 = load i64, ptr %11, align 8, !tbaa !11
  %124 = icmp slt i64 %123, 0
  br i1 %124, label %138, label %125

125:                                              ; preds = %111
  %126 = load ptr, ptr %12, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct._IP6_CONFIG_INSTANCE, ptr %126, i32 0, i32 8
  %128 = load i32, ptr %7, align 4, !tbaa !9
  %129 = zext i32 %128 to i64
  %130 = getelementptr inbounds [7 x %struct.IP6_CONFIG_DATA_ITEM], ptr %127, i64 0, i64 %129
  %131 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %130, i32 0, i32 4
  %132 = call i64 @NetMapIterate(ptr noundef %131, ptr noundef @Ip6ConfigSignalEvent, ptr noundef null)
  %133 = load ptr, ptr %13, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct._IP6_SERVICE, ptr %133, i32 0, i32 40
  %135 = load ptr, ptr %134, align 8, !tbaa !40
  %136 = load ptr, ptr %12, align 8, !tbaa !5
  %137 = call i64 @Ip6ConfigWriteConfigData(ptr noundef %135, ptr noundef %136)
  br label %150

138:                                              ; preds = %111
  %139 = load i64, ptr %11, align 8, !tbaa !11
  %140 = icmp eq i64 %139, -9223372036854775787
  br i1 %140, label %141, label %149

141:                                              ; preds = %138
  store i64 0, ptr %11, align 8, !tbaa !11
  %142 = load ptr, ptr %12, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct._IP6_CONFIG_INSTANCE, ptr %142, i32 0, i32 8
  %144 = load i32, ptr %7, align 4, !tbaa !9
  %145 = zext i32 %144 to i64
  %146 = getelementptr inbounds [7 x %struct.IP6_CONFIG_DATA_ITEM], ptr %143, i64 0, i64 %145
  %147 = getelementptr inbounds %struct.IP6_CONFIG_DATA_ITEM, ptr %146, i32 0, i32 4
  %148 = call i64 @NetMapIterate(ptr noundef %147, ptr noundef @Ip6ConfigSignalEvent, ptr noundef null)
  br label %149

149:                                              ; preds = %141, %138
  br label %150

150:                                              ; preds = %149, %125
  br label %151

151:                                              ; preds = %150, %110
  br label %153

152:                                              ; preds = %87
  store i64 -9223372036854775793, ptr %11, align 8, !tbaa !11
  br label %153

153:                                              ; preds = %152, %151
  %154 = load ptr, ptr @gBS, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %154, i32 0, i32 2
  %156 = load ptr, ptr %155, align 8, !tbaa !41
  %157 = load i64, ptr %10, align 8, !tbaa !11
  call void %156(i64 noundef %157)
  %158 = load i64, ptr %11, align 8, !tbaa !11
  store i64 %158, ptr %5, align 8
  store i32 1, ptr %14, align 4
  br label %159

159:                                              ; preds = %153, %86, %24, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  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
  %160 = load i64, ptr %5, align 8
  ret i64 %160
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"_IP6_CONFIG_INSTANCE", !10, i64 0, !7, i64 4, !15, i64 8, !16, i64 24, !17, i64 32, !18, i64 168, !10, 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, !10, i64 948, !6, i64 952, !10, i64 960, !6, i64 968, !10, 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, !10, i64 68, !18, i64 72, !10, i64 104, !6, i64 112, !10, i64 120, !6, i64 128}
!18 = !{!"", !7, i64 0}
!19 = !{!"", !10, i64 0}
!20 = !{!"", !15, i64 0, !15, i64 16, !12, i64 32}
!21 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!"_IP6_FORM_CALLBACK_INFO", !10, 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 = !{!"", !10, i64 0, !19, i64 4, !18, i64 8, !15, i64 16, !10, i64 32, !15, i64 40, !10, i64 56, !15, i64 64, !10, i64 80}
!25 = !{!26, !10, i64 0}
!26 = !{!"_IP6_SERVICE", !10, i64 0, !27, i64 8, !12, i64 24, !12, i64 32, !15, i64 40, !15, i64 56, !6, i64 72, !6, i64 80, !28, i64 88, !18, i64 136, !30, 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, !31, i64 2352, !32, i64 2372, !6, i64 3032, !6, i64 3040, !14, i64 3048, !6, i64 4176, !10, i64 4184, !10, i64 4188}
!27 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!28 = !{!"", !10, i64 0, !6, i64 8, !6, i64 16, !29, i64 24}
!29 = !{!"", !6, i64 0, !12, i64 8, !7, i64 16}
!30 = !{!"", !12, i64 0, !15, i64 8}
!31 = !{!"", !10, i64 0, !10, 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}
!32 = !{!"", !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}
!33 = !{!26, !7, i64 2209}
!34 = !{!35, !6, i64 24}
!35 = !{!"", !36, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368}
!36 = !{!"", !12, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!37 = !{!38, !12, i64 16}
!38 = !{!"", !6, i64 0, !6, i64 8, !12, i64 16, !7, i64 24, !20, i64 32, !7, i64 72, !12, i64 80}
!39 = !{!38, !6, i64 0}
!40 = !{!26, !6, i64 4176}
!41 = !{!35, !6, i64 32}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.IP6_CONFIG_DATA_ITEM = type { ptr, ptr, i64, i8, %struct.NET_MAP, %union.IP6_CONFIG_DATA, i64 }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%struct._LIST_ENTRY = type { ptr, ptr }
%union.IP6_CONFIG_DATA = type { ptr }

@.str = external hidden unnamed_addr constant [135 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [107 x i8], align 1

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Ip6ConfigWriteConfigData(ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local i64 @EfiIp6ConfigSetData(ptr noundef %0, i32 noundef %1, i64 noundef %2, ptr noundef %3) local_unnamed_addr #1 {
  %5 = icmp eq ptr %0, null
  %6 = icmp eq ptr %3, null
  %or.cond = or i1 %5, %6
  br i1 %or.cond, label %60, label %7

7:                                                ; preds = %4
  %8 = icmp ugt i32 %1, 6
  br i1 %8, label %60, label %9

9:                                                ; preds = %7
  %10 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %10, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre48 = add i64 %.pre, -880
  %.pre50 = inttoptr i64 %.pre48 to ptr
  br i1 %.not, label %._crit_edge47, label %11

11:                                               ; preds = %9
  %12 = load i32, ptr %.pre50, align 8, !tbaa !5
  %.not40 = icmp eq i32 %12, 1127632969
  br i1 %.not40, label %._crit_edge47, label %13

13:                                               ; preds = %11
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1848, ptr noundef nonnull @.str.1) #2
  br label %._crit_edge47

._crit_edge47:                                    ; preds = %9, %11, %13
  %14 = phi ptr [ %0, %13 ], [ %.pre50, %11 ], [ %.pre50, %9 ]
  %15 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not41 = icmp eq i8 %15, 0
  %.pre52 = ptrtoint ptr %14 to i64
  %.pre54 = add i64 %.pre52, -3048
  %.pre56 = inttoptr i64 %.pre54 to ptr
  br i1 %.not41, label %._crit_edge, label %16

16:                                               ; preds = %._crit_edge47
  %17 = load i32, ptr %.pre56, align 8, !tbaa !22
  %.not42 = icmp eq i32 %17, 1396068425
  br i1 %.not42, label %._crit_edge, label %18

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

._crit_edge:                                      ; preds = %._crit_edge47, %16, %18
  %19 = phi ptr [ %14, %18 ], [ %.pre56, %16 ], [ %.pre56, %._crit_edge47 ]
  %20 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not43 = icmp eq i8 %20, 0
  br i1 %.not43, label %26, label %21

21:                                               ; preds = %._crit_edge
  %.not44 = icmp eq ptr %19, null
  br i1 %.not44, label %25, label %22

22:                                               ; preds = %21
  %23 = load i32, ptr %19, align 8, !tbaa !22
  %24 = icmp eq i32 %23, 1396068425
  br i1 %24, label %26, label %25

25:                                               ; preds = %22, %21
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1850, ptr noundef nonnull @.str.12) #2
  br label %26

26:                                               ; preds = %22, %25, %._crit_edge
  %27 = getelementptr inbounds i8, ptr %19, i64 2209
  %28 = load i8, ptr %27, align 1, !tbaa !30
  %.not45 = icmp eq i8 %28, 0
  br i1 %.not45, label %29, label %60

29:                                               ; preds = %26
  %30 = load ptr, ptr @gBS, align 8, !tbaa !31
  %31 = getelementptr inbounds i8, ptr %30, i64 24
  %32 = load ptr, ptr %31, align 8, !tbaa !32
  %33 = tail call i64 %32(i64 noundef 8) #2
  %34 = getelementptr inbounds i8, ptr %14, i64 184
  %35 = zext nneg i32 %1 to i64
  %36 = getelementptr inbounds [7 x %struct.IP6_CONFIG_DATA_ITEM], ptr %34, i64 0, i64 %35
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %38 = load i64, ptr %37, align 8, !tbaa !35
  %.not46 = icmp eq i64 %38, -9223372036854775802
  br i1 %.not46, label %56, label %39

39:                                               ; preds = %29
  %40 = load ptr, ptr %36, align 8, !tbaa !37
  %41 = icmp eq ptr %40, null
  br i1 %41, label %56, label %42

42:                                               ; preds = %39
  %43 = tail call i64 %40(ptr noundef nonnull %14, i64 noundef %2, ptr noundef nonnull %3) #2
  %44 = icmp slt i64 %43, 0
  br i1 %44, label %51, label %45

45:                                               ; preds = %42
  %46 = getelementptr inbounds i8, ptr %36, i64 32
  %47 = tail call i64 @NetMapIterate(ptr noundef nonnull %46, ptr noundef nonnull @Ip6ConfigSignalEvent, ptr noundef null) #2
  %48 = getelementptr inbounds i8, ptr %19, i64 4176
  %49 = load ptr, ptr %48, align 8, !tbaa !38
  %50 = tail call i64 @Ip6ConfigWriteConfigData(ptr noundef %49, ptr noundef nonnull %14)
  br label %56

51:                                               ; preds = %42
  %52 = icmp eq i64 %43, -9223372036854775787
  br i1 %52, label %53, label %56

53:                                               ; preds = %51
  %54 = getelementptr inbounds i8, ptr %36, i64 32
  %55 = tail call i64 @NetMapIterate(ptr noundef nonnull %54, ptr noundef nonnull @Ip6ConfigSignalEvent, ptr noundef null) #2
  br label %56

56:                                               ; preds = %29, %39, %51, %53, %45
  %.033 = phi i64 [ 0, %53 ], [ %43, %51 ], [ %43, %45 ], [ -9223372036854775800, %39 ], [ -9223372036854775793, %29 ]
  %57 = load ptr, ptr @gBS, align 8, !tbaa !31
  %58 = getelementptr inbounds i8, ptr %57, i64 32
  %59 = load ptr, ptr %58, align 8, !tbaa !39
  tail call void %59(i64 noundef %33) #2
  br label %60

60:                                               ; preds = %26, %7, %4, %56
  %.0 = phi i64 [ %.033, %56 ], [ -9223372036854775806, %4 ], [ -9223372036854775805, %7 ], [ -9223372036854775801, %26 ]
  ret i64 %.0
}

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_IP6_CONFIG_INSTANCE", !7, i64 0, !8, i64 4, !10, i64 8, !12, i64 24, !13, i64 32, !14, i64 168, !7, i64 176, !15, i64 180, !8, i64 184, !16, i64 800, !16, i64 840, !18, 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, !19, i64 984, !21, i64 1040}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_LIST_ENTRY", !11, i64 0, !11, i64 8}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!"", !8, i64 0, !8, i64 64, !7, i64 68, !14, i64 72, !7, i64 104, !11, i64 112, !7, i64 120, !11, i64 128}
!14 = !{!"", !8, i64 0}
!15 = !{!"", !7, i64 0}
!16 = !{!"", !10, i64 0, !10, i64 16, !17, i64 32}
!17 = !{!"long long", !8, i64 0}
!18 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!19 = !{!"_IP6_FORM_CALLBACK_INFO", !7, i64 0, !11, i64 8, !20, i64 16, !11, i64 40, !11, i64 48}
!20 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16}
!21 = !{!"", !7, i64 0, !15, i64 4, !14, i64 8, !10, i64 16, !7, i64 32, !10, i64 40, !7, i64 56, !10, i64 64, !7, i64 80}
!22 = !{!23, !7, i64 0}
!23 = !{!"_IP6_SERVICE", !7, i64 0, !24, i64 8, !17, i64 24, !17, i64 32, !10, i64 40, !10, i64 56, !11, i64 72, !11, i64 80, !25, i64 88, !14, i64 136, !27, i64 2168, !14, 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, !10, i64 2232, !10, i64 2248, !10, i64 2264, !10, 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, !28, i64 2352, !29, i64 2372, !11, i64 3032, !11, i64 3040, !6, i64 3048, !11, i64 4176, !7, i64 4184, !7, i64 4188}
!24 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !11, i64 0, !11, i64 8}
!25 = !{!"", !7, i64 0, !11, i64 8, !11, i64 16, !26, i64 24}
!26 = !{!"", !11, i64 0, !17, i64 8, !8, i64 16}
!27 = !{!"", !17, i64 0, !10, i64 8}
!28 = !{!"", !7, i64 0, !7, i64 4, !12, i64 8, !8, i64 10, !8, i64 11, !8, i64 12, !8, i64 13, !8, i64 14, !8, i64 15, !8, i64 16}
!29 = !{!"", !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, !14, i64 552, !14, i64 584, !14, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!30 = !{!23, !8, i64 2209}
!31 = !{!11, !11, i64 0}
!32 = !{!33, !11, i64 24}
!33 = !{!"", !34, i64 0, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !11, i64 232, !11, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !11, i64 272, !11, i64 280, !11, i64 288, !11, i64 296, !11, i64 304, !11, i64 312, !11, i64 320, !11, i64 328, !11, i64 336, !11, i64 344, !11, i64 352, !11, i64 360, !11, i64 368}
!34 = !{!"", !17, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!35 = !{!36, !17, i64 16}
!36 = !{!"", !11, i64 0, !11, i64 8, !17, i64 16, !8, i64 24, !16, i64 32, !8, i64 72, !17, i64 80}
!37 = !{!36, !11, i64 0}
!38 = !{!23, !11, i64 4176}
!39 = !{!33, !11, i64 32}


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