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

; 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_DRIVER_BINDING_PROTOCOL = type { ptr, ptr, ptr, i32, ptr, ptr }
%struct._IP4_SERVICE = type { i32, %struct._EFI_SERVICE_BINDING_PROTOCOL, i64, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, ptr, %struct.IP4_ASSEMBLE_TABLE, %struct.IGMP_SERVICE_DATA, ptr, ptr, ptr, ptr, %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, %struct.EFI_SIMPLE_NETWORK_MODE, ptr, ptr, ptr, ptr, ptr, i32, i32 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.IP4_ASSEMBLE_TABLE = type { [31 x %struct._LIST_ENTRY] }
%struct.IGMP_SERVICE_DATA = type { i64, %struct._LIST_ENTRY }
%struct.EFI_MANAGED_NETWORK_CONFIG_DATA = type { i32, i32, i16, i8, i8, i8, i8, i8, i8, i8 }
%struct.EFI_SIMPLE_NETWORK_MODE = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [16 x %struct.EFI_MAC_ADDRESS], %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i8, i8, i8, i8, i8 }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct._IP4_INTERFACE = type { i32, %struct._LIST_ENTRY, i64, i32, i32, i32, i32, i8, ptr, ptr, ptr, ptr, ptr, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i32, %struct._LIST_ENTRY, i8 }
%struct._EFI_IP4_CONFIG_PROTOCOL = type { ptr, ptr, ptr }
%struct.EFI_IP4_IPCONFIG_DATA = type { %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i32, ptr }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct._IP4_PROTOCOL = type { i32, %struct._EFI_IP4_PROTOCOL, ptr, i64, ptr, %struct._LIST_ENTRY, %struct.NET_MAP, %struct.NET_MAP, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct.EFI_LOCK, ptr, %struct._LIST_ENTRY, ptr, ptr, i32, ptr, i32, %struct.EFI_IP4_CONFIG_DATA }
%struct._EFI_IP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%struct.EFI_LOCK = type { i64, i64, i32 }
%struct.EFI_IP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i8, i8, i8, i8, i32, i32 }
%struct.EFI_BOOT_SERVICES = type { %struct.EFI_TABLE_HEADER, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }
%struct.EFI_IP4_ROUTE_TABLE = type { %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS }

@gBS = external global ptr, align 8
@.str = external hidden unnamed_addr constant [149 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [107 x i8], align 1
@gEfiArpProtocolGuid = external global %struct.GUID, align 4
@gIp4DriverBinding = external global %struct._EFI_DRIVER_BINDING_PROTOCOL, align 8

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

declare zeroext i8 @DebugAssertEnabled() #1

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

declare i32 @SwapBytes32(i32 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @Ip4AutoConfigCallBackDpc(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, 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
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  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
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %20, ptr %6, align 8, !tbaa !5
  br label %21

21:                                               ; preds = %1
  %22 = call zeroext i8 @DebugAssertEnabled()
  %23 = icmp ne i8 %22, 0
  br i1 %23, label %24, label %34

24:                                               ; preds = %21
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %32

27:                                               ; preds = %24
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct._IP4_SERVICE, ptr %28, i32 0, i32 0
  %30 = load i32, ptr %29, align 8, !tbaa !9
  %31 = icmp eq i32 %30, 1395937353
  br i1 %31, label %33, label %32

32:                                               ; preds = %27, %24
  call void @DebugAssert(ptr noundef @.str, i64 noundef 570, ptr noundef @.str.2)
  br label %33

33:                                               ; preds = %32, %27
  br label %34

34:                                               ; preds = %33, %21
  br label %35

35:                                               ; preds = %34
  br label %36

36:                                               ; preds = %35
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._IP4_SERVICE, ptr %37, i32 0, i32 17
  %39 = load ptr, ptr %38, align 8, !tbaa !20
  store ptr %39, ptr %3, align 8, !tbaa !5
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct._IP4_SERVICE, ptr %40, i32 0, i32 20
  %42 = load ptr, ptr %41, align 8, !tbaa !21
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._IP4_SERVICE, ptr %43, i32 0, i32 19
  %45 = load ptr, ptr %44, align 8, !tbaa !22
  %46 = icmp eq ptr %42, %45
  br i1 %46, label %47, label %117

47:                                               ; preds = %36
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._IP4_SERVICE, ptr %48, i32 0, i32 6
  %50 = load ptr, ptr %49, align 8, !tbaa !23
  %51 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %50, i32 0, i32 7
  %52 = load i8, ptr %51, align 8, !tbaa !24
  %53 = icmp ne i8 %52, 0
  br i1 %53, label %54, label %100

54:                                               ; preds = %47
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct._IP4_SERVICE, ptr %55, i32 0, i32 13
  %57 = load ptr, ptr %56, align 8, !tbaa !26
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._IP4_SERVICE, ptr %58, i32 0, i32 11
  %60 = load ptr, ptr %59, align 8, !tbaa !27
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._IP4_SERVICE, ptr %61, i32 0, i32 10
  %63 = load ptr, ptr %62, align 8, !tbaa !28
  %64 = call ptr @Ip4CreateInterface(ptr noundef %57, ptr noundef %60, ptr noundef %63)
  store ptr %64, ptr %8, align 8, !tbaa !5
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = icmp eq ptr %65, null
  br i1 %66, label %67, label %68

67:                                               ; preds = %54
  store i32 1, ptr %19, align 4
  br label %279

68:                                               ; preds = %54
  %69 = call ptr @Ip4CreateRouteTable()
  store ptr %69, ptr %7, align 8, !tbaa !5
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = icmp eq ptr %70, null
  br i1 %71, label %72, label %75

72:                                               ; preds = %68
  %73 = load ptr, ptr %8, align 8, !tbaa !5
  %74 = call i64 @Ip4FreeInterface(ptr noundef %73, ptr noundef null)
  store i32 1, ptr %19, align 4
  br label %279

75:                                               ; preds = %68
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._IP4_SERVICE, ptr %76, i32 0, i32 6
  %78 = load ptr, ptr %77, align 8, !tbaa !23
  call void @Ip4CancelReceive(ptr noundef %78)
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct._IP4_SERVICE, ptr %79, i32 0, i32 6
  %81 = load ptr, ptr %80, align 8, !tbaa !23
  %82 = call i64 @Ip4FreeInterface(ptr noundef %81, ptr noundef null)
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct._IP4_SERVICE, ptr %83, i32 0, i32 7
  %85 = load ptr, ptr %84, align 8, !tbaa !29
  call void @Ip4FreeRouteTable(ptr noundef %85)
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._IP4_SERVICE, ptr %87, i32 0, i32 6
  store ptr %86, ptr %88, align 8, !tbaa !23
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._IP4_SERVICE, ptr %89, i32 0, i32 5
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %91, i32 0, i32 1
  %93 = call ptr @InsertHeadList(ptr noundef %90, ptr noundef %92)
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._IP4_SERVICE, ptr %95, i32 0, i32 7
  store ptr %94, ptr %96, align 8, !tbaa !29
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = call i64 @Ip4ReceiveFrame(ptr noundef %97, ptr noundef null, ptr noundef @Ip4AccpetFrame, ptr noundef %98)
  br label %100

100:                                              ; preds = %75, %47
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._EFI_IP4_CONFIG_PROTOCOL, ptr %101, i32 0, i32 1
  %103 = load ptr, ptr %102, align 8, !tbaa !30
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = call i64 %103(ptr noundef %104)
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._EFI_IP4_CONFIG_PROTOCOL, ptr %106, i32 0, i32 0
  %108 = load ptr, ptr %107, align 8, !tbaa !32
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct._IP4_SERVICE, ptr %110, i32 0, i32 18
  %112 = load ptr, ptr %111, align 8, !tbaa !33
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._IP4_SERVICE, ptr %113, i32 0, i32 19
  %115 = load ptr, ptr %114, align 8, !tbaa !22
  %116 = call i64 %108(ptr noundef %109, ptr noundef %112, ptr noundef %115)
  store i32 1, ptr %19, align 4
  br label %279

117:                                              ; preds = %36
  store i64 0, ptr %10, align 8, !tbaa !34
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._EFI_IP4_CONFIG_PROTOCOL, ptr %118, i32 0, i32 2
  %120 = load ptr, ptr %119, align 8, !tbaa !35
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = call i64 %120(ptr noundef %121, ptr noundef %10, ptr noundef null)
  %123 = icmp ne i64 %122, -9223372036854775803
  br i1 %123, label %124, label %125

124:                                              ; preds = %117
  store i32 1, ptr %19, align 4
  br label %279

125:                                              ; preds = %117
  %126 = load i64, ptr %10, align 8, !tbaa !34
  %127 = call ptr @AllocatePool(i64 noundef %126)
  store ptr %127, ptr %4, align 8, !tbaa !5
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = icmp eq ptr %128, null
  br i1 %129, label %130, label %131

130:                                              ; preds = %125
  store i32 1, ptr %19, align 4
  br label %279

131:                                              ; preds = %125
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._EFI_IP4_CONFIG_PROTOCOL, ptr %132, i32 0, i32 2
  %134 = load ptr, ptr %133, align 8, !tbaa !35
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = call i64 %134(ptr noundef %135, ptr noundef %10, ptr noundef %136)
  store i64 %137, ptr %9, align 8, !tbaa !34
  %138 = load i64, ptr %9, align 8, !tbaa !34
  %139 = icmp slt i64 %138, 0
  br i1 %139, label %140, label %141

140:                                              ; preds = %131
  br label %277

141:                                              ; preds = %131
  %142 = load ptr, ptr %6, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct._IP4_SERVICE, ptr %142, i32 0, i32 6
  %144 = load ptr, ptr %143, align 8, !tbaa !23
  store ptr %144, ptr %8, align 8, !tbaa !5
  %145 = load ptr, ptr %8, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %145, i32 0, i32 7
  %147 = load i8, ptr %146, align 8, !tbaa !24
  %148 = icmp ne i8 %147, 0
  br i1 %148, label %149, label %150

149:                                              ; preds = %141
  br label %277

150:                                              ; preds = %141
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.EFI_IP4_IPCONFIG_DATA, ptr %151, i32 0, i32 0
  %153 = getelementptr inbounds %struct.EFI_IPv4_ADDRESS, ptr %152, i32 0, i32 0
  %154 = getelementptr inbounds [4 x i8], ptr %153, i64 0, i64 0
  %155 = load i32, ptr %154, align 8, !tbaa !36
  %156 = call i32 @SwapBytes32(i32 noundef %155)
  store i32 %156, ptr %12, align 4, !tbaa !36
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.EFI_IP4_IPCONFIG_DATA, ptr %157, i32 0, i32 1
  %159 = getelementptr inbounds %struct.EFI_IPv4_ADDRESS, ptr %158, i32 0, i32 0
  %160 = getelementptr inbounds [4 x i8], ptr %159, i64 0, i64 0
  %161 = load i32, ptr %160, align 4, !tbaa !36
  %162 = call i32 @SwapBytes32(i32 noundef %161)
  store i32 %162, ptr %13, align 4, !tbaa !36
  %163 = load ptr, ptr %8, align 8, !tbaa !5
  %164 = load i32, ptr %12, align 4, !tbaa !36
  %165 = load i32, ptr %13, align 4, !tbaa !36
  %166 = call i64 @Ip4SetAddress(ptr noundef %163, i32 noundef %164, i32 noundef %165)
  store i64 %166, ptr %9, align 8, !tbaa !34
  %167 = load i64, ptr %9, align 8, !tbaa !34
  %168 = icmp slt i64 %167, 0
  br i1 %168, label %169, label %170

169:                                              ; preds = %150
  br label %277

170:                                              ; preds = %150
  %171 = load ptr, ptr %8, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %171, i32 0, i32 11
  %173 = load ptr, ptr %172, align 8, !tbaa !37
  %174 = icmp ne ptr %173, null
  br i1 %174, label %175, label %226

175:                                              ; preds = %170
  store ptr null, ptr %17, align 8, !tbaa !5
  %176 = load ptr, ptr %8, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %176, i32 0, i32 19
  %178 = getelementptr inbounds %struct._LIST_ENTRY, ptr %177, i32 0, i32 0
  %179 = load ptr, ptr %178, align 8, !tbaa !38
  store ptr %179, ptr %18, align 8, !tbaa !5
  br label %180

180:                                              ; preds = %221, %175
  %181 = load ptr, ptr %18, align 8, !tbaa !5
  %182 = load ptr, ptr %8, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %182, i32 0, i32 19
  %184 = icmp ne ptr %181, %183
  br i1 %184, label %185, label %225

185:                                              ; preds = %180
  %186 = call zeroext i8 @DebugAssertEnabled()
  %187 = zext i8 %186 to i32
  %188 = icmp ne i32 %187, 0
  br i1 %188, label %189, label %199

189:                                              ; preds = %185
  %190 = load ptr, ptr %18, align 8, !tbaa !5
  %191 = ptrtoint ptr %190 to i64
  %192 = sub i64 %191, ptrtoint (ptr getelementptr inbounds (%struct._IP4_PROTOCOL, ptr null, i32 0, i32 12) to i64)
  %193 = inttoptr i64 %192 to ptr
  %194 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %193, i32 0, i32 0
  %195 = load i32, ptr %194, align 8, !tbaa !39
  %196 = icmp ne i32 %195, 1345605705
  br i1 %196, label %197, label %199

197:                                              ; preds = %189
  call void @DebugAssert(ptr noundef @.str, i64 noundef 668, ptr noundef @.str.1)
  %198 = load ptr, ptr %18, align 8, !tbaa !5
  br label %204

199:                                              ; preds = %189, %185
  %200 = load ptr, ptr %18, align 8, !tbaa !5
  %201 = ptrtoint ptr %200 to i64
  %202 = sub i64 %201, ptrtoint (ptr getelementptr inbounds (%struct._IP4_PROTOCOL, ptr null, i32 0, i32 12) to i64)
  %203 = inttoptr i64 %202 to ptr
  br label %204

204:                                              ; preds = %199, %197
  %205 = phi ptr [ %198, %197 ], [ %203, %199 ]
  store ptr %205, ptr %16, align 8, !tbaa !5
  %206 = load ptr, ptr @gBS, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %206, i32 0, i32 33
  %208 = load ptr, ptr %207, align 8, !tbaa !45
  %209 = load ptr, ptr %8, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %209, i32 0, i32 12
  %211 = load ptr, ptr %210, align 8, !tbaa !48
  %212 = load ptr, ptr getelementptr inbounds (%struct._EFI_DRIVER_BINDING_PROTOCOL, ptr @gIp4DriverBinding, i32 0, i32 5), align 8, !tbaa !49
  %213 = load ptr, ptr %16, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %213, i32 0, i32 2
  %215 = load ptr, ptr %214, align 8, !tbaa !51
  %216 = call i64 %208(ptr noundef %211, ptr noundef @gEfiArpProtocolGuid, ptr noundef %17, ptr noundef %212, ptr noundef %215, i32 noundef 8)
  store i64 %216, ptr %9, align 8, !tbaa !34
  %217 = load i64, ptr %9, align 8, !tbaa !34
  %218 = icmp slt i64 %217, 0
  br i1 %218, label %219, label %220

219:                                              ; preds = %204
  br label %277

220:                                              ; preds = %204
  br label %221

221:                                              ; preds = %220
  %222 = load ptr, ptr %18, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct._LIST_ENTRY, ptr %222, i32 0, i32 0
  %224 = load ptr, ptr %223, align 8, !tbaa !52
  store ptr %224, ptr %18, align 8, !tbaa !5
  br label %180, !llvm.loop !53

225:                                              ; preds = %180
  br label %226

226:                                              ; preds = %225, %170
  %227 = load ptr, ptr %6, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct._IP4_SERVICE, ptr %227, i32 0, i32 7
  %229 = load ptr, ptr %228, align 8, !tbaa !29
  %230 = load i32, ptr %12, align 4, !tbaa !36
  %231 = load i32, ptr %13, align 4, !tbaa !36
  %232 = call i64 @Ip4AddRoute(ptr noundef %229, i32 noundef %230, i32 noundef %231, i32 noundef 0)
  store i32 0, ptr %11, align 4, !tbaa !36
  br label %233

233:                                              ; preds = %271, %226
  %234 = load i32, ptr %11, align 4, !tbaa !36
  %235 = load ptr, ptr %4, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.EFI_IP4_IPCONFIG_DATA, ptr %235, i32 0, i32 2
  %237 = load i32, ptr %236, align 8, !tbaa !55
  %238 = icmp ult i32 %234, %237
  br i1 %238, label %239, label %274

239:                                              ; preds = %233
  %240 = load ptr, ptr %4, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.EFI_IP4_IPCONFIG_DATA, ptr %240, i32 0, i32 3
  %242 = load ptr, ptr %241, align 8, !tbaa !57
  %243 = load i32, ptr %11, align 4, !tbaa !36
  %244 = zext i32 %243 to i64
  %245 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %242, i64 %244
  store ptr %245, ptr %5, align 8, !tbaa !5
  %246 = load ptr, ptr %5, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %246, i32 0, i32 0
  %248 = getelementptr inbounds %struct.EFI_IPv4_ADDRESS, ptr %247, i32 0, i32 0
  %249 = getelementptr inbounds [4 x i8], ptr %248, i64 0, i64 0
  %250 = load i32, ptr %249, align 1, !tbaa !36
  %251 = call i32 @SwapBytes32(i32 noundef %250)
  store i32 %251, ptr %14, align 4, !tbaa !36
  %252 = load ptr, ptr %5, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %252, i32 0, i32 1
  %254 = getelementptr inbounds %struct.EFI_IPv4_ADDRESS, ptr %253, i32 0, i32 0
  %255 = getelementptr inbounds [4 x i8], ptr %254, i64 0, i64 0
  %256 = load i32, ptr %255, align 1, !tbaa !36
  %257 = call i32 @SwapBytes32(i32 noundef %256)
  store i32 %257, ptr %13, align 4, !tbaa !36
  %258 = load ptr, ptr %5, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %258, i32 0, i32 2
  %260 = getelementptr inbounds %struct.EFI_IPv4_ADDRESS, ptr %259, i32 0, i32 0
  %261 = getelementptr inbounds [4 x i8], ptr %260, i64 0, i64 0
  %262 = load i32, ptr %261, align 1, !tbaa !36
  %263 = call i32 @SwapBytes32(i32 noundef %262)
  store i32 %263, ptr %15, align 4, !tbaa !36
  %264 = load ptr, ptr %6, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct._IP4_SERVICE, ptr %264, i32 0, i32 7
  %266 = load ptr, ptr %265, align 8, !tbaa !29
  %267 = load i32, ptr %14, align 4, !tbaa !36
  %268 = load i32, ptr %13, align 4, !tbaa !36
  %269 = load i32, ptr %15, align 4, !tbaa !36
  %270 = call i64 @Ip4AddRoute(ptr noundef %266, i32 noundef %267, i32 noundef %268, i32 noundef %269)
  br label %271

271:                                              ; preds = %239
  %272 = load i32, ptr %11, align 4, !tbaa !36
  %273 = add i32 %272, 1
  store i32 %273, ptr %11, align 4, !tbaa !36
  br label %233, !llvm.loop !58

274:                                              ; preds = %233
  %275 = load ptr, ptr %6, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct._IP4_SERVICE, ptr %275, i32 0, i32 2
  store i64 2, ptr %276, align 8, !tbaa !59
  br label %277

277:                                              ; preds = %274, %219, %169, %149, %140
  %278 = load ptr, ptr %4, align 8, !tbaa !5
  call void @FreePool(ptr noundef %278)
  store i32 0, ptr %19, align 4
  br label %279

279:                                              ; preds = %277, %130, %124, %100, %72, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  %280 = load i32, ptr %19, align 4
  switch i32 %280, label %282 [
    i32 0, label %281
    i32 1, label %281
  ]

281:                                              ; preds = %279, %279
  ret void

282:                                              ; preds = %279
  unreachable
}

declare ptr @Ip4CreateInterface(ptr noundef, ptr noundef, ptr noundef) #1

declare ptr @Ip4CreateRouteTable() #1

declare i64 @Ip4FreeInterface(ptr noundef, ptr noundef) #1

declare void @Ip4CancelReceive(ptr noundef) #1

declare void @Ip4FreeRouteTable(ptr noundef) #1

declare ptr @InsertHeadList(ptr noundef, ptr noundef) #1

declare i64 @Ip4ReceiveFrame(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare void @Ip4AccpetFrame(ptr noundef, ptr noundef, i64 noundef, i32 noundef, ptr noundef) #1

declare ptr @AllocatePool(i64 noundef) #1

declare i64 @Ip4SetAddress(ptr noundef, i32 noundef, i32 noundef) #1

declare i64 @Ip4AddRoute(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare void @FreePool(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #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 = !{!"_IP4_SERVICE", !11, i64 0, !12, i64 8, !13, i64 24, !13, i64 32, !14, i64 40, !14, i64 56, !6, i64 72, !6, i64 80, !15, i64 88, !16, i64 584, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !17, i64 640, !19, i64 660, !6, i64 1320, !6, i64 1328, !6, i64 1336, !6, i64 1344, !6, i64 1352, !11, i64 1360, !11, i64 1364}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!15 = !{!"", !7, i64 0}
!16 = !{!"", !13, i64 0, !14, i64 8}
!17 = !{!"", !11, i64 0, !11, i64 4, !18, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!18 = !{!"short", !7, i64 0}
!19 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !7, i64 40, !15, i64 552, !15, i64 584, !15, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!20 = !{!10, !6, i64 1328}
!21 = !{!10, !6, i64 1352}
!22 = !{!10, !6, i64 1344}
!23 = !{!10, !6, i64 72}
!24 = !{!25, !7, i64 48}
!25 = !{!"_IP4_INTERFACE", !11, i64 0, !14, i64 8, !13, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !7, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !14, i64 96, !14, i64 112, !6, i64 128, !15, i64 136, !15, i64 168, !11, i64 200, !14, i64 208, !7, i64 224}
!26 = !{!10, !6, i64 632}
!27 = !{!10, !6, i64 616}
!28 = !{!10, !6, i64 608}
!29 = !{!10, !6, i64 80}
!30 = !{!31, !6, i64 8}
!31 = !{!"_EFI_IP4_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!32 = !{!31, !6, i64 0}
!33 = !{!10, !6, i64 1336}
!34 = !{!13, !13, i64 0}
!35 = !{!31, !6, i64 16}
!36 = !{!11, !11, i64 0}
!37 = !{!25, !6, i64 80}
!38 = !{!25, !6, i64 208}
!39 = !{!40, !11, i64 0}
!40 = !{!"_IP4_PROTOCOL", !11, i64 0, !41, i64 8, !6, i64 72, !13, i64 80, !6, i64 88, !14, i64 96, !42, i64 112, !42, i64 152, !14, i64 192, !14, i64 208, !43, i64 224, !6, i64 248, !14, i64 256, !6, i64 272, !6, i64 280, !11, i64 288, !6, i64 296, !11, i64 304, !44, i64 308}
!41 = !{!"_EFI_IP4_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}
!42 = !{!"", !14, i64 0, !14, i64 16, !13, i64 32}
!43 = !{!"", !13, i64 0, !13, i64 8, !11, i64 16}
!44 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !15, i64 6, !15, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !11, i64 20, !11, i64 24}
!45 = !{!46, !6, i64 280}
!46 = !{!"", !47, 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}
!47 = !{!"", !13, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!48 = !{!25, !6, i64 88}
!49 = !{!50, !6, i64 40}
!50 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !6, i64 32, !6, i64 40}
!51 = !{!40, !6, i64 72}
!52 = !{!14, !6, i64 0}
!53 = distinct !{!53, !54}
!54 = !{!"llvm.loop.mustprogress"}
!55 = !{!56, !11, i64 8}
!56 = !{!"", !15, i64 0, !15, i64 4, !11, i64 8, !6, i64 16}
!57 = !{!56, !6, i64 16}
!58 = distinct !{!58, !54}
!59 = !{!10, !13, i64 24}


; 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_DRIVER_BINDING_PROTOCOL = type { ptr, ptr, ptr, i32, ptr, ptr }
%struct.EFI_IP4_ROUTE_TABLE = type { %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }

@gBS = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [149 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [107 x i8], align 1
@gEfiArpProtocolGuid = external global %struct.GUID, align 4
@gIp4DriverBinding = external local_unnamed_addr global %struct._EFI_DRIVER_BINDING_PROTOCOL, align 8

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

declare i32 @SwapBytes32(i32 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @Ip4AutoConfigCallBackDpc(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %4 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %4, 0
  br i1 %.not, label %10, label %5

5:                                                ; preds = %1
  %.not77 = icmp eq ptr %0, null
  br i1 %.not77, label %9, label %6

6:                                                ; preds = %5
  %7 = load i32, ptr %0, align 8, !tbaa !5
  %8 = icmp eq i32 %7, 1395937353
  br i1 %8, label %10, label %9

9:                                                ; preds = %6, %5
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 570, ptr noundef nonnull @.str.2) #3
  br label %10

10:                                               ; preds = %6, %9, %1
  %11 = getelementptr inbounds i8, ptr %0, i64 1328
  %12 = load ptr, ptr %11, align 8, !tbaa !19
  %13 = getelementptr inbounds i8, ptr %0, i64 1352
  %14 = load ptr, ptr %13, align 8, !tbaa !20
  %15 = getelementptr inbounds i8, ptr %0, i64 1344
  %16 = load ptr, ptr %15, align 8, !tbaa !21
  %17 = icmp eq ptr %14, %16
  br i1 %17, label %18, label %56

18:                                               ; preds = %10
  %19 = getelementptr inbounds i8, ptr %0, i64 72
  %20 = load ptr, ptr %19, align 8, !tbaa !22
  %21 = getelementptr inbounds i8, ptr %20, i64 48
  %22 = load i8, ptr %21, align 8, !tbaa !23
  %.not84 = icmp eq i8 %22, 0
  br i1 %.not84, label %47, label %23

23:                                               ; preds = %18
  %24 = getelementptr inbounds i8, ptr %0, i64 632
  %25 = load ptr, ptr %24, align 8, !tbaa !25
  %26 = getelementptr inbounds i8, ptr %0, i64 616
  %27 = load ptr, ptr %26, align 8, !tbaa !26
  %28 = getelementptr inbounds i8, ptr %0, i64 608
  %29 = load ptr, ptr %28, align 8, !tbaa !27
  %30 = tail call ptr @Ip4CreateInterface(ptr noundef %25, ptr noundef %27, ptr noundef %29) #3
  %31 = icmp eq ptr %30, null
  br i1 %31, label %126, label %32

32:                                               ; preds = %23
  %33 = tail call ptr @Ip4CreateRouteTable() #3
  %34 = icmp eq ptr %33, null
  br i1 %34, label %35, label %37

35:                                               ; preds = %32
  %36 = tail call i64 @Ip4FreeInterface(ptr noundef nonnull %30, ptr noundef null) #3
  br label %126

37:                                               ; preds = %32
  %38 = load ptr, ptr %19, align 8, !tbaa !22
  tail call void @Ip4CancelReceive(ptr noundef %38) #3
  %39 = load ptr, ptr %19, align 8, !tbaa !22
  %40 = tail call i64 @Ip4FreeInterface(ptr noundef %39, ptr noundef null) #3
  %41 = getelementptr inbounds i8, ptr %0, i64 80
  %42 = load ptr, ptr %41, align 8, !tbaa !28
  tail call void @Ip4FreeRouteTable(ptr noundef %42) #3
  store ptr %30, ptr %19, align 8, !tbaa !22
  %43 = getelementptr inbounds i8, ptr %0, i64 56
  %44 = getelementptr inbounds i8, ptr %30, i64 8
  %45 = tail call ptr @InsertHeadList(ptr noundef nonnull %43, ptr noundef nonnull %44) #3
  store ptr %33, ptr %41, align 8, !tbaa !28
  %46 = tail call i64 @Ip4ReceiveFrame(ptr noundef nonnull %30, ptr noundef null, ptr noundef nonnull @Ip4AccpetFrame, ptr noundef nonnull %0) #3
  br label %47

47:                                               ; preds = %37, %18
  %48 = getelementptr inbounds i8, ptr %12, i64 8
  %49 = load ptr, ptr %48, align 8, !tbaa !29
  %50 = tail call i64 %49(ptr noundef %12) #3
  %51 = load ptr, ptr %12, align 8, !tbaa !31
  %52 = getelementptr inbounds i8, ptr %0, i64 1336
  %53 = load ptr, ptr %52, align 8, !tbaa !32
  %54 = load ptr, ptr %15, align 8, !tbaa !21
  %55 = tail call i64 %51(ptr noundef nonnull %12, ptr noundef %53, ptr noundef %54) #3
  br label %126

56:                                               ; preds = %10
  store i64 0, ptr %2, align 8, !tbaa !33
  %57 = getelementptr inbounds i8, ptr %12, i64 16
  %58 = load ptr, ptr %57, align 8, !tbaa !34
  %59 = call i64 %58(ptr noundef %12, ptr noundef nonnull %2, ptr noundef null) #3
  %.not78 = icmp eq i64 %59, -9223372036854775803
  br i1 %.not78, label %60, label %126

60:                                               ; preds = %56
  %61 = load i64, ptr %2, align 8, !tbaa !33
  %62 = call ptr @AllocatePool(i64 noundef %61) #3
  %63 = icmp eq ptr %62, null
  br i1 %63, label %126, label %64

64:                                               ; preds = %60
  %65 = load ptr, ptr %57, align 8, !tbaa !34
  %66 = call i64 %65(ptr noundef nonnull %12, ptr noundef nonnull %2, ptr noundef nonnull %62) #3
  %67 = icmp slt i64 %66, 0
  br i1 %67, label %.loopexit85, label %68

68:                                               ; preds = %64
  %69 = getelementptr inbounds i8, ptr %0, i64 72
  %70 = load ptr, ptr %69, align 8, !tbaa !22
  %71 = getelementptr inbounds i8, ptr %70, i64 48
  %72 = load i8, ptr %71, align 8, !tbaa !23
  %.not79 = icmp eq i8 %72, 0
  br i1 %.not79, label %73, label %.loopexit85

73:                                               ; preds = %68
  %74 = load i32, ptr %62, align 8, !tbaa !35
  %75 = call i32 @SwapBytes32(i32 noundef %74) #3
  %76 = getelementptr inbounds i8, ptr %62, i64 4
  %77 = load i32, ptr %76, align 4, !tbaa !35
  %78 = call i32 @SwapBytes32(i32 noundef %77) #3
  %79 = call i64 @Ip4SetAddress(ptr noundef nonnull %70, i32 noundef %75, i32 noundef %78) #3
  %80 = icmp slt i64 %79, 0
  br i1 %80, label %.loopexit85, label %81

81:                                               ; preds = %73
  %82 = getelementptr inbounds i8, ptr %70, i64 80
  %83 = load ptr, ptr %82, align 8, !tbaa !36
  %.not80 = icmp eq ptr %83, null
  br i1 %.not80, label %.loopexit, label %84

84:                                               ; preds = %81
  store ptr null, ptr %3, align 8, !tbaa !37
  %85 = getelementptr inbounds i8, ptr %70, i64 208
  %86 = getelementptr inbounds i8, ptr %70, i64 88
  br label %87

87:                                               ; preds = %._crit_edge89, %84
  %.0.in = phi ptr [ %85, %84 ], [ %.0, %._crit_edge89 ]
  %.0 = load ptr, ptr %.0.in, align 8, !tbaa !38
  %.not81 = icmp eq ptr %.0, %85
  br i1 %.not81, label %.loopexit, label %88

88:                                               ; preds = %87
  %89 = call zeroext i8 @DebugAssertEnabled() #3
  %.not82 = icmp eq i8 %89, 0
  %.pre = ptrtoint ptr %.0 to i64
  %.pre90 = add i64 %.pre, -256
  %.pre92 = inttoptr i64 %.pre90 to ptr
  br i1 %.not82, label %._crit_edge89, label %90

90:                                               ; preds = %88
  %91 = load i32, ptr %.pre92, align 8, !tbaa !39
  %.not83 = icmp eq i32 %91, 1345605705
  br i1 %.not83, label %._crit_edge89, label %92

92:                                               ; preds = %90
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 668, ptr noundef nonnull @.str.1) #3
  br label %._crit_edge89

._crit_edge89:                                    ; preds = %88, %90, %92
  %93 = phi ptr [ %.0, %92 ], [ %.pre92, %90 ], [ %.pre92, %88 ]
  %94 = load ptr, ptr @gBS, align 8, !tbaa !37
  %95 = getelementptr inbounds i8, ptr %94, i64 280
  %96 = load ptr, ptr %95, align 8, !tbaa !45
  %97 = load ptr, ptr %86, align 8, !tbaa !48
  %98 = load ptr, ptr getelementptr inbounds (i8, ptr @gIp4DriverBinding, i64 40), align 8, !tbaa !49
  %99 = getelementptr inbounds i8, ptr %93, i64 72
  %100 = load ptr, ptr %99, align 8, !tbaa !51
  %101 = call i64 %96(ptr noundef %97, ptr noundef nonnull @gEfiArpProtocolGuid, ptr noundef nonnull %3, ptr noundef %98, ptr noundef %100, i32 noundef 8) #3
  %102 = icmp slt i64 %101, 0
  br i1 %102, label %.loopexit85, label %87, !llvm.loop !52

.loopexit:                                        ; preds = %87, %81
  %103 = getelementptr inbounds i8, ptr %0, i64 80
  %104 = load ptr, ptr %103, align 8, !tbaa !28
  %105 = call i64 @Ip4AddRoute(ptr noundef %104, i32 noundef %75, i32 noundef %78, i32 noundef 0) #3
  %106 = getelementptr inbounds i8, ptr %62, i64 8
  %107 = load i32, ptr %106, align 8, !tbaa !54
  %.not87 = icmp eq i32 %107, 0
  br i1 %.not87, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.loopexit
  %108 = getelementptr inbounds i8, ptr %62, i64 16
  br label %109

109:                                              ; preds = %.lr.ph, %109
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %109 ]
  %110 = load ptr, ptr %108, align 8, !tbaa !56
  %111 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %110, i64 %indvars.iv
  %112 = load i32, ptr %111, align 1, !tbaa !35
  %113 = call i32 @SwapBytes32(i32 noundef %112) #3
  %114 = getelementptr inbounds i8, ptr %111, i64 4
  %115 = load i32, ptr %114, align 1, !tbaa !35
  %116 = call i32 @SwapBytes32(i32 noundef %115) #3
  %117 = getelementptr inbounds i8, ptr %111, i64 8
  %118 = load i32, ptr %117, align 1, !tbaa !35
  %119 = call i32 @SwapBytes32(i32 noundef %118) #3
  %120 = load ptr, ptr %103, align 8, !tbaa !28
  %121 = call i64 @Ip4AddRoute(ptr noundef %120, i32 noundef %113, i32 noundef %116, i32 noundef %119) #3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %122 = load i32, ptr %106, align 8, !tbaa !54
  %123 = zext i32 %122 to i64
  %124 = icmp ult i64 %indvars.iv.next, %123
  br i1 %124, label %109, label %._crit_edge, !llvm.loop !57

._crit_edge:                                      ; preds = %109, %.loopexit
  %125 = getelementptr inbounds i8, ptr %0, i64 24
  store i64 2, ptr %125, align 8, !tbaa !58
  br label %.loopexit85

.loopexit85:                                      ; preds = %._crit_edge89, %73, %68, %64, %._crit_edge
  call void @FreePool(ptr noundef nonnull %62) #3
  br label %126

126:                                              ; preds = %60, %56, %23, %.loopexit85, %47, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  ret void
}

declare ptr @Ip4CreateInterface(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @Ip4CreateRouteTable() local_unnamed_addr #1

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

declare void @Ip4CancelReceive(ptr noundef) local_unnamed_addr #1

declare void @Ip4FreeRouteTable(ptr noundef) local_unnamed_addr #1

declare ptr @InsertHeadList(ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare void @Ip4AccpetFrame(ptr noundef, ptr noundef, i64 noundef, i32 noundef, ptr noundef) #1

declare ptr @AllocatePool(i64 noundef) local_unnamed_addr #1

declare i64 @Ip4SetAddress(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare i64 @Ip4AddRoute(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @FreePool(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #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 = !{!"_IP4_SERVICE", !7, i64 0, !10, i64 8, !12, i64 24, !12, i64 32, !13, i64 40, !13, i64 56, !11, i64 72, !11, i64 80, !14, i64 88, !15, i64 584, !11, i64 608, !11, i64 616, !11, i64 624, !11, i64 632, !16, i64 640, !18, i64 660, !11, i64 1320, !11, i64 1328, !11, i64 1336, !11, i64 1344, !11, i64 1352, !7, i64 1360, !7, i64 1364}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !11, i64 0, !11, i64 8}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"long long", !8, i64 0}
!13 = !{!"_LIST_ENTRY", !11, i64 0, !11, i64 8}
!14 = !{!"", !8, i64 0}
!15 = !{!"", !12, i64 0, !13, i64 8}
!16 = !{!"", !7, i64 0, !7, i64 4, !17, i64 8, !8, i64 10, !8, i64 11, !8, i64 12, !8, i64 13, !8, i64 14, !8, i64 15, !8, i64 16}
!17 = !{!"short", !8, i64 0}
!18 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !8, i64 40, !14, i64 552, !14, i64 584, !14, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!19 = !{!6, !11, i64 1328}
!20 = !{!6, !11, i64 1352}
!21 = !{!6, !11, i64 1344}
!22 = !{!6, !11, i64 72}
!23 = !{!24, !8, i64 48}
!24 = !{!"_IP4_INTERFACE", !7, i64 0, !13, i64 8, !12, i64 24, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !8, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !13, i64 96, !13, i64 112, !11, i64 128, !14, i64 136, !14, i64 168, !7, i64 200, !13, i64 208, !8, i64 224}
!25 = !{!6, !11, i64 632}
!26 = !{!6, !11, i64 616}
!27 = !{!6, !11, i64 608}
!28 = !{!6, !11, i64 80}
!29 = !{!30, !11, i64 8}
!30 = !{!"_EFI_IP4_CONFIG_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16}
!31 = !{!30, !11, i64 0}
!32 = !{!6, !11, i64 1336}
!33 = !{!12, !12, i64 0}
!34 = !{!30, !11, i64 16}
!35 = !{!7, !7, i64 0}
!36 = !{!24, !11, i64 80}
!37 = !{!11, !11, i64 0}
!38 = !{!13, !11, i64 0}
!39 = !{!40, !7, i64 0}
!40 = !{!"_IP4_PROTOCOL", !7, i64 0, !41, i64 8, !11, i64 72, !12, i64 80, !11, i64 88, !13, i64 96, !42, i64 112, !42, i64 152, !13, i64 192, !13, i64 208, !43, i64 224, !11, i64 248, !13, i64 256, !11, i64 272, !11, i64 280, !7, i64 288, !11, i64 296, !7, i64 304, !44, i64 308}
!41 = !{!"_EFI_IP4_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}
!42 = !{!"", !13, i64 0, !13, i64 16, !12, i64 32}
!43 = !{!"", !12, i64 0, !12, i64 8, !7, i64 16}
!44 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !14, i64 6, !14, i64 10, !8, i64 14, !8, i64 15, !8, i64 16, !8, i64 17, !7, i64 20, !7, i64 24}
!45 = !{!46, !11, i64 280}
!46 = !{!"", !47, 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}
!47 = !{!"", !12, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!48 = !{!24, !11, i64 88}
!49 = !{!50, !11, i64 40}
!50 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !7, i64 24, !11, i64 32, !11, i64 40}
!51 = !{!40, !11, i64 72}
!52 = distinct !{!52, !53}
!53 = !{!"llvm.loop.mustprogress"}
!54 = !{!55, !7, i64 8}
!55 = !{!"", !14, i64 0, !14, i64 4, !7, i64 8, !11, i64 16}
!56 = !{!55, !11, i64 16}
!57 = distinct !{!57, !53}
!58 = !{!6, !12, i64 24}


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