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

; 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.IP4_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT = type { ptr, i64, 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._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._EFI_IP4_CONFIG_PROTOCOL = type { ptr, ptr, ptr }
%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 }

@gBS = external global ptr, align 8
@.str = external hidden unnamed_addr constant [151 x i8], align 1
@gEfiManagedNetworkProtocolGuid = external global %struct.GUID, align 4
@gEfiIp4ConfigProtocolGuid = external global %struct.GUID, align 4
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@gEfiIp4ServiceBindingProtocolGuid = external global %struct.GUID, align 4
@gEfiArpProtocolGuid = external global %struct.GUID, align 4
@gIp4ControllerNameTable = external global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip4DriverBindingStop(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3) #0 {
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %struct.IP4_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i64 %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 24, 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 @gBS, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %20, i32 0, i32 33
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %24, i32 0, i32 5
  %26 = load ptr, ptr %25, align 8, !tbaa !15
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = call i64 %22(ptr noundef %23, ptr noundef @gEfiIp4ConfigProtocolGuid, ptr noundef null, ptr noundef %26, ptr noundef %27, i32 noundef 4)
  store i64 %28, ptr %13, align 8, !tbaa !9
  %29 = load i64, ptr %13, align 8, !tbaa !9
  %30 = icmp eq i64 %29, 0
  br i1 %30, label %31, label %123

31:                                               ; preds = %4
  %32 = load ptr, ptr @gBS, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %32, i32 0, i32 33
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %36, i32 0, i32 5
  %38 = load ptr, ptr %37, align 8, !tbaa !15
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = call i64 %34(ptr noundef %35, ptr noundef @gEfiIp4ServiceBindingProtocolGuid, ptr noundef %10, ptr noundef %38, ptr noundef %39, i32 noundef 2)
  store i64 %40, ptr %13, align 8, !tbaa !9
  %41 = load i64, ptr %13, align 8, !tbaa !9
  %42 = icmp slt i64 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %31
  store i64 -9223372036854775801, ptr %5, align 8
  store i32 1, ptr %19, align 4
  br label %296

44:                                               ; preds = %31
  %45 = call zeroext i8 @DebugAssertEnabled()
  %46 = zext i8 %45 to i32
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %58

48:                                               ; preds = %44
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = ptrtoint ptr %49 to i64
  %51 = sub i64 %50, ptrtoint (ptr getelementptr inbounds (%struct._IP4_SERVICE, ptr null, i32 0, i32 1) to i64)
  %52 = inttoptr i64 %51 to ptr
  %53 = getelementptr inbounds %struct._IP4_SERVICE, ptr %52, i32 0, i32 0
  %54 = load i32, ptr %53, align 8, !tbaa !17
  %55 = icmp ne i32 %54, 1395937353
  br i1 %55, label %56, label %58

56:                                               ; preds = %48
  call void @DebugAssert(ptr noundef @.str, i64 noundef 611, ptr noundef @.str.2)
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  br label %63

58:                                               ; preds = %48, %44
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = ptrtoint ptr %59 to i64
  %61 = sub i64 %60, ptrtoint (ptr getelementptr inbounds (%struct._IP4_SERVICE, ptr null, i32 0, i32 1) to i64)
  %62 = inttoptr i64 %61 to ptr
  br label %63

63:                                               ; preds = %58, %56
  %64 = phi ptr [ %57, %56 ], [ %62, %58 ]
  store ptr %64, ptr %11, align 8, !tbaa !5
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._IP4_SERVICE, ptr %65, i32 0, i32 17
  %67 = load ptr, ptr %66, align 8, !tbaa !26
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %122

69:                                               ; preds = %63
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._IP4_SERVICE, ptr %70, i32 0, i32 2
  %72 = load i64, ptr %71, align 8, !tbaa !27
  %73 = icmp ne i64 %72, 3
  br i1 %73, label %74, label %122

74:                                               ; preds = %69
  %75 = load ptr, ptr %11, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._IP4_SERVICE, ptr %75, i32 0, i32 17
  %77 = load ptr, ptr %76, align 8, !tbaa !26
  %78 = getelementptr inbounds %struct._EFI_IP4_CONFIG_PROTOCOL, ptr %77, i32 0, i32 1
  %79 = load ptr, ptr %78, align 8, !tbaa !28
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._IP4_SERVICE, ptr %80, i32 0, i32 17
  %82 = load ptr, ptr %81, align 8, !tbaa !26
  %83 = call i64 %79(ptr noundef %82)
  %84 = load ptr, ptr @gBS, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %84, i32 0, i32 34
  %86 = load ptr, ptr %85, align 8, !tbaa !30
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct._IP4_SERVICE, ptr %88, i32 0, i32 10
  %90 = load ptr, ptr %89, align 8, !tbaa !31
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = call i64 %86(ptr noundef %87, ptr noundef @gEfiIp4ConfigProtocolGuid, ptr noundef %90, ptr noundef %91)
  store i64 %92, ptr %13, align 8, !tbaa !9
  %93 = load i64, ptr %13, align 8, !tbaa !9
  %94 = icmp slt i64 %93, 0
  br i1 %94, label %95, label %97

95:                                               ; preds = %74
  %96 = load i64, ptr %13, align 8, !tbaa !9
  store i64 %96, ptr %5, align 8
  store i32 1, ptr %19, align 4
  br label %296

97:                                               ; preds = %74
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._IP4_SERVICE, ptr %98, i32 0, i32 2
  %100 = load i64, ptr %99, align 8, !tbaa !27
  %101 = icmp eq i64 %100, 1
  br i1 %101, label %102, label %105

102:                                              ; preds = %97
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct._IP4_SERVICE, ptr %103, i32 0, i32 2
  store i64 0, ptr %104, align 8, !tbaa !27
  br label %105

105:                                              ; preds = %102, %97
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._IP4_SERVICE, ptr %106, i32 0, i32 17
  store ptr null, ptr %107, align 8, !tbaa !26
  %108 = load ptr, ptr @gBS, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %108, i32 0, i32 12
  %110 = load ptr, ptr %109, align 8, !tbaa !32
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._IP4_SERVICE, ptr %111, i32 0, i32 18
  %113 = load ptr, ptr %112, align 8, !tbaa !33
  %114 = call i64 %110(ptr noundef %113)
  %115 = load ptr, ptr @gBS, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %115, i32 0, i32 12
  %117 = load ptr, ptr %116, align 8, !tbaa !32
  %118 = load ptr, ptr %11, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._IP4_SERVICE, ptr %118, i32 0, i32 19
  %120 = load ptr, ptr %119, align 8, !tbaa !34
  %121 = call i64 %117(ptr noundef %120)
  br label %122

122:                                              ; preds = %105, %69, %63
  store i64 0, ptr %5, align 8
  store i32 1, ptr %19, align 4
  br label %296

123:                                              ; preds = %4
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = call ptr @NetLibGetNicHandle(ptr noundef %124, ptr noundef @gEfiManagedNetworkProtocolGuid)
  store ptr %125, ptr %12, align 8, !tbaa !5
  %126 = load ptr, ptr %12, align 8, !tbaa !5
  %127 = icmp eq ptr %126, null
  br i1 %127, label %128, label %135

128:                                              ; preds = %123
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = call ptr @NetLibGetNicHandle(ptr noundef %129, ptr noundef @gEfiArpProtocolGuid)
  store ptr %130, ptr %12, align 8, !tbaa !5
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  %132 = icmp eq ptr %131, null
  br i1 %132, label %133, label %134

133:                                              ; preds = %128
  store i64 0, ptr %5, align 8
  store i32 1, ptr %19, align 4
  br label %296

134:                                              ; preds = %128
  br label %135

135:                                              ; preds = %134, %123
  %136 = load ptr, ptr @gBS, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %136, i32 0, i32 33
  %138 = load ptr, ptr %137, align 8, !tbaa !11
  %139 = load ptr, ptr %12, align 8, !tbaa !5
  %140 = load ptr, ptr %6, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %140, i32 0, i32 5
  %142 = load ptr, ptr %141, align 8, !tbaa !15
  %143 = load ptr, ptr %12, align 8, !tbaa !5
  %144 = call i64 %138(ptr noundef %139, ptr noundef @gEfiIp4ServiceBindingProtocolGuid, ptr noundef %10, ptr noundef %142, ptr noundef %143, i32 noundef 2)
  store i64 %144, ptr %13, align 8, !tbaa !9
  %145 = load i64, ptr %13, align 8, !tbaa !9
  %146 = icmp slt i64 %145, 0
  br i1 %146, label %147, label %148

147:                                              ; preds = %135
  store i64 -9223372036854775801, ptr %5, align 8
  store i32 1, ptr %19, align 4
  br label %296

148:                                              ; preds = %135
  %149 = call zeroext i8 @DebugAssertEnabled()
  %150 = zext i8 %149 to i32
  %151 = icmp ne i32 %150, 0
  br i1 %151, label %152, label %162

152:                                              ; preds = %148
  %153 = load ptr, ptr %10, align 8, !tbaa !5
  %154 = ptrtoint ptr %153 to i64
  %155 = sub i64 %154, ptrtoint (ptr getelementptr inbounds (%struct._IP4_SERVICE, ptr null, i32 0, i32 1) to i64)
  %156 = inttoptr i64 %155 to ptr
  %157 = getelementptr inbounds %struct._IP4_SERVICE, ptr %156, i32 0, i32 0
  %158 = load i32, ptr %157, align 8, !tbaa !17
  %159 = icmp ne i32 %158, 1395937353
  br i1 %159, label %160, label %162

160:                                              ; preds = %152
  call void @DebugAssert(ptr noundef @.str, i64 noundef 670, ptr noundef @.str.2)
  %161 = load ptr, ptr %10, align 8, !tbaa !5
  br label %167

162:                                              ; preds = %152, %148
  %163 = load ptr, ptr %10, align 8, !tbaa !5
  %164 = ptrtoint ptr %163 to i64
  %165 = sub i64 %164, ptrtoint (ptr getelementptr inbounds (%struct._IP4_SERVICE, ptr null, i32 0, i32 1) to i64)
  %166 = inttoptr i64 %165 to ptr
  br label %167

167:                                              ; preds = %162, %160
  %168 = phi ptr [ %161, %160 ], [ %166, %162 ]
  store ptr %168, ptr %11, align 8, !tbaa !5
  %169 = load i64, ptr %8, align 8, !tbaa !9
  %170 = icmp ne i64 %169, 0
  br i1 %170, label %171, label %182

171:                                              ; preds = %167
  %172 = load ptr, ptr %11, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct._IP4_SERVICE, ptr %172, i32 0, i32 4
  store ptr %173, ptr %15, align 8, !tbaa !5
  %174 = load ptr, ptr %10, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.IP4_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT, ptr %16, i32 0, i32 0
  store ptr %174, ptr %175, align 8, !tbaa !35
  %176 = load i64, ptr %8, align 8, !tbaa !9
  %177 = getelementptr inbounds %struct.IP4_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT, ptr %16, i32 0, i32 1
  store i64 %176, ptr %177, align 8, !tbaa !37
  %178 = load ptr, ptr %9, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.IP4_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT, ptr %16, i32 0, i32 2
  store ptr %178, ptr %179, align 8, !tbaa !38
  %180 = load ptr, ptr %15, align 8, !tbaa !5
  %181 = call i64 @NetDestroyLinkList(ptr noundef %180, ptr noundef @Ip4DestroyChildEntryInHandleBuffer, ptr noundef %16, ptr noundef null)
  store i64 %181, ptr %13, align 8, !tbaa !9
  br label %293

182:                                              ; preds = %167
  %183 = load ptr, ptr %11, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct._IP4_SERVICE, ptr %183, i32 0, i32 6
  %185 = load ptr, ptr %184, align 8, !tbaa !39
  %186 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %185, i32 0, i32 12
  %187 = load ptr, ptr %186, align 8, !tbaa !40
  %188 = load ptr, ptr %7, align 8, !tbaa !5
  %189 = icmp eq ptr %187, %188
  br i1 %189, label %190, label %258

190:                                              ; preds = %182
  %191 = load ptr, ptr %11, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct._IP4_SERVICE, ptr %191, i32 0, i32 6
  %193 = load ptr, ptr %192, align 8, !tbaa !39
  call void @Ip4CancelReceive(ptr noundef %193)
  %194 = load ptr, ptr %11, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct._IP4_SERVICE, ptr %194, i32 0, i32 6
  %196 = load ptr, ptr %195, align 8, !tbaa !39
  %197 = call i64 @Ip4FreeInterface(ptr noundef %196, ptr noundef null)
  %198 = load ptr, ptr %11, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct._IP4_SERVICE, ptr %198, i32 0, i32 7
  %200 = load ptr, ptr %199, align 8, !tbaa !42
  call void @Ip4FreeRouteTable(ptr noundef %200)
  %201 = load ptr, ptr %11, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct._IP4_SERVICE, ptr %201, i32 0, i32 13
  %203 = load ptr, ptr %202, align 8, !tbaa !43
  %204 = load ptr, ptr %11, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct._IP4_SERVICE, ptr %204, i32 0, i32 11
  %206 = load ptr, ptr %205, align 8, !tbaa !44
  %207 = load ptr, ptr %11, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct._IP4_SERVICE, ptr %207, i32 0, i32 10
  %209 = load ptr, ptr %208, align 8, !tbaa !31
  %210 = call ptr @Ip4CreateInterface(ptr noundef %203, ptr noundef %206, ptr noundef %209)
  store ptr %210, ptr %17, align 8, !tbaa !5
  %211 = load ptr, ptr %17, align 8, !tbaa !5
  %212 = icmp eq ptr %211, null
  br i1 %212, label %213, label %214

213:                                              ; preds = %190
  br label %294

214:                                              ; preds = %190
  %215 = call ptr @Ip4CreateRouteTable()
  store ptr %215, ptr %18, align 8, !tbaa !5
  %216 = load ptr, ptr %18, align 8, !tbaa !5
  %217 = icmp eq ptr %216, null
  br i1 %217, label %218, label %221

218:                                              ; preds = %214
  %219 = load ptr, ptr %17, align 8, !tbaa !5
  %220 = call i64 @Ip4FreeInterface(ptr noundef %219, ptr noundef null)
  br label %294

221:                                              ; preds = %214
  %222 = load ptr, ptr %17, align 8, !tbaa !5
  %223 = load ptr, ptr %11, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct._IP4_SERVICE, ptr %223, i32 0, i32 6
  store ptr %222, ptr %224, align 8, !tbaa !39
  %225 = load ptr, ptr %11, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct._IP4_SERVICE, ptr %225, i32 0, i32 5
  %227 = load ptr, ptr %17, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %227, i32 0, i32 1
  %229 = call ptr @InsertHeadList(ptr noundef %226, ptr noundef %228)
  %230 = load ptr, ptr %18, align 8, !tbaa !5
  %231 = load ptr, ptr %11, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct._IP4_SERVICE, ptr %231, i32 0, i32 7
  store ptr %230, ptr %232, align 8, !tbaa !42
  %233 = load ptr, ptr %17, align 8, !tbaa !5
  %234 = load ptr, ptr %11, align 8, !tbaa !5
  %235 = call i64 @Ip4ReceiveFrame(ptr noundef %233, ptr noundef null, ptr noundef @Ip4AccpetFrame, ptr noundef %234)
  %236 = load ptr, ptr %11, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct._IP4_SERVICE, ptr %236, i32 0, i32 17
  %238 = load ptr, ptr %237, align 8, !tbaa !26
  %239 = icmp ne ptr %238, null
  br i1 %239, label %240, label %255

240:                                              ; preds = %221
  %241 = load ptr, ptr %11, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct._IP4_SERVICE, ptr %241, i32 0, i32 2
  %243 = load i64, ptr %242, align 8, !tbaa !27
  %244 = icmp ne i64 %243, 3
  br i1 %244, label %245, label %255

245:                                              ; preds = %240
  %246 = load ptr, ptr %11, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct._IP4_SERVICE, ptr %246, i32 0, i32 17
  %248 = load ptr, ptr %247, align 8, !tbaa !26
  %249 = getelementptr inbounds %struct._EFI_IP4_CONFIG_PROTOCOL, ptr %248, i32 0, i32 1
  %250 = load ptr, ptr %249, align 8, !tbaa !28
  %251 = load ptr, ptr %11, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct._IP4_SERVICE, ptr %251, i32 0, i32 17
  %253 = load ptr, ptr %252, align 8, !tbaa !26
  %254 = call i64 %250(ptr noundef %253)
  br label %255

255:                                              ; preds = %245, %240, %221
  %256 = load ptr, ptr %11, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct._IP4_SERVICE, ptr %256, i32 0, i32 2
  store i64 0, ptr %257, align 8, !tbaa !27
  br label %292

258:                                              ; preds = %182
  %259 = load ptr, ptr %11, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct._IP4_SERVICE, ptr %259, i32 0, i32 4
  %261 = call zeroext i8 @IsListEmpty(ptr noundef %260)
  %262 = icmp ne i8 %261, 0
  br i1 %262, label %263, label %291

263:                                              ; preds = %258
  %264 = load ptr, ptr %11, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct._IP4_SERVICE, ptr %264, i32 0, i32 2
  %266 = load i64, ptr %265, align 8, !tbaa !27
  store i64 %266, ptr %14, align 8, !tbaa !9
  %267 = load ptr, ptr %11, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct._IP4_SERVICE, ptr %267, i32 0, i32 2
  store i64 3, ptr %268, align 8, !tbaa !27
  %269 = load ptr, ptr %11, align 8, !tbaa !5
  %270 = call i64 @Ip4CleanService(ptr noundef %269)
  store i64 %270, ptr %13, align 8, !tbaa !9
  %271 = load i64, ptr %13, align 8, !tbaa !9
  %272 = icmp slt i64 %271, 0
  br i1 %272, label %273, label %277

273:                                              ; preds = %263
  %274 = load i64, ptr %14, align 8, !tbaa !9
  %275 = load ptr, ptr %11, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct._IP4_SERVICE, ptr %275, i32 0, i32 2
  store i64 %274, ptr %276, align 8, !tbaa !27
  br label %294

277:                                              ; preds = %263
  %278 = load ptr, ptr @gBS, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %278, i32 0, i32 16
  %280 = load ptr, ptr %279, align 8, !tbaa !45
  %281 = load ptr, ptr %12, align 8, !tbaa !5
  %282 = load ptr, ptr %10, align 8, !tbaa !5
  %283 = call i64 %280(ptr noundef %281, ptr noundef @gEfiIp4ServiceBindingProtocolGuid, ptr noundef %282)
  %284 = load ptr, ptr @gIp4ControllerNameTable, align 8, !tbaa !5
  %285 = icmp ne ptr %284, null
  br i1 %285, label %286, label %289

286:                                              ; preds = %277
  %287 = load ptr, ptr @gIp4ControllerNameTable, align 8, !tbaa !5
  %288 = call i64 @FreeUnicodeStringTable(ptr noundef %287)
  store ptr null, ptr @gIp4ControllerNameTable, align 8, !tbaa !5
  br label %289

289:                                              ; preds = %286, %277
  %290 = load ptr, ptr %11, align 8, !tbaa !5
  call void @FreePool(ptr noundef %290)
  br label %291

291:                                              ; preds = %289, %258
  br label %292

292:                                              ; preds = %291, %255
  br label %293

293:                                              ; preds = %292, %171
  br label %294

294:                                              ; preds = %293, %273, %218, %213
  %295 = load i64, ptr %13, align 8, !tbaa !9
  store i64 %295, ptr %5, align 8
  store i32 1, ptr %19, align 4
  br label %296

296:                                              ; preds = %294, %147, %133, %122, %95, %43
  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 24, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  %297 = load i64, ptr %5, align 8
  ret i64 %297
}

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

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

declare zeroext i8 @DebugAssertEnabled() #2

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

declare ptr @Ip4CreateRouteTable() #2

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

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

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

declare void @FreePool(ptr noundef) #2

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

declare void @Ip4FreeRouteTable(ptr noundef) #2

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

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

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

declare ptr @NetLibGetNicHandle(ptr noundef, ptr noundef) #2

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

declare void @Ip4CancelReceive(ptr noundef) #2

declare zeroext i8 @IsListEmpty(ptr noundef) #2

declare i64 @FreeUnicodeStringTable(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, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 280}
!12 = !{!"", !13, 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}
!13 = !{!"", !10, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !6, i64 40}
!16 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !6, i64 32, !6, i64 40}
!17 = !{!18, !14, i64 0}
!18 = !{!"_IP4_SERVICE", !14, i64 0, !19, i64 8, !10, i64 24, !10, i64 32, !20, i64 40, !20, i64 56, !6, i64 72, !6, i64 80, !21, i64 88, !22, i64 584, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !23, i64 640, !25, i64 660, !6, i64 1320, !6, i64 1328, !6, i64 1336, !6, i64 1344, !6, i64 1352, !14, i64 1360, !14, i64 1364}
!19 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!20 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!21 = !{!"", !7, i64 0}
!22 = !{!"", !10, i64 0, !20, i64 8}
!23 = !{!"", !14, i64 0, !14, i64 4, !24, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!24 = !{!"short", !7, i64 0}
!25 = !{!"", !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, !21, i64 552, !21, i64 584, !21, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!26 = !{!18, !6, i64 1328}
!27 = !{!18, !10, i64 24}
!28 = !{!29, !6, i64 8}
!29 = !{!"_EFI_IP4_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!30 = !{!12, !6, i64 288}
!31 = !{!18, !6, i64 608}
!32 = !{!12, !6, i64 112}
!33 = !{!18, !6, i64 1336}
!34 = !{!18, !6, i64 1344}
!35 = !{!36, !6, i64 0}
!36 = !{!"", !6, i64 0, !10, i64 8, !6, i64 16}
!37 = !{!36, !10, i64 8}
!38 = !{!36, !6, i64 16}
!39 = !{!18, !6, i64 72}
!40 = !{!41, !6, i64 88}
!41 = !{!"_IP4_INTERFACE", !14, i64 0, !20, i64 8, !10, i64 24, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44, !7, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !20, i64 96, !20, i64 112, !6, i64 128, !21, i64 136, !21, i64 168, !14, i64 200, !20, i64 208, !7, i64 224}
!42 = !{!18, !6, i64 80}
!43 = !{!18, !6, i64 632}
!44 = !{!18, !6, i64 616}
!45 = !{!12, !6, i64 144}


; 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.IP4_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT = type { ptr, i64, ptr }

@gBS = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [151 x i8], align 1
@gEfiManagedNetworkProtocolGuid = external global %struct.GUID, align 4
@gEfiIp4ConfigProtocolGuid = external global %struct.GUID, align 4
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@gEfiIp4ServiceBindingProtocolGuid = external global %struct.GUID, align 4
@gEfiArpProtocolGuid = external global %struct.GUID, align 4
@gIp4ControllerNameTable = external local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip4DriverBindingStop(ptr nocapture noundef readonly %0, ptr noundef %1, i64 noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = alloca ptr, align 8
  %6 = alloca %struct.IP4_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #3
  %7 = load ptr, ptr @gBS, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 280
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = getelementptr inbounds i8, ptr %0, i64 40
  %11 = load ptr, ptr %10, align 8, !tbaa !14
  %12 = tail call i64 %9(ptr noundef %1, ptr noundef nonnull @gEfiIp4ConfigProtocolGuid, ptr noundef null, ptr noundef %11, ptr noundef %1, i32 noundef 4) #3
  %13 = icmp eq i64 %12, 0
  br i1 %13, label %14, label %61

14:                                               ; preds = %4
  %15 = load ptr, ptr @gBS, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 280
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = load ptr, ptr %10, align 8, !tbaa !14
  %19 = call i64 %17(ptr noundef %1, ptr noundef nonnull @gEfiIp4ServiceBindingProtocolGuid, ptr noundef nonnull %5, ptr noundef %18, ptr noundef %1, i32 noundef 2) #3
  %20 = icmp slt i64 %19, 0
  br i1 %20, label %146, label %21

21:                                               ; preds = %14
  %22 = call zeroext i8 @DebugAssertEnabled() #3
  %.not88 = icmp eq i8 %22, 0
  %.pre92 = load ptr, ptr %5, align 8, !tbaa !5
  %.pre94 = ptrtoint ptr %.pre92 to i64
  %.pre95 = add i64 %.pre94, -8
  %.pre97 = inttoptr i64 %.pre95 to ptr
  br i1 %.not88, label %._crit_edge93, label %23

23:                                               ; preds = %21
  %24 = load i32, ptr %.pre97, align 8, !tbaa !16
  %.not89 = icmp eq i32 %24, 1395937353
  br i1 %.not89, label %._crit_edge93, label %25

25:                                               ; preds = %23
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 611, ptr noundef nonnull @.str.2) #3
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  br label %._crit_edge93

._crit_edge93:                                    ; preds = %21, %23, %25
  %27 = phi ptr [ %26, %25 ], [ %.pre97, %23 ], [ %.pre97, %21 ]
  %28 = getelementptr inbounds i8, ptr %27, i64 1328
  %29 = load ptr, ptr %28, align 8, !tbaa !25
  %.not90 = icmp eq ptr %29, null
  br i1 %.not90, label %146, label %30

30:                                               ; preds = %._crit_edge93
  %31 = getelementptr inbounds i8, ptr %27, i64 24
  %32 = load i64, ptr %31, align 8, !tbaa !26
  %.not91 = icmp eq i64 %32, 3
  br i1 %.not91, label %146, label %33

33:                                               ; preds = %30
  %34 = getelementptr inbounds i8, ptr %29, i64 8
  %35 = load ptr, ptr %34, align 8, !tbaa !27
  %36 = call i64 %35(ptr noundef nonnull %29) #3
  %37 = load ptr, ptr @gBS, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %37, i64 288
  %39 = load ptr, ptr %38, align 8, !tbaa !29
  %40 = getelementptr inbounds i8, ptr %27, i64 608
  %41 = load ptr, ptr %40, align 8, !tbaa !30
  %42 = call i64 %39(ptr noundef %1, ptr noundef nonnull @gEfiIp4ConfigProtocolGuid, ptr noundef %41, ptr noundef %1) #3
  %43 = icmp slt i64 %42, 0
  br i1 %43, label %146, label %44

44:                                               ; preds = %33
  %45 = load i64, ptr %31, align 8, !tbaa !26
  %46 = icmp eq i64 %45, 1
  br i1 %46, label %47, label %48

47:                                               ; preds = %44
  store i64 0, ptr %31, align 8, !tbaa !26
  br label %48

48:                                               ; preds = %47, %44
  store ptr null, ptr %28, align 8, !tbaa !25
  %49 = load ptr, ptr @gBS, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i64 112
  %51 = load ptr, ptr %50, align 8, !tbaa !31
  %52 = getelementptr inbounds i8, ptr %27, i64 1336
  %53 = load ptr, ptr %52, align 8, !tbaa !32
  %54 = call i64 %51(ptr noundef %53) #3
  %55 = load ptr, ptr @gBS, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %55, i64 112
  %57 = load ptr, ptr %56, align 8, !tbaa !31
  %58 = getelementptr inbounds i8, ptr %27, i64 1344
  %59 = load ptr, ptr %58, align 8, !tbaa !33
  %60 = call i64 %57(ptr noundef %59) #3
  br label %146

61:                                               ; preds = %4
  %62 = tail call ptr @NetLibGetNicHandle(ptr noundef %1, ptr noundef nonnull @gEfiManagedNetworkProtocolGuid) #3
  %63 = icmp eq ptr %62, null
  br i1 %63, label %64, label %67

64:                                               ; preds = %61
  %65 = tail call ptr @NetLibGetNicHandle(ptr noundef %1, ptr noundef nonnull @gEfiArpProtocolGuid) #3
  %66 = icmp eq ptr %65, null
  br i1 %66, label %146, label %67

67:                                               ; preds = %64, %61
  %.069 = phi ptr [ %65, %64 ], [ %62, %61 ]
  %68 = load ptr, ptr @gBS, align 8, !tbaa !5
  %69 = getelementptr inbounds i8, ptr %68, i64 280
  %70 = load ptr, ptr %69, align 8, !tbaa !9
  %71 = load ptr, ptr %10, align 8, !tbaa !14
  %72 = call i64 %70(ptr noundef nonnull %.069, ptr noundef nonnull @gEfiIp4ServiceBindingProtocolGuid, ptr noundef nonnull %5, ptr noundef %71, ptr noundef nonnull %.069, i32 noundef 2) #3
  %73 = icmp slt i64 %72, 0
  br i1 %73, label %146, label %74

74:                                               ; preds = %67
  %75 = call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %75, 0
  %.pre = load ptr, ptr %5, align 8, !tbaa !5
  %.pre99 = ptrtoint ptr %.pre to i64
  %.pre101 = add i64 %.pre99, -8
  %.pre103 = inttoptr i64 %.pre101 to ptr
  br i1 %.not, label %._crit_edge, label %76

76:                                               ; preds = %74
  %77 = load i32, ptr %.pre103, align 8, !tbaa !16
  %.not82 = icmp eq i32 %77, 1395937353
  br i1 %.not82, label %._crit_edge, label %78

78:                                               ; preds = %76
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 670, ptr noundef nonnull @.str.2) #3
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %74, %76, %78
  %80 = phi ptr [ %79, %78 ], [ %.pre, %76 ], [ %.pre, %74 ]
  %81 = phi ptr [ %79, %78 ], [ %.pre103, %76 ], [ %.pre103, %74 ]
  %.not83 = icmp eq i64 %2, 0
  br i1 %.not83, label %87, label %82

82:                                               ; preds = %._crit_edge
  %83 = getelementptr inbounds i8, ptr %81, i64 40
  store ptr %80, ptr %6, align 8, !tbaa !34
  %84 = getelementptr inbounds i8, ptr %6, i64 8
  store i64 %2, ptr %84, align 8, !tbaa !36
  %85 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %3, ptr %85, align 8, !tbaa !37
  %86 = call i64 @NetDestroyLinkList(ptr noundef nonnull %83, ptr noundef nonnull @Ip4DestroyChildEntryInHandleBuffer, ptr noundef nonnull %6, ptr noundef null) #3
  br label %146

87:                                               ; preds = %._crit_edge
  %88 = getelementptr inbounds i8, ptr %81, i64 72
  %89 = load ptr, ptr %88, align 8, !tbaa !38
  %90 = getelementptr inbounds i8, ptr %89, i64 88
  %91 = load ptr, ptr %90, align 8, !tbaa !39
  %92 = icmp eq ptr %91, %1
  br i1 %92, label %93, label %127

93:                                               ; preds = %87
  call void @Ip4CancelReceive(ptr noundef nonnull %89) #3
  %94 = load ptr, ptr %88, align 8, !tbaa !38
  %95 = call i64 @Ip4FreeInterface(ptr noundef %94, ptr noundef null) #3
  %96 = getelementptr inbounds i8, ptr %81, i64 80
  %97 = load ptr, ptr %96, align 8, !tbaa !41
  call void @Ip4FreeRouteTable(ptr noundef %97) #3
  %98 = getelementptr inbounds i8, ptr %81, i64 632
  %99 = load ptr, ptr %98, align 8, !tbaa !42
  %100 = getelementptr inbounds i8, ptr %81, i64 616
  %101 = load ptr, ptr %100, align 8, !tbaa !43
  %102 = getelementptr inbounds i8, ptr %81, i64 608
  %103 = load ptr, ptr %102, align 8, !tbaa !30
  %104 = call ptr @Ip4CreateInterface(ptr noundef %99, ptr noundef %101, ptr noundef %103) #3
  %105 = icmp eq ptr %104, null
  br i1 %105, label %146, label %106

106:                                              ; preds = %93
  %107 = call ptr @Ip4CreateRouteTable() #3
  %108 = icmp eq ptr %107, null
  br i1 %108, label %109, label %111

109:                                              ; preds = %106
  %110 = call i64 @Ip4FreeInterface(ptr noundef nonnull %104, ptr noundef null) #3
  br label %146

111:                                              ; preds = %106
  store ptr %104, ptr %88, align 8, !tbaa !38
  %112 = getelementptr inbounds i8, ptr %81, i64 56
  %113 = getelementptr inbounds i8, ptr %104, i64 8
  %114 = call ptr @InsertHeadList(ptr noundef nonnull %112, ptr noundef nonnull %113) #3
  store ptr %107, ptr %96, align 8, !tbaa !41
  %115 = call i64 @Ip4ReceiveFrame(ptr noundef nonnull %104, ptr noundef null, ptr noundef nonnull @Ip4AccpetFrame, ptr noundef nonnull %81) #3
  %116 = getelementptr inbounds i8, ptr %81, i64 1328
  %117 = load ptr, ptr %116, align 8, !tbaa !25
  %.not86 = icmp eq ptr %117, null
  br i1 %.not86, label %125, label %118

118:                                              ; preds = %111
  %119 = getelementptr inbounds i8, ptr %81, i64 24
  %120 = load i64, ptr %119, align 8, !tbaa !26
  %.not87 = icmp eq i64 %120, 3
  br i1 %.not87, label %125, label %121

121:                                              ; preds = %118
  %122 = getelementptr inbounds i8, ptr %117, i64 8
  %123 = load ptr, ptr %122, align 8, !tbaa !27
  %124 = call i64 %123(ptr noundef nonnull %117) #3
  br label %125

125:                                              ; preds = %121, %118, %111
  %126 = getelementptr inbounds i8, ptr %81, i64 24
  store i64 0, ptr %126, align 8, !tbaa !26
  br label %146

127:                                              ; preds = %87
  %128 = getelementptr inbounds i8, ptr %81, i64 40
  %129 = call zeroext i8 @IsListEmpty(ptr noundef nonnull %128) #3
  %.not84 = icmp eq i8 %129, 0
  br i1 %.not84, label %146, label %130

130:                                              ; preds = %127
  %131 = getelementptr inbounds i8, ptr %81, i64 24
  %132 = load i64, ptr %131, align 8, !tbaa !26
  store i64 3, ptr %131, align 8, !tbaa !26
  %133 = call i64 @Ip4CleanService(ptr noundef nonnull %81)
  %134 = icmp slt i64 %133, 0
  br i1 %134, label %135, label %136

135:                                              ; preds = %130
  store i64 %132, ptr %131, align 8, !tbaa !26
  br label %146

136:                                              ; preds = %130
  %137 = load ptr, ptr @gBS, align 8, !tbaa !5
  %138 = getelementptr inbounds i8, ptr %137, i64 144
  %139 = load ptr, ptr %138, align 8, !tbaa !44
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = call i64 %139(ptr noundef nonnull %.069, ptr noundef nonnull @gEfiIp4ServiceBindingProtocolGuid, ptr noundef %140) #3
  %142 = load ptr, ptr @gIp4ControllerNameTable, align 8, !tbaa !5
  %.not85 = icmp eq ptr %142, null
  br i1 %.not85, label %145, label %143

143:                                              ; preds = %136
  %144 = call i64 @FreeUnicodeStringTable(ptr noundef nonnull %142) #3
  store ptr null, ptr @gIp4ControllerNameTable, align 8, !tbaa !5
  br label %145

145:                                              ; preds = %143, %136
  call void @FreePool(ptr noundef nonnull %81) #3
  br label %146

146:                                              ; preds = %109, %135, %93, %125, %145, %127, %82, %67, %64, %._crit_edge93, %30, %48, %33, %14
  %.0 = phi i64 [ -9223372036854775801, %14 ], [ %42, %33 ], [ 0, %48 ], [ 0, %30 ], [ 0, %._crit_edge93 ], [ 0, %64 ], [ -9223372036854775801, %67 ], [ %86, %82 ], [ %72, %93 ], [ %72, %109 ], [ %72, %125 ], [ %133, %135 ], [ %133, %145 ], [ %72, %127 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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 @Ip4CreateRouteTable() local_unnamed_addr #2

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

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

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

declare void @FreePool(ptr noundef) local_unnamed_addr #2

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

declare void @Ip4FreeRouteTable(ptr noundef) local_unnamed_addr #2

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

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

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

declare ptr @NetLibGetNicHandle(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare void @Ip4CancelReceive(ptr noundef) local_unnamed_addr #2

declare zeroext i8 @IsListEmpty(ptr noundef) local_unnamed_addr #2

declare i64 @FreeUnicodeStringTable(ptr 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 280}
!10 = !{!"", !11, 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}
!11 = !{!"", !12, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 40}
!15 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !6, i64 32, !6, i64 40}
!16 = !{!17, !13, i64 0}
!17 = !{!"_IP4_SERVICE", !13, i64 0, !18, i64 8, !12, i64 24, !12, i64 32, !19, i64 40, !19, i64 56, !6, i64 72, !6, i64 80, !20, i64 88, !21, i64 584, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !22, i64 640, !24, i64 660, !6, i64 1320, !6, i64 1328, !6, i64 1336, !6, i64 1344, !6, i64 1352, !13, i64 1360, !13, i64 1364}
!18 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!19 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!20 = !{!"", !7, i64 0}
!21 = !{!"", !12, i64 0, !19, i64 8}
!22 = !{!"", !13, i64 0, !13, i64 4, !23, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!23 = !{!"short", !7, i64 0}
!24 = !{!"", !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, !7, i64 40, !20, i64 552, !20, i64 584, !20, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!25 = !{!17, !6, i64 1328}
!26 = !{!17, !12, i64 24}
!27 = !{!28, !6, i64 8}
!28 = !{!"_EFI_IP4_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!10, !6, i64 288}
!30 = !{!17, !6, i64 608}
!31 = !{!10, !6, i64 112}
!32 = !{!17, !6, i64 1336}
!33 = !{!17, !6, i64 1344}
!34 = !{!35, !6, i64 0}
!35 = !{!"", !6, i64 0, !12, i64 8, !6, i64 16}
!36 = !{!35, !12, i64 8}
!37 = !{!35, !6, i64 16}
!38 = !{!17, !6, i64 72}
!39 = !{!40, !6, i64 88}
!40 = !{!"_IP4_INTERFACE", !13, i64 0, !19, i64 8, !12, i64 24, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !7, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !19, i64 96, !19, i64 112, !6, i64 128, !20, i64 136, !20, i64 168, !13, i64 200, !19, i64 208, !7, i64 224}
!41 = !{!17, !6, i64 80}
!42 = !{!17, !6, i64 632}
!43 = !{!17, !6, i64 616}
!44 = !{!10, !6, i64 144}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass