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

; 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._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.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] }
%struct._LIST_ENTRY = type { ptr, ptr }
%union.NET_IP_HEAD = type { ptr }
%struct.NET_BLOCK_OP = type { ptr, ptr, ptr, ptr, i32 }
%struct._IP6_SERVICE = type { i32, %struct._EFI_SERVICE_BINDING_PROTOCOL, i64, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, ptr, %struct.IP6_LINK_RX_TOKEN, %struct.IP6_ASSEMBLE_TABLE, %struct.IP6_MLD_SERVICE_DATA, %struct.EFI_IPv6_ADDRESS, i8, i8, i8, i8, i8, i32, i32, i32, i32, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i32, i8, ptr, i8, i8, i32, ptr, ptr, ptr, ptr, %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, %struct.EFI_SIMPLE_NETWORK_MODE, ptr, ptr, %struct._IP6_CONFIG_INSTANCE, ptr, i32, i32 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct.IP6_LINK_RX_TOKEN = type { i32, ptr, ptr, %struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN }
%struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN = type { ptr, i64, %union.anon }
%union.anon = type { ptr }
%struct.IP6_ASSEMBLE_TABLE = type { [127 x %struct._LIST_ENTRY] }
%struct.IP6_MLD_SERVICE_DATA = type { i64, %struct._LIST_ENTRY }
%struct.EFI_MANAGED_NETWORK_CONFIG_DATA = type { i32, i32, i16, i8, i8, i8, i8, i8, i8, i8 }
%struct.EFI_SIMPLE_NETWORK_MODE = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [16 x %struct.EFI_MAC_ADDRESS], %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i8, i8, i8, i8, i8 }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct._IP6_CONFIG_INSTANCE = type { i32, i8, %struct._LIST_ENTRY, i16, %struct.EFI_IP6_CONFIG_INTERFACE_INFO, %struct.EFI_IP6_CONFIG_INTERFACE_ID, i32, %struct.EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS, [7 x %struct.IP6_CONFIG_DATA_ITEM], %struct.NET_MAP, %struct.NET_MAP, %struct._EFI_IP6_CONFIG_PROTOCOL, ptr, ptr, ptr, ptr, i8, i32, ptr, i32, ptr, i32, %struct._IP6_FORM_CALLBACK_INFO, %struct.IP6_CONFIG_NVDATA }
%struct.EFI_IP6_CONFIG_INTERFACE_INFO = type { [32 x i16], i8, i32, %struct.EFI_MAC_ADDRESS, i32, ptr, i32, ptr }
%struct.EFI_IP6_CONFIG_INTERFACE_ID = type { [8 x i8] }
%struct.EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS = type { i32 }
%struct.IP6_CONFIG_DATA_ITEM = type { ptr, ptr, i64, i8, %struct.NET_MAP, %union.IP6_CONFIG_DATA, i64 }
%union.IP6_CONFIG_DATA = type { ptr }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%struct._EFI_IP6_CONFIG_PROTOCOL = type { ptr, ptr, ptr, ptr }
%struct._IP6_FORM_CALLBACK_INFO = type { i32, ptr, %struct._EFI_HII_CONFIG_ACCESS_PROTOCOL, ptr, ptr }
%struct._EFI_HII_CONFIG_ACCESS_PROTOCOL = type { ptr, ptr, ptr }
%struct.IP6_CONFIG_NVDATA = type { i32, %struct.EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS, %struct.EFI_IP6_CONFIG_INTERFACE_ID, %struct._LIST_ENTRY, i32, %struct._LIST_ENTRY, i32, %struct._LIST_ENTRY, i32 }
%struct.IP6_ICMP_INFORMATION_HEAD = type { %struct.IP6_ICMP_HEAD, i32 }
%struct.IP6_ICMP_HEAD = type { i8, i8, i16 }

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

declare void @NetbufFree(ptr noundef) #1

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

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

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

declare i64 @Ip6Output(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #1

declare void @Ip6SysPacketSent(ptr noundef, i64 noundef, i32 noundef, ptr noundef) #1

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

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

declare i32 @SwapBytes32(i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @Ip6IsAnycast(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip6SendIcmpError(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i8 noundef zeroext %4, i8 noundef zeroext %5, ptr noundef %6) #2 {
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i8, align 1
  %14 = alloca i8, align 1
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i16, align 2
  %19 = alloca %struct._EFI_IP6_HEADER, align 1
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store i8 %4, ptr %13, align 1, !tbaa !9
  store i8 %5, ptr %14, align 1, !tbaa !9
  store ptr %6, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 40, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %23 = load ptr, ptr %12, align 8, !tbaa !5
  %24 = icmp eq ptr %23, null
  br i1 %24, label %25, label %26

25:                                               ; preds = %7
  store i64 -9223372036854775806, ptr %8, align 8
  store i32 1, ptr %22, align 4
  br label %155

26:                                               ; preds = %7
  %27 = load ptr, ptr %12, align 8, !tbaa !5
  %28 = call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef %27)
  %29 = zext i8 %28 to i32
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %44, label %31

31:                                               ; preds = %26
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.EFI_IPv6_ADDRESS, ptr %32, i32 0, i32 0
  %34 = getelementptr inbounds [16 x i8], ptr %33, i64 0, i64 0
  %35 = load i8, ptr %34, align 1, !tbaa !9
  %36 = zext i8 %35 to i32
  %37 = icmp eq i32 %36, 255
  br i1 %37, label %44, label %38

38:                                               ; preds = %31
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = call zeroext i8 @Ip6IsAnycast(ptr noundef %39, ptr noundef %40)
  %42 = zext i8 %41 to i32
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %45

44:                                               ; preds = %38, %31, %26
  store i64 -9223372036854775806, ptr %8, align 8
  store i32 1, ptr %22, align 4
  br label %155

45:                                               ; preds = %38
  %46 = load i8, ptr %13, align 1, !tbaa !9
  %47 = zext i8 %46 to i32
  switch i32 %47, label %54 [
    i32 1, label %48
    i32 3, label %48
    i32 4, label %49
  ]

48:                                               ; preds = %45, %45
  br label %55

49:                                               ; preds = %45
  %50 = load ptr, ptr %15, align 8, !tbaa !5
  %51 = icmp eq ptr %50, null
  br i1 %51, label %52, label %53

52:                                               ; preds = %49
  store i64 -9223372036854775806, ptr %8, align 8
  store i32 1, ptr %22, align 4
  br label %155

53:                                               ; preds = %49
  br label %55

54:                                               ; preds = %45
  store i64 -9223372036854775806, ptr %8, align 8
  store i32 1, ptr %22, align 4
  br label %155

55:                                               ; preds = %53, %48
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.NET_BUF, ptr %56, i32 0, i32 9
  %58 = load i32, ptr %57, align 4, !tbaa !10
  %59 = zext i32 %58 to i64
  %60 = add i64 48, %59
  %61 = trunc i64 %60 to i32
  store i32 %61, ptr %16, align 4, !tbaa !15
  %62 = load i32, ptr %16, align 4, !tbaa !15
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._IP6_SERVICE, ptr %63, i32 0, i32 41
  %65 = load i32, ptr %64, align 8, !tbaa !16
  %66 = icmp ugt i32 %62, %65
  br i1 %66, label %67, label %71

67:                                               ; preds = %55
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._IP6_SERVICE, ptr %68, i32 0, i32 41
  %70 = load i32, ptr %69, align 8, !tbaa !16
  store i32 %70, ptr %16, align 4, !tbaa !15
  br label %71

71:                                               ; preds = %67, %55
  %72 = load i32, ptr %16, align 4, !tbaa !15
  %73 = call ptr @NetbufAlloc(i32 noundef %72)
  store ptr %73, ptr %17, align 8, !tbaa !5
  %74 = load ptr, ptr %17, align 8, !tbaa !5
  %75 = icmp eq ptr %74, null
  br i1 %75, label %76, label %77

76:                                               ; preds = %71
  store i64 -9223372036854775799, ptr %8, align 8
  store i32 1, ptr %22, align 4
  br label %155

77:                                               ; preds = %71
  %78 = load i32, ptr %16, align 4, !tbaa !15
  %79 = zext i32 %78 to i64
  %80 = sub i64 %79, 40
  %81 = trunc i64 %80 to i16
  store i16 %81, ptr %18, align 2, !tbaa !34
  %82 = call ptr @ZeroMem(ptr noundef %19, i64 noundef 40)
  %83 = load i16, ptr %18, align 2, !tbaa !34
  %84 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %83)
  %85 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %19, i32 0, i32 2
  store i16 %84, ptr %85, align 1, !tbaa !35
  %86 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %19, i32 0, i32 3
  store i8 58, ptr %86, align 1, !tbaa !37
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._IP6_SERVICE, ptr %87, i32 0, i32 16
  %89 = load i8, ptr %88, align 4, !tbaa !38
  %90 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %19, i32 0, i32 4
  store i8 %89, ptr %90, align 1, !tbaa !39
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = icmp ne ptr %91, null
  br i1 %92, label %93, label %97

93:                                               ; preds = %77
  %94 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %19, i32 0, i32 5
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = call ptr @CopyMem(ptr noundef %94, ptr noundef %95, i64 noundef 16)
  br label %100

97:                                               ; preds = %77
  %98 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %19, i32 0, i32 5
  %99 = call ptr @ZeroMem(ptr noundef %98, i64 noundef 16)
  br label %100

100:                                              ; preds = %97, %93
  %101 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %19, i32 0, i32 6
  %102 = load ptr, ptr %12, align 8, !tbaa !5
  %103 = call ptr @CopyMem(ptr noundef %101, ptr noundef %102, i64 noundef 16)
  %104 = load ptr, ptr %17, align 8, !tbaa !5
  call void @NetbufReserve(ptr noundef %104, i32 noundef 40)
  %105 = load ptr, ptr %17, align 8, !tbaa !5
  %106 = call ptr @NetbufAllocSpace(ptr noundef %105, i32 noundef 8, i8 noundef zeroext 0)
  store ptr %106, ptr %20, align 8, !tbaa !5
  %107 = load ptr, ptr %20, align 8, !tbaa !5
  %108 = icmp eq ptr %107, null
  br i1 %108, label %109, label %111

109:                                              ; preds = %100
  %110 = load ptr, ptr %17, align 8, !tbaa !5
  call void @NetbufFree(ptr noundef %110)
  store i64 -9223372036854775799, ptr %8, align 8
  store i32 1, ptr %22, align 4
  br label %155

111:                                              ; preds = %100
  %112 = load ptr, ptr %20, align 8, !tbaa !5
  %113 = call ptr @ZeroMem(ptr noundef %112, i64 noundef 8)
  %114 = load i8, ptr %13, align 1, !tbaa !9
  %115 = load ptr, ptr %20, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %115, i32 0, i32 0
  %117 = getelementptr inbounds %struct.IP6_ICMP_HEAD, ptr %116, i32 0, i32 0
  store i8 %114, ptr %117, align 1, !tbaa !40
  %118 = load i8, ptr %14, align 1, !tbaa !9
  %119 = load ptr, ptr %20, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %119, i32 0, i32 0
  %121 = getelementptr inbounds %struct.IP6_ICMP_HEAD, ptr %120, i32 0, i32 1
  store i8 %118, ptr %121, align 1, !tbaa !43
  %122 = load ptr, ptr %15, align 8, !tbaa !5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %124, label %130

124:                                              ; preds = %111
  %125 = load ptr, ptr %15, align 8, !tbaa !5
  %126 = load i32, ptr %125, align 4, !tbaa !15
  %127 = call i32 @SwapBytes32(i32 noundef %126)
  %128 = load ptr, ptr %20, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %128, i32 0, i32 1
  store i32 %127, ptr %129, align 1, !tbaa !44
  br label %130

130:                                              ; preds = %124, %111
  %131 = load i16, ptr %18, align 2, !tbaa !34
  %132 = zext i16 %131 to i64
  %133 = sub i64 %132, 8
  %134 = trunc i64 %133 to i16
  store i16 %134, ptr %18, align 2, !tbaa !34
  %135 = load ptr, ptr %17, align 8, !tbaa !5
  %136 = load i16, ptr %18, align 2, !tbaa !34
  %137 = zext i16 %136 to i32
  %138 = call ptr @NetbufAllocSpace(ptr noundef %135, i32 noundef %137, i8 noundef zeroext 0)
  store ptr %138, ptr %21, align 8, !tbaa !5
  %139 = load ptr, ptr %21, align 8, !tbaa !5
  %140 = icmp ne ptr %139, null
  br i1 %140, label %141, label %151

141:                                              ; preds = %130
  %142 = load ptr, ptr %21, align 8, !tbaa !5
  %143 = load i16, ptr %18, align 2, !tbaa !34
  %144 = zext i16 %143 to i64
  %145 = call ptr @ZeroMem(ptr noundef %142, i64 noundef %144)
  %146 = load ptr, ptr %10, align 8, !tbaa !5
  %147 = load i16, ptr %18, align 2, !tbaa !34
  %148 = zext i16 %147 to i32
  %149 = load ptr, ptr %21, align 8, !tbaa !5
  %150 = call i32 @NetbufCopy(ptr noundef %146, i32 noundef 0, i32 noundef %148, ptr noundef %149)
  br label %151

151:                                              ; preds = %141, %130
  %152 = load ptr, ptr %9, align 8, !tbaa !5
  %153 = load ptr, ptr %17, align 8, !tbaa !5
  %154 = call i64 @Ip6Output(ptr noundef %152, ptr noundef null, ptr noundef null, ptr noundef %153, ptr noundef %19, ptr noundef null, i32 noundef 0, ptr noundef @Ip6SysPacketSent, ptr noundef null)
  store i64 %154, ptr %8, align 8
  store i32 1, ptr %22, align 4
  br label %155

155:                                              ; preds = %151, %109, %76, %54, %52, %44, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  %156 = load i64, ptr %8, align 8
  ret i64 %156
}

declare zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef) #1

declare ptr @NetbufAlloc(i32 noundef) #1

declare void @NetbufReserve(ptr noundef, i32 noundef) #1

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

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 = !{!7, !7, i64 0}
!10 = !{!11, !12, i64 132}
!11 = !{!"", !12, i64 0, !13, i64 8, !14, i64 16, !7, i64 32, !6, i64 40, !6, i64 48, !7, i64 56, !6, i64 120, !12, i64 128, !12, i64 132, !7, i64 136}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!15 = !{!12, !12, i64 0}
!16 = !{!17, !12, i64 4184}
!17 = !{!"_IP6_SERVICE", !12, i64 0, !18, i64 8, !13, i64 24, !13, i64 32, !14, i64 40, !14, i64 56, !6, i64 72, !6, i64 80, !19, i64 88, !21, i64 136, !22, i64 2168, !21, i64 2192, !7, i64 2208, !7, i64 2209, !7, i64 2210, !7, i64 2211, !7, i64 2212, !12, i64 2216, !12, i64 2220, !12, i64 2224, !12, i64 2228, !14, i64 2232, !14, i64 2248, !14, i64 2264, !14, i64 2280, !12, i64 2296, !7, i64 2300, !6, i64 2304, !7, i64 2312, !7, i64 2313, !12, i64 2316, !6, i64 2320, !6, i64 2328, !6, i64 2336, !6, i64 2344, !23, i64 2352, !25, i64 2372, !6, i64 3032, !6, i64 3040, !26, i64 3048, !6, i64 4176, !12, i64 4184, !12, i64 4188}
!18 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!19 = !{!"", !12, i64 0, !6, i64 8, !6, i64 16, !20, i64 24}
!20 = !{!"", !6, i64 0, !13, i64 8, !7, i64 16}
!21 = !{!"", !7, i64 0}
!22 = !{!"", !13, i64 0, !14, i64 8}
!23 = !{!"", !12, i64 0, !12, i64 4, !24, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!24 = !{!"short", !7, i64 0}
!25 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !7, i64 40, !21, i64 552, !21, i64 584, !21, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!26 = !{!"_IP6_CONFIG_INSTANCE", !12, i64 0, !7, i64 4, !14, i64 8, !24, i64 24, !27, i64 32, !21, i64 168, !12, i64 176, !28, i64 180, !7, i64 184, !29, i64 800, !29, i64 840, !30, i64 880, !6, i64 912, !6, i64 920, !6, i64 928, !6, i64 936, !7, i64 944, !12, i64 948, !6, i64 952, !12, i64 960, !6, i64 968, !12, i64 976, !31, i64 984, !33, i64 1040}
!27 = !{!"", !7, i64 0, !7, i64 64, !12, i64 68, !21, i64 72, !12, i64 104, !6, i64 112, !12, i64 120, !6, i64 128}
!28 = !{!"", !12, i64 0}
!29 = !{!"", !14, i64 0, !14, i64 16, !13, i64 32}
!30 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!31 = !{!"_IP6_FORM_CALLBACK_INFO", !12, i64 0, !6, i64 8, !32, i64 16, !6, i64 40, !6, i64 48}
!32 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!"", !12, i64 0, !28, i64 4, !21, i64 8, !14, i64 16, !12, i64 32, !14, i64 40, !12, i64 56, !14, i64 64, !12, i64 80}
!34 = !{!24, !24, i64 0}
!35 = !{!36, !24, i64 4}
!36 = !{!"_EFI_IP6_HEADER", !7, i64 0, !7, i64 0, !7, i64 1, !7, i64 1, !24, i64 2, !24, i64 4, !7, i64 6, !7, i64 7, !21, i64 8, !21, i64 24}
!37 = !{!36, !7, i64 6}
!38 = !{!17, !7, i64 2212}
!39 = !{!36, !7, i64 7}
!40 = !{!41, !7, i64 0}
!41 = !{!"", !42, i64 0, !12, i64 4}
!42 = !{!"", !7, i64 0, !7, i64 1, !24, i64 2}
!43 = !{!41, !7, i64 1}
!44 = !{!41, !12, i64 4}


; 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._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

declare void @NetbufFree(ptr noundef) local_unnamed_addr #1

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

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

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

declare i64 @Ip6Output(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @Ip6SysPacketSent(ptr noundef, i64 noundef, i32 noundef, ptr noundef) #1

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

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

declare i32 @SwapBytes32(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @Ip6IsAnycast(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip6SendIcmpError(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i8 noundef zeroext %4, i8 noundef zeroext %5, ptr noundef readonly %6) local_unnamed_addr #2 {
  %8 = alloca %struct._EFI_IP6_HEADER, align 1
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #4
  %9 = icmp eq ptr %3, null
  br i1 %9, label %66, label %10

10:                                               ; preds = %7
  %11 = tail call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef nonnull %3) #4
  %.not = icmp eq i8 %11, 0
  br i1 %.not, label %12, label %66

12:                                               ; preds = %10
  %13 = load i8, ptr %3, align 1, !tbaa !5
  %14 = icmp eq i8 %13, -1
  br i1 %14, label %66, label %15

15:                                               ; preds = %12
  %16 = tail call zeroext i8 @Ip6IsAnycast(ptr noundef %0, ptr noundef nonnull %3)
  %.not51 = icmp eq i8 %16, 0
  br i1 %.not51, label %17, label %66

17:                                               ; preds = %15
  switch i8 %4, label %66 [
    i8 1, label %20
    i8 3, label %20
    i8 4, label %18
  ]

18:                                               ; preds = %17
  %19 = icmp eq ptr %6, null
  br i1 %19, label %66, label %20

20:                                               ; preds = %18, %17, %17
  %21 = getelementptr inbounds i8, ptr %1, i64 132
  %22 = load i32, ptr %21, align 4, !tbaa !8
  %23 = add i32 %22, 48
  %24 = getelementptr inbounds i8, ptr %0, i64 4184
  %25 = load i32, ptr %24, align 8, !tbaa !14
  %spec.select = tail call i32 @llvm.umin.i32(i32 %23, i32 %25)
  %26 = tail call ptr @NetbufAlloc(i32 noundef %spec.select) #4
  %27 = icmp eq ptr %26, null
  br i1 %27, label %66, label %28

28:                                               ; preds = %20
  %29 = trunc i32 %spec.select to i16
  %30 = add i16 %29, -40
  %31 = call ptr @ZeroMem(ptr noundef nonnull %8, i64 noundef 40) #4
  %32 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %30) #4
  %33 = getelementptr inbounds i8, ptr %8, i64 4
  store i16 %32, ptr %33, align 1, !tbaa !32
  %34 = getelementptr inbounds i8, ptr %8, i64 6
  store i8 58, ptr %34, align 1, !tbaa !34
  %35 = getelementptr inbounds i8, ptr %0, i64 2212
  %36 = load i8, ptr %35, align 4, !tbaa !35
  %37 = getelementptr inbounds i8, ptr %8, i64 7
  store i8 %36, ptr %37, align 1, !tbaa !36
  %.not52 = icmp eq ptr %2, null
  %38 = getelementptr inbounds i8, ptr %8, i64 8
  br i1 %.not52, label %41, label %39

39:                                               ; preds = %28
  %40 = call ptr @CopyMem(ptr noundef nonnull %38, ptr noundef nonnull %2, i64 noundef 16) #4
  br label %43

41:                                               ; preds = %28
  %42 = call ptr @ZeroMem(ptr noundef nonnull %38, i64 noundef 16) #4
  br label %43

43:                                               ; preds = %41, %39
  %44 = getelementptr inbounds i8, ptr %8, i64 24
  %45 = call ptr @CopyMem(ptr noundef nonnull %44, ptr noundef nonnull %3, i64 noundef 16) #4
  call void @NetbufReserve(ptr noundef nonnull %26, i32 noundef 40) #4
  %46 = call ptr @NetbufAllocSpace(ptr noundef nonnull %26, i32 noundef 8, i8 noundef zeroext 0) #4
  %47 = icmp eq ptr %46, null
  br i1 %47, label %48, label %49

48:                                               ; preds = %43
  call void @NetbufFree(ptr noundef nonnull %26) #4
  br label %66

49:                                               ; preds = %43
  %50 = call ptr @ZeroMem(ptr noundef nonnull %46, i64 noundef 8) #4
  store i8 %4, ptr %46, align 1, !tbaa !37
  %51 = getelementptr inbounds i8, ptr %46, i64 1
  store i8 %5, ptr %51, align 1, !tbaa !40
  %.not53 = icmp eq ptr %6, null
  br i1 %.not53, label %56, label %52

52:                                               ; preds = %49
  %53 = load i32, ptr %6, align 4, !tbaa !41
  %54 = call i32 @SwapBytes32(i32 noundef %53) #4
  %55 = getelementptr inbounds i8, ptr %46, i64 4
  store i32 %54, ptr %55, align 1, !tbaa !42
  br label %56

56:                                               ; preds = %52, %49
  %57 = add i16 %29, -48
  %58 = zext i16 %57 to i32
  %59 = call ptr @NetbufAllocSpace(ptr noundef nonnull %26, i32 noundef %58, i8 noundef zeroext 0) #4
  %.not54 = icmp eq ptr %59, null
  br i1 %.not54, label %64, label %60

60:                                               ; preds = %56
  %61 = zext i16 %57 to i64
  %62 = call ptr @ZeroMem(ptr noundef nonnull %59, i64 noundef %61) #4
  %63 = call i32 @NetbufCopy(ptr noundef nonnull %1, i32 noundef 0, i32 noundef %58, ptr noundef nonnull %59) #4
  br label %64

64:                                               ; preds = %60, %56
  %65 = call i64 @Ip6Output(ptr noundef nonnull %0, ptr noundef null, ptr noundef null, ptr noundef nonnull %26, ptr noundef nonnull %8, ptr noundef null, i32 noundef 0, ptr noundef nonnull @Ip6SysPacketSent, ptr noundef null) #4
  br label %66

66:                                               ; preds = %20, %17, %18, %10, %12, %15, %7, %64, %48
  %.0 = phi i64 [ -9223372036854775799, %48 ], [ %65, %64 ], [ -9223372036854775806, %7 ], [ -9223372036854775806, %15 ], [ -9223372036854775806, %12 ], [ -9223372036854775806, %10 ], [ -9223372036854775806, %18 ], [ -9223372036854775806, %17 ], [ -9223372036854775799, %20 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #4
  ret i64 %.0
}

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

declare ptr @NetbufAlloc(i32 noundef) local_unnamed_addr #1

declare void @NetbufReserve(ptr noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #3

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !10, i64 132}
!9 = !{!"", !10, i64 0, !11, i64 8, !12, i64 16, !6, i64 32, !13, i64 40, !13, i64 48, !6, i64 56, !13, i64 120, !10, i64 128, !10, i64 132, !6, i64 136}
!10 = !{!"int", !6, i64 0}
!11 = !{!"long long", !6, i64 0}
!12 = !{!"_LIST_ENTRY", !13, i64 0, !13, i64 8}
!13 = !{!"any pointer", !6, i64 0}
!14 = !{!15, !10, i64 4184}
!15 = !{!"_IP6_SERVICE", !10, i64 0, !16, i64 8, !11, i64 24, !11, i64 32, !12, i64 40, !12, i64 56, !13, i64 72, !13, i64 80, !17, i64 88, !19, i64 136, !20, i64 2168, !19, i64 2192, !6, i64 2208, !6, i64 2209, !6, i64 2210, !6, i64 2211, !6, i64 2212, !10, i64 2216, !10, i64 2220, !10, i64 2224, !10, i64 2228, !12, i64 2232, !12, i64 2248, !12, i64 2264, !12, i64 2280, !10, i64 2296, !6, i64 2300, !13, i64 2304, !6, i64 2312, !6, i64 2313, !10, i64 2316, !13, i64 2320, !13, i64 2328, !13, i64 2336, !13, i64 2344, !21, i64 2352, !23, i64 2372, !13, i64 3032, !13, i64 3040, !24, i64 3048, !13, i64 4176, !10, i64 4184, !10, i64 4188}
!16 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !13, i64 0, !13, i64 8}
!17 = !{!"", !10, i64 0, !13, i64 8, !13, i64 16, !18, i64 24}
!18 = !{!"", !13, i64 0, !11, i64 8, !6, i64 16}
!19 = !{!"", !6, i64 0}
!20 = !{!"", !11, i64 0, !12, i64 8}
!21 = !{!"", !10, i64 0, !10, i64 4, !22, i64 8, !6, i64 10, !6, i64 11, !6, i64 12, !6, i64 13, !6, i64 14, !6, i64 15, !6, i64 16}
!22 = !{!"short", !6, i64 0}
!23 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !6, i64 40, !19, i64 552, !19, i64 584, !19, i64 616, !6, i64 648, !6, i64 649, !6, i64 650, !6, i64 651, !6, i64 652}
!24 = !{!"_IP6_CONFIG_INSTANCE", !10, i64 0, !6, i64 4, !12, i64 8, !22, i64 24, !25, i64 32, !19, i64 168, !10, i64 176, !26, i64 180, !6, i64 184, !27, i64 800, !27, i64 840, !28, i64 880, !13, i64 912, !13, i64 920, !13, i64 928, !13, i64 936, !6, i64 944, !10, i64 948, !13, i64 952, !10, i64 960, !13, i64 968, !10, i64 976, !29, i64 984, !31, i64 1040}
!25 = !{!"", !6, i64 0, !6, i64 64, !10, i64 68, !19, i64 72, !10, i64 104, !13, i64 112, !10, i64 120, !13, i64 128}
!26 = !{!"", !10, i64 0}
!27 = !{!"", !12, i64 0, !12, i64 16, !11, i64 32}
!28 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!29 = !{!"_IP6_FORM_CALLBACK_INFO", !10, i64 0, !13, i64 8, !30, i64 16, !13, i64 40, !13, i64 48}
!30 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !13, i64 0, !13, i64 8, !13, i64 16}
!31 = !{!"", !10, i64 0, !26, i64 4, !19, i64 8, !12, i64 16, !10, i64 32, !12, i64 40, !10, i64 56, !12, i64 64, !10, i64 80}
!32 = !{!33, !22, i64 4}
!33 = !{!"_EFI_IP6_HEADER", !6, i64 0, !6, i64 0, !6, i64 1, !6, i64 1, !22, i64 2, !22, i64 4, !6, i64 6, !6, i64 7, !19, i64 8, !19, i64 24}
!34 = !{!33, !6, i64 6}
!35 = !{!15, !6, i64 2212}
!36 = !{!33, !6, i64 7}
!37 = !{!38, !6, i64 0}
!38 = !{!"", !39, i64 0, !10, i64 4}
!39 = !{!"", !6, i64 0, !6, i64 1, !22, i64 2}
!40 = !{!38, !6, i64 1}
!41 = !{!10, !10, i64 0}
!42 = !{!38, !10, i64 4}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass