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

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

%struct.GUID = type { i32, i16, i16, [8 x i8] }
%struct.PARTITION_PRIVATE_DATA = type { i64, ptr, ptr, %struct._EFI_BLOCK_IO_PROTOCOL, %struct._EFI_BLOCK_IO2_PROTOCOL, %struct.EFI_BLOCK_IO_MEDIA, %struct.EFI_BLOCK_IO_MEDIA, ptr, ptr, ptr, ptr, i64, i64, i32, ptr }
%struct._EFI_BLOCK_IO_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr }
%struct._EFI_BLOCK_IO2_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr }
%struct.EFI_BLOCK_IO_MEDIA = type { i32, i8, i8, i8, i8, i8, i32, i32, i64, i64, i32, i32 }
%struct.EFI_BOOT_SERVICES = type { %struct.EFI_TABLE_HEADER, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }
%struct._EFI_DRIVER_BINDING_PROTOCOL = type { ptr, ptr, ptr, i32, ptr, ptr }

@gBS = external global ptr, align 8
@gEfiDiskIoProtocolGuid = external global %struct.GUID, align 4
@gEfiDevicePathProtocolGuid = external global %struct.GUID, align 4
@gEfiBlockIoProtocolGuid = external global %struct.GUID, align 4
@gEfiBlockIo2ProtocolGuid = external global %struct.GUID, align 4
@.str = external hidden unnamed_addr constant [154 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [40 x i8], align 1
@gEfiPartTypeSystemPartGuid = external global %struct.GUID, align 4

; 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 zeroext i8 @DebugAssertEnabled() #1

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

declare void @FreePool(ptr noundef) #1

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

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

declare i64 @MultU64x32(i64 noundef, i32 noundef) #1

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @PartitionInstallChildHandle(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, i64 noundef %8, i64 noundef %9, i32 noundef %10, i8 noundef zeroext %11) #2 {
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i32, align 4
  %25 = alloca i8, align 1
  %26 = alloca i64, align 8
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  store ptr %0, ptr %14, align 8, !tbaa !5
  store ptr %1, ptr %15, align 8, !tbaa !5
  store ptr %2, ptr %16, align 8, !tbaa !5
  store ptr %3, ptr %17, align 8, !tbaa !5
  store ptr %4, ptr %18, align 8, !tbaa !5
  store ptr %5, ptr %19, align 8, !tbaa !5
  store ptr %6, ptr %20, align 8, !tbaa !5
  store ptr %7, ptr %21, align 8, !tbaa !5
  store i64 %8, ptr %22, align 8, !tbaa !9
  store i64 %9, ptr %23, align 8, !tbaa !9
  store i32 %10, ptr %24, align 4, !tbaa !11
  store i8 %11, ptr %25, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #3
  store i64 0, ptr %26, align 8, !tbaa !9
  %29 = call ptr @AllocateZeroPool(i64 noundef 272)
  store ptr %29, ptr %27, align 8, !tbaa !5
  %30 = load ptr, ptr %27, align 8, !tbaa !5
  %31 = icmp eq ptr %30, null
  br i1 %31, label %32, label %33

32:                                               ; preds = %12
  store i64 -9223372036854775799, ptr %13, align 8
  store i32 1, ptr %28, align 4
  br label %301

33:                                               ; preds = %12
  %34 = load ptr, ptr %27, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %34, i32 0, i32 0
  store i64 1953653072, ptr %35, align 8, !tbaa !14
  %36 = load i64, ptr %22, align 8, !tbaa !9
  %37 = load ptr, ptr %18, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %37, i32 0, i32 1
  %39 = load ptr, ptr %38, align 8, !tbaa !19
  %40 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %39, i32 0, i32 6
  %41 = load i32, ptr %40, align 4, !tbaa !20
  %42 = call i64 @MultU64x32(i64 noundef %36, i32 noundef %41)
  %43 = load ptr, ptr %27, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %43, i32 0, i32 11
  store i64 %42, ptr %44, align 8, !tbaa !21
  %45 = load i64, ptr %23, align 8, !tbaa !9
  %46 = add i64 %45, 1
  %47 = load ptr, ptr %18, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %47, i32 0, i32 1
  %49 = load ptr, ptr %48, align 8, !tbaa !19
  %50 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %49, i32 0, i32 6
  %51 = load i32, ptr %50, align 4, !tbaa !20
  %52 = call i64 @MultU64x32(i64 noundef %46, i32 noundef %51)
  %53 = load ptr, ptr %27, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %53, i32 0, i32 12
  store i64 %52, ptr %54, align 8, !tbaa !22
  %55 = load i32, ptr %24, align 4, !tbaa !11
  %56 = load ptr, ptr %27, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %56, i32 0, i32 13
  store i32 %55, ptr %57, align 8, !tbaa !23
  %58 = load ptr, ptr %18, align 8, !tbaa !5
  %59 = load ptr, ptr %27, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %59, i32 0, i32 9
  store ptr %58, ptr %60, align 8, !tbaa !24
  %61 = load ptr, ptr %19, align 8, !tbaa !5
  %62 = load ptr, ptr %27, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %62, i32 0, i32 10
  store ptr %61, ptr %63, align 8, !tbaa !25
  %64 = load ptr, ptr %16, align 8, !tbaa !5
  %65 = load ptr, ptr %27, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %65, i32 0, i32 7
  store ptr %64, ptr %66, align 8, !tbaa !26
  %67 = load ptr, ptr %17, align 8, !tbaa !5
  %68 = load ptr, ptr %27, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %68, i32 0, i32 8
  store ptr %67, ptr %69, align 8, !tbaa !27
  %70 = load ptr, ptr %18, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %70, i32 0, i32 0
  %72 = load i64, ptr %71, align 8, !tbaa !28
  %73 = load ptr, ptr %27, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %73, i32 0, i32 3
  %75 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %74, i32 0, i32 0
  store i64 %72, ptr %75, align 8, !tbaa !29
  %76 = load ptr, ptr %27, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %76, i32 0, i32 5
  %78 = load ptr, ptr %27, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %78, i32 0, i32 3
  %80 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %79, i32 0, i32 1
  store ptr %77, ptr %80, align 8, !tbaa !30
  %81 = load ptr, ptr %27, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %81, i32 0, i32 3
  %83 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %82, i32 0, i32 1
  %84 = load ptr, ptr %83, align 8, !tbaa !30
  %85 = load ptr, ptr %18, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %85, i32 0, i32 1
  %87 = load ptr, ptr %86, align 8, !tbaa !19
  %88 = call ptr @CopyMem(ptr noundef %84, ptr noundef %87, i64 noundef 48)
  %89 = load ptr, ptr %27, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %89, i32 0, i32 3
  %91 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %90, i32 0, i32 2
  store ptr @PartitionReset, ptr %91, align 8, !tbaa !31
  %92 = load ptr, ptr %27, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %92, i32 0, i32 3
  %94 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %93, i32 0, i32 3
  store ptr @PartitionReadBlocks, ptr %94, align 8, !tbaa !32
  %95 = load ptr, ptr %27, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %95, i32 0, i32 3
  %97 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %96, i32 0, i32 4
  store ptr @PartitionWriteBlocks, ptr %97, align 8, !tbaa !33
  %98 = load ptr, ptr %27, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %98, i32 0, i32 3
  %100 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %99, i32 0, i32 5
  store ptr @PartitionFlushBlocks, ptr %100, align 8, !tbaa !34
  %101 = load ptr, ptr %27, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %101, i32 0, i32 8
  %103 = load ptr, ptr %102, align 8, !tbaa !27
  %104 = icmp ne ptr %103, null
  br i1 %104, label %105, label %144

105:                                              ; preds = %33
  br label %106

106:                                              ; preds = %105
  %107 = call zeroext i8 @DebugAssertEnabled()
  %108 = icmp ne i8 %107, 0
  br i1 %108, label %109, label %116

109:                                              ; preds = %106
  %110 = load ptr, ptr %27, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %110, i32 0, i32 10
  %112 = load ptr, ptr %111, align 8, !tbaa !25
  %113 = icmp ne ptr %112, null
  br i1 %113, label %115, label %114

114:                                              ; preds = %109
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1178, ptr noundef @.str.2)
  br label %115

115:                                              ; preds = %114, %109
  br label %116

116:                                              ; preds = %115, %106
  br label %117

117:                                              ; preds = %116
  br label %118

118:                                              ; preds = %117
  %119 = load ptr, ptr %27, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %119, i32 0, i32 6
  %121 = load ptr, ptr %27, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %121, i32 0, i32 4
  %123 = getelementptr inbounds %struct._EFI_BLOCK_IO2_PROTOCOL, ptr %122, i32 0, i32 0
  store ptr %120, ptr %123, align 8, !tbaa !35
  %124 = load ptr, ptr %27, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %124, i32 0, i32 4
  %126 = getelementptr inbounds %struct._EFI_BLOCK_IO2_PROTOCOL, ptr %125, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8, !tbaa !35
  %128 = load ptr, ptr %19, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._EFI_BLOCK_IO2_PROTOCOL, ptr %128, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !36
  %131 = call ptr @CopyMem(ptr noundef %127, ptr noundef %130, i64 noundef 48)
  %132 = load ptr, ptr %27, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %132, i32 0, i32 4
  %134 = getelementptr inbounds %struct._EFI_BLOCK_IO2_PROTOCOL, ptr %133, i32 0, i32 1
  store ptr @PartitionResetEx, ptr %134, align 8, !tbaa !37
  %135 = load ptr, ptr %27, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %135, i32 0, i32 4
  %137 = getelementptr inbounds %struct._EFI_BLOCK_IO2_PROTOCOL, ptr %136, i32 0, i32 2
  store ptr @PartitionReadBlocksEx, ptr %137, align 8, !tbaa !38
  %138 = load ptr, ptr %27, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %138, i32 0, i32 4
  %140 = getelementptr inbounds %struct._EFI_BLOCK_IO2_PROTOCOL, ptr %139, i32 0, i32 3
  store ptr @PartitionWriteBlocksEx, ptr %140, align 8, !tbaa !39
  %141 = load ptr, ptr %27, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %141, i32 0, i32 4
  %143 = getelementptr inbounds %struct._EFI_BLOCK_IO2_PROTOCOL, ptr %142, i32 0, i32 4
  store ptr @PartitionFlushBlocksEx, ptr %143, align 8, !tbaa !40
  br label %144

144:                                              ; preds = %118, %33
  %145 = load ptr, ptr %27, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %145, i32 0, i32 5
  %147 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %146, i32 0, i32 7
  store i32 0, ptr %147, align 8, !tbaa !41
  %148 = load ptr, ptr %27, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %148, i32 0, i32 5
  %150 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %149, i32 0, i32 3
  store i8 1, ptr %150, align 2, !tbaa !42
  %151 = load i64, ptr %23, align 8, !tbaa !9
  %152 = load i64, ptr %22, align 8, !tbaa !9
  %153 = sub i64 %151, %152
  %154 = add i64 %153, 1
  %155 = load ptr, ptr %18, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %155, i32 0, i32 1
  %157 = load ptr, ptr %156, align 8, !tbaa !19
  %158 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %157, i32 0, i32 6
  %159 = load i32, ptr %158, align 4, !tbaa !20
  %160 = call i64 @MultU64x32(i64 noundef %154, i32 noundef %159)
  %161 = load i32, ptr %24, align 4, !tbaa !11
  %162 = call i64 @DivU64x32(i64 noundef %160, i32 noundef %161)
  %163 = sub i64 %162, 1
  %164 = load ptr, ptr %27, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %164, i32 0, i32 5
  %166 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %165, i32 0, i32 8
  store i64 %163, ptr %166, align 8, !tbaa !43
  %167 = load i32, ptr %24, align 4, !tbaa !11
  %168 = load ptr, ptr %27, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %168, i32 0, i32 5
  %170 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %169, i32 0, i32 6
  store i32 %167, ptr %170, align 4, !tbaa !44
  %171 = load ptr, ptr %27, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %171, i32 0, i32 6
  %173 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %172, i32 0, i32 7
  store i32 0, ptr %173, align 8, !tbaa !45
  %174 = load ptr, ptr %27, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %174, i32 0, i32 6
  %176 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %175, i32 0, i32 3
  store i8 1, ptr %176, align 2, !tbaa !46
  %177 = load ptr, ptr %27, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %177, i32 0, i32 5
  %179 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %178, i32 0, i32 8
  %180 = load i64, ptr %179, align 8, !tbaa !43
  %181 = load ptr, ptr %27, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %181, i32 0, i32 6
  %183 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %182, i32 0, i32 8
  store i64 %180, ptr %183, align 8, !tbaa !47
  %184 = load i32, ptr %24, align 4, !tbaa !11
  %185 = load ptr, ptr %27, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %185, i32 0, i32 6
  %187 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %186, i32 0, i32 6
  store i32 %184, ptr %187, align 4, !tbaa !48
  %188 = load ptr, ptr %27, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %188, i32 0, i32 3
  %190 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %189, i32 0, i32 0
  %191 = load i64, ptr %190, align 8, !tbaa !29
  %192 = icmp uge i64 %191, 131073
  br i1 %192, label %193, label %219

193:                                              ; preds = %144
  %194 = load ptr, ptr %27, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %194, i32 0, i32 5
  %196 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %195, i32 0, i32 9
  store i64 0, ptr %196, align 8, !tbaa !49
  %197 = load ptr, ptr %27, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %197, i32 0, i32 5
  %199 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %198, i32 0, i32 10
  store i32 0, ptr %199, align 8, !tbaa !50
  %200 = load ptr, ptr %27, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %200, i32 0, i32 6
  %202 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %201, i32 0, i32 9
  store i64 0, ptr %202, align 8, !tbaa !51
  %203 = load ptr, ptr %27, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %203, i32 0, i32 6
  %205 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %204, i32 0, i32 10
  store i32 0, ptr %205, align 8, !tbaa !52
  %206 = load ptr, ptr %27, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %206, i32 0, i32 3
  %208 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %207, i32 0, i32 0
  %209 = load i64, ptr %208, align 8, !tbaa !29
  %210 = icmp uge i64 %209, 131121
  br i1 %210, label %211, label %218

211:                                              ; preds = %193
  %212 = load ptr, ptr %27, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %212, i32 0, i32 5
  %214 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %213, i32 0, i32 11
  store i32 0, ptr %214, align 4, !tbaa !53
  %215 = load ptr, ptr %27, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %215, i32 0, i32 6
  %217 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %216, i32 0, i32 11
  store i32 0, ptr %217, align 4, !tbaa !54
  br label %218

218:                                              ; preds = %211, %193
  br label %219

219:                                              ; preds = %218, %144
  %220 = load ptr, ptr %20, align 8, !tbaa !5
  %221 = load ptr, ptr %21, align 8, !tbaa !5
  %222 = call ptr @AppendDevicePathNode(ptr noundef %220, ptr noundef %221)
  %223 = load ptr, ptr %27, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %223, i32 0, i32 2
  store ptr %222, ptr %224, align 8, !tbaa !55
  %225 = load ptr, ptr %27, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %225, i32 0, i32 2
  %227 = load ptr, ptr %226, align 8, !tbaa !55
  %228 = icmp eq ptr %227, null
  br i1 %228, label %229, label %231

229:                                              ; preds = %219
  %230 = load ptr, ptr %27, align 8, !tbaa !5
  call void @FreePool(ptr noundef %230)
  store i64 -9223372036854775799, ptr %13, align 8
  store i32 1, ptr %28, align 4
  br label %301

231:                                              ; preds = %219
  %232 = load i8, ptr %25, align 1, !tbaa !13
  %233 = icmp ne i8 %232, 0
  br i1 %233, label %234, label %237

234:                                              ; preds = %231
  %235 = load ptr, ptr %27, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %235, i32 0, i32 14
  store ptr @gEfiPartTypeSystemPartGuid, ptr %236, align 8, !tbaa !56
  br label %240

237:                                              ; preds = %231
  %238 = load ptr, ptr %27, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %238, i32 0, i32 14
  store ptr null, ptr %239, align 8, !tbaa !56
  br label %240

240:                                              ; preds = %237, %234
  %241 = load ptr, ptr %27, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %241, i32 0, i32 1
  store ptr null, ptr %242, align 8, !tbaa !57
  %243 = load ptr, ptr %27, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %243, i32 0, i32 8
  %245 = load ptr, ptr %244, align 8, !tbaa !27
  %246 = icmp ne ptr %245, null
  br i1 %246, label %247, label %264

247:                                              ; preds = %240
  %248 = load ptr, ptr @gBS, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %248, i32 0, i32 39
  %250 = load ptr, ptr %249, align 8, !tbaa !58
  %251 = load ptr, ptr %27, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %251, i32 0, i32 1
  %253 = load ptr, ptr %27, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %253, i32 0, i32 2
  %255 = load ptr, ptr %254, align 8, !tbaa !55
  %256 = load ptr, ptr %27, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %256, i32 0, i32 3
  %258 = load ptr, ptr %27, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %258, i32 0, i32 4
  %260 = load ptr, ptr %27, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %260, i32 0, i32 14
  %262 = load ptr, ptr %261, align 8, !tbaa !56
  %263 = call i64 (ptr, ...) %250(ptr noundef %252, ptr noundef @gEfiDevicePathProtocolGuid, ptr noundef %255, ptr noundef @gEfiBlockIoProtocolGuid, ptr noundef %257, ptr noundef @gEfiBlockIo2ProtocolGuid, ptr noundef %259, ptr noundef %262, ptr noundef null, ptr noundef null)
  store i64 %263, ptr %26, align 8, !tbaa !9
  br label %279

264:                                              ; preds = %240
  %265 = load ptr, ptr @gBS, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %265, i32 0, i32 39
  %267 = load ptr, ptr %266, align 8, !tbaa !58
  %268 = load ptr, ptr %27, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %268, i32 0, i32 1
  %270 = load ptr, ptr %27, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %270, i32 0, i32 2
  %272 = load ptr, ptr %271, align 8, !tbaa !55
  %273 = load ptr, ptr %27, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %273, i32 0, i32 3
  %275 = load ptr, ptr %27, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %275, i32 0, i32 14
  %277 = load ptr, ptr %276, align 8, !tbaa !56
  %278 = call i64 (ptr, ...) %267(ptr noundef %269, ptr noundef @gEfiDevicePathProtocolGuid, ptr noundef %272, ptr noundef @gEfiBlockIoProtocolGuid, ptr noundef %274, ptr noundef %277, ptr noundef null, ptr noundef null)
  store i64 %278, ptr %26, align 8, !tbaa !9
  br label %279

279:                                              ; preds = %264, %247
  %280 = load i64, ptr %26, align 8, !tbaa !9
  %281 = icmp slt i64 %280, 0
  br i1 %281, label %294, label %282

282:                                              ; preds = %279
  %283 = load ptr, ptr @gBS, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %283, i32 0, i32 33
  %285 = load ptr, ptr %284, align 8, !tbaa !61
  %286 = load ptr, ptr %15, align 8, !tbaa !5
  %287 = load ptr, ptr %14, align 8, !tbaa !5
  %288 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %287, i32 0, i32 5
  %289 = load ptr, ptr %288, align 8, !tbaa !62
  %290 = load ptr, ptr %27, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %290, i32 0, i32 1
  %292 = load ptr, ptr %291, align 8, !tbaa !57
  %293 = call i64 %285(ptr noundef %286, ptr noundef @gEfiDiskIoProtocolGuid, ptr noundef %16, ptr noundef %289, ptr noundef %292, i32 noundef 8)
  store i64 %293, ptr %26, align 8, !tbaa !9
  br label %299

294:                                              ; preds = %279
  %295 = load ptr, ptr %27, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.PARTITION_PRIVATE_DATA, ptr %295, i32 0, i32 2
  %297 = load ptr, ptr %296, align 8, !tbaa !55
  call void @FreePool(ptr noundef %297)
  %298 = load ptr, ptr %27, align 8, !tbaa !5
  call void @FreePool(ptr noundef %298)
  br label %299

299:                                              ; preds = %294, %282
  %300 = load i64, ptr %26, align 8, !tbaa !9
  store i64 %300, ptr %13, align 8
  store i32 1, ptr %28, align 4
  br label %301

301:                                              ; preds = %299, %229, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  %302 = load i64, ptr %13, align 8
  ret i64 %302
}

declare ptr @AllocateZeroPool(i64 noundef) #1

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

declare i64 @DivU64x32(i64 noundef, i32 noundef) #1

declare ptr @AppendDevicePathNode(ptr noundef, ptr noundef) #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 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !10, i64 0}
!15 = !{!"", !10, i64 0, !6, i64 8, !6, i64 16, !16, i64 24, !17, i64 72, !18, i64 112, !18, i64 160, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !10, i64 240, !10, i64 248, !12, i64 256, !6, i64 264}
!16 = !{!"_EFI_BLOCK_IO_PROTOCOL", !10, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!17 = !{!"_EFI_BLOCK_IO2_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!18 = !{!"", !12, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !12, i64 12, !12, i64 16, !10, i64 24, !10, i64 32, !12, i64 40, !12, i64 44}
!19 = !{!16, !6, i64 8}
!20 = !{!18, !12, i64 12}
!21 = !{!15, !10, i64 240}
!22 = !{!15, !10, i64 248}
!23 = !{!15, !12, i64 256}
!24 = !{!15, !6, i64 224}
!25 = !{!15, !6, i64 232}
!26 = !{!15, !6, i64 208}
!27 = !{!15, !6, i64 216}
!28 = !{!16, !10, i64 0}
!29 = !{!15, !10, i64 24}
!30 = !{!15, !6, i64 32}
!31 = !{!15, !6, i64 40}
!32 = !{!15, !6, i64 48}
!33 = !{!15, !6, i64 56}
!34 = !{!15, !6, i64 64}
!35 = !{!15, !6, i64 72}
!36 = !{!17, !6, i64 0}
!37 = !{!15, !6, i64 80}
!38 = !{!15, !6, i64 88}
!39 = !{!15, !6, i64 96}
!40 = !{!15, !6, i64 104}
!41 = !{!15, !12, i64 128}
!42 = !{!15, !7, i64 118}
!43 = !{!15, !10, i64 136}
!44 = !{!15, !12, i64 124}
!45 = !{!15, !12, i64 176}
!46 = !{!15, !7, i64 166}
!47 = !{!15, !10, i64 184}
!48 = !{!15, !12, i64 172}
!49 = !{!15, !10, i64 144}
!50 = !{!15, !12, i64 152}
!51 = !{!15, !10, i64 192}
!52 = !{!15, !12, i64 200}
!53 = !{!15, !12, i64 156}
!54 = !{!15, !12, i64 204}
!55 = !{!15, !6, i64 16}
!56 = !{!15, !6, i64 264}
!57 = !{!15, !6, i64 8}
!58 = !{!59, !6, i64 328}
!59 = !{!"", !60, 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}
!60 = !{!"", !10, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!61 = !{!59, !6, i64 280}
!62 = !{!63, !6, i64 40}
!63 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !6, i64 32, !6, i64 40}


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

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

@gBS = external local_unnamed_addr global ptr, align 8
@gEfiDiskIoProtocolGuid = external global %struct.GUID, align 4
@gEfiDevicePathProtocolGuid = external global %struct.GUID, align 4
@gEfiBlockIoProtocolGuid = external global %struct.GUID, align 4
@gEfiBlockIo2ProtocolGuid = external global %struct.GUID, align 4
@.str = external hidden unnamed_addr constant [154 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [40 x i8], align 1
@gEfiPartTypeSystemPartGuid = external global %struct.GUID, align 4

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #0

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

declare void @FreePool(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @PartitionReadBlocks(ptr noundef, i32 noundef, i64 noundef, i64 noundef, ptr noundef) #1

declare i64 @MultU64x32(i64 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i64 @PartitionWriteBlocks(ptr noundef, i32 noundef, i64 noundef, i64 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @PartitionFlushBlocks(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @PartitionReadBlocksEx(ptr noundef, i32 noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @PartitionWriteBlocksEx(ptr noundef, i32 noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local i64 @PartitionInstallChildHandle(ptr nocapture noundef readonly %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, i64 noundef %8, i64 noundef %9, i32 noundef %10, i8 noundef zeroext %11) local_unnamed_addr #1 {
  %13 = alloca ptr, align 8
  store ptr %2, ptr %13, align 8, !tbaa !5
  %14 = tail call ptr @AllocateZeroPool(i64 noundef 272) #2
  %15 = icmp eq ptr %14, null
  br i1 %15, label %115, label %16

16:                                               ; preds = %12
  store i64 1953653072, ptr %14, align 8, !tbaa !9
  %17 = getelementptr inbounds i8, ptr %4, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !16
  %19 = getelementptr inbounds i8, ptr %18, i64 12
  %20 = load i32, ptr %19, align 4, !tbaa !17
  %21 = tail call i64 @MultU64x32(i64 noundef %8, i32 noundef %20) #2
  %22 = getelementptr inbounds i8, ptr %14, i64 240
  store i64 %21, ptr %22, align 8, !tbaa !18
  %23 = add i64 %9, 1
  %24 = load ptr, ptr %17, align 8, !tbaa !16
  %25 = getelementptr inbounds i8, ptr %24, i64 12
  %26 = load i32, ptr %25, align 4, !tbaa !17
  %27 = tail call i64 @MultU64x32(i64 noundef %23, i32 noundef %26) #2
  %28 = getelementptr inbounds i8, ptr %14, i64 248
  store i64 %27, ptr %28, align 8, !tbaa !19
  %29 = getelementptr inbounds i8, ptr %14, i64 256
  store i32 %10, ptr %29, align 8, !tbaa !20
  %30 = getelementptr inbounds i8, ptr %14, i64 224
  store ptr %4, ptr %30, align 8, !tbaa !21
  %31 = getelementptr inbounds i8, ptr %14, i64 232
  store ptr %5, ptr %31, align 8, !tbaa !22
  %32 = getelementptr inbounds i8, ptr %14, i64 208
  store ptr %2, ptr %32, align 8, !tbaa !23
  %33 = getelementptr inbounds i8, ptr %14, i64 216
  store ptr %3, ptr %33, align 8, !tbaa !24
  %34 = load i64, ptr %4, align 8, !tbaa !25
  %35 = getelementptr inbounds i8, ptr %14, i64 24
  store i64 %34, ptr %35, align 8, !tbaa !26
  %36 = getelementptr inbounds i8, ptr %14, i64 112
  %37 = getelementptr inbounds i8, ptr %14, i64 32
  store ptr %36, ptr %37, align 8, !tbaa !27
  %38 = load ptr, ptr %17, align 8, !tbaa !16
  %39 = tail call ptr @CopyMem(ptr noundef nonnull %36, ptr noundef %38, i64 noundef 48) #2
  %40 = getelementptr inbounds i8, ptr %14, i64 40
  store ptr @PartitionReset, ptr %40, align 8, !tbaa !28
  %41 = getelementptr inbounds i8, ptr %14, i64 48
  store ptr @PartitionReadBlocks, ptr %41, align 8, !tbaa !29
  %42 = getelementptr inbounds i8, ptr %14, i64 56
  store ptr @PartitionWriteBlocks, ptr %42, align 8, !tbaa !30
  %43 = getelementptr inbounds i8, ptr %14, i64 64
  store ptr @PartitionFlushBlocks, ptr %43, align 8, !tbaa !31
  %44 = load ptr, ptr %33, align 8, !tbaa !24
  %.not = icmp eq ptr %44, null
  br i1 %.not, label %59, label %45

45:                                               ; preds = %16
  %46 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not88 = icmp eq i8 %46, 0
  br i1 %.not88, label %50, label %47

47:                                               ; preds = %45
  %48 = load ptr, ptr %31, align 8, !tbaa !22
  %.not89 = icmp eq ptr %48, null
  br i1 %.not89, label %49, label %50

49:                                               ; preds = %47
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1178, ptr noundef nonnull @.str.2) #2
  br label %50

50:                                               ; preds = %47, %49, %45
  %51 = getelementptr inbounds i8, ptr %14, i64 160
  %52 = getelementptr inbounds i8, ptr %14, i64 72
  store ptr %51, ptr %52, align 8, !tbaa !32
  %53 = load ptr, ptr %5, align 8, !tbaa !33
  %54 = tail call ptr @CopyMem(ptr noundef nonnull %51, ptr noundef %53, i64 noundef 48) #2
  %55 = getelementptr inbounds i8, ptr %14, i64 80
  store ptr @PartitionResetEx, ptr %55, align 8, !tbaa !34
  %56 = getelementptr inbounds i8, ptr %14, i64 88
  store ptr @PartitionReadBlocksEx, ptr %56, align 8, !tbaa !35
  %57 = getelementptr inbounds i8, ptr %14, i64 96
  store ptr @PartitionWriteBlocksEx, ptr %57, align 8, !tbaa !36
  %58 = getelementptr inbounds i8, ptr %14, i64 104
  store ptr @PartitionFlushBlocksEx, ptr %58, align 8, !tbaa !37
  br label %59

59:                                               ; preds = %50, %16
  %60 = getelementptr inbounds i8, ptr %14, i64 128
  store i32 0, ptr %60, align 8, !tbaa !38
  %61 = getelementptr inbounds i8, ptr %14, i64 118
  store i8 1, ptr %61, align 2, !tbaa !39
  %reass.sub = sub i64 %9, %8
  %62 = add i64 %reass.sub, 1
  %63 = load ptr, ptr %17, align 8, !tbaa !16
  %64 = getelementptr inbounds i8, ptr %63, i64 12
  %65 = load i32, ptr %64, align 4, !tbaa !17
  %66 = tail call i64 @MultU64x32(i64 noundef %62, i32 noundef %65) #2
  %67 = tail call i64 @DivU64x32(i64 noundef %66, i32 noundef %10) #2
  %68 = add i64 %67, -1
  %69 = getelementptr inbounds i8, ptr %14, i64 136
  store i64 %68, ptr %69, align 8, !tbaa !40
  %70 = getelementptr inbounds i8, ptr %14, i64 124
  store i32 %10, ptr %70, align 4, !tbaa !41
  %71 = getelementptr inbounds i8, ptr %14, i64 176
  store i32 0, ptr %71, align 8, !tbaa !42
  %72 = getelementptr inbounds i8, ptr %14, i64 166
  store i8 1, ptr %72, align 2, !tbaa !43
  %73 = getelementptr inbounds i8, ptr %14, i64 184
  store i64 %68, ptr %73, align 8, !tbaa !44
  %74 = getelementptr inbounds i8, ptr %14, i64 172
  store i32 %10, ptr %74, align 4, !tbaa !45
  %75 = load i64, ptr %35, align 8, !tbaa !26
  %76 = icmp ugt i64 %75, 131072
  br i1 %76, label %77, label %86

77:                                               ; preds = %59
  %78 = getelementptr inbounds i8, ptr %14, i64 144
  store i64 0, ptr %78, align 8, !tbaa !46
  %79 = getelementptr inbounds i8, ptr %14, i64 152
  store i32 0, ptr %79, align 8, !tbaa !47
  %80 = getelementptr inbounds i8, ptr %14, i64 192
  store i64 0, ptr %80, align 8, !tbaa !48
  %81 = getelementptr inbounds i8, ptr %14, i64 200
  store i32 0, ptr %81, align 8, !tbaa !49
  %82 = icmp ugt i64 %75, 131120
  br i1 %82, label %83, label %86

83:                                               ; preds = %77
  %84 = getelementptr inbounds i8, ptr %14, i64 156
  store i32 0, ptr %84, align 4, !tbaa !50
  %85 = getelementptr inbounds i8, ptr %14, i64 204
  store i32 0, ptr %85, align 4, !tbaa !51
  br label %86

86:                                               ; preds = %77, %83, %59
  %87 = tail call ptr @AppendDevicePathNode(ptr noundef %6, ptr noundef %7) #2
  %88 = getelementptr inbounds i8, ptr %14, i64 16
  store ptr %87, ptr %88, align 8, !tbaa !52
  %89 = icmp eq ptr %87, null
  br i1 %89, label %90, label %91

90:                                               ; preds = %86
  tail call void @FreePool(ptr noundef nonnull %14) #2
  br label %115

91:                                               ; preds = %86
  %.not90 = icmp eq i8 %11, 0
  %spec.select = select i1 %.not90, ptr null, ptr @gEfiPartTypeSystemPartGuid
  %92 = getelementptr inbounds i8, ptr %14, i64 264
  store ptr %spec.select, ptr %92, align 8
  %93 = getelementptr inbounds i8, ptr %14, i64 8
  store ptr null, ptr %93, align 8, !tbaa !53
  %94 = load ptr, ptr %33, align 8, !tbaa !24
  %.not91 = icmp eq ptr %94, null
  %95 = load ptr, ptr @gBS, align 8, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %95, i64 328
  %97 = load ptr, ptr %96, align 8, !tbaa !54
  br i1 %.not91, label %101, label %98

98:                                               ; preds = %91
  %99 = getelementptr inbounds i8, ptr %14, i64 72
  %100 = tail call i64 (ptr, ...) %97(ptr noundef nonnull %93, ptr noundef nonnull @gEfiDevicePathProtocolGuid, ptr noundef nonnull %87, ptr noundef nonnull @gEfiBlockIoProtocolGuid, ptr noundef nonnull %35, ptr noundef nonnull @gEfiBlockIo2ProtocolGuid, ptr noundef nonnull %99, ptr noundef %spec.select, ptr noundef null, ptr noundef null) #2
  br label %103

101:                                              ; preds = %91
  %102 = tail call i64 (ptr, ...) %97(ptr noundef nonnull %93, ptr noundef nonnull @gEfiDevicePathProtocolGuid, ptr noundef nonnull %87, ptr noundef nonnull @gEfiBlockIoProtocolGuid, ptr noundef nonnull %35, ptr noundef %spec.select, ptr noundef null, ptr noundef null) #2
  br label %103

103:                                              ; preds = %101, %98
  %.086 = phi i64 [ %100, %98 ], [ %102, %101 ]
  %104 = icmp slt i64 %.086, 0
  br i1 %104, label %113, label %105

105:                                              ; preds = %103
  %106 = load ptr, ptr @gBS, align 8, !tbaa !5
  %107 = getelementptr inbounds i8, ptr %106, i64 280
  %108 = load ptr, ptr %107, align 8, !tbaa !57
  %109 = getelementptr inbounds i8, ptr %0, i64 40
  %110 = load ptr, ptr %109, align 8, !tbaa !58
  %111 = load ptr, ptr %93, align 8, !tbaa !53
  %112 = call i64 %108(ptr noundef %1, ptr noundef nonnull @gEfiDiskIoProtocolGuid, ptr noundef nonnull %13, ptr noundef %110, ptr noundef %111, i32 noundef 8) #2
  br label %115

113:                                              ; preds = %103
  %114 = load ptr, ptr %88, align 8, !tbaa !52
  tail call void @FreePool(ptr noundef %114) #2
  tail call void @FreePool(ptr noundef nonnull %14) #2
  br label %115

115:                                              ; preds = %105, %113, %12, %90
  %.0 = phi i64 [ -9223372036854775799, %90 ], [ -9223372036854775799, %12 ], [ %.086, %113 ], [ %112, %105 ]
  ret i64 %.0
}

declare ptr @AllocateZeroPool(i64 noundef) local_unnamed_addr #0

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

declare i64 @DivU64x32(i64 noundef, i32 noundef) local_unnamed_addr #0

declare ptr @AppendDevicePathNode(ptr noundef, ptr noundef) 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !13, i64 72, !14, i64 112, !14, i64 160, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !11, i64 240, !11, i64 248, !15, i64 256, !6, i64 264}
!11 = !{!"long long", !7, i64 0}
!12 = !{!"_EFI_BLOCK_IO_PROTOCOL", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!13 = !{!"_EFI_BLOCK_IO2_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!14 = !{!"", !15, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !15, i64 12, !15, i64 16, !11, i64 24, !11, i64 32, !15, i64 40, !15, i64 44}
!15 = !{!"int", !7, i64 0}
!16 = !{!12, !6, i64 8}
!17 = !{!14, !15, i64 12}
!18 = !{!10, !11, i64 240}
!19 = !{!10, !11, i64 248}
!20 = !{!10, !15, i64 256}
!21 = !{!10, !6, i64 224}
!22 = !{!10, !6, i64 232}
!23 = !{!10, !6, i64 208}
!24 = !{!10, !6, i64 216}
!25 = !{!12, !11, i64 0}
!26 = !{!10, !11, i64 24}
!27 = !{!10, !6, i64 32}
!28 = !{!10, !6, i64 40}
!29 = !{!10, !6, i64 48}
!30 = !{!10, !6, i64 56}
!31 = !{!10, !6, i64 64}
!32 = !{!10, !6, i64 72}
!33 = !{!13, !6, i64 0}
!34 = !{!10, !6, i64 80}
!35 = !{!10, !6, i64 88}
!36 = !{!10, !6, i64 96}
!37 = !{!10, !6, i64 104}
!38 = !{!10, !15, i64 128}
!39 = !{!10, !7, i64 118}
!40 = !{!10, !11, i64 136}
!41 = !{!10, !15, i64 124}
!42 = !{!10, !15, i64 176}
!43 = !{!10, !7, i64 166}
!44 = !{!10, !11, i64 184}
!45 = !{!10, !15, i64 172}
!46 = !{!10, !11, i64 144}
!47 = !{!10, !15, i64 152}
!48 = !{!10, !11, i64 192}
!49 = !{!10, !15, i64 200}
!50 = !{!10, !15, i64 156}
!51 = !{!10, !15, i64 204}
!52 = !{!10, !6, i64 16}
!53 = !{!10, !6, i64 8}
!54 = !{!55, !6, i64 328}
!55 = !{!"", !56, 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}
!56 = !{!"", !11, i64 0, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20}
!57 = !{!55, !6, i64 280}
!58 = !{!59, !6, i64 40}
!59 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !15, i64 24, !6, i64 32, !6, i64 40}


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