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

; 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 }
%struct.I2C_HOST_CONTEXT = type { i64, i64, ptr, ptr, i64, i8, %struct._LIST_ENTRY, %struct._EFI_I2C_HOST_PROTOCOL, ptr, ptr }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct._EFI_I2C_HOST_PROTOCOL = type { ptr, ptr }

@gBS = external global ptr, align 8
@gEfiI2cBusConfigurationManagementProtocolGuid = external global %struct.GUID, align 4
@gEfiI2cHostProtocolGuid = external global %struct.GUID, align 4
@.str.11 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [139 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @I2cHostDriverStop(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3) #0 {
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i64 %2, ptr %8, align 8, !tbaa !9
  store 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 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %15 = call i64 @EfiGetCurrentTpl()
  store i64 %15, ptr %13, align 8, !tbaa !9
  %16 = load i64, ptr %13, align 8, !tbaa !9
  %17 = icmp ugt i64 %16, 16
  br i1 %17, label %18, label %34

18:                                               ; preds = %4
  br label %19

19:                                               ; preds = %18
  %20 = call zeroext i8 @DebugPrintEnabled()
  %21 = icmp ne i8 %20, 0
  br i1 %21, label %22, label %31

22:                                               ; preds = %19
  br label %23

23:                                               ; preds = %22
  %24 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %25 = icmp ne i8 %24, 0
  br i1 %25, label %26, label %28

26:                                               ; preds = %23
  %27 = load i64, ptr %13, align 8, !tbaa !9
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.11, i64 noundef %27)
  br label %28

28:                                               ; preds = %26, %23
  br label %29

29:                                               ; preds = %28
  br label %30

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30, %19
  br label %32

32:                                               ; preds = %31
  br label %33

33:                                               ; preds = %32
  store i64 -9223372036854775801, ptr %5, align 8
  store i32 1, ptr %14, align 4
  br label %139

34:                                               ; preds = %4
  %35 = load ptr, ptr @gBS, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %35, i32 0, i32 33
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %39, i32 0, i32 5
  %41 = load ptr, ptr %40, align 8, !tbaa !15
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = call i64 %37(ptr noundef %38, ptr noundef @gEfiI2cHostProtocolGuid, ptr noundef %12, ptr noundef %41, ptr noundef %42, i32 noundef 2)
  store i64 %43, ptr %10, align 8, !tbaa !9
  %44 = load i64, ptr %10, align 8, !tbaa !9
  %45 = icmp slt i64 %44, 0
  br i1 %45, label %46, label %47

46:                                               ; preds = %34
  store i64 -9223372036854775801, ptr %5, align 8
  store i32 1, ptr %14, align 4
  br label %139

47:                                               ; preds = %34
  %48 = call zeroext i8 @DebugAssertEnabled()
  %49 = zext i8 %48 to i32
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %61

51:                                               ; preds = %47
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = ptrtoint ptr %52 to i64
  %54 = sub i64 %53, ptrtoint (ptr getelementptr inbounds (%struct.I2C_HOST_CONTEXT, ptr null, i32 0, i32 7) to i64)
  %55 = inttoptr i64 %54 to ptr
  %56 = getelementptr inbounds %struct.I2C_HOST_CONTEXT, ptr %55, i32 0, i32 0
  %57 = load i64, ptr %56, align 8, !tbaa !17
  %58 = icmp ne i64 %57, 1212363337
  br i1 %58, label %59, label %61

59:                                               ; preds = %51
  call void @DebugAssert(ptr noundef @.str.12, i64 noundef 539, ptr noundef @.str.13)
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  br label %66

61:                                               ; preds = %51, %47
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  %63 = ptrtoint ptr %62 to i64
  %64 = sub i64 %63, ptrtoint (ptr getelementptr inbounds (%struct.I2C_HOST_CONTEXT, ptr null, i32 0, i32 7) to i64)
  %65 = inttoptr i64 %64 to ptr
  br label %66

66:                                               ; preds = %61, %59
  %67 = phi ptr [ %60, %59 ], [ %65, %61 ]
  store ptr %67, ptr %11, align 8, !tbaa !5
  %68 = load ptr, ptr @gBS, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %68, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !21
  %71 = call i64 %70(i64 noundef 16)
  store i64 %71, ptr %13, align 8, !tbaa !9
  store i64 -9223372036854775801, ptr %10, align 8, !tbaa !9
  %72 = load ptr, ptr %11, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.I2C_HOST_CONTEXT, ptr %72, i32 0, i32 5
  %74 = load i8, ptr %73, align 8, !tbaa !22
  %75 = icmp ne i8 %74, 0
  br i1 %75, label %89, label %76

76:                                               ; preds = %66
  %77 = load ptr, ptr %11, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.I2C_HOST_CONTEXT, ptr %77, i32 0, i32 6
  %79 = call zeroext i8 @IsListEmpty(ptr noundef %78)
  %80 = zext i8 %79 to i32
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %89

82:                                               ; preds = %76
  %83 = load ptr, ptr @gBS, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %83, i32 0, i32 40
  %85 = load ptr, ptr %84, align 8, !tbaa !23
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = call i64 (ptr, ...) %85(ptr noundef %86, ptr noundef @gEfiI2cHostProtocolGuid, ptr noundef %87, ptr noundef null)
  store i64 %88, ptr %10, align 8, !tbaa !9
  br label %89

89:                                               ; preds = %82, %76, %66
  %90 = load ptr, ptr @gBS, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %90, i32 0, i32 2
  %92 = load ptr, ptr %91, align 8, !tbaa !24
  %93 = load i64, ptr %13, align 8, !tbaa !9
  call void %92(i64 noundef %93)
  %94 = load i64, ptr %10, align 8, !tbaa !9
  %95 = icmp slt i64 %94, 0
  br i1 %95, label %137, label %96

96:                                               ; preds = %89
  %97 = load ptr, ptr @gBS, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %97, i32 0, i32 34
  %99 = load ptr, ptr %98, align 8, !tbaa !25
  %100 = load ptr, ptr %7, align 8, !tbaa !5
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %101, i32 0, i32 5
  %103 = load ptr, ptr %102, align 8, !tbaa !15
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = call i64 %99(ptr noundef %100, ptr noundef @gEfiI2cBusConfigurationManagementProtocolGuid, ptr noundef %103, ptr noundef %104)
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.I2C_HOST_CONTEXT, ptr %106, i32 0, i32 2
  %108 = load ptr, ptr %107, align 8, !tbaa !26
  %109 = icmp ne ptr %108, null
  br i1 %109, label %110, label %120

110:                                              ; preds = %96
  %111 = load ptr, ptr @gBS, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %111, i32 0, i32 12
  %113 = load ptr, ptr %112, align 8, !tbaa !27
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.I2C_HOST_CONTEXT, ptr %114, i32 0, i32 2
  %116 = load ptr, ptr %115, align 8, !tbaa !26
  %117 = call i64 %113(ptr noundef %116)
  %118 = load ptr, ptr %11, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.I2C_HOST_CONTEXT, ptr %118, i32 0, i32 2
  store ptr null, ptr %119, align 8, !tbaa !26
  br label %120

120:                                              ; preds = %110, %96
  %121 = load ptr, ptr %11, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.I2C_HOST_CONTEXT, ptr %121, i32 0, i32 3
  %123 = load ptr, ptr %122, align 8, !tbaa !28
  %124 = icmp ne ptr %123, null
  br i1 %124, label %125, label %135

125:                                              ; preds = %120
  %126 = load ptr, ptr @gBS, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %126, i32 0, i32 12
  %128 = load ptr, ptr %127, align 8, !tbaa !27
  %129 = load ptr, ptr %11, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.I2C_HOST_CONTEXT, ptr %129, i32 0, i32 3
  %131 = load ptr, ptr %130, align 8, !tbaa !28
  %132 = call i64 %128(ptr noundef %131)
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.I2C_HOST_CONTEXT, ptr %133, i32 0, i32 3
  store ptr null, ptr %134, align 8, !tbaa !28
  br label %135

135:                                              ; preds = %125, %120
  %136 = load ptr, ptr %11, align 8, !tbaa !5
  call void @FreePool(ptr noundef %136)
  br label %137

137:                                              ; preds = %135, %89
  %138 = load i64, ptr %10, align 8, !tbaa !9
  store i64 %138, ptr %5, align 8
  store i32 1, ptr %14, align 4
  br label %139

139:                                              ; preds = %137, %46, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  %140 = load i64, ptr %5, align 8
  ret i64 %140
}

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

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

declare zeroext i8 @DebugPrintEnabled() #2

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #2

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

declare void @FreePool(ptr noundef) #2

declare i64 @EfiGetCurrentTpl() #2

declare zeroext i8 @DebugAssertEnabled() #2

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

declare zeroext i8 @IsListEmpty(ptr noundef) #2

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, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 280}
!12 = !{!"", !13, 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}
!13 = !{!"", !10, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !6, i64 40}
!16 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !6, i64 32, !6, i64 40}
!17 = !{!18, !10, i64 0}
!18 = !{!"", !10, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !7, i64 40, !19, i64 48, !20, i64 64, !6, i64 80, !6, i64 88}
!19 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!20 = !{!"_EFI_I2C_HOST_PROTOCOL", !6, i64 0, !6, i64 8}
!21 = !{!12, !6, i64 24}
!22 = !{!18, !7, i64 40}
!23 = !{!12, !6, i64 336}
!24 = !{!12, !6, i64 32}
!25 = !{!12, !6, i64 288}
!26 = !{!18, !6, i64 16}
!27 = !{!12, !6, i64 112}
!28 = !{!18, !6, i64 24}


; 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
@gEfiI2cBusConfigurationManagementProtocolGuid = external global %struct.GUID, align 4
@gEfiI2cHostProtocolGuid = external global %struct.GUID, align 4
@.str.11 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [139 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @I2cHostDriverStop(ptr nocapture noundef readonly %0, ptr noundef %1, i64 noundef %2, ptr nocapture noundef readnone %3) local_unnamed_addr #0 {
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %6 = tail call i64 @EfiGetCurrentTpl() #3
  %7 = icmp ugt i64 %6, 16
  br i1 %7, label %8, label %13

8:                                                ; preds = %4
  %9 = tail call zeroext i8 @DebugPrintEnabled() #3
  %.not31 = icmp eq i8 %9, 0
  br i1 %.not31, label %70, label %10

10:                                               ; preds = %8
  %11 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not32 = icmp eq i8 %11, 0
  br i1 %.not32, label %70, label %12

12:                                               ; preds = %10
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.11, i64 noundef %6) #3
  br label %70

13:                                               ; preds = %4
  %14 = load ptr, ptr @gBS, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %14, i64 280
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = getelementptr inbounds i8, ptr %0, i64 40
  %18 = load ptr, ptr %17, align 8, !tbaa !14
  %19 = call i64 %16(ptr noundef %1, ptr noundef nonnull @gEfiI2cHostProtocolGuid, ptr noundef nonnull %5, ptr noundef %18, ptr noundef %1, i32 noundef 2) #3
  %20 = icmp slt i64 %19, 0
  br i1 %20, label %70, label %21

21:                                               ; preds = %13
  %22 = call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %22, 0
  %.pre = load ptr, ptr %5, align 8, !tbaa !5
  %.pre33 = ptrtoint ptr %.pre to i64
  %.pre34 = add i64 %.pre33, -64
  %.pre36 = inttoptr i64 %.pre34 to ptr
  br i1 %.not, label %._crit_edge, label %23

23:                                               ; preds = %21
  %24 = load i64, ptr %.pre36, align 8, !tbaa !16
  %.not26 = icmp eq i64 %24, 1212363337
  br i1 %.not26, label %._crit_edge, label %25

25:                                               ; preds = %23
  call void @DebugAssert(ptr noundef nonnull @.str.12, i64 noundef 539, ptr noundef nonnull @.str.13) #3
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %21, %23, %25
  %27 = phi ptr [ %26, %25 ], [ %.pre36, %23 ], [ %.pre36, %21 ]
  %28 = load ptr, ptr @gBS, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %28, i64 24
  %30 = load ptr, ptr %29, align 8, !tbaa !20
  %31 = call i64 %30(i64 noundef 16) #3
  %32 = getelementptr inbounds i8, ptr %27, i64 40
  %33 = load i8, ptr %32, align 8, !tbaa !21
  %.not27 = icmp eq i8 %33, 0
  br i1 %.not27, label %34, label %43

34:                                               ; preds = %._crit_edge
  %35 = getelementptr inbounds i8, ptr %27, i64 48
  %36 = call zeroext i8 @IsListEmpty(ptr noundef nonnull %35) #3
  %.not28 = icmp eq i8 %36, 0
  br i1 %.not28, label %43, label %37

37:                                               ; preds = %34
  %38 = load ptr, ptr @gBS, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %38, i64 336
  %40 = load ptr, ptr %39, align 8, !tbaa !22
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = call i64 (ptr, ...) %40(ptr noundef %1, ptr noundef nonnull @gEfiI2cHostProtocolGuid, ptr noundef %41, ptr noundef null) #3
  br label %43

43:                                               ; preds = %37, %34, %._crit_edge
  %.022 = phi i64 [ -9223372036854775801, %._crit_edge ], [ %42, %37 ], [ -9223372036854775801, %34 ]
  %44 = load ptr, ptr @gBS, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %44, i64 32
  %46 = load ptr, ptr %45, align 8, !tbaa !23
  call void %46(i64 noundef %31) #3
  %47 = icmp slt i64 %.022, 0
  br i1 %47, label %70, label %48

48:                                               ; preds = %43
  %49 = load ptr, ptr @gBS, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i64 288
  %51 = load ptr, ptr %50, align 8, !tbaa !24
  %52 = load ptr, ptr %17, align 8, !tbaa !14
  %53 = call i64 %51(ptr noundef %1, ptr noundef nonnull @gEfiI2cBusConfigurationManagementProtocolGuid, ptr noundef %52, ptr noundef %1) #3
  %54 = getelementptr inbounds i8, ptr %27, i64 16
  %55 = load ptr, ptr %54, align 8, !tbaa !25
  %.not29 = icmp eq ptr %55, null
  br i1 %.not29, label %61, label %56

56:                                               ; preds = %48
  %57 = load ptr, ptr @gBS, align 8, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %57, i64 112
  %59 = load ptr, ptr %58, align 8, !tbaa !26
  %60 = call i64 %59(ptr noundef nonnull %55) #3
  store ptr null, ptr %54, align 8, !tbaa !25
  br label %61

61:                                               ; preds = %56, %48
  %62 = getelementptr inbounds i8, ptr %27, i64 24
  %63 = load ptr, ptr %62, align 8, !tbaa !27
  %.not30 = icmp eq ptr %63, null
  br i1 %.not30, label %69, label %64

64:                                               ; preds = %61
  %65 = load ptr, ptr @gBS, align 8, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %65, i64 112
  %67 = load ptr, ptr %66, align 8, !tbaa !26
  %68 = call i64 %67(ptr noundef nonnull %63) #3
  store ptr null, ptr %62, align 8, !tbaa !27
  br label %69

69:                                               ; preds = %64, %61
  call void @FreePool(ptr noundef nonnull %27) #3
  br label %70

70:                                               ; preds = %43, %69, %13, %8, %12, %10
  %.0 = phi i64 [ -9223372036854775801, %10 ], [ -9223372036854775801, %12 ], [ -9223372036854775801, %8 ], [ -9223372036854775801, %13 ], [ %.022, %69 ], [ %.022, %43 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  ret i64 %.0
}

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

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

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #2

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

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

declare void @FreePool(ptr noundef) local_unnamed_addr #2

declare i64 @EfiGetCurrentTpl() local_unnamed_addr #2

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

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

declare zeroext i8 @IsListEmpty(ptr noundef) local_unnamed_addr #2

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 = { mustprogress 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 280}
!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 = !{!15, !6, i64 40}
!15 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !6, i64 32, !6, i64 40}
!16 = !{!17, !12, i64 0}
!17 = !{!"", !12, i64 0, !12, i64 8, !6, i64 16, !6, i64 24, !12, i64 32, !7, i64 40, !18, i64 48, !19, i64 64, !6, i64 80, !6, i64 88}
!18 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!19 = !{!"_EFI_I2C_HOST_PROTOCOL", !6, i64 0, !6, i64 8}
!20 = !{!10, !6, i64 24}
!21 = !{!17, !7, i64 40}
!22 = !{!10, !6, i64 336}
!23 = !{!10, !6, i64 32}
!24 = !{!10, !6, i64 288}
!25 = !{!17, !6, i64 16}
!26 = !{!10, !6, i64 112}
!27 = !{!17, !6, i64 24}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass