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

; 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.MNP_DEVICE_DATA = type { i32, ptr, ptr, %struct._EFI_VLAN_CONFIG_PROTOCOL, i64, ptr, ptr, %struct._LIST_ENTRY, i64, %struct._LIST_ENTRY, i32, ptr, %struct.NET_BUF_QUEUE, i64, ptr, i8, ptr, ptr, i32, i32, i32, i32, i32, i32, ptr, ptr }
%struct._EFI_VLAN_CONFIG_PROTOCOL = type { ptr, ptr, ptr }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.NET_BUF_QUEUE = type { i32, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i32, i32 }
%struct.MNP_SERVICE_DATA = type { i32, %struct._LIST_ENTRY, ptr, ptr, %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr, %struct._LIST_ENTRY, i64, i32, i16, i8 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct.EFI_VLAN_FIND_DATA = type { i16, i8 }

@.str = external hidden unnamed_addr constant [149 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1

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

17:                                               ; preds = %4
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %25

20:                                               ; preds = %17
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = load i16, ptr %21, align 2, !tbaa !9
  %23 = zext i16 %22 to i32
  %24 = icmp sgt i32 %23, 4094
  br i1 %24, label %31, label %25

25:                                               ; preds = %20, %17
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = icmp eq ptr %26, null
  br i1 %27, label %31, label %28

28:                                               ; preds = %25
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %32

31:                                               ; preds = %28, %25, %20, %4
  store i64 -9223372036854775806, ptr %5, align 8
  store i32 1, ptr %14, align 4
  br label %154

32:                                               ; preds = %28
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  store i16 0, ptr %33, align 2, !tbaa !9
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr null, ptr %34, align 8, !tbaa !5
  %35 = call zeroext i8 @DebugAssertEnabled()
  %36 = zext i8 %35 to i32
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %48

38:                                               ; preds = %32
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = ptrtoint ptr %39 to i64
  %41 = sub i64 %40, ptrtoint (ptr getelementptr inbounds (%struct.MNP_DEVICE_DATA, ptr null, i32 0, i32 3) to i64)
  %42 = inttoptr i64 %41 to ptr
  %43 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %42, i32 0, i32 0
  %44 = load i32, ptr %43, align 8, !tbaa !11
  %45 = icmp ne i32 %44, 1148218957
  br i1 %45, label %46, label %48

46:                                               ; preds = %38
  call void @DebugAssert(ptr noundef @.str, i64 noundef 531, ptr noundef @.str.2)
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  br label %53

48:                                               ; preds = %38, %32
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = ptrtoint ptr %49 to i64
  %51 = sub i64 %50, ptrtoint (ptr getelementptr inbounds (%struct.MNP_DEVICE_DATA, ptr null, i32 0, i32 3) to i64)
  %52 = inttoptr i64 %51 to ptr
  br label %53

53:                                               ; preds = %48, %46
  %54 = phi ptr [ %47, %46 ], [ %52, %48 ]
  store ptr %54, ptr %10, align 8, !tbaa !5
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %55, i32 0, i32 4
  %57 = load i64, ptr %56, align 8, !tbaa !18
  %58 = icmp eq i64 %57, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %53
  store i64 -9223372036854775794, ptr %5, align 8
  store i32 1, ptr %14, align 4
  br label %154

60:                                               ; preds = %53
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = icmp eq ptr %61, null
  br i1 %62, label %63, label %127

63:                                               ; preds = %60
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %64, i32 0, i32 4
  %66 = load i64, ptr %65, align 8, !tbaa !18
  %67 = trunc i64 %66 to i16
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  store i16 %67, ptr %68, align 2, !tbaa !9
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = load i16, ptr %69, align 2, !tbaa !9
  %71 = zext i16 %70 to i64
  %72 = mul i64 %71, 4
  %73 = call ptr @AllocateZeroPool(i64 noundef %72)
  store ptr %73, ptr %13, align 8, !tbaa !5
  %74 = load ptr, ptr %13, align 8, !tbaa !5
  %75 = icmp eq ptr %74, null
  br i1 %75, label %76, label %77

76:                                               ; preds = %63
  store i64 -9223372036854775799, ptr %5, align 8
  store i32 1, ptr %14, align 4
  br label %154

77:                                               ; preds = %63
  %78 = load ptr, ptr %13, align 8, !tbaa !5
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %78, ptr %79, align 8, !tbaa !5
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %80, i32 0, i32 7
  %82 = getelementptr inbounds %struct._LIST_ENTRY, ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8, !tbaa !19
  store ptr %83, ptr %12, align 8, !tbaa !5
  br label %84

84:                                               ; preds = %122, %77
  %85 = load ptr, ptr %12, align 8, !tbaa !5
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %86, i32 0, i32 7
  %88 = icmp ne ptr %85, %87
  br i1 %88, label %89, label %126

89:                                               ; preds = %84
  %90 = call zeroext i8 @DebugAssertEnabled()
  %91 = zext i8 %90 to i32
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %103

93:                                               ; preds = %89
  %94 = load ptr, ptr %12, align 8, !tbaa !5
  %95 = ptrtoint ptr %94 to i64
  %96 = sub i64 %95, ptrtoint (ptr getelementptr inbounds (%struct.MNP_SERVICE_DATA, ptr null, i32 0, i32 1) to i64)
  %97 = inttoptr i64 %96 to ptr
  %98 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %97, i32 0, i32 0
  %99 = load i32, ptr %98, align 8, !tbaa !20
  %100 = icmp ne i32 %99, 1399877197
  br i1 %100, label %101, label %103

101:                                              ; preds = %93
  call void @DebugAssert(ptr noundef @.str, i64 noundef 548, ptr noundef @.str.2)
  %102 = load ptr, ptr %12, align 8, !tbaa !5
  br label %108

103:                                              ; preds = %93, %89
  %104 = load ptr, ptr %12, align 8, !tbaa !5
  %105 = ptrtoint ptr %104 to i64
  %106 = sub i64 %105, ptrtoint (ptr getelementptr inbounds (%struct.MNP_SERVICE_DATA, ptr null, i32 0, i32 1) to i64)
  %107 = inttoptr i64 %106 to ptr
  br label %108

108:                                              ; preds = %103, %101
  %109 = phi ptr [ %102, %101 ], [ %107, %103 ]
  store ptr %109, ptr %11, align 8, !tbaa !5
  %110 = load ptr, ptr %11, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %110, i32 0, i32 9
  %112 = load i16, ptr %111, align 4, !tbaa !23
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.EFI_VLAN_FIND_DATA, ptr %113, i32 0, i32 0
  store i16 %112, ptr %114, align 2, !tbaa !24
  %115 = load ptr, ptr %11, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %115, i32 0, i32 10
  %117 = load i8, ptr %116, align 2, !tbaa !26
  %118 = load ptr, ptr %13, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.EFI_VLAN_FIND_DATA, ptr %118, i32 0, i32 1
  store i8 %117, ptr %119, align 2, !tbaa !27
  %120 = load ptr, ptr %13, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.EFI_VLAN_FIND_DATA, ptr %120, i32 1
  store ptr %121, ptr %13, align 8, !tbaa !5
  br label %122

122:                                              ; preds = %108
  %123 = load ptr, ptr %12, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._LIST_ENTRY, ptr %123, i32 0, i32 0
  %125 = load ptr, ptr %124, align 8, !tbaa !28
  store ptr %125, ptr %12, align 8, !tbaa !5
  br label %84, !llvm.loop !29

126:                                              ; preds = %84
  store i64 0, ptr %5, align 8
  store i32 1, ptr %14, align 4
  br label %154

127:                                              ; preds = %60
  %128 = load ptr, ptr %10, align 8, !tbaa !5
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = load i16, ptr %129, align 2, !tbaa !9
  %131 = call ptr @MnpFindServiceData(ptr noundef %128, i16 noundef zeroext %130)
  store ptr %131, ptr %11, align 8, !tbaa !5
  %132 = load ptr, ptr %11, align 8, !tbaa !5
  %133 = icmp eq ptr %132, null
  br i1 %133, label %134, label %135

134:                                              ; preds = %127
  store i64 -9223372036854775794, ptr %5, align 8
  store i32 1, ptr %14, align 4
  br label %154

135:                                              ; preds = %127
  %136 = call ptr @AllocateZeroPool(i64 noundef 4)
  store ptr %136, ptr %13, align 8, !tbaa !5
  %137 = load ptr, ptr %13, align 8, !tbaa !5
  %138 = icmp eq ptr %137, null
  br i1 %138, label %139, label %140

139:                                              ; preds = %135
  store i64 -9223372036854775799, ptr %5, align 8
  store i32 1, ptr %14, align 4
  br label %154

140:                                              ; preds = %135
  %141 = load ptr, ptr %11, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %141, i32 0, i32 9
  %143 = load i16, ptr %142, align 4, !tbaa !23
  %144 = load ptr, ptr %13, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.EFI_VLAN_FIND_DATA, ptr %144, i32 0, i32 0
  store i16 %143, ptr %145, align 2, !tbaa !24
  %146 = load ptr, ptr %11, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %146, i32 0, i32 10
  %148 = load i8, ptr %147, align 2, !tbaa !26
  %149 = load ptr, ptr %13, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.EFI_VLAN_FIND_DATA, ptr %149, i32 0, i32 1
  store i8 %148, ptr %150, align 2, !tbaa !27
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  store i16 1, ptr %151, align 2, !tbaa !9
  %152 = load ptr, ptr %13, align 8, !tbaa !5
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %152, ptr %153, align 8, !tbaa !5
  store i64 0, ptr %5, align 8
  store i32 1, ptr %14, align 4
  br label %154

154:                                              ; preds = %140, %139, %134, %126, %76, %59, %31
  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
  %155 = load i64, ptr %5, align 8
  ret i64 %155
}

; 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 @DebugAssertEnabled() #2

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

declare ptr @AllocateZeroPool(i64 noundef) #2

declare ptr @MnpFindServiceData(ptr noundef, i16 noundef zeroext) #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 = !{!"short", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"", !13, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !15, i64 48, !6, i64 56, !6, i64 64, !16, i64 72, !15, i64 88, !16, i64 96, !13, i64 112, !6, i64 120, !17, i64 128, !15, i64 184, !6, i64 192, !7, i64 200, !6, i64 208, !6, i64 216, !13, i64 224, !13, i64 228, !13, i64 232, !13, i64 236, !13, i64 240, !13, i64 244, !6, i64 248, !6, i64 256}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_EFI_VLAN_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!17 = !{!"", !13, i64 0, !15, i64 8, !16, i64 16, !16, i64 32, !13, i64 48, !13, i64 52}
!18 = !{!12, !15, i64 48}
!19 = !{!12, !6, i64 72}
!20 = !{!21, !13, i64 0}
!21 = !{!"", !13, i64 0, !16, i64 8, !6, i64 24, !6, i64 32, !22, i64 40, !6, i64 56, !16, i64 64, !15, i64 80, !13, i64 88, !10, i64 92, !7, i64 94}
!22 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!23 = !{!21, !10, i64 92}
!24 = !{!25, !10, i64 0}
!25 = !{!"", !10, i64 0, !7, i64 2}
!26 = !{!21, !7, i64 94}
!27 = !{!25, !7, i64 2}
!28 = !{!16, !6, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [149 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @VlanConfigFind(ptr noundef %0, ptr noundef readonly %1, ptr noundef writeonly %2, ptr noundef writeonly %3) local_unnamed_addr #0 {
  %5 = icmp eq ptr %0, null
  br i1 %5, label %.loopexit, label %6

6:                                                ; preds = %4
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %12, label %7

7:                                                ; preds = %6
  %8 = load i16, ptr %1, align 2, !tbaa !5
  %9 = icmp ugt i16 %8, 4094
  %10 = icmp eq ptr %2, null
  %or.cond = or i1 %10, %9
  %11 = icmp eq ptr %3, null
  %or.cond56 = or i1 %11, %or.cond
  br i1 %or.cond56, label %.loopexit, label %13

12:                                               ; preds = %6
  %.old1 = icmp eq ptr %2, null
  %.old = icmp eq ptr %3, null
  %or.cond57 = or i1 %.old1, %.old
  br i1 %or.cond57, label %.loopexit, label %13

13:                                               ; preds = %12, %7
  store i16 0, ptr %2, align 2, !tbaa !5
  store ptr null, ptr %3, align 8, !tbaa !9
  %14 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not51 = icmp eq i8 %14, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre62 = add i64 %.pre, -24
  %.pre64 = inttoptr i64 %.pre62 to ptr
  br i1 %.not51, label %._crit_edge, label %15

15:                                               ; preds = %13
  %16 = load i32, ptr %.pre64, align 8, !tbaa !11
  %.not52 = icmp eq i32 %16, 1148218957
  br i1 %.not52, label %._crit_edge, label %17

17:                                               ; preds = %15
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 531, ptr noundef nonnull @.str.2) #2
  br label %._crit_edge

._crit_edge:                                      ; preds = %13, %15, %17
  %18 = phi ptr [ %0, %17 ], [ %.pre64, %15 ], [ %.pre64, %13 ]
  %19 = getelementptr inbounds i8, ptr %18, i64 48
  %20 = load i64, ptr %19, align 8, !tbaa !18
  %21 = icmp eq i64 %20, 0
  br i1 %21, label %.loopexit, label %22

22:                                               ; preds = %._crit_edge
  br i1 %.not, label %23, label %42

23:                                               ; preds = %22
  %24 = trunc i64 %20 to i16
  store i16 %24, ptr %2, align 2, !tbaa !5
  %25 = shl i64 %20, 2
  %26 = and i64 %25, 262140
  %27 = tail call ptr @AllocateZeroPool(i64 noundef %26) #2
  %28 = icmp eq ptr %27, null
  br i1 %28, label %.loopexit, label %29

29:                                               ; preds = %23
  store ptr %27, ptr %3, align 8, !tbaa !9
  %30 = getelementptr inbounds i8, ptr %18, i64 72
  %.04258 = load ptr, ptr %30, align 8, !tbaa !19
  %.not5359 = icmp eq ptr %.04258, %30
  br i1 %.not5359, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %29, %.lr.ph._crit_edge
  %.04261 = phi ptr [ %.042, %.lr.ph._crit_edge ], [ %.04258, %29 ]
  %.060 = phi ptr [ %41, %.lr.ph._crit_edge ], [ %27, %29 ]
  %31 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not54 = icmp eq i8 %31, 0
  %.pre66 = ptrtoint ptr %.04261 to i64
  %.pre68 = add i64 %.pre66, -8
  %.pre70 = inttoptr i64 %.pre68 to ptr
  br i1 %.not54, label %.lr.ph._crit_edge, label %32

32:                                               ; preds = %.lr.ph
  %33 = load i32, ptr %.pre70, align 8, !tbaa !20
  %.not55 = icmp eq i32 %33, 1399877197
  br i1 %.not55, label %.lr.ph._crit_edge, label %34

34:                                               ; preds = %32
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 548, ptr noundef nonnull @.str.2) #2
  br label %.lr.ph._crit_edge

.lr.ph._crit_edge:                                ; preds = %.lr.ph, %32, %34
  %35 = phi ptr [ %.04261, %34 ], [ %.pre70, %32 ], [ %.pre70, %.lr.ph ]
  %36 = getelementptr inbounds i8, ptr %35, i64 92
  %37 = load i16, ptr %36, align 4, !tbaa !23
  store i16 %37, ptr %.060, align 2, !tbaa !24
  %38 = getelementptr inbounds i8, ptr %35, i64 94
  %39 = load i8, ptr %38, align 2, !tbaa !26
  %40 = getelementptr inbounds i8, ptr %.060, i64 2
  store i8 %39, ptr %40, align 2, !tbaa !27
  %41 = getelementptr inbounds i8, ptr %.060, i64 4
  %.042 = load ptr, ptr %.04261, align 8, !tbaa !19
  %.not53 = icmp eq ptr %.042, %30
  br i1 %.not53, label %.loopexit, label %.lr.ph, !llvm.loop !28

42:                                               ; preds = %22
  %43 = load i16, ptr %1, align 2, !tbaa !5
  %44 = tail call ptr @MnpFindServiceData(ptr noundef nonnull %18, i16 noundef zeroext %43) #2
  %45 = icmp eq ptr %44, null
  br i1 %45, label %.loopexit, label %46

46:                                               ; preds = %42
  %47 = tail call ptr @AllocateZeroPool(i64 noundef 4) #2
  %48 = icmp eq ptr %47, null
  br i1 %48, label %.loopexit, label %49

49:                                               ; preds = %46
  %50 = getelementptr inbounds i8, ptr %44, i64 92
  %51 = load i16, ptr %50, align 4, !tbaa !23
  store i16 %51, ptr %47, align 2, !tbaa !24
  %52 = getelementptr inbounds i8, ptr %44, i64 94
  %53 = load i8, ptr %52, align 2, !tbaa !26
  %54 = getelementptr inbounds i8, ptr %47, i64 2
  store i8 %53, ptr %54, align 2, !tbaa !27
  store i16 1, ptr %2, align 2, !tbaa !5
  store ptr %47, ptr %3, align 8, !tbaa !9
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph._crit_edge, %29, %46, %42, %23, %._crit_edge, %4, %7, %12, %49
  %.043 = phi i64 [ 0, %49 ], [ -9223372036854775806, %12 ], [ -9223372036854775806, %7 ], [ -9223372036854775806, %4 ], [ -9223372036854775794, %._crit_edge ], [ -9223372036854775799, %23 ], [ -9223372036854775794, %42 ], [ -9223372036854775799, %46 ], [ 0, %29 ], [ 0, %.lr.ph._crit_edge ]
  ret i64 %.043
}

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

declare ptr @AllocateZeroPool(i64 noundef) local_unnamed_addr #1

declare ptr @MnpFindServiceData(ptr noundef, i16 noundef zeroext) local_unnamed_addr #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 = { "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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"", !13, i64 0, !10, i64 8, !10, i64 16, !14, i64 24, !15, i64 48, !10, i64 56, !10, i64 64, !16, i64 72, !15, i64 88, !16, i64 96, !13, i64 112, !10, i64 120, !17, i64 128, !15, i64 184, !10, i64 192, !7, i64 200, !10, i64 208, !10, i64 216, !13, i64 224, !13, i64 228, !13, i64 232, !13, i64 236, !13, i64 240, !13, i64 244, !10, i64 248, !10, i64 256}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_EFI_VLAN_CONFIG_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!17 = !{!"", !13, i64 0, !15, i64 8, !16, i64 16, !16, i64 32, !13, i64 48, !13, i64 52}
!18 = !{!12, !15, i64 48}
!19 = !{!16, !10, i64 0}
!20 = !{!21, !13, i64 0}
!21 = !{!"", !13, i64 0, !16, i64 8, !10, i64 24, !10, i64 32, !22, i64 40, !10, i64 56, !16, i64 64, !15, i64 80, !13, i64 88, !6, i64 92, !7, i64 94}
!22 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !10, i64 0, !10, i64 8}
!23 = !{!21, !6, i64 92}
!24 = !{!25, !6, i64 0}
!25 = !{!"", !6, i64 0, !7, i64 2}
!26 = !{!21, !7, i64 94}
!27 = !{!25, !7, i64 2}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


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