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

; 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.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_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_PACKET_OPTION = type { i8, i8, [1 x i8] }

@.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

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

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

17:                                               ; preds = %2
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %66

20:                                               ; preds = %17
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.EFI_DHCP4_CONFIG_DATA, ptr %21, i32 0, i32 0
  %23 = load i32, ptr %22, align 8, !tbaa !9
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %31

25:                                               ; preds = %20
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.EFI_DHCP4_CONFIG_DATA, ptr %26, i32 0, i32 1
  %28 = load ptr, ptr %27, align 8, !tbaa !13
  %29 = icmp eq ptr %28, null
  br i1 %29, label %30, label %31

30:                                               ; preds = %25
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %219

31:                                               ; preds = %25, %20
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.EFI_DHCP4_CONFIG_DATA, ptr %32, i32 0, i32 2
  %34 = load i32, ptr %33, align 8, !tbaa !14
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %42

36:                                               ; preds = %31
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.EFI_DHCP4_CONFIG_DATA, ptr %37, i32 0, i32 3
  %39 = load ptr, ptr %38, align 8, !tbaa !15
  %40 = icmp eq ptr %39, null
  br i1 %40, label %41, label %42

41:                                               ; preds = %36
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %219

42:                                               ; preds = %36, %31
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.EFI_DHCP4_CONFIG_DATA, ptr %43, i32 0, i32 7
  %45 = load i32, ptr %44, align 8, !tbaa !16
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %53

47:                                               ; preds = %42
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.EFI_DHCP4_CONFIG_DATA, ptr %48, i32 0, i32 8
  %50 = load ptr, ptr %49, align 8, !tbaa !17
  %51 = icmp eq ptr %50, null
  br i1 %51, label %52, label %53

52:                                               ; preds = %47
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %219

53:                                               ; preds = %47, %42
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.EFI_DHCP4_CONFIG_DATA, ptr %54, i32 0, i32 4
  %56 = call ptr @CopyMem(ptr noundef %12, ptr noundef %55, i64 noundef 4)
  %57 = load i32, ptr %12, align 4, !tbaa !18
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %65

59:                                               ; preds = %53
  %60 = load i32, ptr %12, align 4, !tbaa !18
  %61 = call i32 @SwapBytes32(i32 noundef %60)
  %62 = call zeroext i8 @NetIp4IsUnicast(i32 noundef %61, i32 noundef 0)
  %63 = icmp ne i8 %62, 0
  br i1 %63, label %65, label %64

64:                                               ; preds = %59
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %219

65:                                               ; preds = %59, %53
  br label %66

66:                                               ; preds = %65, %17
  %67 = call zeroext i8 @DebugAssertEnabled()
  %68 = zext i8 %67 to i32
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %80

70:                                               ; preds = %66
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = ptrtoint ptr %71 to i64
  %73 = sub i64 %72, ptrtoint (ptr getelementptr inbounds (%struct._DHCP_PROTOCOL, ptr null, i32 0, i32 1) to i64)
  %74 = inttoptr i64 %73 to ptr
  %75 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %74, i32 0, i32 0
  %76 = load i32, ptr %75, align 8, !tbaa !19
  %77 = icmp ne i32 %76, 1885562980
  br i1 %77, label %78, label %80

78:                                               ; preds = %70
  call void @DebugAssert(ptr noundef @.str, i64 noundef 670, ptr noundef @.str.1)
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  br label %85

80:                                               ; preds = %70, %66
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = ptrtoint ptr %81 to i64
  %83 = sub i64 %82, ptrtoint (ptr getelementptr inbounds (%struct._DHCP_PROTOCOL, ptr null, i32 0, i32 1) to i64)
  %84 = inttoptr i64 %83 to ptr
  br label %85

85:                                               ; preds = %80, %78
  %86 = phi ptr [ %79, %78 ], [ %84, %80 ]
  store ptr %86, ptr %7, align 8, !tbaa !5
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %87, i32 0, i32 0
  %89 = load i32, ptr %88, align 8, !tbaa !19
  %90 = icmp ne i32 %89, 1885562980
  br i1 %90, label %91, label %92

91:                                               ; preds = %85
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %219

92:                                               ; preds = %85
  %93 = load ptr, ptr @gBS, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %93, i32 0, i32 1
  %95 = load ptr, ptr %94, align 8, !tbaa !26
  %96 = call i64 %95(i64 noundef 8)
  store i64 %96, ptr %10, align 8, !tbaa !29
  %97 = load ptr, ptr %7, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %97, i32 0, i32 4
  %99 = load ptr, ptr %98, align 8, !tbaa !30
  store ptr %99, ptr %8, align 8, !tbaa !5
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %100, i32 0, i32 28
  store ptr %101, ptr %6, align 8, !tbaa !5
  store i64 -9223372036854775793, ptr %9, align 8, !tbaa !29
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %102, i32 0, i32 7
  %104 = load i64, ptr %103, align 8, !tbaa !31
  %105 = icmp ne i64 %104, 0
  br i1 %105, label %106, label %122

106:                                              ; preds = %92
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %107, i32 0, i32 7
  %109 = load i64, ptr %108, align 8, !tbaa !31
  %110 = icmp ne i64 %109, 1
  br i1 %110, label %111, label %122

111:                                              ; preds = %106
  %112 = load ptr, ptr %8, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %112, i32 0, i32 7
  %114 = load i64, ptr %113, align 8, !tbaa !31
  %115 = icmp ne i64 %114, 7
  br i1 %115, label %116, label %122

116:                                              ; preds = %111
  %117 = load ptr, ptr %8, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %117, i32 0, i32 7
  %119 = load i64, ptr %118, align 8, !tbaa !31
  %120 = icmp ne i64 %119, 4
  br i1 %120, label %121, label %122

121:                                              ; preds = %116
  br label %213

122:                                              ; preds = %116, %111, %106, %92
  %123 = load ptr, ptr %8, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %123, i32 0, i32 27
  %125 = load ptr, ptr %124, align 8, !tbaa !34
  %126 = icmp ne ptr %125, null
  br i1 %126, label %127, label %134

127:                                              ; preds = %122
  %128 = load ptr, ptr %8, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %128, i32 0, i32 27
  %130 = load ptr, ptr %129, align 8, !tbaa !34
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = icmp ne ptr %130, %131
  br i1 %132, label %133, label %134

133:                                              ; preds = %127
  br label %213

134:                                              ; preds = %127, %122
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = icmp ne ptr %135, null
  br i1 %136, label %137, label %203

137:                                              ; preds = %134
  store i64 -9223372036854775799, ptr %9, align 8, !tbaa !29
  %138 = load ptr, ptr %6, align 8, !tbaa !5
  call void @DhcpCleanConfigure(ptr noundef %138)
  %139 = load ptr, ptr %6, align 8, !tbaa !5
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = call i64 @DhcpCopyConfigure(ptr noundef %139, ptr noundef %140)
  %142 = icmp slt i64 %141, 0
  br i1 %142, label %143, label %144

143:                                              ; preds = %137
  br label %213

144:                                              ; preds = %137
  %145 = load ptr, ptr %8, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %145, i32 0, i32 29
  store i32 0, ptr %146, align 8, !tbaa !35
  store i32 0, ptr %11, align 4, !tbaa !18
  br label %147

147:                                              ; preds = %169, %144
  %148 = load i32, ptr %11, align 4, !tbaa !18
  %149 = load ptr, ptr %5, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.EFI_DHCP4_CONFIG_DATA, ptr %149, i32 0, i32 7
  %151 = load i32, ptr %150, align 8, !tbaa !16
  %152 = icmp ult i32 %148, %151
  br i1 %152, label %153, label %172

153:                                              ; preds = %147
  %154 = load ptr, ptr %5, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.EFI_DHCP4_CONFIG_DATA, ptr %154, i32 0, i32 8
  %156 = load ptr, ptr %155, align 8, !tbaa !17
  %157 = load i32, ptr %11, align 4, !tbaa !18
  %158 = zext i32 %157 to i64
  %159 = getelementptr inbounds ptr, ptr %156, i64 %158
  %160 = load ptr, ptr %159, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %160, i32 0, i32 1
  %162 = load i8, ptr %161, align 1, !tbaa !36
  %163 = zext i8 %162 to i32
  %164 = add nsw i32 %163, 2
  %165 = load ptr, ptr %8, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %165, i32 0, i32 29
  %167 = load i32, ptr %166, align 8, !tbaa !35
  %168 = add i32 %167, %164
  store i32 %168, ptr %166, align 8, !tbaa !35
  br label %169

169:                                              ; preds = %153
  %170 = load i32, ptr %11, align 4, !tbaa !18
  %171 = add i32 %170, 1
  store i32 %171, ptr %11, align 4, !tbaa !18
  br label %147, !llvm.loop !38

172:                                              ; preds = %147
  %173 = load ptr, ptr %7, align 8, !tbaa !5
  %174 = load ptr, ptr %8, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %174, i32 0, i32 27
  store ptr %173, ptr %175, align 8, !tbaa !34
  %176 = load ptr, ptr %8, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %176, i32 0, i32 7
  %178 = load i64, ptr %177, align 8, !tbaa !31
  %179 = icmp eq i64 %178, 0
  br i1 %179, label %180, label %200

180:                                              ; preds = %172
  %181 = load ptr, ptr %5, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.EFI_DHCP4_CONFIG_DATA, ptr %181, i32 0, i32 4
  %183 = getelementptr inbounds %struct.EFI_IPv4_ADDRESS, ptr %182, i32 0, i32 0
  %184 = getelementptr inbounds [4 x i8], ptr %183, i64 0, i64 0
  %185 = load i32, ptr %184, align 8, !tbaa !18
  %186 = call i32 @SwapBytes32(i32 noundef %185)
  %187 = load ptr, ptr %8, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %187, i32 0, i32 10
  store i32 %186, ptr %188, align 4, !tbaa !40
  %189 = load ptr, ptr %8, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %189, i32 0, i32 10
  %191 = load i32, ptr %190, align 4, !tbaa !40
  %192 = icmp ne i32 %191, 0
  br i1 %192, label %193, label %196

193:                                              ; preds = %180
  %194 = load ptr, ptr %8, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %194, i32 0, i32 7
  store i64 7, ptr %195, align 8, !tbaa !31
  br label %199

196:                                              ; preds = %180
  %197 = load ptr, ptr %8, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %197, i32 0, i32 7
  store i64 1, ptr %198, align 8, !tbaa !31
  br label %199

199:                                              ; preds = %196, %193
  br label %200

200:                                              ; preds = %199, %172
  %201 = load ptr, ptr %8, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %201, i32 0, i32 2
  store i64 1, ptr %202, align 8, !tbaa !41
  store i64 0, ptr %9, align 8, !tbaa !29
  br label %212

203:                                              ; preds = %134
  %204 = load ptr, ptr %8, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %204, i32 0, i32 27
  %206 = load ptr, ptr %205, align 8, !tbaa !34
  %207 = load ptr, ptr %7, align 8, !tbaa !5
  %208 = icmp eq ptr %206, %207
  br i1 %208, label %209, label %211

209:                                              ; preds = %203
  store i64 0, ptr %9, align 8, !tbaa !29
  %210 = load ptr, ptr %8, align 8, !tbaa !5
  call void @DhcpYieldControl(ptr noundef %210)
  br label %211

211:                                              ; preds = %209, %203
  br label %212

212:                                              ; preds = %211, %200
  br label %213

213:                                              ; preds = %212, %143, %133, %121
  %214 = load ptr, ptr @gBS, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %214, i32 0, i32 2
  %216 = load ptr, ptr %215, align 8, !tbaa !42
  %217 = load i64, ptr %10, align 8, !tbaa !29
  call void %216(i64 noundef %217)
  %218 = load i64, ptr %9, align 8, !tbaa !29
  store i64 %218, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %219

219:                                              ; preds = %213, %91, %64, %52, %41, %30, %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %220 = load i64, ptr %3, align 8
  ret i64 %220
}

; 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

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

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

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

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

declare zeroext i8 @NetIp4IsUnicast(i32 noundef, i32 noundef) #2

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

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

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


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

@.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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @EfiDhcp4Configure(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %4 = icmp eq ptr %0, null
  br i1 %4, label %115, label %5

5:                                                ; preds = %2
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %33, label %6

6:                                                ; preds = %5
  %7 = load i32, ptr %1, align 8, !tbaa !5
  %.not54 = icmp eq i32 %7, 0
  br i1 %.not54, label %12, label %8

8:                                                ; preds = %6
  %9 = getelementptr inbounds i8, ptr %1, i64 8
  %10 = load ptr, ptr %9, align 8, !tbaa !12
  %11 = icmp eq ptr %10, null
  br i1 %11, label %115, label %12

12:                                               ; preds = %8, %6
  %13 = getelementptr inbounds i8, ptr %1, i64 16
  %14 = load i32, ptr %13, align 8, !tbaa !13
  %.not55 = icmp eq i32 %14, 0
  br i1 %.not55, label %19, label %15

15:                                               ; preds = %12
  %16 = getelementptr inbounds i8, ptr %1, i64 24
  %17 = load ptr, ptr %16, align 8, !tbaa !14
  %18 = icmp eq ptr %17, null
  br i1 %18, label %115, label %19

19:                                               ; preds = %15, %12
  %20 = getelementptr inbounds i8, ptr %1, i64 56
  %21 = load i32, ptr %20, align 8, !tbaa !15
  %.not56 = icmp eq i32 %21, 0
  br i1 %.not56, label %26, label %22

22:                                               ; preds = %19
  %23 = getelementptr inbounds i8, ptr %1, i64 64
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  %25 = icmp eq ptr %24, null
  br i1 %25, label %115, label %26

26:                                               ; preds = %22, %19
  %27 = getelementptr inbounds i8, ptr %1, i64 32
  %28 = call ptr @CopyMem(ptr noundef nonnull %3, ptr noundef nonnull %27, i64 noundef 4) #3
  %29 = load i32, ptr %3, align 4, !tbaa !17
  %.not57 = icmp eq i32 %29, 0
  br i1 %.not57, label %33, label %30

30:                                               ; preds = %26
  %31 = call i32 @SwapBytes32(i32 noundef %29) #3
  %32 = call zeroext i8 @NetIp4IsUnicast(i32 noundef %31, i32 noundef 0) #3
  %.not58 = icmp eq i8 %32, 0
  br i1 %.not58, label %115, label %33

33:                                               ; preds = %26, %30, %5
  %34 = call zeroext i8 @DebugAssertEnabled() #3
  %.not59 = icmp eq i8 %34, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre73 = add i64 %.pre, -8
  %.pre75 = inttoptr i64 %.pre73 to ptr
  br i1 %.not59, label %._crit_edge72, label %35

35:                                               ; preds = %33
  %36 = load i32, ptr %.pre75, align 8, !tbaa !18
  %.not60 = icmp eq i32 %36, 1885562980
  br i1 %.not60, label %.thread, label %37

37:                                               ; preds = %35
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 670, ptr noundef nonnull @.str.1) #3
  br label %._crit_edge72

._crit_edge72:                                    ; preds = %33, %37
  %.ph = phi ptr [ %0, %37 ], [ %.pre75, %33 ]
  %.pr = load i32, ptr %.ph, align 8, !tbaa !18
  %.not61 = icmp eq i32 %.pr, 1885562980
  br i1 %.not61, label %.thread, label %115

.thread:                                          ; preds = %35, %._crit_edge72
  %38 = phi ptr [ %.ph, %._crit_edge72 ], [ %.pre75, %35 ]
  %39 = load ptr, ptr @gBS, align 8, !tbaa !25
  %40 = getelementptr inbounds i8, ptr %39, i64 24
  %41 = load ptr, ptr %40, align 8, !tbaa !26
  %42 = call i64 %41(i64 noundef 8) #3
  %43 = getelementptr inbounds i8, ptr %38, i64 104
  %44 = load ptr, ptr %43, align 8, !tbaa !29
  %45 = getelementptr inbounds i8, ptr %44, i64 240
  %46 = getelementptr inbounds i8, ptr %44, i64 72
  %47 = load i64, ptr %46, align 8, !tbaa !30
  switch i64 %47, label %111 [
    i64 0, label %48
    i64 1, label %48
    i64 7, label %48
    i64 4, label %48
  ]

48:                                               ; preds = %.thread, %.thread, %.thread, %.thread
  %49 = getelementptr inbounds i8, ptr %44, i64 232
  %50 = load ptr, ptr %49, align 8, !tbaa !33
  %.not66 = icmp eq ptr %50, null
  %.not67 = icmp eq ptr %50, %38
  %or.cond = or i1 %.not66, %.not67
  br i1 %or.cond, label %51, label %111

51:                                               ; preds = %48
  br i1 %.not, label %109, label %52

52:                                               ; preds = %51
  call void @DhcpCleanConfigure(ptr noundef nonnull %45)
  %53 = call i64 @DhcpCopyConfigure(ptr noundef nonnull %45, ptr noundef nonnull %1)
  %54 = icmp slt i64 %53, 0
  br i1 %54, label %111, label %55

55:                                               ; preds = %52
  %56 = getelementptr inbounds i8, ptr %44, i64 312
  store i32 0, ptr %56, align 8, !tbaa !34
  %57 = getelementptr inbounds i8, ptr %1, i64 56
  %58 = load i32, ptr %57, align 8, !tbaa !15
  %.not70 = icmp eq i32 %58, 0
  br i1 %.not70, label %100, label %.lr.ph

.lr.ph:                                           ; preds = %55
  %59 = getelementptr inbounds i8, ptr %1, i64 64
  %60 = load ptr, ptr %59, align 8, !tbaa !16
  %wide.trip.count = zext i32 %58 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %61 = icmp ult i32 %58, 4
  br i1 %61, label %._crit_edge.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %wide.trip.count, 4294967292
  br label %62

62:                                               ; preds = %62, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.3, %62 ]
  %63 = phi i32 [ 0, %.lr.ph.new ], [ %91, %62 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %62 ]
  %64 = getelementptr inbounds ptr, ptr %60, i64 %indvars.iv
  %65 = load ptr, ptr %64, align 8, !tbaa !25
  %66 = getelementptr inbounds i8, ptr %65, i64 1
  %67 = load i8, ptr %66, align 1, !tbaa !35
  %68 = zext i8 %67 to i32
  %69 = add nuw nsw i32 %68, 2
  %70 = add i32 %69, %63
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %71 = getelementptr inbounds ptr, ptr %60, i64 %indvars.iv.next
  %72 = load ptr, ptr %71, align 8, !tbaa !25
  %73 = getelementptr inbounds i8, ptr %72, i64 1
  %74 = load i8, ptr %73, align 1, !tbaa !35
  %75 = zext i8 %74 to i32
  %76 = add nuw nsw i32 %75, 2
  %77 = add i32 %76, %70
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %78 = getelementptr inbounds ptr, ptr %60, i64 %indvars.iv.next.1
  %79 = load ptr, ptr %78, align 8, !tbaa !25
  %80 = getelementptr inbounds i8, ptr %79, i64 1
  %81 = load i8, ptr %80, align 1, !tbaa !35
  %82 = zext i8 %81 to i32
  %83 = add nuw nsw i32 %82, 2
  %84 = add i32 %83, %77
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %85 = getelementptr inbounds ptr, ptr %60, i64 %indvars.iv.next.2
  %86 = load ptr, ptr %85, align 8, !tbaa !25
  %87 = getelementptr inbounds i8, ptr %86, i64 1
  %88 = load i8, ptr %87, align 1, !tbaa !35
  %89 = zext i8 %88 to i32
  %90 = add nuw nsw i32 %89, 2
  %91 = add i32 %90, %84
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.unr-lcssa, label %62, !llvm.loop !37

._crit_edge.unr-lcssa:                            ; preds = %62, %.lr.ph
  %.lcssa.ph = phi i32 [ poison, %.lr.ph ], [ %91, %62 ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.3, %62 ]
  %.unr = phi i32 [ 0, %.lr.ph ], [ %91, %62 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge.unr-lcssa ]
  %92 = phi i32 [ %99, %.epil.preheader ], [ %.unr, %._crit_edge.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.unr-lcssa ]
  %93 = getelementptr inbounds ptr, ptr %60, i64 %indvars.iv.epil
  %94 = load ptr, ptr %93, align 8, !tbaa !25
  %95 = getelementptr inbounds i8, ptr %94, i64 1
  %96 = load i8, ptr %95, align 1, !tbaa !35
  %97 = zext i8 %96 to i32
  %98 = add nuw nsw i32 %97, 2
  %99 = add i32 %98, %92
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !39

._crit_edge:                                      ; preds = %.epil.preheader, %._crit_edge.unr-lcssa
  %.lcssa = phi i32 [ %.lcssa.ph, %._crit_edge.unr-lcssa ], [ %99, %.epil.preheader ]
  store i32 %.lcssa, ptr %56, align 8, !tbaa !34
  br label %100

100:                                              ; preds = %._crit_edge, %55
  store ptr %38, ptr %49, align 8, !tbaa !33
  %101 = load i64, ptr %46, align 8, !tbaa !30
  %102 = icmp eq i64 %101, 0
  br i1 %102, label %.sink.split, label %107

.sink.split:                                      ; preds = %100
  %103 = getelementptr inbounds i8, ptr %1, i64 32
  %104 = load i32, ptr %103, align 8, !tbaa !17
  %105 = call i32 @SwapBytes32(i32 noundef %104) #3
  %106 = getelementptr inbounds i8, ptr %44, i64 92
  store i32 %105, ptr %106, align 4, !tbaa !41
  %.not68 = icmp eq i32 %105, 0
  %. = select i1 %.not68, i64 1, i64 7
  store i64 %., ptr %46, align 8, !tbaa !30
  br label %107

107:                                              ; preds = %.sink.split, %100
  %108 = getelementptr inbounds i8, ptr %44, i64 24
  store i64 1, ptr %108, align 8, !tbaa !42
  br label %111

109:                                              ; preds = %51
  br i1 %.not67, label %110, label %111

110:                                              ; preds = %109
  call void @DhcpYieldControl(ptr noundef nonnull %44)
  br label %111

111:                                              ; preds = %48, %.thread, %107, %110, %109, %52
  %.048 = phi i64 [ -9223372036854775799, %52 ], [ 0, %107 ], [ 0, %110 ], [ -9223372036854775793, %109 ], [ -9223372036854775793, %.thread ], [ -9223372036854775793, %48 ]
  %112 = load ptr, ptr @gBS, align 8, !tbaa !25
  %113 = getelementptr inbounds i8, ptr %112, i64 32
  %114 = load ptr, ptr %113, align 8, !tbaa !43
  call void %114(i64 noundef %42) #3
  br label %115

115:                                              ; preds = %._crit_edge72, %30, %22, %15, %8, %2, %111
  %.047 = phi i64 [ %.048, %111 ], [ -9223372036854775806, %2 ], [ -9223372036854775806, %8 ], [ -9223372036854775806, %15 ], [ -9223372036854775806, %22 ], [ -9223372036854775806, %30 ], [ -9223372036854775806, %._crit_edge72 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  ret i64 %.047
}

; 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

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

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

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

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

declare zeroext i8 @NetIp4IsUnicast(i32 noundef, i32 noundef) local_unnamed_addr #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 = { 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 = { 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 = !{!"", !7, i64 0, !10, i64 8, !7, i64 16, !10, i64 24, !11, i64 32, !10, i64 40, !10, i64 48, !7, i64 56, !10, i64 64}
!7 = !{!"int", !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 = !{!6, !10, i64 8}
!13 = !{!6, !7, i64 16}
!14 = !{!6, !10, i64 24}
!15 = !{!6, !7, i64 56}
!16 = !{!6, !10, i64 64}
!17 = !{!7, !7, i64 0}
!18 = !{!19, !7, i64 0}
!19 = !{!"_DHCP_PROTOCOL", !7, i64 0, !20, i64 8, !21, i64 80, !10, i64 96, !10, i64 104, !8, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !7, i64 152, !22, i64 156, !23, i64 160}
!20 = !{!"_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}
!21 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!22 = !{!"short", !8, i64 0}
!23 = !{!"", !7, i64 0, !24, i64 8, !21, i64 16, !21, i64 32, !7, i64 48, !7, i64 52}
!24 = !{!"long long", !8, i64 0}
!25 = !{!10, !10, i64 0}
!26 = !{!27, !10, i64 24}
!27 = !{!"", !28, 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}
!28 = !{!"", !24, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!29 = !{!19, !10, i64 104}
!30 = !{!31, !24, i64 72}
!31 = !{!"_DHCP_SERVICE", !7, i64 0, !32, i64 8, !24, i64 24, !10, i64 32, !10, i64 40, !21, i64 48, !24, i64 64, !24, i64 72, !24, i64 80, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !10, i64 104, !10, i64 112, !10, i64 120, !7, i64 128, !7, i64 132, !7, i64 136, !24, 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, !6, i64 240, !7, i64 312, !10, i64 320, !7, i64 328, !7, i64 332, !24, i64 336, !24, i64 344, !7, i64 352}
!32 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !10, i64 0, !10, i64 8}
!33 = !{!31, !10, i64 232}
!34 = !{!31, !7, i64 312}
!35 = !{!36, !8, i64 1}
!36 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.unroll.disable"}
!41 = !{!31, !7, i64 92}
!42 = !{!31, !24, i64 24}
!43 = !{!27, !10, i64 32}


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