; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/IntelFrameworkModulePkg (BiosSnp16DriverBindingStop)

; 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_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._EFI_PCI_IO_PROTOCOL = type { ptr, ptr, %struct.EFI_PCI_IO_PROTOCOL_ACCESS, %struct.EFI_PCI_IO_PROTOCOL_ACCESS, %struct.EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr }
%struct.EFI_PCI_IO_PROTOCOL_ACCESS = type { ptr, ptr }
%struct.EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS = type { ptr, ptr }
%struct.EFI_SIMPLE_NETWORK_DEV = type { i64, ptr, %struct._EFI_SIMPLE_NETWORK_PROTOCOL, %struct.EFI_SIMPLE_NETWORK_MODE, %struct._EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL, ptr, ptr, ptr, i8, ptr, ptr, i16, i16, %struct.EFI_SIMPLE_NETWORK_DEV_FIFO, ptr, ptr, %struct.PXENV_UNDI_GET_INFORMATION_T, %struct.PXENV_UNDI_GET_NIC_TYPE_T, %struct.PXENV_UNDI_GET_NDIS_INFO_T, i8, %struct.PXENV_UNDI_ISR_T, ptr, ptr, ptr, ptr, i8, i64, i64, i64, i64, ptr, ptr, ptr, ptr }
%struct._EFI_SIMPLE_NETWORK_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%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_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL = type { i64, i64, i64, i32, [4 x i8], i8, i8, i8, i8, i16 }
%struct.EFI_SIMPLE_NETWORK_DEV_FIFO = type { i32, i32, [64 x ptr] }
%struct.PXENV_UNDI_GET_INFORMATION_T = type { i16, i16, i16, i16, i16, i16, [16 x i8], [16 x i8], i16, i16, i16 }
%struct.PXENV_UNDI_GET_NIC_TYPE_T = type <{ i16, i8, %union.PCI_PNP_INFO_T }>
%union.PCI_PNP_INFO_T = type { %struct.PCI_INFO_T }
%struct.PCI_INFO_T = type { i16, i16, i8, i8, i8, i8, i16, i16, i16 }
%struct.PXENV_UNDI_GET_NDIS_INFO_T = type <{ i16, [16 x i8], i32, i32, [4 x i32] }>
%struct.PXENV_UNDI_ISR_T = type { i16, i16, i16, i16, i16, i16, i16, i8, i8 }

@gBS = external global ptr, align 8
@gEfiDevicePathProtocolGuid = external global %struct.GUID, align 4
@gEfiPciIoProtocolGuid = external global %struct.GUID, align 4
@gEfiSimpleNetworkProtocolGuid = external global %struct.GUID, align 4
@gEfiNetworkInterfaceIdentifierProtocolGuid = external global %struct.GUID, align 4
@.str.29 = external hidden unnamed_addr constant [160 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @BiosSnp16DriverBindingStop(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 i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i8, align 1
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = 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 1, 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 8, ptr %16) #3
  %18 = load i64, ptr %8, align 8, !tbaa !9
  %19 = icmp eq i64 %18, 0
  br i1 %19, label %20, label %74

20:                                               ; preds = %4
  %21 = load ptr, ptr @gBS, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %21, i32 0, i32 33
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %25, i32 0, i32 5
  %27 = load ptr, ptr %26, align 8, !tbaa !15
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = call i64 %23(ptr noundef %24, ptr noundef @gEfiPciIoProtocolGuid, ptr noundef %15, ptr noundef %27, ptr noundef %28, i32 noundef 2)
  store i64 %29, ptr %10, align 8, !tbaa !9
  %30 = load i64, ptr %10, align 8, !tbaa !9
  %31 = icmp slt i64 %30, 0
  br i1 %31, label %50, label %32

32:                                               ; preds = %20
  %33 = load ptr, ptr %15, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct._EFI_PCI_IO_PROTOCOL, ptr %33, i32 0, i32 12
  %35 = load ptr, ptr %34, align 8, !tbaa !17
  %36 = load ptr, ptr %15, align 8, !tbaa !5
  %37 = call i64 %35(ptr noundef %36, i32 noundef 4, i64 noundef 0, ptr noundef %16)
  store i64 %37, ptr %10, align 8, !tbaa !9
  %38 = load i64, ptr %10, align 8, !tbaa !9
  %39 = icmp slt i64 %38, 0
  br i1 %39, label %49, label %40

40:                                               ; preds = %32
  %41 = load i64, ptr %16, align 8, !tbaa !9
  %42 = and i64 %41, 1792
  store i64 %42, ptr %16, align 8, !tbaa !9
  %43 = load ptr, ptr %15, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._EFI_PCI_IO_PROTOCOL, ptr %43, i32 0, i32 12
  %45 = load ptr, ptr %44, align 8, !tbaa !17
  %46 = load ptr, ptr %15, align 8, !tbaa !5
  %47 = load i64, ptr %16, align 8, !tbaa !9
  %48 = call i64 %45(ptr noundef %46, i32 noundef 3, i64 noundef %47, ptr noundef null)
  store i64 %48, ptr %10, align 8, !tbaa !9
  br label %49

49:                                               ; preds = %40, %32
  br label %50

50:                                               ; preds = %49, %20
  %51 = load ptr, ptr @gBS, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %51, i32 0, i32 34
  %53 = load ptr, ptr %52, align 8, !tbaa !20
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %55, i32 0, i32 5
  %57 = load ptr, ptr %56, align 8, !tbaa !15
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = call i64 %53(ptr noundef %54, ptr noundef @gEfiPciIoProtocolGuid, ptr noundef %57, ptr noundef %58)
  store i64 %59, ptr %10, align 8, !tbaa !9
  %60 = load ptr, ptr @gBS, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %60, i32 0, i32 34
  %62 = load ptr, ptr %61, align 8, !tbaa !20
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %64, i32 0, i32 5
  %66 = load ptr, ptr %65, align 8, !tbaa !15
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = call i64 %62(ptr noundef %63, ptr noundef @gEfiDevicePathProtocolGuid, ptr noundef %66, ptr noundef %67)
  store i64 %68, ptr %10, align 8, !tbaa !9
  %69 = load i64, ptr %10, align 8, !tbaa !9
  %70 = icmp slt i64 %69, 0
  br i1 %70, label %71, label %72

71:                                               ; preds = %50
  store i64 -9223372036854775801, ptr %10, align 8, !tbaa !9
  br label %72

72:                                               ; preds = %71, %50
  %73 = load i64, ptr %10, align 8, !tbaa !9
  store i64 %73, ptr %5, align 8
  store i32 1, ptr %17, align 4
  br label %288

74:                                               ; preds = %4
  store i8 1, ptr %12, align 1, !tbaa !21
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %75

75:                                               ; preds = %280, %74
  %76 = load i64, ptr %11, align 8, !tbaa !9
  %77 = load i64, ptr %8, align 8, !tbaa !9
  %78 = icmp ult i64 %76, %77
  br i1 %78, label %79, label %283

79:                                               ; preds = %75
  %80 = load ptr, ptr @gBS, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %80, i32 0, i32 33
  %82 = load ptr, ptr %81, align 8, !tbaa !11
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = load i64, ptr %11, align 8, !tbaa !9
  %85 = getelementptr inbounds ptr, ptr %83, i64 %84
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %87, i32 0, i32 5
  %89 = load ptr, ptr %88, align 8, !tbaa !15
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  %91 = call i64 %82(ptr noundef %86, ptr noundef @gEfiSimpleNetworkProtocolGuid, ptr noundef %13, ptr noundef %89, ptr noundef %90, i32 noundef 2)
  store i64 %91, ptr %10, align 8, !tbaa !9
  %92 = load i64, ptr %10, align 8, !tbaa !9
  %93 = icmp slt i64 %92, 0
  br i1 %93, label %275, label %94

94:                                               ; preds = %79
  %95 = call zeroext i8 @DebugAssertEnabled()
  %96 = zext i8 %95 to i32
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %108

98:                                               ; preds = %94
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = ptrtoint ptr %99 to i64
  %101 = sub i64 %100, ptrtoint (ptr getelementptr inbounds (%struct.EFI_SIMPLE_NETWORK_DEV, ptr null, i32 0, i32 2) to i64)
  %102 = inttoptr i64 %101 to ptr
  %103 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %102, i32 0, i32 0
  %104 = load i64, ptr %103, align 8, !tbaa !22
  %105 = icmp ne i64 %104, 909209203
  br i1 %105, label %106, label %108

106:                                              ; preds = %98
  call void @DebugAssert(ptr noundef @.str.29, i64 noundef 923, ptr noundef @.str.30)
  %107 = load ptr, ptr %13, align 8, !tbaa !5
  br label %113

108:                                              ; preds = %98, %94
  %109 = load ptr, ptr %13, align 8, !tbaa !5
  %110 = ptrtoint ptr %109 to i64
  %111 = sub i64 %110, ptrtoint (ptr getelementptr inbounds (%struct.EFI_SIMPLE_NETWORK_DEV, ptr null, i32 0, i32 2) to i64)
  %112 = inttoptr i64 %111 to ptr
  br label %113

113:                                              ; preds = %108, %106
  %114 = phi ptr [ %107, %106 ], [ %112, %108 ]
  store ptr %114, ptr %14, align 8, !tbaa !5
  %115 = load ptr, ptr @gBS, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %115, i32 0, i32 34
  %117 = load ptr, ptr %116, align 8, !tbaa !20
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %119, i32 0, i32 5
  %121 = load ptr, ptr %120, align 8, !tbaa !15
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = load i64, ptr %11, align 8, !tbaa !9
  %124 = getelementptr inbounds ptr, ptr %122, i64 %123
  %125 = load ptr, ptr %124, align 8, !tbaa !5
  %126 = call i64 %117(ptr noundef %118, ptr noundef @gEfiPciIoProtocolGuid, ptr noundef %121, ptr noundef %125)
  store i64 %126, ptr %10, align 8, !tbaa !9
  %127 = load ptr, ptr @gBS, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %127, i32 0, i32 40
  %129 = load ptr, ptr %128, align 8, !tbaa !34
  %130 = load ptr, ptr %14, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %130, i32 0, i32 1
  %132 = load ptr, ptr %131, align 8, !tbaa !35
  %133 = load ptr, ptr %14, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %133, i32 0, i32 2
  %135 = load ptr, ptr %14, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %135, i32 0, i32 4
  %137 = load ptr, ptr %14, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %137, i32 0, i32 5
  %139 = load ptr, ptr %138, align 8, !tbaa !36
  %140 = call i64 (ptr, ...) %129(ptr noundef %132, ptr noundef @gEfiSimpleNetworkProtocolGuid, ptr noundef %134, ptr noundef @gEfiNetworkInterfaceIdentifierProtocolGuid, ptr noundef %136, ptr noundef @gEfiDevicePathProtocolGuid, ptr noundef %139, ptr noundef null)
  store i64 %140, ptr %10, align 8, !tbaa !9
  %141 = load i64, ptr %10, align 8, !tbaa !9
  %142 = icmp slt i64 %141, 0
  br i1 %142, label %143, label %156

143:                                              ; preds = %113
  %144 = load ptr, ptr @gBS, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %144, i32 0, i32 33
  %146 = load ptr, ptr %145, align 8, !tbaa !11
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %148, i32 0, i32 5
  %150 = load ptr, ptr %149, align 8, !tbaa !15
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = load i64, ptr %11, align 8, !tbaa !9
  %153 = getelementptr inbounds ptr, ptr %151, i64 %152
  %154 = load ptr, ptr %153, align 8, !tbaa !5
  %155 = call i64 %146(ptr noundef %147, ptr noundef @gEfiPciIoProtocolGuid, ptr noundef %15, ptr noundef %150, ptr noundef %154, i32 noundef 8)
  br label %274

156:                                              ; preds = %113
  %157 = load ptr, ptr %14, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %157, i32 0, i32 2
  %159 = call i64 @Undi16SimpleNetworkShutdown(ptr noundef %158)
  %160 = load ptr, ptr %14, align 8, !tbaa !5
  %161 = call i64 @Undi16SimpleNetworkCleanupUndi(ptr noundef %160)
  %162 = load ptr, ptr %14, align 8, !tbaa !5
  %163 = call i64 @Undi16SimpleNetworkStopUndi(ptr noundef %162)
  %164 = load ptr, ptr %14, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %164, i32 0, i32 8
  %166 = load i8, ptr %165, align 8, !tbaa !37
  %167 = icmp ne i8 %166, 0
  br i1 %167, label %168, label %171

168:                                              ; preds = %156
  %169 = load ptr, ptr %14, align 8, !tbaa !5
  %170 = call i64 @Undi16SimpleNetworkUnloadUndi(ptr noundef %169)
  br label %171

171:                                              ; preds = %168, %156
  %172 = load ptr, ptr %14, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %172, i32 0, i32 2
  %174 = getelementptr inbounds %struct._EFI_SIMPLE_NETWORK_PROTOCOL, ptr %173, i32 0, i32 14
  %175 = load ptr, ptr %174, align 8, !tbaa !38
  %176 = icmp ne ptr %175, null
  br i1 %176, label %177, label %186

177:                                              ; preds = %171
  %178 = load ptr, ptr @gBS, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %178, i32 0, i32 12
  %180 = load ptr, ptr %179, align 8, !tbaa !39
  %181 = load ptr, ptr %14, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %181, i32 0, i32 2
  %183 = getelementptr inbounds %struct._EFI_SIMPLE_NETWORK_PROTOCOL, ptr %182, i32 0, i32 14
  %184 = load ptr, ptr %183, align 8, !tbaa !38
  %185 = call i64 %180(ptr noundef %184)
  br label %186

186:                                              ; preds = %177, %171
  %187 = load ptr, ptr %14, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %187, i32 0, i32 10
  %189 = load ptr, ptr %188, align 8, !tbaa !40
  %190 = icmp ne ptr %189, null
  br i1 %190, label %191, label %199

191:                                              ; preds = %186
  %192 = load ptr, ptr @gBS, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %192, i32 0, i32 12
  %194 = load ptr, ptr %193, align 8, !tbaa !39
  %195 = load ptr, ptr %14, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %195, i32 0, i32 10
  %197 = load ptr, ptr %196, align 8, !tbaa !40
  %198 = call i64 %194(ptr noundef %197)
  br label %199

199:                                              ; preds = %191, %186
  %200 = load ptr, ptr %14, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %200, i32 0, i32 9
  %202 = load ptr, ptr %201, align 8, !tbaa !41
  %203 = icmp ne ptr %202, null
  br i1 %203, label %204, label %212

204:                                              ; preds = %199
  %205 = load ptr, ptr @gBS, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %205, i32 0, i32 12
  %207 = load ptr, ptr %206, align 8, !tbaa !39
  %208 = load ptr, ptr %14, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %208, i32 0, i32 9
  %210 = load ptr, ptr %209, align 8, !tbaa !41
  %211 = call i64 %207(ptr noundef %210)
  br label %212

212:                                              ; preds = %204, %199
  %213 = load ptr, ptr %14, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %213, i32 0, i32 21
  %215 = load ptr, ptr %214, align 8, !tbaa !42
  %216 = icmp ne ptr %215, null
  br i1 %216, label %217, label %226

217:                                              ; preds = %212
  %218 = load ptr, ptr @gBS, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %218, i32 0, i32 4
  %220 = load ptr, ptr %219, align 8, !tbaa !43
  %221 = load ptr, ptr %14, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %221, i32 0, i32 21
  %223 = load ptr, ptr %222, align 8, !tbaa !42
  %224 = ptrtoint ptr %223 to i64
  %225 = call i64 %220(i64 noundef %224, i64 noundef 1)
  br label %226

226:                                              ; preds = %217, %212
  %227 = load ptr, ptr %14, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %227, i32 0, i32 22
  %229 = load ptr, ptr %228, align 8, !tbaa !44
  %230 = icmp ne ptr %229, null
  br i1 %230, label %231, label %240

231:                                              ; preds = %226
  %232 = load ptr, ptr @gBS, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %232, i32 0, i32 4
  %234 = load ptr, ptr %233, align 8, !tbaa !43
  %235 = load ptr, ptr %14, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %235, i32 0, i32 22
  %237 = load ptr, ptr %236, align 8, !tbaa !44
  %238 = ptrtoint ptr %237 to i64
  %239 = call i64 %234(i64 noundef %238, i64 noundef 1)
  br label %240

240:                                              ; preds = %231, %226
  %241 = load ptr, ptr %14, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %241, i32 0, i32 23
  %243 = load ptr, ptr %242, align 8, !tbaa !45
  %244 = icmp ne ptr %243, null
  br i1 %244, label %245, label %254

245:                                              ; preds = %240
  %246 = load ptr, ptr @gBS, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %246, i32 0, i32 4
  %248 = load ptr, ptr %247, align 8, !tbaa !43
  %249 = load ptr, ptr %14, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %249, i32 0, i32 23
  %251 = load ptr, ptr %250, align 8, !tbaa !45
  %252 = ptrtoint ptr %251 to i64
  %253 = call i64 %248(i64 noundef %252, i64 noundef 1)
  br label %254

254:                                              ; preds = %245, %240
  %255 = load ptr, ptr %14, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %255, i32 0, i32 24
  %257 = load ptr, ptr %256, align 8, !tbaa !46
  %258 = icmp ne ptr %257, null
  br i1 %258, label %259, label %268

259:                                              ; preds = %254
  %260 = load ptr, ptr @gBS, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %260, i32 0, i32 4
  %262 = load ptr, ptr %261, align 8, !tbaa !43
  %263 = load ptr, ptr %14, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %263, i32 0, i32 24
  %265 = load ptr, ptr %264, align 8, !tbaa !46
  %266 = ptrtoint ptr %265 to i64
  %267 = call i64 %262(i64 noundef %266, i64 noundef 1)
  br label %268

268:                                              ; preds = %259, %254
  %269 = load ptr, ptr @gBS, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %269, i32 0, i32 7
  %271 = load ptr, ptr %270, align 8, !tbaa !47
  %272 = load ptr, ptr %14, align 8, !tbaa !5
  %273 = call i64 %271(ptr noundef %272)
  br label %274

274:                                              ; preds = %268, %143
  br label %275

275:                                              ; preds = %274, %79
  %276 = load i64, ptr %10, align 8, !tbaa !9
  %277 = icmp slt i64 %276, 0
  br i1 %277, label %278, label %279

278:                                              ; preds = %275
  store i8 0, ptr %12, align 1, !tbaa !21
  br label %279

279:                                              ; preds = %278, %275
  br label %280

280:                                              ; preds = %279
  %281 = load i64, ptr %11, align 8, !tbaa !9
  %282 = add i64 %281, 1
  store i64 %282, ptr %11, align 8, !tbaa !9
  br label %75, !llvm.loop !48

283:                                              ; preds = %75
  %284 = load i8, ptr %12, align 1, !tbaa !21
  %285 = icmp ne i8 %284, 0
  br i1 %285, label %287, label %286

286:                                              ; preds = %283
  store i64 -9223372036854775801, ptr %5, align 8
  store i32 1, ptr %17, align 4
  br label %288

287:                                              ; preds = %283
  store i64 0, ptr %5, align 8
  store i32 1, ptr %17, align 4
  br label %288

288:                                              ; preds = %287, %286, %72
  call void @llvm.lifetime.end.p0(i64 8, 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 1, 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
  %289 = load i64, ptr %5, align 8
  ret i64 %289
}

; 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

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

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

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

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

declare zeroext i8 @DebugAssertEnabled() #2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !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, !6, i64 120}
!18 = !{!"_EFI_PCI_IO_PROTOCOL", !6, i64 0, !6, i64 8, !19, i64 16, !19, i64 32, !19, i64 48, !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, !10, i64 144, !6, i64 152}
!19 = !{!"", !6, i64 0, !6, i64 8}
!20 = !{!12, !6, i64 288}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !10, i64 0}
!23 = !{!"", !10, i64 0, !6, i64 8, !24, i64 16, !25, i64 144, !27, i64 800, !6, i64 840, !6, i64 848, !6, i64 856, !7, i64 864, !6, i64 872, !6, i64 880, !28, i64 888, !28, i64 890, !29, i64 896, !6, i64 1416, !6, i64 1424, !30, i64 1432, !31, i64 1482, !32, i64 1499, !7, i64 1541, !33, i64 1542, !6, i64 1560, !6, i64 1568, !6, i64 1576, !6, i64 1584, !7, i64 1592, !10, i64 1600, !10, i64 1608, !10, i64 1616, !10, i64 1624, !6, i64 1632, !6, i64 1640, !6, i64 1648, !6, i64 1656}
!24 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !10, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!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, !26, i64 552, !26, i64 584, !26, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!26 = !{!"", !7, i64 0}
!27 = !{!"_EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !14, i64 24, !7, i64 28, !7, i64 32, !7, i64 33, !7, i64 34, !7, i64 35, !28, i64 36}
!28 = !{!"short", !7, i64 0}
!29 = !{!"", !14, i64 0, !14, i64 4, !7, i64 8}
!30 = !{!"", !28, i64 0, !28, i64 2, !28, i64 4, !28, i64 6, !28, i64 8, !28, i64 10, !7, i64 12, !7, i64 28, !28, i64 44, !28, i64 46, !28, i64 48}
!31 = !{!"", !28, i64 0, !7, i64 2, !7, i64 3}
!32 = !{!"", !28, i64 0, !7, i64 2, !14, i64 18, !14, i64 22, !7, i64 26}
!33 = !{!"", !28, i64 0, !28, i64 2, !28, i64 4, !28, i64 6, !28, i64 8, !28, i64 10, !28, i64 12, !7, i64 14, !7, i64 15}
!34 = !{!12, !6, i64 336}
!35 = !{!23, !6, i64 8}
!36 = !{!23, !6, i64 840}
!37 = !{!23, !7, i64 864}
!38 = !{!23, !6, i64 128}
!39 = !{!12, !6, i64 112}
!40 = !{!23, !6, i64 880}
!41 = !{!23, !6, i64 872}
!42 = !{!23, !6, i64 1560}
!43 = !{!12, !6, i64 48}
!44 = !{!23, !6, i64 1568}
!45 = !{!23, !6, i64 1576}
!46 = !{!23, !6, i64 1584}
!47 = !{!12, !6, i64 72}
!48 = distinct !{!48, !49}
!49 = !{!"llvm.loop.mustprogress"}


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

%struct.GUID = type { i32, i16, i16, [8 x i8] }

@gBS = external local_unnamed_addr global ptr, align 8
@gEfiDevicePathProtocolGuid = external global %struct.GUID, align 4
@gEfiPciIoProtocolGuid = external global %struct.GUID, align 4
@gEfiSimpleNetworkProtocolGuid = external global %struct.GUID, align 4
@gEfiNetworkInterfaceIdentifierProtocolGuid = external global %struct.GUID, align 4
@.str.29 = external hidden unnamed_addr constant [160 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @BiosSnp16DriverBindingStop(ptr nocapture noundef readonly %0, ptr noundef %1, i64 noundef %2, ptr nocapture noundef readonly %3) local_unnamed_addr #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  %8 = icmp eq i64 %2, 0
  br i1 %8, label %10, label %.preheader

.preheader:                                       ; preds = %4
  %9 = getelementptr inbounds i8, ptr %0, i64 40
  br label %43

10:                                               ; preds = %4
  %11 = load ptr, ptr @gBS, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %11, i64 280
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %14 = getelementptr inbounds i8, ptr %0, i64 40
  %15 = load ptr, ptr %14, align 8, !tbaa !14
  %16 = call i64 %13(ptr noundef %1, ptr noundef nonnull @gEfiPciIoProtocolGuid, ptr noundef nonnull %6, ptr noundef %15, ptr noundef %1, i32 noundef 2) #3
  %17 = icmp slt i64 %16, 0
  br i1 %17, label %31, label %18

18:                                               ; preds = %10
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 120
  %21 = load ptr, ptr %20, align 8, !tbaa !16
  %22 = call i64 %21(ptr noundef %19, i32 noundef 4, i64 noundef 0, ptr noundef nonnull %7) #3
  %23 = icmp slt i64 %22, 0
  br i1 %23, label %31, label %24

24:                                               ; preds = %18
  %25 = load i64, ptr %7, align 8, !tbaa !19
  %26 = and i64 %25, 1792
  store i64 %26, ptr %7, align 8, !tbaa !19
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %27, i64 120
  %29 = load ptr, ptr %28, align 8, !tbaa !16
  %30 = call i64 %29(ptr noundef %27, i32 noundef 3, i64 noundef %26, ptr noundef null) #3
  br label %31

31:                                               ; preds = %18, %24, %10
  %32 = load ptr, ptr @gBS, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 288
  %34 = load ptr, ptr %33, align 8, !tbaa !20
  %35 = load ptr, ptr %14, align 8, !tbaa !14
  %36 = call i64 %34(ptr noundef %1, ptr noundef nonnull @gEfiPciIoProtocolGuid, ptr noundef %35, ptr noundef %1) #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 !20
  %40 = load ptr, ptr %14, align 8, !tbaa !14
  %41 = call i64 %39(ptr noundef %1, ptr noundef nonnull @gEfiDevicePathProtocolGuid, ptr noundef %40, ptr noundef %1) #3
  %42 = icmp slt i64 %41, 0
  %spec.store.select = select i1 %42, i64 -9223372036854775801, i64 %41
  br label %160

43:                                               ; preds = %.preheader, %156
  %.05783 = phi i8 [ 1, %.preheader ], [ %157, %156 ]
  %.05882 = phi i64 [ 0, %.preheader ], [ %158, %156 ]
  %44 = load ptr, ptr @gBS, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %44, i64 280
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  %47 = getelementptr inbounds ptr, ptr %3, i64 %.05882
  %48 = load ptr, ptr %47, align 8, !tbaa !5
  %49 = load ptr, ptr %9, align 8, !tbaa !14
  %50 = call i64 %46(ptr noundef %48, ptr noundef nonnull @gEfiSimpleNetworkProtocolGuid, ptr noundef nonnull %5, ptr noundef %49, ptr noundef %1, i32 noundef 2) #3
  %51 = icmp slt i64 %50, 0
  br i1 %51, label %156, label %52

52:                                               ; preds = %43
  %53 = call zeroext i8 @DebugAssertEnabled() #3
  %.not71 = icmp eq i8 %53, 0
  %.pre = load ptr, ptr %5, align 8, !tbaa !5
  %.pre84 = ptrtoint ptr %.pre to i64
  %.pre85 = add i64 %.pre84, -16
  %.pre87 = inttoptr i64 %.pre85 to ptr
  br i1 %.not71, label %._crit_edge, label %54

54:                                               ; preds = %52
  %55 = load i64, ptr %.pre87, align 8, !tbaa !21
  %.not72 = icmp eq i64 %55, 909209203
  br i1 %.not72, label %._crit_edge, label %56

56:                                               ; preds = %54
  call void @DebugAssert(ptr noundef nonnull @.str.29, i64 noundef 923, ptr noundef nonnull @.str.30) #3
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %52, %54, %56
  %58 = phi ptr [ %57, %56 ], [ %.pre87, %54 ], [ %.pre87, %52 ]
  %59 = load ptr, ptr @gBS, align 8, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %59, i64 288
  %61 = load ptr, ptr %60, align 8, !tbaa !20
  %62 = load ptr, ptr %9, align 8, !tbaa !14
  %63 = load ptr, ptr %47, align 8, !tbaa !5
  %64 = call i64 %61(ptr noundef %1, ptr noundef nonnull @gEfiPciIoProtocolGuid, ptr noundef %62, ptr noundef %63) #3
  %65 = load ptr, ptr @gBS, align 8, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %65, i64 336
  %67 = load ptr, ptr %66, align 8, !tbaa !33
  %68 = getelementptr inbounds i8, ptr %58, i64 8
  %69 = load ptr, ptr %68, align 8, !tbaa !34
  %70 = getelementptr inbounds i8, ptr %58, i64 16
  %71 = getelementptr inbounds i8, ptr %58, i64 800
  %72 = getelementptr inbounds i8, ptr %58, i64 840
  %73 = load ptr, ptr %72, align 8, !tbaa !35
  %74 = call i64 (ptr, ...) %67(ptr noundef %69, ptr noundef nonnull @gEfiSimpleNetworkProtocolGuid, ptr noundef nonnull %70, ptr noundef nonnull @gEfiNetworkInterfaceIdentifierProtocolGuid, ptr noundef nonnull %71, ptr noundef nonnull @gEfiDevicePathProtocolGuid, ptr noundef %73, ptr noundef null) #3
  %75 = icmp slt i64 %74, 0
  br i1 %75, label %76, label %83

76:                                               ; preds = %._crit_edge
  %77 = load ptr, ptr @gBS, align 8, !tbaa !5
  %78 = getelementptr inbounds i8, ptr %77, i64 280
  %79 = load ptr, ptr %78, align 8, !tbaa !9
  %80 = load ptr, ptr %9, align 8, !tbaa !14
  %81 = load ptr, ptr %47, align 8, !tbaa !5
  %82 = call i64 %79(ptr noundef %1, ptr noundef nonnull @gEfiPciIoProtocolGuid, ptr noundef nonnull %6, ptr noundef %80, ptr noundef %81, i32 noundef 8) #3
  br label %156

83:                                               ; preds = %._crit_edge
  %84 = call i64 @Undi16SimpleNetworkShutdown(ptr noundef nonnull %70)
  %85 = call i64 @Undi16SimpleNetworkCleanupUndi(ptr noundef nonnull %58)
  %86 = call i64 @Undi16SimpleNetworkStopUndi(ptr noundef nonnull %58)
  %87 = getelementptr inbounds i8, ptr %58, i64 864
  %88 = load i8, ptr %87, align 8, !tbaa !36
  %.not73 = icmp eq i8 %88, 0
  br i1 %.not73, label %91, label %89

89:                                               ; preds = %83
  %90 = call i64 @Undi16SimpleNetworkUnloadUndi(ptr noundef nonnull %58)
  br label %91

91:                                               ; preds = %89, %83
  %92 = getelementptr inbounds i8, ptr %58, i64 128
  %93 = load ptr, ptr %92, align 8, !tbaa !37
  %.not74 = icmp eq ptr %93, null
  br i1 %.not74, label %99, label %94

94:                                               ; preds = %91
  %95 = load ptr, ptr @gBS, align 8, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %95, i64 112
  %97 = load ptr, ptr %96, align 8, !tbaa !38
  %98 = call i64 %97(ptr noundef nonnull %93) #3
  br label %99

99:                                               ; preds = %94, %91
  %100 = getelementptr inbounds i8, ptr %58, i64 880
  %101 = load ptr, ptr %100, align 8, !tbaa !39
  %.not75 = icmp eq ptr %101, null
  br i1 %.not75, label %107, label %102

102:                                              ; preds = %99
  %103 = load ptr, ptr @gBS, align 8, !tbaa !5
  %104 = getelementptr inbounds i8, ptr %103, i64 112
  %105 = load ptr, ptr %104, align 8, !tbaa !38
  %106 = call i64 %105(ptr noundef nonnull %101) #3
  br label %107

107:                                              ; preds = %102, %99
  %108 = getelementptr inbounds i8, ptr %58, i64 872
  %109 = load ptr, ptr %108, align 8, !tbaa !40
  %.not76 = icmp eq ptr %109, null
  br i1 %.not76, label %115, label %110

110:                                              ; preds = %107
  %111 = load ptr, ptr @gBS, align 8, !tbaa !5
  %112 = getelementptr inbounds i8, ptr %111, i64 112
  %113 = load ptr, ptr %112, align 8, !tbaa !38
  %114 = call i64 %113(ptr noundef nonnull %109) #3
  br label %115

115:                                              ; preds = %110, %107
  %116 = getelementptr inbounds i8, ptr %58, i64 1560
  %117 = load ptr, ptr %116, align 8, !tbaa !41
  %.not77 = icmp eq ptr %117, null
  br i1 %.not77, label %124, label %118

118:                                              ; preds = %115
  %119 = load ptr, ptr @gBS, align 8, !tbaa !5
  %120 = getelementptr inbounds i8, ptr %119, i64 48
  %121 = load ptr, ptr %120, align 8, !tbaa !42
  %122 = ptrtoint ptr %117 to i64
  %123 = call i64 %121(i64 noundef %122, i64 noundef 1) #3
  br label %124

124:                                              ; preds = %118, %115
  %125 = getelementptr inbounds i8, ptr %58, i64 1568
  %126 = load ptr, ptr %125, align 8, !tbaa !43
  %.not78 = icmp eq ptr %126, null
  br i1 %.not78, label %133, label %127

127:                                              ; preds = %124
  %128 = load ptr, ptr @gBS, align 8, !tbaa !5
  %129 = getelementptr inbounds i8, ptr %128, i64 48
  %130 = load ptr, ptr %129, align 8, !tbaa !42
  %131 = ptrtoint ptr %126 to i64
  %132 = call i64 %130(i64 noundef %131, i64 noundef 1) #3
  br label %133

133:                                              ; preds = %127, %124
  %134 = getelementptr inbounds i8, ptr %58, i64 1576
  %135 = load ptr, ptr %134, align 8, !tbaa !44
  %.not79 = icmp eq ptr %135, null
  br i1 %.not79, label %142, label %136

136:                                              ; preds = %133
  %137 = load ptr, ptr @gBS, align 8, !tbaa !5
  %138 = getelementptr inbounds i8, ptr %137, i64 48
  %139 = load ptr, ptr %138, align 8, !tbaa !42
  %140 = ptrtoint ptr %135 to i64
  %141 = call i64 %139(i64 noundef %140, i64 noundef 1) #3
  br label %142

142:                                              ; preds = %136, %133
  %143 = getelementptr inbounds i8, ptr %58, i64 1584
  %144 = load ptr, ptr %143, align 8, !tbaa !45
  %.not80 = icmp eq ptr %144, null
  br i1 %.not80, label %151, label %145

145:                                              ; preds = %142
  %146 = load ptr, ptr @gBS, align 8, !tbaa !5
  %147 = getelementptr inbounds i8, ptr %146, i64 48
  %148 = load ptr, ptr %147, align 8, !tbaa !42
  %149 = ptrtoint ptr %144 to i64
  %150 = call i64 %148(i64 noundef %149, i64 noundef 1) #3
  br label %151

151:                                              ; preds = %142, %145
  %152 = load ptr, ptr @gBS, align 8, !tbaa !5
  %153 = getelementptr inbounds i8, ptr %152, i64 72
  %154 = load ptr, ptr %153, align 8, !tbaa !46
  %155 = call i64 %154(ptr noundef nonnull %58) #3
  br label %156

156:                                              ; preds = %76, %43, %151
  %157 = phi i8 [ %.05783, %151 ], [ 0, %43 ], [ 0, %76 ]
  %158 = add nuw i64 %.05882, 1
  %exitcond.not = icmp eq i64 %158, %2
  br i1 %exitcond.not, label %159, label %43, !llvm.loop !47

159:                                              ; preds = %156
  %.not = icmp eq i8 %157, 0
  %. = select i1 %.not, i64 -9223372036854775801, i64 0
  br label %160

160:                                              ; preds = %159, %31
  %.0 = phi i64 [ %spec.store.select, %31 ], [ %., %159 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, 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

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

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

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

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

declare void @DebugAssert(ptr noundef, i64 noundef, 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, !6, i64 120}
!17 = !{!"_EFI_PCI_IO_PROTOCOL", !6, i64 0, !6, i64 8, !18, i64 16, !18, i64 32, !18, i64 48, !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, !12, i64 144, !6, i64 152}
!18 = !{!"", !6, i64 0, !6, i64 8}
!19 = !{!12, !12, i64 0}
!20 = !{!10, !6, i64 288}
!21 = !{!22, !12, i64 0}
!22 = !{!"", !12, i64 0, !6, i64 8, !23, i64 16, !24, i64 144, !26, i64 800, !6, i64 840, !6, i64 848, !6, i64 856, !7, i64 864, !6, i64 872, !6, i64 880, !27, i64 888, !27, i64 890, !28, i64 896, !6, i64 1416, !6, i64 1424, !29, i64 1432, !30, i64 1482, !31, i64 1499, !7, i64 1541, !32, i64 1542, !6, i64 1560, !6, i64 1568, !6, i64 1576, !6, i64 1584, !7, i64 1592, !12, i64 1600, !12, i64 1608, !12, i64 1616, !12, i64 1624, !6, i64 1632, !6, i64 1640, !6, i64 1648, !6, i64 1656}
!23 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!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, !25, i64 552, !25, i64 584, !25, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!25 = !{!"", !7, i64 0}
!26 = !{!"_EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL", !12, i64 0, !12, i64 8, !12, i64 16, !13, i64 24, !7, i64 28, !7, i64 32, !7, i64 33, !7, i64 34, !7, i64 35, !27, i64 36}
!27 = !{!"short", !7, i64 0}
!28 = !{!"", !13, i64 0, !13, i64 4, !7, i64 8}
!29 = !{!"", !27, i64 0, !27, i64 2, !27, i64 4, !27, i64 6, !27, i64 8, !27, i64 10, !7, i64 12, !7, i64 28, !27, i64 44, !27, i64 46, !27, i64 48}
!30 = !{!"", !27, i64 0, !7, i64 2, !7, i64 3}
!31 = !{!"", !27, i64 0, !7, i64 2, !13, i64 18, !13, i64 22, !7, i64 26}
!32 = !{!"", !27, i64 0, !27, i64 2, !27, i64 4, !27, i64 6, !27, i64 8, !27, i64 10, !27, i64 12, !7, i64 14, !7, i64 15}
!33 = !{!10, !6, i64 336}
!34 = !{!22, !6, i64 8}
!35 = !{!22, !6, i64 840}
!36 = !{!22, !7, i64 864}
!37 = !{!22, !6, i64 128}
!38 = !{!10, !6, i64 112}
!39 = !{!22, !6, i64 880}
!40 = !{!22, !6, i64 872}
!41 = !{!22, !6, i64 1560}
!42 = !{!10, !6, i64 48}
!43 = !{!22, !6, i64 1568}
!44 = !{!22, !6, i64 1576}
!45 = !{!22, !6, i64 1584}
!46 = !{!10, !6, i64 72}
!47 = distinct !{!47, !48}
!48 = !{!"llvm.loop.mustprogress"}


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