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

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

%struct._EFI_DRIVER_BINDING_PROTOCOL = type { ptr, ptr, ptr, i32, ptr, ptr }
%struct.GUID = type { i32, i16, i16, [8 x i8] }
%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 }

@gI2cHostDriverBinding = external dso_local global %struct._EFI_DRIVER_BINDING_PROTOCOL, align 8
@gBS = external global ptr, align 8
@gEfiI2cHostProtocolGuid = external global %struct.GUID, align 4
@.str.12 = external hidden unnamed_addr constant [139 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [20 x i8], align 1
@gEfiDriverBindingProtocolGuid = external global %struct.GUID, align 4
@gEfiComponentNameProtocolGuid = external global %struct.GUID, align 4
@gEfiComponentName2ProtocolGuid = 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 @DebugPrintEnabled() #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #1

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

declare zeroext i8 @DebugAssertEnabled() #1

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

; Function Attrs: nounwind uwtable
define dso_local i64 @I2cHostUnload(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %9 = load ptr, ptr @gBS, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %9, i32 0, i32 37
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = call i64 %11(i32 noundef 2, ptr noundef @gEfiI2cHostProtocolGuid, ptr noundef null, ptr noundef %5, ptr noundef %4)
  store i64 %12, ptr %3, align 8, !tbaa !14
  %13 = load i64, ptr %3, align 8, !tbaa !14
  %14 = icmp slt i64 %13, 0
  br i1 %14, label %38, label %15

15:                                               ; preds = %1
  store i64 0, ptr %6, align 8, !tbaa !14
  br label %16

16:                                               ; preds = %34, %15
  %17 = load i64, ptr %6, align 8, !tbaa !14
  %18 = load i64, ptr %5, align 8, !tbaa !14
  %19 = icmp ult i64 %17, %18
  br i1 %19, label %20, label %37

20:                                               ; preds = %16
  %21 = load ptr, ptr @gBS, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %21, i32 0, i32 32
  %23 = load ptr, ptr %22, align 8, !tbaa !15
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = load i64, ptr %6, align 8, !tbaa !14
  %26 = getelementptr inbounds ptr, ptr %24, i64 %25
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = call i64 %23(ptr noundef %27, ptr noundef %28, ptr noundef null)
  store i64 %29, ptr %3, align 8, !tbaa !14
  %30 = load i64, ptr %3, align 8, !tbaa !14
  %31 = icmp slt i64 %30, 0
  br i1 %31, label %32, label %33

32:                                               ; preds = %20
  br label %100

33:                                               ; preds = %20
  br label %34

34:                                               ; preds = %33
  %35 = load i64, ptr %6, align 8, !tbaa !14
  %36 = add i64 %35, 1
  store i64 %36, ptr %6, align 8, !tbaa !14
  br label %16, !llvm.loop !16

37:                                               ; preds = %16
  br label %38

38:                                               ; preds = %37, %1
  %39 = load ptr, ptr @gBS, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %39, i32 0, i32 40
  %41 = load ptr, ptr %40, align 8, !tbaa !18
  %42 = load ptr, ptr getelementptr inbounds (%struct._EFI_DRIVER_BINDING_PROTOCOL, ptr @gI2cHostDriverBinding, i32 0, i32 5), align 8, !tbaa !19
  %43 = call i64 (ptr, ...) %41(ptr noundef %42, ptr noundef @gEfiDriverBindingProtocolGuid, ptr noundef @gI2cHostDriverBinding, ptr noundef null)
  store i64 %43, ptr %3, align 8, !tbaa !14
  br label %44

44:                                               ; preds = %38
  %45 = call zeroext i8 @DebugAssertEnabled()
  %46 = icmp ne i8 %45, 0
  br i1 %46, label %47, label %67

47:                                               ; preds = %44
  %48 = load i64, ptr %3, align 8, !tbaa !14
  %49 = icmp slt i64 %48, 0
  br i1 %49, label %50, label %66

50:                                               ; preds = %47
  br label %51

51:                                               ; preds = %50
  %52 = call zeroext i8 @DebugPrintEnabled()
  %53 = icmp ne i8 %52, 0
  br i1 %53, label %54, label %63

54:                                               ; preds = %51
  br label %55

55:                                               ; preds = %54
  %56 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %57 = icmp ne i8 %56, 0
  br i1 %57, label %58, label %60

58:                                               ; preds = %55
  %59 = load i64, ptr %3, align 8, !tbaa !14
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.18, i64 noundef %59)
  br label %60

60:                                               ; preds = %58, %55
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61
  br label %63

63:                                               ; preds = %62, %51
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  call void @DebugAssert(ptr noundef @.str.12, i64 noundef 1177, ptr noundef @.str.19)
  br label %66

66:                                               ; preds = %65, %47
  br label %67

67:                                               ; preds = %66, %44
  br label %68

68:                                               ; preds = %67
  br label %69

69:                                               ; preds = %68
  %70 = load ptr, ptr @gBS, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %70, i32 0, i32 17
  %72 = load ptr, ptr %71, align 8, !tbaa !21
  %73 = load ptr, ptr getelementptr inbounds (%struct._EFI_DRIVER_BINDING_PROTOCOL, ptr @gI2cHostDriverBinding, i32 0, i32 5), align 8, !tbaa !19
  %74 = call i64 %72(ptr noundef %73, ptr noundef @gEfiComponentNameProtocolGuid, ptr noundef %7)
  store i64 %74, ptr %3, align 8, !tbaa !14
  %75 = load i64, ptr %3, align 8, !tbaa !14
  %76 = icmp slt i64 %75, 0
  br i1 %76, label %84, label %77

77:                                               ; preds = %69
  %78 = load ptr, ptr @gBS, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %78, i32 0, i32 16
  %80 = load ptr, ptr %79, align 8, !tbaa !22
  %81 = load ptr, ptr getelementptr inbounds (%struct._EFI_DRIVER_BINDING_PROTOCOL, ptr @gI2cHostDriverBinding, i32 0, i32 5), align 8, !tbaa !19
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = call i64 %80(ptr noundef %81, ptr noundef @gEfiComponentNameProtocolGuid, ptr noundef %82)
  br label %84

84:                                               ; preds = %77, %69
  %85 = load ptr, ptr @gBS, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %85, i32 0, i32 17
  %87 = load ptr, ptr %86, align 8, !tbaa !21
  %88 = load ptr, ptr getelementptr inbounds (%struct._EFI_DRIVER_BINDING_PROTOCOL, ptr @gI2cHostDriverBinding, i32 0, i32 5), align 8, !tbaa !19
  %89 = call i64 %87(ptr noundef %88, ptr noundef @gEfiComponentName2ProtocolGuid, ptr noundef %8)
  store i64 %89, ptr %3, align 8, !tbaa !14
  %90 = load i64, ptr %3, align 8, !tbaa !14
  %91 = icmp slt i64 %90, 0
  br i1 %91, label %99, label %92

92:                                               ; preds = %84
  %93 = load ptr, ptr @gBS, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %93, i32 0, i32 16
  %95 = load ptr, ptr %94, align 8, !tbaa !22
  %96 = load ptr, ptr getelementptr inbounds (%struct._EFI_DRIVER_BINDING_PROTOCOL, ptr @gI2cHostDriverBinding, i32 0, i32 5), align 8, !tbaa !19
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = call i64 %95(ptr noundef %96, ptr noundef @gEfiComponentName2ProtocolGuid, ptr noundef %97)
  br label %99

99:                                               ; preds = %92, %84
  store i64 0, ptr %3, align 8, !tbaa !14
  br label %100

100:                                              ; preds = %99, %32
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = icmp ne ptr %101, null
  br i1 %102, label %103, label %109

103:                                              ; preds = %100
  %104 = load ptr, ptr @gBS, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %104, i32 0, i32 7
  %106 = load ptr, ptr %105, align 8, !tbaa !23
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = call i64 %106(ptr noundef %107)
  br label %109

109:                                              ; preds = %103, %100
  %110 = load i64, ptr %3, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret i64 %110
}

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, !6, i64 312}
!10 = !{!"", !11, 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}
!11 = !{!"", !12, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !12, i64 0}
!15 = !{!10, !6, i64 272}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!10, !6, i64 336}
!19 = !{!20, !6, i64 40}
!20 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !6, i64 32, !6, i64 40}
!21 = !{!10, !6, i64 152}
!22 = !{!10, !6, i64 144}
!23 = !{!10, !6, i64 72}


; 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._EFI_DRIVER_BINDING_PROTOCOL = type { ptr, ptr, ptr, i32, ptr, ptr }
%struct.GUID = type { i32, i16, i16, [8 x i8] }

@gI2cHostDriverBinding = external dso_local global %struct._EFI_DRIVER_BINDING_PROTOCOL, align 8
@gBS = external local_unnamed_addr global ptr, align 8
@gEfiI2cHostProtocolGuid = external global %struct.GUID, align 4
@.str.12 = external hidden unnamed_addr constant [139 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [20 x i8], align 1
@gEfiDriverBindingProtocolGuid = external global %struct.GUID, align 4
@gEfiComponentNameProtocolGuid = external global %struct.GUID, align 4
@gEfiComponentName2ProtocolGuid = external global %struct.GUID, align 4

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @I2cHostUnload(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %6 = load ptr, ptr @gBS, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 312
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %9 = call i64 %8(i32 noundef 2, ptr noundef nonnull @gEfiI2cHostProtocolGuid, ptr noundef null, ptr noundef nonnull %3, ptr noundef nonnull %2) #3
  %10 = icmp sgt i64 %9, -1
  %11 = load i64, ptr %3, align 8
  %12 = icmp ne i64 %11, 0
  %or.cond20 = select i1 %10, i1 %12, i1 false
  br i1 %or.cond20, label %.lr.ph, label %.loopexit

13:                                               ; preds = %.lr.ph
  %14 = add nuw i64 %.018, 1
  %15 = load i64, ptr %3, align 8, !tbaa !14
  %16 = icmp ult i64 %14, %15
  br i1 %16, label %.lr.ph, label %.loopexit, !llvm.loop !15

.lr.ph:                                           ; preds = %1, %13
  %.018 = phi i64 [ %14, %13 ], [ 0, %1 ]
  %17 = load ptr, ptr @gBS, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %17, i64 272
  %19 = load ptr, ptr %18, align 8, !tbaa !17
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds ptr, ptr %20, i64 %.018
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %23 = call i64 %19(ptr noundef %22, ptr noundef %0, ptr noundef null) #3
  %24 = icmp slt i64 %23, 0
  br i1 %24, label %.loopexit17, label %13

.loopexit:                                        ; preds = %13, %1
  %25 = load ptr, ptr @gBS, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 336
  %27 = load ptr, ptr %26, align 8, !tbaa !18
  %28 = load ptr, ptr getelementptr inbounds (i8, ptr @gI2cHostDriverBinding, i64 40), align 8, !tbaa !19
  %29 = call i64 (ptr, ...) %27(ptr noundef %28, ptr noundef nonnull @gEfiDriverBindingProtocolGuid, ptr noundef nonnull @gI2cHostDriverBinding, ptr noundef null) #3
  %30 = call zeroext i8 @DebugAssertEnabled() #3
  %31 = icmp ne i8 %30, 0
  %32 = icmp slt i64 %29, 0
  %or.cond = select i1 %31, i1 %32, i1 false
  br i1 %or.cond, label %33, label %39

33:                                               ; preds = %.loopexit
  %34 = call zeroext i8 @DebugPrintEnabled() #3
  %.not = icmp eq i8 %34, 0
  br i1 %.not, label %38, label %35

35:                                               ; preds = %33
  %36 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not15 = icmp eq i8 %36, 0
  br i1 %.not15, label %38, label %37

37:                                               ; preds = %35
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.18, i64 noundef %29) #3
  br label %38

38:                                               ; preds = %35, %37, %33
  call void @DebugAssert(ptr noundef nonnull @.str.12, i64 noundef 1177, ptr noundef nonnull @.str.19) #3
  br label %39

39:                                               ; preds = %38, %.loopexit
  %40 = load ptr, ptr @gBS, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %40, i64 152
  %42 = load ptr, ptr %41, align 8, !tbaa !21
  %43 = load ptr, ptr getelementptr inbounds (i8, ptr @gI2cHostDriverBinding, i64 40), align 8, !tbaa !19
  %44 = call i64 %42(ptr noundef %43, ptr noundef nonnull @gEfiComponentNameProtocolGuid, ptr noundef nonnull %4) #3
  %45 = icmp slt i64 %44, 0
  br i1 %45, label %53, label %46

46:                                               ; preds = %39
  %47 = load ptr, ptr @gBS, align 8, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %47, i64 144
  %49 = load ptr, ptr %48, align 8, !tbaa !22
  %50 = load ptr, ptr getelementptr inbounds (i8, ptr @gI2cHostDriverBinding, i64 40), align 8, !tbaa !19
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = call i64 %49(ptr noundef %50, ptr noundef nonnull @gEfiComponentNameProtocolGuid, ptr noundef %51) #3
  br label %53

53:                                               ; preds = %46, %39
  %54 = load ptr, ptr @gBS, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %54, i64 152
  %56 = load ptr, ptr %55, align 8, !tbaa !21
  %57 = load ptr, ptr getelementptr inbounds (i8, ptr @gI2cHostDriverBinding, i64 40), align 8, !tbaa !19
  %58 = call i64 %56(ptr noundef %57, ptr noundef nonnull @gEfiComponentName2ProtocolGuid, ptr noundef nonnull %5) #3
  %59 = icmp slt i64 %58, 0
  br i1 %59, label %.loopexit17, label %60

60:                                               ; preds = %53
  %61 = load ptr, ptr @gBS, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 144
  %63 = load ptr, ptr %62, align 8, !tbaa !22
  %64 = load ptr, ptr getelementptr inbounds (i8, ptr @gI2cHostDriverBinding, i64 40), align 8, !tbaa !19
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = call i64 %63(ptr noundef %64, ptr noundef nonnull @gEfiComponentName2ProtocolGuid, ptr noundef %65) #3
  br label %.loopexit17

.loopexit17:                                      ; preds = %.lr.ph, %53, %60
  %.011 = phi i64 [ 0, %60 ], [ 0, %53 ], [ %23, %.lr.ph ]
  %67 = load ptr, ptr %2, align 8, !tbaa !5
  %.not16 = icmp eq ptr %67, null
  br i1 %.not16, label %73, label %68

68:                                               ; preds = %.loopexit17
  %69 = load ptr, ptr @gBS, align 8, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %69, i64 72
  %71 = load ptr, ptr %70, align 8, !tbaa !23
  %72 = call i64 %71(ptr noundef nonnull %67) #3
  br label %73

73:                                               ; preds = %68, %.loopexit17
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  ret i64 %.011
}

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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 312}
!10 = !{!"", !11, 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}
!11 = !{!"", !12, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !12, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!10, !6, i64 272}
!18 = !{!10, !6, i64 336}
!19 = !{!20, !6, i64 40}
!20 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !6, i64 32, !6, i64 40}
!21 = !{!10, !6, i64 152}
!22 = !{!10, !6, i64 144}
!23 = !{!10, !6, i64 72}


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