; LLVM IR from bkaradzic/bgfx :: 3rdparty/fcpp (cpp3)

; 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.Global = type { i32, i32, ptr, ptr, i32, i32, i32, ptr, i32, i32, i32, i32, [513 x i8], ptr, i8, i8, i8, i8, i8, [32 x i8], ptr, [20 x ptr], ptr, [20 x ptr], [20 x i8], i32, [5 x ptr], [5 x ptr], i8, ptr, [1025 x i8], ptr, [31 x ptr], i32, ptr, [64 x ptr], i32, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i8, i8, i8, i8, i8, i8, ptr, i64, i8, i8, i8, i8, i8, i8, ptr, [20 x ptr], i32, i8, i8, i8, ptr }
%struct.defbuf = type { ptr, ptr, i32, i32, [1 x i8] }
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, ptr }

@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@fpp_initdefines.months = external hidden global [12 x [4 x i8]], align 16
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 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

declare ptr @fpp_defendel(ptr noundef, ptr noundef, i32 noundef) #1

declare ptr @fpp_savestring(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @fpp_initdefines(ptr noundef %0) #2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.Global, ptr %11, i32 0, i32 17
  %13 = load i8, ptr %12, align 1, !tbaa !9
  %14 = sext i8 %13 to i32
  %15 = and i32 %14, 1
  %16 = icmp ne i32 %15, 0
  br i1 %16, label %52, label %17

17:                                               ; preds = %1
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.Global, ptr %18, i32 0, i32 26
  %20 = getelementptr inbounds [5 x ptr], ptr %19, i64 0, i64 0
  store ptr %20, ptr %4, align 8, !tbaa !5
  br label %21

21:                                               ; preds = %48, %17
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = load ptr, ptr %22, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %51

25:                                               ; preds = %21
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds ptr, ptr %26, i64 0
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = load i8, ptr %28, align 1, !tbaa !13
  %30 = sext i8 %29 to i32
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %47

32:                                               ; preds = %25
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  %36 = call ptr @fpp_defendel(ptr noundef %33, ptr noundef %35, i32 noundef 0)
  store ptr %36, ptr %6, align 8, !tbaa !5
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = icmp ne ptr %37, null
  br i1 %38, label %40, label %39

39:                                               ; preds = %32
  store i32 1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %143

40:                                               ; preds = %32
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = call ptr @fpp_savestring(ptr noundef %41, ptr noundef @.str.3)
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.defbuf, ptr %43, i32 0, i32 1
  store ptr %42, ptr %44, align 8, !tbaa !14
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.defbuf, ptr %45, i32 0, i32 3
  store i32 -1, ptr %46, align 4, !tbaa !16
  br label %47

47:                                               ; preds = %40, %25
  br label %48

48:                                               ; preds = %47
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds ptr, ptr %49, i32 1
  store ptr %50, ptr %4, align 8, !tbaa !5
  br label %21, !llvm.loop !17

51:                                               ; preds = %21
  br label %52

52:                                               ; preds = %51, %1
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.Global, ptr %53, i32 0, i32 17
  %55 = load i8, ptr %54, align 1, !tbaa !9
  %56 = sext i8 %55 to i32
  %57 = and i32 %56, 2
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %142, label %59

59:                                               ; preds = %52
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.Global, ptr %60, i32 0, i32 27
  %62 = getelementptr inbounds [5 x ptr], ptr %61, i64 0, i64 0
  store ptr %62, ptr %4, align 8, !tbaa !5
  store i32 -1, ptr %8, align 4, !tbaa !19
  br label %63

63:                                               ; preds = %80, %59
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  %66 = icmp ne ptr %65, null
  br i1 %66, label %67, label %83

67:                                               ; preds = %63
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = load ptr, ptr %69, align 8, !tbaa !5
  %71 = call ptr @fpp_defendel(ptr noundef %68, ptr noundef %70, i32 noundef 0)
  store ptr %71, ptr %6, align 8, !tbaa !5
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = icmp ne ptr %72, null
  br i1 %73, label %75, label %74

74:                                               ; preds = %67
  store i32 1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %143

75:                                               ; preds = %67
  %76 = load i32, ptr %8, align 4, !tbaa !19
  %77 = add nsw i32 %76, -1
  store i32 %77, ptr %8, align 4, !tbaa !19
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.defbuf, ptr %78, i32 0, i32 3
  store i32 %77, ptr %79, align 4, !tbaa !16
  br label %80

80:                                               ; preds = %75
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds ptr, ptr %81, i32 1
  store ptr %82, ptr %4, align 8, !tbaa !5
  br label %63, !llvm.loop !20

83:                                               ; preds = %63
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = call ptr @fpp_defendel(ptr noundef %84, ptr noundef @.str.4, i32 noundef 0)
  store ptr %85, ptr %6, align 8, !tbaa !5
  %86 = call noalias ptr @malloc(i64 noundef 32) #6
  store ptr %86, ptr %5, align 8, !tbaa !5
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = icmp ne ptr %87, null
  br i1 %88, label %89, label %92

89:                                               ; preds = %83
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = icmp ne ptr %90, null
  br i1 %91, label %93, label %92

92:                                               ; preds = %89, %83
  store i32 1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %143

93:                                               ; preds = %89
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.defbuf, ptr %95, i32 0, i32 1
  store ptr %94, ptr %96, align 8, !tbaa !14
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.defbuf, ptr %97, i32 0, i32 3
  store i32 -1, ptr %98, align 4, !tbaa !16
  %99 = call i64 @time(ptr noundef %9) #5
  %100 = call ptr @localtime(ptr noundef %9) #5
  store ptr %100, ptr %7, align 8, !tbaa !5
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.tm, ptr %102, i32 0, i32 4
  %104 = load i32, ptr %103, align 8, !tbaa !21
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [12 x [4 x i8]], ptr @fpp_initdefines.months, i64 0, i64 %105
  %107 = getelementptr inbounds [4 x i8], ptr %106, i64 0, i64 0
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.tm, ptr %108, i32 0, i32 3
  %110 = load i32, ptr %109, align 4, !tbaa !23
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.tm, ptr %111, i32 0, i32 5
  %113 = load i32, ptr %112, align 4, !tbaa !24
  %114 = add nsw i32 %113, 1900
  %115 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %101, ptr noundef @.str.5, ptr noundef %107, i32 noundef %110, i32 noundef %114) #5
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = call ptr @fpp_defendel(ptr noundef %116, ptr noundef @.str.6, i32 noundef 0)
  store ptr %117, ptr %6, align 8, !tbaa !5
  %118 = call noalias ptr @malloc(i64 noundef 11) #6
  store ptr %118, ptr %5, align 8, !tbaa !5
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = icmp ne ptr %119, null
  br i1 %120, label %121, label %124

121:                                              ; preds = %93
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %125, label %124

124:                                              ; preds = %121, %93
  store i32 1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %143

125:                                              ; preds = %121
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.defbuf, ptr %127, i32 0, i32 1
  store ptr %126, ptr %128, align 8, !tbaa !14
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.defbuf, ptr %129, i32 0, i32 3
  store i32 -1, ptr %130, align 4, !tbaa !16
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.tm, ptr %132, i32 0, i32 2
  %134 = load i32, ptr %133, align 8, !tbaa !25
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.tm, ptr %135, i32 0, i32 1
  %137 = load i32, ptr %136, align 4, !tbaa !26
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.tm, ptr %138, i32 0, i32 0
  %140 = load i32, ptr %139, align 8, !tbaa !27
  %141 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %131, ptr noundef @.str.7, i32 noundef %134, i32 noundef %137, i32 noundef %140) #5
  br label %142

142:                                              ; preds = %125, %52
  store i32 0, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %143

143:                                              ; preds = %142, %124, %92, %74, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  %144 = load i32, ptr %2, align 4
  ret i32 %144
}

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #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 #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }

!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, !7, i64 595}
!10 = !{!"Global", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16, !11, i64 24, !11, i64 28, !11, i64 32, !6, i64 40, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !7, i64 64, !6, i64 584, !7, i64 592, !7, i64 593, !7, i64 594, !7, i64 595, !7, i64 596, !7, i64 597, !6, i64 632, !7, i64 640, !6, i64 800, !7, i64 808, !7, i64 968, !11, i64 988, !7, i64 992, !7, i64 1032, !7, i64 1072, !6, i64 1080, !7, i64 1088, !6, i64 2120, !7, i64 2128, !11, i64 2376, !6, i64 2384, !7, i64 2392, !11, i64 2904, !6, i64 2912, !6, i64 2920, !6, i64 2928, !6, i64 2936, !6, i64 2944, !6, i64 2952, !7, i64 2960, !7, i64 2961, !7, i64 2962, !7, i64 2963, !7, i64 2964, !7, i64 2965, !7, i64 2966, !7, i64 2967, !6, i64 2968, !12, i64 2976, !7, i64 2984, !7, i64 2985, !7, i64 2986, !7, i64 2987, !7, i64 2988, !7, i64 2989, !6, i64 2992, !7, i64 3000, !11, i64 3160, !7, i64 3164, !7, i64 3165, !7, i64 3166, !6, i64 3168}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !6, i64 8}
!15 = !{!"defbuf", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !7, i64 24}
!16 = !{!15, !11, i64 20}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!11, !11, i64 0}
!20 = distinct !{!20, !18}
!21 = !{!22, !11, i64 16}
!22 = !{!"tm", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !12, i64 40, !6, i64 48}
!23 = !{!22, !11, i64 12}
!24 = !{!22, !11, i64 20}
!25 = !{!22, !11, i64 8}
!26 = !{!22, !11, i64 4}
!27 = !{!22, !11, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@fpp_initdefines.months = external hidden global [12 x [4 x i8]], align 16
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 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

declare ptr @fpp_defendel(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @fpp_savestring(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @fpp_initdefines(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %3 = getelementptr inbounds i8, ptr %0, i64 595
  %4 = load i8, ptr %3, align 1, !tbaa !5
  %5 = and i8 %4, 1
  %.not = icmp eq i8 %5, 0
  br i1 %.not, label %6, label %.loopexit59

6:                                                ; preds = %1
  %7 = getelementptr inbounds i8, ptr %0, i64 992
  %8 = load ptr, ptr %7, align 8, !tbaa !12
  %.not5361 = icmp eq ptr %8, null
  br i1 %.not5361, label %.loopexit59, label %.lr.ph

.lr.ph:                                           ; preds = %6, %17
  %9 = phi ptr [ %19, %17 ], [ %8, %6 ]
  %.04462 = phi ptr [ %18, %17 ], [ %7, %6 ]
  %10 = load i8, ptr %9, align 1, !tbaa !13
  %.not54 = icmp eq i8 %10, 0
  br i1 %.not54, label %17, label %11

11:                                               ; preds = %.lr.ph
  %12 = tail call ptr @fpp_defendel(ptr noundef %0, ptr noundef nonnull %9, i32 noundef 0) #6
  %.not55 = icmp eq ptr %12, null
  br i1 %.not55, label %.loopexit, label %13

13:                                               ; preds = %11
  %14 = tail call ptr @fpp_savestring(ptr noundef %0, ptr noundef nonnull @.str.3) #6
  %15 = getelementptr inbounds i8, ptr %12, i64 8
  store ptr %14, ptr %15, align 8, !tbaa !14
  %16 = getelementptr inbounds i8, ptr %12, i64 20
  store i32 -1, ptr %16, align 4, !tbaa !16
  br label %17

17:                                               ; preds = %.lr.ph, %13
  %18 = getelementptr inbounds i8, ptr %.04462, i64 8
  %19 = load ptr, ptr %18, align 8, !tbaa !12
  %.not53 = icmp eq ptr %19, null
  br i1 %.not53, label %.loopexit59.loopexit, label %.lr.ph, !llvm.loop !17

.loopexit59.loopexit:                             ; preds = %17
  %.pre = load i8, ptr %3, align 1, !tbaa !5
  br label %.loopexit59

.loopexit59:                                      ; preds = %.loopexit59.loopexit, %6, %1
  %20 = phi i8 [ %.pre, %.loopexit59.loopexit ], [ %4, %6 ], [ %4, %1 ]
  %21 = and i8 %20, 2
  %.not56 = icmp eq i8 %21, 0
  br i1 %.not56, label %22, label %.loopexit

22:                                               ; preds = %.loopexit59
  %23 = getelementptr inbounds i8, ptr %0, i64 1032
  %24 = load ptr, ptr %23, align 8, !tbaa !12
  %.not5763 = icmp eq ptr %24, null
  br i1 %.not5763, label %._crit_edge, label %.lr.ph66

.lr.ph66:                                         ; preds = %22, %27
  %25 = phi ptr [ %31, %27 ], [ %24, %22 ]
  %.065 = phi i32 [ %28, %27 ], [ -1, %22 ]
  %.164 = phi ptr [ %30, %27 ], [ %23, %22 ]
  %26 = tail call ptr @fpp_defendel(ptr noundef %0, ptr noundef nonnull %25, i32 noundef 0) #6
  %.not58 = icmp eq ptr %26, null
  br i1 %.not58, label %.loopexit, label %27

27:                                               ; preds = %.lr.ph66
  %28 = add nsw i32 %.065, -1
  %29 = getelementptr inbounds i8, ptr %26, i64 20
  store i32 %28, ptr %29, align 4, !tbaa !16
  %30 = getelementptr inbounds i8, ptr %.164, i64 8
  %31 = load ptr, ptr %30, align 8, !tbaa !12
  %.not57 = icmp eq ptr %31, null
  br i1 %.not57, label %._crit_edge, label %.lr.ph66, !llvm.loop !19

._crit_edge:                                      ; preds = %27, %22
  %32 = tail call ptr @fpp_defendel(ptr noundef %0, ptr noundef nonnull @.str.4, i32 noundef 0) #6
  %33 = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #7
  %34 = icmp ne ptr %33, null
  %35 = icmp ne ptr %32, null
  %or.cond = select i1 %34, i1 %35, i1 false
  br i1 %or.cond, label %36, label %.loopexit

36:                                               ; preds = %._crit_edge
  %37 = getelementptr inbounds i8, ptr %32, i64 8
  store ptr %33, ptr %37, align 8, !tbaa !14
  %38 = getelementptr inbounds i8, ptr %32, i64 20
  store i32 -1, ptr %38, align 4, !tbaa !16
  %39 = call i64 @time(ptr noundef nonnull %2) #6
  %40 = call ptr @localtime(ptr noundef nonnull %2) #6
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  %42 = load i32, ptr %41, align 8, !tbaa !20
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [12 x [4 x i8]], ptr @fpp_initdefines.months, i64 0, i64 %43
  %45 = getelementptr inbounds i8, ptr %40, i64 12
  %46 = load i32, ptr %45, align 4, !tbaa !22
  %47 = getelementptr inbounds i8, ptr %40, i64 20
  %48 = load i32, ptr %47, align 4, !tbaa !23
  %49 = add nsw i32 %48, 1900
  %50 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %33, ptr noundef nonnull dereferenceable(1) @.str.5, ptr noundef nonnull %44, i32 noundef %46, i32 noundef %49) #6
  %51 = call ptr @fpp_defendel(ptr noundef %0, ptr noundef nonnull @.str.6, i32 noundef 0) #6
  %52 = call noalias dereferenceable_or_null(11) ptr @malloc(i64 noundef 11) #7
  %53 = icmp ne ptr %52, null
  %54 = icmp ne ptr %51, null
  %or.cond3 = select i1 %53, i1 %54, i1 false
  br i1 %or.cond3, label %55, label %.loopexit

55:                                               ; preds = %36
  %56 = getelementptr inbounds i8, ptr %51, i64 8
  store ptr %52, ptr %56, align 8, !tbaa !14
  %57 = getelementptr inbounds i8, ptr %51, i64 20
  store i32 -1, ptr %57, align 4, !tbaa !16
  %58 = getelementptr inbounds i8, ptr %40, i64 8
  %59 = load i32, ptr %58, align 8, !tbaa !24
  %60 = getelementptr inbounds i8, ptr %40, i64 4
  %61 = load i32, ptr %60, align 4, !tbaa !25
  %62 = load i32, ptr %40, align 8, !tbaa !26
  %63 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %52, ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %59, i32 noundef %61, i32 noundef %62) #6
  br label %.loopexit

.loopexit:                                        ; preds = %11, %.lr.ph66, %.loopexit59, %55, %36, %._crit_edge
  %.043 = phi i32 [ 1, %._crit_edge ], [ 1, %36 ], [ 0, %55 ], [ 0, %.loopexit59 ], [ 1, %.lr.ph66 ], [ 1, %11 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  ret i32 %.043
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #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 #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) 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 #4 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

!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, !8, i64 595}
!6 = !{!"Global", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !7, i64 24, !7, i64 28, !7, i64 32, !10, i64 40, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !8, i64 64, !10, i64 584, !8, i64 592, !8, i64 593, !8, i64 594, !8, i64 595, !8, i64 596, !8, i64 597, !10, i64 632, !8, i64 640, !10, i64 800, !8, i64 808, !8, i64 968, !7, i64 988, !8, i64 992, !8, i64 1032, !8, i64 1072, !10, i64 1080, !8, i64 1088, !10, i64 2120, !8, i64 2128, !7, i64 2376, !10, i64 2384, !8, i64 2392, !7, i64 2904, !10, i64 2912, !10, i64 2920, !10, i64 2928, !10, i64 2936, !10, i64 2944, !10, i64 2952, !8, i64 2960, !8, i64 2961, !8, i64 2962, !8, i64 2963, !8, i64 2964, !8, i64 2965, !8, i64 2966, !8, i64 2967, !10, i64 2968, !11, i64 2976, !8, i64 2984, !8, i64 2985, !8, i64 2986, !8, i64 2987, !8, i64 2988, !8, i64 2989, !10, i64 2992, !8, i64 3000, !7, i64 3160, !8, i64 3164, !8, i64 3165, !8, i64 3166, !10, i64 3168}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!10, !10, i64 0}
!13 = !{!8, !8, i64 0}
!14 = !{!15, !10, i64 8}
!15 = !{!"defbuf", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 20, !8, i64 24}
!16 = !{!15, !7, i64 20}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = !{!21, !7, i64 16}
!21 = !{!"tm", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !11, i64 40, !10, i64 48}
!22 = !{!21, !7, i64 12}
!23 = !{!21, !7, i64 20}
!24 = !{!21, !7, i64 8}
!25 = !{!21, !7, i64 4}
!26 = !{!21, !7, i64 0}


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