; 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.pbuf = type { ptr, ptr, i16, i16, i8, i8, i8, i8 }
%struct.udp_hdr = type { i16, i16, i16, i16 }
%struct.udp_pcb = type { %struct.ip4_addr, %struct.ip4_addr, i8, i8, i8, i8, ptr, i8, i16, i16, ptr, ptr }
%struct.netif = type { ptr, %struct.ip4_addr, %struct.ip4_addr, %struct.ip4_addr, ptr, ptr, ptr, ptr, ptr, [1 x ptr], i16, [6 x i8], i8, i8, [2 x i8], i8, i8 }

@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [178 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@ip_data = external global %struct.ip_globals, align 8
@udp_pcbs = external dso_local global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @udp_input(ptr noundef %0, ptr noundef %1) #0 {
  %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 ptr, align 8
  %9 = alloca i16, align 2
  %10 = alloca i16, align 2
  %11 = alloca i8, align 1
  %12 = alloca i8, align 1
  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 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #3
  store i8 0, ptr %12, align 1, !tbaa !9
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  br label %14

14:                                               ; preds = %2
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %22, label %17

17:                                               ; preds = %14
  br label %18

18:                                               ; preds = %17
  %19 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 207, ptr noundef @.str.2)
  br label %20

20:                                               ; preds = %18
  br label %21

21:                                               ; preds = %20
  br label %22

22:                                               ; preds = %21, %14
  br label %23

23:                                               ; preds = %22
  br label %24

24:                                               ; preds = %23
  br label %25

25:                                               ; preds = %24
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %33, label %28

28:                                               ; preds = %25
  br label %29

29:                                               ; preds = %28
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.3, i32 noundef 208, ptr noundef @.str.2)
  br label %31

31:                                               ; preds = %29
  br label %32

32:                                               ; preds = %31
  br label %33

33:                                               ; preds = %32, %25
  br label %34

34:                                               ; preds = %33
  br label %35

35:                                               ; preds = %34
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.pbuf, ptr %36, i32 0, i32 3
  %38 = load i16, ptr %37, align 2, !tbaa !10
  %39 = zext i16 %38 to i32
  %40 = icmp slt i32 %39, 8
  br i1 %40, label %41, label %44

41:                                               ; preds = %35
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = call zeroext i8 @pbuf_free(ptr noundef %42)
  br label %260

44:                                               ; preds = %35
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.pbuf, ptr %45, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !13
  store ptr %47, ptr %5, align 8, !tbaa !5
  %48 = load i32, ptr getelementptr inbounds (%struct.ip_globals, ptr @ip_data, i32 0, i32 5), align 8, !tbaa !14
  %49 = load ptr, ptr @ip_data, align 8, !tbaa !18
  %50 = call zeroext i8 @ip4_addr_isbroadcast_u32(i32 noundef %48, ptr noundef %49)
  store i8 %50, ptr %11, align 1, !tbaa !9
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.udp_hdr, ptr %51, i32 0, i32 0
  %53 = load i16, ptr %52, align 1, !tbaa !19
  %54 = call zeroext i16 @lwip_htons(i16 noundef zeroext %53)
  store i16 %54, ptr %9, align 2, !tbaa !21
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.udp_hdr, ptr %55, i32 0, i32 1
  %57 = load i16, ptr %56, align 1, !tbaa !22
  %58 = call zeroext i16 @lwip_htons(i16 noundef zeroext %57)
  store i16 %58, ptr %10, align 2, !tbaa !21
  store ptr null, ptr %6, align 8, !tbaa !5
  store ptr null, ptr %7, align 8, !tbaa !5
  store ptr null, ptr %8, align 8, !tbaa !5
  %59 = load ptr, ptr @udp_pcbs, align 8, !tbaa !5
  store ptr %59, ptr %6, align 8, !tbaa !5
  br label %60

60:                                               ; preds = %175, %44
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = icmp ne ptr %61, null
  br i1 %62, label %63, label %179

63:                                               ; preds = %60
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.udp_pcb, ptr %64, i32 0, i32 8
  %66 = load i16, ptr %65, align 2, !tbaa !23
  %67 = zext i16 %66 to i32
  %68 = load i16, ptr %10, align 2, !tbaa !21
  %69 = zext i16 %68 to i32
  %70 = icmp eq i32 %67, %69
  br i1 %70, label %71, label %173

71:                                               ; preds = %63
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = load i8, ptr %11, align 1, !tbaa !9
  %75 = call zeroext i8 @udp_input_local_match(ptr noundef %72, ptr noundef %73, i8 noundef zeroext %74)
  %76 = zext i8 %75 to i32
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %173

78:                                               ; preds = %71
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.udp_pcb, ptr %79, i32 0, i32 7
  %81 = load i8, ptr %80, align 8, !tbaa !25
  %82 = zext i8 %81 to i32
  %83 = and i32 %82, 4
  %84 = icmp eq i32 %83, 0
  br i1 %84, label %85, label %136

85:                                               ; preds = %78
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = icmp eq ptr %86, null
  br i1 %87, label %88, label %90

88:                                               ; preds = %85
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %89, ptr %8, align 8, !tbaa !5
  br label %135

90:                                               ; preds = %85
  %91 = load i8, ptr %11, align 1, !tbaa !9
  %92 = zext i8 %91 to i32
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %121

94:                                               ; preds = %90
  %95 = load i32, ptr getelementptr inbounds (%struct.ip_globals, ptr @ip_data, i32 0, i32 5), align 8, !tbaa !14
  %96 = icmp eq i32 %95, -1
  br i1 %96, label %97, label %121

97:                                               ; preds = %94
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.udp_pcb, ptr %98, i32 0, i32 0
  %100 = getelementptr inbounds %struct.ip4_addr, ptr %99, i32 0, i32 0
  %101 = load i32, ptr %100, align 8, !tbaa !26
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.netif, ptr %102, i32 0, i32 1
  %104 = getelementptr inbounds %struct.ip4_addr, ptr %103, i32 0, i32 0
  %105 = load i32, ptr %104, align 8, !tbaa !27
  %106 = icmp eq i32 %101, %105
  br i1 %106, label %120, label %107

107:                                              ; preds = %97
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.udp_pcb, ptr %108, i32 0, i32 0
  %110 = getelementptr inbounds %struct.ip4_addr, ptr %109, i32 0, i32 0
  %111 = load i32, ptr %110, align 8, !tbaa !26
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.netif, ptr %112, i32 0, i32 1
  %114 = getelementptr inbounds %struct.ip4_addr, ptr %113, i32 0, i32 0
  %115 = load i32, ptr %114, align 8, !tbaa !27
  %116 = icmp eq i32 %111, %115
  br i1 %116, label %117, label %119

117:                                              ; preds = %107
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %118, ptr %8, align 8, !tbaa !5
  br label %119

119:                                              ; preds = %117, %107
  br label %120

120:                                              ; preds = %119, %97
  br label %134

121:                                              ; preds = %94, %90
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.udp_pcb, ptr %122, i32 0, i32 0
  %124 = icmp eq ptr %123, null
  br i1 %124, label %133, label %125

125:                                              ; preds = %121
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.udp_pcb, ptr %126, i32 0, i32 0
  %128 = getelementptr inbounds %struct.ip4_addr, ptr %127, i32 0, i32 0
  %129 = load i32, ptr %128, align 8, !tbaa !26
  %130 = icmp eq i32 %129, 0
  br i1 %130, label %133, label %131

131:                                              ; preds = %125
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %132, ptr %8, align 8, !tbaa !5
  br label %133

133:                                              ; preds = %131, %125, %121
  br label %134

134:                                              ; preds = %133, %120
  br label %135

135:                                              ; preds = %134, %88
  br label %136

136:                                              ; preds = %135, %78
  %137 = load ptr, ptr %6, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.udp_pcb, ptr %137, i32 0, i32 9
  %139 = load i16, ptr %138, align 4, !tbaa !28
  %140 = zext i16 %139 to i32
  %141 = load i16, ptr %9, align 2, !tbaa !21
  %142 = zext i16 %141 to i32
  %143 = icmp eq i32 %140, %142
  br i1 %143, label %144, label %172

144:                                              ; preds = %136
  %145 = load ptr, ptr %6, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.udp_pcb, ptr %145, i32 0, i32 1
  %147 = getelementptr inbounds %struct.ip4_addr, ptr %146, i32 0, i32 0
  %148 = load i32, ptr %147, align 4, !tbaa !29
  %149 = icmp eq i32 %148, 0
  br i1 %149, label %157, label %150

150:                                              ; preds = %144
  %151 = load ptr, ptr %6, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.udp_pcb, ptr %151, i32 0, i32 1
  %153 = getelementptr inbounds %struct.ip4_addr, ptr %152, i32 0, i32 0
  %154 = load i32, ptr %153, align 4, !tbaa !29
  %155 = load i32, ptr getelementptr inbounds (%struct.ip_globals, ptr @ip_data, i32 0, i32 4), align 4, !tbaa !30
  %156 = icmp eq i32 %154, %155
  br i1 %156, label %157, label %172

157:                                              ; preds = %150, %144
  %158 = load ptr, ptr %7, align 8, !tbaa !5
  %159 = icmp ne ptr %158, null
  br i1 %159, label %160, label %170

160:                                              ; preds = %157
  %161 = load ptr, ptr %6, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.udp_pcb, ptr %161, i32 0, i32 6
  %163 = load ptr, ptr %162, align 8, !tbaa !31
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.udp_pcb, ptr %164, i32 0, i32 6
  store ptr %163, ptr %165, align 8, !tbaa !31
  %166 = load ptr, ptr @udp_pcbs, align 8, !tbaa !5
  %167 = load ptr, ptr %6, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.udp_pcb, ptr %167, i32 0, i32 6
  store ptr %166, ptr %168, align 8, !tbaa !31
  %169 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %169, ptr @udp_pcbs, align 8, !tbaa !5
  br label %171

170:                                              ; preds = %157
  br label %171

171:                                              ; preds = %170, %160
  br label %179

172:                                              ; preds = %150, %136
  br label %173

173:                                              ; preds = %172, %71, %63
  %174 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %174, ptr %7, align 8, !tbaa !5
  br label %175

175:                                              ; preds = %173
  %176 = load ptr, ptr %6, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.udp_pcb, ptr %176, i32 0, i32 6
  %178 = load ptr, ptr %177, align 8, !tbaa !31
  store ptr %178, ptr %6, align 8, !tbaa !5
  br label %60, !llvm.loop !32

179:                                              ; preds = %171, %60
  %180 = load ptr, ptr %6, align 8, !tbaa !5
  %181 = icmp eq ptr %180, null
  br i1 %181, label %182, label %184

182:                                              ; preds = %179
  %183 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %183, ptr %6, align 8, !tbaa !5
  br label %184

184:                                              ; preds = %182, %179
  %185 = load ptr, ptr %6, align 8, !tbaa !5
  %186 = icmp ne ptr %185, null
  br i1 %186, label %187, label %188

187:                                              ; preds = %184
  store i8 1, ptr %12, align 1, !tbaa !9
  br label %197

188:                                              ; preds = %184
  %189 = load ptr, ptr %4, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.netif, ptr %189, i32 0, i32 1
  %191 = getelementptr inbounds %struct.ip4_addr, ptr %190, i32 0, i32 0
  %192 = load i32, ptr %191, align 8, !tbaa !27
  %193 = load i32, ptr getelementptr inbounds (%struct.ip_globals, ptr @ip_data, i32 0, i32 5), align 8, !tbaa !14
  %194 = icmp eq i32 %192, %193
  %195 = zext i1 %194 to i32
  %196 = trunc i32 %195 to i8
  store i8 %196, ptr %12, align 1, !tbaa !9
  br label %197

197:                                              ; preds = %188, %187
  %198 = load i8, ptr %12, align 1, !tbaa !9
  %199 = icmp ne i8 %198, 0
  br i1 %199, label %200, label %256

200:                                              ; preds = %197
  %201 = load ptr, ptr %3, align 8, !tbaa !5
  %202 = call zeroext i8 @pbuf_remove_header(ptr noundef %201, i64 noundef 8)
  %203 = icmp ne i8 %202, 0
  br i1 %203, label %204, label %214

204:                                              ; preds = %200
  br label %205

205:                                              ; preds = %204
  br label %206

206:                                              ; preds = %205
  %207 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.4, i32 noundef 368, ptr noundef @.str.2)
  br label %208

208:                                              ; preds = %206
  br label %209

209:                                              ; preds = %208
  br label %210

210:                                              ; preds = %209
  br label %211

211:                                              ; preds = %210
  %212 = load ptr, ptr %3, align 8, !tbaa !5
  %213 = call zeroext i8 @pbuf_free(ptr noundef %212)
  br label %260

214:                                              ; preds = %200
  %215 = load ptr, ptr %6, align 8, !tbaa !5
  %216 = icmp ne ptr %215, null
  br i1 %216, label %217, label %236

217:                                              ; preds = %214
  %218 = load ptr, ptr %6, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.udp_pcb, ptr %218, i32 0, i32 10
  %220 = load ptr, ptr %219, align 8, !tbaa !34
  %221 = icmp ne ptr %220, null
  br i1 %221, label %222, label %232

222:                                              ; preds = %217
  %223 = load ptr, ptr %6, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.udp_pcb, ptr %223, i32 0, i32 10
  %225 = load ptr, ptr %224, align 8, !tbaa !34
  %226 = load ptr, ptr %6, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.udp_pcb, ptr %226, i32 0, i32 11
  %228 = load ptr, ptr %227, align 8, !tbaa !35
  %229 = load ptr, ptr %6, align 8, !tbaa !5
  %230 = load ptr, ptr %3, align 8, !tbaa !5
  %231 = load i16, ptr %9, align 2, !tbaa !21
  call void %225(ptr noundef %228, ptr noundef %229, ptr noundef %230, ptr noundef getelementptr inbounds (%struct.ip_globals, ptr @ip_data, i32 0, i32 4), i16 noundef zeroext %231)
  br label %235

232:                                              ; preds = %217
  %233 = load ptr, ptr %3, align 8, !tbaa !5
  %234 = call zeroext i8 @pbuf_free(ptr noundef %233)
  br label %260

235:                                              ; preds = %222
  br label %255

236:                                              ; preds = %214
  %237 = load i8, ptr %11, align 1, !tbaa !9
  %238 = icmp ne i8 %237, 0
  br i1 %238, label %252, label %239

239:                                              ; preds = %236
  %240 = load i32, ptr getelementptr inbounds (%struct.ip_globals, ptr @ip_data, i32 0, i32 5), align 8, !tbaa !14
  %241 = zext i32 %240 to i64
  %242 = and i64 %241, 240
  %243 = icmp eq i64 %242, 224
  br i1 %243, label %252, label %244

244:                                              ; preds = %239
  %245 = load ptr, ptr %3, align 8, !tbaa !5
  %246 = load i16, ptr getelementptr inbounds (%struct.ip_globals, ptr @ip_data, i32 0, i32 3), align 8, !tbaa !36
  %247 = zext i16 %246 to i32
  %248 = add nsw i32 %247, 8
  %249 = trunc i32 %248 to i16
  %250 = call zeroext i8 @pbuf_header_force(ptr noundef %245, i16 noundef signext %249)
  %251 = load ptr, ptr %3, align 8, !tbaa !5
  call void @icmp_dest_unreach(ptr noundef %251, i32 noundef 3)
  br label %252

252:                                              ; preds = %244, %239, %236
  %253 = load ptr, ptr %3, align 8, !tbaa !5
  %254 = call zeroext i8 @pbuf_free(ptr noundef %253)
  br label %255

255:                                              ; preds = %252, %235
  br label %259

256:                                              ; preds = %197
  %257 = load ptr, ptr %3, align 8, !tbaa !5
  %258 = call zeroext i8 @pbuf_free(ptr noundef %257)
  br label %259

259:                                              ; preds = %256, %255
  br label %260

260:                                              ; preds = %259, %232, %211, %41
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret void
}

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

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

declare zeroext i8 @pbuf_free(ptr noundef) #2

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

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i8 @udp_input_local_match(ptr noundef, ptr noundef, i8 noundef zeroext) #0

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

declare zeroext i8 @pbuf_header_force(ptr noundef, i16 noundef signext) #2

declare void @icmp_dest_unreach(ptr noundef, i32 noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !12, i64 18}
!11 = !{!"pbuf", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 18, !7, i64 20, !7, i64 21, !7, i64 22, !7, i64 23}
!12 = !{!"short", !7, i64 0}
!13 = !{!11, !6, i64 8}
!14 = !{!15, !17, i64 32}
!15 = !{!"ip_globals", !6, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !16, i64 28, !16, i64 32}
!16 = !{!"ip4_addr", !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!15, !6, i64 0}
!19 = !{!20, !12, i64 0}
!20 = !{!"udp_hdr", !12, i64 0, !12, i64 2, !12, i64 4, !12, i64 6}
!21 = !{!12, !12, i64 0}
!22 = !{!20, !12, i64 2}
!23 = !{!24, !12, i64 26}
!24 = !{!"udp_pcb", !16, i64 0, !16, i64 4, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !6, i64 16, !7, i64 24, !12, i64 26, !12, i64 28, !6, i64 32, !6, i64 40}
!25 = !{!24, !7, i64 24}
!26 = !{!24, !17, i64 0}
!27 = !{!16, !17, i64 0}
!28 = !{!24, !12, i64 28}
!29 = !{!24, !17, i64 4}
!30 = !{!15, !17, i64 28}
!31 = !{!24, !6, i64 16}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!24, !6, i64 32}
!35 = !{!24, !6, i64 40}
!36 = !{!15, !12, i64 24}


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

@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [178 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@ip_data = external global %struct.ip_globals, align 8
@udp_pcbs = external dso_local local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @udp_input(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %3, label %5

3:                                                ; preds = %2
  %4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.1, i32 noundef 207, ptr noundef nonnull @.str.2)
  br label %5

5:                                                ; preds = %2, %3
  %.not64 = icmp eq ptr %1, null
  br i1 %.not64, label %6, label %8

6:                                                ; preds = %5
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.3, i32 noundef 208, ptr noundef nonnull @.str.2)
  br label %8

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

12:                                               ; preds = %8
  %13 = tail call zeroext i8 @pbuf_free(ptr noundef nonnull %0) #3
  br label %124

14:                                               ; preds = %8
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = load i32, ptr getelementptr inbounds (i8, ptr @ip_data, i64 32), align 8, !tbaa !12
  %18 = load ptr, ptr @ip_data, align 8, !tbaa !16
  %19 = tail call zeroext i8 @ip4_addr_isbroadcast_u32(i32 noundef %17, ptr noundef %18) #3
  %.fr89 = freeze i8 %19
  %20 = load i16, ptr %16, align 1, !tbaa !17
  %21 = tail call zeroext i16 @lwip_htons(i16 noundef zeroext %20) #3
  %22 = getelementptr inbounds i8, ptr %16, i64 2
  %23 = load i16, ptr %22, align 1, !tbaa !19
  %24 = tail call zeroext i16 @lwip_htons(i16 noundef zeroext %23) #3
  %.05782 = load ptr, ptr @udp_pcbs, align 8, !tbaa !20
  %.not6583 = icmp eq ptr %.05782, null
  br i1 %.not6583, label %.loopexit.thread100, label %.lr.ph

.lr.ph:                                           ; preds = %14
  %.not90 = icmp eq i8 %.fr89, 0
  %25 = getelementptr inbounds i8, ptr %1, i64 8
  br i1 %.not90, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %51
  %.05786.us = phi ptr [ %.057.us, %51 ], [ %.05782, %.lr.ph ]
  %.05885.us = phi ptr [ %.05786.us, %51 ], [ null, %.lr.ph ]
  %.05984.us = phi ptr [ %.2.us, %51 ], [ null, %.lr.ph ]
  %26 = getelementptr inbounds i8, ptr %.05786.us, i64 26
  %27 = load i16, ptr %26, align 2, !tbaa !21
  %28 = icmp eq i16 %27, %24
  br i1 %28, label %29, label %51

29:                                               ; preds = %.lr.ph.split.us
  %30 = tail call zeroext i8 @udp_input_local_match(ptr noundef nonnull %.05786.us, ptr noundef %1, i8 noundef zeroext 0)
  %.not66.us = icmp eq i8 %30, 0
  br i1 %.not66.us, label %51, label %31

31:                                               ; preds = %29
  %32 = getelementptr inbounds i8, ptr %.05786.us, i64 24
  %33 = load i8, ptr %32, align 8, !tbaa !23
  %34 = and i8 %33, 4
  %35 = icmp eq i8 %34, 0
  br i1 %35, label %36, label %41

36:                                               ; preds = %31
  %37 = icmp eq ptr %.05984.us, null
  br i1 %37, label %41, label %38

38:                                               ; preds = %36
  %39 = load i32, ptr %.05786.us, align 8, !tbaa !24
  %40 = icmp eq i32 %39, 0
  %spec.select73.us = select i1 %40, ptr %.05984.us, ptr %.05786.us
  br label %41

41:                                               ; preds = %38, %36, %31
  %.160.us = phi ptr [ %.05984.us, %31 ], [ %.05786.us, %36 ], [ %spec.select73.us, %38 ]
  %42 = getelementptr inbounds i8, ptr %.05786.us, i64 28
  %43 = load i16, ptr %42, align 4, !tbaa !25
  %44 = icmp eq i16 %43, %21
  br i1 %44, label %45, label %51

45:                                               ; preds = %41
  %46 = getelementptr inbounds i8, ptr %.05786.us, i64 4
  %47 = load i32, ptr %46, align 4, !tbaa !26
  %48 = icmp eq i32 %47, 0
  %49 = load i32, ptr getelementptr inbounds (i8, ptr @ip_data, i64 28), align 4
  %50 = icmp eq i32 %47, %49
  %or.cond75.us = select i1 %48, i1 true, i1 %50
  br i1 %or.cond75.us, label %.split.us, label %51

51:                                               ; preds = %45, %41, %29, %.lr.ph.split.us
  %.2.us = phi ptr [ %.160.us, %41 ], [ %.05984.us, %29 ], [ %.05984.us, %.lr.ph.split.us ], [ %.160.us, %45 ]
  %52 = getelementptr inbounds i8, ptr %.05786.us, i64 16
  %.057.us = load ptr, ptr %52, align 8, !tbaa !20
  %.not65.us = icmp eq ptr %.057.us, null
  br i1 %.not65.us, label %.loopexit, label %.lr.ph.split.us, !llvm.loop !27

.lr.ph.split:                                     ; preds = %.lr.ph, %93
  %.05786 = phi ptr [ %.057, %93 ], [ %.05782, %.lr.ph ]
  %.05885 = phi ptr [ %.05786, %93 ], [ null, %.lr.ph ]
  %.05984 = phi ptr [ %.2, %93 ], [ null, %.lr.ph ]
  %53 = getelementptr inbounds i8, ptr %.05786, i64 26
  %54 = load i16, ptr %53, align 2, !tbaa !21
  %55 = icmp eq i16 %54, %24
  br i1 %55, label %56, label %93

56:                                               ; preds = %.lr.ph.split
  %57 = tail call zeroext i8 @udp_input_local_match(ptr noundef nonnull %.05786, ptr noundef %1, i8 noundef zeroext %.fr89)
  %.not66 = icmp eq i8 %57, 0
  br i1 %.not66, label %93, label %58

58:                                               ; preds = %56
  %59 = getelementptr inbounds i8, ptr %.05786, i64 24
  %60 = load i8, ptr %59, align 8, !tbaa !23
  %61 = and i8 %60, 4
  %62 = icmp eq i8 %61, 0
  br i1 %62, label %63, label %78

63:                                               ; preds = %58
  %64 = icmp eq ptr %.05984, null
  br i1 %64, label %78, label %65

65:                                               ; preds = %63
  %66 = load i32, ptr getelementptr inbounds (i8, ptr @ip_data, i64 32), align 8
  %67 = icmp eq i32 %66, -1
  br i1 %67, label %68, label %75

68:                                               ; preds = %65
  %69 = load i32, ptr %.05984, align 8, !tbaa !24
  %70 = load i32, ptr %25, align 8, !tbaa !29
  %71 = icmp eq i32 %69, %70
  br i1 %71, label %78, label %72

72:                                               ; preds = %68
  %73 = load i32, ptr %.05786, align 8, !tbaa !24
  %74 = icmp eq i32 %73, %70
  %spec.select = select i1 %74, ptr %.05786, ptr %.05984
  br label %78

75:                                               ; preds = %65
  %76 = load i32, ptr %.05786, align 8, !tbaa !24
  %77 = icmp eq i32 %76, 0
  %spec.select73 = select i1 %77, ptr %.05984, ptr %.05786
  br label %78

78:                                               ; preds = %75, %72, %63, %68, %58
  %.160 = phi ptr [ %.05984, %68 ], [ %.05984, %58 ], [ %.05786, %63 ], [ %spec.select, %72 ], [ %spec.select73, %75 ]
  %79 = getelementptr inbounds i8, ptr %.05786, i64 28
  %80 = load i16, ptr %79, align 4, !tbaa !25
  %81 = icmp eq i16 %80, %21
  br i1 %81, label %82, label %93

82:                                               ; preds = %78
  %83 = getelementptr inbounds i8, ptr %.05786, i64 4
  %84 = load i32, ptr %83, align 4, !tbaa !26
  %85 = icmp eq i32 %84, 0
  %86 = load i32, ptr getelementptr inbounds (i8, ptr @ip_data, i64 28), align 4
  %87 = icmp eq i32 %84, %86
  %or.cond75 = select i1 %85, i1 true, i1 %87
  br i1 %or.cond75, label %.split.us, label %93

.split.us:                                        ; preds = %82, %45
  %.us-phi = phi ptr [ %.05885.us, %45 ], [ %.05885, %82 ]
  %.us-phi87 = phi ptr [ %.05786.us, %45 ], [ %.05786, %82 ]
  %.not67 = icmp eq ptr %.us-phi, null
  br i1 %.not67, label %.critedge.thread, label %88

88:                                               ; preds = %.split.us
  %89 = getelementptr inbounds i8, ptr %.us-phi87, i64 16
  %90 = load ptr, ptr %89, align 8, !tbaa !30
  %91 = getelementptr inbounds i8, ptr %.us-phi, i64 16
  store ptr %90, ptr %91, align 8, !tbaa !30
  %92 = load ptr, ptr @udp_pcbs, align 8, !tbaa !20
  store ptr %92, ptr %89, align 8, !tbaa !30
  store ptr %.us-phi87, ptr @udp_pcbs, align 8, !tbaa !20
  br label %.critedge.thread

93:                                               ; preds = %82, %78, %56, %.lr.ph.split
  %.2 = phi ptr [ %.160, %78 ], [ %.05984, %56 ], [ %.05984, %.lr.ph.split ], [ %.160, %82 ]
  %94 = getelementptr inbounds i8, ptr %.05786, i64 16
  %.057 = load ptr, ptr %94, align 8, !tbaa !20
  %.not65 = icmp eq ptr %.057, null
  br i1 %.not65, label %.loopexit, label %.lr.ph.split, !llvm.loop !27

.loopexit:                                        ; preds = %93, %51
  %spec.select76 = phi ptr [ %.2.us, %51 ], [ %.2, %93 ]
  %.not68 = icmp eq ptr %spec.select76, null
  br i1 %.not68, label %.loopexit.thread100, label %.critedge.thread

.loopexit.thread100:                              ; preds = %14, %.loopexit
  %95 = getelementptr inbounds i8, ptr %1, i64 8
  %96 = load i32, ptr %95, align 8, !tbaa !29
  %97 = load i32, ptr getelementptr inbounds (i8, ptr @ip_data, i64 32), align 8, !tbaa !12
  %.not78 = icmp eq i32 %96, %97
  br i1 %.not78, label %.critedge, label %122

.critedge:                                        ; preds = %.loopexit.thread100
  %98 = tail call zeroext i8 @pbuf_remove_header(ptr noundef %0, i64 noundef 8) #3
  %.not70 = icmp eq i8 %98, 0
  br i1 %.not70, label %111, label %100

.critedge.thread:                                 ; preds = %.split.us, %88, %.loopexit
  %spec.select7699 = phi ptr [ %spec.select76, %.loopexit ], [ %.us-phi87, %88 ], [ %.us-phi87, %.split.us ]
  %99 = tail call zeroext i8 @pbuf_remove_header(ptr noundef %0, i64 noundef 8) #3
  %.not7077 = icmp eq i8 %99, 0
  br i1 %.not7077, label %103, label %100

100:                                              ; preds = %.critedge.thread, %.critedge
  %101 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.4, i32 noundef 368, ptr noundef nonnull @.str.2)
  %102 = tail call zeroext i8 @pbuf_free(ptr noundef %0) #3
  br label %124

103:                                              ; preds = %.critedge.thread
  %104 = getelementptr inbounds i8, ptr %spec.select7699, i64 32
  %105 = load ptr, ptr %104, align 8, !tbaa !31
  %.not72 = icmp eq ptr %105, null
  br i1 %.not72, label %109, label %106

106:                                              ; preds = %103
  %107 = getelementptr inbounds i8, ptr %spec.select7699, i64 40
  %108 = load ptr, ptr %107, align 8, !tbaa !32
  tail call void %105(ptr noundef %108, ptr noundef nonnull %spec.select7699, ptr noundef %0, ptr noundef nonnull getelementptr inbounds (i8, ptr @ip_data, i64 28), i16 noundef zeroext %21) #3
  br label %124

109:                                              ; preds = %103
  %110 = tail call zeroext i8 @pbuf_free(ptr noundef %0) #3
  br label %124

111:                                              ; preds = %.critedge
  %.not71 = icmp eq i8 %.fr89, 0
  br i1 %.not71, label %112, label %120

112:                                              ; preds = %111
  %113 = load i32, ptr getelementptr inbounds (i8, ptr @ip_data, i64 32), align 8, !tbaa !12
  %114 = and i32 %113, 240
  %115 = icmp eq i32 %114, 224
  br i1 %115, label %120, label %116

116:                                              ; preds = %112
  %117 = load i16, ptr getelementptr inbounds (i8, ptr @ip_data, i64 24), align 8, !tbaa !33
  %118 = add i16 %117, 8
  %119 = tail call zeroext i8 @pbuf_header_force(ptr noundef %0, i16 noundef signext %118) #3
  tail call void @icmp_dest_unreach(ptr noundef %0, i32 noundef 3) #3
  br label %120

120:                                              ; preds = %116, %112, %111
  %121 = tail call zeroext i8 @pbuf_free(ptr noundef %0) #3
  br label %124

122:                                              ; preds = %.loopexit.thread100
  %123 = tail call zeroext i8 @pbuf_free(ptr noundef %0) #3
  br label %124

124:                                              ; preds = %122, %120, %106, %109, %100, %12
  ret void
}

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i8 @udp_input_local_match(ptr noundef, ptr noundef, i8 noundef zeroext) local_unnamed_addr #0

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

declare zeroext i8 @pbuf_header_force(ptr noundef, i16 noundef signext) local_unnamed_addr #2

declare void @icmp_dest_unreach(ptr noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #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, !10, i64 18}
!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 = !{!6, !7, i64 8}
!12 = !{!13, !15, i64 32}
!13 = !{!"ip_globals", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !14, i64 28, !14, i64 32}
!14 = !{!"ip4_addr", !15, i64 0}
!15 = !{!"int", !8, i64 0}
!16 = !{!13, !7, i64 0}
!17 = !{!18, !10, i64 0}
!18 = !{!"udp_hdr", !10, i64 0, !10, i64 2, !10, i64 4, !10, i64 6}
!19 = !{!18, !10, i64 2}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !10, i64 26}
!22 = !{!"udp_pcb", !14, i64 0, !14, i64 4, !8, i64 8, !8, i64 9, !8, i64 10, !8, i64 11, !7, i64 16, !8, i64 24, !10, i64 26, !10, i64 28, !7, i64 32, !7, i64 40}
!23 = !{!22, !8, i64 24}
!24 = !{!22, !15, i64 0}
!25 = !{!22, !10, i64 28}
!26 = !{!22, !15, i64 4}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!14, !15, i64 0}
!30 = !{!22, !7, i64 16}
!31 = !{!22, !7, i64 32}
!32 = !{!22, !7, i64 40}
!33 = !{!13, !10, i64 24}


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