; LLVM IR from mwarning/KadNode :: src (kad)

; 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.search = type { i16, i32, i64, [20 x i8], i16, i32, [14 x %struct.search_node], i32, ptr }
%struct.search_node = type { [20 x i8], %struct.sockaddr_storage, i32, i64, i64, i32, [40 x i8], i32, i32, i32 }
%struct.sockaddr_storage = type { i16, [118 x i8], i64 }
%struct.storage = type { [20 x i8], i32, i32, ptr, ptr }
%struct.announcement_t = type { ptr, [20 x i8], [256 x i8], i32, i32, i64, i64 }
%struct.gconf_t = type { i64, i64, ptr, ptr, ptr, ptr, ptr, i8, i8, i32, i32, i32, i32, ptr, i8, [8 x i8], i64, i64, i64, [8 x i32], [8 x i32] }

@searches = external hidden global ptr, align 8
@myid = external hidden global [20 x i8], align 16
@buckets = external hidden global ptr, align 8
@buckets6 = external hidden global ptr, align 8
@storage = external hidden global ptr, align 8
@next_blacklisted = external dso_local global i32, align 4
@gconf = external global ptr, align 8
@.str.73 = external hidden unnamed_addr constant [304 x i8], align 1
@kadnode_version_str = external global ptr, align 8
@.str.74 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @kad_status(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %20 = load ptr, ptr @storage, align 8, !tbaa !5
  store ptr %20, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %21 = load ptr, ptr @searches, align 8, !tbaa !5
  store ptr %21, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %22 = call ptr @announces_get()
  store ptr %22, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %55, %1
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %59

26:                                               ; preds = %23
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.search, ptr %27, i32 0, i32 1
  %29 = load i32, ptr %28, align 4, !tbaa !11
  %30 = icmp eq i32 %29, 10
  br i1 %30, label %31, label %43

31:                                               ; preds = %26
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.search, ptr %32, i32 0, i32 5
  %34 = load i32, ptr %33, align 8, !tbaa !15
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %39

36:                                               ; preds = %31
  %37 = load i32, ptr %9, align 4, !tbaa !9
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %9, align 4, !tbaa !9
  br label %42

39:                                               ; preds = %31
  %40 = load i32, ptr %8, align 4, !tbaa !9
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %8, align 4, !tbaa !9
  br label %42

42:                                               ; preds = %39, %36
  br label %55

43:                                               ; preds = %26
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.search, ptr %44, i32 0, i32 5
  %46 = load i32, ptr %45, align 8, !tbaa !15
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %51

48:                                               ; preds = %43
  %49 = load i32, ptr %7, align 4, !tbaa !9
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %7, align 4, !tbaa !9
  br label %54

51:                                               ; preds = %43
  %52 = load i32, ptr %6, align 4, !tbaa !9
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %6, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %51, %48
  br label %55

55:                                               ; preds = %54, %42
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.search, ptr %56, i32 0, i32 8
  %58 = load ptr, ptr %57, align 8, !tbaa !16
  store ptr %58, ptr %4, align 8, !tbaa !5
  br label %23, !llvm.loop !17

59:                                               ; preds = %23
  br label %60

60:                                               ; preds = %63, %59
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = icmp ne ptr %61, null
  br i1 %62, label %63, label %74

63:                                               ; preds = %60
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.storage, ptr %64, i32 0, i32 1
  %66 = load i32, ptr %65, align 4, !tbaa !19
  %67 = load i32, ptr %11, align 4, !tbaa !9
  %68 = add nsw i32 %67, %66
  store i32 %68, ptr %11, align 4, !tbaa !9
  %69 = load i32, ptr %10, align 4, !tbaa !9
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %10, align 4, !tbaa !9
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.storage, ptr %71, i32 0, i32 4
  %73 = load ptr, ptr %72, align 8, !tbaa !21
  store ptr %73, ptr %3, align 8, !tbaa !5
  br label %60, !llvm.loop !22

74:                                               ; preds = %60
  br label %75

75:                                               ; preds = %78, %74
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = icmp ne ptr %76, null
  br i1 %77, label %78, label %84

78:                                               ; preds = %75
  %79 = load i32, ptr %12, align 4, !tbaa !9
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %12, align 4, !tbaa !9
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.announcement_t, ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8, !tbaa !23
  store ptr %83, ptr %5, align 8, !tbaa !5
  br label %75, !llvm.loop !25

84:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %85 = load ptr, ptr @buckets, align 8, !tbaa !5
  %86 = call i32 @kad_count_bucket(ptr noundef %85, i32 noundef 0)
  store i32 %86, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %87 = load ptr, ptr @buckets6, align 8, !tbaa !5
  %88 = call i32 @kad_count_bucket(ptr noundef %87, i32 noundef 0)
  store i32 %88, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %89 = load ptr, ptr @buckets, align 8, !tbaa !5
  %90 = call i32 @kad_count_bucket(ptr noundef %89, i32 noundef 1)
  store i32 %90, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %91 = load ptr, ptr @buckets6, align 8, !tbaa !5
  %92 = call i32 @kad_count_bucket(ptr noundef %91, i32 noundef 1)
  store i32 %92, ptr %16, align 4, !tbaa !9
  call void @clear_old_traffic_counters()
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  store i64 0, ptr %19, align 8, !tbaa !26
  br label %93

93:                                               ; preds = %112, %84
  %94 = load i64, ptr %19, align 8, !tbaa !26
  %95 = icmp ult i64 %94, 8
  br i1 %95, label %97, label %96

96:                                               ; preds = %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br label %115

97:                                               ; preds = %93
  %98 = load ptr, ptr @gconf, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.gconf_t, ptr %98, i32 0, i32 19
  %100 = load i64, ptr %19, align 8, !tbaa !26
  %101 = getelementptr inbounds [8 x i32], ptr %99, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !9
  %103 = load i32, ptr %17, align 4, !tbaa !9
  %104 = add i32 %103, %102
  store i32 %104, ptr %17, align 4, !tbaa !9
  %105 = load ptr, ptr @gconf, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.gconf_t, ptr %105, i32 0, i32 20
  %107 = load i64, ptr %19, align 8, !tbaa !26
  %108 = getelementptr inbounds [8 x i32], ptr %106, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !9
  %110 = load i32, ptr %18, align 4, !tbaa !9
  %111 = add i32 %110, %109
  store i32 %111, ptr %18, align 4, !tbaa !9
  br label %112

112:                                              ; preds = %97
  %113 = load i64, ptr %19, align 8, !tbaa !26
  %114 = add i64 %113, 1
  store i64 %114, ptr %19, align 8, !tbaa !26
  br label %93, !llvm.loop !27

115:                                              ; preds = %96
  %116 = load ptr, ptr %2, align 8, !tbaa !5
  %117 = load ptr, ptr @kadnode_version_str, align 8, !tbaa !5
  %118 = call ptr @str_id(ptr noundef @myid)
  %119 = load ptr, ptr @gconf, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.gconf_t, ptr %119, i32 0, i32 0
  %121 = load i64, ptr %120, align 8, !tbaa !28
  %122 = load ptr, ptr @gconf, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.gconf_t, ptr %122, i32 0, i32 1
  %124 = load i64, ptr %123, align 8, !tbaa !31
  %125 = sub nsw i64 %121, %124
  %126 = call ptr @str_time(i64 noundef %125)
  %127 = load ptr, ptr @gconf, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.gconf_t, ptr %127, i32 0, i32 11
  %129 = load i32, ptr %128, align 4, !tbaa !32
  %130 = call ptr @str_af(i32 noundef %129)
  %131 = load ptr, ptr @gconf, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.gconf_t, ptr %131, i32 0, i32 13
  %133 = load ptr, ptr %132, align 8, !tbaa !33
  %134 = icmp ne ptr %133, null
  br i1 %134, label %135, label %139

135:                                              ; preds = %115
  %136 = load ptr, ptr @gconf, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.gconf_t, ptr %136, i32 0, i32 13
  %138 = load ptr, ptr %137, align 8, !tbaa !33
  br label %140

139:                                              ; preds = %115
  br label %140

140:                                              ; preds = %139, %135
  %141 = phi ptr [ %138, %135 ], [ @.str.74, %139 ]
  %142 = load ptr, ptr @gconf, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.gconf_t, ptr %142, i32 0, i32 12
  %144 = load i32, ptr %143, align 8, !tbaa !34
  %145 = load i32, ptr %13, align 4, !tbaa !9
  %146 = load i32, ptr %15, align 4, !tbaa !9
  %147 = load i32, ptr %14, align 4, !tbaa !9
  %148 = load i32, ptr %16, align 4, !tbaa !9
  %149 = load i32, ptr %10, align 4, !tbaa !9
  %150 = load i32, ptr %11, align 4, !tbaa !9
  %151 = load i32, ptr %6, align 4, !tbaa !9
  %152 = load i32, ptr %7, align 4, !tbaa !9
  %153 = load i32, ptr %8, align 4, !tbaa !9
  %154 = load i32, ptr %9, align 4, !tbaa !9
  %155 = load i32, ptr %12, align 4, !tbaa !9
  %156 = load i32, ptr @next_blacklisted, align 4, !tbaa !9
  %157 = srem i32 %156, 10
  %158 = load ptr, ptr @gconf, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.gconf_t, ptr %158, i32 0, i32 17
  %160 = load i64, ptr %159, align 8, !tbaa !35
  %161 = call ptr @str_bytes(i64 noundef %160)
  %162 = load i32, ptr %17, align 4, !tbaa !9
  %163 = udiv i32 %162, 8
  %164 = zext i32 %163 to i64
  %165 = call ptr @str_bytes(i64 noundef %164)
  %166 = load ptr, ptr @gconf, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.gconf_t, ptr %166, i32 0, i32 18
  %168 = load i64, ptr %167, align 8, !tbaa !36
  %169 = call ptr @str_bytes(i64 noundef %168)
  %170 = load i32, ptr %18, align 4, !tbaa !9
  %171 = udiv i32 %170, 8
  %172 = zext i32 %171 to i64
  %173 = call ptr @str_bytes(i64 noundef %172)
  %174 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef @.str.73, ptr noundef %117, ptr noundef %118, ptr noundef %126, ptr noundef %130, ptr noundef %141, i32 noundef %144, i32 noundef %145, i32 noundef %146, i32 noundef %147, i32 noundef %148, i32 noundef %149, i32 noundef %150, i32 noundef %151, i32 noundef %152, i32 noundef %153, i32 noundef %154, i32 noundef %155, i32 noundef %157, ptr noundef %161, ptr noundef %165, ptr noundef %169, ptr noundef %173) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret void
}

declare ptr @announces_get() #3

; Function Attrs: nounwind uwtable
declare hidden void @clear_old_traffic_counters() #2

declare ptr @str_id(ptr noundef) #3

declare ptr @str_time(i64 noundef) #3

declare ptr @str_af(i32 noundef) #3

declare ptr @str_bytes(i64 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #3 = { "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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 4}
!12 = !{!"search", !13, i64 0, !10, i64 4, !14, i64 8, !7, i64 16, !13, i64 36, !10, i64 40, !7, i64 48, !10, i64 3296, !6, i64 3304}
!13 = !{!"short", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!12, !10, i64 40}
!16 = !{!12, !6, i64 3304}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !10, i64 20}
!20 = !{!"storage", !7, i64 0, !10, i64 20, !10, i64 24, !6, i64 32, !6, i64 40}
!21 = !{!20, !6, i64 40}
!22 = distinct !{!22, !18}
!23 = !{!24, !6, i64 0}
!24 = !{!"announcement_t", !6, i64 0, !7, i64 8, !7, i64 28, !10, i64 284, !10, i64 288, !14, i64 296, !14, i64 304}
!25 = distinct !{!25, !18}
!26 = !{!14, !14, i64 0}
!27 = distinct !{!27, !18}
!28 = !{!29, !14, i64 0}
!29 = !{!"gconf_t", !14, i64 0, !14, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !30, i64 56, !30, i64 57, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !6, i64 80, !7, i64 88, !7, i64 89, !14, i64 104, !14, i64 112, !14, i64 120, !7, i64 128, !7, i64 160}
!30 = !{!"_Bool", !7, i64 0}
!31 = !{!29, !14, i64 8}
!32 = !{!29, !10, i64 68}
!33 = !{!29, !6, i64 80}
!34 = !{!29, !10, i64 72}
!35 = !{!29, !14, i64 112}
!36 = !{!29, !14, i64 120}


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

@searches = external hidden local_unnamed_addr global ptr, align 8
@myid = external hidden global [20 x i8], align 16
@buckets = external hidden local_unnamed_addr global ptr, align 8
@buckets6 = external hidden local_unnamed_addr global ptr, align 8
@storage = external hidden local_unnamed_addr global ptr, align 8
@next_blacklisted = external dso_local local_unnamed_addr global i32, align 4
@gconf = external local_unnamed_addr global ptr, align 8
@.str.73 = external hidden unnamed_addr constant [304 x i8], align 1
@kadnode_version_str = external local_unnamed_addr global ptr, align 8
@.str.74 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @kad_status(ptr nocapture noundef %0) local_unnamed_addr #1 {
  %2 = load ptr, ptr @storage, align 8, !tbaa !5
  %3 = load ptr, ptr @searches, align 8, !tbaa !5
  %4 = tail call ptr @announces_get() #4
  %.not58 = icmp eq ptr %3, null
  br i1 %.not58, label %.preheader57, label %.lr.ph

.preheader57:                                     ; preds = %20, %1
  %.049.lcssa = phi i32 [ 0, %1 ], [ %.150, %20 ]
  %.047.lcssa = phi i32 [ 0, %1 ], [ %.148, %20 ]
  %.045.lcssa = phi i32 [ 0, %1 ], [ %.146, %20 ]
  %.041.lcssa = phi i32 [ 0, %1 ], [ %.1, %20 ]
  %.not5267 = icmp eq ptr %2, null
  br i1 %.not5267, label %.preheader, label %.lr.ph71

.lr.ph:                                           ; preds = %1, %20
  %.03963 = phi ptr [ %22, %20 ], [ %3, %1 ]
  %.04162 = phi i32 [ %.1, %20 ], [ 0, %1 ]
  %.04561 = phi i32 [ %.146, %20 ], [ 0, %1 ]
  %.04760 = phi i32 [ %.148, %20 ], [ 0, %1 ]
  %.04959 = phi i32 [ %.150, %20 ], [ 0, %1 ]
  %5 = getelementptr inbounds i8, ptr %.03963, i64 4
  %6 = load i32, ptr %5, align 4, !tbaa !9
  %7 = icmp eq i32 %6, 10
  %8 = getelementptr inbounds i8, ptr %.03963, i64 40
  %9 = load i32, ptr %8, align 8, !tbaa !14
  %.not56 = icmp eq i32 %9, 0
  br i1 %7, label %10, label %15

10:                                               ; preds = %.lr.ph
  br i1 %.not56, label %13, label %11

11:                                               ; preds = %10
  %12 = add nsw i32 %.04561, 1
  br label %20

13:                                               ; preds = %10
  %14 = add nsw i32 %.04760, 1
  br label %20

15:                                               ; preds = %.lr.ph
  br i1 %.not56, label %18, label %16

16:                                               ; preds = %15
  %17 = add nsw i32 %.04959, 1
  br label %20

18:                                               ; preds = %15
  %19 = add nsw i32 %.04162, 1
  br label %20

20:                                               ; preds = %16, %18, %11, %13
  %.150 = phi i32 [ %.04959, %11 ], [ %.04959, %13 ], [ %17, %16 ], [ %.04959, %18 ]
  %.148 = phi i32 [ %.04760, %11 ], [ %14, %13 ], [ %.04760, %16 ], [ %.04760, %18 ]
  %.146 = phi i32 [ %12, %11 ], [ %.04561, %13 ], [ %.04561, %16 ], [ %.04561, %18 ]
  %.1 = phi i32 [ %.04162, %11 ], [ %.04162, %13 ], [ %.04162, %16 ], [ %19, %18 ]
  %21 = getelementptr inbounds i8, ptr %.03963, i64 3304
  %22 = load ptr, ptr %21, align 8, !tbaa !15
  %.not = icmp eq ptr %22, null
  br i1 %.not, label %.preheader57, label %.lr.ph, !llvm.loop !16

.preheader:                                       ; preds = %.lr.ph71, %.preheader57
  %.044.lcssa = phi i32 [ 0, %.preheader57 ], [ %26, %.lr.ph71 ]
  %.043.lcssa = phi i32 [ 0, %.preheader57 ], [ %25, %.lr.ph71 ]
  %.not5374 = icmp eq ptr %4, null
  br i1 %.not5374, label %._crit_edge, label %.lr.ph77

.lr.ph71:                                         ; preds = %.preheader57, %.lr.ph71
  %.03870 = phi ptr [ %28, %.lr.ph71 ], [ %2, %.preheader57 ]
  %.04369 = phi i32 [ %25, %.lr.ph71 ], [ 0, %.preheader57 ]
  %.04468 = phi i32 [ %26, %.lr.ph71 ], [ 0, %.preheader57 ]
  %23 = getelementptr inbounds i8, ptr %.03870, i64 20
  %24 = load i32, ptr %23, align 4, !tbaa !18
  %25 = add nsw i32 %24, %.04369
  %26 = add nuw nsw i32 %.04468, 1
  %27 = getelementptr inbounds i8, ptr %.03870, i64 40
  %28 = load ptr, ptr %27, align 8, !tbaa !20
  %.not52 = icmp eq ptr %28, null
  br i1 %.not52, label %.preheader, label %.lr.ph71, !llvm.loop !21

.lr.ph77:                                         ; preds = %.preheader, %.lr.ph77
  %.04076 = phi ptr [ %30, %.lr.ph77 ], [ %4, %.preheader ]
  %.04275 = phi i32 [ %29, %.lr.ph77 ], [ 0, %.preheader ]
  %29 = add nuw nsw i32 %.04275, 1
  %30 = load ptr, ptr %.04076, align 8, !tbaa !22
  %.not53 = icmp eq ptr %30, null
  br i1 %.not53, label %._crit_edge, label %.lr.ph77, !llvm.loop !24

._crit_edge:                                      ; preds = %.lr.ph77, %.preheader
  %.042.lcssa = phi i32 [ 0, %.preheader ], [ %29, %.lr.ph77 ]
  %31 = load ptr, ptr @buckets, align 8, !tbaa !5
  %32 = tail call i32 @kad_count_bucket(ptr noundef %31, i32 noundef 0)
  %33 = load ptr, ptr @buckets6, align 8, !tbaa !5
  %34 = tail call i32 @kad_count_bucket(ptr noundef %33, i32 noundef 0)
  %35 = load ptr, ptr @buckets, align 8, !tbaa !5
  %36 = tail call i32 @kad_count_bucket(ptr noundef %35, i32 noundef 1)
  %37 = load ptr, ptr @buckets6, align 8, !tbaa !5
  %38 = tail call i32 @kad_count_bucket(ptr noundef %37, i32 noundef 1)
  tail call void @clear_old_traffic_counters()
  %39 = load ptr, ptr @gconf, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %39, i64 128
  %41 = getelementptr inbounds i8, ptr %39, i64 160
  %42 = load <8 x i32>, ptr %40, align 4, !tbaa !25
  %43 = tail call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %42)
  %44 = load <8 x i32>, ptr %41, align 4, !tbaa !25
  %45 = tail call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %44)
  %46 = load ptr, ptr @kadnode_version_str, align 8, !tbaa !5
  %47 = tail call ptr @str_id(ptr noundef nonnull @myid) #4
  %48 = load ptr, ptr @gconf, align 8, !tbaa !5
  %49 = load i64, ptr %48, align 8, !tbaa !26
  %50 = getelementptr inbounds i8, ptr %48, i64 8
  %51 = load i64, ptr %50, align 8, !tbaa !29
  %52 = sub nsw i64 %49, %51
  %53 = tail call ptr @str_time(i64 noundef %52) #4
  %54 = load ptr, ptr @gconf, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %54, i64 68
  %56 = load i32, ptr %55, align 4, !tbaa !30
  %57 = tail call ptr @str_af(i32 noundef %56) #4
  %58 = load ptr, ptr @gconf, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 80
  %60 = load ptr, ptr %59, align 8, !tbaa !31
  %.not54 = icmp eq ptr %60, null
  %spec.select = select i1 %.not54, ptr @.str.74, ptr %60
  %61 = getelementptr inbounds i8, ptr %58, i64 72
  %62 = load i32, ptr %61, align 8, !tbaa !32
  %63 = load i32, ptr @next_blacklisted, align 4, !tbaa !25
  %64 = srem i32 %63, 10
  %65 = getelementptr inbounds i8, ptr %58, i64 112
  %66 = load i64, ptr %65, align 8, !tbaa !33
  %67 = tail call ptr @str_bytes(i64 noundef %66) #4
  %68 = lshr i32 %43, 3
  %69 = zext nneg i32 %68 to i64
  %70 = tail call ptr @str_bytes(i64 noundef %69) #4
  %71 = load ptr, ptr @gconf, align 8, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %71, i64 120
  %73 = load i64, ptr %72, align 8, !tbaa !34
  %74 = tail call ptr @str_bytes(i64 noundef %73) #4
  %75 = lshr i32 %45, 3
  %76 = zext nneg i32 %75 to i64
  %77 = tail call ptr @str_bytes(i64 noundef %76) #4
  %78 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.73, ptr noundef %46, ptr noundef %47, ptr noundef %53, ptr noundef %57, ptr noundef nonnull %spec.select, i32 noundef %62, i32 noundef %32, i32 noundef %36, i32 noundef %34, i32 noundef %38, i32 noundef %.044.lcssa, i32 noundef %.043.lcssa, i32 noundef %.041.lcssa, i32 noundef %.049.lcssa, i32 noundef %.047.lcssa, i32 noundef %.045.lcssa, i32 noundef %.042.lcssa, i32 noundef %64, ptr noundef %67, ptr noundef %70, ptr noundef %74, ptr noundef %77) #4
  ret void
}

declare ptr @announces_get() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @clear_old_traffic_counters() local_unnamed_addr #1

declare ptr @str_id(ptr noundef) local_unnamed_addr #2

declare ptr @str_time(i64 noundef) local_unnamed_addr #2

declare ptr @str_af(i32 noundef) local_unnamed_addr #2

declare ptr @str_bytes(i64 noundef) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v8i32(<8 x i32>) #3

attributes #0 = { 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 #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !12, i64 4}
!10 = !{!"search", !11, i64 0, !12, i64 4, !13, i64 8, !7, i64 16, !11, i64 36, !12, i64 40, !7, i64 48, !12, i64 3296, !6, i64 3304}
!11 = !{!"short", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !12, i64 40}
!15 = !{!10, !6, i64 3304}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !12, i64 20}
!19 = !{!"storage", !7, i64 0, !12, i64 20, !12, i64 24, !6, i64 32, !6, i64 40}
!20 = !{!19, !6, i64 40}
!21 = distinct !{!21, !17}
!22 = !{!23, !6, i64 0}
!23 = !{!"announcement_t", !6, i64 0, !7, i64 8, !7, i64 28, !12, i64 284, !12, i64 288, !13, i64 296, !13, i64 304}
!24 = distinct !{!24, !17}
!25 = !{!12, !12, i64 0}
!26 = !{!27, !13, i64 0}
!27 = !{!"gconf_t", !13, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !28, i64 56, !28, i64 57, !12, i64 60, !12, i64 64, !12, i64 68, !12, i64 72, !6, i64 80, !7, i64 88, !7, i64 89, !13, i64 104, !13, i64 112, !13, i64 120, !7, i64 128, !7, i64 160}
!28 = !{!"_Bool", !7, i64 0}
!29 = !{!27, !13, i64 8}
!30 = !{!27, !12, i64 68}
!31 = !{!27, !6, i64 80}
!32 = !{!27, !12, i64 72}
!33 = !{!27, !13, i64 112}
!34 = !{!27, !13, i64 120}


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