; LLVM IR from septag/dmon :: test-incremental (dmon_watch_add)

; 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.dmon__state = type { [64 x ptr], [64 x i32], ptr, i32, i64, %union.pthread_mutex_t, i8 }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.dmon_watch_id = type { i32 }
%struct.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }
%struct.dmon__watch_subdir = type { [260 x i8] }
%struct.dmon__watch_state = type { %struct.dmon_watch_id, i32, i32, ptr, ptr, [260 x i8], ptr, ptr }

@_dmon = external hidden global %struct.dmon__state, align 8
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [58 x i8], align 1
@__PRETTY_FUNCTION__.dmon_watch_add = external hidden unnamed_addr constant [50 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [60 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

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

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

; Function Attrs: nounwind
declare i32 @pthread_mutex_lock(ptr noundef) #2

declare i32 @puts(ptr noundef) #3

; Function Attrs: nounwind
declare i32 @pthread_mutex_unlock(ptr noundef) #2

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

; Function Attrs: nounwind
declare i32 @stat(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #2

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #6

; Function Attrs: nounwind
declare i32 @inotify_add_watch(i32 noundef, ptr noundef, i32 noundef) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @dmon_watch_add(i32 %0, ptr noundef %1) #5 {
  %3 = alloca i1, align 1
  %4 = alloca %struct.dmon_watch_id, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.stat, align 8
  %12 = alloca %struct.dmon__watch_subdir, align 1
  %13 = alloca [260 x i8], align 16
  %14 = alloca [512 x i8], align 16
  %15 = alloca i32, align 4
  %16 = alloca [512 x i8], align 16
  %17 = alloca i32, align 4
  %18 = alloca [260 x i8], align 16
  %19 = alloca i32, align 4
  %20 = alloca [512 x i8], align 16
  %21 = getelementptr inbounds %struct.dmon_watch_id, ptr %4, i32 0, i32 0
  store i32 %0, ptr %21, align 4
  store ptr %1, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.dmon_watch_id, ptr %4, i32 0, i32 0
  %23 = load i32, ptr %22, align 4, !tbaa !9
  %24 = icmp ugt i32 %23, 0
  br i1 %24, label %25, label %30

25:                                               ; preds = %2
  %26 = getelementptr inbounds %struct.dmon_watch_id, ptr %4, i32 0, i32 0
  %27 = load i32, ptr %26, align 4, !tbaa !9
  %28 = icmp ule i32 %27, 64
  br i1 %28, label %29, label %30

29:                                               ; preds = %25
  br label %31

30:                                               ; preds = %25, %2
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str.23, i32 noundef 41, ptr noundef @__PRETTY_FUNCTION__.dmon_watch_add) #8
  unreachable

31:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #9
  %32 = call i64 @pthread_self() #10
  %33 = load i64, ptr getelementptr inbounds (%struct.dmon__state, ptr @_dmon, i32 0, i32 4), align 8, !tbaa !12
  %34 = icmp eq i64 %32, %33
  %35 = zext i1 %34 to i8
  store i8 %35, ptr %6, align 1, !tbaa !16
  %36 = load i8, ptr %6, align 1, !tbaa !16, !range !17, !noundef !18
  %37 = trunc i8 %36 to i1
  br i1 %37, label %40, label %38

38:                                               ; preds = %31
  %39 = call i32 @pthread_mutex_lock(ptr noundef getelementptr inbounds (%struct.dmon__state, ptr @_dmon, i32 0, i32 5)) #9
  br label %40

40:                                               ; preds = %38, %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  %41 = getelementptr inbounds %struct.dmon_watch_id, ptr %4, i32 0, i32 0
  %42 = load i32, ptr %41, align 4, !tbaa !9
  %43 = sub i32 %42, 1
  %44 = zext i32 %43 to i64
  %45 = getelementptr inbounds [64 x ptr], ptr @_dmon, i64 0, i64 %44
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  store ptr %46, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, 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 144, ptr %11) #9
  call void @llvm.lifetime.start.p0(i64 260, ptr %12) #9
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = call i32 @stat(ptr noundef %47, ptr noundef %11) #9
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %50, label %80

50:                                               ; preds = %40
  %51 = getelementptr inbounds %struct.stat, ptr %11, i32 0, i32 3
  %52 = load i32, ptr %51, align 8, !tbaa !19
  %53 = and i32 %52, 16384
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %80

55:                                               ; preds = %50
  %56 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %12, i32 0, i32 0
  %57 = getelementptr inbounds [260 x i8], ptr %56, i64 0, i64 0
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = call ptr @_dmon_strcpy(ptr noundef %57, i32 noundef 260, ptr noundef %58)
  %60 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %12, i32 0, i32 0
  %61 = getelementptr inbounds [260 x i8], ptr %60, i64 0, i64 0
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.dmon__watch_state, ptr %62, i32 0, i32 5
  %64 = getelementptr inbounds [260 x i8], ptr %63, i64 0, i64 0
  %65 = call ptr @strstr(ptr noundef %61, ptr noundef %64) #11
  %66 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %12, i32 0, i32 0
  %67 = getelementptr inbounds [260 x i8], ptr %66, i64 0, i64 0
  %68 = icmp eq ptr %65, %67
  br i1 %68, label %69, label %79

69:                                               ; preds = %55
  %70 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %12, i32 0, i32 0
  %71 = getelementptr inbounds [260 x i8], ptr %70, i64 0, i64 0
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.dmon__watch_state, ptr %73, i32 0, i32 5
  %75 = getelementptr inbounds [260 x i8], ptr %74, i64 0, i64 0
  %76 = call i64 @strlen(ptr noundef %75) #11
  %77 = getelementptr inbounds i8, ptr %72, i64 %76
  %78 = call ptr @_dmon_strcpy(ptr noundef %71, i32 noundef 260, ptr noundef %77)
  br label %79

79:                                               ; preds = %69, %55
  br label %122

80:                                               ; preds = %50, %40
  call void @llvm.lifetime.start.p0(i64 260, ptr %13) #9
  %81 = getelementptr inbounds [260 x i8], ptr %13, i64 0, i64 0
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.dmon__watch_state, ptr %82, i32 0, i32 5
  %84 = getelementptr inbounds [260 x i8], ptr %83, i64 0, i64 0
  %85 = call ptr @_dmon_strcpy(ptr noundef %81, i32 noundef 260, ptr noundef %84)
  %86 = getelementptr inbounds [260 x i8], ptr %13, i64 0, i64 0
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = call ptr @_dmon_strcat(ptr noundef %86, i32 noundef 260, ptr noundef %87)
  %89 = getelementptr inbounds [260 x i8], ptr %13, i64 0, i64 0
  %90 = call i32 @stat(ptr noundef %89, ptr noundef %11) #9
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %97, label %92

92:                                               ; preds = %80
  %93 = getelementptr inbounds %struct.stat, ptr %11, i32 0, i32 3
  %94 = load i32, ptr %93, align 8, !tbaa !19
  %95 = and i32 %94, 16384
  %96 = icmp eq i32 %95, 0
  br i1 %96, label %97, label %114

97:                                               ; preds = %92, %80
  br label %98

98:                                               ; preds = %97
  call void @llvm.lifetime.start.p0(i64 512, ptr %14) #9
  %99 = getelementptr inbounds [512 x i8], ptr %14, i64 0, i64 0
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %99, i64 noundef 512, ptr noundef @.str.24, ptr noundef %100) #9
  br label %102

102:                                              ; preds = %98
  %103 = getelementptr inbounds [512 x i8], ptr %14, i64 0, i64 0
  %104 = call i32 @puts(ptr noundef %103)
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.23, i32 noundef 67, ptr noundef @__PRETTY_FUNCTION__.dmon_watch_add) #8
  unreachable

105:                                              ; No predecessors!
  br label %106

106:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 512, ptr %14) #9
  br label %107

107:                                              ; preds = %106
  br label %108

108:                                              ; preds = %107
  %109 = load i8, ptr %6, align 1, !tbaa !16, !range !17, !noundef !18
  %110 = trunc i8 %109 to i1
  br i1 %110, label %113, label %111

111:                                              ; preds = %108
  %112 = call i32 @pthread_mutex_unlock(ptr noundef getelementptr inbounds (%struct.dmon__state, ptr @_dmon, i32 0, i32 5)) #9
  br label %113

113:                                              ; preds = %111, %108
  store i1 false, ptr %3, align 1
  store i32 1, ptr %15, align 4
  br label %119

114:                                              ; preds = %92
  %115 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %12, i32 0, i32 0
  %116 = getelementptr inbounds [260 x i8], ptr %115, i64 0, i64 0
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = call ptr @_dmon_strcpy(ptr noundef %116, i32 noundef 260, ptr noundef %117)
  store i32 0, ptr %15, align 4
  br label %119

119:                                              ; preds = %114, %113
  call void @llvm.lifetime.end.p0(i64 260, ptr %13) #9
  %120 = load i32, ptr %15, align 4
  switch i32 %120, label %324 [
    i32 0, label %121
  ]

121:                                              ; preds = %119
  br label %122

122:                                              ; preds = %121, %79
  %123 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %12, i32 0, i32 0
  %124 = getelementptr inbounds [260 x i8], ptr %123, i64 0, i64 0
  %125 = call i64 @strlen(ptr noundef %124) #11
  %126 = trunc i64 %125 to i32
  store i32 %126, ptr %8, align 4, !tbaa !22
  %127 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %12, i32 0, i32 0
  %128 = load i32, ptr %8, align 4, !tbaa !22
  %129 = sub nsw i32 %128, 1
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [260 x i8], ptr %127, i64 0, i64 %130
  %132 = load i8, ptr %131, align 1, !tbaa !23
  %133 = sext i8 %132 to i32
  %134 = icmp ne i32 %133, 47
  br i1 %134, label %135, label %145

135:                                              ; preds = %122
  %136 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %12, i32 0, i32 0
  %137 = load i32, ptr %8, align 4, !tbaa !22
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [260 x i8], ptr %136, i64 0, i64 %138
  store i8 47, ptr %139, align 1, !tbaa !23
  %140 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %12, i32 0, i32 0
  %141 = load i32, ptr %8, align 4, !tbaa !22
  %142 = add nsw i32 %141, 1
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [260 x i8], ptr %140, i64 0, i64 %143
  store i8 0, ptr %144, align 1, !tbaa !23
  br label %145

145:                                              ; preds = %135, %122
  store i32 0, ptr %9, align 4, !tbaa !22
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.dmon__watch_state, ptr %146, i32 0, i32 6
  %148 = load ptr, ptr %147, align 8, !tbaa !24
  %149 = icmp ne ptr %148, null
  br i1 %149, label %150, label %157

150:                                              ; preds = %145
  %151 = load ptr, ptr %7, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.dmon__watch_state, ptr %151, i32 0, i32 6
  %153 = load ptr, ptr %152, align 8, !tbaa !24
  %154 = getelementptr inbounds i32, ptr %153, i64 -2
  %155 = getelementptr inbounds i32, ptr %154, i64 1
  %156 = load i32, ptr %155, align 4, !tbaa !22
  br label %158

157:                                              ; preds = %145
  br label %158

158:                                              ; preds = %157, %150
  %159 = phi i32 [ %156, %150 ], [ 0, %157 ]
  store i32 %159, ptr %10, align 4, !tbaa !22
  br label %160

160:                                              ; preds = %195, %158
  %161 = load i32, ptr %9, align 4, !tbaa !22
  %162 = load i32, ptr %10, align 4, !tbaa !22
  %163 = icmp slt i32 %161, %162
  br i1 %163, label %164, label %198

164:                                              ; preds = %160
  %165 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %12, i32 0, i32 0
  %166 = getelementptr inbounds [260 x i8], ptr %165, i64 0, i64 0
  %167 = load ptr, ptr %7, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.dmon__watch_state, ptr %167, i32 0, i32 6
  %169 = load ptr, ptr %168, align 8, !tbaa !24
  %170 = load i32, ptr %9, align 4, !tbaa !22
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %169, i64 %171
  %173 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %172, i32 0, i32 0
  %174 = getelementptr inbounds [260 x i8], ptr %173, i64 0, i64 0
  %175 = call i32 @strcmp(ptr noundef %166, ptr noundef %174) #11
  %176 = icmp eq i32 %175, 0
  br i1 %176, label %177, label %194

177:                                              ; preds = %164
  br label %178

178:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 512, ptr %16) #9
  %179 = getelementptr inbounds [512 x i8], ptr %16, i64 0, i64 0
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %179, i64 noundef 512, ptr noundef @.str.25, ptr noundef %180) #9
  br label %182

182:                                              ; preds = %178
  %183 = getelementptr inbounds [512 x i8], ptr %16, i64 0, i64 0
  %184 = call i32 @puts(ptr noundef %183)
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.23, i32 noundef 84, ptr noundef @__PRETTY_FUNCTION__.dmon_watch_add) #8
  unreachable

185:                                              ; No predecessors!
  br label %186

186:                                              ; preds = %185
  call void @llvm.lifetime.end.p0(i64 512, ptr %16) #9
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187
  %189 = load i8, ptr %6, align 1, !tbaa !16, !range !17, !noundef !18
  %190 = trunc i8 %189 to i1
  br i1 %190, label %193, label %191

191:                                              ; preds = %188
  %192 = call i32 @pthread_mutex_unlock(ptr noundef getelementptr inbounds (%struct.dmon__state, ptr @_dmon, i32 0, i32 5)) #9
  br label %193

193:                                              ; preds = %191, %188
  store i1 false, ptr %3, align 1
  store i32 1, ptr %15, align 4
  br label %324

194:                                              ; preds = %164
  br label %195

195:                                              ; preds = %194
  %196 = load i32, ptr %9, align 4, !tbaa !22
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %9, align 4, !tbaa !22
  br label %160, !llvm.loop !26

198:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  store i32 962, ptr %17, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 260, ptr %18) #9
  %199 = getelementptr inbounds [260 x i8], ptr %18, i64 0, i64 0
  %200 = load ptr, ptr %7, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.dmon__watch_state, ptr %200, i32 0, i32 5
  %202 = getelementptr inbounds [260 x i8], ptr %201, i64 0, i64 0
  %203 = call ptr @_dmon_strcpy(ptr noundef %199, i32 noundef 260, ptr noundef %202)
  %204 = getelementptr inbounds [260 x i8], ptr %18, i64 0, i64 0
  %205 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %12, i32 0, i32 0
  %206 = getelementptr inbounds [260 x i8], ptr %205, i64 0, i64 0
  %207 = call ptr @_dmon_strcat(ptr noundef %204, i32 noundef 260, ptr noundef %206)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  %208 = load ptr, ptr %7, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.dmon__watch_state, ptr %208, i32 0, i32 1
  %210 = load i32, ptr %209, align 4, !tbaa !28
  %211 = getelementptr inbounds [260 x i8], ptr %18, i64 0, i64 0
  %212 = call i32 @inotify_add_watch(i32 noundef %210, ptr noundef %211, i32 noundef 962) #9
  store i32 %212, ptr %19, align 4, !tbaa !22
  %213 = load i32, ptr %19, align 4, !tbaa !22
  %214 = icmp eq i32 %213, -1
  br i1 %214, label %215, label %234

215:                                              ; preds = %198
  br label %216

216:                                              ; preds = %215
  call void @llvm.lifetime.start.p0(i64 512, ptr %20) #9
  %217 = getelementptr inbounds [512 x i8], ptr %20, i64 0, i64 0
  %218 = load ptr, ptr %5, align 8, !tbaa !5
  %219 = call ptr @__errno_location() #10
  %220 = load i32, ptr %219, align 4, !tbaa !22
  %221 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %217, i64 noundef 512, ptr noundef @.str.16, ptr noundef %218, i32 noundef %220) #9
  br label %222

222:                                              ; preds = %216
  %223 = getelementptr inbounds [512 x i8], ptr %20, i64 0, i64 0
  %224 = call i32 @puts(ptr noundef %223)
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.23, i32 noundef 97, ptr noundef @__PRETTY_FUNCTION__.dmon_watch_add) #8
  unreachable

225:                                              ; No predecessors!
  br label %226

226:                                              ; preds = %225
  call void @llvm.lifetime.end.p0(i64 512, ptr %20) #9
  br label %227

227:                                              ; preds = %226
  br label %228

228:                                              ; preds = %227
  %229 = load i8, ptr %6, align 1, !tbaa !16, !range !17, !noundef !18
  %230 = trunc i8 %229 to i1
  br i1 %230, label %233, label %231

231:                                              ; preds = %228
  %232 = call i32 @pthread_mutex_unlock(ptr noundef getelementptr inbounds (%struct.dmon__state, ptr @_dmon, i32 0, i32 5)) #9
  br label %233

233:                                              ; preds = %231, %228
  store i1 false, ptr %3, align 1
  store i32 1, ptr %15, align 4
  br label %323

234:                                              ; preds = %198
  %235 = load ptr, ptr %7, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.dmon__watch_state, ptr %235, i32 0, i32 6
  %237 = load ptr, ptr %236, align 8, !tbaa !24
  %238 = icmp eq ptr %237, null
  br i1 %238, label %254, label %239

239:                                              ; preds = %234
  %240 = load ptr, ptr %7, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.dmon__watch_state, ptr %240, i32 0, i32 6
  %242 = load ptr, ptr %241, align 8, !tbaa !24
  %243 = getelementptr inbounds i32, ptr %242, i64 -2
  %244 = getelementptr inbounds i32, ptr %243, i64 1
  %245 = load i32, ptr %244, align 4, !tbaa !22
  %246 = add nsw i32 %245, 1
  %247 = load ptr, ptr %7, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.dmon__watch_state, ptr %247, i32 0, i32 6
  %249 = load ptr, ptr %248, align 8, !tbaa !24
  %250 = getelementptr inbounds i32, ptr %249, i64 -2
  %251 = getelementptr inbounds i32, ptr %250, i64 0
  %252 = load i32, ptr %251, align 4, !tbaa !22
  %253 = icmp sge i32 %246, %252
  br i1 %253, label %254, label %261

254:                                              ; preds = %239, %234
  %255 = load ptr, ptr %7, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.dmon__watch_state, ptr %255, i32 0, i32 6
  %257 = load ptr, ptr %256, align 8, !tbaa !24
  %258 = call ptr @stb__sbgrowf(ptr noundef %257, i32 noundef 1, i32 noundef 260)
  %259 = load ptr, ptr %7, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.dmon__watch_state, ptr %259, i32 0, i32 6
  store ptr %258, ptr %260, align 8, !tbaa !5
  br label %262

261:                                              ; preds = %239
  br label %262

262:                                              ; preds = %261, %254
  %263 = phi ptr [ %258, %254 ], [ null, %261 ]
  %264 = load ptr, ptr %7, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.dmon__watch_state, ptr %264, i32 0, i32 6
  %266 = load ptr, ptr %265, align 8, !tbaa !24
  %267 = load ptr, ptr %7, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.dmon__watch_state, ptr %267, i32 0, i32 6
  %269 = load ptr, ptr %268, align 8, !tbaa !24
  %270 = getelementptr inbounds i32, ptr %269, i64 -2
  %271 = getelementptr inbounds i32, ptr %270, i64 1
  %272 = load i32, ptr %271, align 4, !tbaa !22
  %273 = add nsw i32 %272, 1
  store i32 %273, ptr %271, align 4, !tbaa !22
  %274 = sext i32 %272 to i64
  %275 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %266, i64 %274
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %275, ptr align 1 %12, i64 260, i1 false), !tbaa.struct !29
  %276 = load ptr, ptr %7, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.dmon__watch_state, ptr %276, i32 0, i32 7
  %278 = load ptr, ptr %277, align 8, !tbaa !30
  %279 = icmp eq ptr %278, null
  br i1 %279, label %295, label %280

280:                                              ; preds = %262
  %281 = load ptr, ptr %7, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.dmon__watch_state, ptr %281, i32 0, i32 7
  %283 = load ptr, ptr %282, align 8, !tbaa !30
  %284 = getelementptr inbounds i32, ptr %283, i64 -2
  %285 = getelementptr inbounds i32, ptr %284, i64 1
  %286 = load i32, ptr %285, align 4, !tbaa !22
  %287 = add nsw i32 %286, 1
  %288 = load ptr, ptr %7, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.dmon__watch_state, ptr %288, i32 0, i32 7
  %290 = load ptr, ptr %289, align 8, !tbaa !30
  %291 = getelementptr inbounds i32, ptr %290, i64 -2
  %292 = getelementptr inbounds i32, ptr %291, i64 0
  %293 = load i32, ptr %292, align 4, !tbaa !22
  %294 = icmp sge i32 %287, %293
  br i1 %294, label %295, label %302

295:                                              ; preds = %280, %262
  %296 = load ptr, ptr %7, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct.dmon__watch_state, ptr %296, i32 0, i32 7
  %298 = load ptr, ptr %297, align 8, !tbaa !30
  %299 = call ptr @stb__sbgrowf(ptr noundef %298, i32 noundef 1, i32 noundef 4)
  %300 = load ptr, ptr %7, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct.dmon__watch_state, ptr %300, i32 0, i32 7
  store ptr %299, ptr %301, align 8, !tbaa !5
  br label %303

302:                                              ; preds = %280
  br label %303

303:                                              ; preds = %302, %295
  %304 = phi ptr [ %299, %295 ], [ null, %302 ]
  %305 = load i32, ptr %19, align 4, !tbaa !22
  %306 = load ptr, ptr %7, align 8, !tbaa !5
  %307 = getelementptr inbounds %struct.dmon__watch_state, ptr %306, i32 0, i32 7
  %308 = load ptr, ptr %307, align 8, !tbaa !30
  %309 = load ptr, ptr %7, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct.dmon__watch_state, ptr %309, i32 0, i32 7
  %311 = load ptr, ptr %310, align 8, !tbaa !30
  %312 = getelementptr inbounds i32, ptr %311, i64 -2
  %313 = getelementptr inbounds i32, ptr %312, i64 1
  %314 = load i32, ptr %313, align 4, !tbaa !22
  %315 = add nsw i32 %314, 1
  store i32 %315, ptr %313, align 4, !tbaa !22
  %316 = sext i32 %314 to i64
  %317 = getelementptr inbounds i32, ptr %308, i64 %316
  store i32 %305, ptr %317, align 4, !tbaa !22
  %318 = load i8, ptr %6, align 1, !tbaa !16, !range !17, !noundef !18
  %319 = trunc i8 %318 to i1
  br i1 %319, label %322, label %320

320:                                              ; preds = %303
  %321 = call i32 @pthread_mutex_unlock(ptr noundef getelementptr inbounds (%struct.dmon__state, ptr @_dmon, i32 0, i32 5)) #9
  br label %322

322:                                              ; preds = %320, %303
  store i1 true, ptr %3, align 1
  store i32 1, ptr %15, align 4
  br label %323

323:                                              ; preds = %322, %233
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 260, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  br label %324

324:                                              ; preds = %323, %193, %119
  call void @llvm.lifetime.end.p0(i64 260, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 144, 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 4, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #9
  %325 = load i1, ptr %3, align 1
  ret i1 %325
}

; Function Attrs: nounwind willreturn memory(none)
declare i64 @pthread_self() #7

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strstr(ptr noundef, ptr noundef) #6

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #6

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { 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 #7 = { 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 #8 = { noreturn nounwind }
attributes #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(none) }
attributes #11 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !14, i64 784}
!13 = !{!"dmon__state", !7, i64 0, !7, i64 512, !6, i64 768, !11, i64 776, !14, i64 784, !7, i64 792, !15, i64 832}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!15, !15, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!20, !11, i64 24}
!20 = !{!"stat", !14, i64 0, !14, i64 8, !14, i64 16, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !21, i64 72, !21, i64 88, !21, i64 104, !7, i64 120}
!21 = !{!"timespec", !14, i64 0, !14, i64 8}
!22 = !{!11, !11, i64 0}
!23 = !{!7, !7, i64 0}
!24 = !{!25, !6, i64 296}
!25 = !{!"dmon__watch_state", !10, i64 0, !11, i64 4, !11, i64 8, !6, i64 16, !6, i64 24, !7, i64 32, !6, i64 296, !6, i64 304}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!25, !11, i64 4}
!29 = !{i64 0, i64 260, !23}
!30 = !{!25, !6, i64 304}


; 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.dmon__state = type { [64 x ptr], [64 x i32], ptr, i32, i64, %union.pthread_mutex_t, i8 }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }
%struct.dmon__watch_subdir = type { [260 x i8] }

@_dmon = external hidden global %struct.dmon__state, align 8
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [58 x i8], align 1
@__PRETTY_FUNCTION__.dmon_watch_add = external hidden unnamed_addr constant [50 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [60 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind
declare i32 @pthread_mutex_lock(ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @pthread_mutex_unlock(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i32 @stat(ptr nocapture noundef readonly, ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #6

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

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @dmon_watch_add(i32 %0, ptr noundef %1) local_unnamed_addr #5 {
  %3 = alloca %struct.stat, align 8
  %4 = alloca %struct.dmon__watch_subdir, align 1
  %5 = alloca [260 x i8], align 16
  %6 = alloca [512 x i8], align 16
  %7 = alloca [512 x i8], align 16
  %8 = alloca [260 x i8], align 16
  %9 = alloca [512 x i8], align 16
  %10 = add i32 %0, -1
  %or.cond = icmp ult i32 %10, 64
  br i1 %or.cond, label %12, label %11

11:                                               ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.23, i32 noundef 41, ptr noundef nonnull @__PRETTY_FUNCTION__.dmon_watch_add) #9
  unreachable

12:                                               ; preds = %2
  %13 = tail call i64 @pthread_self() #10
  %14 = load i64, ptr getelementptr inbounds (i8, ptr @_dmon, i64 784), align 8, !tbaa !5
  %15 = icmp eq i64 %13, %14
  br i1 %15, label %18, label %16

16:                                               ; preds = %12
  %17 = tail call i32 @pthread_mutex_lock(ptr noundef nonnull getelementptr inbounds (i8, ptr @_dmon, i64 792)) #11
  br label %18

18:                                               ; preds = %16, %12
  %19 = zext nneg i32 %10 to i64
  %20 = getelementptr inbounds [64 x ptr], ptr @_dmon, i64 0, i64 %19
  %21 = load ptr, ptr %20, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %3) #11
  call void @llvm.lifetime.start.p0(i64 260, ptr nonnull %4) #11
  %22 = call i32 @stat(ptr noundef %1, ptr noundef nonnull %3) #11
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %35

24:                                               ; preds = %18
  %25 = getelementptr inbounds i8, ptr %3, i64 24
  %26 = load i32, ptr %25, align 8, !tbaa !14
  %27 = and i32 %26, 16384
  %.not = icmp eq i32 %27, 0
  br i1 %.not, label %35, label %28

28:                                               ; preds = %24
  %29 = call ptr @_dmon_strcpy(ptr noundef nonnull %4, i32 noundef 260, ptr noundef %1)
  %30 = getelementptr inbounds i8, ptr %21, i64 32
  %strlen = call i64 @strlen(ptr nonnull dereferenceable(1) %30)
  %strncmp = call i32 @strncmp(ptr nonnull %4, ptr nonnull %30, i64 %strlen)
  %cmp = icmp eq i32 %strncmp, 0
  br i1 %cmp, label %31, label %50

31:                                               ; preds = %28
  %32 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %30) #12
  %33 = getelementptr inbounds i8, ptr %1, i64 %32
  %34 = call ptr @_dmon_strcpy(ptr noundef nonnull %4, i32 noundef 260, ptr noundef %33)
  br label %50

35:                                               ; preds = %24, %18
  call void @llvm.lifetime.start.p0(i64 260, ptr nonnull %5) #11
  %36 = getelementptr inbounds i8, ptr %21, i64 32
  %37 = call ptr @_dmon_strcpy(ptr noundef nonnull %5, i32 noundef 260, ptr noundef nonnull %36)
  %38 = call ptr @_dmon_strcat(ptr noundef nonnull %5, i32 noundef 260, ptr noundef %1)
  %39 = call i32 @stat(ptr noundef nonnull %5, ptr noundef nonnull %3) #11
  %.not52 = icmp eq i32 %39, 0
  br i1 %.not52, label %40, label %45

40:                                               ; preds = %35
  %41 = getelementptr inbounds i8, ptr %3, i64 24
  %42 = load i32, ptr %41, align 8, !tbaa !14
  %43 = and i32 %42, 16384
  %44 = icmp eq i32 %43, 0
  br i1 %44, label %45, label %48

45:                                               ; preds = %35, %40
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %6) #11
  %46 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %6, i64 noundef 512, ptr noundef nonnull @.str.24, ptr noundef %1) #11
  %47 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %6)
  call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.23, i32 noundef 67, ptr noundef nonnull @__PRETTY_FUNCTION__.dmon_watch_add) #9
  unreachable

48:                                               ; preds = %40
  %49 = call ptr @_dmon_strcpy(ptr noundef nonnull %4, i32 noundef 260, ptr noundef %1)
  call void @llvm.lifetime.end.p0(i64 260, ptr nonnull %5) #11
  br label %50

50:                                               ; preds = %48, %28, %31
  %51 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %4) #12
  %52 = shl i64 %51, 32
  %sext = add i64 %52, -4294967296
  %53 = ashr exact i64 %sext, 32
  %54 = getelementptr inbounds [260 x i8], ptr %4, i64 0, i64 %53
  %55 = load i8, ptr %54, align 1, !tbaa !17
  %.not53 = icmp eq i8 %55, 47
  br i1 %.not53, label %61, label %56

56:                                               ; preds = %50
  %57 = ashr exact i64 %52, 32
  %58 = getelementptr inbounds [260 x i8], ptr %4, i64 0, i64 %57
  store i8 47, ptr %58, align 1, !tbaa !17
  %sext55 = add i64 %52, 4294967296
  %59 = ashr exact i64 %sext55, 32
  %60 = getelementptr inbounds [260 x i8], ptr %4, i64 0, i64 %59
  store i8 0, ptr %60, align 1, !tbaa !17
  br label %61

61:                                               ; preds = %56, %50
  %62 = getelementptr inbounds i8, ptr %21, i64 296
  %63 = load ptr, ptr %62, align 8, !tbaa !18
  %.not56 = icmp eq ptr %63, null
  br i1 %.not56, label %._crit_edge, label %64

64:                                               ; preds = %61
  %65 = getelementptr inbounds i8, ptr %63, i64 -4
  %66 = load i32, ptr %65, align 4, !tbaa !21
  %67 = icmp sgt i32 %66, 0
  br i1 %67, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %64
  %wide.trip.count = zext nneg i32 %66 to i64
  br label %.lr.ph

68:                                               ; preds = %.lr.ph
  %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.ph, !llvm.loop !22

.lr.ph:                                           ; preds = %.lr.ph.preheader, %68
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %68 ]
  %69 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %63, i64 %indvars.iv
  %70 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) %69) #12
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %68

72:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %7) #11
  %73 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %7, i64 noundef 512, ptr noundef nonnull @.str.25, ptr noundef %1) #11
  %74 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %7)
  call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.23, i32 noundef 84, ptr noundef nonnull @__PRETTY_FUNCTION__.dmon_watch_add) #9
  unreachable

._crit_edge:                                      ; preds = %68, %61, %64
  call void @llvm.lifetime.start.p0(i64 260, ptr nonnull %8) #11
  %75 = getelementptr inbounds i8, ptr %21, i64 32
  %76 = call ptr @_dmon_strcpy(ptr noundef nonnull %8, i32 noundef 260, ptr noundef nonnull %75)
  %77 = call ptr @_dmon_strcat(ptr noundef nonnull %8, i32 noundef 260, ptr noundef nonnull %4)
  %78 = getelementptr inbounds i8, ptr %21, i64 4
  %79 = load i32, ptr %78, align 4, !tbaa !24
  %80 = call i32 @inotify_add_watch(i32 noundef %79, ptr noundef nonnull %8, i32 noundef 962) #11
  %81 = icmp eq i32 %80, -1
  br i1 %81, label %82, label %87

82:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %9) #11
  %83 = tail call ptr @__errno_location() #10
  %84 = load i32, ptr %83, align 4, !tbaa !21
  %85 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %9, i64 noundef 512, ptr noundef nonnull @.str.16, ptr noundef %1, i32 noundef %84) #11
  %86 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %9)
  call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.23, i32 noundef 97, ptr noundef nonnull @__PRETTY_FUNCTION__.dmon_watch_add) #9
  unreachable

87:                                               ; preds = %._crit_edge
  %88 = load ptr, ptr %62, align 8, !tbaa !18
  %89 = icmp eq ptr %88, null
  br i1 %89, label %96, label %90

90:                                               ; preds = %87
  %91 = getelementptr inbounds i8, ptr %88, i64 -8
  %92 = getelementptr inbounds i8, ptr %88, i64 -4
  %93 = load i32, ptr %92, align 4, !tbaa !21
  %94 = add nsw i32 %93, 1
  %95 = load i32, ptr %91, align 4, !tbaa !21
  %.not57 = icmp slt i32 %94, %95
  br i1 %.not57, label %98, label %96

96:                                               ; preds = %90, %87
  %97 = call ptr @stb__sbgrowf(ptr noundef %88, i32 noundef 1, i32 noundef 260)
  store ptr %97, ptr %62, align 8, !tbaa !13
  %.phi.trans.insert = getelementptr inbounds i8, ptr %97, i64 -4
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !21
  %.pre63 = add nsw i32 %.pre, 1
  br label %98

98:                                               ; preds = %90, %96
  %.pre-phi = phi i32 [ %94, %90 ], [ %.pre63, %96 ]
  %99 = phi i32 [ %93, %90 ], [ %.pre, %96 ]
  %100 = phi ptr [ %88, %90 ], [ %97, %96 ]
  %101 = getelementptr inbounds i8, ptr %100, i64 -4
  store i32 %.pre-phi, ptr %101, align 4, !tbaa !21
  %102 = sext i32 %99 to i64
  %103 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %100, i64 %102
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(260) %103, ptr noundef nonnull align 1 dereferenceable(260) %4, i64 260, i1 false), !tbaa.struct !25
  %104 = getelementptr inbounds i8, ptr %21, i64 304
  %105 = load ptr, ptr %104, align 8, !tbaa !26
  %106 = icmp eq ptr %105, null
  br i1 %106, label %113, label %107

107:                                              ; preds = %98
  %108 = getelementptr inbounds i8, ptr %105, i64 -8
  %109 = getelementptr inbounds i8, ptr %105, i64 -4
  %110 = load i32, ptr %109, align 4, !tbaa !21
  %111 = add nsw i32 %110, 1
  %112 = load i32, ptr %108, align 4, !tbaa !21
  %.not58 = icmp slt i32 %111, %112
  br i1 %.not58, label %115, label %113

113:                                              ; preds = %107, %98
  %114 = call ptr @stb__sbgrowf(ptr noundef %105, i32 noundef 1, i32 noundef 4)
  store ptr %114, ptr %104, align 8, !tbaa !13
  %.phi.trans.insert61 = getelementptr inbounds i8, ptr %114, i64 -4
  %.pre62 = load i32, ptr %.phi.trans.insert61, align 4, !tbaa !21
  %.pre64 = add nsw i32 %.pre62, 1
  br label %115

115:                                              ; preds = %107, %113
  %.pre-phi65 = phi i32 [ %111, %107 ], [ %.pre64, %113 ]
  %116 = phi i32 [ %110, %107 ], [ %.pre62, %113 ]
  %117 = phi ptr [ %105, %107 ], [ %114, %113 ]
  %118 = getelementptr inbounds i8, ptr %117, i64 -4
  store i32 %.pre-phi65, ptr %118, align 4, !tbaa !21
  %119 = sext i32 %116 to i64
  %120 = getelementptr inbounds i32, ptr %117, i64 %119
  store i32 %80, ptr %120, align 4, !tbaa !21
  br i1 %15, label %123, label %121

121:                                              ; preds = %115
  %122 = call i32 @pthread_mutex_unlock(ptr noundef nonnull getelementptr inbounds (i8, ptr @_dmon, i64 792)) #11
  br label %123

123:                                              ; preds = %121, %115
  call void @llvm.lifetime.end.p0(i64 260, ptr nonnull %8) #11
  call void @llvm.lifetime.end.p0(i64 260, ptr nonnull %4) #11
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %3) #11
  ret i1 true
}

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare i64 @pthread_self() local_unnamed_addr #7

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { mustprogress nofree nounwind willreturn memory(argmem: 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 #7 = { 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 #8 = { nofree nounwind willreturn memory(argmem: read) }
attributes #9 = { noreturn nounwind }
attributes #10 = { nounwind willreturn memory(none) }
attributes #11 = { nounwind }
attributes #12 = { nounwind willreturn memory(read) }

!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, !11, i64 784}
!6 = !{!"dmon__state", !7, i64 0, !7, i64 512, !9, i64 768, !10, i64 776, !11, i64 784, !7, i64 792, !12, i64 832}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!"long", !7, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!9, !9, i64 0}
!14 = !{!15, !10, i64 24}
!15 = !{!"stat", !11, i64 0, !11, i64 8, !11, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !16, i64 72, !16, i64 88, !16, i64 104, !7, i64 120}
!16 = !{!"timespec", !11, i64 0, !11, i64 8}
!17 = !{!7, !7, i64 0}
!18 = !{!19, !9, i64 296}
!19 = !{!"dmon__watch_state", !20, i64 0, !10, i64 4, !10, i64 8, !9, i64 16, !9, i64 24, !7, i64 32, !9, i64 296, !9, i64 304}
!20 = !{!"", !10, i64 0}
!21 = !{!10, !10, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!19, !10, i64 4}
!25 = !{i64 0, i64 260, !17}
!26 = !{!19, !9, i64 304}


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