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

; 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_IPv6_ADDRESS = type { [16 x i8] }
%union.IP_IO_OVERRIDE = type { %struct._EFI_IP6_OVERRIDE_DATA, [4 x i8] }
%struct._EFI_IP6_OVERRIDE_DATA = type { i8, i8, i32 }
%union.EFI_IP_ADDRESS = type { [4 x i32] }
%struct._UDP6_INSTANCE_DATA = type { i32, %struct._LIST_ENTRY, ptr, %struct._EFI_UDP6_PROTOCOL, %struct.EFI_UDP6_CONFIG_DATA, ptr, i8, i8, %struct.NET_MAP, %struct.NET_MAP, %struct.NET_MAP, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i16, i64, ptr, i8 }
%struct._EFI_UDP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_UDP6_CONFIG_DATA = type { i8, i8, i8, i8, i8, i32, i32, %struct.EFI_IPv6_ADDRESS, i16, %struct.EFI_IPv6_ADDRESS, i16 }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_BOOT_SERVICES = type { %struct.EFI_TABLE_HEADER, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }
%struct.EFI_UDP6_COMPLETION_TOKEN = type { ptr, i64, %union.anon.1 }
%union.anon.1 = type { ptr }
%struct.EFI_UDP6_TRANSMIT_DATA = type { ptr, i32, i32, [1 x %struct.EFI_UDP6_FRAGMENT_DATA] }
%struct.EFI_UDP6_FRAGMENT_DATA = type { i32, ptr }
%struct._UDP6_SERVICE_DATA = type { i32, %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr, ptr, %struct._LIST_ENTRY, i64, ptr, ptr }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%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.EFI_UDP_HEADER = type { i16, i16, i16, i16 }
%struct.EFI_UDP6_SESSION_DATA = type { %struct.EFI_IPv6_ADDRESS, i16, %struct.EFI_IPv6_ADDRESS, i16 }

@.str = external hidden unnamed_addr constant [131 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1

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

23:                                               ; preds = %2
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %27

26:                                               ; preds = %23, %2
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %270

27:                                               ; preds = %23
  %28 = call zeroext i8 @DebugAssertEnabled()
  %29 = zext i8 %28 to i32
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %41

31:                                               ; preds = %27
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = ptrtoint ptr %32 to i64
  %34 = sub i64 %33, ptrtoint (ptr getelementptr inbounds (%struct._UDP6_INSTANCE_DATA, ptr null, i32 0, i32 3) to i64)
  %35 = inttoptr i64 %34 to ptr
  %36 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %35, i32 0, i32 0
  %37 = load i32, ptr %36, align 8, !tbaa !9
  %38 = icmp ne i32 %37, 1399874645
  br i1 %38, label %39, label %41

39:                                               ; preds = %31
  call void @DebugAssert(ptr noundef @.str, i64 noundef 475, ptr noundef @.str.1)
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  br label %46

41:                                               ; preds = %31, %27
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = ptrtoint ptr %42 to i64
  %44 = sub i64 %43, ptrtoint (ptr getelementptr inbounds (%struct._UDP6_INSTANCE_DATA, ptr null, i32 0, i32 3) to i64)
  %45 = inttoptr i64 %44 to ptr
  br label %46

46:                                               ; preds = %41, %39
  %47 = phi ptr [ %40, %39 ], [ %45, %41 ]
  store ptr %47, ptr %7, align 8, !tbaa !5
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %48, i32 0, i32 6
  %50 = load i8, ptr %49, align 8, !tbaa !19
  %51 = icmp ne i8 %50, 0
  br i1 %51, label %53, label %52

52:                                               ; preds = %46
  store i64 -9223372036854775789, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %270

53:                                               ; preds = %46
  %54 = load ptr, ptr @gBS, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %54, i32 0, i32 1
  %56 = load ptr, ptr %55, align 8, !tbaa !20
  %57 = call i64 %56(i64 noundef 8)
  store i64 %57, ptr %8, align 8, !tbaa !23
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = call i64 @Udp6ValidateTxToken(ptr noundef %58, ptr noundef %59)
  store i64 %60, ptr %6, align 8, !tbaa !23
  %61 = load i64, ptr %6, align 8, !tbaa !23
  %62 = icmp slt i64 %61, 0
  br i1 %62, label %63, label %64

63:                                               ; preds = %53
  br label %264

64:                                               ; preds = %53
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %65, i32 0, i32 8
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = call i64 @NetMapIterate(ptr noundef %66, ptr noundef @Udp6TokenExist, ptr noundef %67)
  %69 = icmp slt i64 %68, 0
  br i1 %69, label %76, label %70

70:                                               ; preds = %64
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %71, i32 0, i32 9
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = call i64 @NetMapIterate(ptr noundef %72, ptr noundef @Udp6TokenExist, ptr noundef %73)
  %75 = icmp slt i64 %74, 0
  br i1 %75, label %76, label %77

76:                                               ; preds = %70, %64
  store i64 -9223372036854775793, ptr %6, align 8, !tbaa !23
  br label %264

77:                                               ; preds = %70
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.EFI_UDP6_COMPLETION_TOKEN, ptr %78, i32 0, i32 2
  %80 = load ptr, ptr %79, align 8, !tbaa !24
  store ptr %80, ptr %14, align 8, !tbaa !5
  %81 = load ptr, ptr %14, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.EFI_UDP6_TRANSMIT_DATA, ptr %81, i32 0, i32 3
  %83 = getelementptr inbounds [1 x %struct.EFI_UDP6_FRAGMENT_DATA], ptr %82, i64 0, i64 0
  %84 = load ptr, ptr %14, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.EFI_UDP6_TRANSMIT_DATA, ptr %84, i32 0, i32 2
  %86 = load i32, ptr %85, align 4, !tbaa !25
  %87 = call ptr @NetbufFromExt(ptr noundef %83, i32 noundef %86, i32 noundef 8, i32 noundef 0, ptr noundef @Udp6NetVectorExtFree, ptr noundef null)
  store ptr %87, ptr %9, align 8, !tbaa !5
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = icmp eq ptr %88, null
  br i1 %89, label %90, label %91

90:                                               ; preds = %77
  store i64 -9223372036854775799, ptr %6, align 8, !tbaa !23
  br label %264

91:                                               ; preds = %77
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %92, i32 0, i32 2
  %94 = load ptr, ptr %93, align 8, !tbaa !27
  store ptr %94, ptr %16, align 8, !tbaa !5
  %95 = load ptr, ptr %16, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._UDP6_SERVICE_DATA, ptr %95, i32 0, i32 6
  %97 = load ptr, ptr %96, align 8, !tbaa !28
  %98 = ptrtoint ptr %97 to i64
  %99 = load ptr, ptr %9, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.NET_BUF, ptr %99, i32 0, i32 6
  %101 = getelementptr inbounds [64 x i8], ptr %100, i64 0, i64 0
  store i64 %98, ptr %101, align 8, !tbaa !23
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = call ptr @NetbufAllocSpace(ptr noundef %102, i32 noundef 8, i8 noundef zeroext 1)
  store ptr %103, ptr %10, align 8, !tbaa !5
  br label %104

104:                                              ; preds = %91
  %105 = call zeroext i8 @DebugAssertEnabled()
  %106 = icmp ne i8 %105, 0
  br i1 %106, label %107, label %112

107:                                              ; preds = %104
  %108 = load ptr, ptr %10, align 8, !tbaa !5
  %109 = icmp ne ptr %108, null
  br i1 %109, label %111, label %110

110:                                              ; preds = %107
  call void @DebugAssert(ptr noundef @.str, i64 noundef 527, ptr noundef @.str.4)
  br label %111

111:                                              ; preds = %110, %107
  br label %112

112:                                              ; preds = %111, %104
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %115, i32 0, i32 4
  store ptr %116, ptr %11, align 8, !tbaa !5
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %117, i32 0, i32 8
  %119 = load i16, ptr %118, align 4, !tbaa !31
  %120 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %119)
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %121, i32 0, i32 0
  store i16 %120, ptr %122, align 1, !tbaa !32
  %123 = load ptr, ptr %11, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %123, i32 0, i32 10
  %125 = load i16, ptr %124, align 2, !tbaa !34
  %126 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %125)
  %127 = load ptr, ptr %10, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %127, i32 0, i32 1
  store i16 %126, ptr %128, align 1, !tbaa !35
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.NET_BUF, ptr %129, i32 0, i32 9
  %131 = load i32, ptr %130, align 4, !tbaa !36
  %132 = trunc i32 %131 to i16
  %133 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %132)
  %134 = load ptr, ptr %10, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %134, i32 0, i32 2
  store i16 %133, ptr %135, align 1, !tbaa !38
  %136 = load ptr, ptr %10, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %136, i32 0, i32 3
  store i16 0, ptr %137, align 1, !tbaa !39
  %138 = load ptr, ptr %10, align 8, !tbaa !5
  %139 = load ptr, ptr %9, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.NET_BUF, ptr %139, i32 0, i32 5
  store ptr %138, ptr %140, align 8, !tbaa !40
  %141 = load ptr, ptr %14, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.EFI_UDP6_TRANSMIT_DATA, ptr %141, i32 0, i32 0
  %143 = load ptr, ptr %142, align 8, !tbaa !41
  store ptr %143, ptr %15, align 8, !tbaa !5
  %144 = load ptr, ptr %15, align 8, !tbaa !5
  %145 = icmp ne ptr %144, null
  br i1 %145, label %146, label %200

146:                                              ; preds = %114
  %147 = load ptr, ptr %15, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.EFI_UDP6_SESSION_DATA, ptr %147, i32 0, i32 3
  %149 = load i16, ptr %148, align 2, !tbaa !42
  %150 = zext i16 %149 to i32
  %151 = icmp ne i32 %150, 0
  br i1 %151, label %152, label %159

152:                                              ; preds = %146
  %153 = load ptr, ptr %15, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.EFI_UDP6_SESSION_DATA, ptr %153, i32 0, i32 3
  %155 = load i16, ptr %154, align 2, !tbaa !42
  %156 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %155)
  %157 = load ptr, ptr %10, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %157, i32 0, i32 1
  store i16 %156, ptr %158, align 1, !tbaa !35
  br label %159

159:                                              ; preds = %152, %146
  %160 = load ptr, ptr %11, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %160, i32 0, i32 7
  %162 = call ptr @CopyMem(ptr noundef %12, ptr noundef %161, i64 noundef 16)
  %163 = load ptr, ptr %15, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.EFI_UDP6_SESSION_DATA, ptr %163, i32 0, i32 2
  %165 = call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef %164)
  %166 = icmp ne i8 %165, 0
  br i1 %166, label %171, label %167

167:                                              ; preds = %159
  %168 = load ptr, ptr %15, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.EFI_UDP6_SESSION_DATA, ptr %168, i32 0, i32 2
  %170 = call ptr @CopyMem(ptr noundef %13, ptr noundef %169, i64 noundef 16)
  br label %175

171:                                              ; preds = %159
  %172 = load ptr, ptr %11, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %172, i32 0, i32 9
  %174 = call ptr @CopyMem(ptr noundef %13, ptr noundef %173, i64 noundef 16)
  br label %175

175:                                              ; preds = %171, %167
  %176 = load ptr, ptr %11, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %176, i32 0, i32 7
  %178 = call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef %177)
  %179 = icmp ne i8 %178, 0
  br i1 %179, label %196, label %180

180:                                              ; preds = %175
  %181 = call zeroext i16 @NetIp6PseudoHeadChecksum(ptr noundef %12, ptr noundef %13, i8 noundef zeroext 17, i32 noundef 0)
  store i16 %181, ptr %18, align 2, !tbaa !44
  %182 = load ptr, ptr %9, align 8, !tbaa !5
  %183 = load i16, ptr %18, align 2, !tbaa !44
  %184 = call zeroext i16 @Udp6Checksum(ptr noundef %182, i16 noundef zeroext %183)
  %185 = load ptr, ptr %10, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %185, i32 0, i32 3
  store i16 %184, ptr %186, align 1, !tbaa !39
  %187 = load ptr, ptr %10, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %187, i32 0, i32 3
  %189 = load i16, ptr %188, align 1, !tbaa !39
  %190 = zext i16 %189 to i32
  %191 = icmp eq i32 %190, 0
  br i1 %191, label %192, label %195

192:                                              ; preds = %180
  %193 = load ptr, ptr %10, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %193, i32 0, i32 3
  store i16 -1, ptr %194, align 1, !tbaa !39
  br label %195

195:                                              ; preds = %192, %180
  br label %199

196:                                              ; preds = %175
  %197 = load ptr, ptr %10, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %197, i32 0, i32 3
  store i16 0, ptr %198, align 1, !tbaa !39
  br label %199

199:                                              ; preds = %196, %195
  br label %221

200:                                              ; preds = %114
  %201 = load ptr, ptr %11, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %201, i32 0, i32 9
  %203 = call ptr @CopyMem(ptr noundef %13, ptr noundef %202, i64 noundef 16)
  %204 = load ptr, ptr %7, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %204, i32 0, i32 13
  %206 = load i16, ptr %205, align 8, !tbaa !45
  store i16 %206, ptr %18, align 2, !tbaa !44
  %207 = load ptr, ptr %9, align 8, !tbaa !5
  %208 = load i16, ptr %18, align 2, !tbaa !44
  %209 = call zeroext i16 @Udp6Checksum(ptr noundef %207, i16 noundef zeroext %208)
  %210 = load ptr, ptr %10, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %210, i32 0, i32 3
  store i16 %209, ptr %211, align 1, !tbaa !39
  %212 = load ptr, ptr %10, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %212, i32 0, i32 3
  %214 = load i16, ptr %213, align 1, !tbaa !39
  %215 = zext i16 %214 to i32
  %216 = icmp eq i32 %215, 0
  br i1 %216, label %217, label %220

217:                                              ; preds = %200
  %218 = load ptr, ptr %10, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %218, i32 0, i32 3
  store i16 -1, ptr %219, align 1, !tbaa !39
  br label %220

220:                                              ; preds = %217, %200
  br label %221

221:                                              ; preds = %220, %199
  %222 = getelementptr inbounds %struct._EFI_IP6_OVERRIDE_DATA, ptr %17, i32 0, i32 0
  store i8 17, ptr %222, align 4, !tbaa !24
  %223 = load ptr, ptr %11, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %223, i32 0, i32 4
  %225 = load i8, ptr %224, align 4, !tbaa !46
  %226 = getelementptr inbounds %struct._EFI_IP6_OVERRIDE_DATA, ptr %17, i32 0, i32 1
  store i8 %225, ptr %226, align 1, !tbaa !24
  %227 = getelementptr inbounds %struct._EFI_IP6_OVERRIDE_DATA, ptr %17, i32 0, i32 2
  store i32 0, ptr %227, align 4, !tbaa !24
  %228 = load ptr, ptr %7, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %228, i32 0, i32 8
  %230 = load ptr, ptr %5, align 8, !tbaa !5
  %231 = load ptr, ptr %9, align 8, !tbaa !5
  %232 = call i64 @NetMapInsertTail(ptr noundef %229, ptr noundef %230, ptr noundef %231)
  store i64 %232, ptr %6, align 8, !tbaa !23
  %233 = load i64, ptr %6, align 8, !tbaa !23
  %234 = icmp slt i64 %233, 0
  br i1 %234, label %235, label %236

235:                                              ; preds = %221
  br label %262

236:                                              ; preds = %221
  %237 = load ptr, ptr %15, align 8, !tbaa !5
  %238 = icmp ne ptr %237, null
  br i1 %238, label %239, label %241

239:                                              ; preds = %236
  %240 = call ptr @CopyMem(ptr noundef %19, ptr noundef %13, i64 noundef 16)
  br label %243

241:                                              ; preds = %236
  %242 = call ptr @ZeroMem(ptr noundef %19, i64 noundef 16)
  br label %243

243:                                              ; preds = %241, %239
  %244 = load ptr, ptr %16, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct._UDP6_SERVICE_DATA, ptr %244, i32 0, i32 6
  %246 = load ptr, ptr %245, align 8, !tbaa !28
  %247 = load ptr, ptr %9, align 8, !tbaa !5
  %248 = load ptr, ptr %7, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %248, i32 0, i32 15
  %250 = load ptr, ptr %249, align 8, !tbaa !47
  %251 = load ptr, ptr %7, align 8, !tbaa !5
  %252 = load ptr, ptr %5, align 8, !tbaa !5
  %253 = call i64 @IpIoSend(ptr noundef %246, ptr noundef %247, ptr noundef %250, ptr noundef %251, ptr noundef %252, ptr noundef %19, ptr noundef %17)
  store i64 %253, ptr %6, align 8, !tbaa !23
  %254 = load i64, ptr %6, align 8, !tbaa !23
  %255 = icmp slt i64 %254, 0
  br i1 %255, label %256, label %261

256:                                              ; preds = %243
  %257 = load ptr, ptr %7, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %257, i32 0, i32 8
  %259 = load ptr, ptr %5, align 8, !tbaa !5
  %260 = call i64 @Udp6RemoveToken(ptr noundef %258, ptr noundef %259)
  br label %261

261:                                              ; preds = %256, %243
  br label %262

262:                                              ; preds = %261, %235
  %263 = load ptr, ptr %9, align 8, !tbaa !5
  call void @NetbufFree(ptr noundef %263)
  br label %264

264:                                              ; preds = %262, %90, %76, %63
  %265 = load ptr, ptr @gBS, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %265, i32 0, i32 2
  %267 = load ptr, ptr %266, align 8, !tbaa !48
  %268 = load i64, ptr %8, align 8, !tbaa !23
  call void %267(i64 noundef %268)
  %269 = load i64, ptr %6, align 8, !tbaa !23
  store i64 %269, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %270

270:                                              ; preds = %264, %52, %26
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 16, 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 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
  %271 = load i64, ptr %3, align 8
  ret i64 %271
}

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

declare zeroext i8 @DebugAssertEnabled() #2

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

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 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 @NetIp6IsUnspecifiedAddr(ptr noundef) #2

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

declare i64 @NetMapInsertTail(ptr noundef, ptr noundef, ptr noundef) #2

declare i64 @NetMapIterate(ptr noundef, ptr noundef, ptr noundef) #2

declare i64 @Udp6ValidateTxToken(ptr noundef, ptr noundef) #2

declare i64 @Udp6TokenExist(ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @NetbufFromExt(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #2

declare void @Udp6NetVectorExtFree(ptr noundef) #2

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

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

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

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

declare i64 @IpIoSend(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare i64 @Udp6RemoveToken(ptr noundef, ptr noundef) #2

declare void @NetbufFree(ptr noundef) #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_UDP6_INSTANCE_DATA", !11, i64 0, !12, i64 8, !6, i64 24, !13, i64 32, !14, i64 88, !6, i64 144, !7, i64 152, !7, i64 153, !17, i64 160, !17, i64 200, !17, i64 240, !12, i64 280, !12, i64 296, !16, i64 312, !18, i64 320, !6, i64 328, !7, i64 336}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"_EFI_UDP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!14 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !11, i64 8, !11, i64 12, !15, i64 16, !16, i64 32, !15, i64 34, !16, i64 50}
!15 = !{!"", !7, i64 0}
!16 = !{!"short", !7, i64 0}
!17 = !{!"", !12, i64 0, !12, i64 16, !18, i64 32}
!18 = !{!"long long", !7, i64 0}
!19 = !{!10, !7, i64 152}
!20 = !{!21, !6, i64 24}
!21 = !{!"", !22, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368}
!22 = !{!"", !18, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!23 = !{!18, !18, i64 0}
!24 = !{!7, !7, i64 0}
!25 = !{!26, !11, i64 12}
!26 = !{!"", !6, i64 0, !11, i64 8, !11, i64 12, !7, i64 16}
!27 = !{!10, !6, i64 24}
!28 = !{!29, !6, i64 64}
!29 = !{!"_UDP6_SERVICE_DATA", !11, i64 0, !30, i64 8, !6, i64 24, !6, i64 32, !12, i64 40, !18, i64 56, !6, i64 64, !6, i64 72}
!30 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!31 = !{!14, !16, i64 32}
!32 = !{!33, !16, i64 0}
!33 = !{!"", !16, i64 0, !16, i64 2, !16, i64 4, !16, i64 6}
!34 = !{!14, !16, i64 50}
!35 = !{!33, !16, i64 2}
!36 = !{!37, !11, i64 132}
!37 = !{!"", !11, i64 0, !18, i64 8, !12, i64 16, !7, i64 32, !6, i64 40, !6, i64 48, !7, i64 56, !6, i64 120, !11, i64 128, !11, i64 132, !7, i64 136}
!38 = !{!33, !16, i64 4}
!39 = !{!33, !16, i64 6}
!40 = !{!37, !6, i64 48}
!41 = !{!26, !6, i64 0}
!42 = !{!43, !16, i64 34}
!43 = !{!"", !15, i64 0, !16, i64 16, !15, i64 18, !16, i64 34}
!44 = !{!16, !16, i64 0}
!45 = !{!10, !16, i64 312}
!46 = !{!14, !7, i64 4}
!47 = !{!10, !6, i64 328}
!48 = !{!21, !6, i64 32}


; 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_IPv6_ADDRESS = type { [16 x i8] }
%union.IP_IO_OVERRIDE = type { %struct._EFI_IP6_OVERRIDE_DATA, [4 x i8] }
%struct._EFI_IP6_OVERRIDE_DATA = type { i8, i8, i32 }
%union.EFI_IP_ADDRESS = type { [4 x i32] }

@.str = external hidden unnamed_addr constant [131 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @Udp6Transmit(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.EFI_IPv6_ADDRESS, align 1
  %4 = alloca %struct.EFI_IPv6_ADDRESS, align 1
  %5 = alloca %union.IP_IO_OVERRIDE, align 4
  %6 = alloca %union.EFI_IP_ADDRESS, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  %7 = icmp eq ptr %0, null
  %8 = icmp eq ptr %1, null
  %or.cond = or i1 %7, %8
  br i1 %or.cond, label %115, label %9

9:                                                ; preds = %2
  %10 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %10, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre91 = add i64 %.pre, -32
  %.pre93 = inttoptr i64 %.pre91 to ptr
  br i1 %.not, label %._crit_edge, label %11

11:                                               ; preds = %9
  %12 = load i32, ptr %.pre93, align 8, !tbaa !5
  %.not84 = icmp eq i32 %12, 1399874645
  br i1 %.not84, label %._crit_edge, label %13

13:                                               ; preds = %11
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 475, ptr noundef nonnull @.str.1) #3
  br label %._crit_edge

._crit_edge:                                      ; preds = %9, %11, %13
  %14 = phi ptr [ %0, %13 ], [ %.pre93, %11 ], [ %.pre93, %9 ]
  %15 = getelementptr inbounds i8, ptr %14, i64 152
  %16 = load i8, ptr %15, align 8, !tbaa !18
  %.not85 = icmp eq i8 %16, 0
  br i1 %.not85, label %115, label %17

17:                                               ; preds = %._crit_edge
  %18 = load ptr, ptr @gBS, align 8, !tbaa !19
  %19 = getelementptr inbounds i8, ptr %18, i64 24
  %20 = load ptr, ptr %19, align 8, !tbaa !20
  %21 = tail call i64 %20(i64 noundef 8) #3
  %22 = tail call i64 @Udp6ValidateTxToken(ptr noundef nonnull %14, ptr noundef nonnull %1) #3
  %23 = icmp slt i64 %22, 0
  br i1 %23, label %111, label %24

24:                                               ; preds = %17
  %25 = getelementptr inbounds i8, ptr %14, i64 160
  %26 = tail call i64 @NetMapIterate(ptr noundef nonnull %25, ptr noundef nonnull @Udp6TokenExist, ptr noundef nonnull %1) #3
  %27 = icmp slt i64 %26, 0
  br i1 %27, label %111, label %28

28:                                               ; preds = %24
  %29 = getelementptr inbounds i8, ptr %14, i64 200
  %30 = tail call i64 @NetMapIterate(ptr noundef nonnull %29, ptr noundef nonnull @Udp6TokenExist, ptr noundef nonnull %1) #3
  %31 = icmp slt i64 %30, 0
  br i1 %31, label %111, label %32

32:                                               ; preds = %28
  %33 = getelementptr inbounds i8, ptr %1, i64 16
  %34 = load ptr, ptr %33, align 8, !tbaa !23
  %35 = getelementptr inbounds i8, ptr %34, i64 16
  %36 = getelementptr inbounds i8, ptr %34, i64 12
  %37 = load i32, ptr %36, align 4, !tbaa !24
  %38 = tail call ptr @NetbufFromExt(ptr noundef nonnull %35, i32 noundef %37, i32 noundef 8, i32 noundef 0, ptr noundef nonnull @Udp6NetVectorExtFree, ptr noundef null) #3
  %39 = icmp eq ptr %38, null
  br i1 %39, label %111, label %40

40:                                               ; preds = %32
  %41 = getelementptr inbounds i8, ptr %14, i64 24
  %42 = load ptr, ptr %41, align 8, !tbaa !26
  %43 = getelementptr inbounds i8, ptr %42, i64 64
  %44 = load ptr, ptr %43, align 8, !tbaa !27
  %45 = ptrtoint ptr %44 to i64
  %46 = getelementptr inbounds i8, ptr %38, i64 56
  store i64 %45, ptr %46, align 8, !tbaa !30
  %47 = tail call ptr @NetbufAllocSpace(ptr noundef nonnull %38, i32 noundef 8, i8 noundef zeroext 1) #3
  %48 = tail call zeroext i8 @DebugAssertEnabled() #3
  %49 = icmp eq i8 %48, 0
  %50 = icmp ne ptr %47, null
  %or.cond3 = select i1 %49, i1 true, i1 %50
  br i1 %or.cond3, label %52, label %51

51:                                               ; preds = %40
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 527, ptr noundef nonnull @.str.4) #3
  br label %52

52:                                               ; preds = %51, %40
  %53 = getelementptr inbounds i8, ptr %14, i64 120
  %54 = load i16, ptr %53, align 4, !tbaa !31
  %55 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %54) #3
  store i16 %55, ptr %47, align 1, !tbaa !32
  %56 = getelementptr inbounds i8, ptr %14, i64 138
  %57 = load i16, ptr %56, align 2, !tbaa !34
  %58 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %57) #3
  %59 = getelementptr inbounds i8, ptr %47, i64 2
  store i16 %58, ptr %59, align 1, !tbaa !35
  %60 = getelementptr inbounds i8, ptr %38, i64 132
  %61 = load i32, ptr %60, align 4, !tbaa !36
  %62 = trunc i32 %61 to i16
  %63 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %62) #3
  %64 = getelementptr inbounds i8, ptr %47, i64 4
  store i16 %63, ptr %64, align 1, !tbaa !38
  %65 = getelementptr inbounds i8, ptr %47, i64 6
  store i16 0, ptr %65, align 1, !tbaa !39
  %66 = getelementptr inbounds i8, ptr %38, i64 48
  store ptr %47, ptr %66, align 8, !tbaa !40
  %67 = load ptr, ptr %34, align 8, !tbaa !41
  %.not86 = icmp eq ptr %67, null
  br i1 %.not86, label %83, label %68

68:                                               ; preds = %52
  %69 = getelementptr inbounds i8, ptr %67, i64 34
  %70 = load i16, ptr %69, align 2, !tbaa !42
  %.not87 = icmp eq i16 %70, 0
  br i1 %.not87, label %73, label %71

71:                                               ; preds = %68
  %72 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %70) #3
  store i16 %72, ptr %59, align 1, !tbaa !35
  br label %73

73:                                               ; preds = %71, %68
  %74 = getelementptr inbounds i8, ptr %14, i64 104
  %75 = call ptr @CopyMem(ptr noundef nonnull %3, ptr noundef nonnull %74, i64 noundef 16) #3
  %76 = getelementptr inbounds i8, ptr %67, i64 18
  %77 = call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef nonnull %76) #3
  %.not88 = icmp eq i8 %77, 0
  %78 = getelementptr inbounds i8, ptr %14, i64 122
  %.sink = select i1 %.not88, ptr %76, ptr %78
  %79 = call ptr @CopyMem(ptr noundef nonnull %4, ptr noundef nonnull %.sink, i64 noundef 16) #3
  %80 = call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef nonnull %74) #3
  %.not89 = icmp eq i8 %80, 0
  br i1 %.not89, label %81, label %90

81:                                               ; preds = %73
  %82 = call zeroext i16 @NetIp6PseudoHeadChecksum(ptr noundef nonnull %3, ptr noundef nonnull %4, i8 noundef zeroext 17, i32 noundef 0) #3
  br label %.sink.split

83:                                               ; preds = %52
  %84 = getelementptr inbounds i8, ptr %14, i64 122
  %85 = call ptr @CopyMem(ptr noundef nonnull %4, ptr noundef nonnull %84, i64 noundef 16) #3
  %86 = getelementptr inbounds i8, ptr %14, i64 312
  %87 = load i16, ptr %86, align 8, !tbaa !44
  br label %.sink.split

.sink.split:                                      ; preds = %81, %83
  %.sink98 = phi i16 [ %87, %83 ], [ %82, %81 ]
  %88 = call zeroext i16 @Udp6Checksum(ptr noundef nonnull %38, i16 noundef zeroext %.sink98) #3
  %89 = icmp eq i16 %88, 0
  %spec.store.select90 = select i1 %89, i16 -1, i16 %88
  br label %90

90:                                               ; preds = %.sink.split, %73
  %spec.store.select90.sink = phi i16 [ 0, %73 ], [ %spec.store.select90, %.sink.split ]
  store i16 %spec.store.select90.sink, ptr %65, align 1
  store i8 17, ptr %5, align 4, !tbaa !23
  %91 = getelementptr inbounds i8, ptr %14, i64 92
  %92 = load i8, ptr %91, align 4, !tbaa !45
  %93 = getelementptr inbounds i8, ptr %5, i64 1
  store i8 %92, ptr %93, align 1, !tbaa !23
  %94 = getelementptr inbounds i8, ptr %5, i64 4
  store i32 0, ptr %94, align 4, !tbaa !23
  %95 = call i64 @NetMapInsertTail(ptr noundef nonnull %25, ptr noundef nonnull %1, ptr noundef nonnull %38) #3
  %96 = icmp slt i64 %95, 0
  br i1 %96, label %110, label %97

97:                                               ; preds = %90
  br i1 %.not86, label %100, label %98

98:                                               ; preds = %97
  %99 = call ptr @CopyMem(ptr noundef nonnull %6, ptr noundef nonnull %4, i64 noundef 16) #3
  br label %102

100:                                              ; preds = %97
  %101 = call ptr @ZeroMem(ptr noundef nonnull %6, i64 noundef 16) #3
  br label %102

102:                                              ; preds = %100, %98
  %103 = load ptr, ptr %43, align 8, !tbaa !27
  %104 = getelementptr inbounds i8, ptr %14, i64 328
  %105 = load ptr, ptr %104, align 8, !tbaa !46
  %106 = call i64 @IpIoSend(ptr noundef %103, ptr noundef nonnull %38, ptr noundef %105, ptr noundef nonnull %14, ptr noundef nonnull %1, ptr noundef nonnull %6, ptr noundef nonnull %5) #3
  %107 = icmp slt i64 %106, 0
  br i1 %107, label %108, label %110

108:                                              ; preds = %102
  %109 = call i64 @Udp6RemoveToken(ptr noundef nonnull %25, ptr noundef nonnull %1) #3
  br label %110

110:                                              ; preds = %102, %108, %90
  %.075 = phi i64 [ %95, %90 ], [ %106, %108 ], [ %106, %102 ]
  call void @NetbufFree(ptr noundef nonnull %38) #3
  br label %111

111:                                              ; preds = %32, %24, %28, %17, %110
  %.1 = phi i64 [ %22, %17 ], [ %.075, %110 ], [ -9223372036854775793, %28 ], [ -9223372036854775793, %24 ], [ -9223372036854775799, %32 ]
  %112 = load ptr, ptr @gBS, align 8, !tbaa !19
  %113 = getelementptr inbounds i8, ptr %112, i64 32
  %114 = load ptr, ptr %113, align 8, !tbaa !47
  call void %114(i64 noundef %21) #3
  br label %115

115:                                              ; preds = %._crit_edge, %2, %111
  %.0 = phi i64 [ %.1, %111 ], [ -9223372036854775806, %2 ], [ -9223372036854775789, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  ret i64 %.0
}

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

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

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

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

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

declare zeroext i16 @NetIp6PseudoHeadChecksum(ptr noundef, ptr noundef, i8 noundef zeroext, i32 noundef) local_unnamed_addr #2

declare i64 @NetMapInsertTail(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i64 @NetMapIterate(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i64 @Udp6ValidateTxToken(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i64 @Udp6TokenExist(ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @NetbufFromExt(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @Udp6NetVectorExtFree(ptr noundef) #2

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

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

declare zeroext i16 @Udp6Checksum(ptr noundef, i16 noundef zeroext) local_unnamed_addr #2

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

declare i64 @IpIoSend(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i64 @Udp6RemoveToken(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @NetbufFree(ptr noundef) local_unnamed_addr #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_UDP6_INSTANCE_DATA", !7, i64 0, !10, i64 8, !11, i64 24, !12, i64 32, !13, i64 88, !11, i64 144, !8, i64 152, !8, i64 153, !16, i64 160, !16, i64 200, !16, i64 240, !10, i64 280, !10, i64 296, !15, i64 312, !17, i64 320, !11, i64 328, !8, i64 336}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_LIST_ENTRY", !11, i64 0, !11, i64 8}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_EFI_UDP6_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48}
!13 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !7, i64 8, !7, i64 12, !14, i64 16, !15, i64 32, !14, i64 34, !15, i64 50}
!14 = !{!"", !8, i64 0}
!15 = !{!"short", !8, i64 0}
!16 = !{!"", !10, i64 0, !10, i64 16, !17, i64 32}
!17 = !{!"long long", !8, i64 0}
!18 = !{!6, !8, i64 152}
!19 = !{!11, !11, i64 0}
!20 = !{!21, !11, i64 24}
!21 = !{!"", !22, i64 0, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !11, i64 232, !11, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !11, i64 272, !11, i64 280, !11, i64 288, !11, i64 296, !11, i64 304, !11, i64 312, !11, i64 320, !11, i64 328, !11, i64 336, !11, i64 344, !11, i64 352, !11, i64 360, !11, i64 368}
!22 = !{!"", !17, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!23 = !{!8, !8, i64 0}
!24 = !{!25, !7, i64 12}
!25 = !{!"", !11, i64 0, !7, i64 8, !7, i64 12, !8, i64 16}
!26 = !{!6, !11, i64 24}
!27 = !{!28, !11, i64 64}
!28 = !{!"_UDP6_SERVICE_DATA", !7, i64 0, !29, i64 8, !11, i64 24, !11, i64 32, !10, i64 40, !17, i64 56, !11, i64 64, !11, i64 72}
!29 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !11, i64 0, !11, i64 8}
!30 = !{!17, !17, i64 0}
!31 = !{!13, !15, i64 32}
!32 = !{!33, !15, i64 0}
!33 = !{!"", !15, i64 0, !15, i64 2, !15, i64 4, !15, i64 6}
!34 = !{!13, !15, i64 50}
!35 = !{!33, !15, i64 2}
!36 = !{!37, !7, i64 132}
!37 = !{!"", !7, i64 0, !17, i64 8, !10, i64 16, !8, i64 32, !11, i64 40, !11, i64 48, !8, i64 56, !11, i64 120, !7, i64 128, !7, i64 132, !8, i64 136}
!38 = !{!33, !15, i64 4}
!39 = !{!33, !15, i64 6}
!40 = !{!37, !11, i64 48}
!41 = !{!25, !11, i64 0}
!42 = !{!43, !15, i64 34}
!43 = !{!"", !14, i64 0, !15, i64 16, !14, i64 18, !15, i64 34}
!44 = !{!6, !15, i64 312}
!45 = !{!13, !8, i64 4}
!46 = !{!6, !11, i64 328}
!47 = !{!21, !11, i64 32}


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