; LLVM IR from gem5/gem5 :: ext/systemc/src/sysc/tracing/sc_wif_trace.ll (ZN7sc_core14wif_trace_file5cycleEb)

; 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"

%"class.sc_core::sc_trace_file_base" = type <{ %"class.sc_core::sc_trace_file", ptr, double, i8, [7 x i8], %"class.std::__cxx11::basic_string", i8, i8, [6 x i8] }>
%"class.sc_core::sc_trace_file" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.sc_core::wif_trace_file" = type { %"class.sc_core::sc_trace_file_base.base", i32, i32, i32, double, %"class.std::vector.0" }
%"class.sc_core::sc_trace_file_base.base" = type <{ %"class.sc_core::sc_trace_file", ptr, double, i8, [7 x i8], %"class.std::__cxx11::basic_string", i8, i8 }>
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<sc_core::wif_trace *, std::allocator<sc_core::wif_trace *>>::_Vector_impl" }
%"struct.std::_Vector_base<sc_core::wif_trace *, std::allocator<sc_core::wif_trace *>>::_Vector_impl" = type { %"struct.std::_Vector_base<sc_core::wif_trace *, std::allocator<sc_core::wif_trace *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sc_core::wif_trace *, std::allocator<sc_core::wif_trace *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.49 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [17 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
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIPN7sc_core9wif_traceESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7sc_core9wif_traceESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN7sc_core13sc_time_stampEv() #3

declare noundef double @_ZNK7sc_core7sc_time10to_secondsEv(ptr noundef nonnull align 8 dereferenceable(8)) #3

declare void @_ZN7sc_core23double_to_special_int64EdPjS0_(double noundef, ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7sc_core14wif_trace_file5cycleEb(ptr noundef nonnull align 8 dereferenceable(112) %0, i1 noundef zeroext %1) unnamed_addr #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca i8, align 1
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %16 = zext i1 %1 to i8
  store i8 %16, ptr %4, align 1, !tbaa !9
  %17 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %18 = call noundef zeroext i1 @_ZNK7sc_core18sc_trace_file_base12delta_cyclesEv(ptr noundef nonnull align 8 dereferenceable(66) %17)
  br i1 %18, label %23, label %19

19:                                               ; preds = %2
  %20 = load i8, ptr %4, align 1, !tbaa !9, !range !11, !noundef !12
  %21 = trunc i8 %20 to i1
  br i1 %21, label %22, label %23

22:                                               ; preds = %19
  store i32 1, ptr %7, align 4
  br label %112

23:                                               ; preds = %19, %2
  %24 = call noundef zeroext i1 @_ZN7sc_core18sc_trace_file_base10initializeEv(ptr noundef nonnull align 8 dereferenceable(66) %17)
  br i1 %24, label %25, label %26

25:                                               ; preds = %23
  store i32 1, ptr %7, align 4
  br label %112

26:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7sc_core13sc_time_stampEv()
  %28 = call noundef double @_ZNK7sc_core7sc_time10to_secondsEv(ptr noundef nonnull align 8 dereferenceable(8) %27)
  %29 = getelementptr inbounds %"class.sc_core::sc_trace_file_base", ptr %17, i32 0, i32 2
  %30 = load double, ptr %29, align 8, !tbaa !13
  %31 = fdiv double %28, %30
  store double %31, ptr %8, align 8, !tbaa !20
  %32 = load double, ptr %8, align 8, !tbaa !20
  call void @_ZN7sc_core23double_to_special_int64EdPjS0_(double noundef %32, ptr noundef %5, ptr noundef %6)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %33 = load double, ptr %8, align 8, !tbaa !20
  %34 = getelementptr inbounds %"class.sc_core::wif_trace_file", ptr %17, i32 0, i32 4
  %35 = load double, ptr %34, align 8, !tbaa !21
  %36 = fsub double %33, %35
  store double %36, ptr %11, align 8, !tbaa !20
  %37 = load double, ptr %11, align 8, !tbaa !20
  call void @_ZN7sc_core23double_to_special_int64EdPjS0_(double noundef %37, ptr noundef %9, ptr noundef %10)
  %38 = load i8, ptr %4, align 1, !tbaa !9, !range !11, !noundef !12
  %39 = trunc i8 %38 to i1
  br i1 %39, label %40, label %46

40:                                               ; preds = %26
  %41 = load double, ptr %11, align 8, !tbaa !20
  %42 = fcmp oeq double %41, 0.000000e+00
  br i1 %42, label %43, label %46

43:                                               ; preds = %40
  %44 = load i32, ptr %10, align 4, !tbaa !28
  %45 = add i32 %44, 1
  store i32 %45, ptr %10, align 4, !tbaa !28
  br label %46

46:                                               ; preds = %43, %40, %26
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #5
  store i8 0, ptr %12, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %47 = getelementptr inbounds %"class.sc_core::wif_trace_file", ptr %17, i32 0, i32 5
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7sc_core9wif_traceESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %47, i64 noundef 0) #5
  store ptr %48, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !28
  br label %49

49:                                               ; preds = %95, %46
  %50 = load i32, ptr %14, align 4, !tbaa !28
  %51 = getelementptr inbounds %"class.sc_core::wif_trace_file", ptr %17, i32 0, i32 5
  %52 = call noundef i64 @_ZNKSt6vectorIPN7sc_core9wif_traceESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %51) #5
  %53 = trunc i64 %52 to i32
  %54 = icmp slt i32 %50, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %49
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %98

56:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %57 = load ptr, ptr %13, align 8, !tbaa !5
  %58 = load i32, ptr %14, align 4, !tbaa !28
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds ptr, ptr %57, i64 %59
  %61 = load ptr, ptr %60, align 8, !tbaa !5
  store ptr %61, ptr %15, align 8, !tbaa !5
  %62 = load ptr, ptr %15, align 8, !tbaa !5
  %63 = load ptr, ptr %62, align 8, !tbaa !29
  %64 = getelementptr inbounds ptr, ptr %63, i64 2
  %65 = load ptr, ptr %64, align 8
  %66 = call noundef zeroext i1 %65(ptr noundef nonnull align 8 dereferenceable(84) %62)
  br i1 %66, label %67, label %94

67:                                               ; preds = %56
  %68 = load i8, ptr %12, align 1, !tbaa !9, !range !11, !noundef !12
  %69 = trunc i8 %68 to i1
  %70 = zext i1 %69 to i32
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %87

72:                                               ; preds = %67
  %73 = load i32, ptr %9, align 4, !tbaa !28
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %81

75:                                               ; preds = %72
  %76 = getelementptr inbounds %"class.sc_core::sc_trace_file_base", ptr %17, i32 0, i32 1
  %77 = load ptr, ptr %76, align 8, !tbaa !31
  %78 = load i32, ptr %9, align 4, !tbaa !28
  %79 = load i32, ptr %10, align 4, !tbaa !28
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef @.str.52, i32 noundef %78, i32 noundef %79) #5
  br label %86

81:                                               ; preds = %72
  %82 = getelementptr inbounds %"class.sc_core::sc_trace_file_base", ptr %17, i32 0, i32 1
  %83 = load ptr, ptr %82, align 8, !tbaa !31
  %84 = load i32, ptr %10, align 4, !tbaa !28
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef @.str.53, i32 noundef %84) #5
  br label %86

86:                                               ; preds = %81, %75
  store i8 1, ptr %12, align 1, !tbaa !9
  br label %87

87:                                               ; preds = %86, %67
  %88 = load ptr, ptr %15, align 8, !tbaa !5
  %89 = getelementptr inbounds %"class.sc_core::sc_trace_file_base", ptr %17, i32 0, i32 1
  %90 = load ptr, ptr %89, align 8, !tbaa !31
  %91 = load ptr, ptr %88, align 8, !tbaa !29
  %92 = getelementptr inbounds ptr, ptr %91, i64 0
  %93 = load ptr, ptr %92, align 8
  call void %93(ptr noundef nonnull align 8 dereferenceable(84) %88, ptr noundef %90)
  br label %94

94:                                               ; preds = %87, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %95

95:                                               ; preds = %94
  %96 = load i32, ptr %14, align 4, !tbaa !28
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %14, align 4, !tbaa !28
  br label %49, !llvm.loop !32

98:                                               ; preds = %55
  %99 = load i8, ptr %12, align 1, !tbaa !9, !range !11, !noundef !12
  %100 = trunc i8 %99 to i1
  br i1 %100, label %101, label %111

101:                                              ; preds = %98
  %102 = getelementptr inbounds %"class.sc_core::sc_trace_file_base", ptr %17, i32 0, i32 1
  %103 = load ptr, ptr %102, align 8, !tbaa !31
  %104 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %103, ptr noundef @.str.49) #5
  %105 = load i32, ptr %5, align 4, !tbaa !28
  %106 = getelementptr inbounds %"class.sc_core::wif_trace_file", ptr %17, i32 0, i32 3
  store i32 %105, ptr %106, align 4, !tbaa !34
  %107 = load i32, ptr %6, align 4, !tbaa !28
  %108 = getelementptr inbounds %"class.sc_core::wif_trace_file", ptr %17, i32 0, i32 2
  store i32 %107, ptr %108, align 8, !tbaa !35
  %109 = load double, ptr %8, align 8, !tbaa !20
  %110 = getelementptr inbounds %"class.sc_core::wif_trace_file", ptr %17, i32 0, i32 4
  store double %109, ptr %110, align 8, !tbaa !21
  br label %111

111:                                              ; preds = %101, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  store i32 0, ptr %7, align 4
  br label %112

112:                                              ; preds = %111, %25, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  %113 = load i32, ptr %7, align 4
  switch i32 %113, label %115 [
    i32 0, label %114
    i32 1, label %114
  ]

114:                                              ; preds = %112, %112
  ret void

115:                                              ; preds = %112
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7sc_core18sc_trace_file_base12delta_cyclesEv(ptr noundef nonnull align 8 dereferenceable(66)) #2 align 2

declare noundef zeroext i1 @_ZN7sc_core18sc_trace_file_base10initializeEv(ptr noundef nonnull align 8 dereferenceable(66)) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress 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 = { "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 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 #5 = { 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !16, i64 16}
!14 = !{!"_ZTSN7sc_core18sc_trace_file_baseE", !15, i64 0, !6, i64 8, !16, i64 16, !10, i64 24, !17, i64 32, !10, i64 64, !10, i64 65}
!15 = !{!"_ZTSN7sc_core13sc_trace_fileE"}
!16 = !{!"double", !7, i64 0}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !18, i64 0, !19, i64 8, !7, i64 16}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!16, !16, i64 0}
!21 = !{!22, !16, i64 80}
!22 = !{!"_ZTSN7sc_core14wif_trace_fileE", !14, i64 0, !23, i64 68, !23, i64 72, !23, i64 76, !16, i64 80, !24, i64 88}
!23 = !{!"int", !7, i64 0}
!24 = !{!"_ZTSSt6vectorIPN7sc_core9wif_traceESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIPN7sc_core9wif_traceESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIPN7sc_core9wif_traceESaIS2_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIPN7sc_core9wif_traceESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!28 = !{!23, !23, i64 0}
!29 = !{!30, !30, i64 0}
!30 = !{!"vtable pointer", !8, i64 0}
!31 = !{!14, !6, i64 8}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!22, !23, i64 76}
!35 = !{!22, !23, i64 72}


; 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.49 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [17 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: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIPN7sc_core9wif_traceESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7sc_core9wif_traceESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN7sc_core13sc_time_stampEv() local_unnamed_addr #3

declare noundef double @_ZNK7sc_core7sc_time10to_secondsEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

declare void @_ZN7sc_core23double_to_special_int64EdPjS0_(double noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7sc_core14wif_trace_file5cycleEb(ptr noundef nonnull align 8 dereferenceable(112) %0, i1 noundef zeroext %1) unnamed_addr #4 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %7 = tail call noundef zeroext i1 @_ZNK7sc_core18sc_trace_file_base12delta_cyclesEv(ptr noundef nonnull align 8 dereferenceable(66) %0)
  %.not18 = xor i1 %1, true
  %brmerge = or i1 %7, %.not18
  br i1 %brmerge, label %8, label %65

8:                                                ; preds = %2
  %9 = tail call noundef zeroext i1 @_ZN7sc_core18sc_trace_file_base10initializeEv(ptr noundef nonnull align 8 dereferenceable(66) %0)
  br i1 %9, label %65, label %10

10:                                               ; preds = %8
  %11 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7sc_core13sc_time_stampEv()
  %12 = tail call noundef double @_ZNK7sc_core7sc_time10to_secondsEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = load double, ptr %13, align 8, !tbaa !5
  %15 = fdiv double %12, %14
  call void @_ZN7sc_core23double_to_special_int64EdPjS0_(double noundef %15, ptr noundef nonnull %3, ptr noundef nonnull %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %16 = getelementptr inbounds i8, ptr %0, i64 80
  %17 = load double, ptr %16, align 8, !tbaa !16
  %18 = fsub double %15, %17
  call void @_ZN7sc_core23double_to_special_int64EdPjS0_(double noundef %18, ptr noundef nonnull %5, ptr noundef nonnull %6)
  %19 = fcmp oeq double %18, 0.000000e+00
  %or.cond = and i1 %19, %1
  br i1 %or.cond, label %20, label %23

20:                                               ; preds = %10
  %21 = load i32, ptr %6, align 4, !tbaa !23
  %22 = add i32 %21, 1
  store i32 %22, ptr %6, align 4, !tbaa !23
  br label %23

23:                                               ; preds = %20, %10
  %24 = getelementptr inbounds i8, ptr %0, i64 88
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7sc_core9wif_traceESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef 0) #5
  %26 = call noundef i64 @_ZNKSt6vectorIPN7sc_core9wif_traceESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #5
  %27 = trunc i64 %26 to i32
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %23
  %29 = getelementptr inbounds i8, ptr %0, i64 8
  br label %31

._crit_edge:                                      ; preds = %53
  %30 = trunc nuw i8 %.2 to i1
  br i1 %30, label %57, label %._crit_edge.thread

31:                                               ; preds = %.lr.ph, %53
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %53 ]
  %.01619 = phi i8 [ 0, %.lr.ph ], [ %.2, %53 ]
  %32 = getelementptr inbounds ptr, ptr %25, i64 %indvars.iv
  %33 = load ptr, ptr %32, align 8, !tbaa !24
  %34 = load ptr, ptr %33, align 8, !tbaa !25
  %35 = getelementptr inbounds i8, ptr %34, i64 16
  %36 = load ptr, ptr %35, align 8
  %37 = call noundef zeroext i1 %36(ptr noundef nonnull align 8 dereferenceable(84) %33)
  br i1 %37, label %38, label %53

38:                                               ; preds = %31
  %39 = and i8 %.01619, 1
  %40 = icmp eq i8 %39, 0
  br i1 %40, label %41, label %49

41:                                               ; preds = %38
  %42 = load i32, ptr %5, align 4, !tbaa !23
  %.not = icmp eq i32 %42, 0
  %43 = load ptr, ptr %29, align 8, !tbaa !27
  %44 = load i32, ptr %6, align 4, !tbaa !23
  br i1 %.not, label %47, label %45

45:                                               ; preds = %41
  %46 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef nonnull @.str.52, i32 noundef %42, i32 noundef %44) #5
  br label %49

47:                                               ; preds = %41
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef nonnull @.str.53, i32 noundef %44) #5
  br label %49

49:                                               ; preds = %45, %47, %38
  %.1 = phi i8 [ %.01619, %38 ], [ 1, %47 ], [ 1, %45 ]
  %50 = load ptr, ptr %29, align 8, !tbaa !27
  %51 = load ptr, ptr %33, align 8, !tbaa !25
  %52 = load ptr, ptr %51, align 8
  call void %52(ptr noundef nonnull align 8 dereferenceable(84) %33, ptr noundef %50)
  br label %53

53:                                               ; preds = %49, %31
  %.2 = phi i8 [ %.1, %49 ], [ %.01619, %31 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %54 = call noundef i64 @_ZNKSt6vectorIPN7sc_core9wif_traceESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #5
  %sext = shl i64 %54, 32
  %55 = ashr exact i64 %sext, 32
  %56 = icmp slt i64 %indvars.iv.next, %55
  br i1 %56, label %31, label %._crit_edge, !llvm.loop !28

57:                                               ; preds = %._crit_edge
  %58 = getelementptr inbounds i8, ptr %0, i64 8
  %59 = load ptr, ptr %58, align 8, !tbaa !27
  %60 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef nonnull @.str.49) #5
  %61 = load i32, ptr %3, align 4, !tbaa !23
  %62 = getelementptr inbounds i8, ptr %0, i64 76
  store i32 %61, ptr %62, align 4, !tbaa !30
  %63 = load i32, ptr %4, align 4, !tbaa !23
  %64 = getelementptr inbounds i8, ptr %0, i64 72
  store i32 %63, ptr %64, align 8, !tbaa !31
  store double %15, ptr %16, align 8, !tbaa !16
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %23, %57, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  br label %65

65:                                               ; preds = %8, %2, %._crit_edge.thread
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7sc_core18sc_trace_file_base12delta_cyclesEv(ptr noundef nonnull align 8 dereferenceable(66)) local_unnamed_addr #2 align 2

declare noundef zeroext i1 @_ZN7sc_core18sc_trace_file_base10initializeEv(ptr noundef nonnull align 8 dereferenceable(66)) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress 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 = { "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 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 #5 = { 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, !11, i64 16}
!6 = !{!"_ZTSN7sc_core18sc_trace_file_baseE", !7, i64 0, !8, i64 8, !11, i64 16, !12, i64 24, !13, i64 32, !12, i64 64, !12, i64 65}
!7 = !{!"_ZTSN7sc_core13sc_trace_fileE"}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"double", !9, i64 0}
!12 = !{!"bool", !9, i64 0}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !14, i64 0, !15, i64 8, !9, i64 16}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !8, i64 0}
!15 = !{!"long", !9, i64 0}
!16 = !{!17, !11, i64 80}
!17 = !{!"_ZTSN7sc_core14wif_trace_fileE", !6, i64 0, !18, i64 68, !18, i64 72, !18, i64 76, !11, i64 80, !19, i64 88}
!18 = !{!"int", !9, i64 0}
!19 = !{!"_ZTSSt6vectorIPN7sc_core9wif_traceESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIPN7sc_core9wif_traceESaIS2_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIPN7sc_core9wif_traceESaIS2_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIPN7sc_core9wif_traceESaIS2_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!23 = !{!18, !18, i64 0}
!24 = !{!8, !8, i64 0}
!25 = !{!26, !26, i64 0}
!26 = !{!"vtable pointer", !10, i64 0}
!27 = !{!6, !8, i64 8}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!17, !18, i64 76}
!31 = !{!17, !18, i64 72}


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