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

; 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.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_IPv6_ADDRESS = type { [16 x 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 }
%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.EFI_DHCP6_CONFIG_DATA = type { ptr, ptr, i32, ptr, %struct.EFI_DHCP6_IA_DESCRIPTOR, ptr, i8, i8, 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_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

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

13:                                               ; preds = %2
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %157

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

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

26:                                               ; preds = %18
  call void @DebugAssert(ptr noundef @.str, i64 noundef 768, ptr noundef @.str.1)
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  br label %33

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

33:                                               ; preds = %28, %26
  %34 = phi ptr [ %27, %26 ], [ %32, %28 ]
  store ptr %34, ptr %8, align 8, !tbaa !5
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %35, i32 0, i32 2
  %37 = load ptr, ptr %36, align 8, !tbaa !17
  store ptr %37, ptr %9, align 8, !tbaa !5
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %38, i32 0, i32 6
  %40 = load ptr, ptr %39, align 8, !tbaa !18
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %43

42:                                               ; preds = %33
  store i64 -9223372036854775793, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %157

43:                                               ; preds = %33
  br label %44

44:                                               ; preds = %43
  %45 = call zeroext i8 @DebugAssertEnabled()
  %46 = icmp ne i8 %45, 0
  br i1 %46, label %47, label %55

47:                                               ; preds = %44
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %48, i32 0, i32 8
  %50 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !19
  %52 = icmp ne ptr %51, null
  br i1 %52, label %54, label %53

53:                                               ; preds = %47
  call void @DebugAssert(ptr noundef @.str, i64 noundef 778, ptr noundef @.str.2)
  br label %54

54:                                               ; preds = %53, %47
  br label %55

55:                                               ; preds = %54, %44
  br label %56

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %58, i32 0, i32 8
  %60 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !19
  %62 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %61, i32 0, i32 1
  %63 = load i32, ptr %62, align 8, !tbaa !20
  %64 = icmp eq i32 %63, 8
  br i1 %64, label %65, label %69

65:                                               ; preds = %57
  %66 = load i8, ptr %5, align 1, !tbaa !9
  %67 = zext i8 %66 to i32
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %80, label %69

69:                                               ; preds = %65, %57
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %70, i32 0, i32 8
  %72 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %71, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8, !tbaa !19
  %74 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %73, i32 0, i32 1
  %75 = load i32, ptr %74, align 8, !tbaa !20
  %76 = icmp eq i32 %75, 7
  br i1 %76, label %77, label %81

77:                                               ; preds = %69
  %78 = load i8, ptr %5, align 1, !tbaa !9
  %79 = icmp ne i8 %78, 0
  br i1 %79, label %81, label %80

80:                                               ; preds = %77, %65
  store i64 -9223372036854775788, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %157

81:                                               ; preds = %77, %69
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %82, i32 0, i32 8
  %84 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %83, i32 0, i32 0
  %85 = load ptr, ptr %84, align 8, !tbaa !19
  %86 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %85, i32 0, i32 1
  %87 = load i32, ptr %86, align 8, !tbaa !20
  %88 = icmp ne i32 %87, 6
  br i1 %88, label %89, label %90

89:                                               ; preds = %81
  store i64 -9223372036854775793, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %157

90:                                               ; preds = %81
  %91 = load ptr, ptr @gBS, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %91, i32 0, i32 1
  %93 = load ptr, ptr %92, align 8, !tbaa !24
  %94 = call i64 %93(i64 noundef 8)
  store i64 %94, ptr %7, align 8, !tbaa !27
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %95, i32 0, i32 14
  store volatile i64 -9223372036854775788, ptr %96, align 8, !tbaa !28
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = load i8, ptr %5, align 1, !tbaa !9
  %99 = call i64 @Dhcp6SendRenewRebindMsg(ptr noundef %97, i8 noundef zeroext %98)
  store i64 %99, ptr %6, align 8, !tbaa !27
  %100 = load i64, ptr %6, align 8, !tbaa !27
  %101 = icmp slt i64 %100, 0
  br i1 %101, label %102, label %103

102:                                              ; preds = %90
  br label %151

103:                                              ; preds = %90
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %104, i32 0, i32 7
  %106 = load ptr, ptr %105, align 8, !tbaa !29
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = call i64 @UdpIoRecvDatagram(ptr noundef %106, ptr noundef @Dhcp6ReceivePacket, ptr noundef %107, i32 noundef 0)
  store i64 %108, ptr %6, align 8, !tbaa !27
  %109 = load i64, ptr %6, align 8, !tbaa !27
  %110 = icmp slt i64 %109, 0
  br i1 %110, label %111, label %115

111:                                              ; preds = %103
  %112 = load i64, ptr %6, align 8, !tbaa !27
  %113 = icmp ne i64 %112, -9223372036854775788
  br i1 %113, label %114, label %115

114:                                              ; preds = %111
  br label %151

115:                                              ; preds = %111, %103
  %116 = load ptr, ptr @gBS, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %116, i32 0, i32 2
  %118 = load ptr, ptr %117, align 8, !tbaa !32
  %119 = load i64, ptr %7, align 8, !tbaa !27
  call void %118(i64 noundef %119)
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %120, i32 0, i32 6
  %122 = load ptr, ptr %121, align 8, !tbaa !18
  %123 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %122, i32 0, i32 5
  %124 = load ptr, ptr %123, align 8, !tbaa !33
  %125 = icmp eq ptr %124, null
  br i1 %125, label %126, label %150

126:                                              ; preds = %115
  br label %127

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

132:                                              ; preds = %127
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %133, i32 0, i32 7
  %135 = load ptr, ptr %134, align 8, !tbaa !29
  %136 = getelementptr inbounds %struct._UDP_IO, ptr %135, i32 0, i32 10
  %137 = load ptr, ptr %136, align 8, !tbaa !9
  %138 = getelementptr inbounds %struct._EFI_UDP6_PROTOCOL, ptr %137, i32 0, i32 6
  %139 = load ptr, ptr %138, align 8, !tbaa !35
  %140 = load ptr, ptr %9, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %140, i32 0, i32 7
  %142 = load ptr, ptr %141, align 8, !tbaa !29
  %143 = getelementptr inbounds %struct._UDP_IO, ptr %142, i32 0, i32 10
  %144 = load ptr, ptr %143, align 8, !tbaa !9
  %145 = call i64 %139(ptr noundef %144)
  br label %127, !llvm.loop !37

146:                                              ; preds = %127
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %147, i32 0, i32 14
  %149 = load volatile i64, ptr %148, align 8, !tbaa !28
  store i64 %149, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %157

150:                                              ; preds = %115
  store i64 0, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %157

151:                                              ; preds = %114, %102
  %152 = load ptr, ptr @gBS, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %152, i32 0, i32 2
  %154 = load ptr, ptr %153, align 8, !tbaa !32
  %155 = load i64, ptr %7, align 8, !tbaa !27
  call void %154(i64 noundef %155)
  %156 = load i64, ptr %6, align 8, !tbaa !27
  store i64 %156, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %157

157:                                              ; preds = %151, %150, %146, %89, %80, %42, %13
  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
  %158 = load i64, ptr %3, align 8
  ret i64 %158
}

; 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

declare i64 @UdpIoRecvDatagram(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

declare void @Dhcp6ReceivePacket(ptr noundef, 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 @Dhcp6SendRenewRebindMsg(ptr noundef, i8 noundef zeroext) #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 = !{!7, !7, i64 0}
!10 = !{!11, !12, i64 0}
!11 = !{!"_DHCP6_INSTANCE", !12, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !14, i64 40, !6, i64 112, !6, i64 120, !6, i64 128, !15, i64 136, !13, i64 160, !13, i64 176, !6, i64 192, !7, i64 200, !6, i64 208, !16, i64 216, !7, i64 224, !7, i64 225, !16, i64 232}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!14 = !{!"_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}
!15 = !{!"_DHCP6_IA_CB", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!16 = !{!"long long", !7, i64 0}
!17 = !{!11, !6, i64 16}
!18 = !{!11, !6, i64 120}
!19 = !{!11, !6, i64 136}
!20 = !{!21, !12, i64 8}
!21 = !{!"", !22, i64 0, !12, i64 8, !6, i64 16, !12, i64 24, !7, i64 28}
!22 = !{!"", !23, i64 0, !12, i64 4}
!23 = !{!"short", !7, i64 0}
!24 = !{!25, !6, i64 24}
!25 = !{!"", !26, 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}
!26 = !{!"", !16, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!27 = !{!16, !16, i64 0}
!28 = !{!11, !16, i64 216}
!29 = !{!30, !6, i64 64}
!30 = !{!"_DHCP6_SERVICE", !12, i64 0, !6, i64 8, !6, i64 16, !31, i64 24, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !12, i64 72, !13, i64 80, !16, i64 96}
!31 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!32 = !{!25, !6, i64 32}
!33 = !{!34, !6, i64 40}
!34 = !{!"", !6, i64 0, !6, i64 8, !12, i64 16, !6, i64 24, !22, 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

; Function Attrs: nounwind uwtable
define dso_local i64 @EfiDhcp6RenewRebind(ptr noundef %0, i8 noundef zeroext %1) local_unnamed_addr #0 {
  %3 = icmp eq ptr %0, null
  br i1 %3, label %64, label %4

4:                                                ; preds = %2
  %5 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %5, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre45 = add i64 %.pre, -40
  %.pre47 = inttoptr i64 %.pre45 to ptr
  br i1 %.not, label %._crit_edge44, label %6

6:                                                ; preds = %4
  %7 = load i32, ptr %.pre47, align 8, !tbaa !5
  %.not38 = icmp eq i32 %7, 1228294212
  br i1 %.not38, label %._crit_edge44, label %8

8:                                                ; preds = %6
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 768, ptr noundef nonnull @.str.1) #2
  br label %._crit_edge44

._crit_edge44:                                    ; preds = %4, %6, %8
  %9 = phi ptr [ %0, %8 ], [ %.pre47, %6 ], [ %.pre47, %4 ]
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  %11 = load ptr, ptr %10, align 8, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %9, i64 120
  %13 = load ptr, ptr %12, align 8, !tbaa !16
  %14 = icmp eq ptr %13, null
  br i1 %14, label %64, label %15

15:                                               ; preds = %._crit_edge44
  %16 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not39 = icmp eq i8 %16, 0
  br i1 %.not39, label %21, label %17

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %9, i64 136
  %19 = load ptr, ptr %18, align 8, !tbaa !17
  %.not40 = icmp eq ptr %19, null
  br i1 %.not40, label %20, label %21

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

21:                                               ; preds = %17, %20, %15
  %22 = getelementptr inbounds i8, ptr %9, i64 136
  %23 = load ptr, ptr %22, align 8, !tbaa !17
  %24 = getelementptr inbounds i8, ptr %23, i64 8
  %25 = load i32, ptr %24, align 8, !tbaa !18
  %.not43 = icmp eq i8 %1, 0
  %or.cond42.v = select i1 %.not43, i32 7, i32 8
  %or.cond42.not = icmp eq i32 %25, %or.cond42.v
  br i1 %or.cond42.not, label %64, label %26

26:                                               ; preds = %21
  %.not41 = icmp eq i32 %25, 6
  br i1 %.not41, label %27, label %64

27:                                               ; preds = %26
  %28 = load ptr, ptr @gBS, align 8, !tbaa !22
  %29 = getelementptr inbounds i8, ptr %28, i64 24
  %30 = load ptr, ptr %29, align 8, !tbaa !23
  %31 = tail call i64 %30(i64 noundef 8) #2
  %32 = getelementptr inbounds i8, ptr %9, i64 216
  store volatile i64 -9223372036854775788, ptr %32, align 8, !tbaa !26
  %33 = tail call i64 @Dhcp6SendRenewRebindMsg(ptr noundef nonnull %9, i8 noundef zeroext %1) #2
  %34 = icmp slt i64 %33, 0
  br i1 %34, label %60, label %35

35:                                               ; preds = %27
  %36 = getelementptr inbounds i8, ptr %11, i64 64
  %37 = load ptr, ptr %36, align 8, !tbaa !27
  %38 = tail call i64 @UdpIoRecvDatagram(ptr noundef %37, ptr noundef nonnull @Dhcp6ReceivePacket, ptr noundef %11, i32 noundef 0) #2
  %39 = icmp slt i64 %38, 0
  %40 = icmp ne i64 %38, -9223372036854775788
  %or.cond6 = and i1 %39, %40
  br i1 %or.cond6, label %60, label %41

41:                                               ; preds = %35
  %42 = load ptr, ptr @gBS, align 8, !tbaa !22
  %43 = getelementptr inbounds i8, ptr %42, i64 32
  %44 = load ptr, ptr %43, align 8, !tbaa !30
  tail call void %44(i64 noundef %31) #2
  %45 = load ptr, ptr %12, align 8, !tbaa !16
  %46 = getelementptr inbounds i8, ptr %45, i64 40
  %47 = load ptr, ptr %46, align 8, !tbaa !31
  %48 = icmp eq ptr %47, null
  br i1 %48, label %.preheader, label %64

.preheader:                                       ; preds = %41
  %49 = load volatile i64, ptr %32, align 8, !tbaa !26
  %50 = icmp eq i64 %49, -9223372036854775788
  br i1 %50, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %51 = load ptr, ptr %36, align 8, !tbaa !27
  %52 = getelementptr inbounds i8, ptr %51, i64 744
  %53 = load ptr, ptr %52, align 8, !tbaa !33
  %54 = getelementptr inbounds i8, ptr %53, i64 48
  %55 = load ptr, ptr %54, align 8, !tbaa !34
  %56 = tail call i64 %55(ptr noundef %53) #2
  %57 = load volatile i64, ptr %32, align 8, !tbaa !26
  %58 = icmp eq i64 %57, -9223372036854775788
  br i1 %58, label %.lr.ph, label %._crit_edge, !llvm.loop !36

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %59 = load volatile i64, ptr %32, align 8, !tbaa !26
  br label %64

60:                                               ; preds = %35, %27
  %.034 = phi i64 [ %33, %27 ], [ %38, %35 ]
  %61 = load ptr, ptr @gBS, align 8, !tbaa !22
  %62 = getelementptr inbounds i8, ptr %61, i64 32
  %63 = load ptr, ptr %62, align 8, !tbaa !30
  tail call void %63(i64 noundef %31) #2
  br label %64

64:                                               ; preds = %41, %26, %21, %._crit_edge44, %2, %60, %._crit_edge
  %.0 = phi i64 [ %.034, %60 ], [ %59, %._crit_edge ], [ -9223372036854775806, %2 ], [ -9223372036854775793, %._crit_edge44 ], [ -9223372036854775788, %21 ], [ -9223372036854775793, %26 ], [ 0, %41 ]
  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 @UdpIoRecvDatagram(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

declare i64 @Dhcp6SendRenewRebindMsg(ptr noundef, i8 noundef zeroext) 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 = !{!6, !10, i64 120}
!17 = !{!6, !10, i64 136}
!18 = !{!19, !7, i64 8}
!19 = !{!"", !20, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !8, i64 28}
!20 = !{!"", !21, i64 0, !7, i64 4}
!21 = !{!"short", !8, i64 0}
!22 = !{!10, !10, i64 0}
!23 = !{!24, !10, i64 24}
!24 = !{!"", !25, 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}
!25 = !{!"", !14, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!26 = !{!6, !14, i64 216}
!27 = !{!28, !10, i64 64}
!28 = !{!"_DHCP6_SERVICE", !7, i64 0, !10, i64 8, !10, i64 16, !29, i64 24, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !7, i64 72, !11, i64 80, !14, i64 96}
!29 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !10, i64 0, !10, i64 8}
!30 = !{!24, !10, i64 32}
!31 = !{!32, !10, i64 40}
!32 = !{!"", !10, i64 0, !10, i64 8, !7, i64 16, !10, i64 24, !20, i64 32, !10, i64 40, !8, i64 48, !8, i64 49, !10, i64 56}
!33 = !{!8, !8, i64 0}
!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,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass