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

; 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 }
%union.VLAN_TCI = type { %struct.anon }
%struct.anon = type { i16 }

@.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 @VlanConfigRemove(ptr noundef %0, i16 noundef zeroext %1) #0 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i16, align 2
  %6 = alloca i64, 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 i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i16 %1, ptr %5, align 2, !tbaa !9
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = icmp eq ptr %13, null
  br i1 %14, label %19, label %15

15:                                               ; preds = %2
  %16 = load i16, ptr %5, align 2, !tbaa !9
  %17 = zext i16 %16 to i32
  %18 = icmp sgt i32 %17, 4094
  br i1 %18, label %19, label %20

19:                                               ; preds = %15, %2
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %181

20:                                               ; preds = %15
  %21 = call zeroext i8 @DebugAssertEnabled()
  %22 = zext i8 %21 to i32
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %34

24:                                               ; preds = %20
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = ptrtoint ptr %25 to i64
  %27 = sub i64 %26, ptrtoint (ptr getelementptr inbounds (%struct.MNP_DEVICE_DATA, ptr null, i32 0, i32 3) to i64)
  %28 = inttoptr i64 %27 to ptr
  %29 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %28, i32 0, i32 0
  %30 = load i32, ptr %29, align 8, !tbaa !11
  %31 = icmp ne i32 %30, 1148218957
  br i1 %31, label %32, label %34

32:                                               ; preds = %24
  call void @DebugAssert(ptr noundef @.str, i64 noundef 615, ptr noundef @.str.2)
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  br label %39

34:                                               ; preds = %24, %20
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = ptrtoint ptr %35 to i64
  %37 = sub i64 %36, ptrtoint (ptr getelementptr inbounds (%struct.MNP_DEVICE_DATA, ptr null, i32 0, i32 3) to i64)
  %38 = inttoptr i64 %37 to ptr
  br label %39

39:                                               ; preds = %34, %32
  %40 = phi ptr [ %33, %32 ], [ %38, %34 ]
  store ptr %40, ptr %7, align 8, !tbaa !5
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %41, i32 0, i32 4
  %43 = load i64, ptr %42, align 8, !tbaa !18
  %44 = icmp eq i64 %43, 0
  br i1 %44, label %45, label %46

45:                                               ; preds = %39
  store i64 -9223372036854775794, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %181

46:                                               ; preds = %39
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = load i16, ptr %5, align 2, !tbaa !9
  %49 = call ptr @MnpFindServiceData(ptr noundef %47, i16 noundef zeroext %48)
  store ptr %49, ptr %8, align 8, !tbaa !5
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = icmp eq ptr %50, null
  br i1 %51, label %52, label %53

52:                                               ; preds = %46
  store i64 -9223372036854775794, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %181

53:                                               ; preds = %46
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %54, i32 0, i32 4
  %56 = load i64, ptr %55, align 8, !tbaa !18
  %57 = add i64 %56, -1
  store i64 %57, ptr %55, align 8, !tbaa !18
  %58 = load i16, ptr %5, align 2, !tbaa !9
  %59 = zext i16 %58 to i32
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %66, label %61

61:                                               ; preds = %53
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %62, i32 0, i32 4
  %64 = load i64, ptr %63, align 8, !tbaa !18
  %65 = icmp ne i64 %64, 0
  br i1 %65, label %66, label %81

66:                                               ; preds = %61, %53
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = call i64 @MnpDestroyServiceChild(ptr noundef %67)
  store i64 %68, ptr %6, align 8, !tbaa !19
  %69 = load i64, ptr %6, align 8, !tbaa !19
  %70 = icmp slt i64 %69, 0
  br i1 %70, label %71, label %73

71:                                               ; preds = %66
  %72 = load i64, ptr %6, align 8, !tbaa !19
  store i64 %72, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %181

73:                                               ; preds = %66
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = call i64 @MnpDestroyServiceData(ptr noundef %74)
  store i64 %75, ptr %6, align 8, !tbaa !19
  %76 = load i64, ptr %6, align 8, !tbaa !19
  %77 = icmp slt i64 %76, 0
  br i1 %77, label %78, label %80

78:                                               ; preds = %73
  %79 = load i64, ptr %6, align 8, !tbaa !19
  store i64 %79, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %181

80:                                               ; preds = %73
  br label %81

81:                                               ; preds = %80, %61
  %82 = load i16, ptr %5, align 2, !tbaa !9
  %83 = zext i16 %82 to i32
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %97

85:                                               ; preds = %81
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %86, i32 0, i32 4
  %88 = load i64, ptr %87, align 8, !tbaa !18
  %89 = icmp eq i64 %88, 0
  br i1 %89, label %90, label %97

90:                                               ; preds = %85
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = call ptr @MnpCreateServiceData(ptr noundef %91, i16 noundef zeroext 0, i8 noundef zeroext 0)
  store ptr %92, ptr %8, align 8, !tbaa !5
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = icmp eq ptr %93, null
  br i1 %94, label %95, label %96

95:                                               ; preds = %90
  store i64 -9223372036854775799, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %181

96:                                               ; preds = %90
  br label %97

97:                                               ; preds = %96, %85, %81
  store ptr null, ptr %10, align 8, !tbaa !5
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %98, i32 0, i32 4
  %100 = load i64, ptr %99, align 8, !tbaa !18
  %101 = icmp ne i64 %100, 0
  br i1 %101, label %102, label %168

102:                                              ; preds = %97
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %103, i32 0, i32 4
  %105 = load i64, ptr %104, align 8, !tbaa !18
  %106 = mul i64 %105, 2
  %107 = call ptr @AllocatePool(i64 noundef %106)
  store ptr %107, ptr %10, align 8, !tbaa !5
  %108 = load ptr, ptr %10, align 8, !tbaa !5
  %109 = icmp eq ptr %108, null
  br i1 %109, label %110, label %111

110:                                              ; preds = %102
  store i64 -9223372036854775799, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %181

111:                                              ; preds = %102
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %112, ptr %11, align 8, !tbaa !5
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %113, i32 0, i32 7
  %115 = getelementptr inbounds %struct._LIST_ENTRY, ptr %114, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !20
  store ptr %116, ptr %9, align 8, !tbaa !5
  br label %117

117:                                              ; preds = %163, %111
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %119, i32 0, i32 7
  %121 = icmp ne ptr %118, %120
  br i1 %121, label %122, label %167

122:                                              ; preds = %117
  %123 = call zeroext i8 @DebugAssertEnabled()
  %124 = zext i8 %123 to i32
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %136

126:                                              ; preds = %122
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = ptrtoint ptr %127 to i64
  %129 = sub i64 %128, ptrtoint (ptr getelementptr inbounds (%struct.MNP_SERVICE_DATA, ptr null, i32 0, i32 1) to i64)
  %130 = inttoptr i64 %129 to ptr
  %131 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %130, i32 0, i32 0
  %132 = load i32, ptr %131, align 8, !tbaa !21
  %133 = icmp ne i32 %132, 1399877197
  br i1 %133, label %134, label %136

134:                                              ; preds = %126
  call void @DebugAssert(ptr noundef @.str, i64 noundef 668, ptr noundef @.str.2)
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  br label %141

136:                                              ; preds = %126, %122
  %137 = load ptr, ptr %9, align 8, !tbaa !5
  %138 = ptrtoint ptr %137 to i64
  %139 = sub i64 %138, ptrtoint (ptr getelementptr inbounds (%struct.MNP_SERVICE_DATA, ptr null, i32 0, i32 1) to i64)
  %140 = inttoptr i64 %139 to ptr
  br label %141

141:                                              ; preds = %136, %134
  %142 = phi ptr [ %135, %134 ], [ %140, %136 ]
  store ptr %142, ptr %8, align 8, !tbaa !5
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %143, i32 0, i32 9
  %145 = load i16, ptr %144, align 4, !tbaa !24
  %146 = load ptr, ptr %11, align 8, !tbaa !5
  %147 = load i16, ptr %146, align 1
  %148 = and i16 %145, 4095
  %149 = and i16 %147, -4096
  %150 = or i16 %149, %148
  store i16 %150, ptr %146, align 1
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %151, i32 0, i32 10
  %153 = load i8, ptr %152, align 2, !tbaa !25
  %154 = zext i8 %153 to i16
  %155 = load ptr, ptr %11, align 8, !tbaa !5
  %156 = load i16, ptr %155, align 1
  %157 = and i16 %154, 7
  %158 = shl i16 %157, 13
  %159 = and i16 %156, 8191
  %160 = or i16 %159, %158
  store i16 %160, ptr %155, align 1
  %161 = load ptr, ptr %11, align 8, !tbaa !5
  %162 = getelementptr inbounds %union.VLAN_TCI, ptr %161, i32 1
  store ptr %162, ptr %11, align 8, !tbaa !5
  br label %163

163:                                              ; preds = %141
  %164 = load ptr, ptr %9, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct._LIST_ENTRY, ptr %164, i32 0, i32 0
  %166 = load ptr, ptr %165, align 8, !tbaa !26
  store ptr %166, ptr %9, align 8, !tbaa !5
  br label %117, !llvm.loop !27

167:                                              ; preds = %117
  br label %168

168:                                              ; preds = %167, %97
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = load ptr, ptr %7, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %170, i32 0, i32 4
  %172 = load i64, ptr %171, align 8, !tbaa !18
  %173 = load ptr, ptr %10, align 8, !tbaa !5
  %174 = call i64 @MnpSetVlanVariable(ptr noundef %169, i64 noundef %172, ptr noundef %173)
  store i64 %174, ptr %6, align 8, !tbaa !19
  %175 = load ptr, ptr %10, align 8, !tbaa !5
  %176 = icmp ne ptr %175, null
  br i1 %176, label %177, label %179

177:                                              ; preds = %168
  %178 = load ptr, ptr %10, align 8, !tbaa !5
  call void @FreePool(ptr noundef %178)
  br label %179

179:                                              ; preds = %177, %168
  %180 = load i64, ptr %6, align 8, !tbaa !19
  store i64 %180, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %181

181:                                              ; preds = %179, %110, %95, %78, %71, %52, %45, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  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
  %182 = load i64, ptr %3, align 8
  ret i64 %182
}

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

declare void @FreePool(ptr noundef) #2

; 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

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

declare i64 @MnpDestroyServiceChild(ptr noundef) #2

declare i64 @MnpDestroyServiceData(ptr noundef) #2

declare ptr @MnpCreateServiceData(ptr noundef, i16 noundef zeroext, i8 noundef zeroext) #2

declare ptr @MnpFindServiceData(ptr noundef, i16 noundef zeroext) #2

declare ptr @AllocatePool(i64 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 = !{!"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 = !{!15, !15, i64 0}
!20 = !{!12, !6, i64 72}
!21 = !{!22, !13, i64 0}
!22 = !{!"", !13, i64 0, !16, i64 8, !6, i64 24, !6, i64 32, !23, i64 40, !6, i64 56, !16, i64 64, !15, i64 80, !13, i64 88, !10, i64 92, !7, i64 94}
!23 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!24 = !{!22, !10, i64 92}
!25 = !{!22, !7, i64 94}
!26 = !{!16, !6, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"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 i64 @VlanConfigRemove(ptr noundef %0, i16 noundef zeroext %1) local_unnamed_addr #0 {
  %3 = icmp eq ptr %0, null
  %4 = icmp ugt i16 %1, 4094
  %or.cond = or i1 %3, %4
  br i1 %or.cond, label %62, label %5

5:                                                ; preds = %2
  %6 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %6, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre77 = add i64 %.pre, -24
  %.pre79 = inttoptr i64 %.pre77 to ptr
  br i1 %.not, label %._crit_edge76, label %7

7:                                                ; preds = %5
  %8 = load i32, ptr %.pre79, align 8, !tbaa !5
  %.not56 = icmp eq i32 %8, 1148218957
  br i1 %.not56, label %._crit_edge76, label %9

9:                                                ; preds = %7
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 615, ptr noundef nonnull @.str.2) #2
  br label %._crit_edge76

._crit_edge76:                                    ; preds = %5, %7, %9
  %10 = phi ptr [ %0, %9 ], [ %.pre79, %7 ], [ %.pre79, %5 ]
  %11 = getelementptr inbounds i8, ptr %10, i64 48
  %12 = load i64, ptr %11, align 8, !tbaa !15
  %13 = icmp eq i64 %12, 0
  br i1 %13, label %62, label %14

14:                                               ; preds = %._crit_edge76
  %15 = tail call ptr @MnpFindServiceData(ptr noundef nonnull %10, i16 noundef zeroext %1) #2
  %16 = icmp eq ptr %15, null
  br i1 %16, label %62, label %17

17:                                               ; preds = %14
  %18 = load i64, ptr %11, align 8, !tbaa !15
  %19 = add i64 %18, -1
  store i64 %19, ptr %11, align 8, !tbaa !15
  %.not57 = icmp eq i16 %1, 0
  %.not58 = icmp eq i64 %19, 0
  %or.cond64 = select i1 %.not57, i1 %.not58, i1 false
  br i1 %or.cond64, label %.thread69, label %20

20:                                               ; preds = %17
  %21 = tail call i64 @MnpDestroyServiceChild(ptr noundef nonnull %15) #2
  %22 = icmp slt i64 %21, 0
  br i1 %22, label %62, label %23

23:                                               ; preds = %20
  %24 = tail call i64 @MnpDestroyServiceData(ptr noundef nonnull %15) #2
  %25 = icmp slt i64 %24, 0
  br i1 %25, label %62, label %26

26:                                               ; preds = %23
  br i1 %.not57, label %33, label %27

27:                                               ; preds = %26
  %28 = load i64, ptr %11, align 8, !tbaa !15
  %29 = icmp eq i64 %28, 0
  br i1 %29, label %30, label %.thread67

30:                                               ; preds = %27
  %31 = tail call ptr @MnpCreateServiceData(ptr noundef nonnull %10, i16 noundef zeroext 0, i8 noundef zeroext 0) #2
  %32 = icmp eq ptr %31, null
  br i1 %32, label %62, label %33

33:                                               ; preds = %30, %26
  %.pr = load i64, ptr %11, align 8, !tbaa !15
  %.not59 = icmp eq i64 %.pr, 0
  br i1 %.not59, label %.thread69, label %.thread67

.thread67:                                        ; preds = %27, %33
  %34 = phi i64 [ %.pr, %33 ], [ %28, %27 ]
  %35 = shl i64 %34, 1
  %36 = tail call ptr @AllocatePool(i64 noundef %35) #2
  %37 = icmp eq ptr %36, null
  br i1 %37, label %62, label %38

38:                                               ; preds = %.thread67
  %39 = getelementptr inbounds i8, ptr %10, i64 72
  %.04772 = load ptr, ptr %39, align 8, !tbaa !16
  %.not6073 = icmp eq ptr %.04772, %39
  br i1 %.not6073, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %38, %.lr.ph._crit_edge
  %.04775 = phi ptr [ %.047, %.lr.ph._crit_edge ], [ %.04772, %38 ]
  %.074 = phi ptr [ %58, %.lr.ph._crit_edge ], [ %36, %38 ]
  %40 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not62 = icmp eq i8 %40, 0
  %.pre81 = ptrtoint ptr %.04775 to i64
  %.pre83 = add i64 %.pre81, -8
  %.pre85 = inttoptr i64 %.pre83 to ptr
  br i1 %.not62, label %.lr.ph._crit_edge, label %41

41:                                               ; preds = %.lr.ph
  %42 = load i32, ptr %.pre85, align 8, !tbaa !17
  %.not63 = icmp eq i32 %42, 1399877197
  br i1 %.not63, label %.lr.ph._crit_edge, label %43

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

.lr.ph._crit_edge:                                ; preds = %.lr.ph, %41, %43
  %44 = phi ptr [ %.04775, %43 ], [ %.pre85, %41 ], [ %.pre85, %.lr.ph ]
  %45 = getelementptr inbounds i8, ptr %44, i64 92
  %46 = load i16, ptr %45, align 4, !tbaa !21
  %47 = load i16, ptr %.074, align 1
  %48 = and i16 %46, 4095
  %49 = and i16 %47, -4096
  %50 = or disjoint i16 %49, %48
  store i16 %50, ptr %.074, align 1
  %51 = getelementptr inbounds i8, ptr %44, i64 94
  %52 = load i8, ptr %51, align 2, !tbaa !22
  %53 = and i8 %52, 7
  %54 = zext nneg i8 %53 to i16
  %55 = shl nuw i16 %54, 13
  %56 = and i16 %50, 8191
  %57 = or disjoint i16 %55, %56
  store i16 %57, ptr %.074, align 1
  %58 = getelementptr inbounds i8, ptr %.074, i64 2
  %.047 = load ptr, ptr %.04775, align 8, !tbaa !16
  %.not60 = icmp eq ptr %.047, %39
  br i1 %.not60, label %._crit_edge, label %.lr.ph, !llvm.loop !23

.thread69:                                        ; preds = %33, %17
  %59 = tail call i64 @MnpSetVlanVariable(ptr noundef nonnull %10, i64 noundef 0, ptr noundef null)
  br label %62

._crit_edge:                                      ; preds = %.lr.ph._crit_edge, %38
  %60 = load i64, ptr %11, align 8, !tbaa !15
  %61 = tail call i64 @MnpSetVlanVariable(ptr noundef %10, i64 noundef %60, ptr noundef nonnull %36)
  tail call void @FreePool(ptr noundef nonnull %36) #2
  br label %62

62:                                               ; preds = %.thread69, %._crit_edge, %.thread67, %30, %23, %20, %14, %._crit_edge76, %2
  %.048 = phi i64 [ -9223372036854775806, %2 ], [ -9223372036854775794, %._crit_edge76 ], [ -9223372036854775794, %14 ], [ %21, %20 ], [ %24, %23 ], [ -9223372036854775799, %30 ], [ -9223372036854775799, %.thread67 ], [ %61, %._crit_edge ], [ %59, %.thread69 ]
  ret i64 %.048
}

declare void @FreePool(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
declare dso_local i64 @MnpSetVlanVariable(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

declare i64 @MnpDestroyServiceChild(ptr noundef) local_unnamed_addr #1

declare i64 @MnpDestroyServiceData(ptr noundef) local_unnamed_addr #1

declare ptr @MnpCreateServiceData(ptr noundef, i16 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #1

declare ptr @MnpFindServiceData(ptr noundef, i16 noundef zeroext) local_unnamed_addr #1

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


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