; LLVM IR from ohler55/agoo :: ext/agoo (log)

; 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._agooLog = type { ptr, [1024 x i8], [16 x i8], ptr, i32, i32, i64, i64, i8, i8, i8, i8, i8, i32, i64, i64, [16 x i8], ptr, ptr, %struct._agooAtom, %struct._agooAtom, %struct._agooAtom, %struct._agooAtom, i32, i32, ptr }
%struct._agooAtom = type { ptr, %union.pthread_mutex_t }
%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 }

@agoo_log = external dso_local global %struct._agooLog, align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
define dso_local void @agoo_log_rotate() #1 {
  %1 = alloca [1060 x i8], align 16
  %2 = alloca [1060 x i8], align 16
  %3 = alloca i32, align 4
  %4 = alloca [32 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 1060, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 1060, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %5 = load ptr, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 3), align 8, !tbaa !5
  %6 = icmp ne ptr null, %5
  br i1 %6, label %7, label %10

7:                                                ; preds = %0
  %8 = load ptr, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 3), align 8, !tbaa !5
  %9 = call i32 @fclose(ptr noundef %8)
  store ptr null, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 3), align 8, !tbaa !5
  br label %10

10:                                               ; preds = %7, %0
  %11 = load i8, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 12), align 4, !tbaa !14, !range !15, !noundef !16
  %12 = trunc i8 %11 to i1
  br i1 %12, label %13, label %44

13:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #4
  %14 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %15 = call i32 @getpid() #4
  %16 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %14, ptr noundef @.str, ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 2), i32 noundef %15) #4
  %17 = load i32, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 4), align 8, !tbaa !17
  store i32 %17, ptr %3, align 4, !tbaa !18
  br label %18

18:                                               ; preds = %34, %13
  %19 = load i32, ptr %3, align 4, !tbaa !18
  %20 = icmp slt i32 0, %19
  br i1 %20, label %21, label %37

21:                                               ; preds = %18
  %22 = getelementptr inbounds [1060 x i8], ptr %2, i64 0, i64 0
  %23 = call i32 @getpid() #4
  %24 = load i32, ptr %3, align 4, !tbaa !18
  %25 = add nsw i32 %24, 1
  %26 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %22, i64 noundef 1059, ptr noundef @.str.1, ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 1), ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 2), i32 noundef %23, i32 noundef %25) #4
  %27 = getelementptr inbounds [1060 x i8], ptr %1, i64 0, i64 0
  %28 = call i32 @getpid() #4
  %29 = load i32, ptr %3, align 4, !tbaa !18
  %30 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %27, i64 noundef 1059, ptr noundef @.str.1, ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 1), ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 2), i32 noundef %28, i32 noundef %29) #4
  %31 = getelementptr inbounds [1060 x i8], ptr %1, i64 0, i64 0
  %32 = getelementptr inbounds [1060 x i8], ptr %2, i64 0, i64 0
  %33 = call i32 @rename(ptr noundef %31, ptr noundef %32) #4
  br label %34

34:                                               ; preds = %21
  %35 = load i32, ptr %3, align 4, !tbaa !18
  %36 = add nsw i32 %35, -1
  store i32 %36, ptr %3, align 4, !tbaa !18
  br label %18, !llvm.loop !19

37:                                               ; preds = %18
  %38 = getelementptr inbounds [1060 x i8], ptr %2, i64 0, i64 0
  %39 = call i32 @getpid() #4
  %40 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %38, i64 noundef 1059, ptr noundef @.str.1, ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 1), ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 2), i32 noundef %39, i32 noundef 1) #4
  %41 = getelementptr inbounds [1060 x i8], ptr %1, i64 0, i64 0
  %42 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %43 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %41, i64 noundef 1059, ptr noundef @.str.2, ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 1), ptr noundef %42) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #4
  br label %68

44:                                               ; preds = %10
  %45 = load i32, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 4), align 8, !tbaa !17
  store i32 %45, ptr %3, align 4, !tbaa !18
  br label %46

46:                                               ; preds = %60, %44
  %47 = load i32, ptr %3, align 4, !tbaa !18
  %48 = icmp slt i32 0, %47
  br i1 %48, label %49, label %63

49:                                               ; preds = %46
  %50 = getelementptr inbounds [1060 x i8], ptr %2, i64 0, i64 0
  %51 = load i32, ptr %3, align 4, !tbaa !18
  %52 = add nsw i32 %51, 1
  %53 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %50, i64 noundef 1059, ptr noundef @.str.3, ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 1), ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 2), i32 noundef %52) #4
  %54 = getelementptr inbounds [1060 x i8], ptr %1, i64 0, i64 0
  %55 = load i32, ptr %3, align 4, !tbaa !18
  %56 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %54, i64 noundef 1059, ptr noundef @.str.3, ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 1), ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 2), i32 noundef %55) #4
  %57 = getelementptr inbounds [1060 x i8], ptr %1, i64 0, i64 0
  %58 = getelementptr inbounds [1060 x i8], ptr %2, i64 0, i64 0
  %59 = call i32 @rename(ptr noundef %57, ptr noundef %58) #4
  br label %60

60:                                               ; preds = %49
  %61 = load i32, ptr %3, align 4, !tbaa !18
  %62 = add nsw i32 %61, -1
  store i32 %62, ptr %3, align 4, !tbaa !18
  br label %46, !llvm.loop !21

63:                                               ; preds = %46
  %64 = getelementptr inbounds [1060 x i8], ptr %2, i64 0, i64 0
  %65 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %64, i64 noundef 1059, ptr noundef @.str.3, ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 1), ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 2), i32 noundef 1) #4
  %66 = getelementptr inbounds [1060 x i8], ptr %1, i64 0, i64 0
  %67 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %66, i64 noundef 1059, ptr noundef @.str.4, ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 1), ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 2)) #4
  br label %68

68:                                               ; preds = %63, %37
  %69 = getelementptr inbounds [1060 x i8], ptr %1, i64 0, i64 0
  %70 = getelementptr inbounds [1060 x i8], ptr %2, i64 0, i64 0
  %71 = call i32 @rename(ptr noundef %69, ptr noundef %70) #4
  %72 = getelementptr inbounds [1060 x i8], ptr %1, i64 0, i64 0
  %73 = call noalias ptr @fopen(ptr noundef %72, ptr noundef @.str.5)
  store ptr %73, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 3), align 8, !tbaa !5
  store i64 0, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 6), align 8, !tbaa !22
  call void @remove_old_logs()
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 1060, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 1060, ptr %1) #4
  ret void
}

declare i32 @fclose(ptr noundef) #2

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #3

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

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

; Function Attrs: nounwind
declare i32 @rename(ptr noundef, ptr noundef) #3

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @remove_old_logs() #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { 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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 1048}
!6 = !{!"_agooLog", !7, i64 0, !8, i64 8, !8, i64 1032, !7, i64 1048, !10, i64 1056, !10, i64 1060, !11, i64 1064, !11, i64 1072, !12, i64 1080, !12, i64 1081, !12, i64 1082, !12, i64 1083, !12, i64 1084, !10, i64 1088, !11, i64 1096, !11, i64 1104, !8, i64 1112, !7, i64 1128, !7, i64 1136, !13, i64 1144, !13, i64 1192, !13, i64 1240, !13, i64 1288, !10, i64 1336, !10, i64 1340, !7, i64 1344}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!"_Bool", !8, i64 0}
!13 = !{!"_agooAtom", !7, i64 0, !8, i64 8}
!14 = !{!6, !12, i64 1084}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!6, !10, i64 1056}
!18 = !{!10, !10, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = !{!6, !11, i64 1064}


; 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._agooLog = type { ptr, [1024 x i8], [16 x i8], ptr, i32, i32, i64, i64, i8, i8, i8, i8, i8, i32, i64, i64, [16 x i8], ptr, ptr, %struct._agooAtom, %struct._agooAtom, %struct._agooAtom, %struct._agooAtom, i32, i32, ptr }
%struct._agooAtom = type { ptr, %union.pthread_mutex_t }
%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 }

@agoo_log = external dso_local global %struct._agooLog, align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
define dso_local void @agoo_log_rotate() local_unnamed_addr #1 {
  %1 = alloca [1060 x i8], align 16
  %2 = alloca [1060 x i8], align 16
  %3 = alloca [32 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 1060, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 1060, ptr nonnull %2) #4
  %4 = load ptr, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1048), align 8, !tbaa !5
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %7, label %5

5:                                                ; preds = %0
  %6 = tail call i32 @fclose(ptr noundef nonnull %4)
  store ptr null, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1048), align 8, !tbaa !5
  br label %7

7:                                                ; preds = %5, %0
  %8 = load i8, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1084), align 4, !tbaa !14, !range !15, !noundef !16
  %9 = trunc nuw i8 %8 to i1
  br i1 %9, label %10, label %26

10:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #4
  %11 = tail call i32 @getpid() #4
  %12 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 1032), i32 noundef %11) #4
  %13 = load i32, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1056), align 8, !tbaa !17
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph12, label %._crit_edge13

.lr.ph12:                                         ; preds = %10, %.lr.ph12
  %.010 = phi i32 [ %21, %.lr.ph12 ], [ %13, %10 ]
  %15 = tail call i32 @getpid() #4
  %16 = add nuw nsw i32 %.010, 1
  %17 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %2, i64 noundef 1059, ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 8), ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 1032), i32 noundef %15, i32 noundef %16) #4
  %18 = tail call i32 @getpid() #4
  %19 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %1, i64 noundef 1059, ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 8), ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 1032), i32 noundef %18, i32 noundef %.010) #4
  %20 = call i32 @rename(ptr noundef nonnull %1, ptr noundef nonnull %2) #4
  %21 = add nsw i32 %.010, -1
  %22 = icmp ugt i32 %.010, 1
  br i1 %22, label %.lr.ph12, label %._crit_edge13, !llvm.loop !18

._crit_edge13:                                    ; preds = %.lr.ph12, %10
  %23 = tail call i32 @getpid() #4
  %24 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %2, i64 noundef 1059, ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 8), ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 1032), i32 noundef %23, i32 noundef 1) #4
  %25 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %1, i64 noundef 1059, ptr noundef nonnull @.str.2, ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 8), ptr noundef nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  br label %37

26:                                               ; preds = %7
  %27 = load i32, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1056), align 8, !tbaa !17
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %26, %.lr.ph
  %.19 = phi i32 [ %33, %.lr.ph ], [ %27, %26 ]
  %29 = add nuw nsw i32 %.19, 1
  %30 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %2, i64 noundef 1059, ptr noundef nonnull @.str.3, ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 8), ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 1032), i32 noundef %29) #4
  %31 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %1, i64 noundef 1059, ptr noundef nonnull @.str.3, ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 8), ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 1032), i32 noundef %.19) #4
  %32 = call i32 @rename(ptr noundef nonnull %1, ptr noundef nonnull %2) #4
  %33 = add nsw i32 %.19, -1
  %34 = icmp ugt i32 %.19, 1
  br i1 %34, label %.lr.ph, label %._crit_edge, !llvm.loop !20

._crit_edge:                                      ; preds = %.lr.ph, %26
  %35 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %2, i64 noundef 1059, ptr noundef nonnull @.str.3, ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 8), ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 1032), i32 noundef 1) #4
  %36 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %1, i64 noundef 1059, ptr noundef nonnull @.str.4, ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 8), ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 1032)) #4
  br label %37

37:                                               ; preds = %._crit_edge, %._crit_edge13
  %38 = call i32 @rename(ptr noundef nonnull %1, ptr noundef nonnull %2) #4
  %39 = call noalias ptr @fopen(ptr noundef nonnull %1, ptr noundef nonnull @.str.5)
  store ptr %39, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1048), align 8, !tbaa !5
  store i64 0, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1064), align 8, !tbaa !21
  call void @remove_old_logs()
  call void @llvm.lifetime.end.p0(i64 1060, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 1060, ptr nonnull %1) #4
  ret void
}

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind
declare i32 @getpid() 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 #2

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @remove_old_logs() local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 1048}
!6 = !{!"_agooLog", !7, i64 0, !8, i64 8, !8, i64 1032, !7, i64 1048, !10, i64 1056, !10, i64 1060, !11, i64 1064, !11, i64 1072, !12, i64 1080, !12, i64 1081, !12, i64 1082, !12, i64 1083, !12, i64 1084, !10, i64 1088, !11, i64 1096, !11, i64 1104, !8, i64 1112, !7, i64 1128, !7, i64 1136, !13, i64 1144, !13, i64 1192, !13, i64 1240, !13, i64 1288, !10, i64 1336, !10, i64 1340, !7, i64 1344}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!"_Bool", !8, i64 0}
!13 = !{!"_agooAtom", !7, i64 0, !8, i64 8}
!14 = !{!6, !12, i64 1084}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!6, !10, i64 1056}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{!6, !11, i64 1064}


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