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

; 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_MTFTP4_TOKEN = type { i64, ptr, ptr, ptr, ptr, i32, ptr, i64, ptr, ptr, ptr, ptr, ptr }
%struct._MTFTP4_PROTOCOL = type { i32, %struct._LIST_ENTRY, %struct._EFI_MTFTP4_PROTOCOL, i64, i8, ptr, ptr, %struct.EFI_MTFTP4_CONFIG_DATA, ptr, %struct.MTFTP4_OPTION, i16, i16, i16, %struct._LIST_ENTRY, i32, i16, i16, i32, ptr, ptr, i32, i32, i32, i32, i32, i16, i8, ptr }
%struct._EFI_MTFTP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_MTFTP4_CONFIG_DATA = type { i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, i16, i16 }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.MTFTP4_OPTION = type { i16, i8, i32, i32, 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_MTFTP4_OVERRIDE_DATA = type { %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, i16, i16 }

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

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

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

declare zeroext i8 @DebugAssertEnabled() #2

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @Mtftp4OverrideValid(ptr noundef, ptr noundef) #0

declare i32 @SwapBytes32(i32 noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local i64 @Mtftp4Start(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2) #0 {
  %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 ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %34, label %16

16:                                               ; preds = %3
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = icmp eq ptr %17, null
  br i1 %18, label %34, label %19

19:                                               ; preds = %16
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %20, i32 0, i32 3
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = icmp eq ptr %22, null
  br i1 %23, label %34, label %24

24:                                               ; preds = %19
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %25, i32 0, i32 5
  %27 = load i32, ptr %26, align 8, !tbaa !15
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %35

29:                                               ; preds = %24
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %30, i32 0, i32 6
  %32 = load ptr, ptr %31, align 8, !tbaa !16
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %35

34:                                               ; preds = %29, %19, %16, %3
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %328

35:                                               ; preds = %29, %24
  %36 = load i16, ptr %7, align 2, !tbaa !9
  %37 = zext i16 %36 to i32
  %38 = icmp eq i32 %37, 1
  br i1 %38, label %43, label %39

39:                                               ; preds = %35
  %40 = load i16, ptr %7, align 2, !tbaa !9
  %41 = zext i16 %40 to i32
  %42 = icmp eq i32 %41, 7
  br i1 %42, label %43, label %54

43:                                               ; preds = %39, %35
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %44, i32 0, i32 8
  %46 = load ptr, ptr %45, align 8, !tbaa !17
  %47 = icmp eq ptr %46, null
  br i1 %47, label %48, label %54

48:                                               ; preds = %43
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %49, i32 0, i32 10
  %51 = load ptr, ptr %50, align 8, !tbaa !18
  %52 = icmp eq ptr %51, null
  br i1 %52, label %53, label %54

53:                                               ; preds = %48
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %328

54:                                               ; preds = %48, %43, %39
  %55 = load i16, ptr %7, align 2, !tbaa !9
  %56 = zext i16 %55 to i32
  %57 = icmp eq i32 %56, 2
  br i1 %57, label %58, label %69

58:                                               ; preds = %54
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %59, i32 0, i32 8
  %61 = load ptr, ptr %60, align 8, !tbaa !17
  %62 = icmp eq ptr %61, null
  br i1 %62, label %63, label %69

63:                                               ; preds = %58
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %64, i32 0, i32 12
  %66 = load ptr, ptr %65, align 8, !tbaa !19
  %67 = icmp eq ptr %66, null
  br i1 %67, label %68, label %69

68:                                               ; preds = %63
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %328

69:                                               ; preds = %63, %58, %54
  %70 = call zeroext i8 @DebugAssertEnabled()
  %71 = zext i8 %70 to i32
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %83

73:                                               ; preds = %69
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = ptrtoint ptr %74 to i64
  %76 = sub i64 %75, ptrtoint (ptr getelementptr inbounds (%struct._MTFTP4_PROTOCOL, ptr null, i32 0, i32 2) to i64)
  %77 = inttoptr i64 %76 to ptr
  %78 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %77, i32 0, i32 0
  %79 = load i32, ptr %78, align 8, !tbaa !20
  %80 = icmp ne i32 %79, 1886676596
  br i1 %80, label %81, label %83

81:                                               ; preds = %73
  call void @DebugAssert(ptr noundef @.str, i64 noundef 393, ptr noundef @.str.5)
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  br label %88

83:                                               ; preds = %73, %69
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = ptrtoint ptr %84 to i64
  %86 = sub i64 %85, ptrtoint (ptr getelementptr inbounds (%struct._MTFTP4_PROTOCOL, ptr null, i32 0, i32 2) to i64)
  %87 = inttoptr i64 %86 to ptr
  br label %88

88:                                               ; preds = %83, %81
  %89 = phi ptr [ %82, %81 ], [ %87, %83 ]
  store ptr %89, ptr %8, align 8, !tbaa !5
  store i64 0, ptr %12, align 8, !tbaa !27
  %90 = load ptr, ptr @gBS, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %90, i32 0, i32 1
  %92 = load ptr, ptr %91, align 8, !tbaa !28
  %93 = call i64 %92(i64 noundef 8)
  store i64 %93, ptr %11, align 8, !tbaa !27
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %94, i32 0, i32 3
  %96 = load i64, ptr %95, align 8, !tbaa !31
  %97 = icmp ne i64 %96, 1
  br i1 %97, label %98, label %99

98:                                               ; preds = %88
  store i64 -9223372036854775789, ptr %12, align 8, !tbaa !27
  br label %99

99:                                               ; preds = %98, %88
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %100, i32 0, i32 10
  %102 = load i16, ptr %101, align 4, !tbaa !32
  %103 = zext i16 %102 to i32
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %106

105:                                              ; preds = %99
  store i64 -9223372036854775793, ptr %12, align 8, !tbaa !27
  br label %106

106:                                              ; preds = %105, %99
  %107 = load i64, ptr %12, align 8, !tbaa !27
  %108 = icmp slt i64 %107, 0
  br i1 %108, label %109, label %115

109:                                              ; preds = %106
  %110 = load ptr, ptr @gBS, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %110, i32 0, i32 2
  %112 = load ptr, ptr %111, align 8, !tbaa !33
  %113 = load i64, ptr %11, align 8, !tbaa !27
  call void %112(i64 noundef %113)
  %114 = load i64, ptr %12, align 8, !tbaa !27
  store i64 %114, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %328

115:                                              ; preds = %106
  %116 = load i16, ptr %7, align 2, !tbaa !9
  %117 = load ptr, ptr %8, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %117, i32 0, i32 10
  store i16 %116, ptr %118, align 4, !tbaa !32
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %119, i32 0, i32 2
  %121 = load ptr, ptr %120, align 8, !tbaa !34
  store ptr %121, ptr %9, align 8, !tbaa !5
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %124, label %130

124:                                              ; preds = %115
  %125 = load ptr, ptr %8, align 8, !tbaa !5
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = call zeroext i8 @Mtftp4OverrideValid(ptr noundef %125, ptr noundef %126)
  %128 = icmp ne i8 %127, 0
  br i1 %128, label %130, label %129

129:                                              ; preds = %124
  store i64 -9223372036854775806, ptr %12, align 8, !tbaa !27
  br label %320

130:                                              ; preds = %124, %115
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %131, i32 0, i32 5
  %133 = load i32, ptr %132, align 8, !tbaa !15
  %134 = icmp ne i32 %133, 0
  br i1 %134, label %135, label %149

135:                                              ; preds = %130
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %136, i32 0, i32 6
  %138 = load ptr, ptr %137, align 8, !tbaa !16
  %139 = load ptr, ptr %6, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %139, i32 0, i32 5
  %141 = load i32, ptr %140, align 8, !tbaa !15
  %142 = load ptr, ptr %8, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %142, i32 0, i32 9
  %144 = call i64 @Mtftp4ParseOption(ptr noundef %138, i32 noundef %141, i8 noundef zeroext 1, ptr noundef %143)
  store i64 %144, ptr %12, align 8, !tbaa !27
  %145 = load i64, ptr %12, align 8, !tbaa !27
  %146 = icmp slt i64 %145, 0
  br i1 %146, label %147, label %148

147:                                              ; preds = %135
  br label %320

148:                                              ; preds = %135
  br label %149

149:                                              ; preds = %148, %130
  %150 = load ptr, ptr %8, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %150, i32 0, i32 7
  store ptr %151, ptr %10, align 8, !tbaa !5
  %152 = load ptr, ptr %6, align 8, !tbaa !5
  %153 = load ptr, ptr %8, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %153, i32 0, i32 8
  store ptr %152, ptr %154, align 8, !tbaa !35
  %155 = load ptr, ptr %8, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %155, i32 0, i32 11
  store i16 512, ptr %156, align 2, !tbaa !36
  %157 = load ptr, ptr %8, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %157, i32 0, i32 14
  %159 = load ptr, ptr %10, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.EFI_MTFTP4_CONFIG_DATA, ptr %159, i32 0, i32 5
  %161 = call ptr @CopyMem(ptr noundef %158, ptr noundef %160, i64 noundef 4)
  %162 = load ptr, ptr %8, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %162, i32 0, i32 14
  %164 = load i32, ptr %163, align 8, !tbaa !37
  %165 = call i32 @SwapBytes32(i32 noundef %164)
  %166 = load ptr, ptr %8, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %166, i32 0, i32 14
  store i32 %165, ptr %167, align 8, !tbaa !37
  %168 = load ptr, ptr %10, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.EFI_MTFTP4_CONFIG_DATA, ptr %168, i32 0, i32 6
  %170 = load i16, ptr %169, align 2, !tbaa !38
  %171 = load ptr, ptr %8, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %171, i32 0, i32 15
  store i16 %170, ptr %172, align 4, !tbaa !39
  %173 = load ptr, ptr %8, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %173, i32 0, i32 16
  store i16 0, ptr %174, align 2, !tbaa !40
  %175 = load ptr, ptr %8, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %175, i32 0, i32 17
  %177 = load ptr, ptr %10, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.EFI_MTFTP4_CONFIG_DATA, ptr %177, i32 0, i32 4
  %179 = call ptr @CopyMem(ptr noundef %176, ptr noundef %178, i64 noundef 4)
  %180 = load ptr, ptr %8, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %180, i32 0, i32 17
  %182 = load i32, ptr %181, align 8, !tbaa !41
  %183 = call i32 @SwapBytes32(i32 noundef %182)
  %184 = load ptr, ptr %8, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %184, i32 0, i32 17
  store i32 %183, ptr %185, align 8, !tbaa !41
  %186 = load ptr, ptr %10, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.EFI_MTFTP4_CONFIG_DATA, ptr %186, i32 0, i32 7
  %188 = load i16, ptr %187, align 2, !tbaa !42
  %189 = zext i16 %188 to i32
  %190 = load ptr, ptr %8, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %190, i32 0, i32 22
  store i32 %189, ptr %191, align 8, !tbaa !43
  %192 = load ptr, ptr %10, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.EFI_MTFTP4_CONFIG_DATA, ptr %192, i32 0, i32 8
  %194 = load i16, ptr %193, align 2, !tbaa !44
  %195 = zext i16 %194 to i32
  %196 = load ptr, ptr %8, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %196, i32 0, i32 23
  store i32 %195, ptr %197, align 4, !tbaa !45
  %198 = load ptr, ptr %8, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %198, i32 0, i32 26
  store i8 1, ptr %199, align 2, !tbaa !46
  %200 = load ptr, ptr %9, align 8, !tbaa !5
  %201 = icmp ne ptr %200, null
  br i1 %201, label %202, label %242

202:                                              ; preds = %149
  %203 = load ptr, ptr %8, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %203, i32 0, i32 14
  %205 = load ptr, ptr %9, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.EFI_MTFTP4_OVERRIDE_DATA, ptr %205, i32 0, i32 1
  %207 = call ptr @CopyMem(ptr noundef %204, ptr noundef %206, i64 noundef 4)
  %208 = load ptr, ptr %8, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %208, i32 0, i32 17
  %210 = load ptr, ptr %9, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.EFI_MTFTP4_OVERRIDE_DATA, ptr %210, i32 0, i32 0
  %212 = call ptr @CopyMem(ptr noundef %209, ptr noundef %211, i64 noundef 4)
  %213 = load ptr, ptr %8, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %213, i32 0, i32 14
  %215 = load i32, ptr %214, align 8, !tbaa !37
  %216 = call i32 @SwapBytes32(i32 noundef %215)
  %217 = load ptr, ptr %8, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %217, i32 0, i32 14
  store i32 %216, ptr %218, align 8, !tbaa !37
  %219 = load ptr, ptr %8, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %219, i32 0, i32 17
  %221 = load i32, ptr %220, align 8, !tbaa !41
  %222 = call i32 @SwapBytes32(i32 noundef %221)
  %223 = load ptr, ptr %8, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %223, i32 0, i32 17
  store i32 %222, ptr %224, align 8, !tbaa !41
  %225 = load ptr, ptr %9, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.EFI_MTFTP4_OVERRIDE_DATA, ptr %225, i32 0, i32 2
  %227 = load i16, ptr %226, align 2, !tbaa !47
  %228 = load ptr, ptr %8, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %228, i32 0, i32 15
  store i16 %227, ptr %229, align 4, !tbaa !39
  %230 = load ptr, ptr %9, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.EFI_MTFTP4_OVERRIDE_DATA, ptr %230, i32 0, i32 3
  %232 = load i16, ptr %231, align 2, !tbaa !49
  %233 = zext i16 %232 to i32
  %234 = load ptr, ptr %8, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %234, i32 0, i32 22
  store i32 %233, ptr %235, align 8, !tbaa !43
  %236 = load ptr, ptr %9, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.EFI_MTFTP4_OVERRIDE_DATA, ptr %236, i32 0, i32 4
  %238 = load i16, ptr %237, align 2, !tbaa !50
  %239 = zext i16 %238 to i32
  %240 = load ptr, ptr %8, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %240, i32 0, i32 23
  store i32 %239, ptr %241, align 4, !tbaa !45
  br label %242

242:                                              ; preds = %202, %149
  %243 = load ptr, ptr %8, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %243, i32 0, i32 15
  %245 = load i16, ptr %244, align 4, !tbaa !39
  %246 = zext i16 %245 to i32
  %247 = icmp eq i32 %246, 0
  br i1 %247, label %248, label %251

248:                                              ; preds = %242
  %249 = load ptr, ptr %8, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %249, i32 0, i32 15
  store i16 69, ptr %250, align 4, !tbaa !39
  br label %251

251:                                              ; preds = %248, %242
  %252 = load ptr, ptr %8, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %252, i32 0, i32 22
  %254 = load i32, ptr %253, align 8, !tbaa !43
  %255 = icmp eq i32 %254, 0
  br i1 %255, label %256, label %259

256:                                              ; preds = %251
  %257 = load ptr, ptr %8, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %257, i32 0, i32 22
  store i32 5, ptr %258, align 8, !tbaa !43
  br label %259

259:                                              ; preds = %256, %251
  %260 = load ptr, ptr %8, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %260, i32 0, i32 23
  %262 = load i32, ptr %261, align 4, !tbaa !45
  %263 = icmp eq i32 %262, 0
  br i1 %263, label %264, label %267

264:                                              ; preds = %259
  %265 = load ptr, ptr %8, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %265, i32 0, i32 23
  store i32 3, ptr %266, align 4, !tbaa !45
  br label %267

267:                                              ; preds = %264, %259
  %268 = load ptr, ptr %8, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %268, i32 0, i32 18
  %270 = load ptr, ptr %269, align 8, !tbaa !51
  %271 = load ptr, ptr %8, align 8, !tbaa !5
  %272 = call i64 @Mtftp4ConfigUnicastPort(ptr noundef %270, ptr noundef %271)
  store i64 %272, ptr %12, align 8, !tbaa !27
  %273 = load i64, ptr %12, align 8, !tbaa !27
  %274 = icmp slt i64 %273, 0
  br i1 %274, label %275, label %276

275:                                              ; preds = %267
  br label %320

276:                                              ; preds = %267
  %277 = load ptr, ptr %6, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %277, i32 0, i32 0
  store i64 -9223372036854775802, ptr %278, align 8, !tbaa !52
  %279 = load i16, ptr %7, align 2, !tbaa !9
  %280 = zext i16 %279 to i32
  %281 = icmp eq i32 %280, 2
  br i1 %281, label %282, label %286

282:                                              ; preds = %276
  %283 = load ptr, ptr %8, align 8, !tbaa !5
  %284 = load i16, ptr %7, align 2, !tbaa !9
  %285 = call i64 @Mtftp4WrqStart(ptr noundef %283, i16 noundef zeroext %284)
  store i64 %285, ptr %12, align 8, !tbaa !27
  br label %290

286:                                              ; preds = %276
  %287 = load ptr, ptr %8, align 8, !tbaa !5
  %288 = load i16, ptr %7, align 2, !tbaa !9
  %289 = call i64 @Mtftp4RrqStart(ptr noundef %287, i16 noundef zeroext %288)
  store i64 %289, ptr %12, align 8, !tbaa !27
  br label %290

290:                                              ; preds = %286, %282
  %291 = load ptr, ptr @gBS, align 8, !tbaa !5
  %292 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %291, i32 0, i32 2
  %293 = load ptr, ptr %292, align 8, !tbaa !33
  %294 = load i64, ptr %11, align 8, !tbaa !27
  call void %293(i64 noundef %294)
  %295 = load i64, ptr %12, align 8, !tbaa !27
  %296 = icmp slt i64 %295, 0
  br i1 %296, label %297, label %298

297:                                              ; preds = %290
  br label %320

298:                                              ; preds = %290
  %299 = load ptr, ptr %6, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %299, i32 0, i32 1
  %301 = load ptr, ptr %300, align 8, !tbaa !53
  %302 = icmp ne ptr %301, null
  br i1 %302, label %303, label %304

303:                                              ; preds = %298
  store i64 0, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %328

304:                                              ; preds = %298
  br label %305

305:                                              ; preds = %310, %304
  %306 = load ptr, ptr %6, align 8, !tbaa !5
  %307 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %306, i32 0, i32 0
  %308 = load i64, ptr %307, align 8, !tbaa !52
  %309 = icmp eq i64 %308, -9223372036854775802
  br i1 %309, label %310, label %316

310:                                              ; preds = %305
  %311 = load ptr, ptr %5, align 8, !tbaa !5
  %312 = getelementptr inbounds %struct._EFI_MTFTP4_PROTOCOL, ptr %311, i32 0, i32 7
  %313 = load ptr, ptr %312, align 8, !tbaa !54
  %314 = load ptr, ptr %5, align 8, !tbaa !5
  %315 = call i64 %313(ptr noundef %314)
  br label %305, !llvm.loop !55

316:                                              ; preds = %305
  %317 = load ptr, ptr %6, align 8, !tbaa !5
  %318 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %317, i32 0, i32 0
  %319 = load i64, ptr %318, align 8, !tbaa !52
  store i64 %319, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %328

320:                                              ; preds = %297, %275, %147, %129
  %321 = load ptr, ptr %8, align 8, !tbaa !5
  %322 = load i64, ptr %12, align 8, !tbaa !27
  call void @Mtftp4CleanOperation(ptr noundef %321, i64 noundef %322)
  %323 = load ptr, ptr @gBS, align 8, !tbaa !5
  %324 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %323, i32 0, i32 2
  %325 = load ptr, ptr %324, align 8, !tbaa !33
  %326 = load i64, ptr %11, align 8, !tbaa !27
  call void %325(i64 noundef %326)
  %327 = load i64, ptr %12, align 8, !tbaa !27
  store i64 %327, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %328

328:                                              ; preds = %320, %316, %303, %109, %68, %53, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %329 = load i64, ptr %4, align 8
  ret i64 %329
}

declare i64 @Mtftp4ParseOption(ptr noundef, i32 noundef, i8 noundef zeroext, ptr noundef) #2

declare i64 @Mtftp4WrqStart(ptr noundef, i16 noundef zeroext) #2

declare i64 @Mtftp4RrqStart(ptr noundef, i16 noundef zeroext) #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 = !{!"short", !7, i64 0}
!11 = !{!12, !6, i64 24}
!12 = !{!"_EFI_MTFTP4_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 64}
!18 = !{!12, !6, i64 80}
!19 = !{!12, !6, i64 96}
!20 = !{!21, !14, i64 0}
!21 = !{!"_MTFTP4_PROTOCOL", !14, i64 0, !22, i64 8, !23, i64 24, !13, i64 88, !7, i64 96, !6, i64 104, !6, i64 112, !24, i64 120, !6, i64 152, !26, i64 160, !10, i64 180, !10, i64 182, !10, i64 184, !22, i64 192, !14, i64 208, !10, i64 212, !10, i64 214, !14, i64 216, !6, i64 224, !6, i64 232, !14, i64 240, !14, i64 244, !14, i64 248, !14, i64 252, !14, i64 256, !10, i64 260, !7, i64 262, !6, i64 264}
!22 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!23 = !{!"_EFI_MTFTP4_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}
!24 = !{!"", !7, i64 0, !25, i64 1, !25, i64 5, !10, i64 10, !25, i64 12, !25, i64 16, !10, i64 20, !10, i64 22, !10, i64 24}
!25 = !{!"", !7, i64 0}
!26 = !{!"", !10, i64 0, !7, i64 2, !14, i64 4, !14, i64 8, !10, i64 12, !7, i64 14, !14, i64 16}
!27 = !{!13, !13, i64 0}
!28 = !{!29, !6, i64 24}
!29 = !{!"", !30, 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}
!30 = !{!"", !13, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!31 = !{!21, !13, i64 88}
!32 = !{!21, !10, i64 180}
!33 = !{!29, !6, i64 32}
!34 = !{!12, !6, i64 16}
!35 = !{!21, !6, i64 152}
!36 = !{!21, !10, i64 182}
!37 = !{!21, !14, i64 208}
!38 = !{!24, !10, i64 20}
!39 = !{!21, !10, i64 212}
!40 = !{!21, !10, i64 214}
!41 = !{!21, !14, i64 216}
!42 = !{!24, !10, i64 22}
!43 = !{!21, !14, i64 248}
!44 = !{!24, !10, i64 24}
!45 = !{!21, !14, i64 252}
!46 = !{!21, !7, i64 262}
!47 = !{!48, !10, i64 8}
!48 = !{!"", !25, i64 0, !25, i64 4, !10, i64 8, !10, i64 10, !10, i64 12}
!49 = !{!48, !10, i64 10}
!50 = !{!48, !10, i64 12}
!51 = !{!21, !6, i64 224}
!52 = !{!12, !13, i64 0}
!53 = !{!12, !6, i64 8}
!54 = !{!23, !6, i64 56}
!55 = distinct !{!55, !56}
!56 = !{!"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 = external hidden unnamed_addr constant [155 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @Mtftp4OverrideValid(ptr noundef, ptr noundef) local_unnamed_addr #0

declare i32 @SwapBytes32(i32 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local i64 @Mtftp4Start(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2) local_unnamed_addr #0 {
  %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
  switch i16 %2, label %26 [
    i16 7, label %18
    i16 1, label %18
  ]

18:                                               ; preds = %17, %17
  %19 = getelementptr inbounds i8, ptr %1, i64 64
  %20 = load ptr, ptr %19, align 8, !tbaa !14
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %26

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

26:                                               ; preds = %17, %22, %18
  %27 = icmp eq i16 %2, 2
  br i1 %27, label %28, label %36

28:                                               ; preds = %26
  %29 = getelementptr inbounds i8, ptr %1, i64 64
  %30 = load ptr, ptr %29, align 8, !tbaa !14
  %31 = icmp eq ptr %30, null
  br i1 %31, label %32, label %36

32:                                               ; preds = %28
  %33 = getelementptr inbounds i8, ptr %1, i64 96
  %34 = load ptr, ptr %33, align 8, !tbaa !16
  %35 = icmp eq ptr %34, null
  br i1 %35, label %.loopexit, label %36

36:                                               ; preds = %32, %28, %26
  %37 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not105 = icmp eq i8 %37, 0
  %.pre114 = ptrtoint ptr %0 to i64
  %.pre115 = add i64 %.pre114, -24
  %.pre117 = inttoptr i64 %.pre115 to ptr
  br i1 %.not105, label %._crit_edge113, label %38

38:                                               ; preds = %36
  %39 = load i32, ptr %.pre117, align 8, !tbaa !17
  %.not106 = icmp eq i32 %39, 1886676596
  br i1 %.not106, label %._crit_edge113, label %40

40:                                               ; preds = %38
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 393, ptr noundef nonnull @.str.5) #2
  br label %._crit_edge113

._crit_edge113:                                   ; preds = %36, %38, %40
  %41 = phi ptr [ %0, %40 ], [ %.pre117, %38 ], [ %.pre117, %36 ]
  %42 = load ptr, ptr @gBS, align 8, !tbaa !25
  %43 = getelementptr inbounds i8, ptr %42, i64 24
  %44 = load ptr, ptr %43, align 8, !tbaa !26
  %45 = tail call i64 %44(i64 noundef 8) #2
  %46 = getelementptr inbounds i8, ptr %41, i64 88
  %47 = load i64, ptr %46, align 8, !tbaa !29
  %.not107 = icmp eq i64 %47, 1
  %spec.select = select i1 %.not107, i64 0, i64 -9223372036854775789
  %48 = getelementptr inbounds i8, ptr %41, i64 180
  %49 = load i16, ptr %48, align 4, !tbaa !30
  %.not108 = icmp eq i16 %49, 0
  %.1 = select i1 %.not108, i64 %spec.select, i64 -9223372036854775793
  %50 = icmp slt i64 %.1, 0
  br i1 %50, label %.loopexit.sink.split, label %51

51:                                               ; preds = %._crit_edge113
  store i16 %2, ptr %48, align 4, !tbaa !30
  %52 = getelementptr inbounds i8, ptr %1, i64 16
  %53 = load ptr, ptr %52, align 8, !tbaa !31
  %.not109 = icmp eq ptr %53, null
  br i1 %.not109, label %56, label %54

54:                                               ; preds = %51
  %55 = tail call zeroext i8 @Mtftp4OverrideValid(ptr noundef nonnull %41, ptr noundef nonnull %53)
  %.not110 = icmp eq i8 %55, 0
  br i1 %.not110, label %144, label %56

56:                                               ; preds = %54, %51
  %57 = load i32, ptr %11, align 8, !tbaa !12
  %.not111 = icmp eq i32 %57, 0
  br i1 %.not111, label %64, label %58

58:                                               ; preds = %56
  %59 = getelementptr inbounds i8, ptr %1, i64 48
  %60 = load ptr, ptr %59, align 8, !tbaa !13
  %61 = getelementptr inbounds i8, ptr %41, i64 160
  %62 = tail call i64 @Mtftp4ParseOption(ptr noundef %60, i32 noundef %57, i8 noundef zeroext 1, ptr noundef nonnull %61) #2
  %63 = icmp slt i64 %62, 0
  br i1 %63, label %144, label %64

64:                                               ; preds = %58, %56
  %65 = getelementptr inbounds i8, ptr %41, i64 152
  store ptr %1, ptr %65, align 8, !tbaa !32
  %66 = getelementptr inbounds i8, ptr %41, i64 182
  store i16 512, ptr %66, align 2, !tbaa !33
  %67 = getelementptr inbounds i8, ptr %41, i64 208
  %68 = getelementptr inbounds i8, ptr %41, i64 136
  %69 = tail call ptr @CopyMem(ptr noundef nonnull %67, ptr noundef nonnull %68, i64 noundef 4) #2
  %70 = load i32, ptr %67, align 8, !tbaa !34
  %71 = tail call i32 @SwapBytes32(i32 noundef %70) #2
  store i32 %71, ptr %67, align 8, !tbaa !34
  %72 = getelementptr inbounds i8, ptr %41, i64 140
  %73 = load i16, ptr %72, align 2, !tbaa !35
  %74 = getelementptr inbounds i8, ptr %41, i64 212
  store i16 %73, ptr %74, align 4, !tbaa !36
  %75 = getelementptr inbounds i8, ptr %41, i64 214
  store i16 0, ptr %75, align 2, !tbaa !37
  %76 = getelementptr inbounds i8, ptr %41, i64 216
  %77 = getelementptr inbounds i8, ptr %41, i64 132
  %78 = tail call ptr @CopyMem(ptr noundef nonnull %76, ptr noundef nonnull %77, i64 noundef 4) #2
  %79 = load i32, ptr %76, align 8, !tbaa !38
  %80 = tail call i32 @SwapBytes32(i32 noundef %79) #2
  store i32 %80, ptr %76, align 8, !tbaa !38
  %81 = getelementptr inbounds i8, ptr %41, i64 142
  %82 = load i16, ptr %81, align 2, !tbaa !39
  %83 = zext i16 %82 to i32
  %84 = getelementptr inbounds i8, ptr %41, i64 248
  store i32 %83, ptr %84, align 8, !tbaa !40
  %85 = getelementptr inbounds i8, ptr %41, i64 144
  %86 = load i16, ptr %85, align 2, !tbaa !41
  %87 = zext i16 %86 to i32
  %88 = getelementptr inbounds i8, ptr %41, i64 252
  store i32 %87, ptr %88, align 4, !tbaa !42
  %89 = getelementptr inbounds i8, ptr %41, i64 262
  store i8 1, ptr %89, align 2, !tbaa !43
  br i1 %.not109, label %._crit_edge, label %90

._crit_edge:                                      ; preds = %64
  %.pre = load i16, ptr %74, align 4, !tbaa !36
  br label %106

90:                                               ; preds = %64
  %91 = getelementptr inbounds i8, ptr %53, i64 4
  %92 = tail call ptr @CopyMem(ptr noundef nonnull %67, ptr noundef nonnull %91, i64 noundef 4) #2
  %93 = tail call ptr @CopyMem(ptr noundef nonnull %76, ptr noundef nonnull %53, i64 noundef 4) #2
  %94 = load i32, ptr %67, align 8, !tbaa !34
  %95 = tail call i32 @SwapBytes32(i32 noundef %94) #2
  store i32 %95, ptr %67, align 8, !tbaa !34
  %96 = load i32, ptr %76, align 8, !tbaa !38
  %97 = tail call i32 @SwapBytes32(i32 noundef %96) #2
  store i32 %97, ptr %76, align 8, !tbaa !38
  %98 = getelementptr inbounds i8, ptr %53, i64 8
  %99 = load i16, ptr %98, align 2, !tbaa !44
  store i16 %99, ptr %74, align 4, !tbaa !36
  %100 = getelementptr inbounds i8, ptr %53, i64 10
  %101 = load i16, ptr %100, align 2, !tbaa !46
  %102 = zext i16 %101 to i32
  store i32 %102, ptr %84, align 8, !tbaa !40
  %103 = getelementptr inbounds i8, ptr %53, i64 12
  %104 = load i16, ptr %103, align 2, !tbaa !47
  %105 = zext i16 %104 to i32
  store i32 %105, ptr %88, align 4, !tbaa !42
  br label %106

106:                                              ; preds = %._crit_edge, %90
  %107 = phi i32 [ %87, %._crit_edge ], [ %105, %90 ]
  %108 = phi i32 [ %83, %._crit_edge ], [ %102, %90 ]
  %109 = phi i16 [ %.pre, %._crit_edge ], [ %99, %90 ]
  %110 = icmp eq i16 %109, 0
  br i1 %110, label %111, label %112

111:                                              ; preds = %106
  store i16 69, ptr %74, align 4, !tbaa !36
  br label %112

112:                                              ; preds = %111, %106
  %113 = icmp eq i32 %108, 0
  br i1 %113, label %114, label %115

114:                                              ; preds = %112
  store i32 5, ptr %84, align 8, !tbaa !40
  br label %115

115:                                              ; preds = %114, %112
  %116 = icmp eq i32 %107, 0
  br i1 %116, label %117, label %118

117:                                              ; preds = %115
  store i32 3, ptr %88, align 4, !tbaa !42
  br label %118

118:                                              ; preds = %117, %115
  %119 = getelementptr inbounds i8, ptr %41, i64 224
  %120 = load ptr, ptr %119, align 8, !tbaa !48
  %121 = tail call i64 @Mtftp4ConfigUnicastPort(ptr noundef %120, ptr noundef nonnull %41)
  %122 = icmp slt i64 %121, 0
  br i1 %122, label %144, label %123

123:                                              ; preds = %118
  store i64 -9223372036854775802, ptr %1, align 8, !tbaa !49
  br i1 %27, label %124, label %126

124:                                              ; preds = %123
  %125 = tail call i64 @Mtftp4WrqStart(ptr noundef nonnull %41, i16 noundef zeroext 2) #2
  br label %128

126:                                              ; preds = %123
  %127 = tail call i64 @Mtftp4RrqStart(ptr noundef nonnull %41, i16 noundef zeroext %2) #2
  br label %128

128:                                              ; preds = %126, %124
  %.2 = phi i64 [ %125, %124 ], [ %127, %126 ]
  %129 = load ptr, ptr @gBS, align 8, !tbaa !25
  %130 = getelementptr inbounds i8, ptr %129, i64 32
  %131 = load ptr, ptr %130, align 8, !tbaa !50
  tail call void %131(i64 noundef %45) #2
  %132 = icmp slt i64 %.2, 0
  br i1 %132, label %144, label %133

133:                                              ; preds = %128
  %134 = getelementptr inbounds i8, ptr %1, i64 8
  %135 = load ptr, ptr %134, align 8, !tbaa !51
  %.not112 = icmp eq ptr %135, null
  br i1 %.not112, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %133
  %136 = load i64, ptr %1, align 8, !tbaa !49
  %137 = icmp eq i64 %136, -9223372036854775802
  br i1 %137, label %.lr.ph, label %.loopexit

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

139:                                              ; preds = %.lr.ph, %139
  %140 = load ptr, ptr %138, align 8, !tbaa !52
  %141 = tail call i64 %140(ptr noundef nonnull %0) #2
  %142 = load i64, ptr %1, align 8, !tbaa !49
  %143 = icmp eq i64 %142, -9223372036854775802
  br i1 %143, label %139, label %.loopexit, !llvm.loop !53

144:                                              ; preds = %54, %128, %118, %58
  %.3 = phi i64 [ %62, %58 ], [ %121, %118 ], [ %.2, %128 ], [ -9223372036854775806, %54 ]
  tail call void @Mtftp4CleanOperation(ptr noundef nonnull %41, i64 noundef %.3)
  br label %.loopexit.sink.split

.loopexit.sink.split:                             ; preds = %._crit_edge113, %144
  %.096.ph = phi i64 [ %.3, %144 ], [ %.1, %._crit_edge113 ]
  %145 = load ptr, ptr @gBS, align 8, !tbaa !25
  %146 = getelementptr inbounds i8, ptr %145, i64 32
  %147 = load ptr, ptr %146, align 8, !tbaa !50
  tail call void %147(i64 noundef %45) #2
  br label %.loopexit

.loopexit:                                        ; preds = %139, %.loopexit.sink.split, %.preheader, %133, %32, %22, %3, %6, %13
  %.096 = phi i64 [ -9223372036854775806, %13 ], [ -9223372036854775806, %6 ], [ -9223372036854775806, %3 ], [ -9223372036854775806, %22 ], [ -9223372036854775806, %32 ], [ 0, %133 ], [ %136, %.preheader ], [ %.096.ph, %.loopexit.sink.split ], [ %142, %139 ]
  ret i64 %.096
}

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

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

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

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 = { "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_MTFTP4_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 64}
!15 = !{!6, !10, i64 80}
!16 = !{!6, !10, i64 96}
!17 = !{!18, !11, i64 0}
!18 = !{!"_MTFTP4_PROTOCOL", !11, i64 0, !19, i64 8, !20, i64 24, !7, i64 88, !8, i64 96, !10, i64 104, !10, i64 112, !21, i64 120, !10, i64 152, !24, i64 160, !23, i64 180, !23, i64 182, !23, i64 184, !19, i64 192, !11, i64 208, !23, i64 212, !23, i64 214, !11, i64 216, !10, i64 224, !10, i64 232, !11, i64 240, !11, i64 244, !11, i64 248, !11, i64 252, !11, i64 256, !23, i64 260, !8, i64 262, !10, i64 264}
!19 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!20 = !{!"_EFI_MTFTP4_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}
!21 = !{!"", !8, i64 0, !22, i64 1, !22, i64 5, !23, i64 10, !22, i64 12, !22, i64 16, !23, i64 20, !23, i64 22, !23, i64 24}
!22 = !{!"", !8, i64 0}
!23 = !{!"short", !8, i64 0}
!24 = !{!"", !23, i64 0, !8, i64 2, !11, i64 4, !11, i64 8, !23, i64 12, !8, i64 14, !11, i64 16}
!25 = !{!10, !10, i64 0}
!26 = !{!27, !10, i64 24}
!27 = !{!"", !28, 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}
!28 = !{!"", !7, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!29 = !{!18, !7, i64 88}
!30 = !{!18, !23, i64 180}
!31 = !{!6, !10, i64 16}
!32 = !{!18, !10, i64 152}
!33 = !{!18, !23, i64 182}
!34 = !{!18, !11, i64 208}
!35 = !{!21, !23, i64 20}
!36 = !{!18, !23, i64 212}
!37 = !{!18, !23, i64 214}
!38 = !{!18, !11, i64 216}
!39 = !{!21, !23, i64 22}
!40 = !{!18, !11, i64 248}
!41 = !{!21, !23, i64 24}
!42 = !{!18, !11, i64 252}
!43 = !{!18, !8, i64 262}
!44 = !{!45, !23, i64 8}
!45 = !{!"", !22, i64 0, !22, i64 4, !23, i64 8, !23, i64 10, !23, i64 12}
!46 = !{!45, !23, i64 10}
!47 = !{!45, !23, i64 12}
!48 = !{!18, !10, i64 224}
!49 = !{!6, !7, i64 0}
!50 = !{!27, !10, i64 32}
!51 = !{!6, !10, i64 8}
!52 = !{!20, !10, i64 56}
!53 = distinct !{!53, !54}
!54 = !{!"llvm.loop.mustprogress"}


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