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

; 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 }
%struct._EFI_SCSI_IO_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, i32 }

; 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 i64 @MultU64x32(i64 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @ScsiDiskTestUnitReady(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i8, align 1
  %12 = alloca i8, align 1
  %13 = alloca i8, align 1
  %14 = alloca i8, align 1
  %15 = alloca i8, align 1
  %16 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #3
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.SCSI_DISK_DEV, ptr %17, i32 0, i32 9
  %19 = load i64, ptr %18, align 8, !tbaa !9
  %20 = mul i64 %19, 18
  %21 = trunc i64 %20 to i8
  store i8 %21, ptr %11, align 1, !tbaa !20
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 0, ptr %22, align 8, !tbaa !21
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.SCSI_DISK_DEV, ptr %23, i32 0, i32 4
  %25 = load ptr, ptr %24, align 8, !tbaa !22
  %26 = call i64 @MultU64x32(i64 noundef 3, i32 noundef 10000000)
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.SCSI_DISK_DEV, ptr %27, i32 0, i32 8
  %29 = load ptr, ptr %28, align 8, !tbaa !23
  %30 = call i64 @ScsiTestUnitReadyCommand(ptr noundef %25, i64 noundef %26, ptr noundef %29, ptr noundef %11, ptr noundef %12, ptr noundef %13)
  store i64 %30, ptr %10, align 8, !tbaa !21
  %31 = load i64, ptr %10, align 8, !tbaa !21
  %32 = icmp eq i64 %31, -9223372036854775802
  br i1 %32, label %33, label %35

33:                                               ; preds = %4
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  store i8 1, ptr %34, align 1, !tbaa !20
  store i64 -9223372036854775801, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %131

35:                                               ; preds = %4
  %36 = load i64, ptr %10, align 8, !tbaa !21
  %37 = icmp eq i64 %36, -9223372036854775806
  br i1 %37, label %41, label %38

38:                                               ; preds = %35
  %39 = load i64, ptr %10, align 8, !tbaa !21
  %40 = icmp eq i64 %39, -9223372036854775805
  br i1 %40, label %41, label %43

41:                                               ; preds = %38, %35
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  store i8 0, ptr %42, align 1, !tbaa !20
  store i64 -9223372036854775801, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %131

43:                                               ; preds = %38
  br label %44

44:                                               ; preds = %43
  %45 = load i8, ptr %12, align 1, !tbaa !20
  %46 = call i64 @CheckHostAdapterStatus(i8 noundef zeroext %45)
  store i64 %46, ptr %10, align 8, !tbaa !21
  %47 = load i64, ptr %10, align 8, !tbaa !21
  %48 = icmp eq i64 %47, -9223372036854775790
  br i1 %48, label %52, label %49

49:                                               ; preds = %44
  %50 = load i64, ptr %10, align 8, !tbaa !21
  %51 = icmp eq i64 %50, -9223372036854775802
  br i1 %51, label %52, label %54

52:                                               ; preds = %49, %44
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  store i8 1, ptr %53, align 1, !tbaa !20
  store i64 -9223372036854775801, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %131

54:                                               ; preds = %49
  %55 = load i64, ptr %10, align 8, !tbaa !21
  %56 = icmp eq i64 %55, -9223372036854775801
  br i1 %56, label %57, label %68

57:                                               ; preds = %54
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.SCSI_DISK_DEV, ptr %58, i32 0, i32 4
  %60 = load ptr, ptr %59, align 8, !tbaa !22
  %61 = getelementptr inbounds %struct._EFI_SCSI_IO_PROTOCOL, ptr %60, i32 0, i32 2
  %62 = load ptr, ptr %61, align 8, !tbaa !24
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.SCSI_DISK_DEV, ptr %63, i32 0, i32 4
  %65 = load ptr, ptr %64, align 8, !tbaa !22
  %66 = call i64 %62(ptr noundef %65)
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  store i8 0, ptr %67, align 1, !tbaa !20
  store i64 -9223372036854775801, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %131

68:                                               ; preds = %54
  br label %69

69:                                               ; preds = %68
  %70 = load i8, ptr %13, align 1, !tbaa !20
  %71 = call i64 @CheckTargetStatus(i8 noundef zeroext %70)
  store i64 %71, ptr %10, align 8, !tbaa !21
  %72 = load i64, ptr %10, align 8, !tbaa !21
  %73 = icmp eq i64 %72, -9223372036854775802
  br i1 %73, label %74, label %85

74:                                               ; preds = %69
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.SCSI_DISK_DEV, ptr %75, i32 0, i32 4
  %77 = load ptr, ptr %76, align 8, !tbaa !22
  %78 = getelementptr inbounds %struct._EFI_SCSI_IO_PROTOCOL, ptr %77, i32 0, i32 3
  %79 = load ptr, ptr %78, align 8, !tbaa !26
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.SCSI_DISK_DEV, ptr %80, i32 0, i32 4
  %82 = load ptr, ptr %81, align 8, !tbaa !22
  %83 = call i64 %79(ptr noundef %82)
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  store i8 1, ptr %84, align 1, !tbaa !20
  store i64 -9223372036854775801, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %131

85:                                               ; preds = %69
  %86 = load i64, ptr %10, align 8, !tbaa !21
  %87 = icmp eq i64 %86, -9223372036854775801
  br i1 %87, label %88, label %90

88:                                               ; preds = %85
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  store i8 0, ptr %89, align 1, !tbaa !20
  store i64 -9223372036854775801, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %131

90:                                               ; preds = %85
  br label %91

91:                                               ; preds = %90
  %92 = load i8, ptr %11, align 1, !tbaa !20
  %93 = zext i8 %92 to i32
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %104

95:                                               ; preds = %91
  %96 = load i8, ptr %11, align 1, !tbaa !20
  %97 = zext i8 %96 to i64
  %98 = udiv i64 %97, 18
  %99 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 %98, ptr %99, align 8, !tbaa !21
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.SCSI_DISK_DEV, ptr %100, i32 0, i32 8
  %102 = load ptr, ptr %101, align 8, !tbaa !23
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %102, ptr %103, align 8, !tbaa !5
  store i64 0, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %131

104:                                              ; preds = %91
  store i8 3, ptr %15, align 1, !tbaa !20
  store i8 0, ptr %14, align 1, !tbaa !20
  br label %105

105:                                              ; preds = %126, %104
  %106 = load i8, ptr %14, align 1, !tbaa !20
  %107 = zext i8 %106 to i32
  %108 = load i8, ptr %15, align 1, !tbaa !20
  %109 = zext i8 %108 to i32
  %110 = icmp slt i32 %107, %109
  br i1 %110, label %111, label %129

111:                                              ; preds = %105
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = load ptr, ptr %8, align 8, !tbaa !5
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = call i64 @ScsiDiskRequestSenseKeys(ptr noundef %112, ptr noundef %113, ptr noundef %114, ptr noundef %115, i8 noundef zeroext 0)
  store i64 %116, ptr %10, align 8, !tbaa !21
  %117 = load i64, ptr %10, align 8, !tbaa !21
  %118 = icmp slt i64 %117, 0
  br i1 %118, label %120, label %119

119:                                              ; preds = %111
  store i64 0, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %131

120:                                              ; preds = %111
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  %122 = load i8, ptr %121, align 1, !tbaa !20
  %123 = icmp ne i8 %122, 0
  br i1 %123, label %125, label %124

124:                                              ; preds = %120
  store i64 -9223372036854775801, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %131

125:                                              ; preds = %120
  br label %126

126:                                              ; preds = %125
  %127 = load i8, ptr %14, align 1, !tbaa !20
  %128 = add i8 %127, 1
  store i8 %128, ptr %14, align 1, !tbaa !20
  br label %105, !llvm.loop !27

129:                                              ; preds = %105
  %130 = load ptr, ptr %7, align 8, !tbaa !5
  store i8 0, ptr %130, align 1, !tbaa !20
  store i64 -9223372036854775801, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %131

131:                                              ; preds = %129, %124, %119, %95, %88, %74, %57, %52, %41, %33
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  %132 = load i64, ptr %5, align 8
  ret i64 %132
}

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

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

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

declare i64 @ScsiTestUnitReadyCommand(ptr noundef, i64 noundef, ptr noundef, ptr noundef, 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, !13, i64 136}
!10 = !{!"", !11, i64 0, !6, i64 8, !12, i64 16, !14, i64 64, !6, i64 112, !7, i64 120, !7, i64 121, !15, i64 122, !6, i64 128, !13, i64 136, !16, i64 144, !6, i64 240, !17, i64 248, !11, i64 296, !11, i64 300, !19, i64 304, !7, i64 816}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_EFI_BLOCK_IO_PROTOCOL", !13, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"", !11, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !11, i64 12, !11, i64 16, !13, i64 24, !13, i64 32, !11, i64 40, !11, i64 44}
!15 = !{!"short", !7, i64 0}
!16 = !{!"", !7, i64 0, !7, i64 0, !7, i64 1, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5}
!17 = !{!"_EFI_DISK_INFO_PROTOCOL", !18, i64 0, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!18 = !{!"", !11, i64 0, !15, i64 4, !15, i64 6, !7, i64 8}
!19 = !{!"", !15, i64 0, !15, i64 2, !15, i64 4, !7, i64 6, !7, i64 20, !7, i64 40, !7, i64 46, !7, i64 54, !7, i64 94, !15, i64 98, !15, i64 100, !15, i64 102, !15, i64 104, !15, i64 106, !7, i64 108, !15, i64 124, !15, i64 126, !15, i64 128, !15, i64 130, !15, i64 132, !15, i64 134, !15, i64 136, !7, i64 138, !7, i64 142, !7, i64 146, !15, i64 150, !15, i64 152, !15, i64 154, !15, i64 156, !15, i64 158, !15, i64 160, !15, i64 162, !15, i64 164, !15, i64 166, !15, i64 168, !15, i64 170, !15, i64 172, !15, i64 174, !15, i64 176, !15, i64 178, !15, i64 180, !15, i64 182, !15, i64 184, !15, i64 186, !15, i64 188, !7, i64 190, !7, i64 216, !7, i64 224, !7, i64 232, !15, i64 238, !15, i64 240, !7, i64 242, !15, i64 250, !7, i64 252, !15, i64 256, !7, i64 258, !7, i64 320, !7, i64 352, !15, i64 444, !15, i64 446, !7, i64 448, !15, i64 510}
!20 = !{!7, !7, i64 0}
!21 = !{!13, !13, i64 0}
!22 = !{!10, !6, i64 112}
!23 = !{!10, !6, i64 128}
!24 = !{!25, !6, i64 16}
!25 = !{!"_EFI_SCSI_IO_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40}
!26 = !{!25, !6, i64 24}
!27 = distinct !{!27, !28}
!28 = !{!"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"

; 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

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775801, 1) i64 @ScsiDiskTestUnitReady(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #2 {
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #3
  %8 = getelementptr inbounds i8, ptr %0, i64 136
  %9 = load i64, ptr %8, align 8, !tbaa !5
  %10 = trunc i64 %9 to i8
  %11 = mul i8 %10, 18
  store i8 %11, ptr %5, align 1, !tbaa !19
  store i64 0, ptr %3, align 8, !tbaa !20
  %12 = getelementptr inbounds i8, ptr %0, i64 112
  %13 = load ptr, ptr %12, align 8, !tbaa !21
  %14 = tail call i64 @MultU64x32(i64 noundef 3, i32 noundef 10000000) #3
  %15 = getelementptr inbounds i8, ptr %0, i64 128
  %16 = load ptr, ptr %15, align 8, !tbaa !22
  %17 = call i64 @ScsiTestUnitReadyCommand(ptr noundef %13, i64 noundef %14, ptr noundef %16, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7) #3
  %18 = icmp eq i64 %17, -9223372036854775802
  br i1 %18, label %19, label %20

19:                                               ; preds = %4
  store i8 1, ptr %1, align 1, !tbaa !19
  br label %.loopexit

20:                                               ; preds = %4
  %21 = and i64 %17, -2
  %or.cond = icmp eq i64 %21, -9223372036854775806
  br i1 %or.cond, label %22, label %23

22:                                               ; preds = %20
  store i8 0, ptr %1, align 1, !tbaa !19
  br label %.loopexit

23:                                               ; preds = %20
  %24 = load i8, ptr %6, align 1, !tbaa !19
  %25 = call i64 @CheckHostAdapterStatus(i8 noundef zeroext %24)
  switch i64 %25, label %32 [
    i64 -9223372036854775790, label %26
    i64 -9223372036854775802, label %26
    i64 -9223372036854775801, label %27
  ]

26:                                               ; preds = %23, %23
  store i8 1, ptr %1, align 1, !tbaa !19
  br label %.loopexit

27:                                               ; preds = %23
  %28 = load ptr, ptr %12, align 8, !tbaa !21
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  %30 = load ptr, ptr %29, align 8, !tbaa !23
  %31 = call i64 %30(ptr noundef %28) #3
  store i8 0, ptr %1, align 1, !tbaa !19
  br label %.loopexit

32:                                               ; preds = %23
  %33 = load i8, ptr %7, align 1, !tbaa !19
  %34 = call i64 @CheckTargetStatus(i8 noundef zeroext %33)
  switch i64 %34, label %41 [
    i64 -9223372036854775802, label %35
    i64 -9223372036854775801, label %40
  ]

35:                                               ; preds = %32
  %36 = load ptr, ptr %12, align 8, !tbaa !21
  %37 = getelementptr inbounds i8, ptr %36, i64 24
  %38 = load ptr, ptr %37, align 8, !tbaa !25
  %39 = call i64 %38(ptr noundef %36) #3
  store i8 1, ptr %1, align 1, !tbaa !19
  br label %.loopexit

40:                                               ; preds = %32
  store i8 0, ptr %1, align 1, !tbaa !19
  br label %.loopexit

41:                                               ; preds = %32
  %42 = load i8, ptr %5, align 1, !tbaa !19
  %.not = icmp eq i8 %42, 0
  br i1 %.not, label %.preheader.preheader, label %45

.preheader.preheader:                             ; preds = %41
  %43 = call i64 @ScsiDiskRequestSenseKeys(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %2, ptr noundef nonnull %3, i8 noundef zeroext 0)
  %44 = icmp slt i64 %43, 0
  br i1 %44, label %58, label %.loopexit

45:                                               ; preds = %41
  %46 = udiv i8 %42, 18
  %47 = zext nneg i8 %46 to i64
  store i64 %47, ptr %3, align 8, !tbaa !20
  %48 = load ptr, ptr %15, align 8, !tbaa !22
  store ptr %48, ptr %2, align 8, !tbaa !26
  br label %.loopexit

.preheader.1:                                     ; preds = %58
  %49 = call i64 @ScsiDiskRequestSenseKeys(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef %2, ptr noundef nonnull %3, i8 noundef zeroext 0)
  %50 = icmp slt i64 %49, 0
  br i1 %50, label %51, label %.loopexit

51:                                               ; preds = %.preheader.1
  %52 = load i8, ptr %1, align 1, !tbaa !19
  %.not42.1 = icmp eq i8 %52, 0
  br i1 %.not42.1, label %.loopexit, label %.preheader.2

.preheader.2:                                     ; preds = %51
  %53 = call i64 @ScsiDiskRequestSenseKeys(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef %2, ptr noundef nonnull %3, i8 noundef zeroext 0)
  %54 = icmp slt i64 %53, 0
  br i1 %54, label %55, label %.loopexit

55:                                               ; preds = %.preheader.2
  %56 = load i8, ptr %1, align 1, !tbaa !19
  %.not42.2 = icmp eq i8 %56, 0
  br i1 %.not42.2, label %.loopexit, label %57

57:                                               ; preds = %55
  store i8 0, ptr %1, align 1, !tbaa !19
  br label %.loopexit

58:                                               ; preds = %.preheader.preheader
  %59 = load i8, ptr %1, align 1, !tbaa !19
  %.not42 = icmp eq i8 %59, 0
  br i1 %.not42, label %.loopexit, label %.preheader.1

.loopexit:                                        ; preds = %58, %.preheader.preheader, %.preheader.1, %51, %.preheader.2, %55, %57, %45, %40, %35, %27, %26, %22, %19
  %.0 = phi i64 [ -9223372036854775801, %19 ], [ -9223372036854775801, %22 ], [ -9223372036854775801, %26 ], [ -9223372036854775801, %27 ], [ -9223372036854775801, %35 ], [ -9223372036854775801, %40 ], [ 0, %45 ], [ -9223372036854775801, %57 ], [ 0, %.preheader.preheader ], [ -9223372036854775801, %58 ], [ 0, %.preheader.1 ], [ -9223372036854775801, %51 ], [ 0, %.preheader.2 ], [ -9223372036854775801, %55 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  ret i64 %.0
}

; Function Attrs: nounwind uwtable
declare dso_local i64 @CheckHostAdapterStatus(i8 noundef zeroext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @CheckTargetStatus(i8 noundef zeroext) local_unnamed_addr #2

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

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

attributes #0 = { mustprogress 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, !12, i64 136}
!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 = !{!8, !8, i64 0}
!20 = !{!12, !12, i64 0}
!21 = !{!6, !10, i64 112}
!22 = !{!6, !10, i64 128}
!23 = !{!24, !10, i64 16}
!24 = !{!"_EFI_SCSI_IO_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !7, i64 40}
!25 = !{!24, !10, i64 24}
!26 = !{!10, !10, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass,TailCallElimPass