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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.sockaddr_storage = type { i16, [118 x i8], i64 }
%union.__SOCKADDR_ARG = type { ptr }
%struct.gconf_t = type { i64, i64, ptr, ptr, ptr, ptr, ptr, i8, i8, i32, i32, i32, i32, ptr, i8, [8 x i8], i64, i64, i64, [8 x i32], [8 x i32] }

@gconf = external global ptr, align 8
@.str.60 = external hidden unnamed_addr constant [32 x i8], align 1
@g_dht_maintenance = external hidden global i64, align 8
@.str.61 = external hidden unnamed_addr constant [28 x i8], align 1

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

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

; 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 dso_local i32 @dht_periodic(ptr noundef, i64 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local void @dht_handler(i32 noundef %0, i32 noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [1500 x i8], align 16
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca %struct.sockaddr_storage, align 8
  %9 = alloca i32, align 4
  %10 = alloca %union.__SOCKADDR_ARG, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1500, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %16 = getelementptr inbounds [1500 x i8], ptr %5, i64 0, i64 0
  store ptr %16, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 128, ptr %8) #7
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %19, label %40

19:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 128, ptr %9, align 4, !tbaa !5
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = load ptr, ptr %6, align 8, !tbaa !9
  store ptr %8, ptr %10, align 8, !tbaa !13
  %22 = getelementptr inbounds %union.__SOCKADDR_ARG, ptr %10, i32 0, i32 0
  %23 = load ptr, ptr %22, align 8
  %24 = call i64 @recvfrom(i32 noundef %20, ptr noundef %21, i64 noundef 1499, i32 noundef 0, ptr %23, ptr noundef %9)
  store i64 %24, ptr %7, align 8, !tbaa !11
  %25 = load i64, ptr %7, align 8, !tbaa !11
  %26 = icmp sle i64 %25, 0
  br i1 %26, label %30, label %27

27:                                               ; preds = %19
  %28 = load i64, ptr %7, align 8, !tbaa !11
  %29 = icmp uge i64 %28, 1500
  br i1 %29, label %30, label %31

30:                                               ; preds = %27, %19
  store i32 1, ptr %11, align 4
  br label %37

31:                                               ; preds = %27
  %32 = load i64, ptr %7, align 8, !tbaa !11
  %33 = trunc i64 %32 to i32
  call void @record_traffic(i32 noundef %33, i32 noundef 0)
  %34 = load ptr, ptr %6, align 8, !tbaa !9
  %35 = load i64, ptr %7, align 8, !tbaa !11
  %36 = getelementptr inbounds i8, ptr %34, i64 %35
  store i8 0, ptr %36, align 1, !tbaa !13
  store i32 0, ptr %11, align 4
  br label %37

37:                                               ; preds = %31, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  %38 = load i32, ptr %11, align 4
  switch i32 %38, label %144 [
    i32 0, label %39
  ]

39:                                               ; preds = %37
  br label %40

40:                                               ; preds = %39, %2
  %41 = load i64, ptr %7, align 8, !tbaa !11
  %42 = icmp sgt i64 %41, 0
  br i1 %42, label %43, label %103

43:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %44 = load ptr, ptr @gconf, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct.gconf_t, ptr %44, i32 0, i32 14
  %46 = load i8, ptr %45, align 8, !tbaa !14
  %47 = zext i8 %46 to i64
  store i64 %47, ptr %12, align 8, !tbaa !11
  %48 = load i64, ptr %12, align 8, !tbaa !11
  %49 = icmp ugt i64 %48, 0
  br i1 %49, label %50, label %70

50:                                               ; preds = %43
  %51 = load i64, ptr %7, align 8, !tbaa !11
  %52 = load i64, ptr %12, align 8, !tbaa !11
  %53 = icmp ule i64 %51, %52
  br i1 %53, label %62, label %54

54:                                               ; preds = %50
  %55 = load ptr, ptr %6, align 8, !tbaa !9
  %56 = load ptr, ptr @gconf, align 8, !tbaa !9
  %57 = getelementptr inbounds %struct.gconf_t, ptr %56, i32 0, i32 15
  %58 = getelementptr inbounds [8 x i8], ptr %57, i64 0, i64 0
  %59 = load i64, ptr %12, align 8, !tbaa !11
  %60 = call i32 @memcmp(ptr noundef %55, ptr noundef %58, i64 noundef %59) #8
  %61 = icmp ne i32 0, %60
  br i1 %61, label %62, label %63

62:                                               ; preds = %54, %50
  store i32 1, ptr %11, align 4
  br label %100

63:                                               ; preds = %54
  %64 = load i64, ptr %12, align 8, !tbaa !11
  %65 = load ptr, ptr %6, align 8, !tbaa !9
  %66 = getelementptr inbounds i8, ptr %65, i64 %64
  store ptr %66, ptr %6, align 8, !tbaa !9
  %67 = load i64, ptr %12, align 8, !tbaa !11
  %68 = load i64, ptr %7, align 8, !tbaa !11
  %69 = sub i64 %68, %67
  store i64 %69, ptr %7, align 8, !tbaa !11
  br label %70

70:                                               ; preds = %63, %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 0, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 128, ptr %14, align 4, !tbaa !5
  %71 = load ptr, ptr %6, align 8, !tbaa !9
  %72 = load i64, ptr %7, align 8, !tbaa !11
  %73 = load i32, ptr %14, align 4, !tbaa !5
  %74 = call i32 @dht_periodic(ptr noundef %71, i64 noundef %72, ptr noundef %8, i32 noundef %73, ptr noundef %13, ptr noundef @dht_callback_func, ptr noundef null)
  store i32 %74, ptr %3, align 4, !tbaa !5
  %75 = load i32, ptr %3, align 4, !tbaa !5
  %76 = icmp slt i32 %75, 0
  br i1 %76, label %77, label %93

77:                                               ; preds = %70
  %78 = call ptr @__errno_location() #9
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = icmp ne i32 %79, 4
  br i1 %80, label %81, label %93

81:                                               ; preds = %77
  %82 = load i32, ptr %3, align 4, !tbaa !5
  %83 = icmp eq i32 %82, 22
  br i1 %83, label %87, label %84

84:                                               ; preds = %81
  %85 = load i32, ptr %3, align 4, !tbaa !5
  %86 = icmp eq i32 %85, 14
  br i1 %86, label %87, label %88

87:                                               ; preds = %84, %81
  call void (i32, ptr, ...) @log_print(i32 noundef 3, ptr noundef @.str.60)
  call void @exit(i32 noundef 1) #10
  unreachable

88:                                               ; preds = %84
  %89 = load ptr, ptr @gconf, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct.gconf_t, ptr %89, i32 0, i32 0
  %91 = load i64, ptr %90, align 8, !tbaa !17
  %92 = add nsw i64 %91, 1
  store i64 %92, ptr @g_dht_maintenance, align 8, !tbaa !11
  br label %99

93:                                               ; preds = %77, %70
  %94 = load ptr, ptr @gconf, align 8, !tbaa !9
  %95 = getelementptr inbounds %struct.gconf_t, ptr %94, i32 0, i32 0
  %96 = load i64, ptr %95, align 8, !tbaa !17
  %97 = load i64, ptr %13, align 8, !tbaa !11
  %98 = add nsw i64 %96, %97
  store i64 %98, ptr @g_dht_maintenance, align 8, !tbaa !11
  br label %99

99:                                               ; preds = %93, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  store i32 0, ptr %11, align 4
  br label %100

100:                                              ; preds = %99, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  %101 = load i32, ptr %11, align 4
  switch i32 %101, label %144 [
    i32 0, label %102
  ]

102:                                              ; preds = %100
  br label %118

103:                                              ; preds = %40
  %104 = load i64, ptr @g_dht_maintenance, align 8, !tbaa !11
  %105 = load ptr, ptr @gconf, align 8, !tbaa !9
  %106 = getelementptr inbounds %struct.gconf_t, ptr %105, i32 0, i32 0
  %107 = load i64, ptr %106, align 8, !tbaa !17
  %108 = icmp sle i64 %104, %107
  br i1 %108, label %109, label %116

109:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store i64 0, ptr %15, align 8, !tbaa !11
  %110 = call i32 @dht_periodic(ptr noundef null, i64 noundef 0, ptr noundef null, i32 noundef 0, ptr noundef %15, ptr noundef @dht_callback_func, ptr noundef null)
  store i32 %110, ptr %3, align 4, !tbaa !5
  %111 = load ptr, ptr @gconf, align 8, !tbaa !9
  %112 = getelementptr inbounds %struct.gconf_t, ptr %111, i32 0, i32 0
  %113 = load i64, ptr %112, align 8, !tbaa !17
  %114 = load i64, ptr %15, align 8, !tbaa !11
  %115 = add nsw i64 %113, %114
  store i64 %115, ptr @g_dht_maintenance, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %117

116:                                              ; preds = %103
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %116, %109
  br label %118

118:                                              ; preds = %117, %102
  %119 = load i32, ptr %3, align 4, !tbaa !5
  %120 = icmp slt i32 %119, 0
  br i1 %120, label %121, label %143

121:                                              ; preds = %118
  %122 = call ptr @__errno_location() #9
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = icmp eq i32 %123, 4
  br i1 %124, label %125, label %126

125:                                              ; preds = %121
  store i32 1, ptr %11, align 4
  br label %144

126:                                              ; preds = %121
  %127 = load i32, ptr %3, align 4, !tbaa !5
  %128 = icmp eq i32 %127, 22
  br i1 %128, label %132, label %129

129:                                              ; preds = %126
  %130 = load i32, ptr %3, align 4, !tbaa !5
  %131 = icmp eq i32 %130, 14
  br i1 %131, label %132, label %136

132:                                              ; preds = %129, %126
  %133 = call ptr @__errno_location() #9
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = call ptr @strerror(i32 noundef %134) #7
  call void (i32, ptr, ...) @log_print(i32 noundef 3, ptr noundef @.str.61, ptr noundef %135)
  store i32 1, ptr %11, align 4
  br label %144

136:                                              ; preds = %129
  %137 = load ptr, ptr @gconf, align 8, !tbaa !9
  %138 = getelementptr inbounds %struct.gconf_t, ptr %137, i32 0, i32 0
  %139 = load i64, ptr %138, align 8, !tbaa !17
  %140 = add nsw i64 %139, 1
  store i64 %140, ptr @g_dht_maintenance, align 8, !tbaa !11
  br label %141

141:                                              ; preds = %136
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142, %118
  store i32 0, ptr %11, align 4
  br label %144

144:                                              ; preds = %143, %132, %125, %100, %37
  call void @llvm.lifetime.end.p0(i64 128, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 1500, ptr %5) #7
  %145 = load i32, ptr %11, align 4
  switch i32 %145, label %147 [
    i32 0, label %146
    i32 1, label %146
  ]

146:                                              ; preds = %144, %144
  ret void

147:                                              ; preds = %144
  unreachable
}

declare i64 @recvfrom(i32 noundef, ptr noundef, i64 noundef, i32 noundef, ptr, ptr noundef) #3

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #4

declare void @log_print(i32 noundef, ptr noundef, ...) #3

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #5

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) #6

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind willreturn memory(read) "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 #5 = { noreturn 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 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { nounwind willreturn memory(none) }
attributes #10 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !7, i64 88}
!15 = !{!"gconf_t", !12, i64 0, !12, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !16, i64 56, !16, i64 57, !6, i64 60, !6, i64 64, !6, i64 68, !6, i64 72, !10, i64 80, !7, i64 88, !7, i64 89, !12, i64 104, !12, i64 112, !12, i64 120, !7, i64 128, !7, i64 160}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{!15, !12, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.sockaddr_storage = type { i16, [118 x i8], i64 }

@gconf = external local_unnamed_addr global ptr, align 8
@g_dht_maintenance = 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: 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 dso_local i32 @dht_periodic(ptr noundef, i64 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local void @dht_handler(i32 noundef %0, i32 noundef %1) local_unnamed_addr #2 {
  %3 = alloca [1500 x i8], align 16
  %4 = alloca %struct.sockaddr_storage, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 1500, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %4) #5
  %8 = icmp sgt i32 %0, 0
  br i1 %8, label %9, label %42

9:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  store i32 128, ptr %5, align 4, !tbaa !5
  %10 = call i64 @recvfrom(i32 noundef %1, ptr noundef nonnull %3, i64 noundef 1499, i32 noundef 0, ptr nonnull %4, ptr noundef nonnull %5) #5
  %11 = add i64 %10, -1
  %or.cond = icmp ult i64 %11, 1499
  br i1 %or.cond, label %12, label %.critedge

12:                                               ; preds = %9
  %13 = trunc nuw nsw i64 %10 to i32
  call void @record_traffic(i32 noundef %13, i32 noundef 0)
  %14 = getelementptr inbounds i8, ptr %3, i64 %10
  store i8 0, ptr %14, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  %15 = load ptr, ptr @gconf, align 8, !tbaa !10
  %16 = getelementptr inbounds i8, ptr %15, i64 88
  %17 = load i8, ptr %16, align 8, !tbaa !12
  %18 = zext i8 %17 to i64
  %.not43 = icmp eq i8 %17, 0
  br i1 %.not43, label %25, label %19

19:                                               ; preds = %12
  %.not44 = icmp ugt i64 %10, %18
  br i1 %.not44, label %20, label %.thread49

20:                                               ; preds = %19
  %21 = getelementptr inbounds i8, ptr %15, i64 89
  %bcmp = call i32 @bcmp(ptr nonnull %3, ptr nonnull %21, i64 %18)
  %.not45 = icmp eq i32 %bcmp, 0
  br i1 %.not45, label %22, label %.thread49

22:                                               ; preds = %20
  %23 = getelementptr inbounds i8, ptr %3, i64 %18
  %24 = sub nsw i64 %10, %18
  br label %25

25:                                               ; preds = %22, %12
  %.138 = phi i64 [ %24, %22 ], [ %10, %12 ]
  %.034 = phi ptr [ %23, %22 ], [ %3, %12 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  store i64 0, ptr %6, align 8, !tbaa !16
  %26 = call i32 @dht_periodic(ptr noundef nonnull %.034, i64 noundef %.138, ptr noundef nonnull %4, i32 noundef 128, ptr noundef nonnull %6, ptr noundef nonnull @dht_callback_func, ptr noundef null)
  %27 = icmp slt i32 %26, 0
  br i1 %27, label %28, label %35

28:                                               ; preds = %25
  %29 = tail call ptr @__errno_location() #6
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %.not46 = icmp eq i32 %30, 4
  br i1 %.not46, label %35, label %31

31:                                               ; preds = %28
  %32 = load ptr, ptr @gconf, align 8, !tbaa !10
  %33 = load i64, ptr %32, align 8, !tbaa !17
  %34 = add nsw i64 %33, 1
  br label %40

35:                                               ; preds = %28, %25
  %36 = load ptr, ptr @gconf, align 8, !tbaa !10
  %37 = load i64, ptr %36, align 8, !tbaa !17
  %38 = load i64, ptr %6, align 8, !tbaa !16
  %39 = add nsw i64 %38, %37
  br label %40

40:                                               ; preds = %31, %35
  %41 = phi ptr [ %36, %35 ], [ %32, %31 ]
  %storemerge = phi i64 [ %39, %35 ], [ %34, %31 ]
  store i64 %storemerge, ptr @g_dht_maintenance, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %52

42:                                               ; preds = %2
  %43 = load i64, ptr @g_dht_maintenance, align 8, !tbaa !16
  %44 = load ptr, ptr @gconf, align 8, !tbaa !10
  %45 = load i64, ptr %44, align 8, !tbaa !17
  %.not = icmp sgt i64 %43, %45
  br i1 %.not, label %.thread49, label %46

46:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  store i64 0, ptr %7, align 8, !tbaa !16
  %47 = call i32 @dht_periodic(ptr noundef null, i64 noundef 0, ptr noundef null, i32 noundef 0, ptr noundef nonnull %7, ptr noundef nonnull @dht_callback_func, ptr noundef null)
  %48 = load ptr, ptr @gconf, align 8, !tbaa !10
  %49 = load i64, ptr %48, align 8, !tbaa !17
  %50 = load i64, ptr %7, align 8, !tbaa !16
  %51 = add nsw i64 %50, %49
  store i64 %51, ptr @g_dht_maintenance, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %52

52:                                               ; preds = %40, %46
  %53 = phi ptr [ %41, %40 ], [ %48, %46 ]
  %.1 = phi i32 [ %26, %40 ], [ %47, %46 ]
  %54 = icmp slt i32 %.1, 0
  br i1 %54, label %55, label %.thread49

55:                                               ; preds = %52
  %56 = tail call ptr @__errno_location() #6
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = icmp eq i32 %57, 4
  br i1 %58, label %.thread49, label %59

59:                                               ; preds = %55
  %60 = load i64, ptr %53, align 8, !tbaa !17
  %61 = add nsw i64 %60, 1
  store i64 %61, ptr @g_dht_maintenance, align 8, !tbaa !16
  br label %.thread49

.critedge:                                        ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  br label %.thread49

.thread49:                                        ; preds = %42, %19, %20, %52, %59, %55, %.critedge
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 1500, ptr nonnull %3) #5
  ret void
}

declare i64 @recvfrom(i32 noundef, ptr noundef, i64 noundef, i32 noundef, ptr, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #4

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 = { "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 = { nofree nounwind willreturn memory(argmem: read) }
attributes #5 = { nounwind }
attributes #6 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!13, !7, i64 88}
!13 = !{!"gconf_t", !14, i64 0, !14, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !15, i64 56, !15, i64 57, !6, i64 60, !6, i64 64, !6, i64 68, !6, i64 72, !11, i64 80, !7, i64 88, !7, i64 89, !14, i64 104, !14, i64 112, !14, i64 120, !7, i64 128, !7, i64 160}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!14, !14, i64 0}
!17 = !{!13, !14, i64 0}


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