; LLVM IR from nubot-nudt/simatch :: src/robot_code/world_model/rtdb (comm)

; 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._agent = type { i8, i8, i8, %struct.timeval, i32, i32, [10 x i8], i32 }
%struct.RTDBconf_var = type { i32, i32, i32 }
%struct.sched_param = type { i32 }
%union.pthread_attr_t = type { i64, [48 x i8] }
%struct.itimerval = type { %struct.timeval, %struct.timeval }
%struct._frameHeader = type { i8, i32, [10 x i8], i32 }

@end = external dso_local global i32, align 4
@timer = external dso_local global i32, align 4
@MAX_DELTA = external dso_local global i32, align 4
@lastSendTimeStamp = external dso_local global %struct.timeval, align 8
@delay = external dso_local global i32, align 4
@lostPackets = external dso_local global [10 x i32], align 16
@myNumber = external dso_local global i32, align 4
@agent = external dso_local global [10 x %struct._agent], align 16
@RUNNING_AGENTS = external dso_local global i32, align 4
@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [36 x i8], align 1
@__FUNCTION__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [96 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [26 x i8], align 1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z17update_stateTablev() #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z17receiveDataThreadPv(ptr noundef) #3

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

; 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) #5

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #7 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca [5000 x i8], align 16
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca [100 x %struct.RTDBconf_var], align 16
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %struct.sched_param, align 4
  %17 = alloca %union.pthread_attr_t, align 8
  %18 = alloca %struct.itimerval, align 8
  %19 = alloca %struct._frameHeader, align 4
  %20 = alloca %struct.timeval, align 8
  %21 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  store i32 2, ptr %4, align 4, !tbaa !5
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = getelementptr inbounds ptr, ptr %22, i64 0
  store ptr @.str.2, ptr %23, align 8, !tbaa !9
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  %25 = getelementptr inbounds ptr, ptr %24, i64 1
  store ptr @.str.3, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.start.p0(i64 5000, ptr %8) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 1200, ptr %11) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.start.p0(i64 56, ptr %17) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #9
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = icmp slt i32 %26, 2
  br i1 %27, label %28, label %30

28:                                               ; preds = %2
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %368

30:                                               ; preds = %2
  store i32 0, ptr @delay, align 4, !tbaa !5
  store i32 0, ptr @timer, align 4, !tbaa !5
  store i32 0, ptr @end, align 4, !tbaa !5
  store i32 1, ptr @RUNNING_AGENTS, align 4, !tbaa !5
  %31 = getelementptr inbounds %struct.sched_param, ptr %16, i32 0, i32 0
  store i32 60, ptr %31, align 4, !tbaa !11
  %32 = call i32 @getpid() #9
  %33 = call i32 @sched_setscheduler(i32 noundef %32, i32 noundef 1, ptr noundef %16) #9
  %34 = icmp slt i32 %33, 0
  br i1 %34, label %35, label %40

35:                                               ; preds = %30
  %36 = call ptr @__errno_location() #10
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = call ptr @strerror(i32 noundef %37) #9
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @__FUNCTION__.main, ptr noundef %38)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %368

40:                                               ; preds = %30
  %41 = call ptr @signal(i32 noundef 14, ptr noundef @_ZL12signal_catchi) #9
  %42 = icmp eq ptr %41, inttoptr (i64 -1 to ptr)
  br i1 %42, label %43, label %48

43:                                               ; preds = %40
  %44 = call ptr @__errno_location() #10
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = call ptr @strerror(i32 noundef %45) #9
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef @.str.1, ptr noundef @__FUNCTION__.main, ptr noundef %46)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %368

48:                                               ; preds = %40
  %49 = call ptr @signal(i32 noundef 2, ptr noundef @_ZL12signal_catchi) #9
  %50 = icmp eq ptr %49, inttoptr (i64 -1 to ptr)
  br i1 %50, label %51, label %56

51:                                               ; preds = %48
  %52 = call ptr @__errno_location() #10
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = call ptr @strerror(i32 noundef %53) #9
  %55 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef @.str.1, ptr noundef @__FUNCTION__.main, ptr noundef %54)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %368

56:                                               ; preds = %48
  %57 = load ptr, ptr %5, align 8, !tbaa !9
  %58 = getelementptr inbounds ptr, ptr %57, i64 1
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  %60 = call noundef i32 @_Z10openSocketPc(ptr noundef %59)
  store i32 %60, ptr %6, align 4, !tbaa !5
  %61 = icmp eq i32 %60, -1
  br i1 %61, label %62, label %65

62:                                               ; preds = %56
  %63 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef @.str.1, ptr noundef @__FUNCTION__.main)
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %368

65:                                               ; preds = %56
  %66 = call noundef i32 @_Z7DB_initv()
  %67 = icmp eq i32 %66, -1
  br i1 %67, label %68, label %71

68:                                               ; preds = %65
  %69 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef @.str.1, ptr noundef @__FUNCTION__.main)
  %70 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z11closeSocketi(i32 noundef %70)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %368

71:                                               ; preds = %65
  %72 = getelementptr inbounds [100 x %struct.RTDBconf_var], ptr %11, i64 0, i64 0
  %73 = call noundef i32 @_Z11DB_comm_iniP12RTDBconf_var(ptr noundef %72)
  store i32 %73, ptr %10, align 4, !tbaa !5
  %74 = icmp slt i32 %73, 1
  br i1 %74, label %75, label %78

75:                                               ; preds = %71
  %76 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, ptr noundef @.str.1, ptr noundef @__FUNCTION__.main)
  call void @_Z7DB_freev()
  %77 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z11closeSocketi(i32 noundef %77)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %368

78:                                               ; preds = %71
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %98, %78
  %80 = load i32, ptr %13, align 4, !tbaa !5
  %81 = icmp slt i32 %80, 10
  br i1 %81, label %82, label %101

82:                                               ; preds = %79
  %83 = load i32, ptr %13, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [10 x i32], ptr @lostPackets, i64 0, i64 %84
  store i32 0, ptr %85, align 4, !tbaa !5
  %86 = load i32, ptr %13, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %87
  %89 = getelementptr inbounds %struct._agent, ptr %88, i32 0, i32 5
  store i32 0, ptr %89, align 4, !tbaa !13
  %90 = load i32, ptr %13, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %91
  %93 = getelementptr inbounds %struct._agent, ptr %92, i32 0, i32 0
  store i8 0, ptr %93, align 16, !tbaa !17
  %94 = load i32, ptr %13, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %95
  %97 = getelementptr inbounds %struct._agent, ptr %96, i32 0, i32 7
  store i32 0, ptr %97, align 4, !tbaa !18
  br label %98

98:                                               ; preds = %82
  %99 = load i32, ptr %13, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %13, align 4, !tbaa !5
  br label %79, !llvm.loop !19

101:                                              ; preds = %79
  %102 = call noundef i32 @_Z6Whoamiv()
  store i32 %102, ptr @myNumber, align 4, !tbaa !5
  %103 = load i32, ptr @myNumber, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %104
  %106 = getelementptr inbounds %struct._agent, ptr %105, i32 0, i32 0
  store i8 1, ptr %106, align 16, !tbaa !17
  %107 = call i32 @pthread_attr_init(ptr noundef %17) #9
  %108 = call i32 @pthread_attr_setinheritsched(ptr noundef %17, i32 noundef 0) #9
  %109 = call i32 @pthread_create(ptr noundef %7, ptr noundef %17, ptr noundef @_Z17receiveDataThreadPv, ptr noundef %6) #9
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %117

111:                                              ; preds = %101
  %112 = call ptr @__errno_location() #10
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = call ptr @strerror(i32 noundef %113) #9
  %115 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, ptr noundef @.str.1, ptr noundef @__FUNCTION__.main, ptr noundef %114)
  call void @_Z7DB_freev()
  %116 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z11closeSocketi(i32 noundef %116)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %368

117:                                              ; preds = %101
  %118 = getelementptr inbounds %struct.itimerval, ptr %18, i32 0, i32 1
  %119 = getelementptr inbounds %struct.timeval, ptr %118, i32 0, i32 1
  store i64 100000, ptr %119, align 8, !tbaa !21
  %120 = getelementptr inbounds %struct.itimerval, ptr %18, i32 0, i32 1
  %121 = getelementptr inbounds %struct.timeval, ptr %120, i32 0, i32 0
  store i64 0, ptr %121, align 8, !tbaa !23
  %122 = getelementptr inbounds %struct.itimerval, ptr %18, i32 0, i32 0
  %123 = getelementptr inbounds %struct.timeval, ptr %122, i32 0, i32 1
  store i64 100000, ptr %123, align 8, !tbaa !24
  %124 = getelementptr inbounds %struct.itimerval, ptr %18, i32 0, i32 0
  %125 = getelementptr inbounds %struct.timeval, ptr %124, i32 0, i32 0
  store i64 0, ptr %125, align 8, !tbaa !25
  %126 = call i32 @setitimer(i32 noundef 0, ptr noundef %18, ptr noundef null) #9
  %127 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  %128 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  br label %129

129:                                              ; preds = %353, %152, %137, %117
  %130 = load i32, ptr @end, align 4, !tbaa !5
  %131 = icmp ne i32 %130, 0
  %132 = xor i1 %131, true
  br i1 %132, label %133, label %354

133:                                              ; preds = %129
  %134 = call i32 @pause()
  %135 = load i32, ptr @timer, align 4, !tbaa !5
  %136 = icmp eq i32 %135, 0
  br i1 %136, label %137, label %138

137:                                              ; preds = %133
  br label %129, !llvm.loop !26

138:                                              ; preds = %133
  %139 = load i32, ptr @delay, align 4, !tbaa !5
  %140 = icmp sgt i32 %139, 1000
  br i1 %140, label %141, label %165

141:                                              ; preds = %138
  %142 = load i32, ptr @myNumber, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %143
  %145 = getelementptr inbounds %struct._agent, ptr %144, i32 0, i32 1
  %146 = load i8, ptr %145, align 1, !tbaa !27
  %147 = sext i8 %146 to i32
  %148 = icmp eq i32 %147, 0
  br i1 %148, label %149, label %165

149:                                              ; preds = %141
  %150 = load i32, ptr @timer, align 4, !tbaa !5
  %151 = icmp eq i32 %150, 1
  br i1 %151, label %152, label %165

152:                                              ; preds = %149
  %153 = load i32, ptr @delay, align 4, !tbaa !5
  %154 = sub nsw i32 %153, 500
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds %struct.itimerval, ptr %18, i32 0, i32 1
  %157 = getelementptr inbounds %struct.timeval, ptr %156, i32 0, i32 1
  store i64 %155, ptr %157, align 8, !tbaa !21
  %158 = getelementptr inbounds %struct.itimerval, ptr %18, i32 0, i32 1
  %159 = getelementptr inbounds %struct.timeval, ptr %158, i32 0, i32 0
  store i64 0, ptr %159, align 8, !tbaa !23
  %160 = getelementptr inbounds %struct.itimerval, ptr %18, i32 0, i32 0
  %161 = getelementptr inbounds %struct.timeval, ptr %160, i32 0, i32 1
  store i64 100000, ptr %161, align 8, !tbaa !24
  %162 = getelementptr inbounds %struct.itimerval, ptr %18, i32 0, i32 0
  %163 = getelementptr inbounds %struct.timeval, ptr %162, i32 0, i32 0
  store i64 0, ptr %163, align 8, !tbaa !25
  %164 = call i32 @setitimer(i32 noundef 0, ptr noundef %18, ptr noundef null) #9
  store i32 0, ptr @delay, align 4, !tbaa !5
  br label %129, !llvm.loop !26

165:                                              ; preds = %149, %141, %138
  store i32 0, ptr @timer, align 4, !tbaa !5
  store i32 0, ptr %9, align 4, !tbaa !5
  %166 = getelementptr inbounds [5000 x i8], ptr %8, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %166, i8 0, i64 5000, i1 false)
  call void @_Z17update_stateTablev()
  store i32 0, ptr %14, align 4, !tbaa !5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %167

167:                                              ; preds = %208, %165
  %168 = load i32, ptr %13, align 4, !tbaa !5
  %169 = icmp slt i32 %168, 10
  br i1 %169, label %170, label %211

170:                                              ; preds = %167
  %171 = load i32, ptr %13, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %172
  %174 = getelementptr inbounds %struct._agent, ptr %173, i32 0, i32 0
  %175 = load i8, ptr %174, align 16, !tbaa !17
  %176 = sext i8 %175 to i32
  %177 = icmp eq i32 %176, 1
  br i1 %177, label %186, label %178

178:                                              ; preds = %170
  %179 = load i32, ptr %13, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %180
  %182 = getelementptr inbounds %struct._agent, ptr %181, i32 0, i32 0
  %183 = load i8, ptr %182, align 16, !tbaa !17
  %184 = sext i8 %183 to i32
  %185 = icmp eq i32 %184, 3
  br i1 %185, label %186, label %195

186:                                              ; preds = %178, %170
  %187 = load i32, ptr %14, align 4, !tbaa !5
  %188 = trunc i32 %187 to i8
  %189 = load i32, ptr %13, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %190
  %192 = getelementptr inbounds %struct._agent, ptr %191, i32 0, i32 1
  store i8 %188, ptr %192, align 1, !tbaa !27
  %193 = load i32, ptr %14, align 4, !tbaa !5
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %14, align 4, !tbaa !5
  br label %195

195:                                              ; preds = %186, %178
  %196 = load i32, ptr %13, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %197
  %199 = getelementptr inbounds %struct._agent, ptr %198, i32 0, i32 0
  %200 = load i8, ptr %199, align 16, !tbaa !17
  %201 = load i32, ptr @myNumber, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %202
  %204 = getelementptr inbounds %struct._agent, ptr %203, i32 0, i32 6
  %205 = load i32, ptr %13, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [10 x i8], ptr %204, i64 0, i64 %206
  store i8 %200, ptr %207, align 1, !tbaa !28
  br label %208

208:                                              ; preds = %195
  %209 = load i32, ptr %13, align 4, !tbaa !5
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %13, align 4, !tbaa !5
  br label %167, !llvm.loop !29

211:                                              ; preds = %167
  %212 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %212, ptr @RUNNING_AGENTS, align 4, !tbaa !5
  %213 = load i32, ptr @RUNNING_AGENTS, align 4, !tbaa !5
  %214 = sitofp i32 %213 to double
  %215 = fdiv double 1.000000e+05, %214
  %216 = fmul double %215, 2.000000e+00
  %217 = fdiv double %216, 3.000000e+00
  %218 = fptosi double %217 to i32
  store i32 %218, ptr @MAX_DELTA, align 4, !tbaa !5
  %219 = load i32, ptr @myNumber, align 4, !tbaa !5
  %220 = trunc i32 %219 to i8
  %221 = getelementptr inbounds %struct._frameHeader, ptr %19, i32 0, i32 0
  store i8 %220, ptr %221, align 4, !tbaa !30
  %222 = load i32, ptr %12, align 4, !tbaa !5
  %223 = getelementptr inbounds %struct._frameHeader, ptr %19, i32 0, i32 1
  store i32 %222, ptr %223, align 4, !tbaa !32
  %224 = load i32, ptr %12, align 4, !tbaa !5
  %225 = add i32 %224, 1
  store i32 %225, ptr %12, align 4, !tbaa !5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %226

226:                                              ; preds = %242, %211
  %227 = load i32, ptr %13, align 4, !tbaa !5
  %228 = icmp slt i32 %227, 10
  br i1 %228, label %229, label %245

229:                                              ; preds = %226
  %230 = load i32, ptr @myNumber, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %231
  %233 = getelementptr inbounds %struct._agent, ptr %232, i32 0, i32 6
  %234 = load i32, ptr %13, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [10 x i8], ptr %233, i64 0, i64 %235
  %237 = load i8, ptr %236, align 1, !tbaa !28
  %238 = getelementptr inbounds %struct._frameHeader, ptr %19, i32 0, i32 2
  %239 = load i32, ptr %13, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [10 x i8], ptr %238, i64 0, i64 %240
  store i8 %237, ptr %241, align 1, !tbaa !28
  br label %242

242:                                              ; preds = %229
  %243 = load i32, ptr %13, align 4, !tbaa !5
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %13, align 4, !tbaa !5
  br label %226, !llvm.loop !33

245:                                              ; preds = %226
  %246 = load i32, ptr %10, align 4, !tbaa !5
  %247 = getelementptr inbounds %struct._frameHeader, ptr %19, i32 0, i32 3
  store i32 %246, ptr %247, align 4, !tbaa !34
  %248 = getelementptr inbounds [5000 x i8], ptr %8, i64 0, i64 0
  %249 = load i32, ptr %9, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds i8, ptr %248, i64 %250
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %251, ptr align 4 %19, i64 24, i1 false)
  %252 = load i32, ptr %9, align 4, !tbaa !5
  %253 = sext i32 %252 to i64
  %254 = add i64 %253, 24
  %255 = trunc i64 %254 to i32
  store i32 %255, ptr %9, align 4, !tbaa !5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %256

256:                                              ; preds = %312, %245
  %257 = load i32, ptr %13, align 4, !tbaa !5
  %258 = load i32, ptr %10, align 4, !tbaa !5
  %259 = icmp slt i32 %257, %258
  br i1 %259, label %260, label %315

260:                                              ; preds = %256
  %261 = getelementptr inbounds [5000 x i8], ptr %8, i64 0, i64 0
  %262 = load i32, ptr %9, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds i8, ptr %261, i64 %263
  %265 = load i32, ptr %13, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [100 x %struct.RTDBconf_var], ptr %11, i64 0, i64 %266
  %268 = getelementptr inbounds %struct.RTDBconf_var, ptr %267, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %264, ptr align 4 %268, i64 4, i1 false)
  %269 = load i32, ptr %9, align 4, !tbaa !5
  %270 = sext i32 %269 to i64
  %271 = add i64 %270, 4
  %272 = trunc i64 %271 to i32
  store i32 %272, ptr %9, align 4, !tbaa !5
  %273 = getelementptr inbounds [5000 x i8], ptr %8, i64 0, i64 0
  %274 = load i32, ptr %9, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds i8, ptr %273, i64 %275
  %277 = load i32, ptr %13, align 4, !tbaa !5
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [100 x %struct.RTDBconf_var], ptr %11, i64 0, i64 %278
  %280 = getelementptr inbounds %struct.RTDBconf_var, ptr %279, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %276, ptr align 4 %280, i64 4, i1 false)
  %281 = load i32, ptr %9, align 4, !tbaa !5
  %282 = sext i32 %281 to i64
  %283 = add i64 %282, 4
  %284 = trunc i64 %283 to i32
  store i32 %284, ptr %9, align 4, !tbaa !5
  %285 = load i32, ptr @myNumber, align 4, !tbaa !5
  %286 = load i32, ptr %13, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [100 x %struct.RTDBconf_var], ptr %11, i64 0, i64 %287
  %289 = getelementptr inbounds %struct.RTDBconf_var, ptr %288, i32 0, i32 0
  %290 = load i32, ptr %289, align 4, !tbaa !35
  %291 = getelementptr inbounds [5000 x i8], ptr %8, i64 0, i64 0
  %292 = load i32, ptr %9, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds i8, ptr %291, i64 %293
  %295 = getelementptr inbounds i8, ptr %294, i64 4
  %296 = call noundef i32 @_Z6DB_getiiPv(i32 noundef %285, i32 noundef %290, ptr noundef %295)
  store i32 %296, ptr %15, align 4, !tbaa !5
  %297 = getelementptr inbounds [5000 x i8], ptr %8, i64 0, i64 0
  %298 = load i32, ptr %9, align 4, !tbaa !5
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds i8, ptr %297, i64 %299
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %300, ptr align 4 %15, i64 4, i1 false)
  %301 = load i32, ptr %9, align 4, !tbaa !5
  %302 = sext i32 %301 to i64
  %303 = add i64 %302, 4
  %304 = load i32, ptr %13, align 4, !tbaa !5
  %305 = sext i32 %304 to i64
  %306 = getelementptr inbounds [100 x %struct.RTDBconf_var], ptr %11, i64 0, i64 %305
  %307 = getelementptr inbounds %struct.RTDBconf_var, ptr %306, i32 0, i32 1
  %308 = load i32, ptr %307, align 4, !tbaa !37
  %309 = sext i32 %308 to i64
  %310 = add i64 %303, %309
  %311 = trunc i64 %310 to i32
  store i32 %311, ptr %9, align 4, !tbaa !5
  br label %312

312:                                              ; preds = %260
  %313 = load i32, ptr %13, align 4, !tbaa !5
  %314 = add nsw i32 %313, 1
  store i32 %314, ptr %13, align 4, !tbaa !5
  br label %256, !llvm.loop !38

315:                                              ; preds = %256
  %316 = load i32, ptr %9, align 4, !tbaa !5
  %317 = icmp sgt i32 %316, 5000
  br i1 %317, label %318, label %321

318:                                              ; preds = %315
  %319 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, ptr noundef @.str.1, ptr noundef @__FUNCTION__.main)
  %320 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, ptr noundef @.str.1, ptr noundef @__FUNCTION__.main)
  br label %354

321:                                              ; preds = %315
  %322 = load i32, ptr %6, align 4, !tbaa !5
  %323 = load i32, ptr %9, align 4, !tbaa !5
  %324 = call noundef i32 @_Z8sendDataiPvi(i32 noundef %322, ptr noundef %8, i32 noundef %323)
  %325 = load i32, ptr %9, align 4, !tbaa !5
  %326 = icmp ne i32 %324, %325
  br i1 %326, label %327, label %332

327:                                              ; preds = %321
  %328 = call ptr @__errno_location() #10
  %329 = load i32, ptr %328, align 4, !tbaa !5
  %330 = call ptr @strerror(i32 noundef %329) #9
  %331 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, ptr noundef @.str.1, ptr noundef @__FUNCTION__.main, ptr noundef %330)
  br label %332

332:                                              ; preds = %327, %321
  %333 = call i32 @gettimeofday(ptr noundef %20, ptr noundef null) #9
  %334 = getelementptr inbounds %struct.timeval, ptr %20, i32 0, i32 0
  %335 = load i64, ptr %334, align 8, !tbaa !39
  store i64 %335, ptr @lastSendTimeStamp, align 8, !tbaa !39
  %336 = getelementptr inbounds %struct.timeval, ptr %20, i32 0, i32 1
  %337 = load i64, ptr %336, align 8, !tbaa !40
  store i64 %337, ptr getelementptr inbounds (%struct.timeval, ptr @lastSendTimeStamp, i32 0, i32 1), align 8, !tbaa !40
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %338

338:                                              ; preds = %350, %332
  %339 = load i32, ptr %13, align 4, !tbaa !5
  %340 = icmp slt i32 %339, 10
  br i1 %340, label %341, label %353

341:                                              ; preds = %338
  %342 = load i32, ptr %13, align 4, !tbaa !5
  %343 = sext i32 %342 to i64
  %344 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %343
  %345 = getelementptr inbounds %struct._agent, ptr %344, i32 0, i32 4
  store i32 0, ptr %345, align 8, !tbaa !41
  %346 = load i32, ptr %13, align 4, !tbaa !5
  %347 = sext i32 %346 to i64
  %348 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %347
  %349 = getelementptr inbounds %struct._agent, ptr %348, i32 0, i32 2
  store i8 0, ptr %349, align 2, !tbaa !42
  br label %350

350:                                              ; preds = %341
  %351 = load i32, ptr %13, align 4, !tbaa !5
  %352 = add nsw i32 %351, 1
  store i32 %352, ptr %13, align 4, !tbaa !5
  br label %338, !llvm.loop !43

353:                                              ; preds = %338
  br label %129, !llvm.loop !26

354:                                              ; preds = %318, %129
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %355

355:                                              ; preds = %359, %354
  %356 = load i32, ptr %13, align 4, !tbaa !5
  %357 = icmp slt i32 %356, 10
  br i1 %357, label %358, label %362

358:                                              ; preds = %355
  br label %359

359:                                              ; preds = %358
  %360 = load i32, ptr %13, align 4, !tbaa !5
  %361 = add nsw i32 %360, 1
  store i32 %361, ptr %13, align 4, !tbaa !5
  br label %355, !llvm.loop !44

362:                                              ; preds = %355
  %363 = call i32 (ptr, ...) @printf(ptr noundef @.str.17)
  %364 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z11closeSocketi(i32 noundef %364)
  %365 = load i64, ptr %7, align 8, !tbaa !45
  %366 = call i32 @pthread_join(i64 noundef %365, ptr noundef null)
  call void @_Z7DB_freev()
  %367 = call i32 (ptr, ...) @printf(ptr noundef @.str.18)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %368

368:                                              ; preds = %362, %111, %75, %68, %62, %51, %43, %35, %28
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 1200, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 5000, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  %369 = load i32, ptr %3, align 4
  ret i32 %369
}

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

; Function Attrs: nounwind
declare i32 @getpid() #1

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

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

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

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

declare noundef i32 @_Z10openSocketPc(ptr noundef) #6

declare noundef i32 @_Z7DB_initv() #6

declare void @_Z11closeSocketi(i32 noundef) #6

declare noundef i32 @_Z11DB_comm_iniP12RTDBconf_var(ptr noundef) #6

declare void @_Z7DB_freev() #6

declare noundef i32 @_Z6Whoamiv() #6

; Function Attrs: nounwind
declare i32 @pthread_attr_init(ptr noundef) #1

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

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

declare i32 @pause() #6

declare noundef i32 @_Z6DB_getiiPv(i32 noundef, i32 noundef, ptr noundef) #6

declare noundef i32 @_Z8sendDataiPvi(i32 noundef, ptr noundef, i32 noundef) #6

declare i32 @pthread_join(i64 noundef, ptr noundef) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 = { mustprogress 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: write) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { "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 norecurse 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS11sched_param", !6, i64 0}
!13 = !{!14, !6, i64 28}
!14 = !{!"_ZTS6_agent", !7, i64 0, !7, i64 1, !7, i64 2, !15, i64 8, !6, i64 24, !6, i64 28, !7, i64 32, !6, i64 44}
!15 = !{!"_ZTS7timeval", !16, i64 0, !16, i64 8}
!16 = !{!"long", !7, i64 0}
!17 = !{!14, !7, i64 0}
!18 = !{!14, !6, i64 44}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!22, !16, i64 24}
!22 = !{!"_ZTS9itimerval", !15, i64 0, !15, i64 16}
!23 = !{!22, !16, i64 16}
!24 = !{!22, !16, i64 8}
!25 = !{!22, !16, i64 0}
!26 = distinct !{!26, !20}
!27 = !{!14, !7, i64 1}
!28 = !{!7, !7, i64 0}
!29 = distinct !{!29, !20}
!30 = !{!31, !7, i64 0}
!31 = !{!"_ZTS12_frameHeader", !7, i64 0, !6, i64 4, !7, i64 8, !6, i64 20}
!32 = !{!31, !6, i64 4}
!33 = distinct !{!33, !20}
!34 = !{!31, !6, i64 20}
!35 = !{!36, !6, i64 0}
!36 = !{!"_ZTS12RTDBconf_var", !6, i64 0, !6, i64 4, !6, i64 8}
!37 = !{!36, !6, i64 4}
!38 = distinct !{!38, !20}
!39 = !{!15, !16, i64 0}
!40 = !{!15, !16, i64 8}
!41 = !{!14, !6, i64 24}
!42 = !{!14, !7, i64 2}
!43 = distinct !{!43, !20}
!44 = distinct !{!44, !20}
!45 = !{!16, !16, 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.timeval = type { i64, i64 }
%struct._agent = type { i8, i8, i8, %struct.timeval, i32, i32, [10 x i8], i32 }
%struct.RTDBconf_var = type { i32, i32, i32 }
%struct.sched_param = type { i32 }
%union.pthread_attr_t = type { i64, [48 x i8] }
%struct.itimerval = type { %struct.timeval, %struct.timeval }

@end = external dso_local local_unnamed_addr global i32, align 4
@timer = external dso_local local_unnamed_addr global i32, align 4
@MAX_DELTA = external dso_local local_unnamed_addr global i32, align 4
@lastSendTimeStamp = external dso_local local_unnamed_addr global %struct.timeval, align 8
@delay = external dso_local local_unnamed_addr global i32, align 4
@lostPackets = external dso_local local_unnamed_addr global [10 x i32], align 16
@myNumber = external dso_local local_unnamed_addr global i32, align 4
@agent = external dso_local local_unnamed_addr global [10 x %struct._agent], align 16
@RUNNING_AGENTS = external dso_local local_unnamed_addr global i32, align 4
@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [36 x i8], align 1
@__FUNCTION__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [96 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [26 x i8], align 1

; 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 nounwind willreturn
declare noundef i32 @setitimer(i32 noundef, ptr nocapture noundef readonly, ptr nocapture noundef) 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: mustprogress nounwind uwtable
declare dso_local void @_Z17update_stateTablev() local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z17receiveDataThreadPv(ptr noundef) #3

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

; 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) #5

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef range(i32 -1, 1) i32 @main(i32 noundef %0, ptr nocapture noundef %1) local_unnamed_addr #7 {
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca [5000 x i8], align 16
  %6 = alloca [100 x %struct.RTDBconf_var], align 16
  %7 = alloca %struct.sched_param, align 4
  %8 = alloca %union.pthread_attr_t, align 8
  %9 = alloca %struct.itimerval, align 8
  %.sroa.4 = alloca [3 x i8], align 1
  %10 = alloca %struct.timeval, align 16
  store ptr @.str.2, ptr %1, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %1, i64 8
  store ptr @.str.3, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #11
  call void @llvm.lifetime.start.p0(i64 5000, ptr nonnull %5) #11
  call void @llvm.lifetime.start.p0(i64 1200, ptr nonnull %6) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #11
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %8) #11
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #11
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %.sroa.4)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #11
  store i32 0, ptr @delay, align 4, !tbaa !9
  store i32 0, ptr @timer, align 4, !tbaa !9
  store i32 0, ptr @end, align 4, !tbaa !9
  store i32 1, ptr @RUNNING_AGENTS, align 4, !tbaa !9
  store i32 60, ptr %7, align 4, !tbaa !11
  %12 = tail call i32 @getpid() #11
  %13 = call i32 @sched_setscheduler(i32 noundef %12, i32 noundef 1, ptr noundef nonnull %7) #11
  %14 = icmp slt i32 %13, 0
  br i1 %14, label %15, label %20

15:                                               ; preds = %2
  %16 = tail call ptr @__errno_location() #12
  %17 = load i32, ptr %16, align 4, !tbaa !9
  %18 = call ptr @strerror(i32 noundef %17) #11
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__.main, ptr noundef %18)
  br label %200

20:                                               ; preds = %2
  %21 = call ptr @signal(i32 noundef 14, ptr noundef nonnull @_ZL12signal_catchi) #11
  %22 = icmp eq ptr %21, inttoptr (i64 -1 to ptr)
  br i1 %22, label %23, label %28

23:                                               ; preds = %20
  %24 = tail call ptr @__errno_location() #12
  %25 = load i32, ptr %24, align 4, !tbaa !9
  %26 = call ptr @strerror(i32 noundef %25) #11
  %27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__.main, ptr noundef %26)
  br label %200

28:                                               ; preds = %20
  %29 = call ptr @signal(i32 noundef 2, ptr noundef nonnull @_ZL12signal_catchi) #11
  %30 = icmp eq ptr %29, inttoptr (i64 -1 to ptr)
  br i1 %30, label %31, label %36

31:                                               ; preds = %28
  %32 = tail call ptr @__errno_location() #12
  %33 = load i32, ptr %32, align 4, !tbaa !9
  %34 = call ptr @strerror(i32 noundef %33) #11
  %35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__.main, ptr noundef %34)
  br label %200

36:                                               ; preds = %28
  %37 = load ptr, ptr %11, align 8, !tbaa !5
  %38 = call noundef i32 @_Z10openSocketPc(ptr noundef %37)
  store i32 %38, ptr %3, align 4, !tbaa !9
  %39 = icmp eq i32 %38, -1
  br i1 %39, label %40, label %43

40:                                               ; preds = %36
  %41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__.main)
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  br label %200

43:                                               ; preds = %36
  %44 = call noundef i32 @_Z7DB_initv()
  %45 = icmp eq i32 %44, -1
  br i1 %45, label %46, label %49

46:                                               ; preds = %43
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__.main)
  %48 = load i32, ptr %3, align 4, !tbaa !9
  call void @_Z11closeSocketi(i32 noundef %48)
  br label %200

49:                                               ; preds = %43
  %50 = call noundef i32 @_Z11DB_comm_iniP12RTDBconf_var(ptr noundef nonnull %6)
  %51 = icmp slt i32 %50, 1
  br i1 %51, label %58, label %.preheader.preheader

.preheader.preheader:                             ; preds = %49
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) @lostPackets, i8 0, i64 40, i1 false), !tbaa !9
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 28), align 4, !tbaa !13
  store i8 0, ptr @agent, align 16, !tbaa !17
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 44), align 4, !tbaa !18
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 76), align 4, !tbaa !13
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 48), align 16, !tbaa !17
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 92), align 4, !tbaa !18
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 124), align 4, !tbaa !13
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 96), align 16, !tbaa !17
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 140), align 4, !tbaa !18
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 172), align 4, !tbaa !13
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 144), align 16, !tbaa !17
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 188), align 4, !tbaa !18
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 220), align 4, !tbaa !13
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 192), align 16, !tbaa !17
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 236), align 4, !tbaa !18
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 268), align 4, !tbaa !13
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 240), align 16, !tbaa !17
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 284), align 4, !tbaa !18
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 316), align 4, !tbaa !13
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 288), align 16, !tbaa !17
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 332), align 4, !tbaa !18
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 364), align 4, !tbaa !13
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 336), align 16, !tbaa !17
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 380), align 4, !tbaa !18
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 412), align 4, !tbaa !13
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 384), align 16, !tbaa !17
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 428), align 4, !tbaa !18
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 460), align 4, !tbaa !13
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 432), align 16, !tbaa !17
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 476), align 4, !tbaa !18
  %52 = call noundef i32 @_Z6Whoamiv()
  store i32 %52, ptr @myNumber, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %53
  store i8 1, ptr %54, align 16, !tbaa !17
  %55 = call i32 @pthread_attr_init(ptr noundef nonnull %8) #11
  %56 = call i32 @pthread_attr_setinheritsched(ptr noundef nonnull %8, i32 noundef 0) #11
  %57 = call i32 @pthread_create(ptr noundef nonnull %4, ptr noundef nonnull %8, ptr noundef nonnull @_Z17receiveDataThreadPv, ptr noundef nonnull %3) #11
  %.not = icmp eq i32 %57, 0
  br i1 %.not, label %67, label %61

58:                                               ; preds = %49
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__.main)
  call void @_Z7DB_freev()
  %60 = load i32, ptr %3, align 4, !tbaa !9
  call void @_Z11closeSocketi(i32 noundef %60)
  br label %200

61:                                               ; preds = %.preheader.preheader
  %62 = tail call ptr @__errno_location() #12
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = call ptr @strerror(i32 noundef %63) #11
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__.main, ptr noundef %64)
  call void @_Z7DB_freev()
  %66 = load i32, ptr %3, align 4, !tbaa !9
  call void @_Z11closeSocketi(i32 noundef %66)
  br label %200

67:                                               ; preds = %.preheader.preheader
  %68 = getelementptr inbounds i8, ptr %9, i64 16
  %69 = getelementptr inbounds i8, ptr %9, i64 24
  store i64 100000, ptr %69, align 8, !tbaa !19
  store i64 0, ptr %68, align 8, !tbaa !21
  %70 = getelementptr inbounds i8, ptr %9, i64 8
  store i64 100000, ptr %70, align 8, !tbaa !22
  store i64 0, ptr %9, align 8, !tbaa !23
  %71 = call i32 @setitimer(i32 noundef 0, ptr noundef nonnull %9, ptr noundef null) #11
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  %73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %74 = load i32, ptr @end, align 4, !tbaa !9
  %.not626674 = icmp eq i32 %74, 0
  br i1 %.not626674, label %.lr.ph.lr.ph, label %.loopexit64

.lr.ph.lr.ph:                                     ; preds = %67
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 1
  %.sroa.485.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 4
  %.sroa.686.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 20
  %wide.trip.count = zext nneg i32 %50 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.lr.ph, %.loopexit
  %.056.ph75 = phi i32 [ 0, %.lr.ph.lr.ph ], [ %161, %.loopexit ]
  br label %75

75:                                               ; preds = %.lr.ph, %.backedge
  %76 = call i32 @pause()
  %77 = load i32, ptr @timer, align 4
  %78 = icmp eq i32 %77, 0
  br i1 %78, label %.backedge, label %79

79:                                               ; preds = %75
  %80 = load i32, ptr @delay, align 4, !tbaa !9
  %81 = icmp sgt i32 %80, 1000
  br i1 %81, label %82, label %94

82:                                               ; preds = %79
  %83 = load i32, ptr @myNumber, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %84, i32 1
  %86 = load i8, ptr %85, align 1, !tbaa !24
  %87 = icmp eq i8 %86, 0
  %88 = icmp eq i32 %77, 1
  %or.cond = and i1 %88, %87
  br i1 %or.cond, label %89, label %94

89:                                               ; preds = %82
  %90 = add nsw i32 %80, -500
  %91 = zext nneg i32 %90 to i64
  store i64 %91, ptr %69, align 8, !tbaa !19
  store i64 0, ptr %68, align 8, !tbaa !21
  store i64 100000, ptr %70, align 8, !tbaa !22
  store i64 0, ptr %9, align 8, !tbaa !23
  %92 = call i32 @setitimer(i32 noundef 0, ptr noundef nonnull %9, ptr noundef null) #11
  store i32 0, ptr @delay, align 4, !tbaa !9
  br label %.backedge

.backedge:                                        ; preds = %89, %75
  %93 = load i32, ptr @end, align 4, !tbaa !9
  %.not62 = icmp eq i32 %93, 0
  br i1 %.not62, label %75, label %.loopexit64, !llvm.loop !25

94:                                               ; preds = %82, %79
  store i32 0, ptr @timer, align 4, !tbaa !9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(5000) %5, i8 0, i64 5000, i1 false)
  call void @_Z17update_stateTablev()
  %95 = load i32, ptr @myNumber, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = load i8, ptr @agent, align 16, !tbaa !17
  switch i8 %97, label %99 [
    i8 1, label %98
    i8 3, label %98
  ]

98:                                               ; preds = %94, %94
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 1), align 1, !tbaa !24
  br label %99

99:                                               ; preds = %94, %98
  %.1 = phi i32 [ 1, %98 ], [ 0, %94 ]
  %100 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %96, i32 6, i64 0
  store i8 %97, ptr %100, align 16, !tbaa !27
  %101 = load i8, ptr getelementptr inbounds (i8, ptr @agent, i64 48), align 16, !tbaa !17
  switch i8 %101, label %105 [
    i8 1, label %102
    i8 3, label %102
  ]

102:                                              ; preds = %99, %99
  %103 = trunc nuw nsw i32 %.1 to i8
  store i8 %103, ptr getelementptr inbounds (i8, ptr @agent, i64 49), align 1, !tbaa !24
  %104 = add nuw nsw i32 %.1, 1
  br label %105

105:                                              ; preds = %102, %99
  %.1.1 = phi i32 [ %104, %102 ], [ %.1, %99 ]
  %106 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %96, i32 6, i64 1
  store i8 %101, ptr %106, align 1, !tbaa !27
  %107 = load i8, ptr getelementptr inbounds (i8, ptr @agent, i64 96), align 16, !tbaa !17
  switch i8 %107, label %111 [
    i8 1, label %108
    i8 3, label %108
  ]

108:                                              ; preds = %105, %105
  %109 = trunc nuw nsw i32 %.1.1 to i8
  store i8 %109, ptr getelementptr inbounds (i8, ptr @agent, i64 97), align 1, !tbaa !24
  %110 = add nuw nsw i32 %.1.1, 1
  br label %111

111:                                              ; preds = %108, %105
  %.1.2 = phi i32 [ %110, %108 ], [ %.1.1, %105 ]
  %112 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %96, i32 6, i64 2
  store i8 %107, ptr %112, align 2, !tbaa !27
  %113 = load i8, ptr getelementptr inbounds (i8, ptr @agent, i64 144), align 16, !tbaa !17
  switch i8 %113, label %117 [
    i8 1, label %114
    i8 3, label %114
  ]

114:                                              ; preds = %111, %111
  %115 = trunc nuw nsw i32 %.1.2 to i8
  store i8 %115, ptr getelementptr inbounds (i8, ptr @agent, i64 145), align 1, !tbaa !24
  %116 = add nuw nsw i32 %.1.2, 1
  br label %117

117:                                              ; preds = %114, %111
  %.1.3 = phi i32 [ %116, %114 ], [ %.1.2, %111 ]
  %118 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %96, i32 6, i64 3
  store i8 %113, ptr %118, align 1, !tbaa !27
  %119 = load i8, ptr getelementptr inbounds (i8, ptr @agent, i64 192), align 16, !tbaa !17
  switch i8 %119, label %123 [
    i8 1, label %120
    i8 3, label %120
  ]

120:                                              ; preds = %117, %117
  %121 = trunc nuw nsw i32 %.1.3 to i8
  store i8 %121, ptr getelementptr inbounds (i8, ptr @agent, i64 193), align 1, !tbaa !24
  %122 = add nuw nsw i32 %.1.3, 1
  br label %123

123:                                              ; preds = %120, %117
  %.1.4 = phi i32 [ %122, %120 ], [ %.1.3, %117 ]
  %124 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %96, i32 6, i64 4
  store i8 %119, ptr %124, align 4, !tbaa !27
  %125 = load i8, ptr getelementptr inbounds (i8, ptr @agent, i64 240), align 16, !tbaa !17
  switch i8 %125, label %129 [
    i8 1, label %126
    i8 3, label %126
  ]

126:                                              ; preds = %123, %123
  %127 = trunc nuw nsw i32 %.1.4 to i8
  store i8 %127, ptr getelementptr inbounds (i8, ptr @agent, i64 241), align 1, !tbaa !24
  %128 = add nuw nsw i32 %.1.4, 1
  br label %129

129:                                              ; preds = %126, %123
  %.1.5 = phi i32 [ %128, %126 ], [ %.1.4, %123 ]
  %130 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %96, i32 6, i64 5
  store i8 %125, ptr %130, align 1, !tbaa !27
  %131 = load i8, ptr getelementptr inbounds (i8, ptr @agent, i64 288), align 16, !tbaa !17
  switch i8 %131, label %135 [
    i8 1, label %132
    i8 3, label %132
  ]

132:                                              ; preds = %129, %129
  %133 = trunc nuw nsw i32 %.1.5 to i8
  store i8 %133, ptr getelementptr inbounds (i8, ptr @agent, i64 289), align 1, !tbaa !24
  %134 = add nuw nsw i32 %.1.5, 1
  br label %135

135:                                              ; preds = %132, %129
  %.1.6 = phi i32 [ %134, %132 ], [ %.1.5, %129 ]
  %136 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %96, i32 6, i64 6
  store i8 %131, ptr %136, align 2, !tbaa !27
  %137 = load i8, ptr getelementptr inbounds (i8, ptr @agent, i64 336), align 16, !tbaa !17
  switch i8 %137, label %141 [
    i8 1, label %138
    i8 3, label %138
  ]

138:                                              ; preds = %135, %135
  %139 = trunc nuw nsw i32 %.1.6 to i8
  store i8 %139, ptr getelementptr inbounds (i8, ptr @agent, i64 337), align 1, !tbaa !24
  %140 = add nuw nsw i32 %.1.6, 1
  br label %141

141:                                              ; preds = %138, %135
  %.1.7 = phi i32 [ %140, %138 ], [ %.1.6, %135 ]
  %142 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %96, i32 6, i64 7
  store i8 %137, ptr %142, align 1, !tbaa !27
  %143 = load i8, ptr getelementptr inbounds (i8, ptr @agent, i64 384), align 16, !tbaa !17
  switch i8 %143, label %147 [
    i8 1, label %144
    i8 3, label %144
  ]

144:                                              ; preds = %141, %141
  %145 = trunc nuw nsw i32 %.1.7 to i8
  store i8 %145, ptr getelementptr inbounds (i8, ptr @agent, i64 385), align 1, !tbaa !24
  %146 = add nuw nsw i32 %.1.7, 1
  br label %147

147:                                              ; preds = %144, %141
  %.1.8 = phi i32 [ %146, %144 ], [ %.1.7, %141 ]
  %148 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %96, i32 6, i64 8
  store i8 %143, ptr %148, align 8, !tbaa !27
  %149 = load i8, ptr getelementptr inbounds (i8, ptr @agent, i64 432), align 16, !tbaa !17
  switch i8 %149, label %.lr.ph72.preheader [
    i8 1, label %150
    i8 3, label %150
  ]

150:                                              ; preds = %147, %147
  %151 = trunc nuw nsw i32 %.1.8 to i8
  store i8 %151, ptr getelementptr inbounds (i8, ptr @agent, i64 433), align 1, !tbaa !24
  %152 = add nuw nsw i32 %.1.8, 1
  br label %.lr.ph72.preheader

.lr.ph72.preheader:                               ; preds = %147, %150
  %.1.9 = phi i32 [ %152, %150 ], [ %.1.8, %147 ]
  %153 = getelementptr inbounds [10 x %struct._agent], ptr @agent, i64 0, i64 %96, i32 6, i64 9
  store i8 %149, ptr %153, align 1, !tbaa !27
  store i32 %.1.9, ptr @RUNNING_AGENTS, align 4, !tbaa !9
  %154 = uitofp nneg i32 %.1.9 to double
  %155 = fdiv double 1.000000e+05, %154
  %156 = fmul double %155, 2.000000e+00
  %157 = fdiv double %156, 3.000000e+00
  %158 = fptosi double %157 to i32
  store i32 %158, ptr @MAX_DELTA, align 4, !tbaa !9
  %159 = trunc i32 %95 to i8
  %160 = mul nsw i64 %96, 48
  %scevgep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @agent, i64 32), i64 %160
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(10) %.sroa.5.0..sroa_idx, ptr noundef nonnull align 16 dereferenceable(10) %scevgep, i64 10, i1 false)
  %161 = add i32 %.056.ph75, 1
  store i8 %159, ptr %5, align 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %.sroa.4.0..sroa_idx, ptr noundef nonnull align 1 dereferenceable(3) %.sroa.4, i64 3, i1 false)
  store i32 %.056.ph75, ptr %.sroa.485.0..sroa_idx, align 4
  store i32 %50, ptr %.sroa.686.0..sroa_idx, align 4
  br label %.lr.ph72

.lr.ph72:                                         ; preds = %.lr.ph72.preheader, %.lr.ph72
  %indvars.iv = phi i64 [ 0, %.lr.ph72.preheader ], [ %indvars.iv.next, %.lr.ph72 ]
  %.05770 = phi i32 [ 24, %.lr.ph72.preheader ], [ %179, %.lr.ph72 ]
  %162 = sext i32 %.05770 to i64
  %163 = getelementptr inbounds i8, ptr %5, i64 %162
  %164 = getelementptr inbounds [100 x %struct.RTDBconf_var], ptr %6, i64 0, i64 %indvars.iv
  %165 = load i32, ptr %164, align 4
  store i32 %165, ptr %163, align 1
  %166 = add i32 %.05770, 4
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds i8, ptr %5, i64 %167
  %169 = getelementptr inbounds i8, ptr %164, i64 4
  %170 = load i32, ptr %169, align 4
  store i32 %170, ptr %168, align 1
  %171 = add i32 %.05770, 8
  %172 = load i32, ptr @myNumber, align 4, !tbaa !9
  %173 = sext i32 %171 to i64
  %174 = getelementptr inbounds i8, ptr %5, i64 %173
  %175 = getelementptr inbounds i8, ptr %174, i64 4
  %176 = call noundef i32 @_Z6DB_getiiPv(i32 noundef %172, i32 noundef %165, ptr noundef nonnull %175)
  store i32 %176, ptr %174, align 1
  %177 = add i32 %.05770, 12
  %178 = load i32, ptr %169, align 4, !tbaa !28
  %179 = add i32 %177, %178
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph72, !llvm.loop !30

._crit_edge:                                      ; preds = %.lr.ph72
  %180 = icmp sgt i32 %179, 5000
  br i1 %180, label %181, label %184

181:                                              ; preds = %._crit_edge
  %182 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__.main)
  %183 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__.main)
  br label %.loopexit64

184:                                              ; preds = %._crit_edge
  %185 = load i32, ptr %3, align 4, !tbaa !9
  %186 = call noundef i32 @_Z8sendDataiPvi(i32 noundef %185, ptr noundef nonnull %5, i32 noundef %179)
  %.not63 = icmp eq i32 %186, %179
  br i1 %.not63, label %.loopexit, label %187

187:                                              ; preds = %184
  %188 = tail call ptr @__errno_location() #12
  %189 = load i32, ptr %188, align 4, !tbaa !9
  %190 = call ptr @strerror(i32 noundef %189) #11
  %191 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__.main, ptr noundef %190)
  br label %.loopexit

.loopexit:                                        ; preds = %187, %184
  %192 = call i32 @gettimeofday(ptr noundef nonnull %10, ptr noundef null) #11
  %193 = load <2 x i64>, ptr %10, align 16, !tbaa !31
  store <2 x i64> %193, ptr @lastSendTimeStamp, align 8, !tbaa !31
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 24), align 8, !tbaa !32
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 2), align 2, !tbaa !33
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 72), align 8, !tbaa !32
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 50), align 2, !tbaa !33
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 120), align 8, !tbaa !32
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 98), align 2, !tbaa !33
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 168), align 8, !tbaa !32
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 146), align 2, !tbaa !33
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 216), align 8, !tbaa !32
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 194), align 2, !tbaa !33
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 264), align 8, !tbaa !32
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 242), align 2, !tbaa !33
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 312), align 8, !tbaa !32
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 290), align 2, !tbaa !33
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 360), align 8, !tbaa !32
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 338), align 2, !tbaa !33
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 408), align 8, !tbaa !32
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 386), align 2, !tbaa !33
  store i32 0, ptr getelementptr inbounds (i8, ptr @agent, i64 456), align 8, !tbaa !32
  store i8 0, ptr getelementptr inbounds (i8, ptr @agent, i64 434), align 2, !tbaa !33
  %194 = load i32, ptr @end, align 4, !tbaa !9
  %.not6266 = icmp eq i32 %194, 0
  br i1 %.not6266, label %.lr.ph, label %.loopexit64

.loopexit64:                                      ; preds = %.loopexit, %.backedge, %67, %181
  %195 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17)
  %196 = load i32, ptr %3, align 4, !tbaa !9
  call void @_Z11closeSocketi(i32 noundef %196)
  %197 = load i64, ptr %4, align 8, !tbaa !31
  %198 = call i32 @pthread_join(i64 noundef %197, ptr noundef null)
  call void @_Z7DB_freev()
  %199 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18)
  br label %200

200:                                              ; preds = %.loopexit64, %61, %58, %46, %40, %31, %23, %15
  %.0 = phi i32 [ -1, %15 ], [ -1, %23 ], [ -1, %31 ], [ -1, %40 ], [ -1, %46 ], [ -1, %58 ], [ -1, %61 ], [ 0, %.loopexit64 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #11
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %.sroa.4)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #11
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %8) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #11
  call void @llvm.lifetime.end.p0(i64 1200, ptr nonnull %6) #11
  call void @llvm.lifetime.end.p0(i64 5000, ptr nonnull %5) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #11
  ret i32 %.0
}

; Function Attrs: nounwind
declare i32 @sched_setscheduler(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #8

; Function Attrs: nounwind
declare i32 @getpid() local_unnamed_addr #8

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

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

; Function Attrs: nounwind
declare ptr @signal(i32 noundef, ptr noundef) local_unnamed_addr #8

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

declare noundef i32 @_Z10openSocketPc(ptr noundef) local_unnamed_addr #10

declare noundef i32 @_Z7DB_initv() local_unnamed_addr #10

declare void @_Z11closeSocketi(i32 noundef) local_unnamed_addr #10

declare noundef i32 @_Z11DB_comm_iniP12RTDBconf_var(ptr noundef) local_unnamed_addr #10

declare void @_Z7DB_freev() local_unnamed_addr #10

declare noundef i32 @_Z6Whoamiv() local_unnamed_addr #10

; Function Attrs: nounwind
declare i32 @pthread_attr_init(ptr noundef) local_unnamed_addr #8

; Function Attrs: nounwind
declare i32 @pthread_attr_setinheritsched(ptr noundef, i32 noundef) local_unnamed_addr #8

; Function Attrs: nounwind
declare i32 @pthread_create(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #8

declare i32 @pause() local_unnamed_addr #10

declare noundef i32 @_Z6DB_getiiPv(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #10

declare noundef i32 @_Z8sendDataiPvi(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #10

declare i32 @pthread_join(i64 noundef, ptr noundef) local_unnamed_addr #10

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn "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 = { mustprogress 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 = { mustprogress 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: write) }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { mustprogress norecurse 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 #8 = { 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 #9 = { 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 #10 = { "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 #11 = { nounwind }
attributes #12 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS11sched_param", !10, i64 0}
!13 = !{!14, !10, i64 28}
!14 = !{!"_ZTS6_agent", !7, i64 0, !7, i64 1, !7, i64 2, !15, i64 8, !10, i64 24, !10, i64 28, !7, i64 32, !10, i64 44}
!15 = !{!"_ZTS7timeval", !16, i64 0, !16, i64 8}
!16 = !{!"long", !7, i64 0}
!17 = !{!14, !7, i64 0}
!18 = !{!14, !10, i64 44}
!19 = !{!20, !16, i64 24}
!20 = !{!"_ZTS9itimerval", !15, i64 0, !15, i64 16}
!21 = !{!20, !16, i64 16}
!22 = !{!20, !16, i64 8}
!23 = !{!20, !16, i64 0}
!24 = !{!14, !7, i64 1}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!7, !7, i64 0}
!28 = !{!29, !10, i64 4}
!29 = !{!"_ZTS12RTDBconf_var", !10, i64 0, !10, i64 4, !10, i64 8}
!30 = distinct !{!30, !26}
!31 = !{!16, !16, i64 0}
!32 = !{!14, !10, i64 24}
!33 = !{!14, !7, i64 2}


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