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

; 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.IP4_HEAD = type { i8, i8, i16, i16, i16, i8, i8, i16, i32, i32 }
%struct._IP4_PROTOCOL = type { i32, %struct._EFI_IP4_PROTOCOL, ptr, i64, ptr, %struct._LIST_ENTRY, %struct.NET_MAP, %struct.NET_MAP, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct.EFI_LOCK, ptr, %struct._LIST_ENTRY, ptr, ptr, i32, ptr, i32, %struct.EFI_IP4_CONFIG_DATA }
%struct._EFI_IP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%struct.EFI_LOCK = type { i64, i64, i32 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_IP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i8, i8, i8, i8, i32, i32 }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct._IP4_INTERFACE = type { i32, %struct._LIST_ENTRY, i64, i32, i32, i32, i32, i8, ptr, ptr, ptr, ptr, ptr, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i32, %struct._LIST_ENTRY, i8 }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct._IP4_SERVICE = type { i32, %struct._EFI_SERVICE_BINDING_PROTOCOL, i64, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, ptr, %struct.IP4_ASSEMBLE_TABLE, %struct.IGMP_SERVICE_DATA, ptr, ptr, ptr, ptr, %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, %struct.EFI_SIMPLE_NETWORK_MODE, ptr, ptr, ptr, ptr, ptr, i32, i32 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct.IP4_ASSEMBLE_TABLE = type { [31 x %struct._LIST_ENTRY] }
%struct.IGMP_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.IP4_ROUTE_CACHE_ENTRY = type { %struct._LIST_ENTRY, i64, i32, i32, i32, i64 }
%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 }

@mIp4Id = external dso_local global i16, align 2

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip4Output(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5, i32 noundef %6, ptr noundef %7, ptr noundef %8) #0 {
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i64, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i8, align 1
  %32 = alloca i32, align 4
  store ptr %0, ptr %11, align 8, !tbaa !5
  store ptr %1, ptr %12, align 8, !tbaa !5
  store ptr %2, ptr %13, align 8, !tbaa !5
  store ptr %3, ptr %14, align 8, !tbaa !5
  store ptr %4, ptr %15, align 8, !tbaa !5
  store i32 %5, ptr %16, align 4, !tbaa !9
  store i32 %6, ptr %17, align 4, !tbaa !9
  store ptr %7, ptr %18, align 8, !tbaa !5
  store ptr %8, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %31) #3
  %33 = load ptr, ptr %12, align 8, !tbaa !5
  %34 = icmp eq ptr %33, null
  br i1 %34, label %35, label %44

35:                                               ; preds = %9
  %36 = load ptr, ptr %11, align 8, !tbaa !5
  %37 = load ptr, ptr %14, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.IP4_HEAD, ptr %37, i32 0, i32 9
  %39 = load i32, ptr %38, align 1, !tbaa !11
  %40 = load ptr, ptr %14, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.IP4_HEAD, ptr %40, i32 0, i32 8
  %42 = load i32, ptr %41, align 1, !tbaa !14
  %43 = call ptr @Ip4SelectInterface(ptr noundef %36, i32 noundef %39, i32 noundef %42)
  store ptr %43, ptr %20, align 8, !tbaa !5
  br label %48

44:                                               ; preds = %9
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %45, i32 0, i32 11
  %47 = load ptr, ptr %46, align 8, !tbaa !15
  store ptr %47, ptr %20, align 8, !tbaa !5
  br label %48

48:                                               ; preds = %44, %35
  %49 = load ptr, ptr %20, align 8, !tbaa !5
  %50 = icmp eq ptr %49, null
  br i1 %50, label %51, label %52

51:                                               ; preds = %48
  store i64 -9223372036854775791, ptr %10, align 8
  store i32 1, ptr %32, align 4
  br label %290

52:                                               ; preds = %48
  %53 = load ptr, ptr %14, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.IP4_HEAD, ptr %53, i32 0, i32 8
  %55 = load i32, ptr %54, align 1, !tbaa !14
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %66

57:                                               ; preds = %52
  %58 = load ptr, ptr %12, align 8, !tbaa !5
  %59 = icmp eq ptr %58, null
  br i1 %59, label %60, label %66

60:                                               ; preds = %57
  %61 = load ptr, ptr %20, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %61, i32 0, i32 3
  %63 = load i32, ptr %62, align 8, !tbaa !24
  %64 = load ptr, ptr %14, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.IP4_HEAD, ptr %64, i32 0, i32 8
  store i32 %63, ptr %65, align 1, !tbaa !14
  br label %66

66:                                               ; preds = %60, %57, %52
  %67 = load i32, ptr %16, align 4, !tbaa !9
  %68 = add i32 %67, 3
  %69 = and i32 %68, -4
  %70 = zext i32 %69 to i64
  %71 = add i64 20, %70
  %72 = trunc i64 %71 to i32
  store i32 %72, ptr %26, align 4, !tbaa !9
  %73 = load ptr, ptr %12, align 8, !tbaa !5
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %83

75:                                               ; preds = %66
  %76 = load ptr, ptr %12, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %76, i32 0, i32 18
  %78 = getelementptr inbounds %struct.EFI_IP4_CONFIG_DATA, ptr %77, i32 0, i32 11
  %79 = load i8, ptr %78, align 1, !tbaa !26
  %80 = zext i8 %79 to i32
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %83

82:                                               ; preds = %75
  store i8 1, ptr %31, align 1, !tbaa !27
  br label %100

83:                                               ; preds = %75, %66
  %84 = load i32, ptr %26, align 4, !tbaa !9
  %85 = lshr i32 %84, 2
  %86 = trunc i32 %85 to i8
  %87 = load ptr, ptr %14, align 8, !tbaa !5
  %88 = load i8, ptr %87, align 1
  %89 = and i8 %86, 15
  %90 = and i8 %88, -16
  %91 = or i8 %90, %89
  store i8 %91, ptr %87, align 1
  %92 = load i16, ptr @mIp4Id, align 2, !tbaa !28
  %93 = add i16 %92, 1
  store i16 %93, ptr @mIp4Id, align 2, !tbaa !28
  %94 = load ptr, ptr %14, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.IP4_HEAD, ptr %94, i32 0, i32 3
  store i16 %92, ptr %95, align 1, !tbaa !29
  %96 = load ptr, ptr %14, align 8, !tbaa !5
  %97 = load i8, ptr %96, align 1
  %98 = and i8 %97, 15
  %99 = or i8 %98, 64
  store i8 %99, ptr %96, align 1
  store i8 0, ptr %31, align 1, !tbaa !27
  br label %100

100:                                              ; preds = %83, %82
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = load ptr, ptr %19, align 8, !tbaa !5
  %103 = call i64 @Ip4IpSecProcessPacket(ptr noundef %101, ptr noundef %14, ptr noundef %13, ptr noundef %15, ptr noundef %16, i32 noundef 1, ptr noundef %102)
  store i64 %103, ptr %23, align 8, !tbaa !30
  %104 = load i64, ptr %23, align 8, !tbaa !30
  %105 = icmp slt i64 %104, 0
  br i1 %105, label %106, label %108

106:                                              ; preds = %100
  %107 = load i64, ptr %23, align 8, !tbaa !30
  store i64 %107, ptr %10, align 8
  store i32 1, ptr %32, align 4
  br label %290

108:                                              ; preds = %100
  %109 = load ptr, ptr %14, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.IP4_HEAD, ptr %109, i32 0, i32 9
  %111 = load i32, ptr %110, align 1, !tbaa !11
  store i32 %111, ptr %22, align 4, !tbaa !9
  %112 = load i32, ptr %22, align 4, !tbaa !9
  %113 = load ptr, ptr %20, align 8, !tbaa !5
  %114 = call i64 @Ip4GetNetCast(i32 noundef %112, ptr noundef %113)
  %115 = icmp sge i64 %114, 4
  br i1 %115, label %119, label %116

116:                                              ; preds = %108
  %117 = load i32, ptr %22, align 4, !tbaa !9
  %118 = icmp eq i32 %117, -1
  br i1 %118, label %119, label %120

119:                                              ; preds = %116, %108
  store i32 -1, ptr %17, align 4, !tbaa !9
  br label %167

120:                                              ; preds = %116
  %121 = load i32, ptr %22, align 4, !tbaa !9
  %122 = and i32 %121, -268435456
  %123 = icmp eq i32 %122, -536870912
  br i1 %123, label %124, label %128

124:                                              ; preds = %120
  %125 = load ptr, ptr %14, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.IP4_HEAD, ptr %125, i32 0, i32 9
  %127 = load i32, ptr %126, align 1, !tbaa !11
  store i32 %127, ptr %17, align 4, !tbaa !9
  br label %166

128:                                              ; preds = %120
  %129 = load i32, ptr %17, align 4, !tbaa !9
  %130 = icmp eq i32 %129, 0
  br i1 %130, label %131, label %165

131:                                              ; preds = %128
  %132 = load ptr, ptr %12, align 8, !tbaa !5
  %133 = icmp eq ptr %132, null
  br i1 %133, label %134, label %145

134:                                              ; preds = %131
  %135 = load ptr, ptr %11, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._IP4_SERVICE, ptr %135, i32 0, i32 7
  %137 = load ptr, ptr %136, align 8, !tbaa !31
  %138 = load ptr, ptr %14, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.IP4_HEAD, ptr %138, i32 0, i32 9
  %140 = load i32, ptr %139, align 1, !tbaa !11
  %141 = load ptr, ptr %14, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.IP4_HEAD, ptr %141, i32 0, i32 8
  %143 = load i32, ptr %142, align 1, !tbaa !14
  %144 = call ptr @Ip4Route(ptr noundef %137, i32 noundef %140, i32 noundef %143)
  store ptr %144, ptr %21, align 8, !tbaa !5
  br label %156

145:                                              ; preds = %131
  %146 = load ptr, ptr %12, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %146, i32 0, i32 13
  %148 = load ptr, ptr %147, align 8, !tbaa !37
  %149 = load ptr, ptr %14, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.IP4_HEAD, ptr %149, i32 0, i32 9
  %151 = load i32, ptr %150, align 1, !tbaa !11
  %152 = load ptr, ptr %14, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.IP4_HEAD, ptr %152, i32 0, i32 8
  %154 = load i32, ptr %153, align 1, !tbaa !14
  %155 = call ptr @Ip4Route(ptr noundef %148, i32 noundef %151, i32 noundef %154)
  store ptr %155, ptr %21, align 8, !tbaa !5
  br label %156

156:                                              ; preds = %145, %134
  %157 = load ptr, ptr %21, align 8, !tbaa !5
  %158 = icmp eq ptr %157, null
  br i1 %158, label %159, label %160

159:                                              ; preds = %156
  store i64 -9223372036854775794, ptr %10, align 8
  store i32 1, ptr %32, align 4
  br label %290

160:                                              ; preds = %156
  %161 = load ptr, ptr %21, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.IP4_ROUTE_CACHE_ENTRY, ptr %161, i32 0, i32 4
  %163 = load i32, ptr %162, align 8, !tbaa !38
  store i32 %163, ptr %17, align 4, !tbaa !9
  %164 = load ptr, ptr %21, align 8, !tbaa !5
  call void @Ip4FreeRouteCacheEntry(ptr noundef %164)
  br label %165

165:                                              ; preds = %160, %128
  br label %166

166:                                              ; preds = %165, %124
  br label %167

167:                                              ; preds = %166, %119
  %168 = load ptr, ptr %11, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct._IP4_SERVICE, ptr %168, i32 0, i32 21
  %170 = load i32, ptr %169, align 8, !tbaa !40
  %171 = zext i32 %170 to i64
  %172 = add i64 %171, 20
  %173 = trunc i64 %172 to i32
  store i32 %173, ptr %29, align 4, !tbaa !9
  %174 = load ptr, ptr %13, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.NET_BUF, ptr %174, i32 0, i32 9
  %176 = load i32, ptr %175, align 4, !tbaa !41
  %177 = load i32, ptr %26, align 4, !tbaa !9
  %178 = add i32 %176, %177
  %179 = load i32, ptr %29, align 4, !tbaa !9
  %180 = icmp ugt i32 %178, %179
  br i1 %180, label %181, label %268

181:                                              ; preds = %167
  %182 = load i8, ptr %31, align 1, !tbaa !27
  %183 = icmp ne i8 %182, 0
  br i1 %183, label %184, label %185

184:                                              ; preds = %181
  store i64 -9223372036854775804, ptr %10, align 8
  store i32 1, ptr %32, align 4
  br label %290

185:                                              ; preds = %181
  %186 = load i32, ptr %29, align 4, !tbaa !9
  %187 = load i32, ptr %26, align 4, !tbaa !9
  %188 = sub i32 %186, %187
  %189 = and i32 %188, -8
  store i32 %189, ptr %29, align 4, !tbaa !9
  %190 = load ptr, ptr %13, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.NET_BUF, ptr %190, i32 0, i32 9
  %192 = load i32, ptr %191, align 4, !tbaa !41
  %193 = load i32, ptr %29, align 4, !tbaa !9
  %194 = add i32 %192, %193
  %195 = sub i32 %194, 1
  %196 = load i32, ptr %29, align 4, !tbaa !9
  %197 = udiv i32 %195, %196
  store i32 %197, ptr %30, align 4, !tbaa !9
  %198 = load ptr, ptr %13, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.NET_BUF, ptr %198, i32 0, i32 9
  %200 = load i32, ptr %199, align 4, !tbaa !41
  %201 = load i32, ptr %30, align 4, !tbaa !9
  %202 = sub i32 %201, 1
  %203 = load i32, ptr %29, align 4, !tbaa !9
  %204 = mul i32 %202, %203
  %205 = sub i32 %200, %204
  store i32 %205, ptr %27, align 4, !tbaa !9
  %206 = load i32, ptr %29, align 4, !tbaa !9
  %207 = load i32, ptr %30, align 4, !tbaa !9
  %208 = sub i32 %207, 1
  %209 = mul i32 %206, %208
  store i32 %209, ptr %28, align 4, !tbaa !9
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %210

210:                                              ; preds = %252, %185
  %211 = load i32, ptr %25, align 4, !tbaa !9
  %212 = load i32, ptr %30, align 4, !tbaa !9
  %213 = sub i32 %212, 1
  %214 = icmp ult i32 %211, %213
  br i1 %214, label %215, label %258

215:                                              ; preds = %210
  %216 = load ptr, ptr %13, align 8, !tbaa !5
  %217 = load i32, ptr %28, align 4, !tbaa !9
  %218 = load i32, ptr %27, align 4, !tbaa !9
  %219 = call ptr @NetbufGetFragment(ptr noundef %216, i32 noundef %217, i32 noundef %218, i32 noundef 60)
  store ptr %219, ptr %24, align 8, !tbaa !5
  %220 = load ptr, ptr %24, align 8, !tbaa !5
  %221 = icmp eq ptr %220, null
  br i1 %221, label %222, label %223

222:                                              ; preds = %215
  store i64 -9223372036854775799, ptr %23, align 8, !tbaa !30
  br label %285

223:                                              ; preds = %215
  %224 = load i32, ptr %25, align 4, !tbaa !9
  %225 = icmp ne i32 %224, 0
  %226 = zext i1 %225 to i64
  %227 = select i1 %225, i32 8192, i32 0
  %228 = or i32 0, %227
  %229 = load i32, ptr %28, align 4, !tbaa !9
  %230 = lshr i32 %229, 3
  %231 = and i32 %230, 8191
  %232 = or i32 %228, %231
  %233 = trunc i32 %232 to i16
  %234 = load ptr, ptr %14, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.IP4_HEAD, ptr %234, i32 0, i32 4
  store i16 %233, ptr %235, align 1, !tbaa !43
  %236 = load ptr, ptr %24, align 8, !tbaa !5
  %237 = load ptr, ptr %14, align 8, !tbaa !5
  %238 = load ptr, ptr %15, align 8, !tbaa !5
  %239 = load i32, ptr %16, align 4, !tbaa !9
  %240 = call i64 @Ip4PrependHead(ptr noundef %236, ptr noundef %237, ptr noundef %238, i32 noundef %239)
  %241 = load ptr, ptr %20, align 8, !tbaa !5
  %242 = load ptr, ptr %12, align 8, !tbaa !5
  %243 = load ptr, ptr %24, align 8, !tbaa !5
  %244 = load i32, ptr %17, align 4, !tbaa !9
  %245 = load ptr, ptr %13, align 8, !tbaa !5
  %246 = call i64 @Ip4SendFrame(ptr noundef %241, ptr noundef %242, ptr noundef %243, i32 noundef %244, ptr noundef @Ip4SysPacketSent, ptr noundef %245)
  store i64 %246, ptr %23, align 8, !tbaa !30
  %247 = load i64, ptr %23, align 8, !tbaa !30
  %248 = icmp slt i64 %247, 0
  br i1 %248, label %249, label %250

249:                                              ; preds = %223
  br label %285

250:                                              ; preds = %223
  %251 = load i32, ptr %29, align 4, !tbaa !9
  store i32 %251, ptr %27, align 4, !tbaa !9
  br label %252

252:                                              ; preds = %250
  %253 = load i32, ptr %25, align 4, !tbaa !9
  %254 = add i32 %253, 1
  store i32 %254, ptr %25, align 4, !tbaa !9
  %255 = load i32, ptr %29, align 4, !tbaa !9
  %256 = load i32, ptr %28, align 4, !tbaa !9
  %257 = sub i32 %256, %255
  store i32 %257, ptr %28, align 4, !tbaa !9
  br label %210, !llvm.loop !44

258:                                              ; preds = %210
  %259 = load ptr, ptr %13, align 8, !tbaa !5
  %260 = load ptr, ptr %13, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.NET_BUF, ptr %260, i32 0, i32 9
  %262 = load i32, ptr %261, align 4, !tbaa !41
  %263 = load i32, ptr %29, align 4, !tbaa !9
  %264 = sub i32 %262, %263
  %265 = call i32 @NetbufTrim(ptr noundef %259, i32 noundef %264, i8 noundef zeroext 0)
  %266 = load ptr, ptr %14, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.IP4_HEAD, ptr %266, i32 0, i32 4
  store i16 8192, ptr %267, align 1, !tbaa !43
  br label %268

268:                                              ; preds = %258, %167
  %269 = load ptr, ptr %13, align 8, !tbaa !5
  %270 = load ptr, ptr %14, align 8, !tbaa !5
  %271 = load ptr, ptr %15, align 8, !tbaa !5
  %272 = load i32, ptr %16, align 4, !tbaa !9
  %273 = call i64 @Ip4PrependHead(ptr noundef %269, ptr noundef %270, ptr noundef %271, i32 noundef %272)
  %274 = load ptr, ptr %20, align 8, !tbaa !5
  %275 = load ptr, ptr %12, align 8, !tbaa !5
  %276 = load ptr, ptr %13, align 8, !tbaa !5
  %277 = load i32, ptr %17, align 4, !tbaa !9
  %278 = load ptr, ptr %18, align 8, !tbaa !5
  %279 = load ptr, ptr %19, align 8, !tbaa !5
  %280 = call i64 @Ip4SendFrame(ptr noundef %274, ptr noundef %275, ptr noundef %276, i32 noundef %277, ptr noundef %278, ptr noundef %279)
  store i64 %280, ptr %23, align 8, !tbaa !30
  %281 = load i64, ptr %23, align 8, !tbaa !30
  %282 = icmp slt i64 %281, 0
  br i1 %282, label %283, label %284

283:                                              ; preds = %268
  br label %285

284:                                              ; preds = %268
  store i64 0, ptr %10, align 8
  store i32 1, ptr %32, align 4
  br label %290

285:                                              ; preds = %283, %249, %222
  %286 = load ptr, ptr %20, align 8, !tbaa !5
  %287 = load ptr, ptr %13, align 8, !tbaa !5
  %288 = load i64, ptr %23, align 8, !tbaa !30
  call void @Ip4CancelPacket(ptr noundef %286, ptr noundef %287, i64 noundef %288)
  %289 = load i64, ptr %23, align 8, !tbaa !30
  store i64 %289, ptr %10, align 8
  store i32 1, ptr %32, align 4
  br label %290

290:                                              ; preds = %285, %284, %184, %159, %106, %51
  call void @llvm.lifetime.end.p0(i64 1, ptr %31) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  %291 = load i64, ptr %10, align 8
  ret i64 %291
}

declare i64 @Ip4IpSecProcessPacket(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

declare i64 @Ip4GetNetCast(i32 noundef, ptr noundef) #2

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

declare void @Ip4FreeRouteCacheEntry(ptr noundef) #2

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

declare i64 @Ip4SendFrame(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"", !7, i64 0, !7, i64 0, !7, i64 1, !13, i64 2, !13, i64 4, !13, i64 6, !7, i64 8, !7, i64 9, !13, i64 10, !10, i64 12, !10, i64 16}
!13 = !{!"short", !7, i64 0}
!14 = !{!12, !10, i64 12}
!15 = !{!16, !6, i64 248}
!16 = !{!"_IP4_PROTOCOL", !10, i64 0, !17, i64 8, !6, i64 72, !18, i64 80, !6, i64 88, !19, i64 96, !20, i64 112, !20, i64 152, !19, i64 192, !19, i64 208, !21, i64 224, !6, i64 248, !19, i64 256, !6, i64 272, !6, i64 280, !10, i64 288, !6, i64 296, !10, i64 304, !22, i64 308}
!17 = !{!"_EFI_IP4_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}
!18 = !{!"long long", !7, i64 0}
!19 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!20 = !{!"", !19, i64 0, !19, i64 16, !18, i64 32}
!21 = !{!"", !18, i64 0, !18, i64 8, !10, i64 16}
!22 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !23, i64 6, !23, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !10, i64 20, !10, i64 24}
!23 = !{!"", !7, i64 0}
!24 = !{!25, !10, i64 32}
!25 = !{!"_IP4_INTERFACE", !10, i64 0, !19, i64 8, !18, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !7, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !19, i64 96, !19, i64 112, !6, i64 128, !23, i64 136, !23, i64 168, !10, i64 200, !19, i64 208, !7, i64 224}
!26 = !{!16, !7, i64 325}
!27 = !{!7, !7, i64 0}
!28 = !{!13, !13, i64 0}
!29 = !{!12, !13, i64 4}
!30 = !{!18, !18, i64 0}
!31 = !{!32, !6, i64 80}
!32 = !{!"_IP4_SERVICE", !10, i64 0, !33, i64 8, !18, i64 24, !18, i64 32, !19, i64 40, !19, i64 56, !6, i64 72, !6, i64 80, !23, i64 88, !34, i64 584, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !35, i64 640, !36, i64 660, !6, i64 1320, !6, i64 1328, !6, i64 1336, !6, i64 1344, !6, i64 1352, !10, i64 1360, !10, i64 1364}
!33 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!34 = !{!"", !18, i64 0, !19, i64 8}
!35 = !{!"", !10, i64 0, !10, i64 4, !13, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!36 = !{!"", !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, !7, i64 40, !23, i64 552, !23, i64 584, !23, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!37 = !{!16, !6, i64 272}
!38 = !{!39, !10, i64 32}
!39 = !{!"", !19, i64 0, !18, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !18, i64 40}
!40 = !{!32, !10, i64 1360}
!41 = !{!42, !10, i64 132}
!42 = !{!"", !10, i64 0, !18, i64 8, !19, i64 16, !7, i64 32, !6, i64 40, !6, i64 48, !7, i64 56, !6, i64 120, !10, i64 128, !10, i64 132, !7, i64 136}
!43 = !{!12, !13, i64 6}
!44 = distinct !{!44, !45}
!45 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@mIp4Id = external dso_local local_unnamed_addr global i16, align 2

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @Ip4SelectInterface(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @Ip4Output(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5, i32 noundef %6, ptr noundef %7, ptr noundef %8) local_unnamed_addr #0 {
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store i32 %5, ptr %13, align 4, !tbaa !9
  %14 = icmp eq ptr %1, null
  br i1 %14, label %15, label %21

15:                                               ; preds = %9
  %16 = getelementptr inbounds i8, ptr %3, i64 16
  %17 = load i32, ptr %16, align 1, !tbaa !11
  %18 = getelementptr inbounds i8, ptr %3, i64 12
  %19 = load i32, ptr %18, align 1, !tbaa !14
  %20 = tail call ptr @Ip4SelectInterface(ptr noundef %0, i32 noundef %17, i32 noundef %19)
  br label %24

21:                                               ; preds = %9
  %22 = getelementptr inbounds i8, ptr %1, i64 248
  %23 = load ptr, ptr %22, align 8, !tbaa !15
  br label %24

24:                                               ; preds = %21, %15
  %.071 = phi ptr [ %20, %15 ], [ %23, %21 ]
  %25 = icmp eq ptr %.071, null
  br i1 %25, label %159, label %26

26:                                               ; preds = %24
  %27 = getelementptr inbounds i8, ptr %3, i64 12
  %28 = load i32, ptr %27, align 1, !tbaa !14
  %29 = icmp eq i32 %28, 0
  %or.cond = and i1 %14, %29
  br i1 %or.cond, label %.thread, label %35

.thread:                                          ; preds = %26
  %30 = getelementptr inbounds i8, ptr %.071, i64 32
  %31 = load i32, ptr %30, align 8, !tbaa !24
  store i32 %31, ptr %27, align 1, !tbaa !14
  %32 = add i32 %5, 3
  %33 = and i32 %32, -4
  %34 = add i32 %33, 20
  br label %42

35:                                               ; preds = %26
  %36 = add i32 %5, 3
  %37 = and i32 %36, -4
  %38 = add i32 %37, 20
  br i1 %14, label %42, label %39

39:                                               ; preds = %35
  %40 = getelementptr inbounds i8, ptr %1, i64 325
  %41 = load i8, ptr %40, align 1, !tbaa !26
  %.not82 = icmp eq i8 %41, 0
  br i1 %.not82, label %42, label %57

42:                                               ; preds = %.thread, %39, %35
  %43 = phi i32 [ %34, %.thread ], [ %38, %39 ], [ %38, %35 ]
  %44 = phi i32 [ %33, %.thread ], [ %37, %39 ], [ %37, %35 ]
  %45 = trunc i32 %43 to i8
  %46 = lshr exact i8 %45, 2
  %47 = load i8, ptr %3, align 1
  %48 = and i8 %46, 15
  %49 = and i8 %47, -16
  %50 = or disjoint i8 %49, %48
  store i8 %50, ptr %3, align 1
  %51 = load i16, ptr @mIp4Id, align 2, !tbaa !27
  %52 = add i16 %51, 1
  store i16 %52, ptr @mIp4Id, align 2, !tbaa !27
  %53 = getelementptr inbounds i8, ptr %3, i64 4
  store i16 %51, ptr %53, align 1, !tbaa !28
  %54 = load i8, ptr %3, align 1
  %55 = and i8 %54, 15
  %56 = or disjoint i8 %55, 64
  store i8 %56, ptr %3, align 1
  br label %57

57:                                               ; preds = %39, %42
  %58 = phi i32 [ %43, %42 ], [ %38, %39 ]
  %59 = phi i32 [ %44, %42 ], [ %37, %39 ]
  %.not83 = phi i1 [ true, %42 ], [ false, %39 ]
  %60 = call i64 @Ip4IpSecProcessPacket(ptr noundef %0, ptr noundef nonnull %11, ptr noundef nonnull %10, ptr noundef nonnull %12, ptr noundef nonnull %13, i32 noundef 1, ptr noundef %8) #2
  %61 = icmp slt i64 %60, 0
  br i1 %61, label %159, label %62

62:                                               ; preds = %57
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  %64 = getelementptr inbounds i8, ptr %63, i64 16
  %65 = load i32, ptr %64, align 1, !tbaa !11
  %66 = call i64 @Ip4GetNetCast(i32 noundef %65, ptr noundef nonnull %.071) #2
  %67 = icmp sgt i64 %66, 3
  %68 = icmp eq i32 %65, -1
  %or.cond3 = or i1 %68, %67
  br i1 %or.cond3, label %92, label %69

69:                                               ; preds = %62
  %70 = and i32 %65, -268435456
  %71 = icmp eq i32 %70, -536870912
  br i1 %71, label %72, label %76

72:                                               ; preds = %69
  %73 = load ptr, ptr %11, align 8, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %73, i64 16
  %75 = load i32, ptr %74, align 1, !tbaa !11
  br label %92

76:                                               ; preds = %69
  %77 = icmp eq i32 %6, 0
  br i1 %77, label %78, label %92

78:                                               ; preds = %76
  %79 = load ptr, ptr %11, align 8, !tbaa !5
  %80 = getelementptr inbounds i8, ptr %79, i64 16
  %81 = load i32, ptr %80, align 1, !tbaa !11
  %82 = getelementptr inbounds i8, ptr %79, i64 12
  %83 = load i32, ptr %82, align 1, !tbaa !14
  %84 = getelementptr inbounds i8, ptr %1, i64 272
  %85 = getelementptr inbounds i8, ptr %0, i64 80
  %.sink94 = select i1 %14, ptr %85, ptr %84
  %86 = load ptr, ptr %.sink94, align 8, !tbaa !5
  %87 = call ptr @Ip4Route(ptr noundef %86, i32 noundef %81, i32 noundef %83) #2
  %88 = icmp eq ptr %87, null
  br i1 %88, label %159, label %89

89:                                               ; preds = %78
  %90 = getelementptr inbounds i8, ptr %87, i64 32
  %91 = load i32, ptr %90, align 8, !tbaa !29
  call void @Ip4FreeRouteCacheEntry(ptr noundef nonnull %87) #2
  br label %92

92:                                               ; preds = %62, %72, %89, %76
  %.069 = phi i32 [ %75, %72 ], [ %91, %89 ], [ %6, %76 ], [ -1, %62 ]
  %93 = getelementptr inbounds i8, ptr %0, i64 1360
  %94 = load i32, ptr %93, align 8, !tbaa !31
  %95 = add i32 %94, 20
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = getelementptr inbounds i8, ptr %96, i64 132
  %98 = load i32, ptr %97, align 4, !tbaa !37
  %99 = add i32 %98, %58
  %100 = icmp ugt i32 %99, %95
  br i1 %100, label %101, label %._crit_edge91

._crit_edge91:                                    ; preds = %92
  %.pre92 = load ptr, ptr %11, align 8, !tbaa !5
  br label %149

101:                                              ; preds = %92
  br i1 %.not83, label %102, label %159

102:                                              ; preds = %101
  %103 = sub i32 %94, %59
  %104 = and i32 %103, -8
  %105 = add i32 %104, -1
  %106 = add i32 %105, %98
  %107 = udiv i32 %106, %104
  %108 = add i32 %107, -1
  %109 = mul i32 %108, %104
  %.not = icmp eq i32 %108, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %102
  %110 = sub i32 %98, %109
  %111 = call ptr @NetbufGetFragment(ptr noundef nonnull %96, i32 noundef %109, i32 noundef %110, i32 noundef 60) #2
  %112 = icmp eq ptr %111, null
  br i1 %112, label %.loopexit, label %113

113:                                              ; preds = %.lr.ph.preheader
  %114 = trunc i32 %109 to i16
  %115 = lshr exact i16 %114, 3
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  %117 = getelementptr inbounds i8, ptr %116, i64 6
  store i16 %115, ptr %117, align 1, !tbaa !39
  %118 = load ptr, ptr %12, align 8, !tbaa !5
  %119 = load i32, ptr %13, align 4, !tbaa !9
  %120 = call i64 @Ip4PrependHead(ptr noundef nonnull %111, ptr noundef %116, ptr noundef %118, i32 noundef %119)
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = call i64 @Ip4SendFrame(ptr noundef nonnull %.071, ptr noundef %1, ptr noundef nonnull %111, i32 noundef %.069, ptr noundef nonnull @Ip4SysPacketSent, ptr noundef %121) #2
  %123 = icmp slt i64 %122, 0
  br i1 %123, label %.loopexit, label %124

124:                                              ; preds = %113
  %.not93 = icmp eq i32 %108, 1
  br i1 %.not93, label %._crit_edge.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %124, %140
  %.06787.pn = phi i32 [ %.06787, %140 ], [ %109, %124 ]
  %.07085 = phi i32 [ %141, %140 ], [ 1, %124 ]
  %.06787 = sub i32 %.06787.pn, %104
  %125 = load ptr, ptr %10, align 8, !tbaa !5
  %126 = call ptr @NetbufGetFragment(ptr noundef %125, i32 noundef %.06787, i32 noundef %104, i32 noundef 60) #2
  %127 = icmp eq ptr %126, null
  br i1 %127, label %.loopexit, label %128

128:                                              ; preds = %.lr.ph
  %129 = trunc i32 %.06787 to i16
  %130 = lshr exact i16 %129, 3
  %131 = or disjoint i16 %130, 8192
  %132 = load ptr, ptr %11, align 8, !tbaa !5
  %133 = getelementptr inbounds i8, ptr %132, i64 6
  store i16 %131, ptr %133, align 1, !tbaa !39
  %134 = load ptr, ptr %12, align 8, !tbaa !5
  %135 = load i32, ptr %13, align 4, !tbaa !9
  %136 = call i64 @Ip4PrependHead(ptr noundef nonnull %126, ptr noundef %132, ptr noundef %134, i32 noundef %135)
  %137 = load ptr, ptr %10, align 8, !tbaa !5
  %138 = call i64 @Ip4SendFrame(ptr noundef nonnull %.071, ptr noundef %1, ptr noundef nonnull %126, i32 noundef %.069, ptr noundef nonnull @Ip4SysPacketSent, ptr noundef %137) #2
  %139 = icmp slt i64 %138, 0
  br i1 %139, label %.loopexit, label %140

140:                                              ; preds = %128
  %141 = add nuw i32 %.07085, 1
  %142 = icmp ult i32 %141, %108
  br i1 %142, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !40

._crit_edge.loopexit:                             ; preds = %140, %124
  %.pre = load ptr, ptr %10, align 8, !tbaa !5
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.pre, i64 132
  %.pre89 = load i32, ptr %.phi.trans.insert, align 4, !tbaa !37
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %102
  %143 = phi i32 [ %.pre89, %._crit_edge.loopexit ], [ %98, %102 ]
  %144 = phi ptr [ %.pre, %._crit_edge.loopexit ], [ %96, %102 ]
  %145 = sub i32 %143, %104
  %146 = call i32 @NetbufTrim(ptr noundef nonnull %144, i32 noundef %145, i8 noundef zeroext 0) #2
  %147 = load ptr, ptr %11, align 8, !tbaa !5
  %148 = getelementptr inbounds i8, ptr %147, i64 6
  store i16 8192, ptr %148, align 1, !tbaa !39
  %.pre90 = load ptr, ptr %10, align 8, !tbaa !5
  br label %149

149:                                              ; preds = %._crit_edge91, %._crit_edge
  %150 = phi ptr [ %147, %._crit_edge ], [ %.pre92, %._crit_edge91 ]
  %151 = phi ptr [ %.pre90, %._crit_edge ], [ %96, %._crit_edge91 ]
  %152 = load ptr, ptr %12, align 8, !tbaa !5
  %153 = load i32, ptr %13, align 4, !tbaa !9
  %154 = call i64 @Ip4PrependHead(ptr noundef %151, ptr noundef %150, ptr noundef %152, i32 noundef %153)
  %155 = load ptr, ptr %10, align 8, !tbaa !5
  %156 = call i64 @Ip4SendFrame(ptr noundef nonnull %.071, ptr noundef %1, ptr noundef %155, i32 noundef %.069, ptr noundef %7, ptr noundef %8) #2
  %157 = icmp slt i64 %156, 0
  br i1 %157, label %.loopexit, label %159

.loopexit:                                        ; preds = %.lr.ph, %128, %.lr.ph.preheader, %113, %149
  %.072 = phi i64 [ %156, %149 ], [ -9223372036854775799, %.lr.ph.preheader ], [ %122, %113 ], [ %138, %128 ], [ -9223372036854775799, %.lr.ph ]
  %158 = load ptr, ptr %10, align 8, !tbaa !5
  call void @Ip4CancelPacket(ptr noundef nonnull %.071, ptr noundef %158, i64 noundef %.072)
  br label %159

159:                                              ; preds = %149, %101, %78, %57, %24, %.loopexit
  %.066 = phi i64 [ %.072, %.loopexit ], [ -9223372036854775791, %24 ], [ %60, %57 ], [ -9223372036854775794, %78 ], [ -9223372036854775804, %101 ], [ 0, %149 ]
  ret i64 %.066
}

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

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

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

declare void @Ip4FreeRouteCacheEntry(ptr noundef) local_unnamed_addr #1

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

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"", !7, i64 0, !7, i64 0, !7, i64 1, !13, i64 2, !13, i64 4, !13, i64 6, !7, i64 8, !7, i64 9, !13, i64 10, !10, i64 12, !10, i64 16}
!13 = !{!"short", !7, i64 0}
!14 = !{!12, !10, i64 12}
!15 = !{!16, !6, i64 248}
!16 = !{!"_IP4_PROTOCOL", !10, i64 0, !17, i64 8, !6, i64 72, !18, i64 80, !6, i64 88, !19, i64 96, !20, i64 112, !20, i64 152, !19, i64 192, !19, i64 208, !21, i64 224, !6, i64 248, !19, i64 256, !6, i64 272, !6, i64 280, !10, i64 288, !6, i64 296, !10, i64 304, !22, i64 308}
!17 = !{!"_EFI_IP4_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}
!18 = !{!"long long", !7, i64 0}
!19 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!20 = !{!"", !19, i64 0, !19, i64 16, !18, i64 32}
!21 = !{!"", !18, i64 0, !18, i64 8, !10, i64 16}
!22 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !23, i64 6, !23, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !10, i64 20, !10, i64 24}
!23 = !{!"", !7, i64 0}
!24 = !{!25, !10, i64 32}
!25 = !{!"_IP4_INTERFACE", !10, i64 0, !19, i64 8, !18, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !7, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !19, i64 96, !19, i64 112, !6, i64 128, !23, i64 136, !23, i64 168, !10, i64 200, !19, i64 208, !7, i64 224}
!26 = !{!16, !7, i64 325}
!27 = !{!13, !13, i64 0}
!28 = !{!12, !13, i64 4}
!29 = !{!30, !10, i64 32}
!30 = !{!"", !19, i64 0, !18, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !18, i64 40}
!31 = !{!32, !10, i64 1360}
!32 = !{!"_IP4_SERVICE", !10, i64 0, !33, i64 8, !18, i64 24, !18, i64 32, !19, i64 40, !19, i64 56, !6, i64 72, !6, i64 80, !23, i64 88, !34, i64 584, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !35, i64 640, !36, i64 660, !6, i64 1320, !6, i64 1328, !6, i64 1336, !6, i64 1344, !6, i64 1352, !10, i64 1360, !10, i64 1364}
!33 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!34 = !{!"", !18, i64 0, !19, i64 8}
!35 = !{!"", !10, i64 0, !10, i64 4, !13, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!36 = !{!"", !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, !7, i64 40, !23, i64 552, !23, i64 584, !23, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!37 = !{!38, !10, i64 132}
!38 = !{!"", !10, i64 0, !18, i64 8, !19, i64 16, !7, i64 32, !6, i64 40, !6, i64 48, !7, i64 56, !6, i64 120, !10, i64 128, !10, i64 132, !7, i64 136}
!39 = !{!12, !13, i64 6}
!40 = distinct !{!40, !41, !42}
!41 = !{!"llvm.loop.mustprogress"}
!42 = !{!"llvm.loop.peeled.count", i32 1}


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