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

; 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.GUID = type { i32, i16, i16, [8 x i8] }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.NET_FRAGMENT = type { i32, ptr }
%struct.UDP_END_POINT = type { %union.EFI_IP_ADDRESS, i16, %union.EFI_IP_ADDRESS, i16 }
%union.EFI_IP_ADDRESS = type { [4 x i32] }
%struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN = type { i64, ptr, %struct.EFI_IPv4_ADDRESS, i16, %struct.EFI_IPv4_ADDRESS, i32, ptr, i32, ptr, i32, ptr }
%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_DHCP4_PACKET = type <{ i32, i32, %struct.anon }>
%struct.anon = type <{ %struct.EFI_DHCP4_HEADER, i32, [1 x i8] }>
%struct.EFI_DHCP4_HEADER = type { i8, i8, i8, i8, i32, i16, i16, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, [16 x i8], [64 x i8], [128 x i8] }
%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_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._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
@gEfiUdp4ProtocolGuid = external global %struct.GUID, align 4
@mZeroIp4Addr = external global %struct.EFI_IPv4_ADDRESS, align 1

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

19:                                               ; preds = %2
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %27, label %22

22:                                               ; preds = %19
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %23, i32 0, i32 8
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %28

27:                                               ; preds = %22, %19, %2
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %318

28:                                               ; preds = %22
  %29 = call zeroext i8 @DebugAssertEnabled()
  %30 = zext i8 %29 to i32
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %42

32:                                               ; preds = %28
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = ptrtoint ptr %33 to i64
  %35 = sub i64 %34, ptrtoint (ptr getelementptr inbounds (%struct._DHCP_PROTOCOL, ptr null, i32 0, i32 1) to i64)
  %36 = inttoptr i64 %35 to ptr
  %37 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %36, i32 0, i32 0
  %38 = load i32, ptr %37, align 8, !tbaa !15
  %39 = icmp ne i32 %38, 1885562980
  br i1 %39, label %40, label %42

40:                                               ; preds = %32
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1490, ptr noundef @.str.1)
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  br label %47

42:                                               ; preds = %32, %28
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = ptrtoint ptr %43 to i64
  %45 = sub i64 %44, ptrtoint (ptr getelementptr inbounds (%struct._DHCP_PROTOCOL, ptr null, i32 0, i32 1) to i64)
  %46 = inttoptr i64 %45 to ptr
  br label %47

47:                                               ; preds = %42, %40
  %48 = phi ptr [ %41, %40 ], [ %46, %42 ]
  store ptr %48, ptr %6, align 8, !tbaa !5
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %49, i32 0, i32 4
  %51 = load ptr, ptr %50, align 8, !tbaa !20
  store ptr %51, ptr %13, align 8, !tbaa !5
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %52, i32 0, i32 8
  %54 = load ptr, ptr %53, align 8, !tbaa !21
  %55 = icmp ne ptr %54, null
  br i1 %55, label %56, label %57

56:                                               ; preds = %47
  store i64 -9223372036854775802, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %318

57:                                               ; preds = %47
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %58, i32 0, i32 8
  %60 = load ptr, ptr %59, align 8, !tbaa !9
  %61 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %60, i32 0, i32 2
  %62 = getelementptr inbounds %struct.anon, ptr %61, i32 0, i32 1
  %63 = load i32, ptr %62, align 1, !tbaa !22
  %64 = icmp ne i32 %63, 1666417251
  br i1 %64, label %106, label %65

65:                                               ; preds = %57
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %66, i32 0, i32 8
  %68 = load ptr, ptr %67, align 8, !tbaa !9
  %69 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %68, i32 0, i32 2
  %70 = getelementptr inbounds %struct.anon, ptr %69, i32 0, i32 0
  %71 = getelementptr inbounds %struct.EFI_DHCP4_HEADER, ptr %70, i32 0, i32 4
  %72 = load i32, ptr %71, align 1, !tbaa !26
  %73 = call i32 @SwapBytes32(i32 noundef %72)
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %74, i32 0, i32 4
  %76 = load ptr, ptr %75, align 8, !tbaa !20
  %77 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %76, i32 0, i32 9
  %78 = load i32, ptr %77, align 8, !tbaa !27
  %79 = icmp eq i32 %73, %78
  br i1 %79, label %106, label %80

80:                                               ; preds = %65
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %81, i32 0, i32 7
  %83 = load i32, ptr %82, align 8, !tbaa !31
  %84 = icmp eq i32 %83, 0
  br i1 %84, label %106, label %85

85:                                               ; preds = %80
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %86, i32 0, i32 5
  %88 = load i32, ptr %87, align 4, !tbaa !32
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %95

90:                                               ; preds = %85
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %91, i32 0, i32 6
  %93 = load ptr, ptr %92, align 8, !tbaa !33
  %94 = icmp eq ptr %93, null
  br i1 %94, label %106, label %95

95:                                               ; preds = %90, %85
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %96, i32 0, i32 8
  %98 = load ptr, ptr %97, align 8, !tbaa !9
  %99 = call i64 @DhcpValidateOptions(ptr noundef %98, ptr noundef null)
  %100 = icmp slt i64 %99, 0
  br i1 %100, label %106, label %101

101:                                              ; preds = %95
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %102, i32 0, i32 2
  %104 = call i64 @CompareMem(ptr noundef %103, ptr noundef @mZeroIp4Addr, i64 noundef 4)
  %105 = icmp eq i64 %104, 0
  br i1 %105, label %106, label %107

106:                                              ; preds = %101, %95, %90, %80, %65, %57
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %318

107:                                              ; preds = %101
  %108 = load ptr, ptr %13, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %108, i32 0, i32 10
  %110 = load i32, ptr %109, align 4, !tbaa !34
  %111 = icmp eq i32 %110, 0
  br i1 %111, label %112, label %113

112:                                              ; preds = %107
  store i64 -9223372036854775791, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %318

113:                                              ; preds = %107
  %114 = load ptr, ptr @gBS, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %114, i32 0, i32 1
  %116 = load ptr, ptr %115, align 8, !tbaa !35
  %117 = call i64 %116(i64 noundef 8)
  store i64 %117, ptr %7, align 8, !tbaa !38
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %119, i32 0, i32 8
  store ptr %118, ptr %120, align 8, !tbaa !21
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %121, i32 0, i32 7
  %123 = load i32, ptr %122, align 8, !tbaa !31
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %124, i32 0, i32 10
  store i32 %123, ptr %125, align 8, !tbaa !39
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = call i64 @Dhcp4InstanceCreateUdpIo(ptr noundef %126)
  store i64 %127, ptr %8, align 8, !tbaa !38
  %128 = load i64, ptr %8, align 8, !tbaa !38
  %129 = icmp slt i64 %128, 0
  br i1 %129, label %130, label %131

130:                                              ; preds = %113
  br label %231

131:                                              ; preds = %113
  %132 = load ptr, ptr %13, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %132, i32 0, i32 26
  %134 = getelementptr inbounds [16 x i8], ptr %133, i64 0, i64 0
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %135, i32 0, i32 8
  %137 = load ptr, ptr %136, align 8, !tbaa !9
  %138 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %137, i32 0, i32 2
  %139 = getelementptr inbounds %struct.anon, ptr %138, i32 0, i32 0
  %140 = getelementptr inbounds %struct.EFI_DHCP4_HEADER, ptr %139, i32 0, i32 11
  %141 = getelementptr inbounds [16 x i8], ptr %140, i64 0, i64 0
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %142, i32 0, i32 8
  %144 = load ptr, ptr %143, align 8, !tbaa !9
  %145 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %144, i32 0, i32 2
  %146 = getelementptr inbounds %struct.anon, ptr %145, i32 0, i32 0
  %147 = getelementptr inbounds %struct.EFI_DHCP4_HEADER, ptr %146, i32 0, i32 2
  %148 = load i8, ptr %147, align 1, !tbaa !40
  %149 = zext i8 %148 to i64
  %150 = call ptr @CopyMem(ptr noundef %134, ptr noundef %141, i64 noundef %149)
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %151, i32 0, i32 8
  %153 = load ptr, ptr %152, align 8, !tbaa !9
  %154 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %153, i32 0, i32 2
  %155 = getelementptr inbounds %struct.NET_FRAGMENT, ptr %9, i32 0, i32 1
  store ptr %154, ptr %155, align 8, !tbaa !41
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %156, i32 0, i32 8
  %158 = load ptr, ptr %157, align 8, !tbaa !9
  %159 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %158, i32 0, i32 1
  %160 = load i32, ptr %159, align 1, !tbaa !43
  %161 = getelementptr inbounds %struct.NET_FRAGMENT, ptr %9, i32 0, i32 0
  store i32 %160, ptr %161, align 8, !tbaa !44
  %162 = call ptr @NetbufFromExt(ptr noundef %9, i32 noundef 1, i32 noundef 0, i32 noundef 0, ptr noundef @DhcpDummyExtFree, ptr noundef null)
  store ptr %162, ptr %10, align 8, !tbaa !5
  %163 = load ptr, ptr %10, align 8, !tbaa !5
  %164 = icmp eq ptr %163, null
  br i1 %164, label %165, label %166

165:                                              ; preds = %131
  store i64 -9223372036854775799, ptr %8, align 8, !tbaa !38
  br label %231

166:                                              ; preds = %131
  %167 = call ptr @ZeroMem(ptr noundef %11, i64 noundef 40)
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %168, i32 0, i32 2
  %170 = call ptr @CopyMem(ptr noundef %12, ptr noundef %169, i64 noundef 4)
  %171 = load i32, ptr %12, align 4, !tbaa !45
  %172 = call i32 @SwapBytes32(i32 noundef %171)
  %173 = getelementptr inbounds %struct.UDP_END_POINT, ptr %11, i32 0, i32 2
  %174 = getelementptr inbounds [4 x i32], ptr %173, i64 0, i64 0
  store i32 %172, ptr %174, align 4, !tbaa !46
  %175 = load ptr, ptr %5, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %175, i32 0, i32 3
  %177 = load i16, ptr %176, align 4, !tbaa !47
  %178 = zext i16 %177 to i32
  %179 = icmp eq i32 %178, 0
  br i1 %179, label %180, label %182

180:                                              ; preds = %166
  %181 = getelementptr inbounds %struct.UDP_END_POINT, ptr %11, i32 0, i32 3
  store i16 67, ptr %181, align 4, !tbaa !48
  br label %187

182:                                              ; preds = %166
  %183 = load ptr, ptr %5, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %183, i32 0, i32 3
  %185 = load i16, ptr %184, align 4, !tbaa !47
  %186 = getelementptr inbounds %struct.UDP_END_POINT, ptr %11, i32 0, i32 3
  store i16 %185, ptr %186, align 4, !tbaa !48
  br label %187

187:                                              ; preds = %182, %180
  %188 = load ptr, ptr %13, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %188, i32 0, i32 11
  %190 = load i32, ptr %189, align 8, !tbaa !50
  store i32 %190, ptr %15, align 4, !tbaa !45
  %191 = call ptr @ZeroMem(ptr noundef %14, i64 noundef 16)
  %192 = load ptr, ptr %13, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %192, i32 0, i32 10
  %194 = load i32, ptr %193, align 4, !tbaa !34
  %195 = load i32, ptr %15, align 4, !tbaa !45
  %196 = and i32 %194, %195
  %197 = getelementptr inbounds %struct.UDP_END_POINT, ptr %11, i32 0, i32 2
  %198 = getelementptr inbounds [4 x i32], ptr %197, i64 0, i64 0
  %199 = load i32, ptr %198, align 4, !tbaa !46
  %200 = load i32, ptr %15, align 4, !tbaa !45
  %201 = and i32 %199, %200
  %202 = icmp eq i32 %196, %201
  br i1 %202, label %211, label %203

203:                                              ; preds = %187
  %204 = load ptr, ptr %5, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %204, i32 0, i32 4
  %206 = call ptr @CopyMem(ptr noundef %14, ptr noundef %205, i64 noundef 4)
  %207 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 0
  %208 = load i32, ptr %207, align 4, !tbaa !46
  %209 = call i32 @SwapBytes32(i32 noundef %208)
  %210 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 0
  store i32 %209, ptr %210, align 4, !tbaa !46
  br label %211

211:                                              ; preds = %203, %187
  %212 = load ptr, ptr %6, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %212, i32 0, i32 9
  %214 = load ptr, ptr %213, align 8, !tbaa !51
  %215 = load ptr, ptr %10, align 8, !tbaa !5
  %216 = call i64 @UdpIoSendDatagram(ptr noundef %214, ptr noundef %215, ptr noundef %11, ptr noundef %14, ptr noundef @DhcpOnPacketSent, ptr noundef null)
  store i64 %216, ptr %8, align 8, !tbaa !38
  %217 = load i64, ptr %8, align 8, !tbaa !38
  %218 = icmp slt i64 %217, 0
  br i1 %218, label %219, label %221

219:                                              ; preds = %211
  %220 = load ptr, ptr %10, align 8, !tbaa !5
  call void @NetbufFree(ptr noundef %220)
  br label %231

221:                                              ; preds = %211
  %222 = load ptr, ptr %6, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %222, i32 0, i32 9
  %224 = load ptr, ptr %223, align 8, !tbaa !51
  %225 = load ptr, ptr %6, align 8, !tbaa !5
  %226 = call i64 @UdpIoRecvDatagram(ptr noundef %224, ptr noundef @PxeDhcpInput, ptr noundef %225, i32 noundef 0)
  store i64 %226, ptr %8, align 8, !tbaa !38
  %227 = load i64, ptr %8, align 8, !tbaa !38
  %228 = icmp slt i64 %227, 0
  br i1 %228, label %229, label %230

229:                                              ; preds = %221
  br label %231

230:                                              ; preds = %221
  br label %231

231:                                              ; preds = %230, %229, %219, %165, %130
  %232 = load i64, ptr %8, align 8, !tbaa !38
  %233 = icmp slt i64 %232, 0
  br i1 %233, label %234, label %268

234:                                              ; preds = %231
  %235 = load ptr, ptr %6, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %235, i32 0, i32 9
  %237 = load ptr, ptr %236, align 8, !tbaa !51
  %238 = icmp ne ptr %237, null
  br i1 %238, label %239, label %268

239:                                              ; preds = %234
  %240 = load ptr, ptr %6, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %240, i32 0, i32 9
  %242 = load ptr, ptr %241, align 8, !tbaa !51
  call void @UdpIoCleanIo(ptr noundef %242)
  %243 = load ptr, ptr @gBS, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %243, i32 0, i32 34
  %245 = load ptr, ptr %244, align 8, !tbaa !52
  %246 = load ptr, ptr %6, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %246, i32 0, i32 9
  %248 = load ptr, ptr %247, align 8, !tbaa !51
  %249 = getelementptr inbounds %struct._UDP_IO, ptr %248, i32 0, i32 6
  %250 = load ptr, ptr %249, align 8, !tbaa !53
  %251 = load ptr, ptr %6, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %251, i32 0, i32 4
  %253 = load ptr, ptr %252, align 8, !tbaa !20
  %254 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %253, i32 0, i32 4
  %255 = load ptr, ptr %254, align 8, !tbaa !56
  %256 = load ptr, ptr %6, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %256, i32 0, i32 3
  %258 = load ptr, ptr %257, align 8, !tbaa !57
  %259 = call i64 %245(ptr noundef %250, ptr noundef @gEfiUdp4ProtocolGuid, ptr noundef %255, ptr noundef %258)
  %260 = load ptr, ptr %6, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %260, i32 0, i32 9
  %262 = load ptr, ptr %261, align 8, !tbaa !51
  %263 = call i64 @UdpIoFreeIo(ptr noundef %262)
  %264 = load ptr, ptr %6, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %264, i32 0, i32 9
  store ptr null, ptr %265, align 8, !tbaa !51
  %266 = load ptr, ptr %6, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %266, i32 0, i32 8
  store ptr null, ptr %267, align 8, !tbaa !21
  br label %268

268:                                              ; preds = %239, %234, %231
  %269 = load ptr, ptr @gBS, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %269, i32 0, i32 2
  %271 = load ptr, ptr %270, align 8, !tbaa !58
  %272 = load i64, ptr %7, align 8, !tbaa !38
  call void %271(i64 noundef %272)
  %273 = load i64, ptr %8, align 8, !tbaa !38
  %274 = icmp slt i64 %273, 0
  br i1 %274, label %316, label %275

275:                                              ; preds = %268
  %276 = load ptr, ptr %5, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN, ptr %276, i32 0, i32 1
  %278 = load ptr, ptr %277, align 8, !tbaa !59
  %279 = icmp eq ptr %278, null
  br i1 %279, label %280, label %316

280:                                              ; preds = %275
  br label %281

281:                                              ; preds = %314, %280
  br label %282

282:                                              ; preds = %281
  %283 = load ptr, ptr @gBS, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %283, i32 0, i32 1
  %285 = load ptr, ptr %284, align 8, !tbaa !35
  %286 = call i64 %285(i64 noundef 8)
  store i64 %286, ptr %7, align 8, !tbaa !38
  %287 = load ptr, ptr %6, align 8, !tbaa !5
  %288 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %287, i32 0, i32 10
  %289 = load i32, ptr %288, align 8, !tbaa !39
  %290 = icmp ugt i32 %289, 0
  br i1 %290, label %291, label %309

291:                                              ; preds = %282
  %292 = load ptr, ptr %6, align 8, !tbaa !5
  %293 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %292, i32 0, i32 9
  %294 = load ptr, ptr %293, align 8, !tbaa !51
  %295 = getelementptr inbounds %struct._UDP_IO, ptr %294, i32 0, i32 10
  %296 = load ptr, ptr %295, align 8, !tbaa !46
  %297 = getelementptr inbounds %struct._EFI_UDP4_PROTOCOL, ptr %296, i32 0, i32 7
  %298 = load ptr, ptr %297, align 8, !tbaa !60
  %299 = load ptr, ptr %6, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %299, i32 0, i32 9
  %301 = load ptr, ptr %300, align 8, !tbaa !51
  %302 = getelementptr inbounds %struct._UDP_IO, ptr %301, i32 0, i32 10
  %303 = load ptr, ptr %302, align 8, !tbaa !46
  %304 = call i64 %298(ptr noundef %303)
  %305 = load ptr, ptr @gBS, align 8, !tbaa !5
  %306 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %305, i32 0, i32 2
  %307 = load ptr, ptr %306, align 8, !tbaa !58
  %308 = load i64, ptr %7, align 8, !tbaa !38
  call void %307(i64 noundef %308)
  br label %314

309:                                              ; preds = %282
  %310 = load ptr, ptr @gBS, align 8, !tbaa !5
  %311 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %310, i32 0, i32 2
  %312 = load ptr, ptr %311, align 8, !tbaa !58
  %313 = load i64, ptr %7, align 8, !tbaa !38
  call void %312(i64 noundef %313)
  br label %315

314:                                              ; preds = %291
  br label %281

315:                                              ; preds = %309
  br label %316

316:                                              ; preds = %315, %275, %268
  %317 = load i64, ptr %8, align 8, !tbaa !38
  store i64 %317, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %318

318:                                              ; preds = %316, %112, %106, %56, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 16, 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
  %319 = load i64, ptr %3, align 8
  ret i64 %319
}

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

declare i32 @SwapBytes32(i32 noundef) #2

declare ptr @ZeroMem(ptr noundef, i64 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 @DhcpValidateOptions(ptr noundef, ptr noundef) #2

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

declare i64 @UdpIoFreeIo(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @DhcpDummyExtFree(ptr noundef) #0

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

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

declare void @NetbufFree(ptr noundef) #2

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

declare void @UdpIoCleanIo(ptr noundef) #2

declare ptr @NetbufFromExt(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #2

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

declare void @DhcpOnPacketSent(ptr noundef, ptr noundef, i64 noundef, 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 = !{!10, !6, i64 48}
!10 = !{!"", !11, i64 0, !6, i64 8, !12, i64 16, !13, i64 20, !12, i64 22, !14, i64 28, !6, i64 32, !14, i64 40, !6, i64 48, !14, i64 56, !6, i64 64}
!11 = !{!"long long", !7, i64 0}
!12 = !{!"", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !14, i64 0}
!16 = !{!"_DHCP_PROTOCOL", !14, i64 0, !17, i64 8, !18, i64 80, !6, i64 96, !6, i64 104, !7, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !14, i64 152, !13, i64 156, !19, i64 160}
!17 = !{!"_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}
!18 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!19 = !{!"", !14, i64 0, !11, i64 8, !18, i64 16, !18, i64 32, !14, i64 48, !14, i64 52}
!20 = !{!16, !6, i64 104}
!21 = !{!16, !6, i64 136}
!22 = !{!23, !14, i64 244}
!23 = !{!"", !14, i64 0, !14, i64 4, !24, i64 8}
!24 = !{!"", !25, i64 0, !14, i64 236, !7, i64 240}
!25 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !14, i64 4, !13, i64 8, !13, i64 10, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}
!26 = !{!23, !14, i64 12}
!27 = !{!28, !14, i64 88}
!28 = !{!"_DHCP_SERVICE", !14, i64 0, !29, i64 8, !11, i64 24, !6, i64 32, !6, i64 40, !18, i64 48, !11, i64 64, !11, i64 72, !11, i64 80, !14, i64 88, !14, i64 92, !14, i64 96, !14, i64 100, !6, i64 104, !6, i64 112, !6, i64 120, !14, i64 128, !14, i64 132, !14, i64 136, !11, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !12, i64 176, !7, i64 208, !7, i64 209, !7, i64 210, !6, i64 232, !30, i64 240, !14, i64 312, !6, i64 320, !14, i64 328, !14, i64 332, !11, i64 336, !11, i64 344, !14, i64 352}
!29 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!30 = !{!"", !14, i64 0, !6, i64 8, !14, i64 16, !6, i64 24, !12, i64 32, !6, i64 40, !6, i64 48, !14, i64 56, !6, i64 64}
!31 = !{!10, !14, i64 40}
!32 = !{!10, !14, i64 28}
!33 = !{!10, !6, i64 32}
!34 = !{!28, !14, i64 92}
!35 = !{!36, !6, i64 24}
!36 = !{!"", !37, 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}
!37 = !{!"", !11, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!38 = !{!11, !11, i64 0}
!39 = !{!16, !14, i64 152}
!40 = !{!23, !7, i64 10}
!41 = !{!42, !6, i64 8}
!42 = !{!"", !14, i64 0, !6, i64 8}
!43 = !{!23, !14, i64 4}
!44 = !{!42, !14, i64 0}
!45 = !{!14, !14, i64 0}
!46 = !{!7, !7, i64 0}
!47 = !{!10, !13, i64 20}
!48 = !{!49, !13, i64 36}
!49 = !{!"", !7, i64 0, !13, i64 16, !7, i64 20, !13, i64 36}
!50 = !{!28, !14, i64 96}
!51 = !{!16, !6, i64 144}
!52 = !{!36, !6, i64 288}
!53 = !{!54, !6, i64 56}
!54 = !{!"_UDP_IO", !14, i64 0, !18, i64 8, !11, i64 24, !7, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !55, i64 64, !18, i64 720, !6, i64 736, !7, i64 744, !7, i64 752}
!55 = !{!"", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !7, i64 40, !12, i64 552, !12, i64 584, !12, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!56 = !{!28, !6, i64 40}
!57 = !{!16, !6, i64 96}
!58 = !{!36, !6, i64 32}
!59 = !{!10, !6, i64 8}
!60 = !{!61, !6, i64 56}
!61 = !{!"_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}


; 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.GUID = type { i32, i16, i16, [8 x i8] }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.NET_FRAGMENT = type { i32, ptr }
%struct.UDP_END_POINT = type { %union.EFI_IP_ADDRESS, i16, %union.EFI_IP_ADDRESS, i16 }
%union.EFI_IP_ADDRESS = type { [4 x i32] }

@.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
@gEfiUdp4ProtocolGuid = external global %struct.GUID, align 4
@mZeroIp4Addr = external global %struct.EFI_IPv4_ADDRESS, align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @EfiDhcp4TransmitReceive(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.NET_FRAGMENT, align 8
  %4 = alloca %struct.UDP_END_POINT, align 4
  %5 = alloca i32, align 4
  %6 = alloca %union.EFI_IP_ADDRESS, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  %7 = icmp eq ptr %0, null
  %8 = icmp eq ptr %1, null
  %or.cond = or i1 %7, %8
  br i1 %or.cond, label %162, label %9

9:                                                ; preds = %2
  %10 = getelementptr inbounds i8, ptr %1, i64 48
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = icmp eq ptr %11, null
  br i1 %12, label %162, label %13

13:                                               ; preds = %9
  %14 = tail call zeroext i8 @DebugAssertEnabled() #4
  %.not = icmp eq i8 %14, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre81 = add i64 %.pre, -8
  %.pre83 = inttoptr i64 %.pre81 to ptr
  br i1 %.not, label %._crit_edge80, label %15

15:                                               ; preds = %13
  %16 = load i32, ptr %.pre83, align 8, !tbaa !14
  %.not69 = icmp eq i32 %16, 1885562980
  br i1 %.not69, label %._crit_edge80, label %17

17:                                               ; preds = %15
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1490, ptr noundef nonnull @.str.1) #4
  br label %._crit_edge80

._crit_edge80:                                    ; preds = %13, %15, %17
  %18 = phi ptr [ %0, %17 ], [ %.pre83, %15 ], [ %.pre83, %13 ]
  %19 = getelementptr inbounds i8, ptr %18, i64 104
  %20 = load ptr, ptr %19, align 8, !tbaa !19
  %21 = getelementptr inbounds i8, ptr %18, i64 136
  %22 = load ptr, ptr %21, align 8, !tbaa !20
  %.not70 = icmp eq ptr %22, null
  br i1 %.not70, label %23, label %162

23:                                               ; preds = %._crit_edge80
  %24 = load ptr, ptr %10, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %24, i64 244
  %26 = load i32, ptr %25, align 1, !tbaa !21
  %.not71 = icmp eq i32 %26, 1666417251
  br i1 %.not71, label %27, label %162

27:                                               ; preds = %23
  %28 = getelementptr inbounds i8, ptr %24, i64 12
  %29 = load i32, ptr %28, align 1, !tbaa !25
  %30 = tail call i32 @SwapBytes32(i32 noundef %29) #4
  %31 = load ptr, ptr %19, align 8, !tbaa !19
  %32 = getelementptr inbounds i8, ptr %31, i64 88
  %33 = load i32, ptr %32, align 8, !tbaa !26
  %34 = icmp eq i32 %30, %33
  br i1 %34, label %162, label %35

35:                                               ; preds = %27
  %36 = getelementptr inbounds i8, ptr %1, i64 40
  %37 = load i32, ptr %36, align 8, !tbaa !30
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %162, label %39

39:                                               ; preds = %35
  %40 = getelementptr inbounds i8, ptr %1, i64 28
  %41 = load i32, ptr %40, align 4, !tbaa !31
  %.not72 = icmp eq i32 %41, 0
  br i1 %.not72, label %46, label %42

42:                                               ; preds = %39
  %43 = getelementptr inbounds i8, ptr %1, i64 32
  %44 = load ptr, ptr %43, align 8, !tbaa !32
  %45 = icmp eq ptr %44, null
  br i1 %45, label %162, label %46

46:                                               ; preds = %42, %39
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = tail call i64 @DhcpValidateOptions(ptr noundef %47, ptr noundef null) #4
  %49 = icmp slt i64 %48, 0
  br i1 %49, label %162, label %50

50:                                               ; preds = %46
  %51 = getelementptr inbounds i8, ptr %1, i64 16
  %52 = tail call i64 @CompareMem(ptr noundef nonnull %51, ptr noundef nonnull @mZeroIp4Addr, i64 noundef 4) #4
  %53 = icmp eq i64 %52, 0
  br i1 %53, label %162, label %54

54:                                               ; preds = %50
  %55 = getelementptr inbounds i8, ptr %20, i64 92
  %56 = load i32, ptr %55, align 4, !tbaa !33
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %162, label %58

58:                                               ; preds = %54
  %59 = load ptr, ptr @gBS, align 8, !tbaa !34
  %60 = getelementptr inbounds i8, ptr %59, i64 24
  %61 = load ptr, ptr %60, align 8, !tbaa !35
  %62 = tail call i64 %61(i64 noundef 8) #4
  store ptr %1, ptr %21, align 8, !tbaa !20
  %63 = load i32, ptr %36, align 8, !tbaa !30
  %64 = getelementptr inbounds i8, ptr %18, i64 152
  store i32 %63, ptr %64, align 8, !tbaa !38
  %65 = tail call i64 @Dhcp4InstanceCreateUdpIo(ptr noundef nonnull %18)
  %66 = icmp slt i64 %65, 0
  br i1 %66, label %.thread, label %67

67:                                               ; preds = %58
  %68 = getelementptr inbounds i8, ptr %20, i64 210
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %69, i64 36
  %71 = getelementptr inbounds i8, ptr %69, i64 10
  %72 = load i8, ptr %71, align 1, !tbaa !39
  %73 = zext i8 %72 to i64
  %74 = tail call ptr @CopyMem(ptr noundef nonnull %68, ptr noundef nonnull %70, i64 noundef %73) #4
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = getelementptr inbounds i8, ptr %75, i64 8
  %77 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %76, ptr %77, align 8, !tbaa !40
  %78 = getelementptr inbounds i8, ptr %75, i64 4
  %79 = load i32, ptr %78, align 1, !tbaa !42
  store i32 %79, ptr %3, align 8, !tbaa !43
  %80 = call ptr @NetbufFromExt(ptr noundef nonnull %3, i32 noundef 1, i32 noundef 0, i32 noundef 0, ptr noundef nonnull @DhcpDummyExtFree, ptr noundef null) #4
  %81 = icmp eq ptr %80, null
  br i1 %81, label %.thread, label %82

82:                                               ; preds = %67
  %83 = call ptr @ZeroMem(ptr noundef nonnull %4, i64 noundef 40) #4
  %84 = call ptr @CopyMem(ptr noundef nonnull %5, ptr noundef nonnull %51, i64 noundef 4) #4
  %85 = load i32, ptr %5, align 4, !tbaa !44
  %86 = call i32 @SwapBytes32(i32 noundef %85) #4
  %87 = getelementptr inbounds i8, ptr %4, i64 20
  store i32 %86, ptr %87, align 4, !tbaa !45
  %88 = getelementptr inbounds i8, ptr %1, i64 20
  %89 = load i16, ptr %88, align 4, !tbaa !46
  %90 = icmp eq i16 %89, 0
  %spec.select = select i1 %90, i16 67, i16 %89
  %91 = getelementptr inbounds i8, ptr %4, i64 36
  store i16 %spec.select, ptr %91, align 4
  %92 = getelementptr inbounds i8, ptr %20, i64 96
  %93 = load i32, ptr %92, align 8, !tbaa !47
  %94 = call ptr @ZeroMem(ptr noundef nonnull %6, i64 noundef 16) #4
  %95 = load i32, ptr %55, align 4, !tbaa !33
  %96 = load i32, ptr %87, align 4, !tbaa !45
  %97 = xor i32 %96, %95
  %98 = and i32 %97, %93
  %99 = icmp eq i32 %98, 0
  br i1 %99, label %105, label %100

100:                                              ; preds = %82
  %101 = getelementptr inbounds i8, ptr %1, i64 22
  %102 = call ptr @CopyMem(ptr noundef nonnull %6, ptr noundef nonnull %101, i64 noundef 4) #4
  %103 = load i32, ptr %6, align 4, !tbaa !45
  %104 = call i32 @SwapBytes32(i32 noundef %103) #4
  store i32 %104, ptr %6, align 4, !tbaa !45
  br label %105

105:                                              ; preds = %100, %82
  %106 = getelementptr inbounds i8, ptr %18, i64 144
  %107 = load ptr, ptr %106, align 8, !tbaa !48
  %108 = call i64 @UdpIoSendDatagram(ptr noundef %107, ptr noundef nonnull %80, ptr noundef nonnull %4, ptr noundef nonnull %6, ptr noundef nonnull @DhcpOnPacketSent, ptr noundef null) #4
  %109 = icmp slt i64 %108, 0
  br i1 %109, label %110, label %111

110:                                              ; preds = %105
  call void @NetbufFree(ptr noundef nonnull %80) #4
  br label %.thread

111:                                              ; preds = %105
  %112 = load ptr, ptr %106, align 8, !tbaa !48
  %113 = call i64 @UdpIoRecvDatagram(ptr noundef %112, ptr noundef nonnull @PxeDhcpInput, ptr noundef nonnull %18, i32 noundef 0) #4
  %114 = icmp slt i64 %113, 0
  br i1 %114, label %.thread, label %132

.thread:                                          ; preds = %67, %110, %58, %111
  %.06277 = phi i64 [ %113, %111 ], [ -9223372036854775799, %67 ], [ %108, %110 ], [ %65, %58 ]
  %115 = getelementptr inbounds i8, ptr %18, i64 144
  %116 = load ptr, ptr %115, align 8, !tbaa !48
  %.not73 = icmp eq ptr %116, null
  br i1 %.not73, label %.sink.split, label %117

117:                                              ; preds = %.thread
  call void @UdpIoCleanIo(ptr noundef nonnull %116) #4
  %118 = load ptr, ptr @gBS, align 8, !tbaa !34
  %119 = getelementptr inbounds i8, ptr %118, i64 288
  %120 = load ptr, ptr %119, align 8, !tbaa !49
  %121 = load ptr, ptr %115, align 8, !tbaa !48
  %122 = getelementptr inbounds i8, ptr %121, i64 56
  %123 = load ptr, ptr %122, align 8, !tbaa !50
  %124 = load ptr, ptr %19, align 8, !tbaa !19
  %125 = getelementptr inbounds i8, ptr %124, i64 40
  %126 = load ptr, ptr %125, align 8, !tbaa !53
  %127 = getelementptr inbounds i8, ptr %18, i64 96
  %128 = load ptr, ptr %127, align 8, !tbaa !54
  %129 = call i64 %120(ptr noundef %123, ptr noundef nonnull @gEfiUdp4ProtocolGuid, ptr noundef %126, ptr noundef %128) #4
  %130 = load ptr, ptr %115, align 8, !tbaa !48
  %131 = call i64 @UdpIoFreeIo(ptr noundef %130) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %21, i8 0, i64 16, i1 false)
  br label %.sink.split

132:                                              ; preds = %111
  %133 = load ptr, ptr @gBS, align 8, !tbaa !34
  %134 = getelementptr inbounds i8, ptr %133, i64 32
  %135 = load ptr, ptr %134, align 8, !tbaa !55
  call void %135(i64 noundef %62) #4
  %136 = getelementptr inbounds i8, ptr %1, i64 8
  %137 = load ptr, ptr %136, align 8, !tbaa !56
  %138 = icmp eq ptr %137, null
  br i1 %138, label %.preheader, label %162

.preheader:                                       ; preds = %132
  %139 = load ptr, ptr @gBS, align 8, !tbaa !34
  %140 = getelementptr inbounds i8, ptr %139, i64 24
  %141 = load ptr, ptr %140, align 8, !tbaa !35
  %142 = call i64 %141(i64 noundef 8) #4
  %143 = load i32, ptr %64, align 8, !tbaa !38
  %.not7478 = icmp eq i32 %143, 0
  br i1 %.not7478, label %.sink.split, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %144 = phi i64 [ %157, %.lr.ph ], [ %142, %.preheader ]
  %145 = load ptr, ptr %106, align 8, !tbaa !48
  %146 = getelementptr inbounds i8, ptr %145, i64 744
  %147 = load ptr, ptr %146, align 8, !tbaa !45
  %148 = getelementptr inbounds i8, ptr %147, i64 56
  %149 = load ptr, ptr %148, align 8, !tbaa !57
  %150 = call i64 %149(ptr noundef %147) #4
  %151 = load ptr, ptr @gBS, align 8, !tbaa !34
  %152 = getelementptr inbounds i8, ptr %151, i64 32
  %153 = load ptr, ptr %152, align 8, !tbaa !55
  call void %153(i64 noundef %144) #4
  %154 = load ptr, ptr @gBS, align 8, !tbaa !34
  %155 = getelementptr inbounds i8, ptr %154, i64 24
  %156 = load ptr, ptr %155, align 8, !tbaa !35
  %157 = call i64 %156(i64 noundef 8) #4
  %158 = load i32, ptr %64, align 8, !tbaa !38
  %.not74 = icmp eq i32 %158, 0
  br i1 %.not74, label %.sink.split, label %.lr.ph

.sink.split:                                      ; preds = %.lr.ph, %.preheader, %.thread, %117
  %.sink = phi i64 [ %62, %117 ], [ %62, %.thread ], [ %142, %.preheader ], [ %157, %.lr.ph ]
  %.0.ph = phi i64 [ %.06277, %117 ], [ %.06277, %.thread ], [ %113, %.preheader ], [ %113, %.lr.ph ]
  %159 = load ptr, ptr @gBS, align 8, !tbaa !34
  %160 = getelementptr inbounds i8, ptr %159, i64 32
  %161 = load ptr, ptr %160, align 8, !tbaa !55
  call void %161(i64 noundef %.sink) #4
  br label %162

162:                                              ; preds = %.sink.split, %132, %54, %23, %27, %35, %42, %46, %50, %._crit_edge80, %2, %9
  %.0 = phi i64 [ -9223372036854775806, %9 ], [ -9223372036854775806, %2 ], [ -9223372036854775802, %._crit_edge80 ], [ -9223372036854775806, %50 ], [ -9223372036854775806, %46 ], [ -9223372036854775806, %42 ], [ -9223372036854775806, %35 ], [ -9223372036854775806, %27 ], [ -9223372036854775806, %23 ], [ -9223372036854775791, %54 ], [ %113, %132 ], [ %.0.ph, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  ret i64 %.0
}

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

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

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare i32 @SwapBytes32(i32 noundef) local_unnamed_addr #2

declare ptr @ZeroMem(ptr noundef, i64 noundef) local_unnamed_addr #2

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

declare i64 @DhcpValidateOptions(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare i64 @UdpIoFreeIo(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @DhcpDummyExtFree(ptr noundef) #0

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

declare i64 @CompareMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @NetbufFree(ptr noundef) local_unnamed_addr #2

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

declare void @UdpIoCleanIo(ptr noundef) local_unnamed_addr #2

declare ptr @NetbufFromExt(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i64 @UdpIoSendDatagram(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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 = { mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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, !10, i64 48}
!6 = !{!"", !7, i64 0, !10, i64 8, !11, i64 16, !12, i64 20, !11, i64 22, !13, i64 28, !10, i64 32, !13, i64 40, !10, i64 48, !13, i64 56, !10, i64 64}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = !{!15, !13, i64 0}
!15 = !{!"_DHCP_PROTOCOL", !13, i64 0, !16, i64 8, !17, i64 80, !10, i64 96, !10, i64 104, !8, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !13, i64 152, !12, i64 156, !18, i64 160}
!16 = !{!"_EFI_DHCP4_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}
!17 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!18 = !{!"", !13, i64 0, !7, i64 8, !17, i64 16, !17, i64 32, !13, i64 48, !13, i64 52}
!19 = !{!15, !10, i64 104}
!20 = !{!15, !10, i64 136}
!21 = !{!22, !13, i64 244}
!22 = !{!"", !13, i64 0, !13, i64 4, !23, i64 8}
!23 = !{!"", !24, i64 0, !13, i64 236, !8, i64 240}
!24 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !13, i64 4, !12, i64 8, !12, i64 10, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !8, i64 28, !8, i64 44, !8, i64 108}
!25 = !{!22, !13, i64 12}
!26 = !{!27, !13, i64 88}
!27 = !{!"_DHCP_SERVICE", !13, i64 0, !28, i64 8, !7, i64 24, !10, i64 32, !10, i64 40, !17, i64 48, !7, i64 64, !7, i64 72, !7, i64 80, !13, i64 88, !13, i64 92, !13, i64 96, !13, i64 100, !10, i64 104, !10, i64 112, !10, i64 120, !13, i64 128, !13, i64 132, !13, i64 136, !7, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !11, i64 176, !8, i64 208, !8, i64 209, !8, i64 210, !10, i64 232, !29, i64 240, !13, i64 312, !10, i64 320, !13, i64 328, !13, i64 332, !7, i64 336, !7, i64 344, !13, i64 352}
!28 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !10, i64 0, !10, i64 8}
!29 = !{!"", !13, i64 0, !10, i64 8, !13, i64 16, !10, i64 24, !11, i64 32, !10, i64 40, !10, i64 48, !13, i64 56, !10, i64 64}
!30 = !{!6, !13, i64 40}
!31 = !{!6, !13, i64 28}
!32 = !{!6, !10, i64 32}
!33 = !{!27, !13, i64 92}
!34 = !{!10, !10, i64 0}
!35 = !{!36, !10, i64 24}
!36 = !{!"", !37, 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}
!37 = !{!"", !7, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!38 = !{!15, !13, i64 152}
!39 = !{!22, !8, i64 10}
!40 = !{!41, !10, i64 8}
!41 = !{!"", !13, i64 0, !10, i64 8}
!42 = !{!22, !13, i64 4}
!43 = !{!41, !13, i64 0}
!44 = !{!13, !13, i64 0}
!45 = !{!8, !8, i64 0}
!46 = !{!6, !12, i64 20}
!47 = !{!27, !13, i64 96}
!48 = !{!15, !10, i64 144}
!49 = !{!36, !10, i64 288}
!50 = !{!51, !10, i64 56}
!51 = !{!"_UDP_IO", !13, i64 0, !17, i64 8, !7, i64 24, !8, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !52, i64 64, !17, i64 720, !10, i64 736, !8, i64 744, !8, i64 752}
!52 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !8, i64 40, !11, i64 552, !11, i64 584, !11, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!53 = !{!27, !10, i64 40}
!54 = !{!15, !10, i64 96}
!55 = !{!36, !10, i64 32}
!56 = !{!6, !10, i64 8}
!57 = !{!58, !10, i64 56}
!58 = !{!"_EFI_UDP4_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}


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