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

; 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_IPv4_ADDRESS = type { [4 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._UDP4_INSTANCE_DATA_ = type { i32, %struct._LIST_ENTRY, ptr, %struct._EFI_UDP4_PROTOCOL, %struct.EFI_UDP4_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_UDP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_UDP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, i8, i32, i32, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, %struct.EFI_IPv4_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_UDP4_COMPLETION_TOKEN = type { ptr, i64, %union.anon.1 }
%union.anon.1 = type { ptr }
%struct.EFI_UDP4_TRANSMIT_DATA = type { ptr, ptr, i32, i32, [1 x %struct.EFI_UDP4_FRAGMENT_DATA] }
%struct.EFI_UDP4_FRAGMENT_DATA = type { i32, ptr }
%struct._UDP4_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_IP4_OVERRIDE_DATA = type { %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i8, i8, i8, i8 }
%struct.EFI_UDP4_SESSION_DATA = type { %struct.EFI_IPv4_ADDRESS, i16, %struct.EFI_IPv4_ADDRESS, i16 }

@.str = external hidden unnamed_addr constant [151 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1
@mZeroIp4Addr = external global %struct.EFI_IPv4_ADDRESS, align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @Udp4Transmit(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 i32, align 4
  %13 = alloca i32, align 4
  %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) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #4
  %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 %283

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._UDP4_INSTANCE_DATA_, ptr null, i32 0, i32 3) to i64)
  %35 = inttoptr i64 %34 to ptr
  %36 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %35, i32 0, i32 0
  %37 = load i32, ptr %36, align 8, !tbaa !9
  %38 = icmp ne i32 %37, 1232102485
  br i1 %38, label %39, label %41

39:                                               ; preds = %31
  call void @DebugAssert(ptr noundef @.str, i64 noundef 523, 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._UDP4_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._UDP4_INSTANCE_DATA_, ptr %48, i32 0, i32 7
  %50 = load i8, ptr %49, align 1, !tbaa !19
  %51 = icmp ne i8 %50, 0
  br i1 %51, label %52, label %53

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

53:                                               ; preds = %46
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %54, i32 0, i32 6
  %56 = load i8, ptr %55, align 8, !tbaa !20
  %57 = icmp ne i8 %56, 0
  br i1 %57, label %59, label %58

58:                                               ; preds = %53
  store i64 -9223372036854775789, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %283

59:                                               ; preds = %53
  %60 = load ptr, ptr @gBS, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %60, i32 0, i32 1
  %62 = load ptr, ptr %61, align 8, !tbaa !21
  %63 = call i64 %62(i64 noundef 8)
  store i64 %63, ptr %8, align 8, !tbaa !24
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = call i64 @Udp4ValidateTxToken(ptr noundef %64, ptr noundef %65)
  store i64 %66, ptr %6, align 8, !tbaa !24
  %67 = load i64, ptr %6, align 8, !tbaa !24
  %68 = icmp slt i64 %67, 0
  br i1 %68, label %69, label %70

69:                                               ; preds = %59
  br label %277

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

76:                                               ; preds = %70
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %77, i32 0, i32 9
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = call i64 @NetMapIterate(ptr noundef %78, ptr noundef @Udp4TokenExist, ptr noundef %79)
  %81 = icmp slt i64 %80, 0
  br i1 %81, label %82, label %83

82:                                               ; preds = %76, %70
  store i64 -9223372036854775793, ptr %6, align 8, !tbaa !24
  br label %277

83:                                               ; preds = %76
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.EFI_UDP4_COMPLETION_TOKEN, ptr %84, i32 0, i32 2
  %86 = load ptr, ptr %85, align 8, !tbaa !25
  store ptr %86, ptr %14, align 8, !tbaa !5
  %87 = load ptr, ptr %14, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.EFI_UDP4_TRANSMIT_DATA, ptr %87, i32 0, i32 4
  %89 = getelementptr inbounds [1 x %struct.EFI_UDP4_FRAGMENT_DATA], ptr %88, i64 0, i64 0
  %90 = load ptr, ptr %14, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.EFI_UDP4_TRANSMIT_DATA, ptr %90, i32 0, i32 3
  %92 = load i32, ptr %91, align 4, !tbaa !26
  %93 = call ptr @NetbufFromExt(ptr noundef %89, i32 noundef %92, i32 noundef 8, i32 noundef 0, ptr noundef @Udp4NetVectorExtFree, ptr noundef null)
  store ptr %93, ptr %9, align 8, !tbaa !5
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = icmp eq ptr %94, null
  br i1 %95, label %96, label %97

96:                                               ; preds = %83
  store i64 -9223372036854775799, ptr %6, align 8, !tbaa !24
  br label %277

97:                                               ; preds = %83
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %98, i32 0, i32 2
  %100 = load ptr, ptr %99, align 8, !tbaa !28
  store ptr %100, ptr %16, align 8, !tbaa !5
  %101 = load ptr, ptr %16, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._UDP4_SERVICE_DATA_, ptr %101, i32 0, i32 6
  %103 = load ptr, ptr %102, align 8, !tbaa !29
  %104 = ptrtoint ptr %103 to i64
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.NET_BUF, ptr %105, i32 0, i32 6
  %107 = getelementptr inbounds [64 x i8], ptr %106, i64 0, i64 0
  store i64 %104, ptr %107, align 8, !tbaa !24
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = call ptr @NetbufAllocSpace(ptr noundef %108, i32 noundef 8, i8 noundef zeroext 1)
  store ptr %109, ptr %10, align 8, !tbaa !5
  br label %110

110:                                              ; preds = %97
  %111 = call zeroext i8 @DebugAssertEnabled()
  %112 = icmp ne i8 %111, 0
  br i1 %112, label %113, label %118

113:                                              ; preds = %110
  %114 = load ptr, ptr %10, align 8, !tbaa !5
  %115 = icmp ne ptr %114, null
  br i1 %115, label %117, label %116

116:                                              ; preds = %113
  call void @DebugAssert(ptr noundef @.str, i64 noundef 578, ptr noundef @.str.3)
  br label %117

117:                                              ; preds = %116, %113
  br label %118

118:                                              ; preds = %117, %110
  br label %119

119:                                              ; preds = %118
  br label %120

120:                                              ; preds = %119
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %121, i32 0, i32 4
  store ptr %122, ptr %11, align 8, !tbaa !5
  %123 = load ptr, ptr %11, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %123, i32 0, i32 12
  %125 = load i16, ptr %124, align 2, !tbaa !32
  %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 0
  store i16 %126, ptr %128, align 1, !tbaa !33
  %129 = load ptr, ptr %11, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %129, i32 0, i32 14
  %131 = load i16, ptr %130, align 4, !tbaa !35
  %132 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %131)
  %133 = load ptr, ptr %10, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %133, i32 0, i32 1
  store i16 %132, ptr %134, align 1, !tbaa !36
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.NET_BUF, ptr %135, i32 0, i32 9
  %137 = load i32, ptr %136, align 4, !tbaa !37
  %138 = trunc i32 %137 to i16
  %139 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %138)
  %140 = load ptr, ptr %10, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %140, i32 0, i32 2
  store i16 %139, ptr %141, align 1, !tbaa !39
  %142 = load ptr, ptr %10, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %142, i32 0, i32 3
  store i16 0, ptr %143, align 1, !tbaa !40
  %144 = load ptr, ptr %14, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.EFI_UDP4_TRANSMIT_DATA, ptr %144, i32 0, i32 0
  %146 = load ptr, ptr %145, align 8, !tbaa !41
  store ptr %146, ptr %15, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.EFI_IP4_OVERRIDE_DATA, ptr %17, i32 0, i32 0
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %148, i32 0, i32 10
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %147, ptr align 1 %149, i64 4, i1 false), !tbaa.struct !42
  %150 = load ptr, ptr %15, align 8, !tbaa !5
  %151 = icmp ne ptr %150, null
  br i1 %151, label %152, label %197

152:                                              ; preds = %120
  %153 = load ptr, ptr %15, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.EFI_UDP4_SESSION_DATA, ptr %153, i32 0, i32 0
  %155 = call i64 @CompareMem(ptr noundef %154, ptr noundef @mZeroIp4Addr, i64 noundef 4)
  %156 = icmp eq i64 %155, 0
  br i1 %156, label %162, label %157

157:                                              ; preds = %152
  %158 = getelementptr inbounds %struct.EFI_IP4_OVERRIDE_DATA, ptr %17, i32 0, i32 0
  %159 = load ptr, ptr %15, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.EFI_UDP4_SESSION_DATA, ptr %159, i32 0, i32 0
  %161 = call ptr @CopyMem(ptr noundef %158, ptr noundef %160, i64 noundef 4)
  br label %162

162:                                              ; preds = %157, %152
  %163 = load ptr, ptr %15, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.EFI_UDP4_SESSION_DATA, ptr %163, i32 0, i32 1
  %165 = load i16, ptr %164, align 2, !tbaa !43
  %166 = zext i16 %165 to i32
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %175

168:                                              ; preds = %162
  %169 = load ptr, ptr %15, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.EFI_UDP4_SESSION_DATA, ptr %169, i32 0, i32 1
  %171 = load i16, ptr %170, align 2, !tbaa !43
  %172 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %171)
  %173 = load ptr, ptr %10, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %173, i32 0, i32 0
  store i16 %172, ptr %174, align 1, !tbaa !33
  br label %175

175:                                              ; preds = %168, %162
  %176 = load ptr, ptr %15, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.EFI_UDP4_SESSION_DATA, ptr %176, i32 0, i32 3
  %178 = load i16, ptr %177, align 2, !tbaa !45
  %179 = zext i16 %178 to i32
  %180 = icmp ne i32 %179, 0
  br i1 %180, label %181, label %188

181:                                              ; preds = %175
  %182 = load ptr, ptr %15, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.EFI_UDP4_SESSION_DATA, ptr %182, i32 0, i32 3
  %184 = load i16, ptr %183, align 2, !tbaa !45
  %185 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %184)
  %186 = load ptr, ptr %10, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %186, i32 0, i32 1
  store i16 %185, ptr %187, align 1, !tbaa !36
  br label %188

188:                                              ; preds = %181, %175
  %189 = getelementptr inbounds %struct.EFI_IP4_OVERRIDE_DATA, ptr %17, i32 0, i32 0
  %190 = call ptr @CopyMem(ptr noundef %12, ptr noundef %189, i64 noundef 4)
  %191 = load ptr, ptr %15, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.EFI_UDP4_SESSION_DATA, ptr %191, i32 0, i32 2
  %193 = call ptr @CopyMem(ptr noundef %13, ptr noundef %192, i64 noundef 4)
  %194 = load i32, ptr %12, align 4, !tbaa !46
  %195 = load i32, ptr %13, align 4, !tbaa !46
  %196 = call zeroext i16 @NetPseudoHeadChecksum(i32 noundef %194, i32 noundef %195, i8 noundef zeroext 17, i16 noundef zeroext 0)
  store i16 %196, ptr %18, align 2, !tbaa !47
  br label %204

197:                                              ; preds = %120
  %198 = load ptr, ptr %11, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %198, i32 0, i32 13
  %200 = call ptr @CopyMem(ptr noundef %13, ptr noundef %199, i64 noundef 4)
  %201 = load ptr, ptr %7, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %201, i32 0, i32 13
  %203 = load i16, ptr %202, align 8, !tbaa !48
  store i16 %203, ptr %18, align 2, !tbaa !47
  br label %204

204:                                              ; preds = %197, %188
  %205 = load ptr, ptr %9, align 8, !tbaa !5
  %206 = load i16, ptr %18, align 2, !tbaa !47
  %207 = call zeroext i16 @Udp4Checksum(ptr noundef %205, i16 noundef zeroext %206)
  %208 = load ptr, ptr %10, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %208, i32 0, i32 3
  store i16 %207, ptr %209, align 1, !tbaa !40
  %210 = load ptr, ptr %10, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %210, i32 0, i32 3
  %212 = load i16, ptr %211, align 1, !tbaa !40
  %213 = zext i16 %212 to i32
  %214 = icmp eq i32 %213, 0
  br i1 %214, label %215, label %218

215:                                              ; preds = %204
  %216 = load ptr, ptr %10, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.EFI_UDP_HEADER, ptr %216, i32 0, i32 3
  store i16 -1, ptr %217, align 1, !tbaa !40
  br label %218

218:                                              ; preds = %215, %204
  %219 = load ptr, ptr %14, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.EFI_UDP4_TRANSMIT_DATA, ptr %219, i32 0, i32 1
  %221 = load ptr, ptr %220, align 8, !tbaa !49
  %222 = icmp ne ptr %221, null
  br i1 %222, label %223, label %229

223:                                              ; preds = %218
  %224 = getelementptr inbounds %struct.EFI_IP4_OVERRIDE_DATA, ptr %17, i32 0, i32 1
  %225 = load ptr, ptr %14, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.EFI_UDP4_TRANSMIT_DATA, ptr %225, i32 0, i32 1
  %227 = load ptr, ptr %226, align 8, !tbaa !49
  %228 = call ptr @CopyMem(ptr noundef %224, ptr noundef %227, i64 noundef 4)
  br label %232

229:                                              ; preds = %218
  %230 = getelementptr inbounds %struct.EFI_IP4_OVERRIDE_DATA, ptr %17, i32 0, i32 1
  %231 = call ptr @ZeroMem(ptr noundef %230, i64 noundef 4)
  br label %232

232:                                              ; preds = %229, %223
  %233 = getelementptr inbounds %struct.EFI_IP4_OVERRIDE_DATA, ptr %17, i32 0, i32 2
  store i8 17, ptr %233, align 4, !tbaa !25
  %234 = load ptr, ptr %11, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %234, i32 0, i32 4
  %236 = load i8, ptr %235, align 4, !tbaa !50
  %237 = getelementptr inbounds %struct.EFI_IP4_OVERRIDE_DATA, ptr %17, i32 0, i32 3
  store i8 %236, ptr %237, align 1, !tbaa !25
  %238 = load ptr, ptr %11, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %238, i32 0, i32 5
  %240 = load i8, ptr %239, align 1, !tbaa !51
  %241 = getelementptr inbounds %struct.EFI_IP4_OVERRIDE_DATA, ptr %17, i32 0, i32 4
  store i8 %240, ptr %241, align 2, !tbaa !25
  %242 = load ptr, ptr %11, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %242, i32 0, i32 6
  %244 = load i8, ptr %243, align 2, !tbaa !52
  %245 = getelementptr inbounds %struct.EFI_IP4_OVERRIDE_DATA, ptr %17, i32 0, i32 5
  store i8 %244, ptr %245, align 1, !tbaa !25
  %246 = load ptr, ptr %7, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %246, i32 0, i32 8
  %248 = load ptr, ptr %5, align 8, !tbaa !5
  %249 = load ptr, ptr %9, align 8, !tbaa !5
  %250 = call i64 @NetMapInsertTail(ptr noundef %247, ptr noundef %248, ptr noundef %249)
  store i64 %250, ptr %6, align 8, !tbaa !24
  %251 = load i64, ptr %6, align 8, !tbaa !24
  %252 = icmp slt i64 %251, 0
  br i1 %252, label %253, label %254

253:                                              ; preds = %232
  br label %275

254:                                              ; preds = %232
  %255 = load i32, ptr %13, align 4, !tbaa !46
  %256 = getelementptr inbounds [4 x i32], ptr %19, i64 0, i64 0
  store i32 %255, ptr %256, align 4, !tbaa !25
  %257 = load ptr, ptr %16, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct._UDP4_SERVICE_DATA_, ptr %257, i32 0, i32 6
  %259 = load ptr, ptr %258, align 8, !tbaa !29
  %260 = load ptr, ptr %9, align 8, !tbaa !5
  %261 = load ptr, ptr %7, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %261, i32 0, i32 15
  %263 = load ptr, ptr %262, align 8, !tbaa !53
  %264 = load ptr, ptr %7, align 8, !tbaa !5
  %265 = load ptr, ptr %5, align 8, !tbaa !5
  %266 = call i64 @IpIoSend(ptr noundef %259, ptr noundef %260, ptr noundef %263, ptr noundef %264, ptr noundef %265, ptr noundef %19, ptr noundef %17)
  store i64 %266, ptr %6, align 8, !tbaa !24
  %267 = load i64, ptr %6, align 8, !tbaa !24
  %268 = icmp slt i64 %267, 0
  br i1 %268, label %269, label %274

269:                                              ; preds = %254
  %270 = load ptr, ptr %7, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %270, i32 0, i32 8
  %272 = load ptr, ptr %5, align 8, !tbaa !5
  %273 = call i64 @Udp4RemoveToken(ptr noundef %271, ptr noundef %272)
  br label %274

274:                                              ; preds = %269, %254
  br label %275

275:                                              ; preds = %274, %253
  %276 = load ptr, ptr %9, align 8, !tbaa !5
  call void @NetbufFree(ptr noundef %276)
  br label %277

277:                                              ; preds = %275, %96, %82, %69
  %278 = load ptr, ptr @gBS, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %278, i32 0, i32 2
  %280 = load ptr, ptr %279, align 8, !tbaa !54
  %281 = load i64, ptr %8, align 8, !tbaa !24
  call void %280(i64 noundef %281)
  %282 = load i64, ptr %6, align 8, !tbaa !24
  store i64 %282, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %283

283:                                              ; preds = %277, %58, %52, %26
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %284 = load i64, ptr %3, align 8
  ret i64 %284
}

; 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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

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

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

declare i64 @Udp4TokenExist(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 @Udp4NetVectorExtFree(ptr noundef) #2

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

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

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

declare zeroext i16 @Udp4Checksum(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 @Udp4RemoveToken(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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_UDP4_INSTANCE_DATA_", !11, i64 0, !12, i64 8, !6, i64 24, !13, i64 32, !14, i64 96, !6, i64 136, !7, i64 144, !7, i64 145, !17, i64 152, !17, i64 192, !17, i64 232, !12, i64 272, !12, i64 288, !16, i64 304, !18, i64 312, !6, i64 320, !7, i64 328}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"_EFI_UDP4_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}
!14 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !11, i64 8, !11, i64 12, !7, i64 16, !15, i64 17, !15, i64 21, !16, i64 26, !15, i64 28, !16, i64 32}
!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 145}
!20 = !{!10, !7, i64 144}
!21 = !{!22, !6, i64 24}
!22 = !{!"", !23, 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}
!23 = !{!"", !18, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!24 = !{!18, !18, i64 0}
!25 = !{!7, !7, i64 0}
!26 = !{!27, !11, i64 20}
!27 = !{!"", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !7, i64 24}
!28 = !{!10, !6, i64 24}
!29 = !{!30, !6, i64 64}
!30 = !{!"_UDP4_SERVICE_DATA_", !11, i64 0, !31, i64 8, !6, i64 24, !6, i64 32, !12, i64 40, !18, i64 56, !6, i64 64, !6, i64 72}
!31 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!32 = !{!14, !16, i64 26}
!33 = !{!34, !16, i64 0}
!34 = !{!"", !16, i64 0, !16, i64 2, !16, i64 4, !16, i64 6}
!35 = !{!14, !16, i64 32}
!36 = !{!34, !16, i64 2}
!37 = !{!38, !11, i64 132}
!38 = !{!"", !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}
!39 = !{!34, !16, i64 4}
!40 = !{!34, !16, i64 6}
!41 = !{!27, !6, i64 0}
!42 = !{i64 0, i64 4, !25}
!43 = !{!44, !16, i64 4}
!44 = !{!"", !15, i64 0, !16, i64 4, !15, i64 6, !16, i64 10}
!45 = !{!44, !16, i64 10}
!46 = !{!11, !11, i64 0}
!47 = !{!16, !16, i64 0}
!48 = !{!10, !16, i64 304}
!49 = !{!27, !6, i64 8}
!50 = !{!14, !7, i64 4}
!51 = !{!14, !7, i64 5}
!52 = !{!14, !7, i64 6}
!53 = !{!10, !6, i64 320}
!54 = !{!22, !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_IPv4_ADDRESS = type { [4 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 [151 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.3 = external hidden unnamed_addr constant [27 x i8], align 1
@mZeroIp4Addr = external global %struct.EFI_IPv4_ADDRESS, align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @Udp4Transmit(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %union.IP_IO_OVERRIDE, align 4
  %6 = alloca %union.EFI_IP_ADDRESS, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 4, 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 %136, 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, 1232102485
  br i1 %.not84, label %._crit_edge, label %13

13:                                               ; preds = %11
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 523, 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 145
  %16 = load i8, ptr %15, align 1, !tbaa !18
  %.not85 = icmp eq i8 %16, 0
  br i1 %.not85, label %17, label %136

17:                                               ; preds = %._crit_edge
  %18 = getelementptr inbounds i8, ptr %14, i64 144
  %19 = load i8, ptr %18, align 8, !tbaa !19
  %.not86 = icmp eq i8 %19, 0
  br i1 %.not86, label %136, label %20

20:                                               ; preds = %17
  %21 = load ptr, ptr @gBS, align 8, !tbaa !20
  %22 = getelementptr inbounds i8, ptr %21, i64 24
  %23 = load ptr, ptr %22, align 8, !tbaa !21
  %24 = tail call i64 %23(i64 noundef 8) #3
  %25 = tail call i64 @Udp4ValidateTxToken(ptr noundef nonnull %14, ptr noundef nonnull %1) #3
  %26 = icmp slt i64 %25, 0
  br i1 %26, label %132, label %27

27:                                               ; preds = %20
  %28 = getelementptr inbounds i8, ptr %14, i64 152
  %29 = tail call i64 @NetMapIterate(ptr noundef nonnull %28, ptr noundef nonnull @Udp4TokenExist, ptr noundef nonnull %1) #3
  %30 = icmp slt i64 %29, 0
  br i1 %30, label %132, label %31

31:                                               ; preds = %27
  %32 = getelementptr inbounds i8, ptr %14, i64 192
  %33 = tail call i64 @NetMapIterate(ptr noundef nonnull %32, ptr noundef nonnull @Udp4TokenExist, ptr noundef nonnull %1) #3
  %34 = icmp slt i64 %33, 0
  br i1 %34, label %132, label %35

35:                                               ; preds = %31
  %36 = getelementptr inbounds i8, ptr %1, i64 16
  %37 = load ptr, ptr %36, align 8, !tbaa !24
  %38 = getelementptr inbounds i8, ptr %37, i64 24
  %39 = getelementptr inbounds i8, ptr %37, i64 20
  %40 = load i32, ptr %39, align 4, !tbaa !25
  %41 = tail call ptr @NetbufFromExt(ptr noundef nonnull %38, i32 noundef %40, i32 noundef 8, i32 noundef 0, ptr noundef nonnull @Udp4NetVectorExtFree, ptr noundef null) #3
  %42 = icmp eq ptr %41, null
  br i1 %42, label %132, label %43

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

54:                                               ; preds = %43
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 578, ptr noundef nonnull @.str.3) #3
  br label %55

55:                                               ; preds = %54, %43
  %56 = getelementptr inbounds i8, ptr %14, i64 122
  %57 = load i16, ptr %56, align 2, !tbaa !32
  %58 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %57) #3
  store i16 %58, ptr %50, align 1, !tbaa !33
  %59 = getelementptr inbounds i8, ptr %14, i64 128
  %60 = load i16, ptr %59, align 4, !tbaa !35
  %61 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %60) #3
  %62 = getelementptr inbounds i8, ptr %50, i64 2
  store i16 %61, ptr %62, align 1, !tbaa !36
  %63 = getelementptr inbounds i8, ptr %41, i64 132
  %64 = load i32, ptr %63, align 4, !tbaa !37
  %65 = trunc i32 %64 to i16
  %66 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %65) #3
  %67 = getelementptr inbounds i8, ptr %50, i64 4
  store i16 %66, ptr %67, align 1, !tbaa !39
  %68 = getelementptr inbounds i8, ptr %50, i64 6
  store i16 0, ptr %68, align 1, !tbaa !40
  %69 = load ptr, ptr %37, align 8, !tbaa !41
  %70 = getelementptr inbounds i8, ptr %14, i64 113
  %71 = load i32, ptr %70, align 1, !tbaa !24
  store i32 %71, ptr %5, align 4, !tbaa !24
  %.not87 = icmp eq ptr %69, null
  br i1 %.not87, label %94, label %72

72:                                               ; preds = %55
  %73 = tail call i64 @CompareMem(ptr noundef nonnull %69, ptr noundef nonnull @mZeroIp4Addr, i64 noundef 4) #3
  %74 = icmp eq i64 %73, 0
  br i1 %74, label %77, label %75

75:                                               ; preds = %72
  %76 = call ptr @CopyMem(ptr noundef nonnull %5, ptr noundef nonnull %69, i64 noundef 4) #3
  br label %77

77:                                               ; preds = %75, %72
  %78 = getelementptr inbounds i8, ptr %69, i64 4
  %79 = load i16, ptr %78, align 2, !tbaa !42
  %.not88 = icmp eq i16 %79, 0
  br i1 %.not88, label %82, label %80

80:                                               ; preds = %77
  %81 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %79) #3
  store i16 %81, ptr %50, align 1, !tbaa !33
  br label %82

82:                                               ; preds = %80, %77
  %83 = getelementptr inbounds i8, ptr %69, i64 10
  %84 = load i16, ptr %83, align 2, !tbaa !44
  %.not89 = icmp eq i16 %84, 0
  br i1 %.not89, label %87, label %85

85:                                               ; preds = %82
  %86 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %84) #3
  store i16 %86, ptr %62, align 1, !tbaa !36
  br label %87

87:                                               ; preds = %85, %82
  %88 = call ptr @CopyMem(ptr noundef nonnull %3, ptr noundef nonnull %5, i64 noundef 4) #3
  %89 = getelementptr inbounds i8, ptr %69, i64 6
  %90 = call ptr @CopyMem(ptr noundef nonnull %4, ptr noundef nonnull %89, i64 noundef 4) #3
  %91 = load i32, ptr %3, align 4, !tbaa !45
  %92 = load i32, ptr %4, align 4, !tbaa !45
  %93 = call zeroext i16 @NetPseudoHeadChecksum(i32 noundef %91, i32 noundef %92, i8 noundef zeroext 17, i16 noundef zeroext 0) #3
  br label %99

94:                                               ; preds = %55
  %95 = getelementptr inbounds i8, ptr %14, i64 124
  %96 = call ptr @CopyMem(ptr noundef nonnull %4, ptr noundef nonnull %95, i64 noundef 4) #3
  %97 = getelementptr inbounds i8, ptr %14, i64 304
  %98 = load i16, ptr %97, align 8, !tbaa !46
  br label %99

99:                                               ; preds = %94, %87
  %.0 = phi i16 [ %93, %87 ], [ %98, %94 ]
  %100 = call zeroext i16 @Udp4Checksum(ptr noundef nonnull %41, i16 noundef zeroext %.0) #3
  %101 = icmp eq i16 %100, 0
  %spec.select = select i1 %101, i16 -1, i16 %100
  store i16 %spec.select, ptr %68, align 1, !tbaa !40
  %102 = getelementptr inbounds i8, ptr %37, i64 8
  %103 = load ptr, ptr %102, align 8, !tbaa !47
  %.not90 = icmp eq ptr %103, null
  %104 = getelementptr inbounds i8, ptr %5, i64 4
  br i1 %.not90, label %107, label %105

105:                                              ; preds = %99
  %106 = call ptr @CopyMem(ptr noundef nonnull %104, ptr noundef nonnull %103, i64 noundef 4) #3
  br label %109

107:                                              ; preds = %99
  %108 = call ptr @ZeroMem(ptr noundef nonnull %104, i64 noundef 4) #3
  br label %109

109:                                              ; preds = %107, %105
  %110 = getelementptr inbounds i8, ptr %5, i64 8
  store i8 17, ptr %110, align 4, !tbaa !24
  %111 = getelementptr inbounds i8, ptr %14, i64 100
  %112 = load i8, ptr %111, align 4, !tbaa !48
  %113 = getelementptr inbounds i8, ptr %5, i64 9
  store i8 %112, ptr %113, align 1, !tbaa !24
  %114 = getelementptr inbounds i8, ptr %14, i64 101
  %115 = load i8, ptr %114, align 1, !tbaa !49
  %116 = getelementptr inbounds i8, ptr %5, i64 10
  store i8 %115, ptr %116, align 2, !tbaa !24
  %117 = getelementptr inbounds i8, ptr %14, i64 102
  %118 = load i8, ptr %117, align 2, !tbaa !50
  %119 = getelementptr inbounds i8, ptr %5, i64 11
  store i8 %118, ptr %119, align 1, !tbaa !24
  %120 = call i64 @NetMapInsertTail(ptr noundef nonnull %28, ptr noundef nonnull %1, ptr noundef nonnull %41) #3
  %121 = icmp slt i64 %120, 0
  br i1 %121, label %131, label %122

122:                                              ; preds = %109
  %123 = load i32, ptr %4, align 4, !tbaa !45
  store i32 %123, ptr %6, align 4, !tbaa !24
  %124 = load ptr, ptr %46, align 8, !tbaa !28
  %125 = getelementptr inbounds i8, ptr %14, i64 320
  %126 = load ptr, ptr %125, align 8, !tbaa !51
  %127 = call i64 @IpIoSend(ptr noundef %124, ptr noundef nonnull %41, ptr noundef %126, ptr noundef nonnull %14, ptr noundef nonnull %1, ptr noundef nonnull %6, ptr noundef nonnull %5) #3
  %128 = icmp slt i64 %127, 0
  br i1 %128, label %129, label %131

129:                                              ; preds = %122
  %130 = call i64 @Udp4RemoveToken(ptr noundef nonnull %28, ptr noundef nonnull %1) #3
  br label %131

131:                                              ; preds = %122, %129, %109
  %.074 = phi i64 [ %120, %109 ], [ %127, %129 ], [ %127, %122 ]
  call void @NetbufFree(ptr noundef nonnull %41) #3
  br label %132

132:                                              ; preds = %35, %27, %31, %20, %131
  %.1 = phi i64 [ %25, %20 ], [ %.074, %131 ], [ -9223372036854775793, %31 ], [ -9223372036854775793, %27 ], [ -9223372036854775799, %35 ]
  %133 = load ptr, ptr @gBS, align 8, !tbaa !20
  %134 = getelementptr inbounds i8, ptr %133, i64 32
  %135 = load ptr, ptr %134, align 8, !tbaa !52
  call void %135(i64 noundef %24) #3
  br label %136

136:                                              ; preds = %17, %._crit_edge, %2, %132
  %.073 = phi i64 [ %.1, %132 ], [ -9223372036854775806, %2 ], [ -9223372036854775791, %._crit_edge ], [ -9223372036854775789, %17 ]
  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 4, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  ret i64 %.073
}

; 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 i16 @NetPseudoHeadChecksum(i32 noundef, i32 noundef, i8 noundef zeroext, i16 noundef zeroext) 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 @Udp4ValidateTxToken(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i64 @Udp4TokenExist(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 @Udp4NetVectorExtFree(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 i64 @CompareMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare zeroext i16 @Udp4Checksum(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 @Udp4RemoveToken(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 = !{!"_UDP4_INSTANCE_DATA_", !7, i64 0, !10, i64 8, !11, i64 24, !12, i64 32, !13, i64 96, !11, i64 136, !8, i64 144, !8, i64 145, !16, i64 152, !16, i64 192, !16, i64 232, !10, i64 272, !10, i64 288, !15, i64 304, !17, i64 312, !11, i64 320, !8, i64 328}
!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_UDP4_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56}
!13 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6, !7, i64 8, !7, i64 12, !8, i64 16, !14, i64 17, !14, i64 21, !15, i64 26, !14, i64 28, !15, i64 32}
!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 145}
!19 = !{!6, !8, i64 144}
!20 = !{!11, !11, i64 0}
!21 = !{!22, !11, i64 24}
!22 = !{!"", !23, 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}
!23 = !{!"", !17, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!24 = !{!8, !8, i64 0}
!25 = !{!26, !7, i64 20}
!26 = !{!"", !11, i64 0, !11, i64 8, !7, i64 16, !7, i64 20, !8, i64 24}
!27 = !{!6, !11, i64 24}
!28 = !{!29, !11, i64 64}
!29 = !{!"_UDP4_SERVICE_DATA_", !7, i64 0, !30, i64 8, !11, i64 24, !11, i64 32, !10, i64 40, !17, i64 56, !11, i64 64, !11, i64 72}
!30 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !11, i64 0, !11, i64 8}
!31 = !{!17, !17, i64 0}
!32 = !{!13, !15, i64 26}
!33 = !{!34, !15, i64 0}
!34 = !{!"", !15, i64 0, !15, i64 2, !15, i64 4, !15, i64 6}
!35 = !{!13, !15, i64 32}
!36 = !{!34, !15, i64 2}
!37 = !{!38, !7, i64 132}
!38 = !{!"", !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}
!39 = !{!34, !15, i64 4}
!40 = !{!34, !15, i64 6}
!41 = !{!26, !11, i64 0}
!42 = !{!43, !15, i64 4}
!43 = !{!"", !14, i64 0, !15, i64 4, !14, i64 6, !15, i64 10}
!44 = !{!43, !15, i64 10}
!45 = !{!7, !7, i64 0}
!46 = !{!6, !15, i64 304}
!47 = !{!26, !11, i64 8}
!48 = !{!13, !8, i64 4}
!49 = !{!13, !8, i64 5}
!50 = !{!13, !8, i64 6}
!51 = !{!6, !11, i64 320}
!52 = !{!22, !11, i64 32}


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