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

; 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._DHCP6_INSTANCE = type { i32, ptr, ptr, %struct._LIST_ENTRY, %struct._EFI_DHCP6_PROTOCOL, ptr, ptr, ptr, %struct._DHCP6_IA_CB, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, i8, ptr, i64, i8, i8, i64 }
%struct._EFI_DHCP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._DHCP6_IA_CB = type { ptr, i32, i32, i32, i32 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct._DHCP6_SERVICE = type { i32, ptr, ptr, %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr, ptr, ptr, ptr, i32, %struct._LIST_ENTRY, i64 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct._UDP_IO = type { i32, %struct._LIST_ENTRY, i64, i8, ptr, ptr, ptr, %struct.EFI_SIMPLE_NETWORK_MODE, %struct._LIST_ENTRY, ptr, %union.anon, %union.anon.0 }
%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] }
%union.anon = type { ptr }
%union.anon.0 = type { %struct.EFI_UDP6_CONFIG_DATA }
%struct.EFI_UDP6_CONFIG_DATA = type { i8, i8, i8, i8, i8, i32, i32, %struct.EFI_IPv6_ADDRESS, i16, %struct.EFI_IPv6_ADDRESS, i16 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct.EFI_DHCP6_IA = type { %struct.EFI_DHCP6_IA_DESCRIPTOR, i32, ptr, i32, [1 x %struct.EFI_DHCP6_IA_ADDRESS] }
%struct.EFI_DHCP6_IA_DESCRIPTOR = type { i16, i32 }
%struct.EFI_DHCP6_IA_ADDRESS = type { %struct.EFI_IPv6_ADDRESS, i32, i32 }
%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 }
%struct.EFI_DHCP6_CONFIG_DATA = type { ptr, ptr, i32, ptr, %struct.EFI_DHCP6_IA_DESCRIPTOR, ptr, i8, i8, ptr }
%struct._EFI_UDP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [133 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@gBS = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1

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

12:                                               ; preds = %1
  store i64 -9223372036854775806, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %153

13:                                               ; preds = %1
  %14 = call zeroext i8 @DebugAssertEnabled()
  %15 = zext i8 %14 to i32
  %16 = icmp ne i32 %15, 0
  br i1 %16, label %17, label %27

17:                                               ; preds = %13
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = ptrtoint ptr %18 to i64
  %20 = sub i64 %19, ptrtoint (ptr getelementptr inbounds (%struct._DHCP6_INSTANCE, ptr null, i32 0, i32 4) to i64)
  %21 = inttoptr i64 %20 to ptr
  %22 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %21, i32 0, i32 0
  %23 = load i32, ptr %22, align 8, !tbaa !9
  %24 = icmp ne i32 %23, 1228294212
  br i1 %24, label %25, label %27

25:                                               ; preds = %17
  call void @DebugAssert(ptr noundef @.str, i64 noundef 182, ptr noundef @.str.1)
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  br label %32

27:                                               ; preds = %17, %13
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = ptrtoint ptr %28 to i64
  %30 = sub i64 %29, ptrtoint (ptr getelementptr inbounds (%struct._DHCP6_INSTANCE, ptr null, i32 0, i32 4) to i64)
  %31 = inttoptr i64 %30 to ptr
  br label %32

32:                                               ; preds = %27, %25
  %33 = phi ptr [ %26, %25 ], [ %31, %27 ]
  store ptr %33, ptr %7, align 8, !tbaa !5
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %34, i32 0, i32 2
  %36 = load ptr, ptr %35, align 8, !tbaa !16
  store ptr %36, ptr %8, align 8, !tbaa !5
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %37, i32 0, i32 7
  %39 = load ptr, ptr %38, align 8, !tbaa !17
  %40 = getelementptr inbounds %struct._UDP_IO, ptr %39, i32 0, i32 10
  %41 = load ptr, ptr %40, align 8, !tbaa !20
  store ptr %41, ptr %6, align 8, !tbaa !5
  store i64 0, ptr %5, align 8, !tbaa !21
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %42, i32 0, i32 6
  %44 = load ptr, ptr %43, align 8, !tbaa !22
  %45 = icmp eq ptr %44, null
  br i1 %45, label %46, label %48

46:                                               ; preds = %32
  %47 = load i64, ptr %5, align 8, !tbaa !21
  store i64 %47, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %153

48:                                               ; preds = %32
  br label %49

49:                                               ; preds = %48
  %50 = call zeroext i8 @DebugAssertEnabled()
  %51 = icmp ne i8 %50, 0
  br i1 %51, label %52, label %60

52:                                               ; preds = %49
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %53, i32 0, i32 8
  %55 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !23
  %57 = icmp ne ptr %56, null
  br i1 %57, label %59, label %58

58:                                               ; preds = %52
  call void @DebugAssert(ptr noundef @.str, i64 noundef 194, ptr noundef @.str.2)
  br label %59

59:                                               ; preds = %58, %52
  br label %60

60:                                               ; preds = %59, %49
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %63, i32 0, i32 8
  %65 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %64, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !23
  %67 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 8, !tbaa !24
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %86, label %70

70:                                               ; preds = %62
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %71, i32 0, i32 8
  %73 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !23
  %75 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %74, i32 0, i32 1
  %76 = load i32, ptr %75, align 8, !tbaa !24
  %77 = icmp eq i32 %76, 1
  br i1 %77, label %86, label %78

78:                                               ; preds = %70
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %79, i32 0, i32 8
  %81 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %80, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !23
  %83 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %82, i32 0, i32 1
  %84 = load i32, ptr %83, align 8, !tbaa !24
  %85 = icmp eq i32 %84, 2
  br i1 %85, label %86, label %87

86:                                               ; preds = %78, %70, %62
  br label %142

87:                                               ; preds = %78
  %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 !28
  %91 = call i64 %90(i64 noundef 8)
  store i64 %91, ptr %4, align 8, !tbaa !21
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %92, i32 0, i32 14
  store volatile i64 -9223372036854775788, ptr %93, align 8, !tbaa !31
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %95, i32 0, i32 8
  %97 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !23
  %99 = call i64 @Dhcp6SendReleaseMsg(ptr noundef %94, ptr noundef %98)
  store i64 %99, ptr %5, align 8, !tbaa !21
  %100 = load ptr, ptr @gBS, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %100, i32 0, i32 2
  %102 = load ptr, ptr %101, align 8, !tbaa !32
  %103 = load i64, ptr %4, align 8, !tbaa !21
  call void %102(i64 noundef %103)
  %104 = load i64, ptr %5, align 8, !tbaa !21
  %105 = icmp slt i64 %104, 0
  br i1 %105, label %106, label %107

106:                                              ; preds = %87
  br label %142

107:                                              ; preds = %87
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %108, i32 0, i32 6
  %110 = load ptr, ptr %109, align 8, !tbaa !22
  %111 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %110, i32 0, i32 5
  %112 = load ptr, ptr %111, align 8, !tbaa !33
  %113 = icmp eq ptr %112, null
  br i1 %113, label %114, label %141

114:                                              ; preds = %107
  br label %115

115:                                              ; preds = %114
  %116 = call zeroext i8 @DebugAssertEnabled()
  %117 = icmp ne i8 %116, 0
  br i1 %117, label %118, label %123

118:                                              ; preds = %115
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = icmp ne ptr %119, null
  br i1 %120, label %122, label %121

121:                                              ; preds = %118
  call void @DebugAssert(ptr noundef @.str, i64 noundef 222, ptr noundef @.str.3)
  br label %122

122:                                              ; preds = %121, %118
  br label %123

123:                                              ; preds = %122, %115
  br label %124

124:                                              ; preds = %123
  br label %125

125:                                              ; preds = %124
  br label %126

126:                                              ; preds = %131, %125
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %127, i32 0, i32 14
  %129 = load volatile i64, ptr %128, align 8, !tbaa !31
  %130 = icmp eq i64 %129, -9223372036854775788
  br i1 %130, label %131, label %137

131:                                              ; preds = %126
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._EFI_UDP6_PROTOCOL, ptr %132, i32 0, i32 6
  %134 = load ptr, ptr %133, align 8, !tbaa !35
  %135 = load ptr, ptr %6, align 8, !tbaa !5
  %136 = call i64 %134(ptr noundef %135)
  br label %126, !llvm.loop !37

137:                                              ; preds = %126
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %138, i32 0, i32 14
  %140 = load volatile i64, ptr %139, align 8, !tbaa !31
  store i64 %140, ptr %5, align 8, !tbaa !21
  br label %141

141:                                              ; preds = %137, %107
  br label %142

142:                                              ; preds = %141, %106, %86
  %143 = load ptr, ptr @gBS, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %143, i32 0, i32 1
  %145 = load ptr, ptr %144, align 8, !tbaa !28
  %146 = call i64 %145(i64 noundef 8)
  store i64 %146, ptr %4, align 8, !tbaa !21
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  call void @Dhcp6CleanupSession(ptr noundef %147, i64 noundef 0)
  %148 = load ptr, ptr @gBS, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %148, i32 0, i32 2
  %150 = load ptr, ptr %149, align 8, !tbaa !32
  %151 = load i64, ptr %4, align 8, !tbaa !21
  call void %150(i64 noundef %151)
  %152 = load i64, ptr %5, align 8, !tbaa !21
  store i64 %152, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %153

153:                                              ; preds = %142, %46, %12
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %154 = load i64, ptr %2, align 8
  ret i64 %154
}

; 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

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

declare void @Dhcp6CleanupSession(ptr noundef, i64 noundef) #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 = { 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, !11, i64 0}
!10 = !{!"_DHCP6_INSTANCE", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !13, i64 40, !6, i64 112, !6, i64 120, !6, i64 128, !14, i64 136, !12, i64 160, !12, i64 176, !6, i64 192, !7, i64 200, !6, i64 208, !15, i64 216, !7, i64 224, !7, i64 225, !15, i64 232}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"_EFI_DHCP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!14 = !{!"_DHCP6_IA_CB", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!15 = !{!"long long", !7, i64 0}
!16 = !{!10, !6, i64 16}
!17 = !{!18, !6, i64 64}
!18 = !{!"_DHCP6_SERVICE", !11, i64 0, !6, i64 8, !6, i64 16, !19, i64 24, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !11, i64 72, !12, i64 80, !15, i64 96}
!19 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!20 = !{!7, !7, i64 0}
!21 = !{!15, !15, i64 0}
!22 = !{!10, !6, i64 120}
!23 = !{!10, !6, i64 136}
!24 = !{!25, !11, i64 8}
!25 = !{!"", !26, i64 0, !11, i64 8, !6, i64 16, !11, i64 24, !7, i64 28}
!26 = !{!"", !27, i64 0, !11, i64 4}
!27 = !{!"short", !7, i64 0}
!28 = !{!29, !6, i64 24}
!29 = !{!"", !30, 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}
!30 = !{!"", !15, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!31 = !{!10, !15, i64 216}
!32 = !{!29, !6, i64 32}
!33 = !{!34, !6, i64 40}
!34 = !{!"", !6, i64 0, !6, i64 8, !11, i64 16, !6, i64 24, !26, i64 32, !6, i64 40, !7, i64 48, !7, i64 49, !6, i64 56}
!35 = !{!36, !6, i64 48}
!36 = !{!"_EFI_UDP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!37 = distinct !{!37, !38}
!38 = !{!"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 [133 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @EfiDhcp6Stop(ptr noundef %0) local_unnamed_addr #0 {
  %2 = icmp eq ptr %0, null
  br i1 %2, label %69, label %3

3:                                                ; preds = %1
  %4 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %4, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre35 = add i64 %.pre, -40
  %.pre37 = inttoptr i64 %.pre35 to ptr
  br i1 %.not, label %._crit_edge34, label %5

5:                                                ; preds = %3
  %6 = load i32, ptr %.pre37, align 8, !tbaa !5
  %.not31 = icmp eq i32 %6, 1228294212
  br i1 %.not31, label %._crit_edge34, label %7

7:                                                ; preds = %5
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 182, ptr noundef nonnull @.str.1) #2
  br label %._crit_edge34

._crit_edge34:                                    ; preds = %3, %5, %7
  %8 = phi ptr [ %0, %7 ], [ %.pre37, %5 ], [ %.pre37, %3 ]
  %9 = getelementptr inbounds i8, ptr %8, i64 16
  %10 = load ptr, ptr %9, align 8, !tbaa !15
  %11 = getelementptr inbounds i8, ptr %10, i64 64
  %12 = load ptr, ptr %11, align 8, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %12, i64 744
  %14 = load ptr, ptr %13, align 8, !tbaa !19
  %15 = getelementptr inbounds i8, ptr %8, i64 120
  %16 = load ptr, ptr %15, align 8, !tbaa !20
  %17 = icmp eq ptr %16, null
  br i1 %17, label %69, label %18

18:                                               ; preds = %._crit_edge34
  %19 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not32 = icmp eq i8 %19, 0
  br i1 %.not32, label %24, label %20

20:                                               ; preds = %18
  %21 = getelementptr inbounds i8, ptr %8, i64 136
  %22 = load ptr, ptr %21, align 8, !tbaa !21
  %.not33 = icmp eq ptr %22, null
  br i1 %.not33, label %23, label %24

23:                                               ; preds = %20
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 194, ptr noundef nonnull @.str.2) #2
  br label %24

24:                                               ; preds = %20, %23, %18
  %25 = getelementptr inbounds i8, ptr %8, i64 136
  %26 = load ptr, ptr %25, align 8, !tbaa !21
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  %28 = load i32, ptr %27, align 8, !tbaa !22
  %switch = icmp ult i32 %28, 3
  br i1 %switch, label %61, label %29

29:                                               ; preds = %24
  %30 = load ptr, ptr @gBS, align 8, !tbaa !26
  %31 = getelementptr inbounds i8, ptr %30, i64 24
  %32 = load ptr, ptr %31, align 8, !tbaa !27
  %33 = tail call i64 %32(i64 noundef 8) #2
  %34 = getelementptr inbounds i8, ptr %8, i64 216
  store volatile i64 -9223372036854775788, ptr %34, align 8, !tbaa !30
  %35 = load ptr, ptr %25, align 8, !tbaa !21
  %36 = tail call i64 @Dhcp6SendReleaseMsg(ptr noundef nonnull %8, ptr noundef %35) #2
  %37 = load ptr, ptr @gBS, align 8, !tbaa !26
  %38 = getelementptr inbounds i8, ptr %37, i64 32
  %39 = load ptr, ptr %38, align 8, !tbaa !31
  tail call void %39(i64 noundef %33) #2
  %40 = icmp slt i64 %36, 0
  br i1 %40, label %61, label %41

41:                                               ; preds = %29
  %42 = load ptr, ptr %15, align 8, !tbaa !20
  %43 = getelementptr inbounds i8, ptr %42, i64 40
  %44 = load ptr, ptr %43, align 8, !tbaa !32
  %45 = icmp eq ptr %44, null
  br i1 %45, label %46, label %61

46:                                               ; preds = %41
  %47 = tail call zeroext i8 @DebugAssertEnabled() #2
  %48 = icmp eq i8 %47, 0
  %49 = icmp ne ptr %14, null
  %or.cond = select i1 %48, i1 true, i1 %49
  br i1 %or.cond, label %51, label %50

50:                                               ; preds = %46
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 222, ptr noundef nonnull @.str.3) #2
  br label %51

51:                                               ; preds = %50, %46
  %52 = load volatile i64, ptr %34, align 8, !tbaa !30
  %53 = icmp eq i64 %52, -9223372036854775788
  br i1 %53, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %51
  %54 = getelementptr inbounds i8, ptr %14, i64 48
  br label %55

55:                                               ; preds = %.lr.ph, %55
  %56 = load ptr, ptr %54, align 8, !tbaa !34
  %57 = tail call i64 %56(ptr noundef %14) #2
  %58 = load volatile i64, ptr %34, align 8, !tbaa !30
  %59 = icmp eq i64 %58, -9223372036854775788
  br i1 %59, label %55, label %._crit_edge, !llvm.loop !36

._crit_edge:                                      ; preds = %55, %51
  %60 = load volatile i64, ptr %34, align 8, !tbaa !30
  br label %61

61:                                               ; preds = %24, %41, %._crit_edge, %29
  %.027 = phi i64 [ %36, %29 ], [ %60, %._crit_edge ], [ %36, %41 ], [ 0, %24 ]
  %62 = load ptr, ptr @gBS, align 8, !tbaa !26
  %63 = getelementptr inbounds i8, ptr %62, i64 24
  %64 = load ptr, ptr %63, align 8, !tbaa !27
  %65 = tail call i64 %64(i64 noundef 8) #2
  tail call void @Dhcp6CleanupSession(ptr noundef nonnull %8, i64 noundef 0) #2
  %66 = load ptr, ptr @gBS, align 8, !tbaa !26
  %67 = getelementptr inbounds i8, ptr %66, i64 32
  %68 = load ptr, ptr %67, align 8, !tbaa !31
  tail call void %68(i64 noundef %65) #2
  br label %69

69:                                               ; preds = %._crit_edge34, %1, %61
  %.0 = phi i64 [ %.027, %61 ], [ -9223372036854775806, %1 ], [ 0, %._crit_edge34 ]
  ret i64 %.0
}

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

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

declare void @Dhcp6CleanupSession(ptr noundef, i64 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, !7, i64 0}
!6 = !{!"_DHCP6_INSTANCE", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !12, i64 40, !10, i64 112, !10, i64 120, !10, i64 128, !13, i64 136, !11, i64 160, !11, i64 176, !10, i64 192, !8, i64 200, !10, i64 208, !14, i64 216, !8, i64 224, !8, i64 225, !14, i64 232}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!12 = !{!"_EFI_DHCP6_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64}
!13 = !{!"_DHCP6_IA_CB", !10, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!14 = !{!"long long", !8, i64 0}
!15 = !{!6, !10, i64 16}
!16 = !{!17, !10, i64 64}
!17 = !{!"_DHCP6_SERVICE", !7, i64 0, !10, i64 8, !10, i64 16, !18, i64 24, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !7, i64 72, !11, i64 80, !14, i64 96}
!18 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !10, i64 0, !10, i64 8}
!19 = !{!8, !8, i64 0}
!20 = !{!6, !10, i64 120}
!21 = !{!6, !10, i64 136}
!22 = !{!23, !7, i64 8}
!23 = !{!"", !24, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !8, i64 28}
!24 = !{!"", !25, i64 0, !7, i64 4}
!25 = !{!"short", !8, i64 0}
!26 = !{!10, !10, i64 0}
!27 = !{!28, !10, i64 24}
!28 = !{!"", !29, i64 0, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, i64 312, !10, i64 320, !10, i64 328, !10, i64 336, !10, i64 344, !10, i64 352, !10, i64 360, !10, i64 368}
!29 = !{!"", !14, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!30 = !{!6, !14, i64 216}
!31 = !{!28, !10, i64 32}
!32 = !{!33, !10, i64 40}
!33 = !{!"", !10, i64 0, !10, i64 8, !7, i64 16, !10, i64 24, !24, i64 32, !10, i64 40, !8, i64 48, !8, i64 49, !10, i64 56}
!34 = !{!35, !10, i64 48}
!35 = !{!"_EFI_UDP6_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}


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