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

; 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.dmon__watch_state = type { %struct.dmon_watch_id, i32, i32, ptr, ptr, [260 x i8], ptr, ptr }
%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.22 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [34 x i8], align 1
@__PRETTY_FUNCTION__.dmon_watch_rm = external hidden unnamed_addr constant [49 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 @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 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 willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #6

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @dmon_watch_rm(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 [260 x i8], align 16
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca [512 x i8], align 16
  %13 = alloca i32, align 4
  %14 = getelementptr inbounds %struct.dmon_watch_id, ptr %4, i32 0, i32 0
  store i32 %0, ptr %14, align 4
  store ptr %1, ptr %5, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.dmon_watch_id, ptr %4, i32 0, i32 0
  %16 = load i32, ptr %15, align 4, !tbaa !9
  %17 = icmp ugt i32 %16, 0
  br i1 %17, label %18, label %23

18:                                               ; preds = %2
  %19 = getelementptr inbounds %struct.dmon_watch_id, ptr %4, i32 0, i32 0
  %20 = load i32, ptr %19, align 4, !tbaa !9
  %21 = icmp ule i32 %20, 64
  br i1 %21, label %22, label %23

22:                                               ; preds = %18
  br label %24

23:                                               ; preds = %18, %2
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str.23, i32 noundef 114, ptr noundef @__PRETTY_FUNCTION__.dmon_watch_rm) #8
  unreachable

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

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

33:                                               ; preds = %31, %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  %34 = getelementptr inbounds %struct.dmon_watch_id, ptr %4, i32 0, i32 0
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = sub i32 %35, 1
  %37 = zext i32 %36 to i64
  %38 = getelementptr inbounds [64 x ptr], ptr @_dmon, i64 0, i64 %37
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  store ptr %39, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 260, ptr %8) #9
  %40 = getelementptr inbounds [260 x i8], ptr %8, i64 0, i64 0
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = call ptr @_dmon_strcpy(ptr noundef %40, i32 noundef 260, ptr noundef %41)
  %43 = getelementptr inbounds [260 x i8], ptr %8, i64 0, i64 0
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.dmon__watch_state, ptr %44, i32 0, i32 5
  %46 = getelementptr inbounds [260 x i8], ptr %45, i64 0, i64 0
  %47 = call ptr @strstr(ptr noundef %43, ptr noundef %46) #11
  %48 = getelementptr inbounds [260 x i8], ptr %8, i64 0, i64 0
  %49 = icmp eq ptr %47, %48
  br i1 %49, label %50, label %59

50:                                               ; preds = %33
  %51 = getelementptr inbounds [260 x i8], ptr %8, i64 0, i64 0
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.dmon__watch_state, ptr %53, i32 0, i32 5
  %55 = getelementptr inbounds [260 x i8], ptr %54, i64 0, i64 0
  %56 = call i64 @strlen(ptr noundef %55) #11
  %57 = getelementptr inbounds i8, ptr %52, i64 %56
  %58 = call ptr @_dmon_strcpy(ptr noundef %51, i32 noundef 260, ptr noundef %57)
  br label %59

59:                                               ; preds = %50, %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  %60 = getelementptr inbounds [260 x i8], ptr %8, i64 0, i64 0
  %61 = call i64 @strlen(ptr noundef %60) #11
  %62 = trunc i64 %61 to i32
  store i32 %62, ptr %9, align 4, !tbaa !19
  %63 = load i32, ptr %9, align 4, !tbaa !19
  %64 = sub nsw i32 %63, 1
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [260 x i8], ptr %8, i64 0, i64 %65
  %67 = load i8, ptr %66, align 1, !tbaa !20
  %68 = sext i8 %67 to i32
  %69 = icmp ne i32 %68, 47
  br i1 %69, label %70, label %78

70:                                               ; preds = %59
  %71 = load i32, ptr %9, align 4, !tbaa !19
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [260 x i8], ptr %8, i64 0, i64 %72
  store i8 47, ptr %73, align 1, !tbaa !20
  %74 = load i32, ptr %9, align 4, !tbaa !19
  %75 = add nsw i32 %74, 1
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [260 x i8], ptr %8, i64 0, i64 %76
  store i8 0, ptr %77, align 1, !tbaa !20
  br label %78

78:                                               ; preds = %70, %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.dmon__watch_state, ptr %79, i32 0, i32 6
  %81 = load ptr, ptr %80, align 8, !tbaa !21
  %82 = icmp ne ptr %81, null
  br i1 %82, label %83, label %90

83:                                               ; preds = %78
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.dmon__watch_state, ptr %84, i32 0, i32 6
  %86 = load ptr, ptr %85, align 8, !tbaa !21
  %87 = getelementptr inbounds i32, ptr %86, i64 -2
  %88 = getelementptr inbounds i32, ptr %87, i64 1
  %89 = load i32, ptr %88, align 4, !tbaa !19
  br label %91

90:                                               ; preds = %78
  br label %91

91:                                               ; preds = %90, %83
  %92 = phi i32 [ %89, %83 ], [ 0, %90 ]
  store i32 %92, ptr %11, align 4, !tbaa !19
  store i32 0, ptr %10, align 4, !tbaa !19
  br label %93

93:                                               ; preds = %111, %91
  %94 = load i32, ptr %10, align 4, !tbaa !19
  %95 = load i32, ptr %11, align 4, !tbaa !19
  %96 = icmp slt i32 %94, %95
  br i1 %96, label %97, label %114

97:                                               ; preds = %93
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.dmon__watch_state, ptr %98, i32 0, i32 6
  %100 = load ptr, ptr %99, align 8, !tbaa !21
  %101 = load i32, ptr %10, align 4, !tbaa !19
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %100, i64 %102
  %104 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %103, i32 0, i32 0
  %105 = getelementptr inbounds [260 x i8], ptr %104, i64 0, i64 0
  %106 = getelementptr inbounds [260 x i8], ptr %8, i64 0, i64 0
  %107 = call i32 @strcmp(ptr noundef %105, ptr noundef %106) #11
  %108 = icmp eq i32 %107, 0
  br i1 %108, label %109, label %110

109:                                              ; preds = %97
  br label %114

110:                                              ; preds = %97
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %10, align 4, !tbaa !19
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %10, align 4, !tbaa !19
  br label %93, !llvm.loop !23

114:                                              ; preds = %109, %93
  %115 = load i32, ptr %10, align 4, !tbaa !19
  %116 = load i32, ptr %11, align 4, !tbaa !19
  %117 = icmp sge i32 %115, %116
  br i1 %117, label %118, label %135

118:                                              ; preds = %114
  br label %119

119:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 512, ptr %12) #9
  %120 = getelementptr inbounds [512 x i8], ptr %12, i64 0, i64 0
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %120, i64 noundef 512, ptr noundef @.str.24, ptr noundef %121) #9
  br label %123

123:                                              ; preds = %119
  %124 = getelementptr inbounds [512 x i8], ptr %12, i64 0, i64 0
  %125 = call i32 @puts(ptr noundef %124)
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.23, i32 noundef 142, ptr noundef @__PRETTY_FUNCTION__.dmon_watch_rm) #8
  unreachable

126:                                              ; No predecessors!
  br label %127

127:                                              ; preds = %126
  call void @llvm.lifetime.end.p0(i64 512, ptr %12) #9
  br label %128

128:                                              ; preds = %127
  br label %129

129:                                              ; preds = %128
  %130 = load i8, ptr %6, align 1, !tbaa !16, !range !17, !noundef !18
  %131 = trunc i8 %130 to i1
  br i1 %131, label %134, label %132

132:                                              ; preds = %129
  %133 = call i32 @pthread_mutex_unlock(ptr noundef getelementptr inbounds (%struct.dmon__state, ptr @_dmon, i32 0, i32 5)) #9
  br label %134

134:                                              ; preds = %132, %129
  store i1 false, ptr %3, align 1
  store i32 1, ptr %13, align 4
  br label %203

135:                                              ; preds = %114
  %136 = load ptr, ptr %7, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.dmon__watch_state, ptr %136, i32 0, i32 1
  %138 = load i32, ptr %137, align 4, !tbaa !25
  %139 = load ptr, ptr %7, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.dmon__watch_state, ptr %139, i32 0, i32 7
  %141 = load ptr, ptr %140, align 8, !tbaa !26
  %142 = load i32, ptr %10, align 4, !tbaa !19
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds i32, ptr %141, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !19
  %146 = call i32 @inotify_rm_watch(i32 noundef %138, i32 noundef %145) #9
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.dmon__watch_state, ptr %147, i32 0, i32 6
  %149 = load ptr, ptr %148, align 8, !tbaa !21
  %150 = load i32, ptr %10, align 4, !tbaa !19
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %149, i64 %151
  %153 = load ptr, ptr %7, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.dmon__watch_state, ptr %153, i32 0, i32 6
  %155 = load ptr, ptr %154, align 8, !tbaa !21
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.dmon__watch_state, ptr %156, i32 0, i32 6
  %158 = load ptr, ptr %157, align 8, !tbaa !21
  %159 = getelementptr inbounds i32, ptr %158, i64 -2
  %160 = getelementptr inbounds i32, ptr %159, i64 1
  %161 = load i32, ptr %160, align 4, !tbaa !19
  %162 = sub nsw i32 %161, 1
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %155, i64 %163
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %152, ptr align 1 %164, i64 260, i1 false), !tbaa.struct !27
  %165 = load ptr, ptr %7, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.dmon__watch_state, ptr %165, i32 0, i32 6
  %167 = load ptr, ptr %166, align 8, !tbaa !21
  %168 = getelementptr inbounds i32, ptr %167, i64 -2
  %169 = getelementptr inbounds i32, ptr %168, i64 1
  %170 = load i32, ptr %169, align 4, !tbaa !19
  %171 = add nsw i32 %170, -1
  store i32 %171, ptr %169, align 4, !tbaa !19
  %172 = load ptr, ptr %7, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.dmon__watch_state, ptr %172, i32 0, i32 7
  %174 = load ptr, ptr %173, align 8, !tbaa !26
  %175 = load ptr, ptr %7, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.dmon__watch_state, ptr %175, i32 0, i32 7
  %177 = load ptr, ptr %176, align 8, !tbaa !26
  %178 = getelementptr inbounds i32, ptr %177, i64 -2
  %179 = getelementptr inbounds i32, ptr %178, i64 1
  %180 = load i32, ptr %179, align 4, !tbaa !19
  %181 = sub nsw i32 %180, 1
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds i32, ptr %174, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !19
  %185 = load ptr, ptr %7, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.dmon__watch_state, ptr %185, i32 0, i32 7
  %187 = load ptr, ptr %186, align 8, !tbaa !26
  %188 = load i32, ptr %10, align 4, !tbaa !19
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds i32, ptr %187, i64 %189
  store i32 %184, ptr %190, align 4, !tbaa !19
  %191 = load ptr, ptr %7, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.dmon__watch_state, ptr %191, i32 0, i32 7
  %193 = load ptr, ptr %192, align 8, !tbaa !26
  %194 = getelementptr inbounds i32, ptr %193, i64 -2
  %195 = getelementptr inbounds i32, ptr %194, i64 1
  %196 = load i32, ptr %195, align 4, !tbaa !19
  %197 = add nsw i32 %196, -1
  store i32 %197, ptr %195, align 4, !tbaa !19
  %198 = load i8, ptr %6, align 1, !tbaa !16, !range !17, !noundef !18
  %199 = trunc i8 %198 to i1
  br i1 %199, label %202, label %200

200:                                              ; preds = %135
  %201 = call i32 @pthread_mutex_unlock(ptr noundef getelementptr inbounds (%struct.dmon__state, ptr @_dmon, i32 0, i32 5)) #9
  br label %202

202:                                              ; preds = %200, %135
  store i1 true, ptr %3, align 1
  store i32 1, ptr %13, align 4
  br label %203

203:                                              ; preds = %202, %134
  call void @llvm.lifetime.end.p0(i64 4, 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 260, 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
  %204 = load i1, ptr %3, align 1
  ret i1 %204
}

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

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 = !{!11, !11, i64 0}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !6, i64 296}
!22 = !{!"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}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!22, !11, i64 4}
!26 = !{!22, !6, i64 304}
!27 = !{i64 0, i64 260, !20}


; 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.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.22 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [34 x i8], align 1
@__PRETTY_FUNCTION__.dmon_watch_rm = external hidden unnamed_addr constant [49 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 @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: mustprogress nofree nosync nounwind willreturn memory(none)
declare i64 @pthread_self() local_unnamed_addr #7

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

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

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

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

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

13:                                               ; preds = %11, %7
  %14 = zext nneg i32 %5 to i64
  %15 = getelementptr inbounds [64 x ptr], ptr @_dmon, i64 0, i64 %14
  %16 = load ptr, ptr %15, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 260, ptr nonnull %3) #11
  %17 = call ptr @_dmon_strcpy(ptr noundef nonnull %3, i32 noundef 260, ptr noundef %1)
  %18 = getelementptr inbounds i8, ptr %16, i64 32
  %strlen = call i64 @strlen(ptr nonnull dereferenceable(1) %18)
  %strncmp = call i32 @strncmp(ptr nonnull %3, ptr nonnull %18, i64 %strlen)
  %cmp = icmp eq i32 %strncmp, 0
  br i1 %cmp, label %19, label %23

19:                                               ; preds = %13
  %20 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %18) #12
  %21 = getelementptr inbounds i8, ptr %1, i64 %20
  %22 = call ptr @_dmon_strcpy(ptr noundef nonnull %3, i32 noundef 260, ptr noundef %21)
  br label %23

23:                                               ; preds = %19, %13
  %24 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #12
  %25 = shl i64 %24, 32
  %sext = add i64 %25, -4294967296
  %26 = ashr exact i64 %sext, 32
  %27 = getelementptr inbounds [260 x i8], ptr %3, i64 0, i64 %26
  %28 = load i8, ptr %27, align 1, !tbaa !14
  %.not = icmp eq i8 %28, 47
  br i1 %.not, label %34, label %29

29:                                               ; preds = %23
  %30 = ashr exact i64 %25, 32
  %31 = getelementptr inbounds [260 x i8], ptr %3, i64 0, i64 %30
  store i8 47, ptr %31, align 1, !tbaa !14
  %sext40 = add i64 %25, 4294967296
  %32 = ashr exact i64 %sext40, 32
  %33 = getelementptr inbounds [260 x i8], ptr %3, i64 0, i64 %32
  store i8 0, ptr %33, align 1, !tbaa !14
  br label %34

34:                                               ; preds = %29, %23
  %35 = getelementptr inbounds i8, ptr %16, i64 296
  %36 = load ptr, ptr %35, align 8, !tbaa !15
  %.not41 = icmp eq ptr %36, null
  br i1 %.not41, label %._crit_edge, label %37

37:                                               ; preds = %34
  %38 = getelementptr inbounds i8, ptr %36, i64 -4
  %39 = load i32, ptr %38, align 4, !tbaa !18
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %.lr.ph.preheader, label %._crit_edge

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %44
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %44 ]
  %41 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %36, i64 %indvars.iv
  %42 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %41, ptr noundef nonnull dereferenceable(1) %3) #12
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %47, label %44

44:                                               ; 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 !19

._crit_edge:                                      ; preds = %44, %34, %37
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %4) #11
  %45 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %4, i64 noundef 512, ptr noundef nonnull @.str.24, ptr noundef %1) #11
  %46 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %4)
  call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.23, i32 noundef 142, ptr noundef nonnull @__PRETTY_FUNCTION__.dmon_watch_rm) #9
  unreachable

47:                                               ; preds = %.lr.ph
  %48 = getelementptr inbounds i8, ptr %16, i64 4
  %49 = load i32, ptr %48, align 4, !tbaa !21
  %50 = getelementptr inbounds i8, ptr %16, i64 304
  %51 = load ptr, ptr %50, align 8, !tbaa !22
  %52 = and i64 %indvars.iv, 4294967295
  %53 = getelementptr inbounds i32, ptr %51, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !18
  %55 = call i32 @inotify_rm_watch(i32 noundef %49, i32 noundef %54) #11
  %56 = load ptr, ptr %35, align 8, !tbaa !15
  %57 = getelementptr inbounds %struct.dmon__watch_subdir, ptr %56, i64 %52
  %58 = getelementptr inbounds i8, ptr %56, i64 -4
  %59 = load i32, ptr %58, align 4, !tbaa !18
  %60 = sext i32 %59 to i64
  %61 = getelementptr %struct.dmon__watch_subdir, ptr %56, i64 %60
  %62 = getelementptr i8, ptr %61, i64 -260
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(260) %57, ptr noundef nonnull align 1 dereferenceable(260) %62, i64 260, i1 false), !tbaa.struct !23
  %63 = load ptr, ptr %35, align 8, !tbaa !15
  %64 = getelementptr inbounds i8, ptr %63, i64 -4
  %65 = load i32, ptr %64, align 4, !tbaa !18
  %66 = add nsw i32 %65, -1
  store i32 %66, ptr %64, align 4, !tbaa !18
  %67 = load ptr, ptr %50, align 8, !tbaa !22
  %68 = getelementptr inbounds i8, ptr %67, i64 -4
  %69 = load i32, ptr %68, align 4, !tbaa !18
  %70 = sext i32 %69 to i64
  %71 = getelementptr i32, ptr %67, i64 %70
  %72 = getelementptr i8, ptr %71, i64 -4
  %73 = load i32, ptr %72, align 4, !tbaa !18
  %74 = getelementptr inbounds i32, ptr %67, i64 %52
  store i32 %73, ptr %74, align 4, !tbaa !18
  %75 = add nsw i32 %69, -1
  store i32 %75, ptr %68, align 4, !tbaa !18
  br i1 %10, label %78, label %76

76:                                               ; preds = %47
  %77 = call i32 @pthread_mutex_unlock(ptr noundef nonnull getelementptr inbounds (i8, ptr @_dmon, i64 792)) #11
  br label %78

78:                                               ; preds = %76, %47
  call void @llvm.lifetime.end.p0(i64 260, ptr nonnull %3) #11
  ret i1 true
}

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

; 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 = !{!7, !7, i64 0}
!15 = !{!16, !9, i64 296}
!16 = !{!"dmon__watch_state", !17, i64 0, !10, i64 4, !10, i64 8, !9, i64 16, !9, i64 24, !7, i64 32, !9, i64 296, !9, i64 304}
!17 = !{!"", !10, i64 0}
!18 = !{!10, !10, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!16, !10, i64 4}
!22 = !{!16, !9, i64 304}
!23 = !{i64 0, i64 260, !14}


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