; LLVM IR from whoiswelliton/Computer_Engineering_UTFPR-PB :: Embedded_Systems/TIVA Connected TM4C1294XL Projects/01 - lwIP_HTTPServer_on_TIVA (reass)

; 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.pbuf = type { ptr, ptr, i16, i16, i8, i8, i8, i8 }
%struct.ip_hdr = type { i8, i8, i16, i16, i16, i8, i8, i16, %struct.ip4_addr_packed, %struct.ip4_addr_packed }
%struct.ip4_addr_packed = type { i32 }
%struct.ip_reassdata = type { ptr, ptr, %struct.ip_hdr, i16, i8, i8 }
%struct.ip_reass_helper = type <{ ptr, i16, i16 }>

@reassdatagrams = external hidden global ptr, align 8
@ip_reass_pbufcount = external hidden global i16, align 2
@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [188 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [32 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @ip4_reass(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i16, align 2
  %9 = alloca i16, align 2
  %10 = alloca i16, align 2
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i16, align 2
  %15 = alloca i32, align 4
  %16 = alloca i16, align 2
  %17 = alloca ptr, align 8
  %18 = alloca i16, align 2
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  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 2, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 1, 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
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.pbuf, ptr %19, i32 0, i32 1
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  store ptr %21, ptr %5, align 8, !tbaa !5
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.ip_hdr, ptr %22, i32 0, i32 0
  %24 = load i8, ptr %23, align 1, !tbaa !12
  %25 = zext i8 %24 to i32
  %26 = and i32 %25, 15
  %27 = mul nsw i32 %26, 4
  %28 = trunc i32 %27 to i8
  %29 = zext i8 %28 to i32
  %30 = icmp ne i32 %29, 20
  br i1 %30, label %31, label %32

31:                                               ; preds = %1
  br label %363

32:                                               ; preds = %1
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ip_hdr, ptr %33, i32 0, i32 4
  %35 = load i16, ptr %34, align 1, !tbaa !16
  %36 = call zeroext i16 @lwip_htons(i16 noundef zeroext %35)
  %37 = zext i16 %36 to i32
  %38 = and i32 %37, 8191
  %39 = mul i32 %38, 8
  %40 = trunc i32 %39 to i16
  store i16 %40, ptr %8, align 2, !tbaa !17
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.ip_hdr, ptr %41, i32 0, i32 2
  %43 = load i16, ptr %42, align 1, !tbaa !18
  %44 = call zeroext i16 @lwip_htons(i16 noundef zeroext %43)
  store i16 %44, ptr %9, align 2, !tbaa !17
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ip_hdr, ptr %45, i32 0, i32 0
  %47 = load i8, ptr %46, align 1, !tbaa !12
  %48 = zext i8 %47 to i32
  %49 = and i32 %48, 15
  %50 = mul nsw i32 %49, 4
  %51 = trunc i32 %50 to i8
  store i8 %51, ptr %11, align 1, !tbaa !19
  %52 = load i8, ptr %11, align 1, !tbaa !19
  %53 = zext i8 %52 to i32
  %54 = load i16, ptr %9, align 2, !tbaa !17
  %55 = zext i16 %54 to i32
  %56 = icmp sgt i32 %53, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %32
  br label %363

58:                                               ; preds = %32
  %59 = load i16, ptr %9, align 2, !tbaa !17
  %60 = zext i16 %59 to i32
  %61 = load i8, ptr %11, align 1, !tbaa !19
  %62 = zext i8 %61 to i32
  %63 = sub nsw i32 %60, %62
  %64 = trunc i32 %63 to i16
  store i16 %64, ptr %9, align 2, !tbaa !17
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = call zeroext i16 @pbuf_clen(ptr noundef %65)
  store i16 %66, ptr %10, align 2, !tbaa !17
  %67 = load i16, ptr @ip_reass_pbufcount, align 2, !tbaa !17
  %68 = zext i16 %67 to i32
  %69 = load i16, ptr %10, align 2, !tbaa !17
  %70 = zext i16 %69 to i32
  %71 = add nsw i32 %68, %70
  %72 = icmp sgt i32 %71, 10
  br i1 %72, label %73, label %88

73:                                               ; preds = %58
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = load i16, ptr %10, align 2, !tbaa !17
  %76 = zext i16 %75 to i32
  %77 = call i32 @ip_reass_remove_oldest_datagram(ptr noundef %74, i32 noundef %76)
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %86

79:                                               ; preds = %73
  %80 = load i16, ptr @ip_reass_pbufcount, align 2, !tbaa !17
  %81 = zext i16 %80 to i32
  %82 = load i16, ptr %10, align 2, !tbaa !17
  %83 = zext i16 %82 to i32
  %84 = add nsw i32 %81, %83
  %85 = icmp sgt i32 %84, 10
  br i1 %85, label %86, label %87

86:                                               ; preds = %79, %73
  br label %363

87:                                               ; preds = %79
  br label %88

88:                                               ; preds = %87, %58
  %89 = load ptr, ptr @reassdatagrams, align 8, !tbaa !5
  store ptr %89, ptr %6, align 8, !tbaa !5
  br label %90

90:                                               ; preds = %130, %88
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = icmp ne ptr %91, null
  br i1 %92, label %93, label %134

93:                                               ; preds = %90
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.ip_reassdata, ptr %94, i32 0, i32 2
  %96 = getelementptr inbounds %struct.ip_hdr, ptr %95, i32 0, i32 8
  %97 = getelementptr inbounds %struct.ip4_addr_packed, ptr %96, i32 0, i32 0
  %98 = load i32, ptr %97, align 4, !tbaa !20
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.ip_hdr, ptr %99, i32 0, i32 8
  %101 = getelementptr inbounds %struct.ip4_addr_packed, ptr %100, i32 0, i32 0
  %102 = load i32, ptr %101, align 1, !tbaa !22
  %103 = icmp eq i32 %98, %102
  br i1 %103, label %104, label %127

104:                                              ; preds = %93
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.ip_reassdata, ptr %105, i32 0, i32 2
  %107 = getelementptr inbounds %struct.ip_hdr, ptr %106, i32 0, i32 9
  %108 = getelementptr inbounds %struct.ip4_addr_packed, ptr %107, i32 0, i32 0
  %109 = load i32, ptr %108, align 8, !tbaa !23
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.ip_hdr, ptr %110, i32 0, i32 9
  %112 = getelementptr inbounds %struct.ip4_addr_packed, ptr %111, i32 0, i32 0
  %113 = load i32, ptr %112, align 1, !tbaa !24
  %114 = icmp eq i32 %109, %113
  br i1 %114, label %115, label %127

115:                                              ; preds = %104
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.ip_reassdata, ptr %116, i32 0, i32 2
  %118 = getelementptr inbounds %struct.ip_hdr, ptr %117, i32 0, i32 3
  %119 = load i16, ptr %118, align 4, !tbaa !25
  %120 = zext i16 %119 to i32
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.ip_hdr, ptr %121, i32 0, i32 3
  %123 = load i16, ptr %122, align 1, !tbaa !26
  %124 = zext i16 %123 to i32
  %125 = icmp eq i32 %120, %124
  br i1 %125, label %126, label %127

126:                                              ; preds = %115
  br i1 true, label %128, label %129

127:                                              ; preds = %115, %104, %93
  br i1 false, label %128, label %129

128:                                              ; preds = %127, %126
  br label %134

129:                                              ; preds = %127, %126
  br label %130

130:                                              ; preds = %129
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.ip_reassdata, ptr %131, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8, !tbaa !27
  store ptr %133, ptr %6, align 8, !tbaa !5
  br label %90, !llvm.loop !28

134:                                              ; preds = %128, %90
  %135 = load ptr, ptr %6, align 8, !tbaa !5
  %136 = icmp eq ptr %135, null
  br i1 %136, label %137, label %146

137:                                              ; preds = %134
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = load i16, ptr %10, align 2, !tbaa !17
  %140 = zext i16 %139 to i32
  %141 = call ptr @ip_reass_enqueue_new_datagram(ptr noundef %138, i32 noundef %140)
  store ptr %141, ptr %6, align 8, !tbaa !5
  %142 = load ptr, ptr %6, align 8, !tbaa !5
  %143 = icmp eq ptr %142, null
  br i1 %143, label %144, label %145

144:                                              ; preds = %137
  br label %363

145:                                              ; preds = %137
  br label %168

146:                                              ; preds = %134
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.ip_hdr, ptr %147, i32 0, i32 4
  %149 = load i16, ptr %148, align 1, !tbaa !16
  %150 = call zeroext i16 @lwip_htons(i16 noundef zeroext %149)
  %151 = zext i16 %150 to i32
  %152 = and i32 %151, 8191
  %153 = icmp eq i32 %152, 0
  br i1 %153, label %154, label %167

154:                                              ; preds = %146
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.ip_reassdata, ptr %155, i32 0, i32 2
  %157 = getelementptr inbounds %struct.ip_hdr, ptr %156, i32 0, i32 4
  %158 = load i16, ptr %157, align 2, !tbaa !30
  %159 = call zeroext i16 @lwip_htons(i16 noundef zeroext %158)
  %160 = zext i16 %159 to i32
  %161 = and i32 %160, 8191
  %162 = icmp ne i32 %161, 0
  br i1 %162, label %163, label %167

163:                                              ; preds = %154
  %164 = load ptr, ptr %6, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.ip_reassdata, ptr %164, i32 0, i32 2
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %165, ptr align 1 %166, i64 20, i1 false)
  br label %167

167:                                              ; preds = %163, %154, %146
  br label %168

168:                                              ; preds = %167, %145
  %169 = load ptr, ptr %5, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.ip_hdr, ptr %169, i32 0, i32 4
  %171 = load i16, ptr %170, align 1, !tbaa !16
  %172 = zext i16 %171 to i32
  %173 = and i32 %172, 32
  %174 = icmp eq i32 %173, 0
  %175 = zext i1 %174 to i32
  store i32 %175, ptr %13, align 4, !tbaa !31
  %176 = load i32, ptr %13, align 4, !tbaa !31
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %178, label %199

178:                                              ; preds = %168
  call void @llvm.lifetime.start.p0(i64 2, ptr %14) #4
  %179 = load i16, ptr %8, align 2, !tbaa !17
  %180 = zext i16 %179 to i32
  %181 = load i16, ptr %9, align 2, !tbaa !17
  %182 = zext i16 %181 to i32
  %183 = add nsw i32 %180, %182
  %184 = trunc i32 %183 to i16
  store i16 %184, ptr %14, align 2, !tbaa !17
  %185 = load i16, ptr %14, align 2, !tbaa !17
  %186 = zext i16 %185 to i32
  %187 = load i16, ptr %8, align 2, !tbaa !17
  %188 = zext i16 %187 to i32
  %189 = icmp slt i32 %186, %188
  br i1 %189, label %194, label %190

190:                                              ; preds = %178
  %191 = load i16, ptr %14, align 2, !tbaa !17
  %192 = zext i16 %191 to i32
  %193 = icmp sgt i32 %192, 65515
  br i1 %193, label %194, label %195

194:                                              ; preds = %190, %178
  store i32 6, ptr %15, align 4
  br label %196

195:                                              ; preds = %190
  store i32 0, ptr %15, align 4
  br label %196

196:                                              ; preds = %195, %194
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #4
  %197 = load i32, ptr %15, align 4
  switch i32 %197, label %366 [
    i32 0, label %198
    i32 6, label %332
  ]

198:                                              ; preds = %196
  br label %199

199:                                              ; preds = %198, %168
  %200 = load ptr, ptr %6, align 8, !tbaa !5
  %201 = load ptr, ptr %3, align 8, !tbaa !5
  %202 = load i32, ptr %13, align 4, !tbaa !31
  %203 = call i32 @ip_reass_chain_frag_into_datagram_and_validate(ptr noundef %200, ptr noundef %201, i32 noundef %202)
  store i32 %203, ptr %12, align 4, !tbaa !31
  %204 = load i32, ptr %12, align 4, !tbaa !31
  %205 = icmp eq i32 %204, -1
  br i1 %205, label %206, label %207

206:                                              ; preds = %199
  br label %332

207:                                              ; preds = %199
  %208 = load i16, ptr @ip_reass_pbufcount, align 2, !tbaa !17
  %209 = zext i16 %208 to i32
  %210 = load i16, ptr %10, align 2, !tbaa !17
  %211 = zext i16 %210 to i32
  %212 = add nsw i32 %209, %211
  %213 = trunc i32 %212 to i16
  store i16 %213, ptr @ip_reass_pbufcount, align 2, !tbaa !17
  %214 = load i32, ptr %13, align 4, !tbaa !31
  %215 = icmp ne i32 %214, 0
  br i1 %215, label %216, label %232

216:                                              ; preds = %207
  call void @llvm.lifetime.start.p0(i64 2, ptr %16) #4
  %217 = load i16, ptr %8, align 2, !tbaa !17
  %218 = zext i16 %217 to i32
  %219 = load i16, ptr %9, align 2, !tbaa !17
  %220 = zext i16 %219 to i32
  %221 = add nsw i32 %218, %220
  %222 = trunc i32 %221 to i16
  store i16 %222, ptr %16, align 2, !tbaa !17
  %223 = load i16, ptr %16, align 2, !tbaa !17
  %224 = load ptr, ptr %6, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.ip_reassdata, ptr %224, i32 0, i32 3
  store i16 %223, ptr %225, align 4, !tbaa !32
  %226 = load ptr, ptr %6, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.ip_reassdata, ptr %226, i32 0, i32 4
  %228 = load i8, ptr %227, align 2, !tbaa !33
  %229 = zext i8 %228 to i32
  %230 = or i32 %229, 1
  %231 = trunc i32 %230 to i8
  store i8 %231, ptr %227, align 2, !tbaa !33
  call void @llvm.lifetime.end.p0(i64 2, ptr %16) #4
  br label %232

232:                                              ; preds = %216, %207
  %233 = load i32, ptr %12, align 4, !tbaa !31
  %234 = icmp eq i32 %233, 1
  br i1 %234, label %235, label %331

235:                                              ; preds = %232
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #4
  %236 = load ptr, ptr %6, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.ip_reassdata, ptr %236, i32 0, i32 3
  %238 = load i16, ptr %237, align 4, !tbaa !32
  %239 = zext i16 %238 to i32
  %240 = add nsw i32 %239, 20
  %241 = trunc i32 %240 to i16
  store i16 %241, ptr %18, align 2, !tbaa !17
  %242 = load ptr, ptr %6, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.ip_reassdata, ptr %242, i32 0, i32 1
  %244 = load ptr, ptr %243, align 8, !tbaa !34
  %245 = getelementptr inbounds %struct.pbuf, ptr %244, i32 0, i32 1
  %246 = load ptr, ptr %245, align 8, !tbaa !9
  %247 = getelementptr inbounds %struct.ip_reass_helper, ptr %246, i32 0, i32 0
  %248 = load ptr, ptr %247, align 1, !tbaa !35
  store ptr %248, ptr %4, align 8, !tbaa !5
  %249 = load ptr, ptr %6, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.ip_reassdata, ptr %249, i32 0, i32 1
  %251 = load ptr, ptr %250, align 8, !tbaa !34
  %252 = getelementptr inbounds %struct.pbuf, ptr %251, i32 0, i32 1
  %253 = load ptr, ptr %252, align 8, !tbaa !9
  store ptr %253, ptr %5, align 8, !tbaa !5
  %254 = load ptr, ptr %5, align 8, !tbaa !5
  %255 = load ptr, ptr %6, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.ip_reassdata, ptr %255, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %254, ptr align 8 %256, i64 20, i1 false)
  %257 = load i16, ptr %18, align 2, !tbaa !17
  %258 = call zeroext i16 @lwip_htons(i16 noundef zeroext %257)
  %259 = load ptr, ptr %5, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.ip_hdr, ptr %259, i32 0, i32 2
  store i16 %258, ptr %260, align 1, !tbaa !18
  %261 = load ptr, ptr %5, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.ip_hdr, ptr %261, i32 0, i32 4
  store i16 0, ptr %262, align 1, !tbaa !16
  %263 = load ptr, ptr %5, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.ip_hdr, ptr %263, i32 0, i32 7
  store i16 0, ptr %264, align 1, !tbaa !37
  %265 = load ptr, ptr %6, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.ip_reassdata, ptr %265, i32 0, i32 1
  %267 = load ptr, ptr %266, align 8, !tbaa !34
  store ptr %267, ptr %3, align 8, !tbaa !5
  br label %268

268:                                              ; preds = %271, %235
  %269 = load ptr, ptr %4, align 8, !tbaa !5
  %270 = icmp ne ptr %269, null
  br i1 %270, label %271, label %282

271:                                              ; preds = %268
  %272 = load ptr, ptr %4, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.pbuf, ptr %272, i32 0, i32 1
  %274 = load ptr, ptr %273, align 8, !tbaa !9
  store ptr %274, ptr %7, align 8, !tbaa !5
  %275 = load ptr, ptr %4, align 8, !tbaa !5
  %276 = call zeroext i8 @pbuf_remove_header(ptr noundef %275, i64 noundef 20)
  %277 = load ptr, ptr %3, align 8, !tbaa !5
  %278 = load ptr, ptr %4, align 8, !tbaa !5
  call void @pbuf_cat(ptr noundef %277, ptr noundef %278)
  %279 = load ptr, ptr %7, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct.ip_reass_helper, ptr %279, i32 0, i32 0
  %281 = load ptr, ptr %280, align 1, !tbaa !35
  store ptr %281, ptr %4, align 8, !tbaa !5
  br label %268, !llvm.loop !38

282:                                              ; preds = %268
  %283 = load ptr, ptr %6, align 8, !tbaa !5
  %284 = load ptr, ptr @reassdatagrams, align 8, !tbaa !5
  %285 = icmp eq ptr %283, %284
  br i1 %285, label %286, label %287

286:                                              ; preds = %282
  store ptr null, ptr %17, align 8, !tbaa !5
  br label %305

287:                                              ; preds = %282
  %288 = load ptr, ptr @reassdatagrams, align 8, !tbaa !5
  store ptr %288, ptr %17, align 8, !tbaa !5
  br label %289

289:                                              ; preds = %300, %287
  %290 = load ptr, ptr %17, align 8, !tbaa !5
  %291 = icmp ne ptr %290, null
  br i1 %291, label %292, label %304

292:                                              ; preds = %289
  %293 = load ptr, ptr %17, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct.ip_reassdata, ptr %293, i32 0, i32 0
  %295 = load ptr, ptr %294, align 8, !tbaa !27
  %296 = load ptr, ptr %6, align 8, !tbaa !5
  %297 = icmp eq ptr %295, %296
  br i1 %297, label %298, label %299

298:                                              ; preds = %292
  br label %304

299:                                              ; preds = %292
  br label %300

300:                                              ; preds = %299
  %301 = load ptr, ptr %17, align 8, !tbaa !5
  %302 = getelementptr inbounds %struct.ip_reassdata, ptr %301, i32 0, i32 0
  %303 = load ptr, ptr %302, align 8, !tbaa !27
  store ptr %303, ptr %17, align 8, !tbaa !5
  br label %289, !llvm.loop !39

304:                                              ; preds = %298, %289
  br label %305

305:                                              ; preds = %304, %286
  %306 = load ptr, ptr %6, align 8, !tbaa !5
  %307 = load ptr, ptr %17, align 8, !tbaa !5
  call void @ip_reass_dequeue_datagram(ptr noundef %306, ptr noundef %307)
  %308 = load ptr, ptr %3, align 8, !tbaa !5
  %309 = call zeroext i16 @pbuf_clen(ptr noundef %308)
  store i16 %309, ptr %10, align 2, !tbaa !17
  br label %310

310:                                              ; preds = %305
  %311 = load i16, ptr @ip_reass_pbufcount, align 2, !tbaa !17
  %312 = zext i16 %311 to i32
  %313 = load i16, ptr %10, align 2, !tbaa !17
  %314 = zext i16 %313 to i32
  %315 = icmp sge i32 %312, %314
  br i1 %315, label %321, label %316

316:                                              ; preds = %310
  br label %317

317:                                              ; preds = %316
  %318 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 667, ptr noundef @.str.2)
  br label %319

319:                                              ; preds = %317
  br label %320

320:                                              ; preds = %319
  br label %321

321:                                              ; preds = %320, %310
  br label %322

322:                                              ; preds = %321
  br label %323

323:                                              ; preds = %322
  %324 = load i16, ptr @ip_reass_pbufcount, align 2, !tbaa !17
  %325 = zext i16 %324 to i32
  %326 = load i16, ptr %10, align 2, !tbaa !17
  %327 = zext i16 %326 to i32
  %328 = sub nsw i32 %325, %327
  %329 = trunc i32 %328 to i16
  store i16 %329, ptr @ip_reass_pbufcount, align 2, !tbaa !17
  %330 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %330, ptr %2, align 8
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %366

331:                                              ; preds = %232
  store ptr null, ptr %2, align 8
  store i32 1, ptr %15, align 4
  br label %366

332:                                              ; preds = %206, %196
  br label %333

333:                                              ; preds = %332
  %334 = load ptr, ptr %6, align 8, !tbaa !5
  %335 = icmp ne ptr %334, null
  br i1 %335, label %341, label %336

336:                                              ; preds = %333
  br label %337

337:                                              ; preds = %336
  %338 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.3, i32 noundef 680, ptr noundef @.str.2)
  br label %339

339:                                              ; preds = %337
  br label %340

340:                                              ; preds = %339
  br label %341

341:                                              ; preds = %340, %333
  br label %342

342:                                              ; preds = %341
  br label %343

343:                                              ; preds = %342
  %344 = load ptr, ptr %6, align 8, !tbaa !5
  %345 = getelementptr inbounds %struct.ip_reassdata, ptr %344, i32 0, i32 1
  %346 = load ptr, ptr %345, align 8, !tbaa !34
  %347 = icmp eq ptr %346, null
  br i1 %347, label %348, label %362

348:                                              ; preds = %343
  br label %349

349:                                              ; preds = %348
  %350 = load ptr, ptr %6, align 8, !tbaa !5
  %351 = load ptr, ptr @reassdatagrams, align 8, !tbaa !5
  %352 = icmp eq ptr %350, %351
  br i1 %352, label %358, label %353

353:                                              ; preds = %349
  br label %354

354:                                              ; preds = %353
  %355 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.4, i32 noundef 683, ptr noundef @.str.2)
  br label %356

356:                                              ; preds = %354
  br label %357

357:                                              ; preds = %356
  br label %358

358:                                              ; preds = %357, %349
  br label %359

359:                                              ; preds = %358
  br label %360

360:                                              ; preds = %359
  %361 = load ptr, ptr %6, align 8, !tbaa !5
  call void @ip_reass_dequeue_datagram(ptr noundef %361, ptr noundef null)
  br label %362

362:                                              ; preds = %360, %343
  br label %363

363:                                              ; preds = %362, %144, %86, %57, %31
  %364 = load ptr, ptr %3, align 8, !tbaa !5
  %365 = call zeroext i8 @pbuf_free(ptr noundef %364)
  store ptr null, ptr %2, align 8
  store i32 1, ptr %15, align 4
  br label %366

366:                                              ; preds = %363, %331, %323, %196
  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 1, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 2, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  %367 = load ptr, ptr %2, align 8
  ret ptr %367
}

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

declare zeroext i16 @pbuf_clen(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @ip_reass_remove_oldest_datagram(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden ptr @ip_reass_enqueue_new_datagram(ptr noundef, i32 noundef) #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

; Function Attrs: nounwind uwtable
declare hidden i32 @ip_reass_chain_frag_into_datagram_and_validate(ptr noundef, ptr noundef, i32 noundef) #1

declare zeroext i8 @pbuf_remove_header(ptr noundef, i64 noundef) #2

declare void @pbuf_cat(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @ip_reass_dequeue_datagram(ptr noundef, ptr noundef) #1

declare i32 @printf(ptr noundef, ...) #2

declare zeroext i8 @pbuf_free(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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, !6, i64 8}
!10 = !{!"pbuf", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 18, !7, i64 20, !7, i64 21, !7, i64 22, !7, i64 23}
!11 = !{!"short", !7, i64 0}
!12 = !{!13, !7, i64 0}
!13 = !{!"ip_hdr", !7, i64 0, !7, i64 1, !11, i64 2, !11, i64 4, !11, i64 6, !7, i64 8, !7, i64 9, !11, i64 10, !14, i64 12, !14, i64 16}
!14 = !{!"ip4_addr_packed", !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!13, !11, i64 6}
!17 = !{!11, !11, i64 0}
!18 = !{!13, !11, i64 2}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !15, i64 28}
!21 = !{!"ip_reassdata", !6, i64 0, !6, i64 8, !13, i64 16, !11, i64 36, !7, i64 38, !7, i64 39}
!22 = !{!13, !15, i64 12}
!23 = !{!21, !15, i64 32}
!24 = !{!13, !15, i64 16}
!25 = !{!21, !11, i64 20}
!26 = !{!13, !11, i64 4}
!27 = !{!21, !6, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!21, !11, i64 22}
!31 = !{!15, !15, i64 0}
!32 = !{!21, !11, i64 36}
!33 = !{!21, !7, i64 38}
!34 = !{!21, !6, i64 8}
!35 = !{!36, !6, i64 0}
!36 = !{!"ip_reass_helper", !6, i64 0, !11, i64 8, !11, i64 10}
!37 = !{!13, !11, i64 10}
!38 = distinct !{!38, !29}
!39 = distinct !{!39, !29}


; 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"

@reassdatagrams = external hidden local_unnamed_addr global ptr, align 8
@ip_reass_pbufcount = external hidden local_unnamed_addr global i16, align 2
@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [188 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @ip4_reass(ptr noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = load i8, ptr %3, align 1, !tbaa !11
  %5 = and i8 %4, 15
  %.not = icmp eq i8 %5, 5
  br i1 %.not, label %6, label %132

6:                                                ; preds = %1
  %7 = getelementptr inbounds i8, ptr %3, i64 6
  %8 = load i16, ptr %7, align 1, !tbaa !15
  %9 = tail call zeroext i16 @lwip_htons(i16 noundef zeroext %8) #4
  %10 = shl i16 %9, 3
  %11 = getelementptr inbounds i8, ptr %3, i64 2
  %12 = load i16, ptr %11, align 1, !tbaa !16
  %13 = tail call zeroext i16 @lwip_htons(i16 noundef zeroext %12) #4
  %14 = load i8, ptr %3, align 1, !tbaa !11
  %15 = shl i8 %14, 2
  %16 = and i8 %15, 60
  %17 = zext nneg i8 %16 to i16
  %18 = icmp ult i16 %13, %17
  br i1 %18, label %132, label %19

19:                                               ; preds = %6
  %20 = sub i16 %13, %17
  %21 = tail call zeroext i16 @pbuf_clen(ptr noundef nonnull %0) #4
  %22 = load i16, ptr @ip_reass_pbufcount, align 2, !tbaa !17
  %23 = zext i16 %22 to i32
  %24 = zext i16 %21 to i32
  %25 = add nuw nsw i32 %23, %24
  %26 = icmp ugt i32 %25, 10
  br i1 %26, label %27, label %34

27:                                               ; preds = %19
  %28 = tail call i32 @ip_reass_remove_oldest_datagram(ptr noundef nonnull %3, i32 noundef %24)
  %.not95 = icmp eq i32 %28, 0
  br i1 %.not95, label %132, label %29

29:                                               ; preds = %27
  %30 = load i16, ptr @ip_reass_pbufcount, align 2, !tbaa !17
  %31 = zext i16 %30 to i32
  %32 = add nuw nsw i32 %31, %24
  %33 = icmp ugt i32 %32, 10
  br i1 %33, label %132, label %34

34:                                               ; preds = %29, %19
  %.087102 = load ptr, ptr @reassdatagrams, align 8, !tbaa !18
  %cond103 = icmp eq ptr %.087102, null
  br i1 %cond103, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %34
  %35 = getelementptr inbounds i8, ptr %3, i64 12
  %36 = load i32, ptr %35, align 1, !tbaa !19
  %37 = getelementptr inbounds i8, ptr %3, i64 16
  %38 = getelementptr inbounds i8, ptr %3, i64 4
  br label %39

39:                                               ; preds = %.lr.ph, %53
  %.087104 = phi ptr [ %.087102, %.lr.ph ], [ %.087, %53 ]
  %40 = getelementptr inbounds i8, ptr %.087104, i64 28
  %41 = load i32, ptr %40, align 4, !tbaa !20
  %42 = icmp eq i32 %41, %36
  br i1 %42, label %43, label %53

43:                                               ; preds = %39
  %44 = getelementptr inbounds i8, ptr %.087104, i64 32
  %45 = load i32, ptr %44, align 8, !tbaa !22
  %46 = load i32, ptr %37, align 1, !tbaa !23
  %47 = icmp eq i32 %45, %46
  br i1 %47, label %48, label %53

48:                                               ; preds = %43
  %49 = getelementptr inbounds i8, ptr %.087104, i64 20
  %50 = load i16, ptr %49, align 4, !tbaa !24
  %51 = load i16, ptr %38, align 1, !tbaa !25
  %52 = icmp eq i16 %50, %51
  br i1 %52, label %56, label %53

53:                                               ; preds = %48, %43, %39
  %.087 = load ptr, ptr %.087104, align 8, !tbaa !18
  %cond = icmp eq ptr %.087, null
  br i1 %cond, label %._crit_edge, label %39, !llvm.loop !26

._crit_edge:                                      ; preds = %53, %34
  %54 = tail call ptr @ip_reass_enqueue_new_datagram(ptr noundef nonnull %3, i32 noundef %24)
  %55 = icmp eq ptr %54, null
  br i1 %55, label %132, label %68

56:                                               ; preds = %48
  %57 = load i16, ptr %7, align 1, !tbaa !15
  %58 = tail call zeroext i16 @lwip_htons(i16 noundef zeroext %57) #4
  %59 = and i16 %58, 8191
  %60 = icmp eq i16 %59, 0
  br i1 %60, label %61, label %68

61:                                               ; preds = %56
  %62 = getelementptr inbounds i8, ptr %.087104, i64 22
  %63 = load i16, ptr %62, align 2, !tbaa !28
  %64 = tail call zeroext i16 @lwip_htons(i16 noundef zeroext %63) #4
  %65 = and i16 %64, 8191
  %.not97 = icmp eq i16 %65, 0
  br i1 %.not97, label %68, label %66

66:                                               ; preds = %61
  %67 = getelementptr inbounds i8, ptr %.087104, i64 16
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %67, ptr noundef nonnull align 1 dereferenceable(20) %3, i64 20, i1 false)
  br label %68

68:                                               ; preds = %56, %61, %66, %._crit_edge
  %.188 = phi ptr [ %54, %._crit_edge ], [ %.087104, %66 ], [ %.087104, %61 ], [ %.087104, %56 ]
  %69 = load i16, ptr %7, align 1, !tbaa !15
  %70 = and i16 %69, 32
  %71 = icmp eq i16 %70, 0
  %72 = zext i1 %71 to i32
  br i1 %71, label %73, label %77

73:                                               ; preds = %68
  %74 = add i16 %20, %10
  %75 = icmp ult i16 %74, %10
  %76 = icmp ugt i16 %74, -21
  %or.cond = or i1 %75, %76
  br i1 %or.cond, label %122, label %77

77:                                               ; preds = %73, %68
  %78 = tail call i32 @ip_reass_chain_frag_into_datagram_and_validate(ptr noundef nonnull %.188, ptr noundef %0, i32 noundef %72)
  %79 = icmp eq i32 %78, -1
  br i1 %79, label %122, label %80

80:                                               ; preds = %77
  %81 = load i16, ptr @ip_reass_pbufcount, align 2, !tbaa !17
  %82 = add i16 %81, %21
  store i16 %82, ptr @ip_reass_pbufcount, align 2, !tbaa !17
  br i1 %71, label %83, label %89

83:                                               ; preds = %80
  %84 = add i16 %20, %10
  %85 = getelementptr inbounds i8, ptr %.188, i64 36
  store i16 %84, ptr %85, align 4, !tbaa !29
  %86 = getelementptr inbounds i8, ptr %.188, i64 38
  %87 = load i8, ptr %86, align 2, !tbaa !30
  %88 = or i8 %87, 1
  store i8 %88, ptr %86, align 2, !tbaa !30
  br label %89

89:                                               ; preds = %83, %80
  %90 = icmp eq i32 %78, 1
  br i1 %90, label %91, label %134

91:                                               ; preds = %89
  %92 = getelementptr inbounds i8, ptr %.188, i64 36
  %93 = load i16, ptr %92, align 4, !tbaa !29
  %94 = add i16 %93, 20
  %95 = getelementptr inbounds i8, ptr %.188, i64 8
  %96 = load ptr, ptr %95, align 8, !tbaa !31
  %97 = getelementptr inbounds i8, ptr %96, i64 8
  %98 = load ptr, ptr %97, align 8, !tbaa !5
  %99 = load ptr, ptr %98, align 1, !tbaa !32
  %100 = getelementptr inbounds i8, ptr %.188, i64 16
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %98, ptr noundef nonnull align 8 dereferenceable(20) %100, i64 20, i1 false)
  %101 = tail call zeroext i16 @lwip_htons(i16 noundef zeroext %94) #4
  %102 = getelementptr inbounds i8, ptr %98, i64 2
  store i16 %101, ptr %102, align 1, !tbaa !16
  %103 = getelementptr inbounds i8, ptr %98, i64 6
  store i16 0, ptr %103, align 1, !tbaa !15
  %104 = getelementptr inbounds i8, ptr %98, i64 10
  store i16 0, ptr %104, align 1, !tbaa !34
  %105 = load ptr, ptr %95, align 8, !tbaa !31
  %.not98105 = icmp eq ptr %99, null
  br i1 %.not98105, label %._crit_edge109, label %.lr.ph108

.lr.ph108:                                        ; preds = %91, %.lr.ph108
  %.086106 = phi ptr [ %109, %.lr.ph108 ], [ %99, %91 ]
  %106 = getelementptr inbounds i8, ptr %.086106, i64 8
  %107 = load ptr, ptr %106, align 8, !tbaa !5
  %108 = tail call zeroext i8 @pbuf_remove_header(ptr noundef nonnull %.086106, i64 noundef 20) #4
  tail call void @pbuf_cat(ptr noundef %105, ptr noundef nonnull %.086106) #4
  %109 = load ptr, ptr %107, align 1, !tbaa !32
  %.not98 = icmp eq ptr %109, null
  br i1 %.not98, label %._crit_edge109, label %.lr.ph108, !llvm.loop !35

._crit_edge109:                                   ; preds = %.lr.ph108, %91
  %110 = load ptr, ptr @reassdatagrams, align 8, !tbaa !18
  %111 = icmp eq ptr %.188, %110
  br i1 %111, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %._crit_edge109, %112
  %.084 = phi ptr [ %113, %112 ], [ %110, %._crit_edge109 ]
  %.not99 = icmp eq ptr %.084, null
  br i1 %.not99, label %.loopexit, label %112

112:                                              ; preds = %.preheader
  %113 = load ptr, ptr %.084, align 8, !tbaa !36
  %114 = icmp eq ptr %113, %.188
  br i1 %114, label %.loopexit, label %.preheader, !llvm.loop !37

.loopexit:                                        ; preds = %.preheader, %112, %._crit_edge109
  %.1 = phi ptr [ null, %._crit_edge109 ], [ null, %.preheader ], [ %.084, %112 ]
  tail call void @ip_reass_dequeue_datagram(ptr noundef nonnull %.188, ptr noundef %.1)
  %115 = tail call zeroext i16 @pbuf_clen(ptr noundef %105) #4
  %116 = load i16, ptr @ip_reass_pbufcount, align 2, !tbaa !17
  %.not100 = icmp ult i16 %116, %115
  br i1 %.not100, label %117, label %119

117:                                              ; preds = %.loopexit
  %118 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.1, i32 noundef 667, ptr noundef nonnull @.str.2)
  %.pre = load i16, ptr @ip_reass_pbufcount, align 2, !tbaa !17
  br label %119

119:                                              ; preds = %117, %.loopexit
  %120 = phi i16 [ %.pre, %117 ], [ %116, %.loopexit ]
  %121 = sub i16 %120, %115
  store i16 %121, ptr @ip_reass_pbufcount, align 2, !tbaa !17
  br label %134

122:                                              ; preds = %73, %77
  %123 = getelementptr inbounds i8, ptr %.188, i64 8
  %124 = load ptr, ptr %123, align 8, !tbaa !31
  %125 = icmp eq ptr %124, null
  br i1 %125, label %126, label %132

126:                                              ; preds = %122
  %127 = load ptr, ptr @reassdatagrams, align 8, !tbaa !18
  %128 = icmp eq ptr %.188, %127
  br i1 %128, label %131, label %129

129:                                              ; preds = %126
  %130 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.4, i32 noundef 683, ptr noundef nonnull @.str.2)
  br label %131

131:                                              ; preds = %129, %126
  tail call void @ip_reass_dequeue_datagram(ptr noundef nonnull %.188, ptr noundef null)
  br label %132

132:                                              ; preds = %122, %131, %._crit_edge, %27, %29, %6, %1
  %133 = tail call zeroext i8 @pbuf_free(ptr noundef %0) #4
  br label %134

134:                                              ; preds = %89, %132, %119
  %.0 = phi ptr [ null, %132 ], [ %105, %119 ], [ null, %89 ]
  ret ptr %.0
}

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

declare zeroext i16 @pbuf_clen(ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress 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) #2

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

declare zeroext i8 @pbuf_remove_header(ptr noundef, i64 noundef) local_unnamed_addr #1

declare void @pbuf_cat(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @ip_reass_dequeue_datagram(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "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 #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, !7, i64 8}
!6 = !{!"pbuf", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 18, !8, i64 20, !8, i64 21, !8, i64 22, !8, i64 23}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!12, !8, i64 0}
!12 = !{!"ip_hdr", !8, i64 0, !8, i64 1, !10, i64 2, !10, i64 4, !10, i64 6, !8, i64 8, !8, i64 9, !10, i64 10, !13, i64 12, !13, i64 16}
!13 = !{!"ip4_addr_packed", !14, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!12, !10, i64 6}
!16 = !{!12, !10, i64 2}
!17 = !{!10, !10, i64 0}
!18 = !{!7, !7, i64 0}
!19 = !{!12, !14, i64 12}
!20 = !{!21, !14, i64 28}
!21 = !{!"ip_reassdata", !7, i64 0, !7, i64 8, !12, i64 16, !10, i64 36, !8, i64 38, !8, i64 39}
!22 = !{!21, !14, i64 32}
!23 = !{!12, !14, i64 16}
!24 = !{!21, !10, i64 20}
!25 = !{!12, !10, i64 4}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!21, !10, i64 22}
!29 = !{!21, !10, i64 36}
!30 = !{!21, !8, i64 38}
!31 = !{!21, !7, i64 8}
!32 = !{!33, !7, i64 0}
!33 = !{!"ip_reass_helper", !7, i64 0, !10, i64 8, !10, i64 10}
!34 = !{!12, !10, i64 10}
!35 = distinct !{!35, !27}
!36 = !{!21, !7, i64 0}
!37 = distinct !{!37, !27}


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