; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/NetworkPkg/Mtftp6Dxe (Mtftp6OperationStart)

; 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_MTFTP6_TOKEN = type { i64, ptr, ptr, ptr, ptr, i32, ptr, i64, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_MTFTP6_OVERRIDE_DATA = type { %struct.EFI_IPv6_ADDRESS, i16, i16, i16 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct._MTFTP6_INSTANCE = type { i32, ptr, %struct._LIST_ENTRY, %struct._EFI_MTFTP6_PROTOCOL, ptr, ptr, ptr, %struct.MTFTP6_EXT_OPTION_INFO, i16, i16, %struct._LIST_ENTRY, %struct.EFI_IPv6_ADDRESS, i16, i16, ptr, %struct.EFI_IPv6_ADDRESS, i16, ptr, ptr, i32, i32, i32, i32, i64, i8, i8, i8 }
%struct._EFI_MTFTP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.MTFTP6_EXT_OPTION_INFO = type { i16, i8, i32, %struct.EFI_IPv6_ADDRESS, i16, i8, i32 }
%struct._LIST_ENTRY = type { ptr, 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_MTFTP6_CONFIG_DATA = type { %struct.EFI_IPv6_ADDRESS, i16, %struct.EFI_IPv6_ADDRESS, i16, i16, i16 }

@gBS = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [138 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 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

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

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

declare zeroext i8 @DebugAssertEnabled() #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @Mtftp6OperationClean(ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @Mtftp6OperationStart(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2) #2 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i16, align 2
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i16 %2, ptr %7, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = icmp eq ptr %11, null
  br i1 %12, label %43, label %13

13:                                               ; preds = %3
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %43, label %16

16:                                               ; preds = %13
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %17, i32 0, i32 3
  %19 = load ptr, ptr %18, align 8, !tbaa !11
  %20 = icmp eq ptr %19, null
  br i1 %20, label %43, label %21

21:                                               ; preds = %16
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %22, i32 0, i32 5
  %24 = load i32, ptr %23, align 8, !tbaa !15
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %31

26:                                               ; preds = %21
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %27, i32 0, i32 6
  %29 = load ptr, ptr %28, align 8, !tbaa !16
  %30 = icmp eq ptr %29, null
  br i1 %30, label %43, label %31

31:                                               ; preds = %26, %21
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %32, i32 0, i32 2
  %34 = load ptr, ptr %33, align 8, !tbaa !17
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %44

36:                                               ; preds = %31
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %37, i32 0, i32 2
  %39 = load ptr, ptr %38, align 8, !tbaa !17
  %40 = getelementptr inbounds %struct.EFI_MTFTP6_OVERRIDE_DATA, ptr %39, i32 0, i32 0
  %41 = call zeroext i8 @NetIp6IsValidUnicast(ptr noundef %40)
  %42 = icmp ne i8 %41, 0
  br i1 %42, label %44, label %43

43:                                               ; preds = %36, %26, %16, %13, %3
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %302

44:                                               ; preds = %36, %31
  %45 = load i16, ptr %7, align 2, !tbaa !9
  %46 = zext i16 %45 to i32
  %47 = icmp eq i32 %46, 1
  br i1 %47, label %52, label %48

48:                                               ; preds = %44
  %49 = load i16, ptr %7, align 2, !tbaa !9
  %50 = zext i16 %49 to i32
  %51 = icmp eq i32 %50, 7
  br i1 %51, label %52, label %63

52:                                               ; preds = %48, %44
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %53, i32 0, i32 8
  %55 = load ptr, ptr %54, align 8, !tbaa !18
  %56 = icmp eq ptr %55, null
  br i1 %56, label %57, label %63

57:                                               ; preds = %52
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %58, i32 0, i32 10
  %60 = load ptr, ptr %59, align 8, !tbaa !19
  %61 = icmp eq ptr %60, null
  br i1 %61, label %62, label %63

62:                                               ; preds = %57
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %302

63:                                               ; preds = %57, %52, %48
  %64 = load i16, ptr %7, align 2, !tbaa !9
  %65 = zext i16 %64 to i32
  %66 = icmp eq i32 %65, 2
  br i1 %66, label %67, label %78

67:                                               ; preds = %63
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %68, i32 0, i32 8
  %70 = load ptr, ptr %69, align 8, !tbaa !18
  %71 = icmp eq ptr %70, null
  br i1 %71, label %72, label %78

72:                                               ; preds = %67
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %73, i32 0, i32 12
  %75 = load ptr, ptr %74, align 8, !tbaa !20
  %76 = icmp eq ptr %75, null
  br i1 %76, label %77, label %78

77:                                               ; preds = %72
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %302

78:                                               ; preds = %72, %67, %63
  %79 = call zeroext i8 @DebugAssertEnabled()
  %80 = zext i8 %79 to i32
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %92

82:                                               ; preds = %78
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = ptrtoint ptr %83 to i64
  %85 = sub i64 %84, ptrtoint (ptr getelementptr inbounds (%struct._MTFTP6_INSTANCE, ptr null, i32 0, i32 3) to i64)
  %86 = inttoptr i64 %85 to ptr
  %87 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %86, i32 0, i32 0
  %88 = load i32, ptr %87, align 8, !tbaa !21
  %89 = icmp ne i32 %88, 1228293709
  br i1 %89, label %90, label %92

90:                                               ; preds = %82
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 1000, ptr noundef @.str.4)
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  br label %97

92:                                               ; preds = %82, %78
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = ptrtoint ptr %93 to i64
  %95 = sub i64 %94, ptrtoint (ptr getelementptr inbounds (%struct._MTFTP6_INSTANCE, ptr null, i32 0, i32 3) to i64)
  %96 = inttoptr i64 %95 to ptr
  br label %97

97:                                               ; preds = %92, %90
  %98 = phi ptr [ %91, %90 ], [ %96, %92 ]
  store ptr %98, ptr %8, align 8, !tbaa !5
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %99, i32 0, i32 5
  %101 = load ptr, ptr %100, align 8, !tbaa !27
  %102 = icmp eq ptr %101, null
  br i1 %102, label %103, label %104

103:                                              ; preds = %97
  store i64 -9223372036854775789, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %302

104:                                              ; preds = %97
  %105 = load ptr, ptr %8, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %105, i32 0, i32 6
  %107 = load ptr, ptr %106, align 8, !tbaa !28
  %108 = icmp ne ptr %107, null
  br i1 %108, label %109, label %110

109:                                              ; preds = %104
  store i64 -9223372036854775793, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %302

110:                                              ; preds = %104
  store i64 0, ptr %9, align 8, !tbaa !29
  %111 = load ptr, ptr @gBS, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %111, i32 0, i32 1
  %113 = load ptr, ptr %112, align 8, !tbaa !30
  %114 = call i64 %113(i64 noundef 8)
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %115, i32 0, i32 23
  store i64 %114, ptr %116, align 8, !tbaa !33
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %117, i32 0, i32 5
  %119 = load i32, ptr %118, align 8, !tbaa !15
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %121, label %135

121:                                              ; preds = %110
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %122, i32 0, i32 6
  %124 = load ptr, ptr %123, align 8, !tbaa !16
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %125, i32 0, i32 5
  %127 = load i32, ptr %126, align 8, !tbaa !15
  %128 = load ptr, ptr %8, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %128, i32 0, i32 7
  %130 = call i64 @Mtftp6ParseExtensionOption(ptr noundef %124, i32 noundef %127, i8 noundef zeroext 1, ptr noundef %129)
  store i64 %130, ptr %9, align 8, !tbaa !29
  %131 = load i64, ptr %9, align 8, !tbaa !29
  %132 = icmp slt i64 %131, 0
  br i1 %132, label %133, label %134

133:                                              ; preds = %121
  br label %292

134:                                              ; preds = %121
  br label %135

135:                                              ; preds = %134, %110
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = load ptr, ptr %8, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %137, i32 0, i32 6
  store ptr %136, ptr %138, align 8, !tbaa !28
  %139 = load ptr, ptr %8, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %139, i32 0, i32 5
  %141 = load ptr, ptr %140, align 8, !tbaa !27
  %142 = getelementptr inbounds %struct.EFI_MTFTP6_CONFIG_DATA, ptr %141, i32 0, i32 3
  %143 = load i16, ptr %142, align 2, !tbaa !34
  %144 = load ptr, ptr %8, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %144, i32 0, i32 12
  store i16 %143, ptr %145, align 8, !tbaa !36
  %146 = load ptr, ptr %8, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %146, i32 0, i32 13
  store i16 0, ptr %147, align 2, !tbaa !37
  %148 = load ptr, ptr %8, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %148, i32 0, i32 5
  %150 = load ptr, ptr %149, align 8, !tbaa !27
  %151 = getelementptr inbounds %struct.EFI_MTFTP6_CONFIG_DATA, ptr %150, i32 0, i32 4
  %152 = load i16, ptr %151, align 2, !tbaa !38
  %153 = zext i16 %152 to i32
  %154 = load ptr, ptr %8, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %154, i32 0, i32 20
  store i32 %153, ptr %155, align 4, !tbaa !39
  %156 = load ptr, ptr %8, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %156, i32 0, i32 5
  %158 = load ptr, ptr %157, align 8, !tbaa !27
  %159 = getelementptr inbounds %struct.EFI_MTFTP6_CONFIG_DATA, ptr %158, i32 0, i32 5
  %160 = load i16, ptr %159, align 2, !tbaa !40
  %161 = zext i16 %160 to i32
  %162 = load ptr, ptr %8, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %162, i32 0, i32 22
  store i32 %161, ptr %163, align 4, !tbaa !41
  %164 = load ptr, ptr %8, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %164, i32 0, i32 25
  store i8 1, ptr %165, align 1, !tbaa !42
  %166 = load ptr, ptr %8, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %166, i32 0, i32 11
  %168 = load ptr, ptr %8, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %168, i32 0, i32 5
  %170 = load ptr, ptr %169, align 8, !tbaa !27
  %171 = getelementptr inbounds %struct.EFI_MTFTP6_CONFIG_DATA, ptr %170, i32 0, i32 2
  %172 = call ptr @CopyMem(ptr noundef %167, ptr noundef %171, i64 noundef 16)
  %173 = load ptr, ptr %6, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %173, i32 0, i32 2
  %175 = load ptr, ptr %174, align 8, !tbaa !17
  %176 = icmp ne ptr %175, null
  br i1 %176, label %177, label %208

177:                                              ; preds = %135
  %178 = load ptr, ptr %6, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %178, i32 0, i32 2
  %180 = load ptr, ptr %179, align 8, !tbaa !17
  %181 = getelementptr inbounds %struct.EFI_MTFTP6_OVERRIDE_DATA, ptr %180, i32 0, i32 1
  %182 = load i16, ptr %181, align 2, !tbaa !43
  %183 = load ptr, ptr %8, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %183, i32 0, i32 12
  store i16 %182, ptr %184, align 8, !tbaa !36
  %185 = load ptr, ptr %6, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %185, i32 0, i32 2
  %187 = load ptr, ptr %186, align 8, !tbaa !17
  %188 = getelementptr inbounds %struct.EFI_MTFTP6_OVERRIDE_DATA, ptr %187, i32 0, i32 2
  %189 = load i16, ptr %188, align 2, !tbaa !45
  %190 = zext i16 %189 to i32
  %191 = load ptr, ptr %8, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %191, i32 0, i32 20
  store i32 %190, ptr %192, align 4, !tbaa !39
  %193 = load ptr, ptr %6, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %193, i32 0, i32 2
  %195 = load ptr, ptr %194, align 8, !tbaa !17
  %196 = getelementptr inbounds %struct.EFI_MTFTP6_OVERRIDE_DATA, ptr %195, i32 0, i32 3
  %197 = load i16, ptr %196, align 2, !tbaa !46
  %198 = zext i16 %197 to i32
  %199 = load ptr, ptr %8, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %199, i32 0, i32 22
  store i32 %198, ptr %200, align 4, !tbaa !41
  %201 = load ptr, ptr %8, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %201, i32 0, i32 11
  %203 = load ptr, ptr %6, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %203, i32 0, i32 2
  %205 = load ptr, ptr %204, align 8, !tbaa !17
  %206 = getelementptr inbounds %struct.EFI_MTFTP6_OVERRIDE_DATA, ptr %205, i32 0, i32 0
  %207 = call ptr @CopyMem(ptr noundef %202, ptr noundef %206, i64 noundef 16)
  br label %208

208:                                              ; preds = %177, %135
  %209 = load ptr, ptr %8, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %209, i32 0, i32 12
  %211 = load i16, ptr %210, align 8, !tbaa !36
  %212 = zext i16 %211 to i32
  %213 = icmp eq i32 %212, 0
  br i1 %213, label %214, label %217

214:                                              ; preds = %208
  %215 = load ptr, ptr %8, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %215, i32 0, i32 12
  store i16 69, ptr %216, align 8, !tbaa !36
  br label %217

217:                                              ; preds = %214, %208
  %218 = load ptr, ptr %8, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %218, i32 0, i32 8
  %220 = load i16, ptr %219, align 8, !tbaa !47
  %221 = zext i16 %220 to i32
  %222 = icmp eq i32 %221, 0
  br i1 %222, label %223, label %226

223:                                              ; preds = %217
  %224 = load ptr, ptr %8, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %224, i32 0, i32 8
  store i16 512, ptr %225, align 8, !tbaa !47
  br label %226

226:                                              ; preds = %223, %217
  %227 = load ptr, ptr %8, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %227, i32 0, i32 20
  %229 = load i32, ptr %228, align 4, !tbaa !39
  %230 = icmp eq i32 %229, 0
  br i1 %230, label %231, label %234

231:                                              ; preds = %226
  %232 = load ptr, ptr %8, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %232, i32 0, i32 20
  store i32 5, ptr %233, align 4, !tbaa !39
  br label %234

234:                                              ; preds = %231, %226
  %235 = load ptr, ptr %8, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %235, i32 0, i32 22
  %237 = load i32, ptr %236, align 4, !tbaa !41
  %238 = icmp eq i32 %237, 0
  br i1 %238, label %239, label %242

239:                                              ; preds = %234
  %240 = load ptr, ptr %8, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %240, i32 0, i32 22
  store i32 3, ptr %241, align 4, !tbaa !41
  br label %242

242:                                              ; preds = %239, %234
  %243 = load ptr, ptr %6, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %243, i32 0, i32 0
  store i64 -9223372036854775802, ptr %244, align 8, !tbaa !48
  %245 = load i16, ptr %7, align 2, !tbaa !9
  %246 = zext i16 %245 to i32
  switch i32 %246, label %259 [
    i32 1, label %247
    i32 7, label %251
    i32 2, label %255
  ]

247:                                              ; preds = %242
  %248 = load ptr, ptr %8, align 8, !tbaa !5
  %249 = load i16, ptr %7, align 2, !tbaa !9
  %250 = call i64 @Mtftp6RrqStart(ptr noundef %248, i16 noundef zeroext %249)
  store i64 %250, ptr %9, align 8, !tbaa !29
  br label %260

251:                                              ; preds = %242
  %252 = load ptr, ptr %8, align 8, !tbaa !5
  %253 = load i16, ptr %7, align 2, !tbaa !9
  %254 = call i64 @Mtftp6RrqStart(ptr noundef %252, i16 noundef zeroext %253)
  store i64 %254, ptr %9, align 8, !tbaa !29
  br label %260

255:                                              ; preds = %242
  %256 = load ptr, ptr %8, align 8, !tbaa !5
  %257 = load i16, ptr %7, align 2, !tbaa !9
  %258 = call i64 @Mtftp6WrqStart(ptr noundef %256, i16 noundef zeroext %257)
  store i64 %258, ptr %9, align 8, !tbaa !29
  br label %260

259:                                              ; preds = %242
  store i64 -9223372036854775801, ptr %9, align 8, !tbaa !29
  br label %292

260:                                              ; preds = %255, %251, %247
  %261 = load i64, ptr %9, align 8, !tbaa !29
  %262 = icmp slt i64 %261, 0
  br i1 %262, label %263, label %264

263:                                              ; preds = %260
  br label %292

264:                                              ; preds = %260
  %265 = load ptr, ptr @gBS, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %265, i32 0, i32 2
  %267 = load ptr, ptr %266, align 8, !tbaa !49
  %268 = load ptr, ptr %8, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %268, i32 0, i32 23
  %270 = load i64, ptr %269, align 8, !tbaa !33
  call void %267(i64 noundef %270)
  %271 = load ptr, ptr %6, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %271, i32 0, i32 1
  %273 = load ptr, ptr %272, align 8, !tbaa !50
  %274 = icmp eq ptr %273, null
  br i1 %274, label %275, label %291

275:                                              ; preds = %264
  br label %276

276:                                              ; preds = %281, %275
  %277 = load ptr, ptr %6, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %277, i32 0, i32 0
  %279 = load i64, ptr %278, align 8, !tbaa !48
  %280 = icmp eq i64 %279, -9223372036854775802
  br i1 %280, label %281, label %287

281:                                              ; preds = %276
  %282 = load ptr, ptr %5, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct._EFI_MTFTP6_PROTOCOL, ptr %282, i32 0, i32 7
  %284 = load ptr, ptr %283, align 8, !tbaa !51
  %285 = load ptr, ptr %5, align 8, !tbaa !5
  %286 = call i64 %284(ptr noundef %285)
  br label %276, !llvm.loop !52

287:                                              ; preds = %276
  %288 = load ptr, ptr %6, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %288, i32 0, i32 0
  %290 = load i64, ptr %289, align 8, !tbaa !48
  store i64 %290, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %302

291:                                              ; preds = %264
  store i64 0, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %302

292:                                              ; preds = %263, %259, %133
  %293 = load ptr, ptr %8, align 8, !tbaa !5
  %294 = load i64, ptr %9, align 8, !tbaa !29
  call void @Mtftp6OperationClean(ptr noundef %293, i64 noundef %294)
  %295 = load ptr, ptr @gBS, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %295, i32 0, i32 2
  %297 = load ptr, ptr %296, align 8, !tbaa !49
  %298 = load ptr, ptr %8, align 8, !tbaa !5
  %299 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %298, i32 0, i32 23
  %300 = load i64, ptr %299, align 8, !tbaa !33
  call void %297(i64 noundef %300)
  %301 = load i64, ptr %9, align 8, !tbaa !29
  store i64 %301, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %302

302:                                              ; preds = %292, %291, %287, %109, %103, %77, %62, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %303 = load i64, ptr %4, align 8
  ret i64 %303
}

declare zeroext i8 @NetIp6IsValidUnicast(ptr noundef) #1

declare i64 @Mtftp6ParseExtensionOption(ptr noundef, i32 noundef, i8 noundef zeroext, ptr noundef) #1

declare i64 @Mtftp6RrqStart(ptr noundef, i16 noundef zeroext) #1

declare i64 @Mtftp6WrqStart(ptr noundef, i16 noundef zeroext) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !6, i64 24}
!12 = !{!"_EFI_MTFTP6_TOKEN", !13, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !14, i64 40, !6, i64 48, !13, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!12, !14, i64 40}
!16 = !{!12, !6, i64 48}
!17 = !{!12, !6, i64 16}
!18 = !{!12, !6, i64 64}
!19 = !{!12, !6, i64 80}
!20 = !{!12, !6, i64 96}
!21 = !{!22, !14, i64 0}
!22 = !{!"_MTFTP6_INSTANCE", !14, i64 0, !6, i64 8, !23, i64 16, !24, i64 32, !6, i64 96, !6, i64 104, !6, i64 112, !25, i64 120, !10, i64 152, !10, i64 154, !23, i64 160, !26, i64 176, !10, i64 192, !10, i64 194, !6, i64 200, !26, i64 208, !10, i64 224, !6, i64 232, !6, i64 240, !14, i64 248, !14, i64 252, !14, i64 256, !14, i64 260, !13, i64 264, !7, i64 272, !7, i64 273, !7, i64 274}
!23 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!24 = !{!"_EFI_MTFTP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!25 = !{!"", !10, i64 0, !7, i64 2, !14, i64 4, !26, i64 8, !10, i64 24, !7, i64 26, !14, i64 28}
!26 = !{!"", !7, i64 0}
!27 = !{!22, !6, i64 104}
!28 = !{!22, !6, i64 112}
!29 = !{!13, !13, i64 0}
!30 = !{!31, !6, i64 24}
!31 = !{!"", !32, 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}
!32 = !{!"", !13, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!33 = !{!22, !13, i64 264}
!34 = !{!35, !10, i64 34}
!35 = !{!"", !26, i64 0, !10, i64 16, !26, i64 18, !10, i64 34, !10, i64 36, !10, i64 38}
!36 = !{!22, !10, i64 192}
!37 = !{!22, !10, i64 194}
!38 = !{!35, !10, i64 36}
!39 = !{!22, !14, i64 252}
!40 = !{!35, !10, i64 38}
!41 = !{!22, !14, i64 260}
!42 = !{!22, !7, i64 273}
!43 = !{!44, !10, i64 16}
!44 = !{!"", !26, i64 0, !10, i64 16, !10, i64 18, !10, i64 20}
!45 = !{!44, !10, i64 18}
!46 = !{!44, !10, i64 20}
!47 = !{!22, !10, i64 152}
!48 = !{!12, !13, i64 0}
!49 = !{!31, !6, i64 32}
!50 = !{!12, !6, i64 8}
!51 = !{!24, !6, i64 56}
!52 = distinct !{!52, !53}
!53 = !{!"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"

@gBS = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [138 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1

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

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
declare dso_local void @Mtftp6OperationClean(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i64 @Mtftp6OperationStart(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2) local_unnamed_addr #1 {
  %4 = icmp eq ptr %0, null
  %5 = icmp eq ptr %1, null
  %or.cond = or i1 %4, %5
  br i1 %or.cond, label %.loopexit, label %6

6:                                                ; preds = %3
  %7 = getelementptr inbounds i8, ptr %1, i64 24
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = icmp eq ptr %8, null
  br i1 %9, label %.loopexit, label %10

10:                                               ; preds = %6
  %11 = getelementptr inbounds i8, ptr %1, i64 40
  %12 = load i32, ptr %11, align 8, !tbaa !12
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %17, label %13

13:                                               ; preds = %10
  %14 = getelementptr inbounds i8, ptr %1, i64 48
  %15 = load ptr, ptr %14, align 8, !tbaa !13
  %16 = icmp eq ptr %15, null
  br i1 %16, label %.loopexit, label %17

17:                                               ; preds = %13, %10
  %18 = getelementptr inbounds i8, ptr %1, i64 16
  %19 = load ptr, ptr %18, align 8, !tbaa !14
  %.not85 = icmp eq ptr %19, null
  br i1 %.not85, label %22, label %20

20:                                               ; preds = %17
  %21 = tail call zeroext i8 @NetIp6IsValidUnicast(ptr noundef nonnull %19) #2
  %.not86 = icmp eq i8 %21, 0
  br i1 %.not86, label %.loopexit, label %22

22:                                               ; preds = %20, %17
  switch i16 %2, label %40 [
    i16 7, label %23
    i16 1, label %23
    i16 2, label %._crit_edge
  ]

._crit_edge:                                      ; preds = %22
  %.phi.trans.insert = getelementptr inbounds i8, ptr %1, i64 64
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !15
  br label %33

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

27:                                               ; preds = %23
  %28 = getelementptr inbounds i8, ptr %1, i64 80
  %29 = load ptr, ptr %28, align 8, !tbaa !16
  %30 = icmp eq ptr %29, null
  br i1 %30, label %.loopexit, label %31

31:                                               ; preds = %27, %23
  %32 = icmp eq i16 %2, 2
  br i1 %32, label %33, label %40

33:                                               ; preds = %._crit_edge, %31
  %34 = phi ptr [ %.pre, %._crit_edge ], [ %25, %31 ]
  %35 = icmp eq ptr %34, null
  br i1 %35, label %36, label %40

36:                                               ; preds = %33
  %37 = getelementptr inbounds i8, ptr %1, i64 96
  %38 = load ptr, ptr %37, align 8, !tbaa !17
  %39 = icmp eq ptr %38, null
  br i1 %39, label %.loopexit, label %40

40:                                               ; preds = %22, %36, %33, %31
  %41 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not87 = icmp eq i8 %41, 0
  %.pre93 = ptrtoint ptr %0 to i64
  %.pre94 = add i64 %.pre93, -32
  %.pre96 = inttoptr i64 %.pre94 to ptr
  br i1 %.not87, label %._crit_edge92, label %42

42:                                               ; preds = %40
  %43 = load i32, ptr %.pre96, align 8, !tbaa !18
  %.not88 = icmp eq i32 %43, 1228293709
  br i1 %.not88, label %._crit_edge92, label %44

44:                                               ; preds = %42
  tail call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 1000, ptr noundef nonnull @.str.4) #2
  br label %._crit_edge92

._crit_edge92:                                    ; preds = %40, %42, %44
  %45 = phi ptr [ %0, %44 ], [ %.pre96, %42 ], [ %.pre96, %40 ]
  %46 = getelementptr inbounds i8, ptr %45, i64 104
  %47 = load ptr, ptr %46, align 8, !tbaa !25
  %48 = icmp eq ptr %47, null
  br i1 %48, label %.loopexit, label %49

49:                                               ; preds = %._crit_edge92
  %50 = getelementptr inbounds i8, ptr %45, i64 112
  %51 = load ptr, ptr %50, align 8, !tbaa !26
  %.not89 = icmp eq ptr %51, null
  br i1 %.not89, label %52, label %.loopexit

52:                                               ; preds = %49
  %53 = load ptr, ptr @gBS, align 8, !tbaa !27
  %54 = getelementptr inbounds i8, ptr %53, i64 24
  %55 = load ptr, ptr %54, align 8, !tbaa !28
  %56 = tail call i64 %55(i64 noundef 8) #2
  %57 = getelementptr inbounds i8, ptr %45, i64 264
  store i64 %56, ptr %57, align 8, !tbaa !31
  %58 = load i32, ptr %11, align 8, !tbaa !12
  %.not90 = icmp eq i32 %58, 0
  br i1 %.not90, label %65, label %59

59:                                               ; preds = %52
  %60 = getelementptr inbounds i8, ptr %1, i64 48
  %61 = load ptr, ptr %60, align 8, !tbaa !13
  %62 = getelementptr inbounds i8, ptr %45, i64 120
  %63 = tail call i64 @Mtftp6ParseExtensionOption(ptr noundef %61, i32 noundef %58, i8 noundef zeroext 1, ptr noundef nonnull %62) #2
  %64 = icmp slt i64 %63, 0
  br i1 %64, label %136, label %65

65:                                               ; preds = %59, %52
  store ptr %1, ptr %50, align 8, !tbaa !26
  %66 = load ptr, ptr %46, align 8, !tbaa !25
  %67 = getelementptr inbounds i8, ptr %66, i64 34
  %68 = load i16, ptr %67, align 2, !tbaa !32
  %69 = getelementptr inbounds i8, ptr %45, i64 192
  store i16 %68, ptr %69, align 8, !tbaa !34
  %70 = getelementptr inbounds i8, ptr %45, i64 194
  store i16 0, ptr %70, align 2, !tbaa !35
  %71 = getelementptr inbounds i8, ptr %66, i64 36
  %72 = load i16, ptr %71, align 2, !tbaa !36
  %73 = zext i16 %72 to i32
  %74 = getelementptr inbounds i8, ptr %45, i64 252
  store i32 %73, ptr %74, align 4, !tbaa !37
  %75 = getelementptr inbounds i8, ptr %66, i64 38
  %76 = load i16, ptr %75, align 2, !tbaa !38
  %77 = zext i16 %76 to i32
  %78 = getelementptr inbounds i8, ptr %45, i64 260
  store i32 %77, ptr %78, align 4, !tbaa !39
  %79 = getelementptr inbounds i8, ptr %45, i64 273
  store i8 1, ptr %79, align 1, !tbaa !40
  %80 = getelementptr inbounds i8, ptr %45, i64 176
  %81 = getelementptr inbounds i8, ptr %66, i64 18
  %82 = tail call ptr @CopyMem(ptr noundef nonnull %80, ptr noundef nonnull %81, i64 noundef 16) #2
  %83 = load ptr, ptr %18, align 8, !tbaa !14
  %.not91 = icmp eq ptr %83, null
  br i1 %.not91, label %94, label %84

84:                                               ; preds = %65
  %85 = getelementptr inbounds i8, ptr %83, i64 16
  %86 = load i16, ptr %85, align 2, !tbaa !41
  store i16 %86, ptr %69, align 8, !tbaa !34
  %87 = getelementptr inbounds i8, ptr %83, i64 18
  %88 = load i16, ptr %87, align 2, !tbaa !43
  %89 = zext i16 %88 to i32
  store i32 %89, ptr %74, align 4, !tbaa !37
  %90 = getelementptr inbounds i8, ptr %83, i64 20
  %91 = load i16, ptr %90, align 2, !tbaa !44
  %92 = zext i16 %91 to i32
  store i32 %92, ptr %78, align 4, !tbaa !39
  %93 = tail call ptr @CopyMem(ptr noundef nonnull %80, ptr noundef nonnull %83, i64 noundef 16) #2
  br label %94

94:                                               ; preds = %84, %65
  %95 = load i16, ptr %69, align 8, !tbaa !34
  %96 = icmp eq i16 %95, 0
  br i1 %96, label %97, label %98

97:                                               ; preds = %94
  store i16 69, ptr %69, align 8, !tbaa !34
  br label %98

98:                                               ; preds = %97, %94
  %99 = getelementptr inbounds i8, ptr %45, i64 152
  %100 = load i16, ptr %99, align 8, !tbaa !45
  %101 = icmp eq i16 %100, 0
  br i1 %101, label %102, label %103

102:                                              ; preds = %98
  store i16 512, ptr %99, align 8, !tbaa !45
  br label %103

103:                                              ; preds = %102, %98
  %104 = load i32, ptr %74, align 4, !tbaa !37
  %105 = icmp eq i32 %104, 0
  br i1 %105, label %106, label %107

106:                                              ; preds = %103
  store i32 5, ptr %74, align 4, !tbaa !37
  br label %107

107:                                              ; preds = %106, %103
  %108 = load i32, ptr %78, align 4, !tbaa !39
  %109 = icmp eq i32 %108, 0
  br i1 %109, label %110, label %111

110:                                              ; preds = %107
  store i32 3, ptr %78, align 4, !tbaa !39
  br label %111

111:                                              ; preds = %110, %107
  store i64 -9223372036854775802, ptr %1, align 8, !tbaa !46
  switch i16 %2, label %136 [
    i16 1, label %112
    i16 7, label %114
    i16 2, label %116
  ]

112:                                              ; preds = %111
  %113 = tail call i64 @Mtftp6RrqStart(ptr noundef nonnull %45, i16 noundef zeroext 1) #2
  br label %118

114:                                              ; preds = %111
  %115 = tail call i64 @Mtftp6RrqStart(ptr noundef nonnull %45, i16 noundef zeroext 7) #2
  br label %118

116:                                              ; preds = %111
  %117 = tail call i64 @Mtftp6WrqStart(ptr noundef nonnull %45, i16 noundef zeroext 2) #2
  br label %118

118:                                              ; preds = %116, %114, %112
  %.0 = phi i64 [ %117, %116 ], [ %115, %114 ], [ %113, %112 ]
  %119 = icmp slt i64 %.0, 0
  br i1 %119, label %136, label %120

120:                                              ; preds = %118
  %121 = load ptr, ptr @gBS, align 8, !tbaa !27
  %122 = getelementptr inbounds i8, ptr %121, i64 32
  %123 = load ptr, ptr %122, align 8, !tbaa !47
  %124 = load i64, ptr %57, align 8, !tbaa !31
  tail call void %123(i64 noundef %124) #2
  %125 = getelementptr inbounds i8, ptr %1, i64 8
  %126 = load ptr, ptr %125, align 8, !tbaa !48
  %127 = icmp eq ptr %126, null
  br i1 %127, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %120
  %128 = load i64, ptr %1, align 8, !tbaa !46
  %129 = icmp eq i64 %128, -9223372036854775802
  br i1 %129, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader
  %130 = getelementptr inbounds i8, ptr %0, i64 56
  br label %131

131:                                              ; preds = %.lr.ph, %131
  %132 = load ptr, ptr %130, align 8, !tbaa !49
  %133 = tail call i64 %132(ptr noundef nonnull %0) #2
  %134 = load i64, ptr %1, align 8, !tbaa !46
  %135 = icmp eq i64 %134, -9223372036854775802
  br i1 %135, label %131, label %.loopexit, !llvm.loop !50

136:                                              ; preds = %111, %118, %59
  %.1 = phi i64 [ %63, %59 ], [ %.0, %118 ], [ -9223372036854775801, %111 ]
  tail call void @Mtftp6OperationClean(ptr noundef nonnull %45, i64 noundef %.1)
  %137 = load ptr, ptr @gBS, align 8, !tbaa !27
  %138 = getelementptr inbounds i8, ptr %137, i64 32
  %139 = load ptr, ptr %138, align 8, !tbaa !47
  %140 = load i64, ptr %57, align 8, !tbaa !31
  tail call void %139(i64 noundef %140) #2
  br label %.loopexit

.loopexit:                                        ; preds = %131, %.preheader, %120, %49, %._crit_edge92, %36, %27, %3, %6, %13, %20, %136
  %.077 = phi i64 [ %.1, %136 ], [ -9223372036854775806, %20 ], [ -9223372036854775806, %13 ], [ -9223372036854775806, %6 ], [ -9223372036854775806, %3 ], [ -9223372036854775806, %27 ], [ -9223372036854775806, %36 ], [ -9223372036854775789, %._crit_edge92 ], [ -9223372036854775793, %49 ], [ 0, %120 ], [ %128, %.preheader ], [ %134, %131 ]
  ret i64 %.077
}

declare zeroext i8 @NetIp6IsValidUnicast(ptr noundef) local_unnamed_addr #0

declare i64 @Mtftp6ParseExtensionOption(ptr noundef, i32 noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #0

declare i64 @Mtftp6RrqStart(ptr noundef, i16 noundef zeroext) local_unnamed_addr #0

declare i64 @Mtftp6WrqStart(ptr noundef, i16 noundef zeroext) local_unnamed_addr #0

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, !10, i64 24}
!6 = !{!"_EFI_MTFTP6_TOKEN", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !11, i64 40, !10, i64 48, !7, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !11, i64 40}
!13 = !{!6, !10, i64 48}
!14 = !{!6, !10, i64 16}
!15 = !{!6, !10, i64 64}
!16 = !{!6, !10, i64 80}
!17 = !{!6, !10, i64 96}
!18 = !{!19, !11, i64 0}
!19 = !{!"_MTFTP6_INSTANCE", !11, i64 0, !10, i64 8, !20, i64 16, !21, i64 32, !10, i64 96, !10, i64 104, !10, i64 112, !22, i64 120, !23, i64 152, !23, i64 154, !20, i64 160, !24, i64 176, !23, i64 192, !23, i64 194, !10, i64 200, !24, i64 208, !23, i64 224, !10, i64 232, !10, i64 240, !11, i64 248, !11, i64 252, !11, i64 256, !11, i64 260, !7, i64 264, !8, i64 272, !8, i64 273, !8, i64 274}
!20 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!21 = !{!"_EFI_MTFTP6_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56}
!22 = !{!"", !23, i64 0, !8, i64 2, !11, i64 4, !24, i64 8, !23, i64 24, !8, i64 26, !11, i64 28}
!23 = !{!"short", !8, i64 0}
!24 = !{!"", !8, i64 0}
!25 = !{!19, !10, i64 104}
!26 = !{!19, !10, i64 112}
!27 = !{!10, !10, i64 0}
!28 = !{!29, !10, i64 24}
!29 = !{!"", !30, i64 0, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, i64 312, !10, i64 320, !10, i64 328, !10, i64 336, !10, i64 344, !10, i64 352, !10, i64 360, !10, i64 368}
!30 = !{!"", !7, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!31 = !{!19, !7, i64 264}
!32 = !{!33, !23, i64 34}
!33 = !{!"", !24, i64 0, !23, i64 16, !24, i64 18, !23, i64 34, !23, i64 36, !23, i64 38}
!34 = !{!19, !23, i64 192}
!35 = !{!19, !23, i64 194}
!36 = !{!33, !23, i64 36}
!37 = !{!19, !11, i64 252}
!38 = !{!33, !23, i64 38}
!39 = !{!19, !11, i64 260}
!40 = !{!19, !8, i64 273}
!41 = !{!42, !23, i64 16}
!42 = !{!"", !24, i64 0, !23, i64 16, !23, i64 18, !23, i64 20}
!43 = !{!42, !23, i64 18}
!44 = !{!42, !23, i64 20}
!45 = !{!19, !23, i64 152}
!46 = !{!6, !7, i64 0}
!47 = !{!29, !10, i64 32}
!48 = !{!6, !10, i64 8}
!49 = !{!21, !10, i64 56}
!50 = distinct !{!50, !51}
!51 = !{!"llvm.loop.mustprogress"}


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