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

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

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

@gBS = external global ptr, align 8
@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

; Function Attrs: nounwind uwtable
define dso_local i64 @NetLibDefaultUnload(ptr noundef %0) #1 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #2
  %13 = load ptr, ptr @gBS, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %13, i32 0, i32 37
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %16 = call i64 %15(i32 noundef 0, ptr noundef null, ptr noundef null, ptr noundef %6, ptr noundef %5)
  store i64 %16, ptr %4, align 8, !tbaa !14
  %17 = load i64, ptr %4, align 8, !tbaa !14
  %18 = icmp slt i64 %17, 0
  br i1 %18, label %19, label %21

19:                                               ; preds = %1
  %20 = load i64, ptr %4, align 8, !tbaa !14
  store i64 %20, ptr %2, align 8
  store i32 1, ptr %12, align 4
  br label %127

21:                                               ; preds = %1
  store i64 0, ptr %7, align 8, !tbaa !14
  br label %22

22:                                               ; preds = %114, %21
  %23 = load i64, ptr %7, align 8, !tbaa !14
  %24 = load i64, ptr %6, align 8, !tbaa !14
  %25 = icmp ult i64 %23, %24
  br i1 %25, label %26, label %117

26:                                               ; preds = %22
  %27 = load ptr, ptr @gBS, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %27, i32 0, i32 17
  %29 = load ptr, ptr %28, align 8, !tbaa !15
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = load i64, ptr %7, align 8, !tbaa !14
  %32 = getelementptr inbounds ptr, ptr %30, i64 %31
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %34 = call i64 %29(ptr noundef %33, ptr noundef @gEfiDriverBindingProtocolGuid, ptr noundef %9)
  store i64 %34, ptr %4, align 8, !tbaa !14
  %35 = load i64, ptr %4, align 8, !tbaa !14
  %36 = icmp slt i64 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %26
  br label %114

38:                                               ; preds = %26
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %39, i32 0, i32 4
  %41 = load ptr, ptr %40, align 8, !tbaa !16
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = icmp ne ptr %41, %42
  br i1 %43, label %44, label %45

44:                                               ; preds = %38
  br label %114

45:                                               ; preds = %38
  store i64 0, ptr %8, align 8, !tbaa !14
  br label %46

46:                                               ; preds = %62, %45
  %47 = load i64, ptr %8, align 8, !tbaa !14
  %48 = load i64, ptr %6, align 8, !tbaa !14
  %49 = icmp ult i64 %47, %48
  br i1 %49, label %50, label %65

50:                                               ; preds = %46
  %51 = load ptr, ptr @gBS, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %51, i32 0, i32 32
  %53 = load ptr, ptr %52, align 8, !tbaa !18
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = load i64, ptr %8, align 8, !tbaa !14
  %56 = getelementptr inbounds ptr, ptr %54, i64 %55
  %57 = load ptr, ptr %56, align 8, !tbaa !5
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %58, i32 0, i32 5
  %60 = load ptr, ptr %59, align 8, !tbaa !19
  %61 = call i64 %53(ptr noundef %57, ptr noundef %60, ptr noundef null)
  store i64 %61, ptr %4, align 8, !tbaa !14
  br label %62

62:                                               ; preds = %50
  %63 = load i64, ptr %8, align 8, !tbaa !14
  %64 = add i64 %63, 1
  store i64 %64, ptr %8, align 8, !tbaa !14
  br label %46, !llvm.loop !20

65:                                               ; preds = %46
  %66 = load ptr, ptr @gBS, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %66, i32 0, i32 16
  %68 = load ptr, ptr %67, align 8, !tbaa !22
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %69, i32 0, i32 5
  %71 = load ptr, ptr %70, align 8, !tbaa !19
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = call i64 %68(ptr noundef %71, ptr noundef @gEfiDriverBindingProtocolGuid, ptr noundef %72)
  %74 = load ptr, ptr @gBS, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %74, i32 0, i32 17
  %76 = load ptr, ptr %75, align 8, !tbaa !15
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = load i64, ptr %7, align 8, !tbaa !14
  %79 = getelementptr inbounds ptr, ptr %77, i64 %78
  %80 = load ptr, ptr %79, align 8, !tbaa !5
  %81 = call i64 %76(ptr noundef %80, ptr noundef @gEfiComponentNameProtocolGuid, ptr noundef %10)
  store i64 %81, ptr %4, align 8, !tbaa !14
  %82 = load i64, ptr %4, align 8, !tbaa !14
  %83 = icmp slt i64 %82, 0
  br i1 %83, label %93, label %84

84:                                               ; preds = %65
  %85 = load ptr, ptr @gBS, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %85, i32 0, i32 16
  %87 = load ptr, ptr %86, align 8, !tbaa !22
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %88, i32 0, i32 5
  %90 = load ptr, ptr %89, align 8, !tbaa !19
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = call i64 %87(ptr noundef %90, ptr noundef @gEfiComponentNameProtocolGuid, ptr noundef %91)
  br label %93

93:                                               ; preds = %84, %65
  %94 = load ptr, ptr @gBS, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %94, i32 0, i32 17
  %96 = load ptr, ptr %95, align 8, !tbaa !15
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = load i64, ptr %7, align 8, !tbaa !14
  %99 = getelementptr inbounds ptr, ptr %97, i64 %98
  %100 = load ptr, ptr %99, align 8, !tbaa !5
  %101 = call i64 %96(ptr noundef %100, ptr noundef @gEfiComponentName2ProtocolGuid, ptr noundef %11)
  store i64 %101, ptr %4, align 8, !tbaa !14
  %102 = load i64, ptr %4, align 8, !tbaa !14
  %103 = icmp slt i64 %102, 0
  br i1 %103, label %113, label %104

104:                                              ; preds = %93
  %105 = load ptr, ptr @gBS, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %105, i32 0, i32 16
  %107 = load ptr, ptr %106, align 8, !tbaa !22
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %108, i32 0, i32 5
  %110 = load ptr, ptr %109, align 8, !tbaa !19
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = call i64 %107(ptr noundef %110, ptr noundef @gEfiComponentName2ProtocolGuid, ptr noundef %111)
  br label %113

113:                                              ; preds = %104, %93
  br label %114

114:                                              ; preds = %113, %44, %37
  %115 = load i64, ptr %7, align 8, !tbaa !14
  %116 = add i64 %115, 1
  store i64 %116, ptr %7, align 8, !tbaa !14
  br label %22, !llvm.loop !23

117:                                              ; preds = %22
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = icmp ne ptr %118, null
  br i1 %119, label %120, label %126

120:                                              ; preds = %117
  %121 = load ptr, ptr @gBS, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %121, i32 0, i32 7
  %123 = load ptr, ptr %122, align 8, !tbaa !24
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = call i64 %123(ptr noundef %124)
  br label %126

126:                                              ; preds = %120, %117
  store i64 0, ptr %2, align 8
  store i32 1, ptr %12, align 4
  br label %127

127:                                              ; preds = %126, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #2
  %128 = load i64, ptr %2, align 8
  ret i64 %128
}

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 = { 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 152}
!16 = !{!17, !6, i64 32}
!17 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !6, i64 32, !6, i64 40}
!18 = !{!10, !6, i64 272}
!19 = !{!17, !6, i64 40}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!10, !6, i64 144}
!23 = distinct !{!23, !21}
!24 = !{!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.GUID = type { i32, i16, i16, [8 x i8] }

@gBS = external local_unnamed_addr global ptr, align 8
@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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @NetLibDefaultUnload(ptr noundef readnone %0) local_unnamed_addr #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #2
  %7 = load ptr, ptr @gBS, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 312
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = call i64 %9(i32 noundef 0, ptr noundef null, ptr noundef null, ptr noundef nonnull %3, ptr noundef nonnull %2) #2
  %11 = icmp slt i64 %10, 0
  br i1 %11, label %91, label %.preheader19

.preheader19:                                     ; preds = %1
  %12 = load i64, ptr %3, align 8, !tbaa !14
  %.not24 = icmp eq i64 %12, 0
  br i1 %.not24, label %._crit_edge23, label %.lr.ph22

.lr.ph22:                                         ; preds = %.preheader19, %81
  %.01421 = phi i64 [ %82, %81 ], [ 0, %.preheader19 ]
  %13 = load ptr, ptr @gBS, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %13, i64 152
  %15 = load ptr, ptr %14, align 8, !tbaa !15
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds ptr, ptr %16, i64 %.01421
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = call i64 %15(ptr noundef %18, ptr noundef nonnull @gEfiDriverBindingProtocolGuid, ptr noundef nonnull %4) #2
  %20 = icmp slt i64 %19, 0
  br i1 %20, label %81, label %21

21:                                               ; preds = %.lr.ph22
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %22, i64 32
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  %.not18 = icmp eq ptr %24, %0
  br i1 %.not18, label %.preheader, label %81

.preheader:                                       ; preds = %21
  %25 = load i64, ptr %3, align 8, !tbaa !14
  %.not25 = icmp eq i64 %25, 0
  br i1 %.not25, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %.020 = phi i64 [ %36, %.lr.ph ], [ 0, %.preheader ]
  %26 = load ptr, ptr @gBS, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %26, i64 272
  %28 = load ptr, ptr %27, align 8, !tbaa !18
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds ptr, ptr %29, i64 %.020
  %31 = load ptr, ptr %30, align 8, !tbaa !5
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 40
  %34 = load ptr, ptr %33, align 8, !tbaa !19
  %35 = call i64 %28(ptr noundef %31, ptr noundef %34, ptr noundef null) #2
  %36 = add nuw i64 %.020, 1
  %37 = load i64, ptr %3, align 8, !tbaa !14
  %38 = icmp ult i64 %36, %37
  br i1 %38, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !20

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load ptr, ptr %4, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %39 = phi ptr [ %.pre, %._crit_edge.loopexit ], [ %22, %.preheader ]
  %40 = load ptr, ptr @gBS, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %40, i64 144
  %42 = load ptr, ptr %41, align 8, !tbaa !22
  %43 = getelementptr inbounds i8, ptr %39, i64 40
  %44 = load ptr, ptr %43, align 8, !tbaa !19
  %45 = call i64 %42(ptr noundef %44, ptr noundef nonnull @gEfiDriverBindingProtocolGuid, ptr noundef %39) #2
  %46 = load ptr, ptr @gBS, align 8, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %46, i64 152
  %48 = load ptr, ptr %47, align 8, !tbaa !15
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = getelementptr inbounds ptr, ptr %49, i64 %.01421
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %52 = call i64 %48(ptr noundef %51, ptr noundef nonnull @gEfiComponentNameProtocolGuid, ptr noundef nonnull %5) #2
  %53 = icmp slt i64 %52, 0
  br i1 %53, label %63, label %54

54:                                               ; preds = %._crit_edge
  %55 = load ptr, ptr @gBS, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %55, i64 144
  %57 = load ptr, ptr %56, align 8, !tbaa !22
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 40
  %60 = load ptr, ptr %59, align 8, !tbaa !19
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = call i64 %57(ptr noundef %60, ptr noundef nonnull @gEfiComponentNameProtocolGuid, ptr noundef %61) #2
  br label %63

63:                                               ; preds = %54, %._crit_edge
  %64 = load ptr, ptr @gBS, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %64, i64 152
  %66 = load ptr, ptr %65, align 8, !tbaa !15
  %67 = load ptr, ptr %2, align 8, !tbaa !5
  %68 = getelementptr inbounds ptr, ptr %67, i64 %.01421
  %69 = load ptr, ptr %68, align 8, !tbaa !5
  %70 = call i64 %66(ptr noundef %69, ptr noundef nonnull @gEfiComponentName2ProtocolGuid, ptr noundef nonnull %6) #2
  %71 = icmp slt i64 %70, 0
  br i1 %71, label %81, label %72

72:                                               ; preds = %63
  %73 = load ptr, ptr @gBS, align 8, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %73, i64 144
  %75 = load ptr, ptr %74, align 8, !tbaa !22
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %76, i64 40
  %78 = load ptr, ptr %77, align 8, !tbaa !19
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = call i64 %75(ptr noundef %78, ptr noundef nonnull @gEfiComponentName2ProtocolGuid, ptr noundef %79) #2
  br label %81

81:                                               ; preds = %63, %72, %21, %.lr.ph22
  %82 = add nuw i64 %.01421, 1
  %83 = load i64, ptr %3, align 8, !tbaa !14
  %84 = icmp ult i64 %82, %83
  br i1 %84, label %.lr.ph22, label %._crit_edge23, !llvm.loop !23

._crit_edge23:                                    ; preds = %81, %.preheader19
  %85 = load ptr, ptr %2, align 8, !tbaa !5
  %.not = icmp eq ptr %85, null
  br i1 %.not, label %91, label %86

86:                                               ; preds = %._crit_edge23
  %87 = load ptr, ptr @gBS, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %87, i64 72
  %89 = load ptr, ptr %88, align 8, !tbaa !24
  %90 = call i64 %89(ptr noundef nonnull %85) #2
  br label %91

91:                                               ; preds = %._crit_edge23, %86, %1
  %.015 = phi i64 [ %10, %1 ], [ 0, %86 ], [ 0, %._crit_edge23 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #2
  ret i64 %.015
}

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


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