; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/NetworkPkg/Ip6Dxe (Ip6InstanceFrameAcceptable)

; 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.IP6_ICMP_ERROR_HEAD = type { %struct.IP6_ICMP_HEAD, i32, %struct._EFI_IP6_HEADER }
%struct.IP6_ICMP_HEAD = type { i8, i8, i16 }
%struct._EFI_IP6_HEADER = type { i16, i16, i16, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct._IP6_PROTOCOL = type { i32, %struct._EFI_IP6_PROTOCOL, ptr, i64, ptr, %struct._LIST_ENTRY, i8, %struct.NET_MAP, %struct.NET_MAP, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct.EFI_LOCK, ptr, %struct._LIST_ENTRY, ptr, i32, %struct.EFI_IP6_CONFIG_DATA, i8 }
%struct._EFI_IP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%struct.EFI_LOCK = type { i64, i64, i32 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_IP6_CONFIG_DATA = type { i8, i8, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS, i8, i8, i32, i32, i32 }
%struct.NET_BUF = type { i32, i64, %struct._LIST_ENTRY, %union.NET_IP_HEAD, ptr, ptr, [64 x i8], ptr, i32, i32, [1 x %struct.NET_BLOCK_OP] }
%union.NET_IP_HEAD = type { ptr }
%struct.NET_BLOCK_OP = type { ptr, ptr, ptr, ptr, i32 }
%struct.IP6_CLIP_INFO = type { i32, i32, i32, i32, i32, i32, i64, i32, i16, i8, i8, i32 }

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

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

declare i64 @CompareMem(ptr noundef, ptr noundef, i64 noundef) #1

declare ptr @NetbufGetByte(ptr noundef, i32 noundef, ptr noundef) #1

declare zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef) #1

declare i32 @NetbufCopy(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #1

declare zeroext i8 @Ip6IsExtsValid(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i8 noundef zeroext, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare zeroext i16 @SwapBytes16(i16 noundef zeroext) #1

; Function Attrs: nounwind uwtable
define dso_local zeroext i8 @Ip6InstanceFrameAcceptable(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca i8, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %struct.IP6_ICMP_ERROR_HEAD, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i16, align 2
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, 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
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %17, i32 0, i32 16
  store ptr %18, ptr %9, align 8, !tbaa !5
  store ptr null, ptr %11, align 8, !tbaa !5
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.EFI_IP6_CONFIG_DATA, ptr %19, i32 0, i32 9
  %21 = load i32, ptr %20, align 4, !tbaa !9
  %22 = icmp eq i32 %21, -1
  br i1 %22, label %23, label %24

23:                                               ; preds = %3
  store i8 0, ptr %4, align 1
  store i32 1, ptr %16, align 4
  br label %159

24:                                               ; preds = %3
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.EFI_IP6_CONFIG_DATA, ptr %25, i32 0, i32 3
  %27 = load i8, ptr %26, align 1, !tbaa !13
  %28 = icmp ne i8 %27, 0
  br i1 %28, label %29, label %30

29:                                               ; preds = %24
  store i8 1, ptr %4, align 1
  store i32 1, ptr %16, align 4
  br label %159

30:                                               ; preds = %24
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = call ptr @NetbufGetByte(ptr noundef %31, i32 noundef 0, ptr noundef null)
  store ptr %32, ptr %13, align 8, !tbaa !5
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %33, i32 0, i32 4
  %35 = load ptr, ptr %34, align 8, !tbaa !14
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %37, i32 0, i32 3
  %39 = load ptr, ptr %13, align 8, !tbaa !5
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %40, i32 0, i32 2
  %42 = load i16, ptr %41, align 1, !tbaa !21
  %43 = zext i16 %42 to i32
  %44 = call zeroext i8 @Ip6IsExtsValid(ptr noundef %35, ptr noundef %36, ptr noundef %38, ptr noundef %39, i32 noundef %43, i8 noundef zeroext 1, ptr noundef null, ptr noundef %11, ptr noundef null, ptr noundef null, ptr noundef null)
  %45 = icmp ne i8 %44, 0
  br i1 %45, label %47, label %46

46:                                               ; preds = %30
  store i8 0, ptr %4, align 1
  store i32 1, ptr %16, align 4
  br label %159

47:                                               ; preds = %30
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = load i8, ptr %48, align 1, !tbaa !24
  %50 = zext i8 %49 to i32
  %51 = icmp eq i32 %50, 58
  br i1 %51, label %52, label %97

52:                                               ; preds = %47
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.EFI_IP6_CONFIG_DATA, ptr %53, i32 0, i32 1
  %55 = load i8, ptr %54, align 1, !tbaa !25
  %56 = icmp ne i8 %55, 0
  br i1 %56, label %97, label %57

57:                                               ; preds = %52
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = load i8, ptr %58, align 1, !tbaa !24
  %60 = zext i8 %59 to i32
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.EFI_IP6_CONFIG_DATA, ptr %61, i32 0, i32 0
  %63 = load i8, ptr %62, align 4, !tbaa !26
  %64 = zext i8 %63 to i32
  %65 = icmp ne i32 %60, %64
  br i1 %65, label %66, label %97

66:                                               ; preds = %57
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = call i32 @NetbufCopy(ptr noundef %67, i32 noundef 0, i32 noundef 48, ptr noundef %8)
  %69 = getelementptr inbounds %struct.IP6_ICMP_ERROR_HEAD, ptr %8, i32 0, i32 0
  %70 = getelementptr inbounds %struct.IP6_ICMP_HEAD, ptr %69, i32 0, i32 0
  %71 = load i8, ptr %70, align 1, !tbaa !27
  %72 = zext i8 %71 to i32
  %73 = icmp sle i32 %72, 127
  br i1 %73, label %74, label %96

74:                                               ; preds = %66
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.EFI_IP6_CONFIG_DATA, ptr %75, i32 0, i32 2
  %77 = load i8, ptr %76, align 2, !tbaa !30
  %78 = icmp ne i8 %77, 0
  br i1 %78, label %80, label %79

79:                                               ; preds = %74
  store i8 0, ptr %4, align 1
  store i32 1, ptr %16, align 4
  br label %159

80:                                               ; preds = %74
  %81 = getelementptr inbounds %struct.IP6_ICMP_ERROR_HEAD, ptr %8, i32 0, i32 2
  %82 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %81, i32 0, i32 2
  %83 = load i16, ptr %82, align 1, !tbaa !31
  %84 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %83)
  store i16 %84, ptr %14, align 2, !tbaa !32
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = call ptr @NetbufGetByte(ptr noundef %85, i32 noundef 48, ptr noundef null)
  store ptr %86, ptr %15, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.IP6_ICMP_ERROR_HEAD, ptr %8, i32 0, i32 2
  %88 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %87, i32 0, i32 3
  %89 = load ptr, ptr %15, align 8, !tbaa !5
  %90 = load i16, ptr %14, align 2, !tbaa !32
  %91 = zext i16 %90 to i32
  %92 = call zeroext i8 @Ip6IsExtsValid(ptr noundef null, ptr noundef null, ptr noundef %88, ptr noundef %89, i32 noundef %91, i8 noundef zeroext 1, ptr noundef null, ptr noundef %11, ptr noundef null, ptr noundef null, ptr noundef null)
  %93 = icmp ne i8 %92, 0
  br i1 %93, label %95, label %94

94:                                               ; preds = %80
  store i8 0, ptr %4, align 1
  store i32 1, ptr %16, align 4
  br label %159

95:                                               ; preds = %80
  br label %96

96:                                               ; preds = %95, %66
  br label %97

97:                                               ; preds = %96, %57, %52, %47
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.EFI_IP6_CONFIG_DATA, ptr %98, i32 0, i32 1
  %100 = load i8, ptr %99, align 1, !tbaa !25
  %101 = icmp ne i8 %100, 0
  br i1 %101, label %112, label %102

102:                                              ; preds = %97
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = load i8, ptr %103, align 1, !tbaa !24
  %105 = zext i8 %104 to i32
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.EFI_IP6_CONFIG_DATA, ptr %106, i32 0, i32 0
  %108 = load i8, ptr %107, align 4, !tbaa !26
  %109 = zext i8 %108 to i32
  %110 = icmp ne i32 %105, %109
  br i1 %110, label %111, label %112

111:                                              ; preds = %102
  store i8 0, ptr %4, align 1
  store i32 1, ptr %16, align 4
  br label %159

112:                                              ; preds = %102, %97
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.NET_BUF, ptr %113, i32 0, i32 6
  %115 = getelementptr inbounds [64 x i8], ptr %114, i64 0, i64 0
  store ptr %115, ptr %10, align 8, !tbaa !5
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.IP6_CLIP_INFO, ptr %116, i32 0, i32 1
  %118 = load i32, ptr %117, align 4, !tbaa !33
  %119 = icmp eq i32 %118, 3
  br i1 %119, label %120, label %158

120:                                              ; preds = %112
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %121, i32 0, i32 16
  %123 = getelementptr inbounds %struct.EFI_IP6_CONFIG_DATA, ptr %122, i32 0, i32 5
  %124 = call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef %123)
  %125 = icmp ne i8 %124, 0
  br i1 %125, label %126, label %127

126:                                              ; preds = %120
  store i8 1, ptr %4, align 1
  store i32 1, ptr %16, align 4
  br label %159

127:                                              ; preds = %120
  store i32 0, ptr %12, align 4, !tbaa !35
  br label %128

128:                                              ; preds = %147, %127
  %129 = load i32, ptr %12, align 4, !tbaa !35
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %130, i32 0, i32 15
  %132 = load i32, ptr %131, align 8, !tbaa !36
  %133 = icmp ult i32 %129, %132
  br i1 %133, label %134, label %150

134:                                              ; preds = %128
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %135, i32 0, i32 14
  %137 = load ptr, ptr %136, align 8, !tbaa !37
  %138 = load i32, ptr %12, align 4, !tbaa !35
  %139 = zext i32 %138 to i64
  %140 = getelementptr inbounds %struct.EFI_IPv6_ADDRESS, ptr %137, i64 %139
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %141, i32 0, i32 6
  %143 = call i64 @CompareMem(ptr noundef %140, ptr noundef %142, i64 noundef 16)
  %144 = icmp eq i64 %143, 0
  br i1 %144, label %145, label %146

145:                                              ; preds = %134
  br label %150

146:                                              ; preds = %134
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %12, align 4, !tbaa !35
  %149 = add i32 %148, 1
  store i32 %149, ptr %12, align 4, !tbaa !35
  br label %128, !llvm.loop !38

150:                                              ; preds = %145, %128
  %151 = load i32, ptr %12, align 4, !tbaa !35
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %152, i32 0, i32 15
  %154 = load i32, ptr %153, align 8, !tbaa !36
  %155 = icmp ult i32 %151, %154
  %156 = zext i1 %155 to i32
  %157 = trunc i32 %156 to i8
  store i8 %157, ptr %4, align 1
  store i32 1, ptr %16, align 4
  br label %159

158:                                              ; preds = %112
  store i8 1, ptr %4, align 1
  store i32 1, ptr %16, align 4
  br label %159

159:                                              ; preds = %158, %150, %126, %111, %94, %79, %46, %29, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #3
  %160 = load i8, ptr %4, align 1
  ret i8 %160
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !12, i64 44}
!10 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !11, i64 4, !11, i64 20, !7, i64 36, !7, i64 37, !12, i64 40, !12, i64 44, !12, i64 48}
!11 = !{!"", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !7, i64 3}
!14 = !{!15, !6, i64 96}
!15 = !{!"_IP6_PROTOCOL", !12, i64 0, !16, i64 8, !6, i64 80, !17, i64 88, !6, i64 96, !18, i64 104, !7, i64 120, !19, i64 128, !19, i64 168, !18, i64 208, !18, i64 224, !20, i64 240, !6, i64 264, !18, i64 272, !6, i64 288, !12, i64 296, !10, i64 300, !7, i64 352}
!16 = !{!"_EFI_IP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!17 = !{!"long long", !7, i64 0}
!18 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!19 = !{!"", !18, i64 0, !18, i64 16, !17, i64 32}
!20 = !{!"", !17, i64 0, !17, i64 8, !12, i64 16}
!21 = !{!22, !23, i64 4}
!22 = !{!"_EFI_IP6_HEADER", !7, i64 0, !7, i64 0, !7, i64 1, !7, i64 1, !23, i64 2, !23, i64 4, !7, i64 6, !7, i64 7, !11, i64 8, !11, i64 24}
!23 = !{!"short", !7, i64 0}
!24 = !{!7, !7, i64 0}
!25 = !{!10, !7, i64 1}
!26 = !{!10, !7, i64 0}
!27 = !{!28, !7, i64 0}
!28 = !{!"", !29, i64 0, !12, i64 4, !22, i64 8}
!29 = !{!"", !7, i64 0, !7, i64 1, !23, i64 2}
!30 = !{!10, !7, i64 2}
!31 = !{!28, !23, i64 12}
!32 = !{!23, !23, i64 0}
!33 = !{!34, !12, i64 4}
!34 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !17, i64 24, !12, i64 32, !23, i64 36, !7, i64 38, !7, i64 39, !12, i64 40}
!35 = !{!12, !12, i64 0}
!36 = !{!15, !12, i64 296}
!37 = !{!15, !6, i64 288}
!38 = distinct !{!38, !39}
!39 = !{!"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"

%struct.IP6_ICMP_ERROR_HEAD = type { %struct.IP6_ICMP_HEAD, i32, %struct._EFI_IP6_HEADER }
%struct.IP6_ICMP_HEAD = type { i8, i8, i16 }
%struct._EFI_IP6_HEADER = type { i16, i16, i16, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }

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

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

declare i64 @CompareMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare ptr @NetbufGetByte(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef) local_unnamed_addr #1

declare i32 @NetbufCopy(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare zeroext i8 @Ip6IsExtsValid(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i8 noundef zeroext, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare zeroext i16 @SwapBytes16(i16 noundef zeroext) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local zeroext range(i8 0, 2) i8 @Ip6InstanceFrameAcceptable(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = alloca %struct.IP6_ICMP_ERROR_HEAD, align 1
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %6 = getelementptr inbounds i8, ptr %0, i64 300
  store ptr null, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 344
  %8 = load i32, ptr %7, align 4, !tbaa !9
  %9 = icmp eq i32 %8, -1
  br i1 %9, label %75, label %10

10:                                               ; preds = %3
  %11 = getelementptr inbounds i8, ptr %0, i64 303
  %12 = load i8, ptr %11, align 1, !tbaa !13
  %.not = icmp eq i8 %12, 0
  br i1 %.not, label %13, label %75

13:                                               ; preds = %10
  %14 = tail call ptr @NetbufGetByte(ptr noundef %2, i32 noundef 0, ptr noundef null) #3
  %15 = getelementptr inbounds i8, ptr %0, i64 96
  %16 = load ptr, ptr %15, align 8, !tbaa !14
  %17 = getelementptr inbounds i8, ptr %1, i64 6
  %18 = getelementptr inbounds i8, ptr %1, i64 4
  %19 = load i16, ptr %18, align 1, !tbaa !21
  %20 = zext i16 %19 to i32
  %21 = call zeroext i8 @Ip6IsExtsValid(ptr noundef %16, ptr noundef %2, ptr noundef nonnull %17, ptr noundef %14, i32 noundef %20, i8 noundef zeroext 1, ptr noundef null, ptr noundef nonnull %5, ptr noundef null, ptr noundef null, ptr noundef null) #3
  %.not31 = icmp eq i8 %21, 0
  br i1 %.not31, label %75, label %22

22:                                               ; preds = %13
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = load i8, ptr %23, align 1, !tbaa !24
  %25 = icmp eq i8 %24, 58
  br i1 %25, label %26, label %46

26:                                               ; preds = %22
  %27 = getelementptr inbounds i8, ptr %0, i64 301
  %28 = load i8, ptr %27, align 1, !tbaa !25
  %.not32 = icmp eq i8 %28, 0
  br i1 %.not32, label %29, label %46

29:                                               ; preds = %26
  %30 = load i8, ptr %6, align 4, !tbaa !26
  %.not33 = icmp eq i8 %30, 58
  br i1 %.not33, label %46, label %31

31:                                               ; preds = %29
  %32 = call i32 @NetbufCopy(ptr noundef %2, i32 noundef 0, i32 noundef 48, ptr noundef nonnull %4) #3
  %33 = load i8, ptr %4, align 1, !tbaa !27
  %34 = icmp sgt i8 %33, -1
  br i1 %34, label %35, label %46

35:                                               ; preds = %31
  %36 = getelementptr inbounds i8, ptr %0, i64 302
  %37 = load i8, ptr %36, align 2, !tbaa !30
  %.not34 = icmp eq i8 %37, 0
  br i1 %.not34, label %75, label %38

38:                                               ; preds = %35
  %39 = getelementptr inbounds i8, ptr %4, i64 12
  %40 = load i16, ptr %39, align 1, !tbaa !31
  %41 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %40) #3
  %42 = call ptr @NetbufGetByte(ptr noundef %2, i32 noundef 48, ptr noundef null) #3
  %43 = getelementptr inbounds i8, ptr %4, i64 14
  %44 = zext i16 %41 to i32
  %45 = call zeroext i8 @Ip6IsExtsValid(ptr noundef null, ptr noundef null, ptr noundef nonnull %43, ptr noundef %42, i32 noundef %44, i8 noundef zeroext 1, ptr noundef null, ptr noundef nonnull %5, ptr noundef null, ptr noundef null, ptr noundef null) #3
  %.not35 = icmp eq i8 %45, 0
  br i1 %.not35, label %75, label %46

46:                                               ; preds = %31, %38, %29, %26, %22
  %47 = getelementptr inbounds i8, ptr %0, i64 301
  %48 = load i8, ptr %47, align 1, !tbaa !25
  %.not36 = icmp eq i8 %48, 0
  br i1 %.not36, label %49, label %53

49:                                               ; preds = %46
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = load i8, ptr %50, align 1, !tbaa !24
  %52 = load i8, ptr %6, align 4, !tbaa !26
  %.not37 = icmp eq i8 %51, %52
  br i1 %.not37, label %53, label %75

53:                                               ; preds = %49, %46
  %54 = getelementptr inbounds i8, ptr %2, i64 60
  %55 = load i32, ptr %54, align 4, !tbaa !32
  %56 = icmp eq i32 %55, 3
  br i1 %56, label %57, label %75

57:                                               ; preds = %53
  %58 = getelementptr inbounds i8, ptr %0, i64 320
  %59 = call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef nonnull %58) #3
  %.not38 = icmp eq i8 %59, 0
  br i1 %.not38, label %.preheader, label %75

.preheader:                                       ; preds = %57
  %60 = getelementptr inbounds i8, ptr %0, i64 288
  %61 = getelementptr inbounds i8, ptr %0, i64 296
  %62 = load i32, ptr %61, align 8, !tbaa !34
  %.not42 = icmp eq i32 %62, 0
  br i1 %.not42, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %63 = getelementptr inbounds i8, ptr %1, i64 24
  br label %64

64:                                               ; preds = %.lr.ph, %69
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %69 ]
  %65 = load ptr, ptr %60, align 8, !tbaa !35
  %66 = getelementptr inbounds %struct.EFI_IPv6_ADDRESS, ptr %65, i64 %indvars.iv
  %67 = call i64 @CompareMem(ptr noundef %66, ptr noundef nonnull %63, i64 noundef 16) #3
  %68 = icmp eq i64 %67, 0
  %.pre.pre = load i32, ptr %61, align 8, !tbaa !34
  br i1 %68, label %._crit_edge.loopexit, label %69

69:                                               ; preds = %64
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %70 = zext i32 %.pre.pre to i64
  %71 = icmp ult i64 %indvars.iv.next, %70
  br i1 %71, label %64, label %._crit_edge.loopexit, !llvm.loop !36

._crit_edge.loopexit:                             ; preds = %64, %69
  %.029.lcssa.ph.in = phi i64 [ %indvars.iv.next, %69 ], [ %indvars.iv, %64 ]
  %.029.lcssa.ph = trunc i64 %.029.lcssa.ph.in to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %72 = phi i32 [ 0, %.preheader ], [ %.pre.pre, %._crit_edge.loopexit ]
  %.029.lcssa = phi i32 [ 0, %.preheader ], [ %.029.lcssa.ph, %._crit_edge.loopexit ]
  %73 = icmp ult i32 %.029.lcssa, %72
  %74 = zext i1 %73 to i8
  br label %75

75:                                               ; preds = %53, %57, %49, %38, %35, %13, %10, %3, %._crit_edge
  %.0 = phi i8 [ %74, %._crit_edge ], [ 0, %3 ], [ 1, %10 ], [ 0, %13 ], [ 0, %35 ], [ 0, %38 ], [ 0, %49 ], [ 1, %57 ], [ 1, %53 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #3
  ret i8 %.0
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !12, i64 44}
!10 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !11, i64 4, !11, i64 20, !7, i64 36, !7, i64 37, !12, i64 40, !12, i64 44, !12, i64 48}
!11 = !{!"", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !7, i64 3}
!14 = !{!15, !6, i64 96}
!15 = !{!"_IP6_PROTOCOL", !12, i64 0, !16, i64 8, !6, i64 80, !17, i64 88, !6, i64 96, !18, i64 104, !7, i64 120, !19, i64 128, !19, i64 168, !18, i64 208, !18, i64 224, !20, i64 240, !6, i64 264, !18, i64 272, !6, i64 288, !12, i64 296, !10, i64 300, !7, i64 352}
!16 = !{!"_EFI_IP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!17 = !{!"long long", !7, i64 0}
!18 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!19 = !{!"", !18, i64 0, !18, i64 16, !17, i64 32}
!20 = !{!"", !17, i64 0, !17, i64 8, !12, i64 16}
!21 = !{!22, !23, i64 4}
!22 = !{!"_EFI_IP6_HEADER", !7, i64 0, !7, i64 0, !7, i64 1, !7, i64 1, !23, i64 2, !23, i64 4, !7, i64 6, !7, i64 7, !11, i64 8, !11, i64 24}
!23 = !{!"short", !7, i64 0}
!24 = !{!7, !7, i64 0}
!25 = !{!10, !7, i64 1}
!26 = !{!10, !7, i64 0}
!27 = !{!28, !7, i64 0}
!28 = !{!"", !29, i64 0, !12, i64 4, !22, i64 8}
!29 = !{!"", !7, i64 0, !7, i64 1, !23, i64 2}
!30 = !{!10, !7, i64 2}
!31 = !{!28, !23, i64 12}
!32 = !{!33, !12, i64 4}
!33 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !17, i64 24, !12, i64 32, !23, i64 36, !7, i64 38, !7, i64 39, !12, i64 40}
!34 = !{!15, !12, i64 296}
!35 = !{!15, !6, i64 288}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}


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