; 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 }
%struct._agooLogCat = type { ptr, [32 x i8], ptr, i32, i8 }
%struct._agooLogEntry = type { ptr, i64, ptr, [104 x i8], i8, ptr, [40 x i8] }

@agoo_log = external dso_local global %struct._agooLog, align 8
@.str.12 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [61 x i8], align 1
@agoo_fatal_cat = external dso_local global %struct._agooLogCat, align 8
@.str.14 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [4 x i8], align 1
@agoo_error_cat = external dso_local global %struct._agooLogCat, align 8
@.str.16 = external hidden unnamed_addr constant [6 x i8], align 1
@agoo_warn_cat = external dso_local global %struct._agooLogCat, align 8
@.str.17 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [7 x i8], align 1
@agoo_info_cat = external dso_local global %struct._agooLogCat, align 8
@.str.19 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [6 x i8], align 1
@agoo_debug_cat = external dso_local global %struct._agooLogCat, align 8
@.str.21 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [5 x i8], align 1
@agoo_con_cat = external dso_local global %struct._agooLogCat, align 8
@.str.23 = external hidden unnamed_addr constant [8 x i8], align 1
@agoo_req_cat = external dso_local global %struct._agooLogCat, align 8
@.str.24 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [5 x i8], align 1
@agoo_resp_cat = external dso_local global %struct._agooLogCat, align 8
@.str.26 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [10 x i8], align 1
@agoo_eval_cat = external dso_local global %struct._agooLogCat, align 8
@.str.28 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [5 x i8], align 1
@agoo_push_cat = external dso_local global %struct._agooLogCat, align 8
@.str.30 = external hidden unnamed_addr constant [5 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
declare dso_local void @agoo_log_cat_reg(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i1 noundef zeroext) #1

; Function Attrs: nounwind
declare ptr @strncpy(ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @agoo_log_init(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %10 = call i64 @time(ptr noundef null) #6
  store i64 %10, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %11 = call ptr @localtime(ptr noundef %6) #6
  store ptr %11, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1024, ptr %8, align 4, !tbaa !11
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = call ptr @strncpy(ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 2), ptr noundef %12, i64 noundef 16) #6
  store i8 0, ptr getelementptr inbounds ([16 x i8], ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 2), i64 0, i64 15), align 1, !tbaa !13
  store ptr null, ptr @agoo_log, align 8, !tbaa !14
  store i8 0, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 1), align 8, !tbaa !13
  store ptr null, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 3), align 8, !tbaa !18
  store i32 3, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 4), align 8, !tbaa !19
  store i32 100000000, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 5), align 4, !tbaa !20
  store i64 0, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 6), align 8, !tbaa !21
  store volatile i8 0, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 8), align 8, !tbaa !22
  store i8 1, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 9), align 1, !tbaa !23
  store i8 1, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 10), align 2, !tbaa !24
  store i8 1, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 11), align 1, !tbaa !25
  store i8 0, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 12), align 4, !tbaa !26
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  %15 = call i64 @timegm(ptr noundef %14) #6
  %16 = load i64, ptr %6, align 8, !tbaa !9
  %17 = sub nsw i64 %15, %16
  %18 = trunc i64 %17 to i32
  store i32 %18, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 13), align 8, !tbaa !27
  store i64 0, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 14), align 8, !tbaa !28
  store i64 0, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 15), align 8, !tbaa !29
  store i8 0, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 16), align 8, !tbaa !13
  store i64 0, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 7), align 8, !tbaa !30
  %19 = load i32, ptr %8, align 4, !tbaa !11
  %20 = sext i32 %19 to i64
  %21 = call noalias ptr @calloc(i64 noundef %20, i64 noundef 184) #7
  store ptr %21, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 17), align 8, !tbaa !31
  %22 = icmp eq ptr null, %21
  br i1 %22, label %23, label %26

23:                                               ; preds = %2
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = call i32 @agoo_err_memory(ptr noundef %24, ptr noundef @.str.12, ptr noundef @.str.13, i32 noundef 619)
  store i32 %25, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %34

26:                                               ; preds = %2
  %27 = load ptr, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 17), align 8, !tbaa !31
  %28 = load i32, ptr %8, align 4, !tbaa !11
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds %struct._agooLogEntry, ptr %27, i64 %29
  store ptr %30, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 18), align 8, !tbaa !32
  %31 = load ptr, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 17), align 8, !tbaa !31
  call void @atomic_init(ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 19), ptr noundef %31)
  %32 = load ptr, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 17), align 8, !tbaa !31
  %33 = getelementptr inbounds %struct._agooLogEntry, ptr %32, i64 1
  call void @atomic_init(ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 20), ptr noundef %33)
  call void @agoo_atomic_flag_init(ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 21))
  call void @atomic_init(ptr noundef getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 22), ptr noundef null)
  store i32 0, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 23), align 8, !tbaa !33
  store i32 0, ptr getelementptr inbounds (%struct._agooLog, ptr @agoo_log, i32 0, i32 24), align 4, !tbaa !34
  call void @agoo_log_cat_reg(ptr noundef @agoo_fatal_cat, ptr noundef @.str.14, i32 noundef 0, ptr noundef @.str.15, i1 noundef zeroext true)
  call void @agoo_log_cat_reg(ptr noundef @agoo_error_cat, ptr noundef @.str.16, i32 noundef 1, ptr noundef @.str.15, i1 noundef zeroext true)
  call void @agoo_log_cat_reg(ptr noundef @agoo_warn_cat, ptr noundef @.str.17, i32 noundef 2, ptr noundef @.str.18, i1 noundef zeroext true)
  call void @agoo_log_cat_reg(ptr noundef @agoo_info_cat, ptr noundef @.str.19, i32 noundef 3, ptr noundef @.str.20, i1 noundef zeroext true)
  call void @agoo_log_cat_reg(ptr noundef @agoo_debug_cat, ptr noundef @.str.21, i32 noundef 4, ptr noundef @.str.22, i1 noundef zeroext false)
  call void @agoo_log_cat_reg(ptr noundef @agoo_con_cat, ptr noundef @.str.23, i32 noundef 3, ptr noundef @.str.20, i1 noundef zeroext false)
  call void @agoo_log_cat_reg(ptr noundef @agoo_req_cat, ptr noundef @.str.24, i32 noundef 3, ptr noundef @.str.25, i1 noundef zeroext false)
  call void @agoo_log_cat_reg(ptr noundef @agoo_resp_cat, ptr noundef @.str.26, i32 noundef 3, ptr noundef @.str.27, i1 noundef zeroext false)
  call void @agoo_log_cat_reg(ptr noundef @agoo_eval_cat, ptr noundef @.str.28, i32 noundef 3, ptr noundef @.str.29, i1 noundef zeroext false)
  call void @agoo_log_cat_reg(ptr noundef @agoo_push_cat, ptr noundef @.str.30, i32 noundef 3, ptr noundef @.str.27, i1 noundef zeroext false)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %34

34:                                               ; preds = %26, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %35 = load i32, ptr %3, align 4
  ret i32 %35
}

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #2

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

; Function Attrs: nounwind
declare i64 @timegm(ptr noundef) #2

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #3

declare i32 @agoo_err_memory(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @atomic_init(ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @agoo_atomic_flag_init(ptr noundef) #5

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 = { 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 allocsize(0,1) "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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint 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 }
attributes #7 = { nounwind allocsize(0,1) }

!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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"_agooLog", !6, i64 0, !7, i64 8, !7, i64 1032, !6, i64 1048, !12, i64 1056, !12, i64 1060, !10, i64 1064, !10, i64 1072, !16, i64 1080, !16, i64 1081, !16, i64 1082, !16, i64 1083, !16, i64 1084, !12, i64 1088, !10, i64 1096, !10, i64 1104, !7, i64 1112, !6, i64 1128, !6, i64 1136, !17, i64 1144, !17, i64 1192, !17, i64 1240, !17, i64 1288, !12, i64 1336, !12, i64 1340, !6, i64 1344}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{!"_agooAtom", !6, i64 0, !7, i64 8}
!18 = !{!15, !6, i64 1048}
!19 = !{!15, !12, i64 1056}
!20 = !{!15, !12, i64 1060}
!21 = !{!15, !10, i64 1064}
!22 = !{!15, !16, i64 1080}
!23 = !{!15, !16, i64 1081}
!24 = !{!15, !16, i64 1082}
!25 = !{!15, !16, i64 1083}
!26 = !{!15, !16, i64 1084}
!27 = !{!15, !12, i64 1088}
!28 = !{!15, !10, i64 1096}
!29 = !{!15, !10, i64 1104}
!30 = !{!15, !10, i64 1072}
!31 = !{!15, !6, i64 1128}
!32 = !{!15, !6, i64 1136}
!33 = !{!15, !12, i64 1336}
!34 = !{!15, !12, i64 1340}


; 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 }
%struct._agooLogCat = type { ptr, [32 x i8], ptr, i32, i8 }

@agoo_log = external dso_local global %struct._agooLog, align 8
@.str.12 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [61 x i8], align 1
@agoo_fatal_cat = external dso_local global %struct._agooLogCat, align 8
@.str.14 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [4 x i8], align 1
@agoo_error_cat = external dso_local global %struct._agooLogCat, align 8
@.str.16 = external hidden unnamed_addr constant [6 x i8], align 1
@agoo_warn_cat = external dso_local global %struct._agooLogCat, align 8
@.str.17 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [7 x i8], align 1
@agoo_info_cat = external dso_local global %struct._agooLogCat, align 8
@.str.19 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [6 x i8], align 1
@agoo_debug_cat = external dso_local global %struct._agooLogCat, align 8
@.str.21 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [5 x i8], align 1
@agoo_con_cat = external dso_local global %struct._agooLogCat, align 8
@.str.23 = external hidden unnamed_addr constant [8 x i8], align 1
@agoo_req_cat = external dso_local global %struct._agooLogCat, align 8
@.str.24 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [5 x i8], align 1
@agoo_resp_cat = external dso_local global %struct._agooLogCat, align 8
@.str.26 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [10 x i8], align 1
@agoo_eval_cat = external dso_local global %struct._agooLogCat, align 8
@.str.28 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [5 x i8], align 1
@agoo_push_cat = external dso_local global %struct._agooLogCat, align 8
@.str.30 = external hidden unnamed_addr constant [5 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
declare dso_local void @agoo_log_cat_reg(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i32 @agoo_log_init(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #1 {
  %3 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %4 = tail call i64 @time(ptr noundef null) #8
  store i64 %4, ptr %3, align 8, !tbaa !5
  %5 = call ptr @localtime(ptr noundef nonnull %3) #8
  %6 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @agoo_log, i64 1032), ptr noundef nonnull dereferenceable(1) %1, i64 noundef 16) #8
  store i8 0, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1047), align 1, !tbaa !9
  store ptr null, ptr @agoo_log, align 8, !tbaa !10
  store i8 0, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 8), align 8, !tbaa !9
  store ptr null, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1048), align 8, !tbaa !16
  store i32 3, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1056), align 8, !tbaa !17
  store i32 100000000, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1060), align 4, !tbaa !18
  store i64 0, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1064), align 8, !tbaa !19
  store volatile i8 0, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1080), align 8, !tbaa !20
  store <4 x i8> <i8 1, i8 1, i8 1, i8 0>, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1081), align 1, !tbaa !21
  %7 = call i64 @timegm(ptr noundef %5) #8
  %8 = load i64, ptr %3, align 8, !tbaa !5
  %9 = sub nsw i64 %7, %8
  %10 = trunc i64 %9 to i32
  store i32 %10, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1088), align 8, !tbaa !22
  store i64 0, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1072), align 8, !tbaa !23
  %11 = call noalias dereferenceable_or_null(188416) ptr @calloc(i64 noundef 1024, i64 noundef 184) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(17) getelementptr inbounds (i8, ptr @agoo_log, i64 1096), i8 0, i64 17, i1 false)
  store ptr %11, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1128), align 8, !tbaa !24
  %12 = icmp eq ptr %11, null
  br i1 %12, label %13, label %15

13:                                               ; preds = %2
  %14 = call i32 @agoo_err_memory(ptr noundef %0, ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.13, i32 noundef 619) #8
  br label %19

15:                                               ; preds = %2
  %16 = getelementptr inbounds i8, ptr %11, i64 188416
  store ptr %16, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1136), align 8, !tbaa !25
  call void @atomic_init(ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 1144), ptr noundef nonnull %11)
  %17 = load ptr, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1128), align 8, !tbaa !24
  %18 = getelementptr inbounds i8, ptr %17, i64 184
  call void @atomic_init(ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 1192), ptr noundef nonnull %18)
  call void @agoo_atomic_flag_init(ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 1240))
  call void @atomic_init(ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_log, i64 1288), ptr noundef null)
  store i32 0, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1336), align 8, !tbaa !26
  store i32 0, ptr getelementptr inbounds (i8, ptr @agoo_log, i64 1340), align 4, !tbaa !27
  call void @agoo_log_cat_reg(ptr noundef nonnull @agoo_fatal_cat, ptr noundef nonnull @.str.14, i32 noundef 0, ptr noundef nonnull @.str.15, i1 noundef zeroext true)
  call void @agoo_log_cat_reg(ptr noundef nonnull @agoo_error_cat, ptr noundef nonnull @.str.16, i32 noundef 1, ptr noundef nonnull @.str.15, i1 noundef zeroext true)
  call void @agoo_log_cat_reg(ptr noundef nonnull @agoo_warn_cat, ptr noundef nonnull @.str.17, i32 noundef 2, ptr noundef nonnull @.str.18, i1 noundef zeroext true)
  call void @agoo_log_cat_reg(ptr noundef nonnull @agoo_info_cat, ptr noundef nonnull @.str.19, i32 noundef 3, ptr noundef nonnull @.str.20, i1 noundef zeroext true)
  call void @agoo_log_cat_reg(ptr noundef nonnull @agoo_debug_cat, ptr noundef nonnull @.str.21, i32 noundef 4, ptr noundef nonnull @.str.22, i1 noundef zeroext false)
  call void @agoo_log_cat_reg(ptr noundef nonnull @agoo_con_cat, ptr noundef nonnull @.str.23, i32 noundef 3, ptr noundef nonnull @.str.20, i1 noundef zeroext false)
  call void @agoo_log_cat_reg(ptr noundef nonnull @agoo_req_cat, ptr noundef nonnull @.str.24, i32 noundef 3, ptr noundef nonnull @.str.25, i1 noundef zeroext false)
  call void @agoo_log_cat_reg(ptr noundef nonnull @agoo_resp_cat, ptr noundef nonnull @.str.26, i32 noundef 3, ptr noundef nonnull @.str.27, i1 noundef zeroext false)
  call void @agoo_log_cat_reg(ptr noundef nonnull @agoo_eval_cat, ptr noundef nonnull @.str.28, i32 noundef 3, ptr noundef nonnull @.str.29, i1 noundef zeroext false)
  call void @agoo_log_cat_reg(ptr noundef nonnull @agoo_push_cat, ptr noundef nonnull @.str.30, i32 noundef 3, ptr noundef nonnull @.str.27, i1 noundef zeroext false)
  br label %19

19:                                               ; preds = %15, %13
  %.0 = phi i32 [ %14, %13 ], [ 0, %15 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  ret i32 %.0
}

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare ptr @localtime(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i64 @timegm(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #4

declare i32 @agoo_err_memory(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @atomic_init(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @agoo_atomic_flag_init(ptr noundef) local_unnamed_addr #6

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

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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 = { inlinehint 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0,1) }

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !12, i64 0}
!11 = !{!"_agooLog", !12, i64 0, !7, i64 8, !7, i64 1032, !12, i64 1048, !13, i64 1056, !13, i64 1060, !6, i64 1064, !6, i64 1072, !14, i64 1080, !14, i64 1081, !14, i64 1082, !14, i64 1083, !14, i64 1084, !13, i64 1088, !6, i64 1096, !6, i64 1104, !7, i64 1112, !12, i64 1128, !12, i64 1136, !15, i64 1144, !15, i64 1192, !15, i64 1240, !15, i64 1288, !13, i64 1336, !13, i64 1340, !12, i64 1344}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!"_agooAtom", !12, i64 0, !7, i64 8}
!16 = !{!11, !12, i64 1048}
!17 = !{!11, !13, i64 1056}
!18 = !{!11, !13, i64 1060}
!19 = !{!11, !6, i64 1064}
!20 = !{!11, !14, i64 1080}
!21 = !{!14, !14, i64 0}
!22 = !{!11, !13, i64 1088}
!23 = !{!11, !6, i64 1072}
!24 = !{!11, !12, i64 1128}
!25 = !{!11, !12, i64 1136}
!26 = !{!11, !13, i64 1336}
!27 = !{!11, !13, i64 1340}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,TailCallElimPass