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

; 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.ip_globals = type { ptr, ptr, ptr, i16, %struct.ip4_addr, %struct.ip4_addr }
%struct.ip4_addr = type { i32 }
%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.pbuf = type { ptr, ptr, i16, i16, i8, i8, i8, i8 }
%struct.icmp_echo_hdr = type { i8, i8, i16, i16, i16 }

@ip_data = external global %struct.ip_globals, align 8
@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [184 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [50 x i8], align 1

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

27:                                               ; preds = %2
  br label %269

28:                                               ; preds = %2
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.pbuf, ptr %29, i32 0, i32 3
  %31 = load i16, ptr %30, align 2, !tbaa !18
  %32 = zext i16 %31 to i64
  %33 = icmp ult i64 %32, 4
  br i1 %33, label %34, label %35

34:                                               ; preds = %28
  br label %269

35:                                               ; preds = %28
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.pbuf, ptr %36, i32 0, i32 1
  %38 = load ptr, ptr %37, align 8, !tbaa !20
  %39 = load i8, ptr %38, align 1, !tbaa !21
  store i8 %39, ptr %5, align 1, !tbaa !21
  %40 = load i8, ptr %5, align 1, !tbaa !21
  %41 = zext i8 %40 to i32
  switch i32 %41, label %212 [
    i32 0, label %42
    i32 8, label %43
  ]

42:                                               ; preds = %35
  br label %266

43:                                               ; preds = %35
  store ptr getelementptr inbounds (%struct.ip_globals, ptr @ip_data, i32 0, i32 5), ptr %9, align 8, !tbaa !5
  %44 = load i32, ptr getelementptr inbounds (%struct.ip_globals, ptr @ip_data, i32 0, i32 5), align 8, !tbaa !22
  %45 = zext i32 %44 to i64
  %46 = and i64 %45, 240
  %47 = icmp eq i64 %46, 224
  br i1 %47, label %48, label %49

48:                                               ; preds = %43
  br label %272

49:                                               ; preds = %43
  %50 = load i32, ptr getelementptr inbounds (%struct.ip_globals, ptr @ip_data, i32 0, i32 5), align 8, !tbaa !22
  %51 = load ptr, ptr @ip_data, align 8, !tbaa !23
  %52 = call zeroext i8 @ip4_addr_isbroadcast_u32(i32 noundef %50, ptr noundef %51)
  %53 = icmp ne i8 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %49
  br label %272

55:                                               ; preds = %49
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.pbuf, ptr %56, i32 0, i32 2
  %58 = load i16, ptr %57, align 8, !tbaa !24
  %59 = zext i16 %58 to i64
  %60 = icmp ult i64 %59, 8
  br i1 %60, label %61, label %62

61:                                               ; preds = %55
  br label %269

62:                                               ; preds = %55
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = call zeroext i16 @inet_chksum_pbuf(ptr noundef %63)
  %65 = zext i16 %64 to i32
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %70

67:                                               ; preds = %62
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = call zeroext i8 @pbuf_free(ptr noundef %68)
  store i32 1, ptr %10, align 4
  br label %275

70:                                               ; preds = %62
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = load i16, ptr %8, align 2, !tbaa !17
  %73 = zext i16 %72 to i32
  %74 = add nsw i32 %73, 16
  %75 = add nsw i32 %74, 0
  %76 = sext i32 %75 to i64
  %77 = call zeroext i8 @pbuf_add_header(ptr noundef %71, i64 noundef %76)
  %78 = icmp ne i8 %77, 0
  br i1 %78, label %79, label %152

79:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #4
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.pbuf, ptr %80, i32 0, i32 2
  %82 = load i16, ptr %81, align 8, !tbaa !24
  %83 = zext i16 %82 to i32
  %84 = load i16, ptr %8, align 2, !tbaa !17
  %85 = zext i16 %84 to i32
  %86 = add nsw i32 %83, %85
  %87 = trunc i32 %86 to i16
  store i16 %87, ptr %12, align 2, !tbaa !17
  %88 = load i16, ptr %12, align 2, !tbaa !17
  %89 = zext i16 %88 to i32
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.pbuf, ptr %90, i32 0, i32 2
  %92 = load i16, ptr %91, align 8, !tbaa !24
  %93 = zext i16 %92 to i32
  %94 = icmp slt i32 %89, %93
  br i1 %94, label %95, label %96

95:                                               ; preds = %79
  store i32 4, ptr %10, align 4
  br label %149

96:                                               ; preds = %79
  %97 = load i16, ptr %12, align 2, !tbaa !17
  %98 = call ptr @pbuf_alloc(i32 noundef 16, i16 noundef zeroext %97, i32 noundef 640)
  store ptr %98, ptr %11, align 8, !tbaa !5
  %99 = load ptr, ptr %11, align 8, !tbaa !5
  %100 = icmp eq ptr %99, null
  br i1 %100, label %101, label %102

101:                                              ; preds = %96
  store i32 4, ptr %10, align 4
  br label %149

102:                                              ; preds = %96
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.pbuf, ptr %103, i32 0, i32 3
  %105 = load i16, ptr %104, align 2, !tbaa !18
  %106 = zext i16 %105 to i64
  %107 = load i16, ptr %8, align 2, !tbaa !17
  %108 = zext i16 %107 to i64
  %109 = add i64 %108, 8
  %110 = icmp ult i64 %106, %109
  br i1 %110, label %111, label %114

111:                                              ; preds = %102
  %112 = load ptr, ptr %11, align 8, !tbaa !5
  %113 = call zeroext i8 @pbuf_free(ptr noundef %112)
  store i32 4, ptr %10, align 4
  br label %149

114:                                              ; preds = %102
  %115 = load ptr, ptr %11, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.pbuf, ptr %115, i32 0, i32 1
  %117 = load ptr, ptr %116, align 8, !tbaa !20
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = load i16, ptr %8, align 2, !tbaa !17
  %120 = zext i16 %119 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %117, ptr align 1 %118, i64 %120, i1 false)
  %121 = load ptr, ptr %11, align 8, !tbaa !5
  %122 = load i16, ptr %8, align 2, !tbaa !17
  %123 = zext i16 %122 to i64
  %124 = call zeroext i8 @pbuf_remove_header(ptr noundef %121, i64 noundef %123)
  %125 = icmp ne i8 %124, 0
  br i1 %125, label %126, label %136

126:                                              ; preds = %114
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127
  %129 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 182, ptr noundef @.str.2)
  br label %130

130:                                              ; preds = %128
  br label %131

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132
  %134 = load ptr, ptr %11, align 8, !tbaa !5
  %135 = call zeroext i8 @pbuf_free(ptr noundef %134)
  store i32 4, ptr %10, align 4
  br label %149

136:                                              ; preds = %114
  %137 = load ptr, ptr %11, align 8, !tbaa !5
  %138 = load ptr, ptr %3, align 8, !tbaa !5
  %139 = call signext i8 @pbuf_copy(ptr noundef %137, ptr noundef %138)
  %140 = sext i8 %139 to i32
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %145

142:                                              ; preds = %136
  %143 = load ptr, ptr %11, align 8, !tbaa !5
  %144 = call zeroext i8 @pbuf_free(ptr noundef %143)
  store i32 4, ptr %10, align 4
  br label %149

145:                                              ; preds = %136
  %146 = load ptr, ptr %3, align 8, !tbaa !5
  %147 = call zeroext i8 @pbuf_free(ptr noundef %146)
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %148, ptr %3, align 8, !tbaa !5
  store i32 0, ptr %10, align 4
  br label %149

149:                                              ; preds = %145, %142, %133, %111, %101, %95
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  %150 = load i32, ptr %10, align 4
  switch i32 %150, label %275 [
    i32 0, label %151
    i32 4, label %272
  ]

151:                                              ; preds = %149
  br label %170

152:                                              ; preds = %70
  %153 = load ptr, ptr %3, align 8, !tbaa !5
  %154 = load i16, ptr %8, align 2, !tbaa !17
  %155 = zext i16 %154 to i32
  %156 = add nsw i32 %155, 16
  %157 = add nsw i32 %156, 0
  %158 = sext i32 %157 to i64
  %159 = call zeroext i8 @pbuf_remove_header(ptr noundef %153, i64 noundef %158)
  %160 = icmp ne i8 %159, 0
  br i1 %160, label %161, label %169

161:                                              ; preds = %152
  br label %162

162:                                              ; preds = %161
  br label %163

163:                                              ; preds = %162
  %164 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.3, i32 noundef 199, ptr noundef @.str.2)
  br label %165

165:                                              ; preds = %163
  br label %166

166:                                              ; preds = %165
  br label %167

167:                                              ; preds = %166
  br label %168

168:                                              ; preds = %167
  br label %272

169:                                              ; preds = %152
  br label %170

170:                                              ; preds = %169, %151
  %171 = load ptr, ptr %3, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.pbuf, ptr %171, i32 0, i32 1
  %173 = load ptr, ptr %172, align 8, !tbaa !20
  store ptr %173, ptr %6, align 8, !tbaa !5
  %174 = load ptr, ptr %3, align 8, !tbaa !5
  %175 = load i16, ptr %8, align 2, !tbaa !17
  %176 = zext i16 %175 to i64
  %177 = call zeroext i8 @pbuf_add_header(ptr noundef %174, i64 noundef %176)
  %178 = icmp ne i8 %177, 0
  br i1 %178, label %179, label %180

179:                                              ; preds = %170
  br label %211

180:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %181 = load ptr, ptr %3, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.pbuf, ptr %181, i32 0, i32 1
  %183 = load ptr, ptr %182, align 8, !tbaa !20
  store ptr %183, ptr %14, align 8, !tbaa !5
  %184 = load ptr, ptr %9, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.ip4_addr, ptr %184, i32 0, i32 0
  %186 = load i32, ptr %185, align 4, !tbaa !25
  %187 = load ptr, ptr %14, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.ip_hdr, ptr %187, i32 0, i32 8
  %189 = getelementptr inbounds %struct.ip4_addr_packed, ptr %188, i32 0, i32 0
  store i32 %186, ptr %189, align 1, !tbaa !26
  %190 = load i32, ptr getelementptr inbounds (%struct.ip_globals, ptr @ip_data, i32 0, i32 4), align 4, !tbaa !27
  %191 = load ptr, ptr %14, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.ip_hdr, ptr %191, i32 0, i32 9
  %193 = getelementptr inbounds %struct.ip4_addr_packed, ptr %192, i32 0, i32 0
  store i32 %190, ptr %193, align 1, !tbaa !28
  %194 = load ptr, ptr %6, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.icmp_echo_hdr, ptr %194, i32 0, i32 0
  store i8 0, ptr %195, align 1, !tbaa !29
  %196 = load ptr, ptr %6, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.icmp_echo_hdr, ptr %196, i32 0, i32 2
  store i16 0, ptr %197, align 1, !tbaa !31
  %198 = load ptr, ptr %14, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.ip_hdr, ptr %198, i32 0, i32 5
  store i8 -1, ptr %199, align 1, !tbaa !32
  %200 = load ptr, ptr %14, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.ip_hdr, ptr %200, i32 0, i32 7
  store i16 0, ptr %201, align 1, !tbaa !33
  %202 = load ptr, ptr %3, align 8, !tbaa !5
  %203 = load ptr, ptr %9, align 8, !tbaa !5
  %204 = load ptr, ptr %4, align 8, !tbaa !5
  %205 = call signext i8 @ip4_output_if(ptr noundef %202, ptr noundef %203, ptr noundef null, i8 noundef zeroext -1, i8 noundef zeroext 0, i8 noundef zeroext 1, ptr noundef %204)
  store i8 %205, ptr %13, align 1, !tbaa !21
  %206 = load i8, ptr %13, align 1, !tbaa !21
  %207 = sext i8 %206 to i32
  %208 = icmp ne i32 %207, 0
  br i1 %208, label %209, label %210

209:                                              ; preds = %180
  br label %210

210:                                              ; preds = %209, %180
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #4
  br label %211

211:                                              ; preds = %210, %179
  br label %266

212:                                              ; preds = %35
  %213 = load i8, ptr %5, align 1, !tbaa !21
  %214 = zext i8 %213 to i32
  %215 = icmp eq i32 %214, 3
  br i1 %215, label %216, label %217

216:                                              ; preds = %212
  br label %265

217:                                              ; preds = %212
  %218 = load i8, ptr %5, align 1, !tbaa !21
  %219 = zext i8 %218 to i32
  %220 = icmp eq i32 %219, 11
  br i1 %220, label %221, label %222

221:                                              ; preds = %217
  br label %264

222:                                              ; preds = %217
  %223 = load i8, ptr %5, align 1, !tbaa !21
  %224 = zext i8 %223 to i32
  %225 = icmp eq i32 %224, 12
  br i1 %225, label %226, label %227

226:                                              ; preds = %222
  br label %263

227:                                              ; preds = %222
  %228 = load i8, ptr %5, align 1, !tbaa !21
  %229 = zext i8 %228 to i32
  %230 = icmp eq i32 %229, 4
  br i1 %230, label %231, label %232

231:                                              ; preds = %227
  br label %262

232:                                              ; preds = %227
  %233 = load i8, ptr %5, align 1, !tbaa !21
  %234 = zext i8 %233 to i32
  %235 = icmp eq i32 %234, 5
  br i1 %235, label %236, label %237

236:                                              ; preds = %232
  br label %261

237:                                              ; preds = %232
  %238 = load i8, ptr %5, align 1, !tbaa !21
  %239 = zext i8 %238 to i32
  %240 = icmp eq i32 %239, 13
  br i1 %240, label %241, label %242

241:                                              ; preds = %237
  br label %260

242:                                              ; preds = %237
  %243 = load i8, ptr %5, align 1, !tbaa !21
  %244 = zext i8 %243 to i32
  %245 = icmp eq i32 %244, 14
  br i1 %245, label %246, label %247

246:                                              ; preds = %242
  br label %259

247:                                              ; preds = %242
  %248 = load i8, ptr %5, align 1, !tbaa !21
  %249 = zext i8 %248 to i32
  %250 = icmp eq i32 %249, 17
  br i1 %250, label %251, label %252

251:                                              ; preds = %247
  br label %258

252:                                              ; preds = %247
  %253 = load i8, ptr %5, align 1, !tbaa !21
  %254 = zext i8 %253 to i32
  %255 = icmp eq i32 %254, 18
  br i1 %255, label %256, label %257

256:                                              ; preds = %252
  br label %257

257:                                              ; preds = %256, %252
  br label %258

258:                                              ; preds = %257, %251
  br label %259

259:                                              ; preds = %258, %246
  br label %260

260:                                              ; preds = %259, %241
  br label %261

261:                                              ; preds = %260, %236
  br label %262

262:                                              ; preds = %261, %231
  br label %263

263:                                              ; preds = %262, %226
  br label %264

264:                                              ; preds = %263, %221
  br label %265

265:                                              ; preds = %264, %216
  br label %266

266:                                              ; preds = %265, %211, %42
  %267 = load ptr, ptr %3, align 8, !tbaa !5
  %268 = call zeroext i8 @pbuf_free(ptr noundef %267)
  store i32 1, ptr %10, align 4
  br label %275

269:                                              ; preds = %61, %34, %27
  %270 = load ptr, ptr %3, align 8, !tbaa !5
  %271 = call zeroext i8 @pbuf_free(ptr noundef %270)
  store i32 1, ptr %10, align 4
  br label %275

272:                                              ; preds = %168, %149, %54, %48
  %273 = load ptr, ptr %3, align 8, !tbaa !5
  %274 = call zeroext i8 @pbuf_free(ptr noundef %273)
  store i32 1, ptr %10, align 4
  br label %275

275:                                              ; preds = %272, %269, %266, %149, %67
  call void @llvm.lifetime.end.p0(i64 8, 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 1, ptr %5) #4
  ret void
}

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

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

declare zeroext i16 @inet_chksum_pbuf(ptr noundef) #2

declare zeroext i8 @pbuf_free(ptr noundef) #2

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

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

; 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 i8 @pbuf_remove_header(ptr noundef, i64 noundef) #2

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

declare signext i8 @pbuf_copy(ptr noundef, ptr noundef) #2

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

declare signext i8 @ip4_output_if(ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, 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, !6, i64 16}
!10 = !{!"ip_globals", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !12, i64 28, !12, i64 32}
!11 = !{!"short", !7, i64 0}
!12 = !{!"ip4_addr", !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !7, i64 0}
!15 = !{!"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, !16, i64 12, !16, i64 16}
!16 = !{!"ip4_addr_packed", !13, i64 0}
!17 = !{!11, !11, i64 0}
!18 = !{!19, !11, i64 18}
!19 = !{!"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}
!20 = !{!19, !6, i64 8}
!21 = !{!7, !7, i64 0}
!22 = !{!10, !13, i64 32}
!23 = !{!10, !6, i64 0}
!24 = !{!19, !11, i64 16}
!25 = !{!12, !13, i64 0}
!26 = !{!15, !13, i64 12}
!27 = !{!10, !13, i64 28}
!28 = !{!15, !13, i64 16}
!29 = !{!30, !7, i64 0}
!30 = !{!"icmp_echo_hdr", !7, i64 0, !7, i64 1, !11, i64 2, !11, i64 4, !11, i64 6}
!31 = !{!30, !11, i64 2}
!32 = !{!15, !7, i64 8}
!33 = !{!15, !11, i64 10}


; 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.ip_globals = type { ptr, ptr, ptr, i16, %struct.ip4_addr, %struct.ip4_addr }
%struct.ip4_addr = type { i32 }

@ip_data = external global %struct.ip_globals, align 8
@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [184 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [50 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @icmp_input(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = load ptr, ptr getelementptr inbounds (i8, ptr @ip_data, i64 16), align 8, !tbaa !5
  %4 = load i8, ptr %3, align 1, !tbaa !13
  %5 = shl i8 %4, 2
  %6 = and i8 %5, 60
  %7 = icmp ult i8 %6, 20
  br i1 %7, label %83, label %8

8:                                                ; preds = %2
  %9 = getelementptr inbounds i8, ptr %0, i64 18
  %10 = load i16, ptr %9, align 2, !tbaa !16
  %11 = icmp ult i16 %10, 4
  br i1 %11, label %83, label %12

12:                                               ; preds = %8
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !18
  %15 = load i8, ptr %14, align 1, !tbaa !19
  %cond = icmp eq i8 %15, 8
  br i1 %cond, label %16, label %81

16:                                               ; preds = %12
  %17 = load i32, ptr getelementptr inbounds (i8, ptr @ip_data, i64 32), align 8, !tbaa !20
  %18 = and i32 %17, 240
  %19 = icmp eq i32 %18, 224
  br i1 %19, label %.thread, label %20

20:                                               ; preds = %16
  %21 = load ptr, ptr @ip_data, align 8, !tbaa !21
  %22 = tail call zeroext i8 @ip4_addr_isbroadcast_u32(i32 noundef %17, ptr noundef %21) #4
  %.not = icmp eq i8 %22, 0
  br i1 %.not, label %23, label %.thread

23:                                               ; preds = %20
  %24 = getelementptr inbounds i8, ptr %0, i64 16
  %25 = load i16, ptr %24, align 8, !tbaa !22
  %26 = icmp ult i16 %25, 8
  br i1 %26, label %83, label %27

27:                                               ; preds = %23
  %28 = tail call zeroext i16 @inet_chksum_pbuf(ptr noundef nonnull %0) #4
  %.not82 = icmp eq i16 %28, 0
  br i1 %.not82, label %31, label %29

29:                                               ; preds = %27
  %30 = tail call zeroext i8 @pbuf_free(ptr noundef nonnull %0) #4
  br label %86

31:                                               ; preds = %27
  %narrow = add nuw nsw i8 %6, 16
  %32 = zext nneg i8 %narrow to i64
  %33 = tail call zeroext i8 @pbuf_add_header(ptr noundef nonnull %0, i64 noundef %32) #4
  %.not83 = icmp eq i8 %33, 0
  br i1 %.not83, label %64, label %34

34:                                               ; preds = %31
  %35 = load i16, ptr %24, align 8, !tbaa !22
  %36 = zext nneg i8 %6 to i16
  %37 = add i16 %35, %36
  %38 = icmp ult i16 %37, %35
  br i1 %38, label %.thread, label %39

39:                                               ; preds = %34
  %40 = tail call ptr @pbuf_alloc(i32 noundef 16, i16 noundef zeroext %37, i32 noundef 640) #4
  %41 = icmp eq ptr %40, null
  br i1 %41, label %.thread, label %42

42:                                               ; preds = %39
  %43 = getelementptr inbounds i8, ptr %40, i64 18
  %44 = load i16, ptr %43, align 2, !tbaa !16
  %45 = zext i16 %44 to i64
  %46 = zext nneg i8 %6 to i64
  %47 = add nuw nsw i64 %46, 8
  %48 = icmp ugt i64 %47, %45
  br i1 %48, label %49, label %51

49:                                               ; preds = %42
  %50 = tail call zeroext i8 @pbuf_free(ptr noundef nonnull %40) #4
  br label %.thread

51:                                               ; preds = %42
  %52 = getelementptr inbounds i8, ptr %40, i64 8
  %53 = load ptr, ptr %52, align 8, !tbaa !18
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %53, ptr nonnull align 1 %3, i64 %46, i1 false)
  %54 = tail call zeroext i8 @pbuf_remove_header(ptr noundef nonnull %40, i64 noundef %46) #4
  %.not85 = icmp eq i8 %54, 0
  br i1 %.not85, label %58, label %55

55:                                               ; preds = %51
  %56 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.1, i32 noundef 182, ptr noundef nonnull @.str.2)
  %57 = tail call zeroext i8 @pbuf_free(ptr noundef nonnull %40) #4
  br label %.thread

58:                                               ; preds = %51
  %59 = tail call signext i8 @pbuf_copy(ptr noundef nonnull %40, ptr noundef nonnull %0) #4
  %.not86 = icmp eq i8 %59, 0
  br i1 %.not86, label %62, label %60

60:                                               ; preds = %58
  %61 = tail call zeroext i8 @pbuf_free(ptr noundef nonnull %40) #4
  br label %.thread

62:                                               ; preds = %58
  %63 = tail call zeroext i8 @pbuf_free(ptr noundef nonnull %0) #4
  br label %68

64:                                               ; preds = %31
  %65 = tail call zeroext i8 @pbuf_remove_header(ptr noundef nonnull %0, i64 noundef %32) #4
  %.not84 = icmp eq i8 %65, 0
  br i1 %.not84, label %._crit_edge, label %66

._crit_edge:                                      ; preds = %64
  %.pre = zext nneg i8 %6 to i64
  br label %68

66:                                               ; preds = %64
  %67 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.3, i32 noundef 199, ptr noundef nonnull @.str.2)
  br label %.thread

68:                                               ; preds = %._crit_edge, %62
  %.pre-phi = phi i64 [ %.pre, %._crit_edge ], [ %46, %62 ]
  %.1 = phi ptr [ %0, %._crit_edge ], [ %40, %62 ]
  %69 = getelementptr inbounds i8, ptr %.1, i64 8
  %70 = load ptr, ptr %69, align 8, !tbaa !18
  %71 = tail call zeroext i8 @pbuf_add_header(ptr noundef nonnull %.1, i64 noundef %.pre-phi) #4
  %.not87 = icmp eq i8 %71, 0
  br i1 %.not87, label %72, label %81

72:                                               ; preds = %68
  %73 = load ptr, ptr %69, align 8, !tbaa !18
  %74 = getelementptr inbounds i8, ptr %73, i64 12
  %75 = load <2 x i32>, ptr getelementptr inbounds (i8, ptr @ip_data, i64 28), align 4, !tbaa !23
  %76 = shufflevector <2 x i32> %75, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
  store <2 x i32> %76, ptr %74, align 1, !tbaa !24
  store i8 0, ptr %70, align 1, !tbaa !25
  %77 = getelementptr inbounds i8, ptr %70, i64 2
  store i16 0, ptr %77, align 1, !tbaa !27
  %78 = getelementptr inbounds i8, ptr %73, i64 8
  store i8 -1, ptr %78, align 1, !tbaa !28
  %79 = getelementptr inbounds i8, ptr %73, i64 10
  store i16 0, ptr %79, align 1, !tbaa !29
  %80 = tail call signext i8 @ip4_output_if(ptr noundef nonnull %.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @ip_data, i64 32), ptr noundef null, i8 noundef zeroext -1, i8 noundef zeroext 0, i8 noundef zeroext 1, ptr noundef %1) #4
  br label %81

81:                                               ; preds = %12, %72, %68
  %.2 = phi ptr [ %.1, %68 ], [ %.1, %72 ], [ %0, %12 ]
  %82 = tail call zeroext i8 @pbuf_free(ptr noundef nonnull %.2) #4
  br label %86

83:                                               ; preds = %23, %8, %2
  %84 = tail call zeroext i8 @pbuf_free(ptr noundef %0) #4
  br label %86

.thread:                                          ; preds = %39, %34, %60, %55, %49, %20, %16, %66
  %85 = tail call zeroext i8 @pbuf_free(ptr noundef nonnull %0) #4
  br label %86

86:                                               ; preds = %.thread, %83, %81, %29
  ret void
}

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

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

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

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

declare ptr @pbuf_alloc(i32 noundef, i16 noundef zeroext, i32 noundef) local_unnamed_addr #1

; 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

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

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

declare signext i8 @pbuf_copy(ptr noundef, ptr noundef) local_unnamed_addr #1

declare signext i8 @ip4_output_if(ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, 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 16}
!6 = !{!"ip_globals", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !11, i64 28, !11, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!"ip4_addr", !12, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!14, !8, i64 0}
!14 = !{!"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, !15, i64 12, !15, i64 16}
!15 = !{!"ip4_addr_packed", !12, i64 0}
!16 = !{!17, !10, i64 18}
!17 = !{!"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}
!18 = !{!17, !7, i64 8}
!19 = !{!8, !8, i64 0}
!20 = !{!6, !12, i64 32}
!21 = !{!6, !7, i64 0}
!22 = !{!17, !10, i64 16}
!23 = !{!11, !12, i64 0}
!24 = !{!12, !12, i64 0}
!25 = !{!26, !8, i64 0}
!26 = !{!"icmp_echo_hdr", !8, i64 0, !8, i64 1, !10, i64 2, !10, i64 4, !10, i64 6}
!27 = !{!26, !10, i64 2}
!28 = !{!14, !8, i64 8}
!29 = !{!14, !10, i64 10}


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