; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Scsi (ScsiDiskWriteSectors)

; 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.SCSI_DISK_DEV = type { i32, ptr, %struct._EFI_BLOCK_IO_PROTOCOL, %struct.EFI_BLOCK_IO_MEDIA, ptr, i8, i8, i16, ptr, i64, %struct.EFI_SCSI_INQUIRY_DATA, ptr, %struct._EFI_DISK_INFO_PROTOCOL, i32, i32, %struct.ATAPI_IDENTIFY_DATA, i8 }
%struct._EFI_BLOCK_IO_PROTOCOL = type { i64, 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_SCSI_INQUIRY_DATA = type { i16, i8, i8, i8, [91 x i8] }
%struct._EFI_DISK_INFO_PROTOCOL = type { %struct.GUID, ptr, ptr, ptr, ptr }
%struct.GUID = type { i32, i16, i16, [8 x i8] }
%struct.ATAPI_IDENTIFY_DATA = type { i16, i16, i16, [7 x i16], [20 x i8], [3 x i16], [8 x i8], [40 x i8], [2 x i16], i16, i16, i16, i16, i16, [8 x i16], i16, i16, i16, i16, i16, i16, i16, [2 x i16], [2 x i16], [2 x i16], i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, [13 x i16], [4 x i16], [4 x i16], [3 x i16], i16, i16, [4 x i16], i16, [2 x i16], i16, [31 x i16], [16 x i16], [46 x i16], i16, i16, [31 x i16], i16 }

; 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

; Function Attrs: nounwind uwtable
define dso_local i64 @ScsiDiskWriteSectors(ptr noundef %0, ptr noundef %1, i64 noundef %2, i64 noundef %3) #1 {
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i8, align 1
  %19 = alloca i8, align 1
  %20 = alloca i8, align 1
  %21 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i64 %2, ptr %8, align 8, !tbaa !9
  store i64 %3, ptr %9, align 8, !tbaa !9
  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 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #3
  store i64 0, ptr %17, align 8, !tbaa !9
  %22 = load i64, ptr %9, align 8, !tbaa !9
  store i64 %22, ptr %10, align 8, !tbaa !9
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.SCSI_DISK_DEV, ptr %23, i32 0, i32 2
  %25 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %24, i32 0, i32 1
  %26 = load ptr, ptr %25, align 8, !tbaa !11
  %27 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %26, i32 0, i32 6
  %28 = load i32, ptr %27, align 4, !tbaa !21
  store i32 %28, ptr %12, align 4, !tbaa !22
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.SCSI_DISK_DEV, ptr %29, i32 0, i32 16
  %31 = load i8, ptr %30, align 8, !tbaa !23
  %32 = icmp ne i8 %31, 0
  br i1 %32, label %34, label %33

33:                                               ; preds = %4
  store i32 65535, ptr %14, align 4, !tbaa !22
  br label %35

34:                                               ; preds = %4
  store i32 -1, ptr %14, align 4, !tbaa !22
  br label %35

35:                                               ; preds = %34, %33
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %36, ptr %11, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %117, %35
  %38 = load i64, ptr %10, align 8, !tbaa !9
  %39 = icmp ugt i64 %38, 0
  br i1 %39, label %40, label %135

40:                                               ; preds = %37
  %41 = load i64, ptr %10, align 8, !tbaa !9
  %42 = load i32, ptr %14, align 4, !tbaa !22
  %43 = zext i32 %42 to i64
  %44 = icmp ule i64 %41, %43
  br i1 %44, label %45, label %58

45:                                               ; preds = %40
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.SCSI_DISK_DEV, ptr %46, i32 0, i32 16
  %48 = load i8, ptr %47, align 8, !tbaa !23
  %49 = icmp ne i8 %48, 0
  br i1 %49, label %54, label %50

50:                                               ; preds = %45
  %51 = load i64, ptr %10, align 8, !tbaa !9
  %52 = trunc i64 %51 to i16
  %53 = zext i16 %52 to i32
  store i32 %53, ptr %15, align 4, !tbaa !22
  br label %57

54:                                               ; preds = %45
  %55 = load i64, ptr %10, align 8, !tbaa !9
  %56 = trunc i64 %55 to i32
  store i32 %56, ptr %15, align 4, !tbaa !22
  br label %57

57:                                               ; preds = %54, %50
  br label %60

58:                                               ; preds = %40
  %59 = load i32, ptr %14, align 4, !tbaa !22
  store i32 %59, ptr %15, align 4, !tbaa !22
  br label %60

60:                                               ; preds = %58, %57
  %61 = load i32, ptr %15, align 4, !tbaa !22
  %62 = load i32, ptr %12, align 4, !tbaa !22
  %63 = mul i32 %61, %62
  store i32 %63, ptr %13, align 4, !tbaa !22
  %64 = load i32, ptr %13, align 4, !tbaa !22
  %65 = udiv i32 %64, 2100000
  %66 = add i32 %65, 31
  %67 = zext i32 %66 to i64
  %68 = call i64 @MultU64x32(i64 noundef %67, i32 noundef 10000000)
  store i64 %68, ptr %16, align 8, !tbaa !9
  store i8 2, ptr %19, align 1, !tbaa !24
  store i8 0, ptr %18, align 1, !tbaa !24
  br label %69

69:                                               ; preds = %104, %60
  %70 = load i8, ptr %18, align 1, !tbaa !24
  %71 = zext i8 %70 to i32
  %72 = load i8, ptr %19, align 1, !tbaa !24
  %73 = zext i8 %72 to i32
  %74 = icmp slt i32 %71, %73
  br i1 %74, label %75, label %107

75:                                               ; preds = %69
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.SCSI_DISK_DEV, ptr %76, i32 0, i32 16
  %78 = load i8, ptr %77, align 8, !tbaa !23
  %79 = icmp ne i8 %78, 0
  br i1 %79, label %88, label %80

80:                                               ; preds = %75
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = load i64, ptr %16, align 8, !tbaa !9
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = load i64, ptr %8, align 8, !tbaa !9
  %85 = trunc i64 %84 to i32
  %86 = load i32, ptr %15, align 4, !tbaa !22
  %87 = call i64 @ScsiDiskWrite10(ptr noundef %81, ptr noundef %20, i64 noundef %82, ptr noundef %83, ptr noundef %13, i32 noundef %85, i32 noundef %86)
  store i64 %87, ptr %17, align 8, !tbaa !9
  br label %95

88:                                               ; preds = %75
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = load i64, ptr %16, align 8, !tbaa !9
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = load i64, ptr %8, align 8, !tbaa !9
  %93 = load i32, ptr %15, align 4, !tbaa !22
  %94 = call i64 @ScsiDiskWrite16(ptr noundef %89, ptr noundef %20, i64 noundef %90, ptr noundef %91, ptr noundef %13, i64 noundef %92, i32 noundef %93)
  store i64 %94, ptr %17, align 8, !tbaa !9
  br label %95

95:                                               ; preds = %88, %80
  %96 = load i64, ptr %17, align 8, !tbaa !9
  %97 = icmp slt i64 %96, 0
  br i1 %97, label %99, label %98

98:                                               ; preds = %95
  br label %107

99:                                               ; preds = %95
  %100 = load i8, ptr %20, align 1, !tbaa !24
  %101 = icmp ne i8 %100, 0
  br i1 %101, label %103, label %102

102:                                              ; preds = %99
  store i64 -9223372036854775801, ptr %5, align 8
  store i32 1, ptr %21, align 4
  br label %136

103:                                              ; preds = %99
  br label %104

104:                                              ; preds = %103
  %105 = load i8, ptr %18, align 1, !tbaa !24
  %106 = add i8 %105, 1
  store i8 %106, ptr %18, align 1, !tbaa !24
  br label %69, !llvm.loop !25

107:                                              ; preds = %98, %69
  %108 = load i8, ptr %18, align 1, !tbaa !24
  %109 = zext i8 %108 to i32
  %110 = load i8, ptr %19, align 1, !tbaa !24
  %111 = zext i8 %110 to i32
  %112 = icmp eq i32 %109, %111
  br i1 %112, label %113, label %117

113:                                              ; preds = %107
  %114 = load i64, ptr %17, align 8, !tbaa !9
  %115 = icmp ne i64 %114, 0
  br i1 %115, label %116, label %117

116:                                              ; preds = %113
  store i64 -9223372036854775801, ptr %5, align 8
  store i32 1, ptr %21, align 4
  br label %136

117:                                              ; preds = %113, %107
  %118 = load i32, ptr %13, align 4, !tbaa !22
  %119 = load i32, ptr %12, align 4, !tbaa !22
  %120 = udiv i32 %118, %119
  store i32 %120, ptr %15, align 4, !tbaa !22
  %121 = load i32, ptr %15, align 4, !tbaa !22
  %122 = zext i32 %121 to i64
  %123 = load i64, ptr %8, align 8, !tbaa !9
  %124 = add i64 %123, %122
  store i64 %124, ptr %8, align 8, !tbaa !9
  %125 = load ptr, ptr %11, align 8, !tbaa !5
  %126 = load i32, ptr %15, align 4, !tbaa !22
  %127 = load i32, ptr %12, align 4, !tbaa !22
  %128 = mul i32 %126, %127
  %129 = zext i32 %128 to i64
  %130 = getelementptr inbounds i8, ptr %125, i64 %129
  store ptr %130, ptr %11, align 8, !tbaa !5
  %131 = load i32, ptr %15, align 4, !tbaa !22
  %132 = zext i32 %131 to i64
  %133 = load i64, ptr %10, align 8, !tbaa !9
  %134 = sub i64 %133, %132
  store i64 %134, ptr %10, align 8, !tbaa !9
  br label %37, !llvm.loop !27

135:                                              ; preds = %37
  store i64 0, ptr %5, align 8
  store i32 1, ptr %21, align 4
  br label %136

136:                                              ; preds = %135, %116, %102
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, 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
  %137 = load i64, ptr %5, align 8
  ret i64 %137
}

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 24}
!12 = !{!"", !13, i64 0, !6, i64 8, !14, i64 16, !15, i64 64, !6, i64 112, !7, i64 120, !7, i64 121, !16, i64 122, !6, i64 128, !10, i64 136, !17, i64 144, !6, i64 240, !18, i64 248, !13, i64 296, !13, i64 300, !20, i64 304, !7, i64 816}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_EFI_BLOCK_IO_PROTOCOL", !10, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!15 = !{!"", !13, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !13, i64 12, !13, i64 16, !10, i64 24, !10, i64 32, !13, i64 40, !13, i64 44}
!16 = !{!"short", !7, i64 0}
!17 = !{!"", !7, i64 0, !7, i64 0, !7, i64 1, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5}
!18 = !{!"_EFI_DISK_INFO_PROTOCOL", !19, i64 0, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!19 = !{!"", !13, i64 0, !16, i64 4, !16, i64 6, !7, i64 8}
!20 = !{!"", !16, i64 0, !16, i64 2, !16, i64 4, !7, i64 6, !7, i64 20, !7, i64 40, !7, i64 46, !7, i64 54, !7, i64 94, !16, i64 98, !16, i64 100, !16, i64 102, !16, i64 104, !16, i64 106, !7, i64 108, !16, i64 124, !16, i64 126, !16, i64 128, !16, i64 130, !16, i64 132, !16, i64 134, !16, i64 136, !7, i64 138, !7, i64 142, !7, i64 146, !16, i64 150, !16, i64 152, !16, i64 154, !16, i64 156, !16, i64 158, !16, i64 160, !16, i64 162, !16, i64 164, !16, i64 166, !16, i64 168, !16, i64 170, !16, i64 172, !16, i64 174, !16, i64 176, !16, i64 178, !16, i64 180, !16, i64 182, !16, i64 184, !16, i64 186, !16, i64 188, !7, i64 190, !7, i64 216, !7, i64 224, !7, i64 232, !16, i64 238, !16, i64 240, !7, i64 242, !16, i64 250, !7, i64 252, !16, i64 256, !7, i64 258, !7, i64 320, !7, i64 352, !16, i64 444, !16, i64 446, !7, i64 448, !16, i64 510}
!21 = !{!15, !13, i64 12}
!22 = !{!13, !13, i64 0}
!23 = !{!12, !7, i64 816}
!24 = !{!7, !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}


; 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"

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775801, 1) i64 @ScsiDiskWriteSectors(ptr noundef %0, ptr noundef %1, i64 noundef %2, i64 noundef %3) local_unnamed_addr #1 {
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #3
  %7 = getelementptr inbounds i8, ptr %0, i64 24
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %8, i64 12
  %10 = load i32, ptr %9, align 4, !tbaa !19
  %11 = getelementptr inbounds i8, ptr %0, i64 816
  %12 = load i8, ptr %11, align 8, !tbaa !20
  %.not = icmp eq i8 %12, 0
  %. = select i1 %.not, i32 65535, i32 -1
  %.not4762 = icmp eq i64 %3, 0
  br i1 %.not4762, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %4
  %13 = zext i32 %. to i64
  br label %14

14:                                               ; preds = %.lr.ph, %.thread
  %.04265 = phi i64 [ %2, %.lr.ph ], [ %46, %.thread ]
  %.04564 = phi i64 [ %3, %.lr.ph ], [ %50, %.thread ]
  %.04663 = phi ptr [ %1, %.lr.ph ], [ %49, %.thread ]
  %.not48 = icmp ugt i64 %.04564, %13
  br i1 %.not48, label %19, label %15

15:                                               ; preds = %14
  %16 = load i8, ptr %11, align 8, !tbaa !20
  %.not49 = icmp eq i8 %16, 0
  %17 = trunc i64 %.04564 to i32
  %18 = and i32 %17, 65535
  %spec.select = select i1 %.not49, i32 %18, i32 %17
  br label %19

19:                                               ; preds = %15, %14
  %.043 = phi i32 [ %., %14 ], [ %spec.select, %15 ]
  %20 = mul i32 %.043, %10
  store i32 %20, ptr %5, align 4, !tbaa !21
  %21 = udiv i32 %20, 2100000
  %22 = add nuw nsw i32 %21, 31
  %23 = zext nneg i32 %22 to i64
  %24 = call i64 @MultU64x32(i64 noundef %23, i32 noundef 10000000) #3
  %25 = trunc i64 %.04265 to i32
  %26 = load i8, ptr %11, align 8, !tbaa !20
  %.not50 = icmp eq i8 %26, 0
  br i1 %.not50, label %27, label %29

27:                                               ; preds = %19
  %28 = call i64 @ScsiDiskWrite10(ptr noundef nonnull %0, ptr noundef nonnull %6, i64 noundef %24, ptr noundef %.04663, ptr noundef nonnull %5, i32 noundef %25, i32 noundef %.043)
  br label %31

29:                                               ; preds = %19
  %30 = call i64 @ScsiDiskWrite16(ptr noundef nonnull %0, ptr noundef nonnull %6, i64 noundef %24, ptr noundef %.04663, ptr noundef nonnull %5, i64 noundef %.04265, i32 noundef %.043)
  br label %31

31:                                               ; preds = %29, %27
  %.2 = phi i64 [ %30, %29 ], [ %28, %27 ]
  %32 = icmp slt i64 %.2, 0
  br i1 %32, label %33, label %.thread

33:                                               ; preds = %31
  %34 = load i8, ptr %6, align 1, !tbaa !22
  %.not51 = icmp eq i8 %34, 0
  br i1 %.not51, label %.loopexit, label %35

35:                                               ; preds = %33
  %36 = load i8, ptr %11, align 8, !tbaa !20
  %.not50.1 = icmp eq i8 %36, 0
  br i1 %.not50.1, label %39, label %37

37:                                               ; preds = %35
  %38 = call i64 @ScsiDiskWrite16(ptr noundef nonnull %0, ptr noundef nonnull %6, i64 noundef %24, ptr noundef %.04663, ptr noundef nonnull %5, i64 noundef %.04265, i32 noundef %.043)
  br label %41

39:                                               ; preds = %35
  %40 = call i64 @ScsiDiskWrite10(ptr noundef nonnull %0, ptr noundef nonnull %6, i64 noundef %24, ptr noundef %.04663, ptr noundef nonnull %5, i32 noundef %25, i32 noundef %.043)
  br label %41

41:                                               ; preds = %39, %37
  %.2.1 = phi i64 [ %38, %37 ], [ %40, %39 ]
  %42 = icmp slt i64 %.2.1, 0
  br i1 %42, label %.loopexit, label %.thread

.thread:                                          ; preds = %31, %41
  %43 = load i32, ptr %5, align 4, !tbaa !21
  %44 = udiv i32 %43, %10
  %45 = zext i32 %44 to i64
  %46 = add i64 %.04265, %45
  %47 = mul i32 %44, %10
  %48 = zext i32 %47 to i64
  %49 = getelementptr inbounds i8, ptr %.04663, i64 %48
  %50 = sub i64 %.04564, %45
  %.not47 = icmp eq i64 %50, 0
  br i1 %.not47, label %.loopexit, label %14, !llvm.loop !23

.loopexit:                                        ; preds = %.thread, %33, %41, %4
  %.0 = phi i64 [ 0, %4 ], [ -9223372036854775801, %41 ], [ 0, %.thread ], [ -9223372036854775801, %33 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  ret i64 %.0
}

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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, !10, i64 24}
!6 = !{!"", !7, i64 0, !10, i64 8, !11, i64 16, !13, i64 64, !10, i64 112, !8, i64 120, !8, i64 121, !14, i64 122, !10, i64 128, !12, i64 136, !15, i64 144, !10, i64 240, !16, i64 248, !7, i64 296, !7, i64 300, !18, i64 304, !8, i64 816}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_EFI_BLOCK_IO_PROTOCOL", !12, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!12 = !{!"long long", !8, i64 0}
!13 = !{!"", !7, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7, !8, i64 8, !7, i64 12, !7, i64 16, !12, i64 24, !12, i64 32, !7, i64 40, !7, i64 44}
!14 = !{!"short", !8, i64 0}
!15 = !{!"", !8, i64 0, !8, i64 0, !8, i64 1, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5}
!16 = !{!"_EFI_DISK_INFO_PROTOCOL", !17, i64 0, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!17 = !{!"", !7, i64 0, !14, i64 4, !14, i64 6, !8, i64 8}
!18 = !{!"", !14, i64 0, !14, i64 2, !14, i64 4, !8, i64 6, !8, i64 20, !8, i64 40, !8, i64 46, !8, i64 54, !8, i64 94, !14, i64 98, !14, i64 100, !14, i64 102, !14, i64 104, !14, i64 106, !8, i64 108, !14, i64 124, !14, i64 126, !14, i64 128, !14, i64 130, !14, i64 132, !14, i64 134, !14, i64 136, !8, i64 138, !8, i64 142, !8, i64 146, !14, i64 150, !14, i64 152, !14, i64 154, !14, i64 156, !14, i64 158, !14, i64 160, !14, i64 162, !14, i64 164, !14, i64 166, !14, i64 168, !14, i64 170, !14, i64 172, !14, i64 174, !14, i64 176, !14, i64 178, !14, i64 180, !14, i64 182, !14, i64 184, !14, i64 186, !14, i64 188, !8, i64 190, !8, i64 216, !8, i64 224, !8, i64 232, !14, i64 238, !14, i64 240, !8, i64 242, !14, i64 250, !8, i64 252, !14, i64 256, !8, i64 258, !8, i64 320, !8, i64 352, !14, i64 444, !14, i64 446, !8, i64 448, !14, i64 510}
!19 = !{!13, !7, i64 12}
!20 = !{!6, !8, i64 816}
!21 = !{!7, !7, i64 0}
!22 = !{!8, !8, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass