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

; 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.timeval = type { i64, i64 }
%struct.parsed_message = type { [16 x i8], i16, [20 x i8], [20 x i8], [20 x i8], i16, i16, [128 x i8], i16, [416 x i8], i16, [608 x i8], i16, [2048 x i8], i16, [2048 x i8], i16, i16 }
%struct.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }
%struct.sockaddr_in6 = type { i16, i16, i32, %struct.in6_addr, i32 }
%struct.in6_addr = type { %union.anon }
%union.anon = type { [4 x i32] }
%struct.sockaddr = type { i16, [14 x i8] }
%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 }

@searches = external hidden global ptr, align 8
@now = external hidden global %struct.timeval, align 8
@myid = external hidden global [20 x i8], align 16
@search_time = external hidden global i64, align 8
@buckets = external hidden global ptr, align 8
@buckets6 = external hidden global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [1 x i8], align 1
@mybucket_grow_time = external hidden global i64, align 8
@mybucket6_grow_time = external hidden global i64, align 8
@confirm_nodes_time = external hidden global i64, align 8
@.str.23 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [23 x i8], align 1
@zeroes = external hidden constant [20 x i8], align 16
@.str.25 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [25 x i8], align 1
@rotate_secrets_time = external hidden global i64, align 8
@expire_stuff_time = external hidden global i64, align 8

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

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #1

; Function Attrs: nounwind uwtable
declare hidden ptr @find_storage(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @debugf(ptr noundef, ...) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @__bswap_16(i16 noundef zeroext) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

; Function Attrs: nounwind uwtable
declare hidden i32 @id_cmp(ptr noalias noundef, ptr noalias noundef) #2

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

; Function Attrs: nounwind
declare i32 @gettimeofday(ptr noundef, ptr noundef) #5

; Function Attrs: nounwind
declare i64 @random() #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

; Function Attrs: nounwind uwtable
declare hidden i32 @rotate_secrets() #2

; Function Attrs: nounwind uwtable
declare hidden i32 @expire_buckets(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @dht_periodic(ptr noundef %0, i64 noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #2 {
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %struct.parsed_message, align 2
  %18 = alloca i16, align 2
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca %struct.sockaddr_in, align 4
  %25 = alloca ptr, align 8
  %26 = alloca %struct.sockaddr_in6, align 4
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca [8 x i8], align 1
  %31 = alloca ptr, align 8
  %32 = alloca i64, align 8
  %33 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store i64 %1, ptr %10, align 8, !tbaa !9
  store ptr %2, ptr %11, align 8, !tbaa !5
  store i32 %3, ptr %12, align 4, !tbaa !11
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  %34 = call i32 @gettimeofday(ptr noundef @now, ptr noundef null) #7
  %35 = load i64, ptr %10, align 8, !tbaa !9
  %36 = icmp ugt i64 %35, 0
  br i1 %36, label %37, label %653

37:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 5342, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #7
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  %39 = call i32 @is_martian(ptr noundef %38)
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %42

41:                                               ; preds = %37
  store i32 2, ptr %19, align 4
  br label %650

42:                                               ; preds = %37
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  %44 = load i32, ptr %12, align 4, !tbaa !11
  %45 = call i32 @node_blacklisted(ptr noundef %43, i32 noundef %44)
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %48

47:                                               ; preds = %42
  call void (ptr, ...) @debugf(ptr noundef @.str.23)
  store i32 2, ptr %19, align 4
  br label %650

48:                                               ; preds = %42
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = load i64, ptr %10, align 8, !tbaa !9
  %51 = getelementptr inbounds i8, ptr %49, i64 %50
  %52 = load i8, ptr %51, align 1, !tbaa !13
  %53 = sext i8 %52 to i32
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %57

55:                                               ; preds = %48
  call void (ptr, ...) @debugf(ptr noundef @.str.24)
  %56 = call ptr @__errno_location() #8
  store i32 22, ptr %56, align 4, !tbaa !11
  store i32 -1, ptr %8, align 4
  store i32 1, ptr %19, align 4
  br label %650

57:                                               ; preds = %48
  call void @llvm.memset.p0.i64(ptr align 2 %17, i8 0, i64 5342, i1 false)
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = load i64, ptr %10, align 8, !tbaa !9
  %60 = trunc i64 %59 to i32
  %61 = call i32 @parse_message(ptr noundef %58, i32 noundef %60, ptr noundef %17)
  store i32 %61, ptr %16, align 4, !tbaa !11
  %62 = load i32, ptr %16, align 4, !tbaa !11
  %63 = icmp slt i32 %62, 0
  br i1 %63, label %72, label %64

64:                                               ; preds = %57
  %65 = load i32, ptr %16, align 4, !tbaa !11
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %72, label %67

67:                                               ; preds = %64
  %68 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 2
  %69 = getelementptr inbounds [20 x i8], ptr %68, i64 0, i64 0
  %70 = call i32 @id_cmp(ptr noundef %69, ptr noundef @zeroes)
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %76

72:                                               ; preds = %67, %64, %57
  call void (ptr, ...) @debugf(ptr noundef @.str.25)
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = load i64, ptr %10, align 8, !tbaa !9
  %75 = trunc i64 %74 to i32
  call void @debug_printable(ptr noundef %73, i32 noundef %75)
  call void (ptr, ...) @debugf(ptr noundef @.str.2)
  store i32 2, ptr %19, align 4
  br label %650

76:                                               ; preds = %67
  %77 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 2
  %78 = getelementptr inbounds [20 x i8], ptr %77, i64 0, i64 0
  %79 = call i32 @id_cmp(ptr noundef %78, ptr noundef @myid)
  %80 = icmp eq i32 %79, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %76
  call void (ptr, ...) @debugf(ptr noundef @.str.26)
  store i32 2, ptr %19, align 4
  br label %650

82:                                               ; preds = %76
  %83 = load i32, ptr %16, align 4, !tbaa !11
  %84 = icmp sgt i32 %83, 1
  br i1 %84, label %85, label %90

85:                                               ; preds = %82
  %86 = call i32 @token_bucket()
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %89, label %88

88:                                               ; preds = %85
  call void (ptr, ...) @debugf(ptr noundef @.str.27)
  store i32 2, ptr %19, align 4
  br label %650

89:                                               ; preds = %85
  br label %90

90:                                               ; preds = %89, %82
  %91 = load i32, ptr %16, align 4, !tbaa !11
  switch i32 %91, label %649 [
    i32 1, label %92
    i32 2, label %442
    i32 3, label %459
    i32 4, label %481
    i32 5, label %557
  ]

92:                                               ; preds = %90
  %93 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 1
  %94 = load i16, ptr %93, align 2, !tbaa !14
  %95 = zext i16 %94 to i32
  %96 = icmp ne i32 %95, 4
  br i1 %96, label %97, label %105

97:                                               ; preds = %92
  call void (ptr, ...) @debugf(ptr noundef @.str.28)
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = load i64, ptr %10, align 8, !tbaa !9
  %100 = trunc i64 %99 to i32
  call void @debug_printable(ptr noundef %98, i32 noundef %100)
  call void (ptr, ...) @debugf(ptr noundef @.str.2)
  %101 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 2
  %102 = getelementptr inbounds [20 x i8], ptr %101, i64 0, i64 0
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = load i32, ptr %12, align 4, !tbaa !11
  call void @blacklist_node(ptr noundef %102, ptr noundef %103, i32 noundef %104)
  store i32 2, ptr %19, align 4
  br label %650

105:                                              ; preds = %92
  %106 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 0
  %107 = getelementptr inbounds [16 x i8], ptr %106, i64 0, i64 0
  %108 = call i32 @tid_match(ptr noundef %107, ptr noundef @.str.29, ptr noundef null)
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %110, label %116

110:                                              ; preds = %105
  call void (ptr, ...) @debugf(ptr noundef @.str.30)
  %111 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 2
  %112 = getelementptr inbounds [20 x i8], ptr %111, i64 0, i64 0
  %113 = load ptr, ptr %11, align 8, !tbaa !5
  %114 = load i32, ptr %12, align 4, !tbaa !11
  %115 = call ptr @new_node(ptr noundef %112, ptr noundef %113, i32 noundef %114, i32 noundef 2)
  br label %441

116:                                              ; preds = %105
  %117 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 0
  %118 = getelementptr inbounds [16 x i8], ptr %117, i64 0, i64 0
  %119 = call i32 @tid_match(ptr noundef %118, ptr noundef @.str.31, ptr noundef null)
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %126, label %121

121:                                              ; preds = %116
  %122 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 0
  %123 = getelementptr inbounds [16 x i8], ptr %122, i64 0, i64 0
  %124 = call i32 @tid_match(ptr noundef %123, ptr noundef @.str.32, ptr noundef null)
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %357

126:                                              ; preds = %121, %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  store ptr null, ptr %21, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 0
  %128 = getelementptr inbounds [16 x i8], ptr %127, i64 0, i64 0
  %129 = call i32 @tid_match(ptr noundef %128, ptr noundef @.str.32, ptr noundef %18)
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %131, label %138

131:                                              ; preds = %126
  store i32 1, ptr %20, align 4, !tbaa !11
  %132 = load i16, ptr %18, align 2, !tbaa !17
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.sockaddr, ptr %133, i32 0, i32 0
  %135 = load i16, ptr %134, align 2, !tbaa !18
  %136 = zext i16 %135 to i32
  %137 = call ptr @find_search(i16 noundef zeroext %132, i32 noundef %136)
  store ptr %137, ptr %21, align 8, !tbaa !5
  br label %138

138:                                              ; preds = %131, %126
  %139 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 10
  %140 = load i16, ptr %139, align 2, !tbaa !20
  %141 = zext i16 %140 to i32
  %142 = sdiv i32 %141, 26
  %143 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 12
  %144 = load i16, ptr %143, align 2, !tbaa !21
  %145 = zext i16 %144 to i32
  %146 = sdiv i32 %145, 38
  %147 = load i32, ptr %20, align 4, !tbaa !11
  %148 = icmp ne i32 %147, 0
  %149 = zext i1 %148 to i64
  %150 = select i1 %148, ptr @.str.34, ptr @.str.5
  call void (ptr, ...) @debugf(ptr noundef @.str.33, i32 noundef %142, i32 noundef %146, ptr noundef %150)
  %151 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 10
  %152 = load i16, ptr %151, align 2, !tbaa !20
  %153 = zext i16 %152 to i32
  %154 = srem i32 %153, 26
  %155 = icmp ne i32 %154, 0
  br i1 %155, label %162, label %156

156:                                              ; preds = %138
  %157 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 12
  %158 = load i16, ptr %157, align 2, !tbaa !21
  %159 = zext i16 %158 to i32
  %160 = srem i32 %159, 38
  %161 = icmp ne i32 %160, 0
  br i1 %161, label %162, label %167

162:                                              ; preds = %156, %138
  call void (ptr, ...) @debugf(ptr noundef @.str.35)
  %163 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 2
  %164 = getelementptr inbounds [20 x i8], ptr %163, i64 0, i64 0
  %165 = load ptr, ptr %11, align 8, !tbaa !5
  %166 = load i32, ptr %12, align 4, !tbaa !11
  call void @blacklist_node(ptr noundef %164, ptr noundef %165, i32 noundef %166)
  br label %286

167:                                              ; preds = %156
  %168 = load i32, ptr %20, align 4, !tbaa !11
  %169 = icmp ne i32 %168, 0
  br i1 %169, label %170, label %179

170:                                              ; preds = %167
  %171 = load ptr, ptr %21, align 8, !tbaa !5
  %172 = icmp eq ptr %171, null
  br i1 %172, label %173, label %179

173:                                              ; preds = %170
  call void (ptr, ...) @debugf(ptr noundef @.str.36)
  %174 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 2
  %175 = getelementptr inbounds [20 x i8], ptr %174, i64 0, i64 0
  %176 = load ptr, ptr %11, align 8, !tbaa !5
  %177 = load i32, ptr %12, align 4, !tbaa !11
  %178 = call ptr @new_node(ptr noundef %175, ptr noundef %176, i32 noundef %177, i32 noundef 1)
  br label %285

179:                                              ; preds = %170, %167
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %180 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 2
  %181 = getelementptr inbounds [20 x i8], ptr %180, i64 0, i64 0
  %182 = load ptr, ptr %11, align 8, !tbaa !5
  %183 = load i32, ptr %12, align 4, !tbaa !11
  %184 = call ptr @new_node(ptr noundef %181, ptr noundef %182, i32 noundef %183, i32 noundef 2)
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %185

185:                                              ; preds = %228, %179
  %186 = load i32, ptr %22, align 4, !tbaa !11
  %187 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 10
  %188 = load i16, ptr %187, align 2, !tbaa !20
  %189 = zext i16 %188 to i32
  %190 = sdiv i32 %189, 26
  %191 = icmp slt i32 %186, %190
  br i1 %191, label %192, label %231

192:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %193 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 9
  %194 = getelementptr inbounds [416 x i8], ptr %193, i64 0, i64 0
  %195 = load i32, ptr %22, align 4, !tbaa !11
  %196 = mul nsw i32 %195, 26
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds i8, ptr %194, i64 %197
  store ptr %198, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #7
  %199 = load ptr, ptr %23, align 8, !tbaa !5
  %200 = call i32 @id_cmp(ptr noundef %199, ptr noundef @myid)
  %201 = icmp eq i32 %200, 0
  br i1 %201, label %202, label %203

202:                                              ; preds = %192
  store i32 6, ptr %19, align 4
  br label %225

203:                                              ; preds = %192
  call void @llvm.memset.p0.i64(ptr align 4 %24, i8 0, i64 16, i1 false)
  %204 = getelementptr inbounds %struct.sockaddr_in, ptr %24, i32 0, i32 0
  store i16 2, ptr %204, align 4, !tbaa !22
  %205 = getelementptr inbounds %struct.sockaddr_in, ptr %24, i32 0, i32 2
  %206 = load ptr, ptr %23, align 8, !tbaa !5
  %207 = getelementptr inbounds i8, ptr %206, i64 20
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %205, ptr align 1 %207, i64 4, i1 false)
  %208 = getelementptr inbounds %struct.sockaddr_in, ptr %24, i32 0, i32 1
  %209 = load ptr, ptr %23, align 8, !tbaa !5
  %210 = getelementptr inbounds i8, ptr %209, i64 24
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %208, ptr align 1 %210, i64 2, i1 false)
  %211 = load ptr, ptr %23, align 8, !tbaa !5
  %212 = call ptr @new_node(ptr noundef %211, ptr noundef %24, i32 noundef 16, i32 noundef 0)
  %213 = load ptr, ptr %21, align 8, !tbaa !5
  %214 = icmp ne ptr %213, null
  br i1 %214, label %215, label %224

215:                                              ; preds = %203
  %216 = load ptr, ptr %21, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.search, ptr %216, i32 0, i32 1
  %218 = load i32, ptr %217, align 4, !tbaa !25
  %219 = icmp eq i32 %218, 2
  br i1 %219, label %220, label %224

220:                                              ; preds = %215
  %221 = load ptr, ptr %23, align 8, !tbaa !5
  %222 = load ptr, ptr %21, align 8, !tbaa !5
  %223 = call ptr @insert_search_node(ptr noundef %221, ptr noundef %24, i32 noundef 16, ptr noundef %222, i32 noundef 0, ptr noundef null, i32 noundef 0)
  br label %224

224:                                              ; preds = %220, %215, %203
  store i32 0, ptr %19, align 4
  br label %225

225:                                              ; preds = %224, %202
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  %226 = load i32, ptr %19, align 4
  switch i32 %226, label %822 [
    i32 0, label %227
    i32 6, label %228
  ]

227:                                              ; preds = %225
  br label %228

228:                                              ; preds = %227, %225
  %229 = load i32, ptr %22, align 4, !tbaa !11
  %230 = add nsw i32 %229, 1
  store i32 %230, ptr %22, align 4, !tbaa !11
  br label %185, !llvm.loop !27

231:                                              ; preds = %185
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %232

232:                                              ; preds = %275, %231
  %233 = load i32, ptr %22, align 4, !tbaa !11
  %234 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 12
  %235 = load i16, ptr %234, align 2, !tbaa !21
  %236 = zext i16 %235 to i32
  %237 = sdiv i32 %236, 38
  %238 = icmp slt i32 %233, %237
  br i1 %238, label %239, label %278

239:                                              ; preds = %232
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %240 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 11
  %241 = getelementptr inbounds [608 x i8], ptr %240, i64 0, i64 0
  %242 = load i32, ptr %22, align 4, !tbaa !11
  %243 = mul nsw i32 %242, 38
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds i8, ptr %241, i64 %244
  store ptr %245, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 28, ptr %26) #7
  %246 = load ptr, ptr %25, align 8, !tbaa !5
  %247 = call i32 @id_cmp(ptr noundef %246, ptr noundef @myid)
  %248 = icmp eq i32 %247, 0
  br i1 %248, label %249, label %250

249:                                              ; preds = %239
  store i32 9, ptr %19, align 4
  br label %272

250:                                              ; preds = %239
  call void @llvm.memset.p0.i64(ptr align 4 %26, i8 0, i64 28, i1 false)
  %251 = getelementptr inbounds %struct.sockaddr_in6, ptr %26, i32 0, i32 0
  store i16 10, ptr %251, align 4, !tbaa !29
  %252 = getelementptr inbounds %struct.sockaddr_in6, ptr %26, i32 0, i32 3
  %253 = load ptr, ptr %25, align 8, !tbaa !5
  %254 = getelementptr inbounds i8, ptr %253, i64 20
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %252, ptr align 1 %254, i64 16, i1 false)
  %255 = getelementptr inbounds %struct.sockaddr_in6, ptr %26, i32 0, i32 1
  %256 = load ptr, ptr %25, align 8, !tbaa !5
  %257 = getelementptr inbounds i8, ptr %256, i64 36
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %255, ptr align 1 %257, i64 2, i1 false)
  %258 = load ptr, ptr %25, align 8, !tbaa !5
  %259 = call ptr @new_node(ptr noundef %258, ptr noundef %26, i32 noundef 28, i32 noundef 0)
  %260 = load ptr, ptr %21, align 8, !tbaa !5
  %261 = icmp ne ptr %260, null
  br i1 %261, label %262, label %271

262:                                              ; preds = %250
  %263 = load ptr, ptr %21, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.search, ptr %263, i32 0, i32 1
  %265 = load i32, ptr %264, align 4, !tbaa !25
  %266 = icmp eq i32 %265, 10
  br i1 %266, label %267, label %271

267:                                              ; preds = %262
  %268 = load ptr, ptr %25, align 8, !tbaa !5
  %269 = load ptr, ptr %21, align 8, !tbaa !5
  %270 = call ptr @insert_search_node(ptr noundef %268, ptr noundef %26, i32 noundef 28, ptr noundef %269, i32 noundef 0, ptr noundef null, i32 noundef 0)
  br label %271

271:                                              ; preds = %267, %262, %250
  store i32 0, ptr %19, align 4
  br label %272

272:                                              ; preds = %271, %249
  call void @llvm.lifetime.end.p0(i64 28, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  %273 = load i32, ptr %19, align 4
  switch i32 %273, label %822 [
    i32 0, label %274
    i32 9, label %275
  ]

274:                                              ; preds = %272
  br label %275

275:                                              ; preds = %274, %272
  %276 = load i32, ptr %22, align 4, !tbaa !11
  %277 = add nsw i32 %276, 1
  store i32 %277, ptr %22, align 4, !tbaa !11
  br label %232, !llvm.loop !32

278:                                              ; preds = %232
  %279 = load ptr, ptr %21, align 8, !tbaa !5
  %280 = icmp ne ptr %279, null
  br i1 %280, label %281, label %284

281:                                              ; preds = %278
  %282 = load ptr, ptr %21, align 8, !tbaa !5
  %283 = call i32 @search_send_get_peers(ptr noundef %282, ptr noundef null)
  br label %284

284:                                              ; preds = %281, %278
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %285

285:                                              ; preds = %284, %173
  br label %286

286:                                              ; preds = %285, %162
  %287 = load ptr, ptr %21, align 8, !tbaa !5
  %288 = icmp ne ptr %287, null
  br i1 %288, label %289, label %356

289:                                              ; preds = %286
  %290 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 2
  %291 = getelementptr inbounds [20 x i8], ptr %290, i64 0, i64 0
  %292 = load ptr, ptr %11, align 8, !tbaa !5
  %293 = load i32, ptr %12, align 4, !tbaa !11
  %294 = load ptr, ptr %21, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 7
  %296 = getelementptr inbounds [128 x i8], ptr %295, i64 0, i64 0
  %297 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 8
  %298 = load i16, ptr %297, align 2, !tbaa !33
  %299 = zext i16 %298 to i32
  %300 = call ptr @insert_search_node(ptr noundef %291, ptr noundef %292, i32 noundef %293, ptr noundef %294, i32 noundef 1, ptr noundef %296, i32 noundef %299)
  %301 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 14
  %302 = load i16, ptr %301, align 2, !tbaa !34
  %303 = zext i16 %302 to i32
  %304 = icmp sgt i32 %303, 0
  br i1 %304, label %310, label %305

305:                                              ; preds = %289
  %306 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 16
  %307 = load i16, ptr %306, align 2, !tbaa !35
  %308 = zext i16 %307 to i32
  %309 = icmp sgt i32 %308, 0
  br i1 %309, label %310, label %355

310:                                              ; preds = %305, %289
  %311 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 14
  %312 = load i16, ptr %311, align 2, !tbaa !34
  %313 = zext i16 %312 to i32
  %314 = sdiv i32 %313, 6
  %315 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 16
  %316 = load i16, ptr %315, align 2, !tbaa !35
  %317 = zext i16 %316 to i32
  %318 = sdiv i32 %317, 18
  call void (ptr, ...) @debugf(ptr noundef @.str.37, i32 noundef %314, i32 noundef %318)
  %319 = load ptr, ptr %14, align 8, !tbaa !5
  %320 = icmp ne ptr %319, null
  br i1 %320, label %321, label %354

321:                                              ; preds = %310
  %322 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 14
  %323 = load i16, ptr %322, align 2, !tbaa !34
  %324 = zext i16 %323 to i32
  %325 = icmp sgt i32 %324, 0
  br i1 %325, label %326, label %337

326:                                              ; preds = %321
  %327 = load ptr, ptr %14, align 8, !tbaa !5
  %328 = load ptr, ptr %15, align 8, !tbaa !5
  %329 = load ptr, ptr %21, align 8, !tbaa !5
  %330 = getelementptr inbounds %struct.search, ptr %329, i32 0, i32 3
  %331 = getelementptr inbounds [20 x i8], ptr %330, i64 0, i64 0
  %332 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 13
  %333 = getelementptr inbounds [2048 x i8], ptr %332, i64 0, i64 0
  %334 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 14
  %335 = load i16, ptr %334, align 2, !tbaa !34
  %336 = zext i16 %335 to i64
  call void %327(ptr noundef %328, i32 noundef 1, ptr noundef %331, ptr noundef %333, i64 noundef %336)
  br label %337

337:                                              ; preds = %326, %321
  %338 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 16
  %339 = load i16, ptr %338, align 2, !tbaa !35
  %340 = zext i16 %339 to i32
  %341 = icmp sgt i32 %340, 0
  br i1 %341, label %342, label %353

342:                                              ; preds = %337
  %343 = load ptr, ptr %14, align 8, !tbaa !5
  %344 = load ptr, ptr %15, align 8, !tbaa !5
  %345 = load ptr, ptr %21, align 8, !tbaa !5
  %346 = getelementptr inbounds %struct.search, ptr %345, i32 0, i32 3
  %347 = getelementptr inbounds [20 x i8], ptr %346, i64 0, i64 0
  %348 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 15
  %349 = getelementptr inbounds [2048 x i8], ptr %348, i64 0, i64 0
  %350 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 16
  %351 = load i16, ptr %350, align 2, !tbaa !35
  %352 = zext i16 %351 to i64
  call void %343(ptr noundef %344, i32 noundef 2, ptr noundef %347, ptr noundef %349, i64 noundef %352)
  br label %353

353:                                              ; preds = %342, %337
  br label %354

354:                                              ; preds = %353, %310
  br label %355

355:                                              ; preds = %354, %305
  br label %356

356:                                              ; preds = %355, %286
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %440

357:                                              ; preds = %121
  %358 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 0
  %359 = getelementptr inbounds [16 x i8], ptr %358, i64 0, i64 0
  %360 = call i32 @tid_match(ptr noundef %359, ptr noundef @.str.38, ptr noundef %18)
  %361 = icmp ne i32 %360, 0
  br i1 %361, label %362, label %435

362:                                              ; preds = %357
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  call void (ptr, ...) @debugf(ptr noundef @.str.39)
  %363 = load i16, ptr %18, align 2, !tbaa !17
  %364 = load ptr, ptr %11, align 8, !tbaa !5
  %365 = getelementptr inbounds %struct.sockaddr, ptr %364, i32 0, i32 0
  %366 = load i16, ptr %365, align 2, !tbaa !18
  %367 = zext i16 %366 to i32
  %368 = call ptr @find_search(i16 noundef zeroext %363, i32 noundef %367)
  store ptr %368, ptr %27, align 8, !tbaa !5
  %369 = load ptr, ptr %27, align 8, !tbaa !5
  %370 = icmp ne ptr %369, null
  br i1 %370, label %377, label %371

371:                                              ; preds = %362
  call void (ptr, ...) @debugf(ptr noundef @.str.36)
  %372 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 2
  %373 = getelementptr inbounds [20 x i8], ptr %372, i64 0, i64 0
  %374 = load ptr, ptr %11, align 8, !tbaa !5
  %375 = load i32, ptr %12, align 4, !tbaa !11
  %376 = call ptr @new_node(ptr noundef %373, ptr noundef %374, i32 noundef %375, i32 noundef 1)
  br label %434

377:                                              ; preds = %362
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  %378 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 2
  %379 = getelementptr inbounds [20 x i8], ptr %378, i64 0, i64 0
  %380 = load ptr, ptr %11, align 8, !tbaa !5
  %381 = load i32, ptr %12, align 4, !tbaa !11
  %382 = call ptr @new_node(ptr noundef %379, ptr noundef %380, i32 noundef %381, i32 noundef 2)
  store i32 0, ptr %28, align 4, !tbaa !11
  br label %383

383:                                              ; preds = %428, %377
  %384 = load i32, ptr %28, align 4, !tbaa !11
  %385 = load ptr, ptr %27, align 8, !tbaa !5
  %386 = getelementptr inbounds %struct.search, ptr %385, i32 0, i32 7
  %387 = load i32, ptr %386, align 8, !tbaa !36
  %388 = icmp slt i32 %384, %387
  br i1 %388, label %389, label %431

389:                                              ; preds = %383
  %390 = load ptr, ptr %27, align 8, !tbaa !5
  %391 = getelementptr inbounds %struct.search, ptr %390, i32 0, i32 6
  %392 = load i32, ptr %28, align 4, !tbaa !11
  %393 = sext i32 %392 to i64
  %394 = getelementptr inbounds [14 x %struct.search_node], ptr %391, i64 0, i64 %393
  %395 = getelementptr inbounds %struct.search_node, ptr %394, i32 0, i32 0
  %396 = getelementptr inbounds [20 x i8], ptr %395, i64 0, i64 0
  %397 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 2
  %398 = getelementptr inbounds [20 x i8], ptr %397, i64 0, i64 0
  %399 = call i32 @id_cmp(ptr noundef %396, ptr noundef %398)
  %400 = icmp eq i32 %399, 0
  br i1 %400, label %401, label %427

401:                                              ; preds = %389
  %402 = load ptr, ptr %27, align 8, !tbaa !5
  %403 = getelementptr inbounds %struct.search, ptr %402, i32 0, i32 6
  %404 = load i32, ptr %28, align 4, !tbaa !11
  %405 = sext i32 %404 to i64
  %406 = getelementptr inbounds [14 x %struct.search_node], ptr %403, i64 0, i64 %405
  %407 = getelementptr inbounds %struct.search_node, ptr %406, i32 0, i32 3
  store i64 0, ptr %407, align 8, !tbaa !37
  %408 = load i64, ptr @now, align 8, !tbaa !40
  %409 = load ptr, ptr %27, align 8, !tbaa !5
  %410 = getelementptr inbounds %struct.search, ptr %409, i32 0, i32 6
  %411 = load i32, ptr %28, align 4, !tbaa !11
  %412 = sext i32 %411 to i64
  %413 = getelementptr inbounds [14 x %struct.search_node], ptr %410, i64 0, i64 %412
  %414 = getelementptr inbounds %struct.search_node, ptr %413, i32 0, i32 4
  store i64 %408, ptr %414, align 8, !tbaa !42
  %415 = load ptr, ptr %27, align 8, !tbaa !5
  %416 = getelementptr inbounds %struct.search, ptr %415, i32 0, i32 6
  %417 = load i32, ptr %28, align 4, !tbaa !11
  %418 = sext i32 %417 to i64
  %419 = getelementptr inbounds [14 x %struct.search_node], ptr %416, i64 0, i64 %418
  %420 = getelementptr inbounds %struct.search_node, ptr %419, i32 0, i32 9
  store i32 1, ptr %420, align 4, !tbaa !43
  %421 = load ptr, ptr %27, align 8, !tbaa !5
  %422 = getelementptr inbounds %struct.search, ptr %421, i32 0, i32 6
  %423 = load i32, ptr %28, align 4, !tbaa !11
  %424 = sext i32 %423 to i64
  %425 = getelementptr inbounds [14 x %struct.search_node], ptr %422, i64 0, i64 %424
  %426 = getelementptr inbounds %struct.search_node, ptr %425, i32 0, i32 5
  store i32 0, ptr %426, align 8, !tbaa !44
  br label %431

427:                                              ; preds = %389
  br label %428

428:                                              ; preds = %427
  %429 = load i32, ptr %28, align 4, !tbaa !11
  %430 = add nsw i32 %429, 1
  store i32 %430, ptr %28, align 4, !tbaa !11
  br label %383, !llvm.loop !45

431:                                              ; preds = %401, %383
  %432 = load ptr, ptr %27, align 8, !tbaa !5
  %433 = call i32 @search_send_get_peers(ptr noundef %432, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %434

434:                                              ; preds = %431, %371
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %439

435:                                              ; preds = %357
  call void (ptr, ...) @debugf(ptr noundef @.str.40)
  %436 = load ptr, ptr %9, align 8, !tbaa !5
  %437 = load i64, ptr %10, align 8, !tbaa !9
  %438 = trunc i64 %437 to i32
  call void @debug_printable(ptr noundef %436, i32 noundef %438)
  call void (ptr, ...) @debugf(ptr noundef @.str.2)
  br label %439

439:                                              ; preds = %435, %434
  br label %440

440:                                              ; preds = %439, %356
  br label %441

441:                                              ; preds = %440, %110
  br label %649

442:                                              ; preds = %90
  %443 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 1
  %444 = load i16, ptr %443, align 2, !tbaa !14
  %445 = zext i16 %444 to i32
  call void (ptr, ...) @debugf(ptr noundef @.str.41, i32 noundef %445)
  %446 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 2
  %447 = getelementptr inbounds [20 x i8], ptr %446, i64 0, i64 0
  %448 = load ptr, ptr %11, align 8, !tbaa !5
  %449 = load i32, ptr %12, align 4, !tbaa !11
  %450 = call ptr @new_node(ptr noundef %447, ptr noundef %448, i32 noundef %449, i32 noundef 1)
  call void (ptr, ...) @debugf(ptr noundef @.str.42)
  %451 = load ptr, ptr %11, align 8, !tbaa !5
  %452 = load i32, ptr %12, align 4, !tbaa !11
  %453 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 0
  %454 = getelementptr inbounds [16 x i8], ptr %453, i64 0, i64 0
  %455 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 1
  %456 = load i16, ptr %455, align 2, !tbaa !14
  %457 = zext i16 %456 to i32
  %458 = call i32 @send_pong(ptr noundef %451, i32 noundef %452, ptr noundef %454, i32 noundef %457)
  br label %649

459:                                              ; preds = %90
  call void (ptr, ...) @debugf(ptr noundef @.str.43)
  %460 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 2
  %461 = getelementptr inbounds [20 x i8], ptr %460, i64 0, i64 0
  %462 = load ptr, ptr %11, align 8, !tbaa !5
  %463 = load i32, ptr %12, align 4, !tbaa !11
  %464 = call ptr @new_node(ptr noundef %461, ptr noundef %462, i32 noundef %463, i32 noundef 1)
  %465 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 17
  %466 = load i16, ptr %465, align 2, !tbaa !46
  %467 = zext i16 %466 to i32
  call void (ptr, ...) @debugf(ptr noundef @.str.44, i32 noundef %467)
  %468 = load ptr, ptr %11, align 8, !tbaa !5
  %469 = load i32, ptr %12, align 4, !tbaa !11
  %470 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 0
  %471 = getelementptr inbounds [16 x i8], ptr %470, i64 0, i64 0
  %472 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 1
  %473 = load i16, ptr %472, align 2, !tbaa !14
  %474 = zext i16 %473 to i32
  %475 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 4
  %476 = getelementptr inbounds [20 x i8], ptr %475, i64 0, i64 0
  %477 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 17
  %478 = load i16, ptr %477, align 2, !tbaa !46
  %479 = zext i16 %478 to i32
  %480 = call i32 @send_closest_nodes(ptr noundef %468, i32 noundef %469, ptr noundef %471, i32 noundef %474, ptr noundef %476, i32 noundef %479, i32 noundef 0, ptr noundef null, ptr noundef null, i32 noundef 0)
  br label %649

481:                                              ; preds = %90
  call void (ptr, ...) @debugf(ptr noundef @.str.45)
  %482 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 2
  %483 = getelementptr inbounds [20 x i8], ptr %482, i64 0, i64 0
  %484 = load ptr, ptr %11, align 8, !tbaa !5
  %485 = load i32, ptr %12, align 4, !tbaa !11
  %486 = call ptr @new_node(ptr noundef %483, ptr noundef %484, i32 noundef %485, i32 noundef 1)
  %487 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 3
  %488 = getelementptr inbounds [20 x i8], ptr %487, i64 0, i64 0
  %489 = call i32 @id_cmp(ptr noundef %488, ptr noundef @zeroes)
  %490 = icmp eq i32 %489, 0
  br i1 %490, label %491, label %500

491:                                              ; preds = %481
  call void (ptr, ...) @debugf(ptr noundef @.str.46)
  %492 = load ptr, ptr %11, align 8, !tbaa !5
  %493 = load i32, ptr %12, align 4, !tbaa !11
  %494 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 0
  %495 = getelementptr inbounds [16 x i8], ptr %494, i64 0, i64 0
  %496 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 1
  %497 = load i16, ptr %496, align 2, !tbaa !14
  %498 = zext i16 %497 to i32
  %499 = call i32 @send_error(ptr noundef %492, i32 noundef %493, ptr noundef %495, i32 noundef %498, i32 noundef 203, ptr noundef @.str.47)
  br label %649

500:                                              ; preds = %481
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %501 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 3
  %502 = getelementptr inbounds [20 x i8], ptr %501, i64 0, i64 0
  %503 = call ptr @find_storage(ptr noundef %502)
  store ptr %503, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %504 = load ptr, ptr %11, align 8, !tbaa !5
  %505 = getelementptr inbounds [8 x i8], ptr %30, i64 0, i64 0
  call void @make_token(ptr noundef %504, i32 noundef 0, ptr noundef %505)
  %506 = load ptr, ptr %29, align 8, !tbaa !5
  %507 = icmp ne ptr %506, null
  br i1 %507, label %508, label %540

508:                                              ; preds = %500
  %509 = load ptr, ptr %29, align 8, !tbaa !5
  %510 = getelementptr inbounds %struct.storage, ptr %509, i32 0, i32 1
  %511 = load i32, ptr %510, align 4, !tbaa !47
  %512 = icmp sgt i32 %511, 0
  br i1 %512, label %513, label %540

513:                                              ; preds = %508
  %514 = load ptr, ptr %11, align 8, !tbaa !5
  %515 = getelementptr inbounds %struct.sockaddr, ptr %514, i32 0, i32 0
  %516 = load i16, ptr %515, align 2, !tbaa !18
  %517 = zext i16 %516 to i32
  %518 = icmp eq i32 %517, 10
  %519 = zext i1 %518 to i64
  %520 = select i1 %518, ptr @.str.49, ptr @.str.5
  call void (ptr, ...) @debugf(ptr noundef @.str.48, ptr noundef %520)
  %521 = load ptr, ptr %11, align 8, !tbaa !5
  %522 = load i32, ptr %12, align 4, !tbaa !11
  %523 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 0
  %524 = getelementptr inbounds [16 x i8], ptr %523, i64 0, i64 0
  %525 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 1
  %526 = load i16, ptr %525, align 2, !tbaa !14
  %527 = zext i16 %526 to i32
  %528 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 3
  %529 = getelementptr inbounds [20 x i8], ptr %528, i64 0, i64 0
  %530 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 17
  %531 = load i16, ptr %530, align 2, !tbaa !46
  %532 = zext i16 %531 to i32
  %533 = load ptr, ptr %11, align 8, !tbaa !5
  %534 = getelementptr inbounds %struct.sockaddr, ptr %533, i32 0, i32 0
  %535 = load i16, ptr %534, align 2, !tbaa !18
  %536 = zext i16 %535 to i32
  %537 = load ptr, ptr %29, align 8, !tbaa !5
  %538 = getelementptr inbounds [8 x i8], ptr %30, i64 0, i64 0
  %539 = call i32 @send_closest_nodes(ptr noundef %521, i32 noundef %522, ptr noundef %524, i32 noundef %527, ptr noundef %529, i32 noundef %532, i32 noundef %536, ptr noundef %537, ptr noundef %538, i32 noundef 8)
  br label %555

540:                                              ; preds = %508, %500
  call void (ptr, ...) @debugf(ptr noundef @.str.50)
  %541 = load ptr, ptr %11, align 8, !tbaa !5
  %542 = load i32, ptr %12, align 4, !tbaa !11
  %543 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 0
  %544 = getelementptr inbounds [16 x i8], ptr %543, i64 0, i64 0
  %545 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 1
  %546 = load i16, ptr %545, align 2, !tbaa !14
  %547 = zext i16 %546 to i32
  %548 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 3
  %549 = getelementptr inbounds [20 x i8], ptr %548, i64 0, i64 0
  %550 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 17
  %551 = load i16, ptr %550, align 2, !tbaa !46
  %552 = zext i16 %551 to i32
  %553 = getelementptr inbounds [8 x i8], ptr %30, i64 0, i64 0
  %554 = call i32 @send_closest_nodes(ptr noundef %541, i32 noundef %542, ptr noundef %544, i32 noundef %547, ptr noundef %549, i32 noundef %552, i32 noundef 0, ptr noundef null, ptr noundef %553, i32 noundef 8)
  br label %555

555:                                              ; preds = %540, %513
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  br label %556

556:                                              ; preds = %555
  br label %649

557:                                              ; preds = %90
  call void (ptr, ...) @debugf(ptr noundef @.str.51)
  %558 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 2
  %559 = getelementptr inbounds [20 x i8], ptr %558, i64 0, i64 0
  %560 = load ptr, ptr %11, align 8, !tbaa !5
  %561 = load i32, ptr %12, align 4, !tbaa !11
  %562 = call ptr @new_node(ptr noundef %559, ptr noundef %560, i32 noundef %561, i32 noundef 1)
  %563 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 3
  %564 = getelementptr inbounds [20 x i8], ptr %563, i64 0, i64 0
  %565 = call i32 @id_cmp(ptr noundef %564, ptr noundef @zeroes)
  %566 = icmp eq i32 %565, 0
  br i1 %566, label %567, label %576

567:                                              ; preds = %557
  call void (ptr, ...) @debugf(ptr noundef @.str.52)
  %568 = load ptr, ptr %11, align 8, !tbaa !5
  %569 = load i32, ptr %12, align 4, !tbaa !11
  %570 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 0
  %571 = getelementptr inbounds [16 x i8], ptr %570, i64 0, i64 0
  %572 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 1
  %573 = load i16, ptr %572, align 2, !tbaa !14
  %574 = zext i16 %573 to i32
  %575 = call i32 @send_error(ptr noundef %568, i32 noundef %569, ptr noundef %571, i32 noundef %574, i32 noundef 203, ptr noundef @.str.53)
  br label %649

576:                                              ; preds = %557
  %577 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 7
  %578 = getelementptr inbounds [128 x i8], ptr %577, i64 0, i64 0
  %579 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 8
  %580 = load i16, ptr %579, align 2, !tbaa !33
  %581 = zext i16 %580 to i32
  %582 = load ptr, ptr %11, align 8, !tbaa !5
  %583 = call i32 @token_match(ptr noundef %578, i32 noundef %581, ptr noundef %582)
  %584 = icmp ne i32 %583, 0
  br i1 %584, label %594, label %585

585:                                              ; preds = %576
  call void (ptr, ...) @debugf(ptr noundef @.str.54)
  %586 = load ptr, ptr %11, align 8, !tbaa !5
  %587 = load i32, ptr %12, align 4, !tbaa !11
  %588 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 0
  %589 = getelementptr inbounds [16 x i8], ptr %588, i64 0, i64 0
  %590 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 1
  %591 = load i16, ptr %590, align 2, !tbaa !14
  %592 = zext i16 %591 to i32
  %593 = call i32 @send_error(ptr noundef %586, i32 noundef %587, ptr noundef %589, i32 noundef %592, i32 noundef 203, ptr noundef @.str.55)
  br label %649

594:                                              ; preds = %576
  %595 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 6
  %596 = load i16, ptr %595, align 2, !tbaa !49
  %597 = zext i16 %596 to i32
  %598 = icmp ne i32 %597, 0
  br i1 %598, label %599, label %617

599:                                              ; preds = %594
  %600 = load ptr, ptr %11, align 8, !tbaa !5
  %601 = getelementptr inbounds %struct.sockaddr, ptr %600, i32 0, i32 0
  %602 = load i16, ptr %601, align 2, !tbaa !18
  %603 = zext i16 %602 to i32
  switch i32 %603, label %616 [
    i32 2, label %604
    i32 10, label %610
  ]

604:                                              ; preds = %599
  %605 = load ptr, ptr %11, align 8, !tbaa !5
  %606 = getelementptr inbounds %struct.sockaddr_in, ptr %605, i32 0, i32 1
  %607 = load i16, ptr %606, align 2, !tbaa !50
  %608 = call zeroext i16 @__bswap_16(i16 noundef zeroext %607)
  %609 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 5
  store i16 %608, ptr %609, align 2, !tbaa !51
  br label %616

610:                                              ; preds = %599
  %611 = load ptr, ptr %11, align 8, !tbaa !5
  %612 = getelementptr inbounds %struct.sockaddr_in6, ptr %611, i32 0, i32 1
  %613 = load i16, ptr %612, align 2, !tbaa !52
  %614 = call zeroext i16 @__bswap_16(i16 noundef zeroext %613)
  %615 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 5
  store i16 %614, ptr %615, align 2, !tbaa !51
  br label %616

616:                                              ; preds = %610, %604, %599
  br label %617

617:                                              ; preds = %616, %594
  %618 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 5
  %619 = load i16, ptr %618, align 2, !tbaa !51
  %620 = zext i16 %619 to i32
  %621 = icmp eq i32 %620, 0
  br i1 %621, label %622, label %634

622:                                              ; preds = %617
  %623 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 5
  %624 = load i16, ptr %623, align 2, !tbaa !51
  %625 = zext i16 %624 to i32
  call void (ptr, ...) @debugf(ptr noundef @.str.56, i32 noundef %625)
  %626 = load ptr, ptr %11, align 8, !tbaa !5
  %627 = load i32, ptr %12, align 4, !tbaa !11
  %628 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 0
  %629 = getelementptr inbounds [16 x i8], ptr %628, i64 0, i64 0
  %630 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 1
  %631 = load i16, ptr %630, align 2, !tbaa !14
  %632 = zext i16 %631 to i32
  %633 = call i32 @send_error(ptr noundef %626, i32 noundef %627, ptr noundef %629, i32 noundef %632, i32 noundef 203, ptr noundef @.str.57)
  br label %649

634:                                              ; preds = %617
  %635 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 3
  %636 = getelementptr inbounds [20 x i8], ptr %635, i64 0, i64 0
  %637 = load ptr, ptr %11, align 8, !tbaa !5
  %638 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 5
  %639 = load i16, ptr %638, align 2, !tbaa !51
  %640 = call i32 @storage_store(ptr noundef %636, ptr noundef %637, i16 noundef zeroext %639)
  call void (ptr, ...) @debugf(ptr noundef @.str.58)
  %641 = load ptr, ptr %11, align 8, !tbaa !5
  %642 = load i32, ptr %12, align 4, !tbaa !11
  %643 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 0
  %644 = getelementptr inbounds [16 x i8], ptr %643, i64 0, i64 0
  %645 = getelementptr inbounds %struct.parsed_message, ptr %17, i32 0, i32 1
  %646 = load i16, ptr %645, align 2, !tbaa !14
  %647 = zext i16 %646 to i32
  %648 = call i32 @send_peer_announced(ptr noundef %641, i32 noundef %642, ptr noundef %644, i32 noundef %647)
  br label %649

649:                                              ; preds = %634, %622, %585, %567, %556, %491, %459, %442, %441, %90
  store i32 0, ptr %19, align 4
  br label %650

650:                                              ; preds = %649, %97, %88, %81, %72, %55, %47, %41
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 5342, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  %651 = load i32, ptr %19, align 4
  switch i32 %651, label %822 [
    i32 0, label %652
    i32 1, label %820
    i32 2, label %654
  ]

652:                                              ; preds = %650
  br label %653

653:                                              ; preds = %652, %7
  br label %654

654:                                              ; preds = %653, %650
  %655 = load i64, ptr @now, align 8, !tbaa !40
  %656 = load i64, ptr @rotate_secrets_time, align 8, !tbaa !9
  %657 = icmp sge i64 %655, %656
  br i1 %657, label %658, label %660

658:                                              ; preds = %654
  %659 = call i32 @rotate_secrets()
  br label %660

660:                                              ; preds = %658, %654
  %661 = load i64, ptr @now, align 8, !tbaa !40
  %662 = load i64, ptr @expire_stuff_time, align 8, !tbaa !9
  %663 = icmp sge i64 %661, %662
  br i1 %663, label %664, label %672

664:                                              ; preds = %660
  %665 = load ptr, ptr @buckets, align 8, !tbaa !5
  %666 = call i32 @expire_buckets(ptr noundef %665)
  %667 = load ptr, ptr @buckets6, align 8, !tbaa !5
  %668 = call i32 @expire_buckets(ptr noundef %667)
  %669 = call i32 @expire_storage()
  %670 = load ptr, ptr %14, align 8, !tbaa !5
  %671 = load ptr, ptr %15, align 8, !tbaa !5
  call void @expire_searches(ptr noundef %670, ptr noundef %671)
  br label %672

672:                                              ; preds = %664, %660
  %673 = load i64, ptr @search_time, align 8, !tbaa !9
  %674 = icmp sgt i64 %673, 0
  br i1 %674, label %675, label %737

675:                                              ; preds = %672
  %676 = load i64, ptr @now, align 8, !tbaa !40
  %677 = load i64, ptr @search_time, align 8, !tbaa !9
  %678 = icmp sge i64 %676, %677
  br i1 %678, label %679, label %737

679:                                              ; preds = %675
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  %680 = load ptr, ptr @searches, align 8, !tbaa !5
  store ptr %680, ptr %31, align 8, !tbaa !5
  br label %681

681:                                              ; preds = %701, %679
  %682 = load ptr, ptr %31, align 8, !tbaa !5
  %683 = icmp ne ptr %682, null
  br i1 %683, label %684, label %705

684:                                              ; preds = %681
  %685 = load ptr, ptr %31, align 8, !tbaa !5
  %686 = getelementptr inbounds %struct.search, ptr %685, i32 0, i32 5
  %687 = load i32, ptr %686, align 8, !tbaa !53
  %688 = icmp ne i32 %687, 0
  br i1 %688, label %701, label %689

689:                                              ; preds = %684
  %690 = load ptr, ptr %31, align 8, !tbaa !5
  %691 = getelementptr inbounds %struct.search, ptr %690, i32 0, i32 2
  %692 = load i64, ptr %691, align 8, !tbaa !54
  %693 = add nsw i64 %692, 5
  %694 = add nsw i64 %693, 1
  %695 = load i64, ptr @now, align 8, !tbaa !40
  %696 = icmp sle i64 %694, %695
  br i1 %696, label %697, label %701

697:                                              ; preds = %689
  %698 = load ptr, ptr %31, align 8, !tbaa !5
  %699 = load ptr, ptr %14, align 8, !tbaa !5
  %700 = load ptr, ptr %15, align 8, !tbaa !5
  call void @search_step(ptr noundef %698, ptr noundef %699, ptr noundef %700)
  br label %701

701:                                              ; preds = %697, %689, %684
  %702 = load ptr, ptr %31, align 8, !tbaa !5
  %703 = getelementptr inbounds %struct.search, ptr %702, i32 0, i32 8
  %704 = load ptr, ptr %703, align 8, !tbaa !55
  store ptr %704, ptr %31, align 8, !tbaa !5
  br label %681, !llvm.loop !56

705:                                              ; preds = %681
  store i64 0, ptr @search_time, align 8, !tbaa !9
  %706 = load ptr, ptr @searches, align 8, !tbaa !5
  store ptr %706, ptr %31, align 8, !tbaa !5
  br label %707

707:                                              ; preds = %732, %705
  %708 = load ptr, ptr %31, align 8, !tbaa !5
  %709 = icmp ne ptr %708, null
  br i1 %709, label %710, label %736

710:                                              ; preds = %707
  %711 = load ptr, ptr %31, align 8, !tbaa !5
  %712 = getelementptr inbounds %struct.search, ptr %711, i32 0, i32 5
  %713 = load i32, ptr %712, align 8, !tbaa !53
  %714 = icmp ne i32 %713, 0
  br i1 %714, label %732, label %715

715:                                              ; preds = %710
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  %716 = load ptr, ptr %31, align 8, !tbaa !5
  %717 = getelementptr inbounds %struct.search, ptr %716, i32 0, i32 2
  %718 = load i64, ptr %717, align 8, !tbaa !54
  %719 = add nsw i64 %718, 10
  %720 = call i64 @random() #7
  %721 = srem i64 %720, 10
  %722 = add nsw i64 %719, %721
  store i64 %722, ptr %32, align 8, !tbaa !9
  %723 = load i64, ptr @search_time, align 8, !tbaa !9
  %724 = icmp eq i64 %723, 0
  br i1 %724, label %729, label %725

725:                                              ; preds = %715
  %726 = load i64, ptr @search_time, align 8, !tbaa !9
  %727 = load i64, ptr %32, align 8, !tbaa !9
  %728 = icmp sgt i64 %726, %727
  br i1 %728, label %729, label %731

729:                                              ; preds = %725, %715
  %730 = load i64, ptr %32, align 8, !tbaa !9
  store i64 %730, ptr @search_time, align 8, !tbaa !9
  br label %731

731:                                              ; preds = %729, %725
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  br label %732

732:                                              ; preds = %731, %710
  %733 = load ptr, ptr %31, align 8, !tbaa !5
  %734 = getelementptr inbounds %struct.search, ptr %733, i32 0, i32 8
  %735 = load ptr, ptr %734, align 8, !tbaa !55
  store ptr %735, ptr %31, align 8, !tbaa !5
  br label %707, !llvm.loop !57

736:                                              ; preds = %707
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  br label %737

737:                                              ; preds = %736, %675, %672
  %738 = load i64, ptr @now, align 8, !tbaa !40
  %739 = load i64, ptr @confirm_nodes_time, align 8, !tbaa !9
  %740 = icmp sge i64 %738, %739
  br i1 %740, label %741, label %785

741:                                              ; preds = %737
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  store i32 0, ptr %33, align 4, !tbaa !11
  %742 = call i32 @bucket_maintenance(i32 noundef 2)
  %743 = load i32, ptr %33, align 4, !tbaa !11
  %744 = or i32 %743, %742
  store i32 %744, ptr %33, align 4, !tbaa !11
  %745 = call i32 @bucket_maintenance(i32 noundef 10)
  %746 = load i32, ptr %33, align 4, !tbaa !11
  %747 = or i32 %746, %745
  store i32 %747, ptr %33, align 4, !tbaa !11
  %748 = load i32, ptr %33, align 4, !tbaa !11
  %749 = icmp ne i32 %748, 0
  br i1 %749, label %769, label %750

750:                                              ; preds = %741
  %751 = load i64, ptr @mybucket_grow_time, align 8, !tbaa !9
  %752 = load i64, ptr @now, align 8, !tbaa !40
  %753 = sub nsw i64 %752, 150
  %754 = icmp sge i64 %751, %753
  br i1 %754, label %755, label %759

755:                                              ; preds = %750
  %756 = call i32 @neighbourhood_maintenance(i32 noundef 2)
  %757 = load i32, ptr %33, align 4, !tbaa !11
  %758 = or i32 %757, %756
  store i32 %758, ptr %33, align 4, !tbaa !11
  br label %759

759:                                              ; preds = %755, %750
  %760 = load i64, ptr @mybucket6_grow_time, align 8, !tbaa !9
  %761 = load i64, ptr @now, align 8, !tbaa !40
  %762 = sub nsw i64 %761, 150
  %763 = icmp sge i64 %760, %762
  br i1 %763, label %764, label %768

764:                                              ; preds = %759
  %765 = call i32 @neighbourhood_maintenance(i32 noundef 10)
  %766 = load i32, ptr %33, align 4, !tbaa !11
  %767 = or i32 %766, %765
  store i32 %767, ptr %33, align 4, !tbaa !11
  br label %768

768:                                              ; preds = %764, %759
  br label %769

769:                                              ; preds = %768, %741
  %770 = load i32, ptr %33, align 4, !tbaa !11
  %771 = icmp ne i32 %770, 0
  br i1 %771, label %772, label %778

772:                                              ; preds = %769
  %773 = load i64, ptr @now, align 8, !tbaa !40
  %774 = add nsw i64 %773, 5
  %775 = call i64 @random() #7
  %776 = srem i64 %775, 10
  %777 = add nsw i64 %774, %776
  store i64 %777, ptr @confirm_nodes_time, align 8, !tbaa !9
  br label %784

778:                                              ; preds = %769
  %779 = load i64, ptr @now, align 8, !tbaa !40
  %780 = add nsw i64 %779, 60
  %781 = call i64 @random() #7
  %782 = srem i64 %781, 120
  %783 = add nsw i64 %780, %782
  store i64 %783, ptr @confirm_nodes_time, align 8, !tbaa !9
  br label %784

784:                                              ; preds = %778, %772
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  br label %785

785:                                              ; preds = %784, %737
  %786 = load i64, ptr @confirm_nodes_time, align 8, !tbaa !9
  %787 = load i64, ptr @now, align 8, !tbaa !40
  %788 = icmp sgt i64 %786, %787
  br i1 %788, label %789, label %794

789:                                              ; preds = %785
  %790 = load i64, ptr @confirm_nodes_time, align 8, !tbaa !9
  %791 = load i64, ptr @now, align 8, !tbaa !40
  %792 = sub nsw i64 %790, %791
  %793 = load ptr, ptr %13, align 8, !tbaa !5
  store i64 %792, ptr %793, align 8, !tbaa !9
  br label %796

794:                                              ; preds = %785
  %795 = load ptr, ptr %13, align 8, !tbaa !5
  store i64 0, ptr %795, align 8, !tbaa !9
  br label %796

796:                                              ; preds = %794, %789
  %797 = load i64, ptr @search_time, align 8, !tbaa !9
  %798 = icmp sgt i64 %797, 0
  br i1 %798, label %799, label %819

799:                                              ; preds = %796
  %800 = load i64, ptr @search_time, align 8, !tbaa !9
  %801 = load i64, ptr @now, align 8, !tbaa !40
  %802 = icmp sle i64 %800, %801
  br i1 %802, label %803, label %805

803:                                              ; preds = %799
  %804 = load ptr, ptr %13, align 8, !tbaa !5
  store i64 0, ptr %804, align 8, !tbaa !9
  br label %818

805:                                              ; preds = %799
  %806 = load ptr, ptr %13, align 8, !tbaa !5
  %807 = load i64, ptr %806, align 8, !tbaa !9
  %808 = load i64, ptr @search_time, align 8, !tbaa !9
  %809 = load i64, ptr @now, align 8, !tbaa !40
  %810 = sub nsw i64 %808, %809
  %811 = icmp sgt i64 %807, %810
  br i1 %811, label %812, label %817

812:                                              ; preds = %805
  %813 = load i64, ptr @search_time, align 8, !tbaa !9
  %814 = load i64, ptr @now, align 8, !tbaa !40
  %815 = sub nsw i64 %813, %814
  %816 = load ptr, ptr %13, align 8, !tbaa !5
  store i64 %815, ptr %816, align 8, !tbaa !9
  br label %817

817:                                              ; preds = %812, %805
  br label %818

818:                                              ; preds = %817, %803
  br label %819

819:                                              ; preds = %818, %796
  store i32 1, ptr %8, align 4
  br label %820

820:                                              ; preds = %819, %650
  %821 = load i32, ptr %8, align 4
  ret i32 %821

822:                                              ; preds = %650, %272, %225
  unreachable
}

; Function Attrs: nounwind uwtable
declare hidden i32 @is_martian(ptr noundef) #2

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

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

; Function Attrs: nounwind uwtable
declare hidden void @debug_printable(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @token_bucket() #2

; Function Attrs: nounwind uwtable
declare hidden void @blacklist_node(ptr noundef, ptr noundef, i32 noundef) #2

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

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

; Function Attrs: nounwind uwtable
declare hidden ptr @find_search(i16 noundef zeroext, i32 noundef) #2

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @make_token(ptr noundef, i32 noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
declare hidden i32 @storage_store(ptr noundef, ptr noundef, i16 noundef zeroext) #2

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

; Function Attrs: nounwind uwtable
declare hidden i32 @expire_storage() #2

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

; Function Attrs: nounwind uwtable
declare hidden i32 @bucket_maintenance(i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @neighbourhood_maintenance(i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind willreturn memory(none) "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 = { inlinehint 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(none) }

!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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !16, i64 16}
!15 = !{!"parsed_message", !7, i64 0, !16, i64 16, !7, i64 18, !7, i64 38, !7, i64 58, !16, i64 78, !16, i64 80, !7, i64 82, !16, i64 210, !7, i64 212, !16, i64 628, !7, i64 630, !16, i64 1238, !7, i64 1240, !16, i64 3288, !7, i64 3290, !16, i64 5338, !16, i64 5340}
!16 = !{!"short", !7, i64 0}
!17 = !{!16, !16, i64 0}
!18 = !{!19, !16, i64 0}
!19 = !{!"sockaddr", !16, i64 0, !7, i64 2}
!20 = !{!15, !16, i64 628}
!21 = !{!15, !16, i64 1238}
!22 = !{!23, !16, i64 0}
!23 = !{!"sockaddr_in", !16, i64 0, !16, i64 2, !24, i64 4, !7, i64 8}
!24 = !{!"in_addr", !12, i64 0}
!25 = !{!26, !12, i64 4}
!26 = !{!"search", !16, i64 0, !12, i64 4, !10, i64 8, !7, i64 16, !16, i64 36, !12, i64 40, !7, i64 48, !12, i64 3296, !6, i64 3304}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!30, !16, i64 0}
!30 = !{!"sockaddr_in6", !16, i64 0, !16, i64 2, !12, i64 4, !31, i64 8, !12, i64 24}
!31 = !{!"in6_addr", !7, i64 0}
!32 = distinct !{!32, !28}
!33 = !{!15, !16, i64 210}
!34 = !{!15, !16, i64 3288}
!35 = !{!15, !16, i64 5338}
!36 = !{!26, !12, i64 3296}
!37 = !{!38, !10, i64 160}
!38 = !{!"search_node", !7, i64 0, !39, i64 24, !12, i64 152, !10, i64 160, !10, i64 168, !12, i64 176, !7, i64 180, !12, i64 220, !12, i64 224, !12, i64 228}
!39 = !{!"sockaddr_storage", !16, i64 0, !7, i64 2, !10, i64 120}
!40 = !{!41, !10, i64 0}
!41 = !{!"timeval", !10, i64 0, !10, i64 8}
!42 = !{!38, !10, i64 168}
!43 = !{!38, !12, i64 228}
!44 = !{!38, !12, i64 176}
!45 = distinct !{!45, !28}
!46 = !{!15, !16, i64 5340}
!47 = !{!48, !12, i64 20}
!48 = !{!"storage", !7, i64 0, !12, i64 20, !12, i64 24, !6, i64 32, !6, i64 40}
!49 = !{!15, !16, i64 80}
!50 = !{!23, !16, i64 2}
!51 = !{!15, !16, i64 78}
!52 = !{!30, !16, i64 2}
!53 = !{!26, !12, i64 40}
!54 = !{!26, !10, i64 8}
!55 = !{!26, !6, i64 3304}
!56 = distinct !{!56, !28}
!57 = distinct !{!57, !28}


; 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.timeval = type { i64, i64 }
%struct.parsed_message = type { [16 x i8], i16, [20 x i8], [20 x i8], [20 x i8], i16, i16, [128 x i8], i16, [416 x i8], i16, [608 x i8], i16, [2048 x i8], i16, [2048 x i8], i16, i16 }
%struct.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }
%struct.sockaddr_in6 = type { i16, i16, i32, %struct.in6_addr, i32 }
%struct.in6_addr = type { %union.anon }
%union.anon = type { [4 x i32] }
%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 }

@searches = external hidden local_unnamed_addr global ptr, align 8
@now = external hidden global %struct.timeval, align 8
@myid = external hidden global [20 x i8], align 16
@search_time = external hidden local_unnamed_addr global i64, align 8
@buckets = external hidden local_unnamed_addr global ptr, align 8
@buckets6 = external hidden local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [1 x i8], align 1
@mybucket_grow_time = external hidden local_unnamed_addr global i64, align 8
@mybucket6_grow_time = external hidden local_unnamed_addr global i64, align 8
@confirm_nodes_time = external hidden local_unnamed_addr global i64, align 8
@.str.23 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [23 x i8], align 1
@zeroes = external hidden constant [20 x i8], align 16
@.str.25 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [25 x i8], align 1
@rotate_secrets_time = external hidden local_unnamed_addr global i64, align 8
@expire_stuff_time = external hidden local_unnamed_addr global i64, align 8

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

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @find_storage(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @debugf(ptr noundef, ...) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @__bswap_16(i16 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

; Function Attrs: nounwind uwtable
declare hidden i32 @id_cmp(ptr noalias noundef, ptr noalias noundef) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i32 @gettimeofday(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: nounwind
declare i64 @random() local_unnamed_addr #6

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

; Function Attrs: nounwind uwtable
declare hidden i32 @rotate_secrets() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @expire_buckets(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @dht_periodic(ptr noundef %0, i64 noundef %1, ptr noundef %2, i32 noundef %3, ptr nocapture noundef writeonly %4, ptr noundef %5, ptr noundef %6) local_unnamed_addr #2 {
  %8 = alloca %struct.parsed_message, align 2
  %9 = alloca i16, align 2
  %10 = alloca %struct.sockaddr_in, align 4
  %11 = alloca %struct.sockaddr_in6, align 4
  %12 = alloca [8 x i8], align 1
  %13 = tail call i32 @gettimeofday(ptr noundef nonnull @now, ptr noundef null) #8
  %.not = icmp eq i64 %1, 0
  br i1 %.not, label %298, label %14

14:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 5342, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %9) #8
  %15 = tail call i32 @is_martian(ptr noundef %2)
  %.not183 = icmp eq i32 %15, 0
  br i1 %.not183, label %16, label %.thread226

16:                                               ; preds = %14
  %17 = tail call i32 @node_blacklisted(ptr noundef %2, i32 noundef %3)
  %.not184 = icmp eq i32 %17, 0
  br i1 %.not184, label %19, label %18

18:                                               ; preds = %16
  tail call void (ptr, ...) @debugf(ptr noundef nonnull @.str.23)
  br label %.thread226

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %0, i64 %1
  %21 = load i8, ptr %20, align 1, !tbaa !5
  %.not185 = icmp eq i8 %21, 0
  br i1 %.not185, label %22, label %296

22:                                               ; preds = %19
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 2 dereferenceable(5342) %8, i8 0, i64 5342, i1 false)
  %23 = trunc i64 %1 to i32
  %24 = call i32 @parse_message(ptr noundef nonnull %0, i32 noundef %23, ptr noundef nonnull %8)
  %or.cond = icmp slt i32 %24, 1
  br i1 %or.cond, label %29, label %25

25:                                               ; preds = %22
  %26 = getelementptr inbounds i8, ptr %8, i64 18
  %27 = call i32 @id_cmp(ptr noundef nonnull %26, ptr noundef nonnull @zeroes)
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %30

29:                                               ; preds = %25, %22
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.25)
  call void @debug_printable(ptr noundef nonnull %0, i32 noundef %23)
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.2)
  br label %.thread226

30:                                               ; preds = %25
  %31 = call i32 @id_cmp(ptr noundef nonnull %26, ptr noundef nonnull @myid)
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %34

33:                                               ; preds = %30
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.26)
  br label %.thread226

34:                                               ; preds = %30
  %cond = icmp eq i32 %24, 1
  br i1 %cond, label %39, label %35

35:                                               ; preds = %34
  %36 = call i32 @token_bucket()
  %.not187 = icmp eq i32 %36, 0
  br i1 %.not187, label %37, label %38

37:                                               ; preds = %35
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.27)
  br label %.thread226

38:                                               ; preds = %35
  switch i32 %24, label %.thread226 [
    i32 5, label %251
    i32 2, label %193
    i32 3, label %201
    i32 4, label %213
  ]

39:                                               ; preds = %34
  %40 = getelementptr inbounds i8, ptr %8, i64 16
  %41 = load i16, ptr %40, align 2, !tbaa !8
  %.not191 = icmp eq i16 %41, 4
  br i1 %.not191, label %43, label %42

42:                                               ; preds = %39
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.28)
  call void @debug_printable(ptr noundef nonnull %0, i32 noundef %23)
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.2)
  call void @blacklist_node(ptr noundef nonnull %26, ptr noundef %2, i32 noundef %3)
  br label %.thread226

43:                                               ; preds = %39
  %44 = call i32 @tid_match(ptr noundef nonnull %8, ptr noundef nonnull @.str.29, ptr noundef null)
  %.not192 = icmp eq i32 %44, 0
  br i1 %.not192, label %47, label %45

45:                                               ; preds = %43
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.30)
  %46 = call ptr @new_node(ptr noundef nonnull %26, ptr noundef %2, i32 noundef %3, i32 noundef 2)
  br label %.thread226

47:                                               ; preds = %43
  %48 = call i32 @tid_match(ptr noundef nonnull %8, ptr noundef nonnull @.str.31, ptr noundef null)
  %.not193 = icmp eq i32 %48, 0
  br i1 %.not193, label %49, label %51

49:                                               ; preds = %47
  %50 = call i32 @tid_match(ptr noundef nonnull %8, ptr noundef nonnull @.str.32, ptr noundef null)
  %.not194 = icmp eq i32 %50, 0
  br i1 %.not194, label %162, label %51

51:                                               ; preds = %49, %47
  %52 = call i32 @tid_match(ptr noundef nonnull %8, ptr noundef nonnull @.str.32, ptr noundef nonnull %9)
  %.not197 = icmp ne i32 %52, 0
  br i1 %.not197, label %53, label %58

53:                                               ; preds = %51
  %54 = load i16, ptr %9, align 2, !tbaa !11
  %55 = load i16, ptr %2, align 2, !tbaa !12
  %56 = zext i16 %55 to i32
  %57 = call ptr @find_search(i16 noundef zeroext %54, i32 noundef %56)
  br label %58

58:                                               ; preds = %53, %51
  %59 = phi ptr [ @.str.34, %53 ], [ @.str.5, %51 ]
  %.0165 = phi ptr [ %57, %53 ], [ null, %51 ]
  %60 = getelementptr inbounds i8, ptr %8, i64 628
  %61 = load i16, ptr %60, align 2, !tbaa !14
  %62 = udiv i16 %61, 26
  %63 = zext nneg i16 %62 to i32
  %64 = getelementptr inbounds i8, ptr %8, i64 1238
  %65 = load i16, ptr %64, align 2, !tbaa !15
  %66 = udiv i16 %65, 38
  %67 = zext nneg i16 %66 to i32
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.33, i32 noundef %63, i32 noundef %67, ptr noundef nonnull %59)
  %68 = load i16, ptr %60, align 2, !tbaa !14
  %69 = urem i16 %68, 26
  %.not198 = icmp eq i16 %69, 0
  br i1 %.not198, label %70, label %132

70:                                               ; preds = %58
  %71 = load i16, ptr %64, align 2, !tbaa !15
  %72 = urem i16 %71, 38
  %.not199 = icmp eq i16 %72, 0
  br i1 %.not199, label %73, label %132

73:                                               ; preds = %70
  %74 = icmp eq ptr %.0165, null
  %or.cond3 = select i1 %.not197, i1 %74, i1 false
  br i1 %or.cond3, label %.thread, label %76

.thread:                                          ; preds = %73
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.36)
  %75 = call ptr @new_node(ptr noundef nonnull %26, ptr noundef %2, i32 noundef %3, i32 noundef 1)
  br label %.thread226

76:                                               ; preds = %73
  %77 = call ptr @new_node(ptr noundef nonnull %26, ptr noundef %2, i32 noundef %3, i32 noundef 2)
  %78 = load i16, ptr %60, align 2, !tbaa !14
  %.not251 = icmp ult i16 %78, 26
  br i1 %.not251, label %.preheader234, label %.lr.ph

.lr.ph:                                           ; preds = %76
  %79 = getelementptr inbounds i8, ptr %8, i64 212
  %80 = getelementptr inbounds i8, ptr %10, i64 4
  %81 = getelementptr inbounds i8, ptr %10, i64 2
  %82 = getelementptr inbounds i8, ptr %.0165, i64 4
  %83 = getelementptr inbounds i8, ptr %10, i64 8
  br label %90

.preheader234:                                    ; preds = %106, %76
  %84 = load i16, ptr %64, align 2, !tbaa !15
  %.not252 = icmp ult i16 %84, 38
  br i1 %.not252, label %._crit_edge, label %.lr.ph237

.lr.ph237:                                        ; preds = %.preheader234
  %85 = getelementptr inbounds i8, ptr %8, i64 630
  %86 = getelementptr inbounds i8, ptr %11, i64 8
  %87 = getelementptr inbounds i8, ptr %11, i64 2
  %88 = getelementptr inbounds i8, ptr %.0165, i64 4
  %89 = getelementptr inbounds i8, ptr %11, i64 4
  br label %111

90:                                               ; preds = %.lr.ph, %106
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %106 ]
  %91 = mul nuw nsw i64 %indvars.iv, 26
  %92 = getelementptr inbounds i8, ptr %79, i64 %91
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #8
  %93 = call i32 @id_cmp(ptr noundef nonnull %92, ptr noundef nonnull @myid)
  %94 = icmp eq i32 %93, 0
  br i1 %94, label %106, label %95

95:                                               ; preds = %90
  store i64 0, ptr %83, align 4
  store i16 2, ptr %10, align 4, !tbaa !16
  %96 = getelementptr inbounds i8, ptr %92, i64 20
  %97 = load i32, ptr %96, align 2
  store i32 %97, ptr %80, align 4
  %98 = getelementptr inbounds i8, ptr %92, i64 24
  %99 = load i16, ptr %98, align 2
  store i16 %99, ptr %81, align 2
  %100 = call ptr @new_node(ptr noundef nonnull %92, ptr noundef nonnull %10, i32 noundef 16, i32 noundef 0)
  br i1 %74, label %106, label %101

101:                                              ; preds = %95
  %102 = load i32, ptr %82, align 4, !tbaa !20
  %103 = icmp eq i32 %102, 2
  br i1 %103, label %104, label %106

104:                                              ; preds = %101
  %105 = call ptr @insert_search_node(ptr noundef nonnull %92, ptr noundef nonnull %10, i32 noundef 16, ptr noundef nonnull %.0165, i32 noundef 0, ptr noundef null, i32 noundef 0)
  br label %106

106:                                              ; preds = %95, %101, %104, %90
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %107 = load i16, ptr %60, align 2, !tbaa !14
  %108 = udiv i16 %107, 26
  %109 = zext nneg i16 %108 to i64
  %110 = icmp ult i64 %indvars.iv.next, %109
  br i1 %110, label %90, label %.preheader234, !llvm.loop !24

111:                                              ; preds = %.lr.ph237, %126
  %indvars.iv255 = phi i64 [ 0, %.lr.ph237 ], [ %indvars.iv.next256, %126 ]
  %112 = mul nuw nsw i64 %indvars.iv255, 38
  %113 = getelementptr inbounds i8, ptr %85, i64 %112
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %11) #8
  %114 = call i32 @id_cmp(ptr noundef nonnull %113, ptr noundef nonnull @myid)
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %126, label %116

116:                                              ; preds = %111
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %89, i8 0, i64 24, i1 false)
  store i16 10, ptr %11, align 4, !tbaa !26
  %117 = getelementptr inbounds i8, ptr %113, i64 20
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %86, ptr noundef nonnull align 2 dereferenceable(16) %117, i64 16, i1 false)
  %118 = getelementptr inbounds i8, ptr %113, i64 36
  %119 = load i16, ptr %118, align 2
  store i16 %119, ptr %87, align 2
  %120 = call ptr @new_node(ptr noundef nonnull %113, ptr noundef nonnull %11, i32 noundef 28, i32 noundef 0)
  br i1 %74, label %126, label %121

121:                                              ; preds = %116
  %122 = load i32, ptr %88, align 4, !tbaa !20
  %123 = icmp eq i32 %122, 10
  br i1 %123, label %124, label %126

124:                                              ; preds = %121
  %125 = call ptr @insert_search_node(ptr noundef nonnull %113, ptr noundef nonnull %11, i32 noundef 28, ptr noundef nonnull %.0165, i32 noundef 0, ptr noundef null, i32 noundef 0)
  br label %126

126:                                              ; preds = %116, %121, %124, %111
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %11) #8
  %indvars.iv.next256 = add nuw nsw i64 %indvars.iv255, 1
  %127 = load i16, ptr %64, align 2, !tbaa !15
  %128 = udiv i16 %127, 38
  %129 = zext nneg i16 %128 to i64
  %130 = icmp ult i64 %indvars.iv.next256, %129
  br i1 %130, label %111, label %._crit_edge, !llvm.loop !29

._crit_edge:                                      ; preds = %126, %.preheader234
  br i1 %74, label %.thread226, label %.thread269

.thread269:                                       ; preds = %._crit_edge
  %131 = call i32 @search_send_get_peers(ptr noundef nonnull %.0165, ptr noundef null)
  br label %133

132:                                              ; preds = %58, %70
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.35)
  call void @blacklist_node(ptr noundef nonnull %26, ptr noundef %2, i32 noundef %3)
  %.not203 = icmp eq ptr %.0165, null
  br i1 %.not203, label %.thread226, label %133

133:                                              ; preds = %.thread269, %132
  %134 = getelementptr inbounds i8, ptr %8, i64 82
  %135 = getelementptr inbounds i8, ptr %8, i64 210
  %136 = load i16, ptr %135, align 2, !tbaa !30
  %137 = zext i16 %136 to i32
  %138 = call ptr @insert_search_node(ptr noundef nonnull %26, ptr noundef %2, i32 noundef %3, ptr noundef nonnull %.0165, i32 noundef 1, ptr noundef nonnull %134, i32 noundef %137)
  %139 = getelementptr inbounds i8, ptr %8, i64 3288
  %140 = load i16, ptr %139, align 2, !tbaa !31
  %141 = icmp ne i16 %140, 0
  %142 = getelementptr inbounds i8, ptr %8, i64 5338
  %143 = load i16, ptr %142, align 2
  %144 = icmp ne i16 %143, 0
  %or.cond7 = select i1 %141, i1 true, i1 %144
  br i1 %or.cond7, label %145, label %.thread226

145:                                              ; preds = %133
  %146 = udiv i16 %140, 6
  %147 = zext nneg i16 %146 to i32
  %148 = udiv i16 %143, 18
  %149 = zext nneg i16 %148 to i32
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.37, i32 noundef %147, i32 noundef %149)
  %.not204 = icmp eq ptr %5, null
  br i1 %.not204, label %.thread226, label %150

150:                                              ; preds = %145
  %151 = load i16, ptr %139, align 2, !tbaa !31
  %.not205 = icmp eq i16 %151, 0
  br i1 %.not205, label %156, label %152

152:                                              ; preds = %150
  %153 = getelementptr inbounds i8, ptr %.0165, i64 16
  %154 = getelementptr inbounds i8, ptr %8, i64 1240
  %155 = zext i16 %151 to i64
  call void %5(ptr noundef %6, i32 noundef 1, ptr noundef nonnull %153, ptr noundef nonnull %154, i64 noundef %155) #8
  br label %156

156:                                              ; preds = %152, %150
  %157 = load i16, ptr %142, align 2, !tbaa !32
  %.not206 = icmp eq i16 %157, 0
  br i1 %.not206, label %.thread226, label %158

158:                                              ; preds = %156
  %159 = getelementptr inbounds i8, ptr %.0165, i64 16
  %160 = getelementptr inbounds i8, ptr %8, i64 3290
  %161 = zext i16 %157 to i64
  call void %5(ptr noundef %6, i32 noundef 2, ptr noundef nonnull %159, ptr noundef nonnull %160, i64 noundef %161) #8
  br label %.thread226

162:                                              ; preds = %49
  %163 = call i32 @tid_match(ptr noundef nonnull %8, ptr noundef nonnull @.str.38, ptr noundef nonnull %9)
  %.not195 = icmp eq i32 %163, 0
  br i1 %.not195, label %192, label %164

164:                                              ; preds = %162
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.39)
  %165 = load i16, ptr %9, align 2, !tbaa !11
  %166 = load i16, ptr %2, align 2, !tbaa !12
  %167 = zext i16 %166 to i32
  %168 = call ptr @find_search(i16 noundef zeroext %165, i32 noundef %167)
  %.not196 = icmp eq ptr %168, null
  br i1 %.not196, label %169, label %171

169:                                              ; preds = %164
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.36)
  %170 = call ptr @new_node(ptr noundef nonnull %26, ptr noundef nonnull %2, i32 noundef %3, i32 noundef 1)
  br label %.thread226

171:                                              ; preds = %164
  %172 = call ptr @new_node(ptr noundef nonnull %26, ptr noundef nonnull %2, i32 noundef %3, i32 noundef 2)
  %173 = getelementptr inbounds i8, ptr %168, i64 3296
  %174 = load i32, ptr %173, align 8, !tbaa !33
  %175 = icmp sgt i32 %174, 0
  br i1 %175, label %.lr.ph240, label %.loopexit233

.lr.ph240:                                        ; preds = %171
  %176 = getelementptr inbounds i8, ptr %168, i64 48
  br label %181

177:                                              ; preds = %181
  %indvars.iv.next259 = add nuw nsw i64 %indvars.iv258, 1
  %178 = load i32, ptr %173, align 8, !tbaa !33
  %179 = sext i32 %178 to i64
  %180 = icmp slt i64 %indvars.iv.next259, %179
  br i1 %180, label %181, label %.loopexit233, !llvm.loop !34

181:                                              ; preds = %.lr.ph240, %177
  %indvars.iv258 = phi i64 [ 0, %.lr.ph240 ], [ %indvars.iv.next259, %177 ]
  %182 = getelementptr inbounds [14 x %struct.search_node], ptr %176, i64 0, i64 %indvars.iv258
  %183 = call i32 @id_cmp(ptr noundef nonnull %182, ptr noundef nonnull %26)
  %184 = icmp eq i32 %183, 0
  br i1 %184, label %185, label %177

185:                                              ; preds = %181
  %186 = getelementptr inbounds i8, ptr %182, i64 160
  store i64 0, ptr %186, align 8, !tbaa !35
  %187 = load i64, ptr @now, align 8, !tbaa !38
  %188 = getelementptr inbounds i8, ptr %182, i64 168
  store i64 %187, ptr %188, align 8, !tbaa !40
  %189 = getelementptr inbounds i8, ptr %182, i64 228
  store i32 1, ptr %189, align 4, !tbaa !41
  %190 = getelementptr inbounds i8, ptr %182, i64 176
  store i32 0, ptr %190, align 8, !tbaa !42
  br label %.loopexit233

.loopexit233:                                     ; preds = %177, %171, %185
  %191 = call i32 @search_send_get_peers(ptr noundef nonnull %168, ptr noundef null)
  br label %.thread226

192:                                              ; preds = %162
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.40)
  call void @debug_printable(ptr noundef nonnull %0, i32 noundef %23)
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.2)
  br label %.thread226

193:                                              ; preds = %38
  %194 = getelementptr inbounds i8, ptr %8, i64 16
  %195 = load i16, ptr %194, align 2, !tbaa !8
  %196 = zext i16 %195 to i32
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.41, i32 noundef %196)
  %197 = call ptr @new_node(ptr noundef nonnull %26, ptr noundef %2, i32 noundef %3, i32 noundef 1)
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.42)
  %198 = load i16, ptr %194, align 2, !tbaa !8
  %199 = zext i16 %198 to i32
  %200 = call i32 @send_pong(ptr noundef %2, i32 noundef %3, ptr noundef nonnull %8, i32 noundef %199)
  br label %.thread226

201:                                              ; preds = %38
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.43)
  %202 = call ptr @new_node(ptr noundef nonnull %26, ptr noundef %2, i32 noundef %3, i32 noundef 1)
  %203 = getelementptr inbounds i8, ptr %8, i64 5340
  %204 = load i16, ptr %203, align 2, !tbaa !43
  %205 = zext i16 %204 to i32
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.44, i32 noundef %205)
  %206 = getelementptr inbounds i8, ptr %8, i64 16
  %207 = load i16, ptr %206, align 2, !tbaa !8
  %208 = zext i16 %207 to i32
  %209 = getelementptr inbounds i8, ptr %8, i64 58
  %210 = load i16, ptr %203, align 2, !tbaa !43
  %211 = zext i16 %210 to i32
  %212 = call i32 @send_closest_nodes(ptr noundef %2, i32 noundef %3, ptr noundef nonnull %8, i32 noundef %208, ptr noundef nonnull %209, i32 noundef %211, i32 noundef 0, ptr noundef null, ptr noundef null, i32 noundef 0)
  br label %.thread226

213:                                              ; preds = %38
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.45)
  %214 = call ptr @new_node(ptr noundef nonnull %26, ptr noundef %2, i32 noundef %3, i32 noundef 1)
  %215 = getelementptr inbounds i8, ptr %8, i64 38
  %216 = call i32 @id_cmp(ptr noundef nonnull %215, ptr noundef nonnull @zeroes)
  %217 = icmp eq i32 %216, 0
  br i1 %217, label %218, label %223

218:                                              ; preds = %213
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.46)
  %219 = getelementptr inbounds i8, ptr %8, i64 16
  %220 = load i16, ptr %219, align 2, !tbaa !8
  %221 = zext i16 %220 to i32
  %222 = call i32 @send_error(ptr noundef %2, i32 noundef %3, ptr noundef nonnull %8, i32 noundef %221, i32 noundef 203, ptr noundef nonnull @.str.47)
  br label %.thread226

223:                                              ; preds = %213
  %224 = call ptr @find_storage(ptr noundef nonnull %215)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  call void @make_token(ptr noundef %2, i32 noundef 0, ptr noundef nonnull %12)
  %.not190 = icmp eq ptr %224, null
  br i1 %.not190, label %242, label %225

225:                                              ; preds = %223
  %226 = getelementptr inbounds i8, ptr %224, i64 20
  %227 = load i32, ptr %226, align 4, !tbaa !44
  %228 = icmp sgt i32 %227, 0
  br i1 %228, label %229, label %242

229:                                              ; preds = %225
  %230 = load i16, ptr %2, align 2, !tbaa !12
  %231 = icmp eq i16 %230, 10
  %232 = select i1 %231, ptr @.str.49, ptr @.str.5
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.48, ptr noundef nonnull %232)
  %233 = getelementptr inbounds i8, ptr %8, i64 16
  %234 = load i16, ptr %233, align 2, !tbaa !8
  %235 = zext i16 %234 to i32
  %236 = getelementptr inbounds i8, ptr %8, i64 5340
  %237 = load i16, ptr %236, align 2, !tbaa !43
  %238 = zext i16 %237 to i32
  %239 = load i16, ptr %2, align 2, !tbaa !12
  %240 = zext i16 %239 to i32
  %241 = call i32 @send_closest_nodes(ptr noundef nonnull %2, i32 noundef %3, ptr noundef nonnull %8, i32 noundef %235, ptr noundef nonnull %215, i32 noundef %238, i32 noundef %240, ptr noundef nonnull %224, ptr noundef nonnull %12, i32 noundef 8)
  br label %250

242:                                              ; preds = %225, %223
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.50)
  %243 = getelementptr inbounds i8, ptr %8, i64 16
  %244 = load i16, ptr %243, align 2, !tbaa !8
  %245 = zext i16 %244 to i32
  %246 = getelementptr inbounds i8, ptr %8, i64 5340
  %247 = load i16, ptr %246, align 2, !tbaa !43
  %248 = zext i16 %247 to i32
  %249 = call i32 @send_closest_nodes(ptr noundef %2, i32 noundef %3, ptr noundef nonnull %8, i32 noundef %245, ptr noundef nonnull %215, i32 noundef %248, i32 noundef 0, ptr noundef null, ptr noundef nonnull %12, i32 noundef 8)
  br label %250

250:                                              ; preds = %242, %229
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  br label %.thread226

251:                                              ; preds = %38
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.51)
  %252 = call ptr @new_node(ptr noundef nonnull %26, ptr noundef %2, i32 noundef %3, i32 noundef 1)
  %253 = getelementptr inbounds i8, ptr %8, i64 38
  %254 = call i32 @id_cmp(ptr noundef nonnull %253, ptr noundef nonnull @zeroes)
  %255 = icmp eq i32 %254, 0
  br i1 %255, label %256, label %261

256:                                              ; preds = %251
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.52)
  %257 = getelementptr inbounds i8, ptr %8, i64 16
  %258 = load i16, ptr %257, align 2, !tbaa !8
  %259 = zext i16 %258 to i32
  %260 = call i32 @send_error(ptr noundef %2, i32 noundef %3, ptr noundef nonnull %8, i32 noundef %259, i32 noundef 203, ptr noundef nonnull @.str.53)
  br label %.thread226

261:                                              ; preds = %251
  %262 = getelementptr inbounds i8, ptr %8, i64 82
  %263 = getelementptr inbounds i8, ptr %8, i64 210
  %264 = load i16, ptr %263, align 2, !tbaa !30
  %265 = zext i16 %264 to i32
  %266 = call i32 @token_match(ptr noundef nonnull %262, i32 noundef %265, ptr noundef %2)
  %.not188 = icmp eq i32 %266, 0
  br i1 %.not188, label %267, label %272

267:                                              ; preds = %261
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.54)
  %268 = getelementptr inbounds i8, ptr %8, i64 16
  %269 = load i16, ptr %268, align 2, !tbaa !8
  %270 = zext i16 %269 to i32
  %271 = call i32 @send_error(ptr noundef %2, i32 noundef %3, ptr noundef nonnull %8, i32 noundef %270, i32 noundef 203, ptr noundef nonnull @.str.55)
  br label %.thread226

272:                                              ; preds = %261
  %273 = getelementptr inbounds i8, ptr %8, i64 80
  %274 = load i16, ptr %273, align 2, !tbaa !46
  %.not189 = icmp eq i16 %274, 0
  br i1 %.not189, label %281, label %275

275:                                              ; preds = %272
  %276 = load i16, ptr %2, align 2, !tbaa !12
  switch i16 %276, label %281 [
    i16 2, label %.sink.split
    i16 10, label %.sink.split
  ]

.sink.split:                                      ; preds = %275, %275
  %277 = getelementptr inbounds i8, ptr %2, i64 2
  %278 = load i16, ptr %277, align 2, !tbaa !11
  %279 = call zeroext i16 @__bswap_16(i16 noundef zeroext %278)
  %280 = getelementptr inbounds i8, ptr %8, i64 78
  store i16 %279, ptr %280, align 2, !tbaa !47
  br label %281

281:                                              ; preds = %.sink.split, %275, %272
  %282 = getelementptr inbounds i8, ptr %8, i64 78
  %283 = load i16, ptr %282, align 2, !tbaa !47
  %284 = icmp eq i16 %283, 0
  br i1 %284, label %285, label %290

285:                                              ; preds = %281
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.56, i32 noundef 0)
  %286 = getelementptr inbounds i8, ptr %8, i64 16
  %287 = load i16, ptr %286, align 2, !tbaa !8
  %288 = zext i16 %287 to i32
  %289 = call i32 @send_error(ptr noundef %2, i32 noundef %3, ptr noundef nonnull %8, i32 noundef %288, i32 noundef 203, ptr noundef nonnull @.str.57)
  br label %.thread226

290:                                              ; preds = %281
  %291 = call i32 @storage_store(ptr noundef nonnull %253, ptr noundef %2, i16 noundef zeroext %283)
  call void (ptr, ...) @debugf(ptr noundef nonnull @.str.58)
  %292 = getelementptr inbounds i8, ptr %8, i64 16
  %293 = load i16, ptr %292, align 2, !tbaa !8
  %294 = zext i16 %293 to i32
  %295 = call i32 @send_peer_announced(ptr noundef %2, i32 noundef %3, ptr noundef nonnull %8, i32 noundef %294)
  br label %.thread226

.thread226:                                       ; preds = %18, %29, %33, %42, %37, %14, %169, %.loopexit233, %132, %145, %158, %156, %133, %._crit_edge, %45, %192, %290, %285, %267, %256, %250, %218, %201, %193, %38, %.thread
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 5342, ptr nonnull %8) #8
  br label %298

296:                                              ; preds = %19
  tail call void (ptr, ...) @debugf(ptr noundef nonnull @.str.24)
  %297 = tail call ptr @__errno_location() #9
  store i32 22, ptr %297, align 4, !tbaa !48
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 5342, ptr nonnull %8) #8
  br label %381

298:                                              ; preds = %.thread226, %7
  %299 = load i64, ptr @now, align 8
  %300 = load i64, ptr @rotate_secrets_time, align 8, !tbaa !49
  %.not207 = icmp slt i64 %299, %300
  br i1 %.not207, label %303, label %301

301:                                              ; preds = %298
  %302 = call i32 @rotate_secrets()
  %.pre = load i64, ptr @now, align 8
  br label %303

303:                                              ; preds = %301, %298
  %304 = phi i64 [ %.pre, %301 ], [ %299, %298 ]
  %305 = load i64, ptr @expire_stuff_time, align 8, !tbaa !49
  %.not208 = icmp slt i64 %304, %305
  br i1 %.not208, label %312, label %306

306:                                              ; preds = %303
  %307 = load ptr, ptr @buckets, align 8, !tbaa !50
  %308 = call i32 @expire_buckets(ptr noundef %307)
  %309 = load ptr, ptr @buckets6, align 8, !tbaa !50
  %310 = call i32 @expire_buckets(ptr noundef %309)
  %311 = call i32 @expire_storage()
  call void @expire_searches(ptr noundef %5, ptr noundef %6)
  %.pre261 = load i64, ptr @now, align 8
  br label %312

312:                                              ; preds = %306, %303
  %313 = phi i64 [ %.pre261, %306 ], [ %304, %303 ]
  %314 = load i64, ptr @search_time, align 8, !tbaa !49
  %315 = icmp slt i64 %314, 1
  %.not209 = icmp slt i64 %313, %314
  %or.cond222 = select i1 %315, i1 true, i1 %.not209
  br i1 %or.cond222, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %312
  %.0160241 = load ptr, ptr @searches, align 8, !tbaa !50
  %.not210242 = icmp eq ptr %.0160241, null
  br i1 %.not210242, label %._crit_edge245.thread, label %.lr.ph244

._crit_edge245.thread:                            ; preds = %.preheader
  store i64 0, ptr @search_time, align 8, !tbaa !49
  br label %.loopexit

.lr.ph244:                                        ; preds = %.preheader, %324
  %.0160243 = phi ptr [ %.0160, %324 ], [ %.0160241, %.preheader ]
  %316 = getelementptr inbounds i8, ptr %.0160243, i64 40
  %317 = load i32, ptr %316, align 8, !tbaa !51
  %.not220 = icmp eq i32 %317, 0
  br i1 %.not220, label %318, label %324

318:                                              ; preds = %.lr.ph244
  %319 = getelementptr inbounds i8, ptr %.0160243, i64 8
  %320 = load i64, ptr %319, align 8, !tbaa !52
  %321 = add nsw i64 %320, 6
  %322 = load i64, ptr @now, align 8, !tbaa !38
  %.not221 = icmp sgt i64 %321, %322
  br i1 %.not221, label %324, label %323

323:                                              ; preds = %318
  call void @search_step(ptr noundef nonnull %.0160243, ptr noundef %5, ptr noundef %6)
  br label %324

324:                                              ; preds = %323, %318, %.lr.ph244
  %325 = getelementptr inbounds i8, ptr %.0160243, i64 3304
  %.0160 = load ptr, ptr %325, align 8, !tbaa !50
  %.not210 = icmp eq ptr %.0160, null
  br i1 %.not210, label %._crit_edge245, label %.lr.ph244, !llvm.loop !53

._crit_edge245:                                   ; preds = %324
  %.1161246.pre = load ptr, ptr @searches, align 8, !tbaa !50
  store i64 0, ptr @search_time, align 8, !tbaa !49
  %.not211247 = icmp eq ptr %.1161246.pre, null
  br i1 %.not211247, label %.loopexit, label %.lr.ph250

.lr.ph250:                                        ; preds = %._crit_edge245, %339
  %.1161248 = phi ptr [ %.1161, %339 ], [ %.1161246.pre, %._crit_edge245 ]
  %326 = getelementptr inbounds i8, ptr %.1161248, i64 40
  %327 = load i32, ptr %326, align 8, !tbaa !51
  %.not219 = icmp eq i32 %327, 0
  br i1 %.not219, label %328, label %339

328:                                              ; preds = %.lr.ph250
  %329 = getelementptr inbounds i8, ptr %.1161248, i64 8
  %330 = load i64, ptr %329, align 8, !tbaa !52
  %331 = add nsw i64 %330, 10
  %332 = call i64 @random() #8
  %333 = srem i64 %332, 10
  %334 = add nsw i64 %331, %333
  %335 = load i64, ptr @search_time, align 8, !tbaa !49
  %336 = icmp eq i64 %335, 0
  %337 = icmp sgt i64 %335, %334
  %or.cond223 = select i1 %336, i1 true, i1 %337
  br i1 %or.cond223, label %338, label %339

338:                                              ; preds = %328
  store i64 %334, ptr @search_time, align 8, !tbaa !49
  br label %339

339:                                              ; preds = %338, %328, %.lr.ph250
  %340 = getelementptr inbounds i8, ptr %.1161248, i64 3304
  %.1161 = load ptr, ptr %340, align 8, !tbaa !50
  %.not211 = icmp eq ptr %.1161, null
  br i1 %.not211, label %.loopexit, label %.lr.ph250, !llvm.loop !54

.loopexit:                                        ; preds = %339, %._crit_edge245.thread, %._crit_edge245, %312
  %341 = load i64, ptr @now, align 8, !tbaa !38
  %342 = load i64, ptr @confirm_nodes_time, align 8, !tbaa !49
  %.not212 = icmp slt i64 %341, %342
  br i1 %.not212, label %367, label %343

343:                                              ; preds = %.loopexit
  %344 = call i32 @bucket_maintenance(i32 noundef 2)
  %345 = call i32 @bucket_maintenance(i32 noundef 10)
  %346 = or i32 %345, %344
  %.not213 = icmp eq i32 %346, 0
  %.pre264 = load i64, ptr @now, align 8, !tbaa !38
  br i1 %.not213, label %347, label %.thread230

347:                                              ; preds = %343
  %348 = load i64, ptr @mybucket_grow_time, align 8, !tbaa !49
  %349 = add nsw i64 %.pre264, -150
  %.not214 = icmp slt i64 %348, %349
  br i1 %.not214, label %352, label %350

350:                                              ; preds = %347
  %351 = call i32 @neighbourhood_maintenance(i32 noundef 2)
  %.pre263 = load i64, ptr @now, align 8, !tbaa !38
  %.pre268 = add nsw i64 %.pre263, -150
  br label %352

352:                                              ; preds = %350, %347
  %.pre-phi = phi i64 [ %.pre268, %350 ], [ %349, %347 ]
  %353 = phi i64 [ %.pre263, %350 ], [ %.pre264, %347 ]
  %.0 = phi i32 [ %351, %350 ], [ 0, %347 ]
  %354 = load i64, ptr @mybucket6_grow_time, align 8, !tbaa !49
  %.not215 = icmp slt i64 %354, %.pre-phi
  br i1 %.not215, label %358, label %355

355:                                              ; preds = %352
  %356 = call i32 @neighbourhood_maintenance(i32 noundef 10)
  %357 = or i32 %356, %.0
  %.pre265.pre = load i64, ptr @now, align 8, !tbaa !38
  br label %358

358:                                              ; preds = %352, %355
  %.pre265 = phi i64 [ %.pre265.pre, %355 ], [ %353, %352 ]
  %.1 = phi i32 [ %357, %355 ], [ %.0, %352 ]
  %.not216 = icmp eq i32 %.1, 0
  br i1 %.not216, label %361, label %.thread230

.thread230:                                       ; preds = %343, %358
  %359 = phi i64 [ %.pre264, %343 ], [ %.pre265, %358 ]
  %360 = add nsw i64 %359, 5
  br label %363

361:                                              ; preds = %358
  %362 = add nsw i64 %.pre265, 60
  br label %363

363:                                              ; preds = %361, %.thread230
  %.sink278 = phi i64 [ 120, %361 ], [ 10, %.thread230 ]
  %.sink = phi i64 [ %362, %361 ], [ %360, %.thread230 ]
  %364 = call i64 @random() #8
  %365 = srem i64 %364, %.sink278
  %366 = add nsw i64 %.sink, %365
  store i64 %366, ptr @confirm_nodes_time, align 8, !tbaa !49
  %.pre266 = load i64, ptr @now, align 8, !tbaa !38
  br label %367

367:                                              ; preds = %363, %.loopexit
  %368 = phi i64 [ %.pre266, %363 ], [ %341, %.loopexit ]
  %369 = phi i64 [ %366, %363 ], [ %342, %.loopexit ]
  %370 = icmp sgt i64 %369, %368
  %371 = sub nsw i64 %369, %368
  %storemerge217 = select i1 %370, i64 %371, i64 0
  store i64 %storemerge217, ptr %4, align 8, !tbaa !49
  %372 = load i64, ptr @search_time, align 8, !tbaa !49
  %373 = icmp sgt i64 %372, 0
  br i1 %373, label %374, label %381

374:                                              ; preds = %367
  %375 = load i64, ptr @now, align 8, !tbaa !38
  %.not218 = icmp sgt i64 %372, %375
  br i1 %.not218, label %377, label %376

376:                                              ; preds = %374
  store i64 0, ptr %4, align 8, !tbaa !49
  br label %381

377:                                              ; preds = %374
  %378 = sub nsw i64 %372, %375
  %379 = icmp sgt i64 %storemerge217, %378
  br i1 %379, label %380, label %381

380:                                              ; preds = %377
  store i64 %378, ptr %4, align 8, !tbaa !49
  br label %381

381:                                              ; preds = %296, %367, %377, %380, %376
  %.1159 = phi i32 [ -1, %296 ], [ 1, %376 ], [ 1, %380 ], [ 1, %377 ], [ 1, %367 ]
  ret i32 %.1159
}

; Function Attrs: nounwind uwtable
declare hidden i32 @is_martian(ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: nounwind uwtable
declare hidden void @debug_printable(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @token_bucket() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @blacklist_node(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

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

; Function Attrs: nounwind uwtable
declare hidden ptr @find_search(i16 noundef zeroext, i32 noundef) local_unnamed_addr #2

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @make_token(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare hidden i32 @storage_store(ptr noundef, ptr noundef, i16 noundef zeroext) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare hidden i32 @expire_storage() local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare hidden i32 @bucket_maintenance(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @neighbourhood_maintenance(i32 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { inlinehint 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { 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 #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(none) }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !10, i64 16}
!9 = !{!"parsed_message", !6, i64 0, !10, i64 16, !6, i64 18, !6, i64 38, !6, i64 58, !10, i64 78, !10, i64 80, !6, i64 82, !10, i64 210, !6, i64 212, !10, i64 628, !6, i64 630, !10, i64 1238, !6, i64 1240, !10, i64 3288, !6, i64 3290, !10, i64 5338, !10, i64 5340}
!10 = !{!"short", !6, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!13, !10, i64 0}
!13 = !{!"sockaddr", !10, i64 0, !6, i64 2}
!14 = !{!9, !10, i64 628}
!15 = !{!9, !10, i64 1238}
!16 = !{!17, !10, i64 0}
!17 = !{!"sockaddr_in", !10, i64 0, !10, i64 2, !18, i64 4, !6, i64 8}
!18 = !{!"in_addr", !19, i64 0}
!19 = !{!"int", !6, i64 0}
!20 = !{!21, !19, i64 4}
!21 = !{!"search", !10, i64 0, !19, i64 4, !22, i64 8, !6, i64 16, !10, i64 36, !19, i64 40, !6, i64 48, !19, i64 3296, !23, i64 3304}
!22 = !{!"long", !6, i64 0}
!23 = !{!"any pointer", !6, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !10, i64 0}
!27 = !{!"sockaddr_in6", !10, i64 0, !10, i64 2, !19, i64 4, !28, i64 8, !19, i64 24}
!28 = !{!"in6_addr", !6, i64 0}
!29 = distinct !{!29, !25}
!30 = !{!9, !10, i64 210}
!31 = !{!9, !10, i64 3288}
!32 = !{!9, !10, i64 5338}
!33 = !{!21, !19, i64 3296}
!34 = distinct !{!34, !25}
!35 = !{!36, !22, i64 160}
!36 = !{!"search_node", !6, i64 0, !37, i64 24, !19, i64 152, !22, i64 160, !22, i64 168, !19, i64 176, !6, i64 180, !19, i64 220, !19, i64 224, !19, i64 228}
!37 = !{!"sockaddr_storage", !10, i64 0, !6, i64 2, !22, i64 120}
!38 = !{!39, !22, i64 0}
!39 = !{!"timeval", !22, i64 0, !22, i64 8}
!40 = !{!36, !22, i64 168}
!41 = !{!36, !19, i64 228}
!42 = !{!36, !19, i64 176}
!43 = !{!9, !10, i64 5340}
!44 = !{!45, !19, i64 20}
!45 = !{!"storage", !6, i64 0, !19, i64 20, !19, i64 24, !23, i64 32, !23, i64 40}
!46 = !{!9, !10, i64 80}
!47 = !{!9, !10, i64 78}
!48 = !{!19, !19, i64 0}
!49 = !{!22, !22, i64 0}
!50 = !{!23, !23, i64 0}
!51 = !{!21, !19, i64 40}
!52 = !{!21, !22, i64 8}
!53 = distinct !{!53, !25}
!54 = distinct !{!54, !25}


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