; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal (EfiDhcp4RenewRebind)

; 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._DHCP_PROTOCOL = type { i32, %struct._EFI_DHCP4_PROTOCOL, %struct._LIST_ENTRY, ptr, ptr, i8, ptr, ptr, ptr, ptr, i32, i16, %struct.NET_BUF_QUEUE }
%struct._EFI_DHCP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.NET_BUF_QUEUE = type { i32, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, 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._DHCP_SERVICE = type { i32, %struct._EFI_SERVICE_BINDING_PROTOCOL, i64, ptr, ptr, %struct._LIST_ENTRY, i64, i64, i64, i32, i32, i32, i32, ptr, ptr, ptr, i32, i32, i32, i64, ptr, ptr, ptr, %struct.EFI_MAC_ADDRESS, i8, i8, [16 x i8], ptr, %struct.EFI_DHCP4_CONFIG_DATA, i32, ptr, i32, i32, i64, i64, i32 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct.EFI_DHCP4_CONFIG_DATA = type { i32, ptr, i32, ptr, %struct.EFI_IPv4_ADDRESS, ptr, ptr, i32, ptr }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.DHCP_PARAMETER = type { i32, i32, i8, i8, i32, i32, i32, i32 }
%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 }
%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_UDP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

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

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

15:                                               ; preds = %3
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %145

16:                                               ; preds = %3
  %17 = call zeroext i8 @DebugAssertEnabled()
  %18 = zext i8 %17 to i32
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %30

20:                                               ; preds = %16
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = ptrtoint ptr %21 to i64
  %23 = sub i64 %22, ptrtoint (ptr getelementptr inbounds (%struct._DHCP_PROTOCOL, ptr null, i32 0, i32 1) to i64)
  %24 = inttoptr i64 %23 to ptr
  %25 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %24, i32 0, i32 0
  %26 = load i32, ptr %25, align 8, !tbaa !10
  %27 = icmp ne i32 %26, 1885562980
  br i1 %27, label %28, label %30

28:                                               ; preds = %20
  call void @DebugAssert(ptr noundef @.str, i64 noundef 902, ptr noundef @.str.1)
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  br label %35

30:                                               ; preds = %20, %16
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = ptrtoint ptr %31 to i64
  %33 = sub i64 %32, ptrtoint (ptr getelementptr inbounds (%struct._DHCP_PROTOCOL, ptr null, i32 0, i32 1) to i64)
  %34 = inttoptr i64 %33 to ptr
  br label %35

35:                                               ; preds = %30, %28
  %36 = phi ptr [ %29, %28 ], [ %34, %30 ]
  store ptr %36, ptr %8, align 8, !tbaa !5
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %37, i32 0, i32 0
  %39 = load i32, ptr %38, align 8, !tbaa !10
  %40 = icmp ne i32 %39, 1885562980
  br i1 %40, label %41, label %42

41:                                               ; preds = %35
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %145

42:                                               ; preds = %35
  %43 = load ptr, ptr @gBS, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %43, i32 0, i32 1
  %45 = load ptr, ptr %44, align 8, !tbaa !18
  %46 = call i64 %45(i64 noundef 8)
  store i64 %46, ptr %11, align 8, !tbaa !21
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %47, i32 0, i32 4
  %49 = load ptr, ptr %48, align 8, !tbaa !22
  store ptr %49, ptr %9, align 8, !tbaa !5
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %50, i32 0, i32 7
  %52 = load i64, ptr %51, align 8, !tbaa !23
  %53 = icmp eq i64 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %42
  store i64 -9223372036854775789, ptr %10, align 8, !tbaa !21
  br label %139

55:                                               ; preds = %42
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %56, i32 0, i32 7
  %58 = load i64, ptr %57, align 8, !tbaa !23
  %59 = icmp ne i64 %58, 4
  br i1 %59, label %60, label %61

60:                                               ; preds = %55
  store i64 -9223372036854775793, ptr %10, align 8, !tbaa !21
  br label %139

61:                                               ; preds = %55
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %62, i32 0, i32 15
  %64 = load ptr, ptr %63, align 8, !tbaa !28
  %65 = icmp eq ptr %64, null
  br i1 %65, label %74, label %66

66:                                               ; preds = %61
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %67, i32 0, i32 15
  %69 = load ptr, ptr %68, align 8, !tbaa !28
  %70 = getelementptr inbounds %struct.DHCP_PARAMETER, ptr %69, i32 0, i32 2
  %71 = load i8, ptr %70, align 4, !tbaa !29
  %72 = zext i8 %71 to i32
  %73 = icmp eq i32 %72, 0
  br i1 %73, label %74, label %75

74:                                               ; preds = %66, %61
  store i64 0, ptr %10, align 8, !tbaa !21
  br label %139

75:                                               ; preds = %66
  %76 = load i8, ptr %6, align 1, !tbaa !9
  %77 = icmp ne i8 %76, 0
  br i1 %77, label %81, label %78

78:                                               ; preds = %75
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = call i64 @DhcpSetState(ptr noundef %79, i64 noundef 5, i8 noundef zeroext 0)
  br label %84

81:                                               ; preds = %75
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = call i64 @DhcpSetState(ptr noundef %82, i64 noundef 6, i8 noundef zeroext 0)
  br label %84

84:                                               ; preds = %81, %78
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %85, i32 0, i32 11
  store i16 0, ptr %86, align 4, !tbaa !31
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %88, i32 0, i32 14
  %90 = load ptr, ptr %89, align 8, !tbaa !32
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %91, i32 0, i32 15
  %93 = load ptr, ptr %92, align 8, !tbaa !28
  %94 = call i64 @DhcpSendMessage(ptr noundef %87, ptr noundef %90, ptr noundef %93, i8 noundef zeroext 3, ptr noundef @.str.2)
  store i64 %94, ptr %10, align 8, !tbaa !21
  %95 = load i64, ptr %10, align 8, !tbaa !21
  %96 = icmp slt i64 %95, 0
  br i1 %96, label %97, label %100

97:                                               ; preds = %84
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = call i64 @DhcpSetState(ptr noundef %98, i64 noundef 4, i8 noundef zeroext 0)
  br label %139

100:                                              ; preds = %84
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %101, i32 0, i32 19
  store i64 1, ptr %102, align 8, !tbaa !33
  %103 = load ptr, ptr %9, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %103, i32 0, i32 8
  store i64 -9223372036854775788, ptr %104, align 8, !tbaa !34
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = load ptr, ptr %8, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %106, i32 0, i32 7
  store ptr %105, ptr %107, align 8, !tbaa !35
  %108 = load ptr, ptr @gBS, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %108, i32 0, i32 2
  %110 = load ptr, ptr %109, align 8, !tbaa !36
  %111 = load i64, ptr %11, align 8, !tbaa !21
  call void %110(i64 noundef %111)
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = icmp eq ptr %112, null
  br i1 %113, label %114, label %138

114:                                              ; preds = %100
  br label %115

115:                                              ; preds = %120, %114
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %116, i32 0, i32 8
  %118 = load i64, ptr %117, align 8, !tbaa !34
  %119 = icmp eq i64 %118, -9223372036854775788
  br i1 %119, label %120, label %134

120:                                              ; preds = %115
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %121, i32 0, i32 20
  %123 = load ptr, ptr %122, align 8, !tbaa !37
  %124 = getelementptr inbounds %struct._UDP_IO, ptr %123, i32 0, i32 10
  %125 = load ptr, ptr %124, align 8, !tbaa !9
  %126 = getelementptr inbounds %struct._EFI_UDP4_PROTOCOL, ptr %125, i32 0, i32 7
  %127 = load ptr, ptr %126, align 8, !tbaa !38
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %128, i32 0, i32 20
  %130 = load ptr, ptr %129, align 8, !tbaa !37
  %131 = getelementptr inbounds %struct._UDP_IO, ptr %130, i32 0, i32 10
  %132 = load ptr, ptr %131, align 8, !tbaa !9
  %133 = call i64 %127(ptr noundef %132)
  br label %115, !llvm.loop !40

134:                                              ; preds = %115
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %135, i32 0, i32 8
  %137 = load i64, ptr %136, align 8, !tbaa !34
  store i64 %137, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %145

138:                                              ; preds = %100
  store i64 0, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %145

139:                                              ; preds = %97, %74, %60, %54
  %140 = load ptr, ptr @gBS, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %140, i32 0, i32 2
  %142 = load ptr, ptr %141, align 8, !tbaa !36
  %143 = load i64, ptr %11, align 8, !tbaa !21
  call void %142(i64 noundef %143)
  %144 = load i64, ptr %10, align 8, !tbaa !21
  store i64 %144, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %145

145:                                              ; preds = %139, %138, %134, %41, %15
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  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 8, ptr %8) #3
  %146 = load i64, ptr %4, align 8
  ret i64 %146
}

; 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 @DhcpSetState(ptr noundef, i64 noundef, i8 noundef zeroext) #2

declare i64 @DhcpSendMessage(ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext, ptr 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 = !{!7, !7, i64 0}
!10 = !{!11, !12, i64 0}
!11 = !{!"_DHCP_PROTOCOL", !12, i64 0, !13, i64 8, !14, i64 80, !6, i64 96, !6, i64 104, !7, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !12, i64 152, !15, i64 156, !16, i64 160}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_EFI_DHCP4_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 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!15 = !{!"short", !7, i64 0}
!16 = !{!"", !12, i64 0, !17, i64 8, !14, i64 16, !14, i64 32, !12, i64 48, !12, i64 52}
!17 = !{!"long long", !7, i64 0}
!18 = !{!19, !6, i64 24}
!19 = !{!"", !20, 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}
!20 = !{!"", !17, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!21 = !{!17, !17, i64 0}
!22 = !{!11, !6, i64 104}
!23 = !{!24, !17, i64 72}
!24 = !{!"_DHCP_SERVICE", !12, i64 0, !25, i64 8, !17, i64 24, !6, i64 32, !6, i64 40, !14, i64 48, !17, i64 64, !17, i64 72, !17, i64 80, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !6, i64 104, !6, i64 112, !6, i64 120, !12, i64 128, !12, i64 132, !12, i64 136, !17, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !26, i64 176, !7, i64 208, !7, i64 209, !7, i64 210, !6, i64 232, !27, i64 240, !12, i64 312, !6, i64 320, !12, i64 328, !12, i64 332, !17, i64 336, !17, i64 344, !12, i64 352}
!25 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!26 = !{!"", !7, i64 0}
!27 = !{!"", !12, i64 0, !6, i64 8, !12, i64 16, !6, i64 24, !26, i64 32, !6, i64 40, !6, i64 48, !12, i64 56, !6, i64 64}
!28 = !{!24, !6, i64 120}
!29 = !{!30, !7, i64 8}
!30 = !{!"", !12, i64 0, !12, i64 4, !7, i64 8, !7, i64 9, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24}
!31 = !{!11, !15, i64 156}
!32 = !{!24, !6, i64 112}
!33 = !{!24, !17, i64 144}
!34 = !{!24, !17, i64 80}
!35 = !{!11, !6, i64 128}
!36 = !{!19, !6, i64 32}
!37 = !{!24, !6, i64 152}
!38 = !{!39, !6, i64 56}
!39 = !{!"_EFI_UDP4_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}
!40 = distinct !{!40, !41}
!41 = !{!"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 [153 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.2 = external hidden unnamed_addr constant [38 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @EfiDhcp4RenewRebind(ptr noundef %0, i8 noundef zeroext %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = icmp eq ptr %0, null
  br i1 %4, label %.loopexit, label %5

5:                                                ; preds = %3
  %6 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %6, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre41 = add i64 %.pre, -8
  %.pre43 = inttoptr i64 %.pre41 to ptr
  br i1 %.not, label %._crit_edge, label %7

7:                                                ; preds = %5
  %8 = load i32, ptr %.pre43, align 8, !tbaa !5
  %.not37 = icmp eq i32 %8, 1885562980
  br i1 %.not37, label %.thread, label %9

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

._crit_edge:                                      ; preds = %5, %9
  %.ph = phi ptr [ %0, %9 ], [ %.pre43, %5 ]
  %.pr = load i32, ptr %.ph, align 8, !tbaa !5
  %.not38 = icmp eq i32 %.pr, 1885562980
  br i1 %.not38, label %.thread, label %.loopexit

.thread:                                          ; preds = %7, %._crit_edge
  %10 = phi ptr [ %.ph, %._crit_edge ], [ %.pre43, %7 ]
  %11 = load ptr, ptr @gBS, align 8, !tbaa !16
  %12 = getelementptr inbounds i8, ptr %11, i64 24
  %13 = load ptr, ptr %12, align 8, !tbaa !17
  %14 = tail call i64 %13(i64 noundef 8) #2
  %15 = getelementptr inbounds i8, ptr %10, i64 104
  %16 = load ptr, ptr %15, align 8, !tbaa !20
  %17 = getelementptr inbounds i8, ptr %16, i64 72
  %18 = load i64, ptr %17, align 8, !tbaa !21
  switch i64 %18, label %19 [
    i64 0, label %58
    i64 4, label %20
  ]

19:                                               ; preds = %.thread
  br label %58

20:                                               ; preds = %.thread
  %21 = getelementptr inbounds i8, ptr %16, i64 120
  %22 = load ptr, ptr %21, align 8, !tbaa !26
  %23 = icmp eq ptr %22, null
  br i1 %23, label %58, label %24

24:                                               ; preds = %20
  %25 = getelementptr inbounds i8, ptr %22, i64 8
  %26 = load i8, ptr %25, align 4, !tbaa !27
  %27 = icmp eq i8 %26, 0
  br i1 %27, label %58, label %28

28:                                               ; preds = %24
  %.not40 = icmp eq i8 %1, 0
  %. = select i1 %.not40, i64 5, i64 6
  %29 = tail call i64 @DhcpSetState(ptr noundef nonnull %16, i64 noundef %., i8 noundef zeroext 0) #2
  %30 = getelementptr inbounds i8, ptr %10, i64 156
  store i16 0, ptr %30, align 4, !tbaa !29
  %31 = getelementptr inbounds i8, ptr %16, i64 112
  %32 = load ptr, ptr %31, align 8, !tbaa !30
  %33 = load ptr, ptr %21, align 8, !tbaa !26
  %34 = tail call i64 @DhcpSendMessage(ptr noundef nonnull %16, ptr noundef %32, ptr noundef %33, i8 noundef zeroext 3, ptr noundef nonnull @.str.2) #2
  %35 = icmp slt i64 %34, 0
  br i1 %35, label %36, label %38

36:                                               ; preds = %28
  %37 = tail call i64 @DhcpSetState(ptr noundef nonnull %16, i64 noundef 4, i8 noundef zeroext 0) #2
  br label %58

38:                                               ; preds = %28
  %39 = getelementptr inbounds i8, ptr %16, i64 144
  store i64 1, ptr %39, align 8, !tbaa !31
  %40 = getelementptr inbounds i8, ptr %16, i64 80
  store i64 -9223372036854775788, ptr %40, align 8, !tbaa !32
  %41 = getelementptr inbounds i8, ptr %10, i64 128
  store ptr %2, ptr %41, align 8, !tbaa !33
  %42 = load ptr, ptr @gBS, align 8, !tbaa !16
  %43 = getelementptr inbounds i8, ptr %42, i64 32
  %44 = load ptr, ptr %43, align 8, !tbaa !34
  tail call void %44(i64 noundef %14) #2
  %45 = icmp eq ptr %2, null
  br i1 %45, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %38
  %46 = load i64, ptr %40, align 8, !tbaa !32
  %47 = icmp eq i64 %46, -9223372036854775788
  br i1 %47, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader
  %48 = getelementptr inbounds i8, ptr %16, i64 152
  br label %49

49:                                               ; preds = %.lr.ph, %49
  %50 = load ptr, ptr %48, align 8, !tbaa !35
  %51 = getelementptr inbounds i8, ptr %50, i64 744
  %52 = load ptr, ptr %51, align 8, !tbaa !36
  %53 = getelementptr inbounds i8, ptr %52, i64 56
  %54 = load ptr, ptr %53, align 8, !tbaa !37
  %55 = tail call i64 %54(ptr noundef %52) #2
  %56 = load i64, ptr %40, align 8, !tbaa !32
  %57 = icmp eq i64 %56, -9223372036854775788
  br i1 %57, label %49, label %.loopexit, !llvm.loop !39

58:                                               ; preds = %20, %24, %.thread, %36, %19
  %.031 = phi i64 [ -9223372036854775793, %19 ], [ %34, %36 ], [ -9223372036854775789, %.thread ], [ 0, %24 ], [ 0, %20 ]
  %59 = load ptr, ptr @gBS, align 8, !tbaa !16
  %60 = getelementptr inbounds i8, ptr %59, i64 32
  %61 = load ptr, ptr %60, align 8, !tbaa !34
  tail call void %61(i64 noundef %14) #2
  br label %.loopexit

.loopexit:                                        ; preds = %49, %.preheader, %38, %._crit_edge, %3, %58
  %.0 = phi i64 [ %.031, %58 ], [ -9223372036854775806, %3 ], [ -9223372036854775806, %._crit_edge ], [ 0, %38 ], [ %46, %.preheader ], [ %56, %49 ]
  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 @DhcpSetState(ptr noundef, i64 noundef, i8 noundef zeroext) local_unnamed_addr #1

declare i64 @DhcpSendMessage(ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_DHCP_PROTOCOL", !7, i64 0, !10, i64 8, !12, i64 80, !11, i64 96, !11, i64 104, !8, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !7, i64 152, !13, i64 156, !14, i64 160}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_EFI_DHCP4_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_LIST_ENTRY", !11, i64 0, !11, i64 8}
!13 = !{!"short", !8, i64 0}
!14 = !{!"", !7, i64 0, !15, i64 8, !12, i64 16, !12, i64 32, !7, i64 48, !7, i64 52}
!15 = !{!"long long", !8, i64 0}
!16 = !{!11, !11, i64 0}
!17 = !{!18, !11, i64 24}
!18 = !{!"", !19, 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}
!19 = !{!"", !15, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!20 = !{!6, !11, i64 104}
!21 = !{!22, !15, i64 72}
!22 = !{!"_DHCP_SERVICE", !7, i64 0, !23, i64 8, !15, i64 24, !11, i64 32, !11, i64 40, !12, i64 48, !15, i64 64, !15, i64 72, !15, i64 80, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !11, i64 104, !11, i64 112, !11, i64 120, !7, i64 128, !7, i64 132, !7, i64 136, !15, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !24, i64 176, !8, i64 208, !8, i64 209, !8, i64 210, !11, i64 232, !25, i64 240, !7, i64 312, !11, i64 320, !7, i64 328, !7, i64 332, !15, i64 336, !15, i64 344, !7, i64 352}
!23 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !11, i64 0, !11, i64 8}
!24 = !{!"", !8, i64 0}
!25 = !{!"", !7, i64 0, !11, i64 8, !7, i64 16, !11, i64 24, !24, i64 32, !11, i64 40, !11, i64 48, !7, i64 56, !11, i64 64}
!26 = !{!22, !11, i64 120}
!27 = !{!28, !8, i64 8}
!28 = !{!"", !7, i64 0, !7, i64 4, !8, i64 8, !8, i64 9, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24}
!29 = !{!6, !13, i64 156}
!30 = !{!22, !11, i64 112}
!31 = !{!22, !15, i64 144}
!32 = !{!22, !15, i64 80}
!33 = !{!6, !11, i64 128}
!34 = !{!18, !11, i64 32}
!35 = !{!22, !11, i64 152}
!36 = !{!8, !8, i64 0}
!37 = !{!38, !11, i64 56}
!38 = !{!"_EFI_UDP4_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}


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