; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/OptionRomPkg/Bus/Usb (GetStatus)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.EFI_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_SIMPLE_NETWORK_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.NIC_DEVICE = type { i64, ptr, ptr, %struct._EFI_SIMPLE_NETWORK_PROTOCOL, %struct._EFI_SIMPLE_NETWORK_PROTOCOL, %struct.EFI_SIMPLE_NETWORK_MODE, i8, ptr, i16, i8, i8, i8, i8, i64, i64, i16, ptr, ptr, [8 x i8], %struct.EFI_MAC_ADDRESS, i8, ptr, ptr, ptr, ptr, ptr, i64, 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] }

@.str = external hidden unnamed_addr constant [161 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1

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

declare zeroext i8 @DebugAssertEnabled() #1

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @SN_GetStatus(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  %12 = alloca i8, align 1
  %13 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 1, 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
  %14 = load ptr, ptr @gBS, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %14, i32 0, i32 1
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = call i64 %16(i64 noundef 8)
  store i64 %17, ptr %13, align 8, !tbaa !14
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = icmp ne ptr null, %18
  br i1 %19, label %20, label %261

20:                                               ; preds = %3
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct._EFI_SIMPLE_NETWORK_PROTOCOL, ptr %21, i32 0, i32 15
  %23 = load ptr, ptr %22, align 8, !tbaa !15
  %24 = icmp ne ptr null, %23
  br i1 %24, label %25, label %261

25:                                               ; preds = %20
  %26 = call zeroext i8 @DebugAssertEnabled()
  %27 = zext i8 %26 to i32
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %39

29:                                               ; preds = %25
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = ptrtoint ptr %30 to i64
  %32 = sub i64 %31, ptrtoint (ptr getelementptr inbounds (%struct.NIC_DEVICE, ptr null, i32 0, i32 3) to i64)
  %33 = inttoptr i64 %32 to ptr
  %34 = getelementptr inbounds %struct.NIC_DEVICE, ptr %33, i32 0, i32 0
  %35 = load i64, ptr %34, align 8, !tbaa !17
  %36 = icmp ne i64 %35, 943216705
  br i1 %36, label %37, label %39

37:                                               ; preds = %29
  call void @DebugAssert(ptr noundef @.str, i64 noundef 139, ptr noundef @.str.1)
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  br label %44

39:                                               ; preds = %29, %25
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = ptrtoint ptr %40 to i64
  %42 = sub i64 %41, ptrtoint (ptr getelementptr inbounds (%struct.NIC_DEVICE, ptr null, i32 0, i32 3) to i64)
  %43 = inttoptr i64 %42 to ptr
  br label %44

44:                                               ; preds = %39, %37
  %45 = phi ptr [ %38, %37 ], [ %43, %39 ]
  store ptr %45, ptr %8, align 8, !tbaa !5
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = icmp ne ptr null, %46
  br i1 %47, label %48, label %60

48:                                               ; preds = %44
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.NIC_DEVICE, ptr %49, i32 0, i32 7
  %51 = load ptr, ptr %50, align 8, !tbaa !22
  %52 = icmp ne ptr null, %51
  br i1 %52, label %53, label %60

53:                                               ; preds = %48
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.NIC_DEVICE, ptr %54, i32 0, i32 7
  %56 = load ptr, ptr %55, align 8, !tbaa !22
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %56, ptr %57, align 8, !tbaa !5
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.NIC_DEVICE, ptr %58, i32 0, i32 7
  store ptr null, ptr %59, align 8, !tbaa !22
  br label %60

60:                                               ; preds = %53, %48, %44
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._EFI_SIMPLE_NETWORK_PROTOCOL, ptr %61, i32 0, i32 15
  %63 = load ptr, ptr %62, align 8, !tbaa !15
  store ptr %63, ptr %7, align 8, !tbaa !5
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %64, i32 0, i32 0
  %66 = load i32, ptr %65, align 4, !tbaa !23
  %67 = icmp eq i32 2, %66
  br i1 %67, label %68, label %252

68:                                               ; preds = %60
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.NIC_DEVICE, ptr %69, i32 0, i32 13
  %71 = load i64, ptr %70, align 8, !tbaa !24
  %72 = icmp ugt i64 %71, 20000
  br i1 %72, label %73, label %241

73:                                               ; preds = %68
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.NIC_DEVICE, ptr %74, i32 0, i32 12
  %76 = load i8, ptr %75, align 1, !tbaa !25
  store i8 %76, ptr %11, align 1, !tbaa !26
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.NIC_DEVICE, ptr %77, i32 0, i32 9
  %79 = load i8, ptr %78, align 2, !tbaa !27
  store i8 %79, ptr %12, align 1, !tbaa !26
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.NIC_DEVICE, ptr %80, i32 0, i32 11
  %82 = load i8, ptr %81, align 4, !tbaa !28
  store i8 %82, ptr %10, align 1, !tbaa !26
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.NIC_DEVICE, ptr %84, i32 0, i32 14
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.NIC_DEVICE, ptr %86, i32 0, i32 10
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.NIC_DEVICE, ptr %88, i32 0, i32 12
  %90 = load ptr, ptr %8, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.NIC_DEVICE, ptr %90, i32 0, i32 9
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.NIC_DEVICE, ptr %92, i32 0, i32 11
  %94 = call i64 @Ax88772NegotiateLinkComplete(ptr noundef %83, ptr noundef %85, ptr noundef %87, ptr noundef %89, ptr noundef %91, ptr noundef %93)
  store i64 %94, ptr %9, align 8, !tbaa !14
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.NIC_DEVICE, ptr %95, i32 0, i32 10
  %97 = load i8, ptr %96, align 1, !tbaa !29
  %98 = icmp ne i8 %97, 0
  br i1 %98, label %99, label %216

99:                                               ; preds = %73
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.NIC_DEVICE, ptr %100, i32 0, i32 12
  %102 = load i8, ptr %101, align 1, !tbaa !25
  %103 = icmp ne i8 %102, 0
  br i1 %103, label %104, label %215

104:                                              ; preds = %99
  %105 = load i8, ptr %12, align 1, !tbaa !26
  %106 = zext i8 %105 to i32
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %108, label %113

108:                                              ; preds = %104
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.NIC_DEVICE, ptr %109, i32 0, i32 9
  %111 = load i8, ptr %110, align 2, !tbaa !27
  %112 = icmp ne i8 %111, 0
  br i1 %112, label %113, label %140

113:                                              ; preds = %108, %104
  %114 = load i8, ptr %12, align 1, !tbaa !26
  %115 = icmp ne i8 %114, 0
  br i1 %115, label %122, label %116

116:                                              ; preds = %113
  %117 = load ptr, ptr %8, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.NIC_DEVICE, ptr %117, i32 0, i32 9
  %119 = load i8, ptr %118, align 2, !tbaa !27
  %120 = zext i8 %119 to i32
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %140, label %122

122:                                              ; preds = %116, %113
  %123 = load i8, ptr %10, align 1, !tbaa !26
  %124 = zext i8 %123 to i32
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %131

126:                                              ; preds = %122
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.NIC_DEVICE, ptr %127, i32 0, i32 11
  %129 = load i8, ptr %128, align 4, !tbaa !28
  %130 = icmp ne i8 %129, 0
  br i1 %130, label %131, label %140

131:                                              ; preds = %126, %122
  %132 = load i8, ptr %10, align 1, !tbaa !26
  %133 = icmp ne i8 %132, 0
  br i1 %133, label %174, label %134

134:                                              ; preds = %131
  %135 = load ptr, ptr %8, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.NIC_DEVICE, ptr %135, i32 0, i32 11
  %137 = load i8, ptr %136, align 4, !tbaa !28
  %138 = zext i8 %137 to i32
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %140, label %174

140:                                              ; preds = %134, %126, %116, %108
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.NIC_DEVICE, ptr %141, i32 0, i32 14
  store i64 0, ptr %142, align 8, !tbaa !30
  br label %143

143:                                              ; preds = %140
  %144 = call zeroext i8 @DebugPrintEnabled()
  %145 = icmp ne i8 %144, 0
  br i1 %145, label %146, label %168

146:                                              ; preds = %143
  br label %147

147:                                              ; preds = %146
  %148 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64)
  %149 = icmp ne i8 %148, 0
  br i1 %149, label %150, label %165

150:                                              ; preds = %147
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.NIC_DEVICE, ptr %151, i32 0, i32 9
  %153 = load i8, ptr %152, align 2, !tbaa !27
  %154 = zext i8 %153 to i32
  %155 = icmp ne i32 %154, 0
  %156 = zext i1 %155 to i64
  %157 = select i1 %155, i32 100, i32 10
  %158 = load ptr, ptr %8, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.NIC_DEVICE, ptr %158, i32 0, i32 11
  %160 = load i8, ptr %159, align 4, !tbaa !28
  %161 = zext i8 %160 to i32
  %162 = icmp ne i32 %161, 0
  %163 = zext i1 %162 to i64
  %164 = select i1 %162, ptr @.str.3, ptr @.str.4
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef @.str.2, i32 noundef %157, ptr noundef %164)
  br label %165

165:                                              ; preds = %150, %147
  br label %166

166:                                              ; preds = %165
  br label %167

167:                                              ; preds = %166
  br label %168

168:                                              ; preds = %167, %143
  br label %169

169:                                              ; preds = %168
  br label %170

170:                                              ; preds = %169
  %171 = load ptr, ptr %8, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.NIC_DEVICE, ptr %171, i32 0, i32 3
  %173 = call i64 @SN_Reset(ptr noundef %172, i8 noundef zeroext 0)
  store i64 %173, ptr %9, align 8, !tbaa !14
  br label %174

174:                                              ; preds = %170, %134, %131
  %175 = load i8, ptr %11, align 1, !tbaa !26
  %176 = icmp ne i8 %175, 0
  br i1 %176, label %212, label %177

177:                                              ; preds = %174
  %178 = load ptr, ptr %8, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.NIC_DEVICE, ptr %178, i32 0, i32 12
  %180 = load i8, ptr %179, align 1, !tbaa !25
  %181 = zext i8 %180 to i32
  %182 = icmp ne i32 %181, 0
  br i1 %182, label %183, label %212

183:                                              ; preds = %177
  br label %184

184:                                              ; preds = %183
  %185 = call zeroext i8 @DebugPrintEnabled()
  %186 = icmp ne i8 %185, 0
  br i1 %186, label %187, label %209

187:                                              ; preds = %184
  br label %188

188:                                              ; preds = %187
  %189 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64)
  %190 = icmp ne i8 %189, 0
  br i1 %190, label %191, label %206

191:                                              ; preds = %188
  %192 = load ptr, ptr %8, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.NIC_DEVICE, ptr %192, i32 0, i32 9
  %194 = load i8, ptr %193, align 2, !tbaa !27
  %195 = zext i8 %194 to i32
  %196 = icmp ne i32 %195, 0
  %197 = zext i1 %196 to i64
  %198 = select i1 %196, i32 100, i32 10
  %199 = load ptr, ptr %8, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.NIC_DEVICE, ptr %199, i32 0, i32 11
  %201 = load i8, ptr %200, align 4, !tbaa !28
  %202 = zext i8 %201 to i32
  %203 = icmp ne i32 %202, 0
  %204 = zext i1 %203 to i64
  %205 = select i1 %203, ptr @.str.3, ptr @.str.4
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef @.str.5, i32 noundef %198, ptr noundef %205)
  br label %206

206:                                              ; preds = %191, %188
  br label %207

207:                                              ; preds = %206
  br label %208

208:                                              ; preds = %207
  br label %209

209:                                              ; preds = %208, %184
  br label %210

210:                                              ; preds = %209
  br label %211

211:                                              ; preds = %210
  br label %212

212:                                              ; preds = %211, %177, %174
  %213 = load ptr, ptr %8, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.NIC_DEVICE, ptr %213, i32 0, i32 13
  store i64 0, ptr %214, align 8, !tbaa !24
  br label %215

215:                                              ; preds = %212, %99
  br label %216

216:                                              ; preds = %215, %73
  %217 = load i8, ptr %11, align 1, !tbaa !26
  %218 = zext i8 %217 to i32
  %219 = icmp ne i32 %218, 0
  br i1 %219, label %220, label %240

220:                                              ; preds = %216
  %221 = load ptr, ptr %8, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.NIC_DEVICE, ptr %221, i32 0, i32 12
  %223 = load i8, ptr %222, align 1, !tbaa !25
  %224 = icmp ne i8 %223, 0
  br i1 %224, label %240, label %225

225:                                              ; preds = %220
  br label %226

226:                                              ; preds = %225
  %227 = call zeroext i8 @DebugPrintEnabled()
  %228 = icmp ne i8 %227, 0
  br i1 %228, label %229, label %237

229:                                              ; preds = %226
  br label %230

230:                                              ; preds = %229
  %231 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64)
  %232 = icmp ne i8 %231, 0
  br i1 %232, label %233, label %234

233:                                              ; preds = %230
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef @.str.6)
  br label %234

234:                                              ; preds = %233, %230
  br label %235

235:                                              ; preds = %234
  br label %236

236:                                              ; preds = %235
  br label %237

237:                                              ; preds = %236, %226
  br label %238

238:                                              ; preds = %237
  br label %239

239:                                              ; preds = %238
  br label %240

240:                                              ; preds = %239, %220, %216
  br label %241

241:                                              ; preds = %240, %68
  %242 = load ptr, ptr %8, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.NIC_DEVICE, ptr %242, i32 0, i32 12
  %244 = load i8, ptr %243, align 1, !tbaa !25
  %245 = load ptr, ptr %7, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %245, i32 0, i32 18
  store i8 %244, ptr %246, align 4, !tbaa !31
  %247 = load ptr, ptr %5, align 8, !tbaa !5
  %248 = icmp ne ptr null, %247
  br i1 %248, label %249, label %251

249:                                              ; preds = %241
  %250 = load ptr, ptr %5, align 8, !tbaa !5
  store i32 0, ptr %250, align 4, !tbaa !32
  br label %251

251:                                              ; preds = %249, %241
  store i64 0, ptr %9, align 8, !tbaa !14
  br label %260

252:                                              ; preds = %60
  %253 = load ptr, ptr %7, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %253, i32 0, i32 0
  %255 = load i32, ptr %254, align 4, !tbaa !23
  %256 = icmp eq i32 1, %255
  br i1 %256, label %257, label %258

257:                                              ; preds = %252
  store i64 -9223372036854775801, ptr %9, align 8, !tbaa !14
  br label %259

258:                                              ; preds = %252
  store i64 -9223372036854775789, ptr %9, align 8, !tbaa !14
  br label %259

259:                                              ; preds = %258, %257
  br label %260

260:                                              ; preds = %259, %251
  br label %262

261:                                              ; preds = %20, %3
  store i64 -9223372036854775806, ptr %9, align 8, !tbaa !14
  br label %262

262:                                              ; preds = %261, %260
  %263 = load ptr, ptr @gBS, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %263, i32 0, i32 2
  %265 = load ptr, ptr %264, align 8, !tbaa !33
  %266 = load i64, ptr %13, align 8, !tbaa !14
  call void %265(i64 noundef %266)
  %267 = load i64, ptr %9, align 8, !tbaa !14
  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 1, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret i64 %267
}

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

declare zeroext i8 @DebugPrintEnabled() #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #1

declare void @DebugPrint(i64 noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @SN_Reset(ptr noundef, i8 noundef zeroext) #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 24}
!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 = !{!12, !12, i64 0}
!15 = !{!16, !6, i64 120}
!16 = !{!"_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}
!17 = !{!18, !12, i64 0}
!18 = !{!"", !12, i64 0, !6, i64 8, !6, i64 16, !16, i64 24, !16, i64 152, !19, i64 280, !7, i64 936, !6, i64 944, !21, i64 952, !7, i64 954, !7, i64 955, !7, i64 956, !7, i64 957, !12, i64 960, !12, i64 968, !21, i64 976, !6, i64 984, !6, i64 992, !7, i64 1000, !20, i64 1008, !7, i64 1040, !6, i64 1048, !6, i64 1056, !6, i64 1064, !6, i64 1072, !6, i64 1080, !12, i64 1088, !6, i64 1096}
!19 = !{!"", !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}
!20 = !{!"", !7, i64 0}
!21 = !{!"short", !7, i64 0}
!22 = !{!18, !6, i64 944}
!23 = !{!19, !13, i64 0}
!24 = !{!18, !12, i64 960}
!25 = !{!18, !7, i64 957}
!26 = !{!7, !7, i64 0}
!27 = !{!18, !7, i64 954}
!28 = !{!18, !7, i64 956}
!29 = !{!18, !7, i64 955}
!30 = !{!18, !12, i64 968}
!31 = !{!19, !7, i64 652}
!32 = !{!13, !13, i64 0}
!33 = !{!10, !6, i64 32}


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

@.str = external hidden unnamed_addr constant [161 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @SN_GetStatus(ptr noundef %0, ptr noundef writeonly %1, ptr noundef writeonly %2) local_unnamed_addr #1 {
  %4 = load ptr, ptr @gBS, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 24
  %6 = load ptr, ptr %5, align 8, !tbaa !9
  %7 = tail call i64 %6(i64 noundef 8) #2
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %86, label %8

8:                                                ; preds = %3
  %9 = getelementptr inbounds i8, ptr %0, i64 120
  %10 = load ptr, ptr %9, align 8, !tbaa !14
  %.not54 = icmp eq ptr %10, null
  br i1 %.not54, label %86, label %11

11:                                               ; preds = %8
  %12 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not55 = icmp eq i8 %12, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre85 = add i64 %.pre, -24
  %.pre87 = inttoptr i64 %.pre85 to ptr
  br i1 %.not55, label %._crit_edge, label %13

13:                                               ; preds = %11
  %14 = load i64, ptr %.pre87, align 8, !tbaa !16
  %.not56 = icmp eq i64 %14, 943216705
  br i1 %.not56, label %._crit_edge, label %15

15:                                               ; preds = %13
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 139, ptr noundef nonnull @.str.1) #2
  br label %._crit_edge

._crit_edge:                                      ; preds = %11, %13, %15
  %16 = phi ptr [ %0, %15 ], [ %.pre87, %13 ], [ %.pre87, %11 ]
  %.not57 = icmp eq ptr %2, null
  br i1 %.not57, label %21, label %17

17:                                               ; preds = %._crit_edge
  %18 = getelementptr inbounds i8, ptr %16, i64 944
  %19 = load ptr, ptr %18, align 8, !tbaa !21
  %.not58 = icmp eq ptr %19, null
  br i1 %.not58, label %21, label %20

20:                                               ; preds = %17
  store ptr %19, ptr %2, align 8, !tbaa !5
  store ptr null, ptr %18, align 8, !tbaa !21
  br label %21

21:                                               ; preds = %20, %17, %._crit_edge
  %22 = load ptr, ptr %9, align 8, !tbaa !14
  %23 = load i32, ptr %22, align 4, !tbaa !22
  switch i32 %23, label %85 [
    i32 2, label %24
    i32 1, label %86
  ]

24:                                               ; preds = %21
  %25 = getelementptr inbounds i8, ptr %16, i64 960
  %26 = load i64, ptr %25, align 8, !tbaa !23
  %27 = icmp ugt i64 %26, 20000
  br i1 %27, label %28, label %80

28:                                               ; preds = %24
  %29 = getelementptr inbounds i8, ptr %16, i64 957
  %30 = load i8, ptr %29, align 1, !tbaa !24
  %31 = getelementptr inbounds i8, ptr %16, i64 954
  %32 = load i8, ptr %31, align 2, !tbaa !25
  %33 = getelementptr inbounds i8, ptr %16, i64 956
  %34 = load i8, ptr %33, align 4, !tbaa !26
  %35 = getelementptr inbounds i8, ptr %16, i64 968
  %36 = getelementptr inbounds i8, ptr %16, i64 955
  %37 = tail call i64 @Ax88772NegotiateLinkComplete(ptr noundef nonnull %16, ptr noundef nonnull %35, ptr noundef nonnull %36, ptr noundef nonnull %29, ptr noundef nonnull %31, ptr noundef nonnull %33) #2
  %38 = load i8, ptr %36, align 1, !tbaa !27
  %.not59 = icmp eq i8 %38, 0
  br i1 %.not59, label %72, label %39

39:                                               ; preds = %28
  %40 = load i8, ptr %29, align 1, !tbaa !24
  %.not60 = icmp eq i8 %40, 0
  br i1 %.not60, label %72, label %41

41:                                               ; preds = %39
  %cond = icmp eq i8 %32, 0
  %42 = load i8, ptr %31, align 2, !tbaa !25
  %.not64 = icmp eq i8 %42, 0
  %43 = xor i1 %cond, %.not64
  br i1 %43, label %47, label %44

44:                                               ; preds = %41
  %cond84 = icmp eq i8 %34, 0
  %45 = load i8, ptr %33, align 4, !tbaa !26
  %.not68 = icmp eq i8 %45, 0
  %46 = xor i1 %cond84, %.not68
  br i1 %46, label %47, label %59

47:                                               ; preds = %44, %41
  store i64 0, ptr %35, align 8, !tbaa !28
  %48 = tail call zeroext i8 @DebugPrintEnabled() #2
  %.not69 = icmp eq i8 %48, 0
  br i1 %.not69, label %56, label %49

49:                                               ; preds = %47
  %50 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64) #2
  %.not70 = icmp eq i8 %50, 0
  br i1 %.not70, label %56, label %51

51:                                               ; preds = %49
  %52 = load i8, ptr %31, align 2, !tbaa !25
  %.not71 = icmp eq i8 %52, 0
  %53 = select i1 %.not71, i32 10, i32 100
  %54 = load i8, ptr %33, align 4, !tbaa !26
  %.not72 = icmp eq i8 %54, 0
  %55 = select i1 %.not72, ptr @.str.4, ptr @.str.3
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef nonnull @.str.2, i32 noundef %53, ptr noundef nonnull %55) #2
  br label %56

56:                                               ; preds = %49, %51, %47
  %57 = getelementptr inbounds i8, ptr %16, i64 24
  %58 = tail call i64 @SN_Reset(ptr noundef nonnull %57, i8 noundef zeroext 0)
  br label %59

59:                                               ; preds = %44, %56
  %.not73 = icmp eq i8 %30, 0
  br i1 %.not73, label %60, label %71

60:                                               ; preds = %59
  %61 = load i8, ptr %29, align 1, !tbaa !24
  %.not74 = icmp eq i8 %61, 0
  br i1 %.not74, label %71, label %62

62:                                               ; preds = %60
  %63 = tail call zeroext i8 @DebugPrintEnabled() #2
  %.not75 = icmp eq i8 %63, 0
  br i1 %.not75, label %71, label %64

64:                                               ; preds = %62
  %65 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64) #2
  %.not76 = icmp eq i8 %65, 0
  br i1 %.not76, label %71, label %66

66:                                               ; preds = %64
  %67 = load i8, ptr %31, align 2, !tbaa !25
  %.not77 = icmp eq i8 %67, 0
  %68 = select i1 %.not77, i32 10, i32 100
  %69 = load i8, ptr %33, align 4, !tbaa !26
  %.not78 = icmp eq i8 %69, 0
  %70 = select i1 %.not78, ptr @.str.4, ptr @.str.3
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef nonnull @.str.5, i32 noundef %68, ptr noundef nonnull %70) #2
  br label %71

71:                                               ; preds = %62, %66, %64, %60, %59
  store i64 0, ptr %25, align 8, !tbaa !23
  br label %72

72:                                               ; preds = %39, %71, %28
  %.not79 = icmp eq i8 %30, 0
  br i1 %.not79, label %80, label %73

73:                                               ; preds = %72
  %74 = load i8, ptr %29, align 1, !tbaa !24
  %.not80 = icmp eq i8 %74, 0
  br i1 %.not80, label %75, label %80

75:                                               ; preds = %73
  %76 = tail call zeroext i8 @DebugPrintEnabled() #2
  %.not81 = icmp eq i8 %76, 0
  br i1 %.not81, label %80, label %77

77:                                               ; preds = %75
  %78 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64) #2
  %.not82 = icmp eq i8 %78, 0
  br i1 %.not82, label %80, label %79

79:                                               ; preds = %77
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef nonnull @.str.6) #2
  br label %80

80:                                               ; preds = %72, %73, %77, %79, %75, %24
  %81 = getelementptr inbounds i8, ptr %16, i64 957
  %82 = load i8, ptr %81, align 1, !tbaa !24
  %83 = getelementptr inbounds i8, ptr %22, i64 652
  store i8 %82, ptr %83, align 4, !tbaa !29
  %.not83 = icmp eq ptr %1, null
  br i1 %.not83, label %86, label %84

84:                                               ; preds = %80
  store i32 0, ptr %1, align 4, !tbaa !30
  br label %86

85:                                               ; preds = %21
  br label %86

86:                                               ; preds = %3, %8, %21, %80, %84, %85
  %.0 = phi i64 [ -9223372036854775789, %85 ], [ 0, %84 ], [ 0, %80 ], [ -9223372036854775801, %21 ], [ -9223372036854775806, %8 ], [ -9223372036854775806, %3 ]
  %87 = load ptr, ptr @gBS, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %87, i64 32
  %89 = load ptr, ptr %88, align 8, !tbaa !31
  tail call void %89(i64 noundef %7) #2
  ret i64 %.0
}

declare i64 @Ax88772NegotiateLinkComplete(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #0

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) local_unnamed_addr #0

declare void @DebugPrint(i64 noundef, ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i64 @SN_Reset(ptr noundef, i8 noundef zeroext) local_unnamed_addr #1

attributes #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 = { 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 #2 = { 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 24}
!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 120}
!15 = !{!"_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}
!16 = !{!17, !12, i64 0}
!17 = !{!"", !12, i64 0, !6, i64 8, !6, i64 16, !15, i64 24, !15, i64 152, !18, i64 280, !7, i64 936, !6, i64 944, !20, i64 952, !7, i64 954, !7, i64 955, !7, i64 956, !7, i64 957, !12, i64 960, !12, i64 968, !20, i64 976, !6, i64 984, !6, i64 992, !7, i64 1000, !19, i64 1008, !7, i64 1040, !6, i64 1048, !6, i64 1056, !6, i64 1064, !6, i64 1072, !6, i64 1080, !12, i64 1088, !6, i64 1096}
!18 = !{!"", !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, !19, i64 552, !19, i64 584, !19, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!19 = !{!"", !7, i64 0}
!20 = !{!"short", !7, i64 0}
!21 = !{!17, !6, i64 944}
!22 = !{!18, !13, i64 0}
!23 = !{!17, !12, i64 960}
!24 = !{!17, !7, i64 957}
!25 = !{!17, !7, i64 954}
!26 = !{!17, !7, i64 956}
!27 = !{!17, !7, i64 955}
!28 = !{!17, !12, i64 968}
!29 = !{!18, !7, i64 652}
!30 = !{!13, !13, i64 0}
!31 = !{!10, !6, i64 32}


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