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

; 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.etharp_entry = type { ptr, %struct.ip4_addr, ptr, %struct.eth_addr, i16, i8 }
%struct.ip4_addr = type { i32 }
%struct.eth_addr = type { [6 x i8] }
%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 }
%struct.pbuf = type { ptr, ptr, i16, i16, i8, i8, i8, i8 }

@arp_table = external hidden global [10 x %struct.etharp_entry], align 16
@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [186 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i8], align 1
@etharp_cached_entry = external hidden global i8, align 1
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [26 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: nounwind uwtable
declare dso_local signext i8 @etharp_request(ptr noundef, ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
declare hidden signext i16 @etharp_find_entry(ptr noundef, i8 noundef zeroext, ptr noundef) #1

declare zeroext i8 @pbuf_free(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local signext i8 @etharp_query(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca i8, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i16, align 2
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.netif, ptr %16, i32 0, i32 11
  %18 = getelementptr inbounds [6 x i8], ptr %17, i64 0, i64 0
  store ptr %18, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #3
  store i8 -1, ptr %9, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #3
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.ip4_addr, ptr %19, i32 0, i32 0
  %21 = load i32, ptr %20, align 4, !tbaa !12
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = call zeroext i8 @ip4_addr_isbroadcast_u32(i32 noundef %21, ptr noundef %22)
  %24 = zext i8 %23 to i32
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %41, label %26

26:                                               ; preds = %3
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.ip4_addr, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 4, !tbaa !12
  %30 = zext i32 %29 to i64
  %31 = and i64 %30, 240
  %32 = icmp eq i64 %31, 224
  br i1 %32, label %41, label %33

33:                                               ; preds = %26
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = icmp eq ptr %34, null
  br i1 %35, label %41, label %36

36:                                               ; preds = %33
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.ip4_addr, ptr %37, i32 0, i32 0
  %39 = load i32, ptr %38, align 4, !tbaa !12
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %41, label %42

41:                                               ; preds = %36, %33, %26, %3
  store i8 -16, ptr %4, align 1
  store i32 1, ptr %13, align 4
  br label %246

42:                                               ; preds = %36
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = call signext i16 @etharp_find_entry(ptr noundef %43, i8 noundef zeroext 1, ptr noundef %44)
  store i16 %45, ptr %11, align 2, !tbaa !14
  %46 = load i16, ptr %11, align 2, !tbaa !14
  %47 = sext i16 %46 to i32
  %48 = icmp slt i32 %47, 0
  br i1 %48, label %49, label %56

49:                                               ; preds = %42
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %52, label %53

52:                                               ; preds = %49
  br label %53

53:                                               ; preds = %52, %49
  %54 = load i16, ptr %11, align 2, !tbaa !14
  %55 = trunc i16 %54 to i8
  store i8 %55, ptr %4, align 1
  store i32 1, ptr %13, align 4
  br label %246

56:                                               ; preds = %42
  br label %57

57:                                               ; preds = %56
  %58 = load i16, ptr %11, align 2, !tbaa !14
  %59 = sext i16 %58 to i64
  %60 = icmp ult i64 %59, 127
  br i1 %60, label %66, label %61

61:                                               ; preds = %57
  br label %62

62:                                               ; preds = %61
  %63 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.7, i32 noundef 961, ptr noundef @.str.2)
  br label %64

64:                                               ; preds = %62
  br label %65

65:                                               ; preds = %64
  br label %66

66:                                               ; preds = %65, %57
  br label %67

67:                                               ; preds = %66
  br label %68

68:                                               ; preds = %67
  %69 = load i16, ptr %11, align 2, !tbaa !14
  %70 = trunc i16 %69 to i8
  store i8 %70, ptr %12, align 1, !tbaa !9
  %71 = load i8, ptr %12, align 1, !tbaa !9
  %72 = zext i8 %71 to i64
  %73 = getelementptr inbounds [10 x %struct.etharp_entry], ptr @arp_table, i64 0, i64 %72
  %74 = getelementptr inbounds %struct.etharp_entry, ptr %73, i32 0, i32 5
  %75 = load i8, ptr %74, align 8, !tbaa !16
  %76 = zext i8 %75 to i32
  %77 = icmp eq i32 %76, 0
  br i1 %77, label %78, label %88

78:                                               ; preds = %68
  store i32 1, ptr %10, align 4, !tbaa !10
  %79 = load i8, ptr %12, align 1, !tbaa !9
  %80 = zext i8 %79 to i64
  %81 = getelementptr inbounds [10 x %struct.etharp_entry], ptr @arp_table, i64 0, i64 %80
  %82 = getelementptr inbounds %struct.etharp_entry, ptr %81, i32 0, i32 5
  store i8 1, ptr %82, align 8, !tbaa !16
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = load i8, ptr %12, align 1, !tbaa !9
  %85 = zext i8 %84 to i64
  %86 = getelementptr inbounds [10 x %struct.etharp_entry], ptr @arp_table, i64 0, i64 %85
  %87 = getelementptr inbounds %struct.etharp_entry, ptr %86, i32 0, i32 2
  store ptr %83, ptr %87, align 8, !tbaa !19
  br label %88

88:                                               ; preds = %78, %68
  br label %89

89:                                               ; preds = %88
  %90 = load i8, ptr %12, align 1, !tbaa !9
  %91 = zext i8 %90 to i64
  %92 = getelementptr inbounds [10 x %struct.etharp_entry], ptr @arp_table, i64 0, i64 %91
  %93 = getelementptr inbounds %struct.etharp_entry, ptr %92, i32 0, i32 5
  %94 = load i8, ptr %93, align 8, !tbaa !16
  %95 = zext i8 %94 to i32
  %96 = icmp eq i32 %95, 1
  br i1 %96, label %110, label %97

97:                                               ; preds = %89
  %98 = load i8, ptr %12, align 1, !tbaa !9
  %99 = zext i8 %98 to i64
  %100 = getelementptr inbounds [10 x %struct.etharp_entry], ptr @arp_table, i64 0, i64 %99
  %101 = getelementptr inbounds %struct.etharp_entry, ptr %100, i32 0, i32 5
  %102 = load i8, ptr %101, align 8, !tbaa !16
  %103 = zext i8 %102 to i32
  %104 = icmp sge i32 %103, 2
  br i1 %104, label %110, label %105

105:                                              ; preds = %97
  br label %106

106:                                              ; preds = %105
  %107 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.8, i32 noundef 975, ptr noundef @.str.2)
  br label %108

108:                                              ; preds = %106
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109, %97, %89
  br label %111

111:                                              ; preds = %110
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %10, align 4, !tbaa !10
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %118, label %115

115:                                              ; preds = %112
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = icmp eq ptr %116, null
  br i1 %117, label %118, label %132

118:                                              ; preds = %115, %112
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = call signext i8 @etharp_request(ptr noundef %119, ptr noundef %120)
  store i8 %121, ptr %9, align 1, !tbaa !9
  %122 = load i8, ptr %9, align 1, !tbaa !9
  %123 = sext i8 %122 to i32
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %126

125:                                              ; preds = %118
  br label %126

126:                                              ; preds = %125, %118
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = icmp eq ptr %127, null
  br i1 %128, label %129, label %131

129:                                              ; preds = %126
  %130 = load i8, ptr %9, align 1, !tbaa !9
  store i8 %130, ptr %4, align 1
  store i32 1, ptr %13, align 4
  br label %246

131:                                              ; preds = %126
  br label %132

132:                                              ; preds = %131, %115
  br label %133

133:                                              ; preds = %132
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = icmp ne ptr %134, null
  br i1 %135, label %141, label %136

136:                                              ; preds = %133
  br label %137

137:                                              ; preds = %136
  %138 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.6, i32 noundef 993, ptr noundef @.str.2)
  br label %139

139:                                              ; preds = %137
  br label %140

140:                                              ; preds = %139
  br label %141

141:                                              ; preds = %140, %133
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142
  %144 = load i8, ptr %12, align 1, !tbaa !9
  %145 = zext i8 %144 to i64
  %146 = getelementptr inbounds [10 x %struct.etharp_entry], ptr @arp_table, i64 0, i64 %145
  %147 = getelementptr inbounds %struct.etharp_entry, ptr %146, i32 0, i32 5
  %148 = load i8, ptr %147, align 8, !tbaa !16
  %149 = zext i8 %148 to i32
  %150 = icmp sge i32 %149, 2
  br i1 %150, label %151, label %161

151:                                              ; preds = %143
  %152 = load i8, ptr %12, align 1, !tbaa !9
  store i8 %152, ptr @etharp_cached_entry, align 1, !tbaa !9
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = load ptr, ptr %8, align 8, !tbaa !5
  %156 = load i8, ptr %12, align 1, !tbaa !9
  %157 = zext i8 %156 to i64
  %158 = getelementptr inbounds [10 x %struct.etharp_entry], ptr @arp_table, i64 0, i64 %157
  %159 = getelementptr inbounds %struct.etharp_entry, ptr %158, i32 0, i32 3
  %160 = call signext i8 @ethernet_output(ptr noundef %153, ptr noundef %154, ptr noundef %155, ptr noundef %159, i16 noundef zeroext 2048)
  store i8 %160, ptr %9, align 1, !tbaa !9
  br label %244

161:                                              ; preds = %143
  %162 = load i8, ptr %12, align 1, !tbaa !9
  %163 = zext i8 %162 to i64
  %164 = getelementptr inbounds [10 x %struct.etharp_entry], ptr @arp_table, i64 0, i64 %163
  %165 = getelementptr inbounds %struct.etharp_entry, ptr %164, i32 0, i32 5
  %166 = load i8, ptr %165, align 8, !tbaa !16
  %167 = zext i8 %166 to i32
  %168 = icmp eq i32 %167, 1
  br i1 %168, label %169, label %243

169:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  store i32 0, ptr %15, align 4, !tbaa !10
  %170 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %170, ptr %14, align 8, !tbaa !5
  br label %171

171:                                              ; preds = %205, %169
  %172 = load ptr, ptr %14, align 8, !tbaa !5
  %173 = icmp ne ptr %172, null
  br i1 %173, label %174, label %209

174:                                              ; preds = %171
  br label %175

175:                                              ; preds = %174
  %176 = load ptr, ptr %14, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.pbuf, ptr %176, i32 0, i32 3
  %178 = load i16, ptr %177, align 2, !tbaa !20
  %179 = zext i16 %178 to i32
  %180 = load ptr, ptr %14, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.pbuf, ptr %180, i32 0, i32 2
  %182 = load i16, ptr %181, align 8, !tbaa !22
  %183 = zext i16 %182 to i32
  %184 = icmp ne i32 %179, %183
  br i1 %184, label %195, label %185

185:                                              ; preds = %175
  %186 = load ptr, ptr %14, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.pbuf, ptr %186, i32 0, i32 0
  %188 = load ptr, ptr %187, align 8, !tbaa !23
  %189 = icmp eq ptr %188, null
  br i1 %189, label %195, label %190

190:                                              ; preds = %185
  br label %191

191:                                              ; preds = %190
  %192 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.9, i32 noundef 1009, ptr noundef @.str.2)
  br label %193

193:                                              ; preds = %191
  br label %194

194:                                              ; preds = %193
  br label %195

195:                                              ; preds = %194, %185, %175
  br label %196

196:                                              ; preds = %195
  br label %197

197:                                              ; preds = %196
  %198 = load ptr, ptr %14, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.pbuf, ptr %198, i32 0, i32 4
  %200 = load i8, ptr %199, align 4, !tbaa !24
  %201 = zext i8 %200 to i32
  %202 = and i32 %201, 64
  %203 = icmp ne i32 %202, 0
  br i1 %203, label %204, label %205

204:                                              ; preds = %197
  store i32 1, ptr %15, align 4, !tbaa !10
  br label %209

205:                                              ; preds = %197
  %206 = load ptr, ptr %14, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.pbuf, ptr %206, i32 0, i32 0
  %208 = load ptr, ptr %207, align 8, !tbaa !23
  store ptr %208, ptr %14, align 8, !tbaa !5
  br label %171, !llvm.loop !25

209:                                              ; preds = %204, %171
  %210 = load i32, ptr %15, align 4, !tbaa !10
  %211 = icmp ne i32 %210, 0
  br i1 %211, label %212, label %215

212:                                              ; preds = %209
  %213 = load ptr, ptr %7, align 8, !tbaa !5
  %214 = call ptr @pbuf_clone(i32 noundef 16, i32 noundef 640, ptr noundef %213)
  store ptr %214, ptr %14, align 8, !tbaa !5
  br label %218

215:                                              ; preds = %209
  %216 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %216, ptr %14, align 8, !tbaa !5
  %217 = load ptr, ptr %14, align 8, !tbaa !5
  call void @pbuf_ref(ptr noundef %217)
  br label %218

218:                                              ; preds = %215, %212
  %219 = load ptr, ptr %14, align 8, !tbaa !5
  %220 = icmp ne ptr %219, null
  br i1 %220, label %221, label %241

221:                                              ; preds = %218
  %222 = load i8, ptr %12, align 1, !tbaa !9
  %223 = zext i8 %222 to i64
  %224 = getelementptr inbounds [10 x %struct.etharp_entry], ptr @arp_table, i64 0, i64 %223
  %225 = getelementptr inbounds %struct.etharp_entry, ptr %224, i32 0, i32 0
  %226 = load ptr, ptr %225, align 8, !tbaa !27
  %227 = icmp ne ptr %226, null
  br i1 %227, label %228, label %235

228:                                              ; preds = %221
  %229 = load i8, ptr %12, align 1, !tbaa !9
  %230 = zext i8 %229 to i64
  %231 = getelementptr inbounds [10 x %struct.etharp_entry], ptr @arp_table, i64 0, i64 %230
  %232 = getelementptr inbounds %struct.etharp_entry, ptr %231, i32 0, i32 0
  %233 = load ptr, ptr %232, align 8, !tbaa !27
  %234 = call zeroext i8 @pbuf_free(ptr noundef %233)
  br label %235

235:                                              ; preds = %228, %221
  %236 = load ptr, ptr %14, align 8, !tbaa !5
  %237 = load i8, ptr %12, align 1, !tbaa !9
  %238 = zext i8 %237 to i64
  %239 = getelementptr inbounds [10 x %struct.etharp_entry], ptr @arp_table, i64 0, i64 %238
  %240 = getelementptr inbounds %struct.etharp_entry, ptr %239, i32 0, i32 0
  store ptr %236, ptr %240, align 8, !tbaa !27
  store i8 0, ptr %9, align 1, !tbaa !9
  br label %242

241:                                              ; preds = %218
  store i8 -1, ptr %9, align 1, !tbaa !9
  br label %242

242:                                              ; preds = %241, %235
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  br label %243

243:                                              ; preds = %242, %161
  br label %244

244:                                              ; preds = %243, %151
  %245 = load i8, ptr %9, align 1, !tbaa !9
  store i8 %245, ptr %4, align 1
  store i32 1, ptr %13, align 4
  br label %246

246:                                              ; preds = %244, %129, %53, %41
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %247 = load i8, ptr %4, align 1
  ret i8 %247
}

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

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

declare void @pbuf_ref(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 = { 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, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 0}
!13 = !{!"ip4_addr", !11, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = !{!17, !7, i64 32}
!17 = !{!"etharp_entry", !6, i64 0, !13, i64 8, !6, i64 16, !18, i64 24, !15, i64 30, !7, i64 32}
!18 = !{!"eth_addr", !7, i64 0}
!19 = !{!17, !6, i64 16}
!20 = !{!21, !15, i64 18}
!21 = !{!"pbuf", !6, i64 0, !6, i64 8, !15, i64 16, !15, i64 18, !7, i64 20, !7, i64 21, !7, i64 22, !7, i64 23}
!22 = !{!21, !15, i64 16}
!23 = !{!21, !6, i64 0}
!24 = !{!21, !7, i64 20}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!17, !6, i64 0}


; 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.etharp_entry = type { ptr, %struct.ip4_addr, ptr, %struct.eth_addr, i16, i8 }
%struct.ip4_addr = type { i32 }
%struct.eth_addr = type { [6 x i8] }

@arp_table = external hidden global [10 x %struct.etharp_entry], align 16
@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [186 x i8], align 1
@etharp_cached_entry = external hidden local_unnamed_addr global i8, align 1
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local signext i8 @etharp_request(ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: nounwind uwtable
define dso_local signext i8 @etharp_query(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 74
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = tail call zeroext i8 @ip4_addr_isbroadcast_u32(i32 noundef %5, ptr noundef %0) #3
  %.not = icmp eq i8 %6, 0
  br i1 %.not, label %7, label %65

7:                                                ; preds = %3
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %9 = and i32 %8, 240
  %10 = icmp eq i32 %9, 224
  %11 = icmp eq i32 %8, 0
  %or.cond = or i1 %11, %10
  br i1 %or.cond, label %65, label %12

12:                                               ; preds = %7
  %13 = tail call signext i16 @etharp_find_entry(ptr noundef nonnull %1, i8 noundef zeroext 1, ptr noundef %0)
  %14 = icmp slt i16 %13, 0
  br i1 %14, label %15, label %17

15:                                               ; preds = %12
  %16 = trunc i16 %13 to i8
  br label %65

17:                                               ; preds = %12
  %18 = icmp ult i16 %13, 127
  br i1 %18, label %21, label %19

19:                                               ; preds = %17
  %20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.7, i32 noundef 961, ptr noundef nonnull @.str.2)
  br label %21

21:                                               ; preds = %19, %17
  %22 = trunc i16 %13 to i8
  %.mask = and i16 %13, 255
  %23 = zext nneg i16 %.mask to i64
  %24 = getelementptr inbounds [10 x %struct.etharp_entry], ptr @arp_table, i64 0, i64 %23
  %25 = getelementptr inbounds i8, ptr %24, i64 32
  %26 = load i8, ptr %25, align 8, !tbaa !10
  %27 = icmp eq i8 %26, 0
  br i1 %27, label %.thread, label %31

.thread:                                          ; preds = %21
  store i8 1, ptr %25, align 8, !tbaa !10
  %28 = getelementptr inbounds i8, ptr %24, i64 16
  store ptr %0, ptr %28, align 8, !tbaa !15
  %29 = icmp eq ptr %2, null
  %30 = tail call signext i8 @etharp_request(ptr noundef %0, ptr noundef nonnull %1)
  br i1 %29, label %65, label %.thread71thread-pre-split

31:                                               ; preds = %21
  %32 = icmp eq ptr %2, null
  br i1 %32, label %33, label %.thread71

33:                                               ; preds = %31
  %34 = tail call signext i8 @etharp_request(ptr noundef %0, ptr noundef nonnull %1)
  br label %65

.thread71thread-pre-split:                        ; preds = %.thread
  %.pr = load i8, ptr %25, align 8, !tbaa !10
  br label %.thread71

.thread71:                                        ; preds = %.thread71thread-pre-split, %31
  %35 = phi i8 [ %.pr, %.thread71thread-pre-split ], [ %26, %31 ]
  %.05673 = phi i8 [ %30, %.thread71thread-pre-split ], [ -1, %31 ]
  %36 = icmp ugt i8 %35, 1
  br i1 %36, label %37, label %40

37:                                               ; preds = %.thread71
  store i8 %22, ptr @etharp_cached_entry, align 1, !tbaa !16
  %38 = getelementptr inbounds i8, ptr %24, i64 24
  %39 = tail call signext i8 @ethernet_output(ptr noundef %0, ptr noundef nonnull %2, ptr noundef nonnull %4, ptr noundef nonnull %38, i16 noundef zeroext 2048) #3
  br label %65

40:                                               ; preds = %.thread71
  %41 = icmp eq i8 %35, 1
  br i1 %41, label %.lr.ph, label %65

.lr.ph:                                           ; preds = %40, %55
  %.05475 = phi ptr [ %56, %55 ], [ %2, %40 ]
  %42 = getelementptr inbounds i8, ptr %.05475, i64 18
  %43 = load i16, ptr %42, align 2, !tbaa !17
  %44 = getelementptr inbounds i8, ptr %.05475, i64 16
  %45 = load i16, ptr %44, align 8, !tbaa !19
  %.not65 = icmp eq i16 %43, %45
  br i1 %.not65, label %46, label %51

46:                                               ; preds = %.lr.ph
  %47 = load ptr, ptr %.05475, align 8, !tbaa !20
  %48 = icmp eq ptr %47, null
  br i1 %48, label %51, label %49

49:                                               ; preds = %46
  %50 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.9, i32 noundef 1009, ptr noundef nonnull @.str.2)
  br label %51

51:                                               ; preds = %49, %46, %.lr.ph
  %52 = getelementptr inbounds i8, ptr %.05475, i64 20
  %53 = load i8, ptr %52, align 4, !tbaa !21
  %54 = and i8 %53, 64
  %.not66 = icmp eq i8 %54, 0
  br i1 %.not66, label %55, label %57

55:                                               ; preds = %51
  %56 = load ptr, ptr %.05475, align 8, !tbaa !20
  %.not64 = icmp eq ptr %56, null
  br i1 %.not64, label %.critedge, label %.lr.ph, !llvm.loop !22

57:                                               ; preds = %51
  %58 = tail call ptr @pbuf_clone(i32 noundef 16, i32 noundef 640, ptr noundef nonnull %2) #3
  br label %59

.critedge:                                        ; preds = %55
  tail call void @pbuf_ref(ptr noundef %2) #3
  br label %59

59:                                               ; preds = %.critedge, %57
  %.1 = phi ptr [ %58, %57 ], [ %2, %.critedge ]
  %.not68 = icmp eq ptr %.1, null
  br i1 %.not68, label %65, label %60

60:                                               ; preds = %59
  %61 = load ptr, ptr %24, align 8, !tbaa !24
  %.not69 = icmp eq ptr %61, null
  br i1 %.not69, label %64, label %62

62:                                               ; preds = %60
  %63 = tail call zeroext i8 @pbuf_free(ptr noundef nonnull %61) #3
  br label %64

64:                                               ; preds = %62, %60
  store ptr %.1, ptr %24, align 8, !tbaa !24
  br label %65

65:                                               ; preds = %33, %.thread, %37, %40, %59, %64, %3, %7, %15
  %.055 = phi i8 [ %16, %15 ], [ -16, %7 ], [ -16, %3 ], [ %34, %33 ], [ %39, %37 ], [ %.05673, %40 ], [ 0, %64 ], [ -1, %59 ], [ %30, %.thread ]
  ret i8 %.055
}

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

declare ptr @pbuf_clone(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @pbuf_ref(ptr noundef) local_unnamed_addr #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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, !7, i64 0}
!6 = !{!"ip4_addr", !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !8, i64 32}
!11 = !{!"etharp_entry", !12, i64 0, !6, i64 8, !12, i64 16, !13, i64 24, !14, i64 30, !8, i64 32}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"eth_addr", !8, i64 0}
!14 = !{!"short", !8, i64 0}
!15 = !{!11, !12, i64 16}
!16 = !{!8, !8, i64 0}
!17 = !{!18, !14, i64 18}
!18 = !{!"pbuf", !12, i64 0, !12, i64 8, !14, i64 16, !14, i64 18, !8, i64 20, !8, i64 21, !8, i64 22, !8, i64 23}
!19 = !{!18, !14, i64 16}
!20 = !{!18, !12, i64 0}
!21 = !{!18, !8, i64 20}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!11, !12, i64 0}


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