; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/IntelFrameworkModulePkg (BiosInitBlockIo)

; 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.BIOS_BLOCK_IO_DEV = type { i64, ptr, ptr, %struct._EFI_BLOCK_IO_PROTOCOL, %struct.EFI_BLOCK_IO_MEDIA, ptr, ptr, ptr, %struct.BIOS_LEGACY_DRIVE }
%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.BIOS_LEGACY_DRIVE = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, ptr, i8, i8, i8, i8, i16, i16, %struct.EDD_DRIVE_PARAMETERS }
%struct.EDD_DRIVE_PARAMETERS = type <{ i16, i16, i32, i32, i32, i64, i16, i32, i16, i8, i8, i16, [4 x i8], [8 x i8], %union.EDD_INTERFACE_PATH, %union.EDD_DEVICE_PATH, i8, i8 }>
%union.EDD_INTERFACE_PATH = type { %struct.EDD_PCI }
%struct.EDD_PCI = type { i8, i8, i8, i8, i32 }
%union.EDD_DEVICE_PATH = type { %struct.EDD_USB }
%struct.EDD_USB = type { i64, i64 }

@.str = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local zeroext i8 @BiosInitBlockIo(ptr noundef %0) #0 {
  %2 = alloca i8, align 1
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %8, i32 0, i32 3
  store ptr %9, ptr %4, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %10, i32 0, i32 4
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %12, i32 0, i32 1
  store ptr %11, ptr %13, align 8, !tbaa !9
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %14, i32 0, i32 1
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  store ptr %16, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %17, i32 0, i32 8
  store ptr %18, ptr %6, align 8, !tbaa !5
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = call i64 @Int13GetDeviceParameters(ptr noundef %19, ptr noundef %20)
  %22 = icmp ne i64 %21, 0
  br i1 %22, label %23, label %147

23:                                               ; preds = %1
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = call i64 @Int13Extensions(ptr noundef %24, ptr noundef %25)
  %27 = icmp ne i64 %26, 0
  br i1 %27, label %28, label %54

28:                                               ; preds = %23
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %29, i32 0, i32 16
  %31 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %30, i32 0, i32 5
  %32 = load i64, ptr %31, align 8, !tbaa !12
  %33 = sub i64 %32, 1
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %34, i32 0, i32 8
  store i64 %33, ptr %35, align 8, !tbaa !17
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %36, i32 0, i32 16
  %38 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %37, i32 0, i32 6
  %39 = load i16, ptr %38, align 8, !tbaa !19
  %40 = zext i16 %39 to i32
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %41, i32 0, i32 6
  store i32 %40, ptr %42, align 4, !tbaa !20
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %43, i32 0, i32 16
  %45 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %44, i32 0, i32 1
  %46 = load i16, ptr %45, align 2, !tbaa !21
  %47 = zext i16 %46 to i32
  %48 = and i32 %47, 4
  %49 = icmp eq i32 %48, 4
  br i1 %49, label %50, label %53

50:                                               ; preds = %28
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %51, i32 0, i32 1
  store i8 1, ptr %52, align 4, !tbaa !22
  br label %53

53:                                               ; preds = %50, %28
  br label %77

54:                                               ; preds = %23
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %55, i32 0, i32 6
  store i32 512, ptr %56, align 4, !tbaa !20
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %57, i32 0, i32 12
  %59 = load i8, ptr %58, align 2, !tbaa !23
  %60 = zext i8 %59 to i32
  %61 = add nsw i32 %60, 1
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %62, i32 0, i32 13
  %64 = load i8, ptr %63, align 1, !tbaa !24
  %65 = zext i8 %64 to i32
  %66 = mul nsw i32 %61, %65
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %67, i32 0, i32 14
  %69 = load i16, ptr %68, align 4, !tbaa !25
  %70 = zext i16 %69 to i32
  %71 = add nsw i32 %70, 1
  %72 = mul nsw i32 %66, %71
  %73 = sub nsw i32 %72, 1
  %74 = sext i32 %73 to i64
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %75, i32 0, i32 8
  store i64 %74, ptr %76, align 8, !tbaa !17
  br label %77

77:                                               ; preds = %54, %53
  br label %78

78:                                               ; preds = %77
  %79 = call zeroext i8 @DebugPrintEnabled()
  %80 = icmp ne i8 %79, 0
  br i1 %80, label %81, label %95

81:                                               ; preds = %78
  br label %82

82:                                               ; preds = %81
  %83 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 1)
  %84 = icmp ne i8 %83, 0
  br i1 %84, label %85, label %92

85:                                               ; preds = %82
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %86, i32 0, i32 6
  %88 = load i32, ptr %87, align 4, !tbaa !20
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %89, i32 0, i32 8
  %91 = load i64, ptr %90, align 8, !tbaa !17
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 1, ptr noundef @.str, i32 noundef %88, i64 noundef %91)
  br label %92

92:                                               ; preds = %85, %82
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93
  br label %95

95:                                               ; preds = %94, %78
  br label %96

96:                                               ; preds = %95
  br label %97

97:                                               ; preds = %96
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %98, i32 0, i32 3
  store i8 0, ptr %99, align 2, !tbaa !26
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %100, i32 0, i32 5
  store i8 0, ptr %101, align 8, !tbaa !27
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %102, i32 0, i32 4
  store i8 0, ptr %103, align 1, !tbaa !28
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %104, i32 0, i32 2
  store i8 1, ptr %105, align 1, !tbaa !29
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %106, i32 0, i32 2
  store ptr @BiosBlockIoReset, ptr %107, align 8, !tbaa !30
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %108, i32 0, i32 5
  store ptr @BiosBlockIoFlushBlocks, ptr %109, align 8, !tbaa !31
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %110, i32 0, i32 3
  %112 = load i8, ptr %111, align 1, !tbaa !32
  %113 = icmp ne i8 %112, 0
  br i1 %113, label %119, label %114

114:                                              ; preds = %97
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %115, i32 0, i32 3
  store ptr @BiosReadLegacyDrive, ptr %116, align 8, !tbaa !33
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %117, i32 0, i32 4
  store ptr @BiosWriteLegacyDrive, ptr %118, align 8, !tbaa !34
  br label %142

119:                                              ; preds = %97
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %120, i32 0, i32 2
  %122 = load i8, ptr %121, align 2, !tbaa !35
  %123 = zext i8 %122 to i32
  %124 = icmp eq i32 %123, 48
  br i1 %124, label %125, label %136

125:                                              ; preds = %119
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %126, i32 0, i32 6
  %128 = load i8, ptr %127, align 2, !tbaa !36
  %129 = zext i8 %128 to i32
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %131, label %136

131:                                              ; preds = %125
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %132, i32 0, i32 3
  store ptr @Edd30BiosReadBlocks, ptr %133, align 8, !tbaa !33
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %134, i32 0, i32 4
  store ptr @Edd30BiosWriteBlocks, ptr %135, align 8, !tbaa !34
  br label %141

136:                                              ; preds = %125, %119
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %137, i32 0, i32 3
  store ptr @Edd11BiosReadBlocks, ptr %138, align 8, !tbaa !33
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %139, i32 0, i32 4
  store ptr @Edd11BiosWriteBlocks, ptr %140, align 8, !tbaa !34
  br label %141

141:                                              ; preds = %136, %131
  br label %142

142:                                              ; preds = %141, %114
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %143, i32 0, i32 3
  store i8 0, ptr %144, align 2, !tbaa !26
  %145 = load ptr, ptr %5, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %145, i32 0, i32 5
  store i8 0, ptr %146, align 8, !tbaa !27
  store i8 1, ptr %2, align 1
  store i32 1, ptr %7, align 4
  br label %148

147:                                              ; preds = %1
  store i8 0, ptr %2, align 1
  store i32 1, ptr %7, align 4
  br label %148

148:                                              ; preds = %147, %142
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %149 = load i8, ptr %2, align 1
  ret i8 %149
}

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

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

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

declare zeroext i8 @DebugPrintEnabled() #2

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #2

declare void @DebugPrint(i64 noundef, ptr noundef, ...) #2

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

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

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

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_EFI_BLOCK_IO_PROTOCOL", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!11 = !{!"long long", !7, i64 0}
!12 = !{!13, !11, i64 48}
!13 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !6, i64 16, !7, i64 24, !7, i64 25, !7, i64 26, !7, i64 27, !14, i64 28, !14, i64 30, !15, i64 32}
!14 = !{!"short", !7, i64 0}
!15 = !{!"", !14, i64 0, !14, i64 2, !16, i64 4, !16, i64 8, !16, i64 12, !11, i64 16, !14, i64 24, !16, i64 26, !14, i64 30, !7, i64 32, !7, i64 33, !14, i64 34, !7, i64 36, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 72, !7, i64 73}
!16 = !{!"int", !7, i64 0}
!17 = !{!18, !11, i64 24}
!18 = !{!"", !16, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !16, i64 12, !16, i64 16, !11, i64 24, !11, i64 32, !16, i64 40, !16, i64 44}
!19 = !{!13, !14, i64 56}
!20 = !{!18, !16, i64 12}
!21 = !{!13, !14, i64 34}
!22 = !{!18, !7, i64 4}
!23 = !{!13, !7, i64 26}
!24 = !{!13, !7, i64 27}
!25 = !{!13, !14, i64 28}
!26 = !{!18, !7, i64 6}
!27 = !{!18, !7, i64 8}
!28 = !{!18, !7, i64 7}
!29 = !{!18, !7, i64 5}
!30 = !{!10, !6, i64 16}
!31 = !{!10, !6, i64 40}
!32 = !{!13, !7, i64 3}
!33 = !{!10, !6, i64 24}
!34 = !{!10, !6, i64 32}
!35 = !{!13, !7, i64 2}
!36 = !{!13, !7, i64 6}


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

@.str = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local zeroext range(i8 0, 2) i8 @BiosInitBlockIo(ptr noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 72
  %3 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %2, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 144
  %5 = tail call i64 @Int13GetDeviceParameters(ptr noundef %0, ptr noundef nonnull %4)
  %.not = icmp eq i64 %5, 0
  br i1 %.not, label %69, label %6

6:                                                ; preds = %1
  %7 = tail call i64 @Int13Extensions(ptr noundef nonnull %0, ptr noundef nonnull %4)
  %.not39 = icmp eq i64 %7, 0
  br i1 %.not39, label %22, label %8

8:                                                ; preds = %6
  %9 = getelementptr inbounds i8, ptr %0, i64 192
  %10 = load i64, ptr %9, align 8, !tbaa !11
  %11 = add i64 %10, -1
  %12 = getelementptr inbounds i8, ptr %0, i64 96
  store i64 %11, ptr %12, align 8, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %0, i64 200
  %14 = load i16, ptr %13, align 8, !tbaa !18
  %15 = zext i16 %14 to i32
  %16 = getelementptr inbounds i8, ptr %0, i64 84
  store i32 %15, ptr %16, align 4, !tbaa !19
  %17 = getelementptr inbounds i8, ptr %0, i64 178
  %18 = load i16, ptr %17, align 2, !tbaa !20
  %19 = and i16 %18, 4
  %.not40 = icmp eq i16 %19, 0
  br i1 %.not40, label %40, label %20

20:                                               ; preds = %8
  %21 = getelementptr inbounds i8, ptr %0, i64 76
  store i8 1, ptr %21, align 4, !tbaa !21
  br label %40

22:                                               ; preds = %6
  %23 = getelementptr inbounds i8, ptr %0, i64 84
  store i32 512, ptr %23, align 4, !tbaa !19
  %24 = getelementptr inbounds i8, ptr %0, i64 170
  %25 = load i8, ptr %24, align 2, !tbaa !22
  %26 = zext i8 %25 to i64
  %27 = add nuw nsw i64 %26, 1
  %28 = getelementptr inbounds i8, ptr %0, i64 171
  %29 = load i8, ptr %28, align 1, !tbaa !23
  %30 = zext i8 %29 to i64
  %31 = getelementptr inbounds i8, ptr %0, i64 172
  %32 = load i16, ptr %31, align 4, !tbaa !24
  %33 = zext i16 %32 to i64
  %34 = add nuw nsw i64 %33, 1
  %35 = shl nuw nsw i64 %30, 32
  %36 = mul nuw nsw i64 %35, %27
  %37 = mul nuw i64 %36, %34
  %sext = add i64 %37, -4294967296
  %38 = ashr exact i64 %sext, 32
  %39 = getelementptr inbounds i8, ptr %0, i64 96
  store i64 %38, ptr %39, align 8, !tbaa !16
  br label %40

40:                                               ; preds = %22, %20, %8
  %41 = tail call zeroext i8 @DebugPrintEnabled() #2
  %.not41 = icmp eq i8 %41, 0
  br i1 %.not41, label %49, label %42

42:                                               ; preds = %40
  %43 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 1) #2
  %.not42 = icmp eq i8 %43, 0
  br i1 %.not42, label %49, label %44

44:                                               ; preds = %42
  %45 = getelementptr inbounds i8, ptr %0, i64 84
  %46 = load i32, ptr %45, align 4, !tbaa !19
  %47 = getelementptr inbounds i8, ptr %0, i64 96
  %48 = load i64, ptr %47, align 8, !tbaa !16
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 1, ptr noundef nonnull @.str, i32 noundef %46, i64 noundef %48) #2
  br label %49

49:                                               ; preds = %42, %44, %40
  %50 = getelementptr inbounds i8, ptr %0, i64 78
  %51 = getelementptr inbounds i8, ptr %0, i64 80
  %52 = getelementptr inbounds i8, ptr %0, i64 79
  store i8 0, ptr %52, align 1, !tbaa !25
  %53 = getelementptr inbounds i8, ptr %0, i64 77
  store i8 1, ptr %53, align 1, !tbaa !26
  %54 = getelementptr inbounds i8, ptr %0, i64 40
  store ptr @BiosBlockIoReset, ptr %54, align 8, !tbaa !27
  %55 = getelementptr inbounds i8, ptr %0, i64 64
  store ptr @BiosBlockIoFlushBlocks, ptr %55, align 8, !tbaa !28
  %56 = getelementptr inbounds i8, ptr %0, i64 147
  %57 = load i8, ptr %56, align 1, !tbaa !29
  %.not43 = icmp eq i8 %57, 0
  br i1 %.not43, label %66, label %58

58:                                               ; preds = %49
  %59 = getelementptr inbounds i8, ptr %0, i64 146
  %60 = load i8, ptr %59, align 2, !tbaa !30
  %61 = icmp eq i8 %60, 48
  br i1 %61, label %62, label %65

62:                                               ; preds = %58
  %63 = getelementptr inbounds i8, ptr %0, i64 150
  %64 = load i8, ptr %63, align 2, !tbaa !31
  %.not44 = icmp eq i8 %64, 0
  br i1 %.not44, label %65, label %66

65:                                               ; preds = %62, %58
  br label %66

66:                                               ; preds = %62, %49, %65
  %Edd30BiosReadBlocks.sink = phi ptr [ @Edd11BiosReadBlocks, %65 ], [ @BiosReadLegacyDrive, %49 ], [ @Edd30BiosReadBlocks, %62 ]
  %Edd30BiosWriteBlocks.sink = phi ptr [ @Edd11BiosWriteBlocks, %65 ], [ @BiosWriteLegacyDrive, %49 ], [ @Edd30BiosWriteBlocks, %62 ]
  %67 = getelementptr inbounds i8, ptr %0, i64 48
  store ptr %Edd30BiosReadBlocks.sink, ptr %67, align 8, !tbaa !32
  %68 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr %Edd30BiosWriteBlocks.sink, ptr %68, align 8, !tbaa !33
  store i8 0, ptr %50, align 2, !tbaa !34
  store i8 0, ptr %51, align 8, !tbaa !35
  br label %69

69:                                               ; preds = %1, %66
  %.0 = phi i8 [ 1, %66 ], [ 0, %1 ]
  ret i8 %.0
}

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

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

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) local_unnamed_addr #1

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

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

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

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

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

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

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 8}
!6 = !{!"_EFI_BLOCK_IO_PROTOCOL", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !7, i64 48}
!12 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7, !8, i64 8, !10, i64 16, !8, i64 24, !8, i64 25, !8, i64 26, !8, i64 27, !13, i64 28, !13, i64 30, !14, i64 32}
!13 = !{!"short", !8, i64 0}
!14 = !{!"", !13, i64 0, !13, i64 2, !15, i64 4, !15, i64 8, !15, i64 12, !7, i64 16, !13, i64 24, !15, i64 26, !13, i64 30, !8, i64 32, !8, i64 33, !13, i64 34, !8, i64 36, !8, i64 40, !8, i64 48, !8, i64 56, !8, i64 72, !8, i64 73}
!15 = !{!"int", !8, i64 0}
!16 = !{!17, !7, i64 24}
!17 = !{!"", !15, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7, !8, i64 8, !15, i64 12, !15, i64 16, !7, i64 24, !7, i64 32, !15, i64 40, !15, i64 44}
!18 = !{!12, !13, i64 56}
!19 = !{!17, !15, i64 12}
!20 = !{!12, !13, i64 34}
!21 = !{!17, !8, i64 4}
!22 = !{!12, !8, i64 26}
!23 = !{!12, !8, i64 27}
!24 = !{!12, !13, i64 28}
!25 = !{!17, !8, i64 7}
!26 = !{!17, !8, i64 5}
!27 = !{!6, !10, i64 16}
!28 = !{!6, !10, i64 40}
!29 = !{!12, !8, i64 3}
!30 = !{!12, !8, i64 2}
!31 = !{!12, !8, i64 6}
!32 = !{!6, !10, i64 24}
!33 = !{!6, !10, i64 32}
!34 = !{!17, !8, i64 6}
!35 = !{!17, !8, i64 8}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass