; LLVM IR from InsightSoftwareConsortium/ITK :: Modules/ThirdParty/DoubleConversion/src/double-conversion (double-to-string)

; 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.double_conversion::Double" = type { i64 }
%"class.double_conversion::DoubleToStringConverter" = type { i32, ptr, ptr, i8, i32, i32, i32, i32, i32 }

@.str.3 = external hidden unnamed_addr constant [141 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [32 x i8], align 1
@__PRETTY_FUNCTION__._ZNK17double_conversion23DoubleToStringConverter11ToPrecisionEdiPNS_13StringBuilderE = external hidden unnamed_addr constant [97 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: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK17double_conversion23DoubleToStringConverter19HandleSpecialValuesEdPNS_13StringBuilderE(ptr noundef nonnull align 8 dereferenceable(48), double noundef, ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17double_conversion6DoubleC2Ed(ptr noundef nonnull align 8 dereferenceable(8), double noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17double_conversion13StringBuilder12AddCharacterEc(ptr noundef nonnull align 8 dereferenceable(20), i8 noundef signext) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK17double_conversion23DoubleToStringConverter31CreateExponentialRepresentationEPKciiPNS_13StringBuilderE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, i32 noundef, i32 noundef, ptr noundef) #1 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK17double_conversion23DoubleToStringConverter27CreateDecimalRepresentationEPKciiiPNS_13StringBuilderE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17double_conversion23DoubleToStringConverter13DoubleToAsciiEdNS0_8DtoaModeEiPciPbPiS4_(double noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK17double_conversion23DoubleToStringConverter11ToPrecisionEdiPNS_13StringBuilderE(ptr noundef nonnull align 8 dereferenceable(48) %0, double noundef %1, i32 noundef %2, ptr noundef %3) #1 align 2 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"class.double_conversion::Double", align 8
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  %14 = alloca [121 x i8], align 16
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i8, align 1
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store double %1, ptr %7, align 8, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !11
  store ptr %3, ptr %9, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %26 = load double, ptr %7, align 8, !tbaa !9
  call void @_ZN17double_conversion6DoubleC2Ed(ptr noundef nonnull align 8 dereferenceable(8) %10, double noundef %26)
  %27 = call noundef zeroext i1 @_ZNK17double_conversion6Double9IsSpecialEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br i1 %27, label %28, label %32

28:                                               ; preds = %4
  %29 = load double, ptr %7, align 8, !tbaa !9
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = call noundef zeroext i1 @_ZNK17double_conversion23DoubleToStringConverter19HandleSpecialValuesEdPNS_13StringBuilderE(ptr noundef nonnull align 8 dereferenceable(48) %25, double noundef %29, ptr noundef %30)
  store i1 %31, ptr %5, align 1
  br label %158

32:                                               ; preds = %4
  %33 = load i32, ptr %8, align 4, !tbaa !11
  %34 = icmp slt i32 %33, 1
  br i1 %34, label %38, label %35

35:                                               ; preds = %32
  %36 = load i32, ptr %8, align 4, !tbaa !11
  %37 = icmp sgt i32 %36, 120
  br i1 %37, label %38, label %39

38:                                               ; preds = %35, %32
  store i1 false, ptr %5, align 1
  br label %158

39:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 121, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 121, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %40 = load double, ptr %7, align 8, !tbaa !9
  %41 = load i32, ptr %8, align 4, !tbaa !11
  %42 = getelementptr inbounds [121 x i8], ptr %14, i64 0, i64 0
  call void @_ZN17double_conversion23DoubleToStringConverter13DoubleToAsciiEdNS0_8DtoaModeEiPciPbPiS4_(double noundef %40, i32 noundef 3, i32 noundef %41, ptr noundef %42, i32 noundef 121, ptr noundef %12, ptr noundef %15, ptr noundef %11)
  %43 = load i32, ptr %15, align 4, !tbaa !11
  %44 = load i32, ptr %8, align 4, !tbaa !11
  %45 = icmp sle i32 %43, %44
  br i1 %45, label %46, label %47

46:                                               ; preds = %39
  br label %49

47:                                               ; preds = %39
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.3, i32 noundef 325, ptr noundef @__PRETTY_FUNCTION__._ZNK17double_conversion23DoubleToStringConverter11ToPrecisionEdiPNS_13StringBuilderE) #6
  unreachable

48:                                               ; No predecessors!
  br label %49

49:                                               ; preds = %48, %46
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #5
  %50 = getelementptr inbounds %"class.double_conversion::DoubleToStringConverter", ptr %25, i32 0, i32 0
  %51 = load i32, ptr %50, align 8, !tbaa !13
  %52 = and i32 %51, 8
  %53 = icmp ne i32 %52, 0
  %54 = zext i1 %53 to i8
  store i8 %54, ptr %16, align 1, !tbaa !15
  %55 = load i8, ptr %12, align 1, !tbaa !15, !range !17, !noundef !18
  %56 = trunc i8 %55 to i1
  br i1 %56, label %57, label %65

57:                                               ; preds = %49
  %58 = load double, ptr %7, align 8, !tbaa !9
  %59 = fcmp une double %58, 0.000000e+00
  br i1 %59, label %63, label %60

60:                                               ; preds = %57
  %61 = load i8, ptr %16, align 1, !tbaa !15, !range !17, !noundef !18
  %62 = trunc i8 %61 to i1
  br i1 %62, label %65, label %63

63:                                               ; preds = %60, %57
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN17double_conversion13StringBuilder12AddCharacterEc(ptr noundef nonnull align 8 dereferenceable(20) %64, i8 noundef signext 45)
  br label %65

65:                                               ; preds = %63, %60, %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %66 = load i32, ptr %11, align 4, !tbaa !11
  %67 = sub nsw i32 %66, 1
  store i32 %67, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %68 = getelementptr inbounds %"class.double_conversion::DoubleToStringConverter", ptr %25, i32 0, i32 0
  %69 = load i32, ptr %68, align 8, !tbaa !13
  %70 = and i32 %69, 4
  %71 = icmp ne i32 %70, 0
  %72 = zext i1 %71 to i64
  %73 = select i1 %71, i32 1, i32 0
  store i32 %73, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #5
  %74 = load i32, ptr %11, align 4, !tbaa !11
  %75 = sub nsw i32 0, %74
  %76 = add nsw i32 %75, 1
  %77 = getelementptr inbounds %"class.double_conversion::DoubleToStringConverter", ptr %25, i32 0, i32 6
  %78 = load i32, ptr %77, align 4, !tbaa !19
  %79 = icmp sgt i32 %76, %78
  br i1 %79, label %89, label %80

80:                                               ; preds = %65
  %81 = load i32, ptr %11, align 4, !tbaa !11
  %82 = load i32, ptr %8, align 4, !tbaa !11
  %83 = sub nsw i32 %81, %82
  %84 = load i32, ptr %18, align 4, !tbaa !11
  %85 = add nsw i32 %83, %84
  %86 = getelementptr inbounds %"class.double_conversion::DoubleToStringConverter", ptr %25, i32 0, i32 7
  %87 = load i32, ptr %86, align 8, !tbaa !20
  %88 = icmp sgt i32 %85, %87
  br label %89

89:                                               ; preds = %80, %65
  %90 = phi i1 [ true, %65 ], [ %88, %80 ]
  %91 = zext i1 %90 to i8
  store i8 %91, ptr %19, align 1, !tbaa !15
  %92 = getelementptr inbounds %"class.double_conversion::DoubleToStringConverter", ptr %25, i32 0, i32 0
  %93 = load i32, ptr %92, align 8, !tbaa !13
  %94 = and i32 %93, 16
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %96, label %125

96:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %97 = load i8, ptr %19, align 1, !tbaa !15, !range !17, !noundef !18
  %98 = trunc i8 %97 to i1
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  br i1 %98, label %99, label %100

99:                                               ; preds = %96
  br label %103

100:                                              ; preds = %96
  store i32 1, ptr %21, align 4, !tbaa !11
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %102 = load i32, ptr %101, align 4, !tbaa !11
  br label %103

103:                                              ; preds = %100, %99
  %104 = phi i32 [ 1, %99 ], [ %102, %100 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  store i32 %104, ptr %20, align 4, !tbaa !11
  br label %105

105:                                              ; preds = %119, %103
  %106 = load i32, ptr %15, align 4, !tbaa !11
  %107 = load i32, ptr %20, align 4, !tbaa !11
  %108 = icmp sgt i32 %106, %107
  br i1 %108, label %109, label %117

109:                                              ; preds = %105
  %110 = load i32, ptr %15, align 4, !tbaa !11
  %111 = sub nsw i32 %110, 1
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [121 x i8], ptr %14, i64 0, i64 %112
  %114 = load i8, ptr %113, align 1, !tbaa !21
  %115 = sext i8 %114 to i32
  %116 = icmp eq i32 %115, 48
  br label %117

117:                                              ; preds = %109, %105
  %118 = phi i1 [ false, %105 ], [ %116, %109 ]
  br i1 %118, label %119, label %122

119:                                              ; preds = %117
  %120 = load i32, ptr %15, align 4, !tbaa !11
  %121 = add nsw i32 %120, -1
  store i32 %121, ptr %15, align 4, !tbaa !11
  br label %105, !llvm.loop !22

122:                                              ; preds = %117
  %123 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %124 = load i32, ptr %123, align 4, !tbaa !11
  store i32 %124, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %125

125:                                              ; preds = %122, %89
  %126 = load i8, ptr %19, align 1, !tbaa !15, !range !17, !noundef !18
  %127 = trunc i8 %126 to i1
  br i1 %127, label %128, label %147

128:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %129 = load i32, ptr %15, align 4, !tbaa !11
  store i32 %129, ptr %22, align 4, !tbaa !11
  br label %130

130:                                              ; preds = %139, %128
  %131 = load i32, ptr %22, align 4, !tbaa !11
  %132 = load i32, ptr %8, align 4, !tbaa !11
  %133 = icmp slt i32 %131, %132
  br i1 %133, label %135, label %134

134:                                              ; preds = %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %142

135:                                              ; preds = %130
  %136 = load i32, ptr %22, align 4, !tbaa !11
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [121 x i8], ptr %14, i64 0, i64 %137
  store i8 48, ptr %138, align 1, !tbaa !21
  br label %139

139:                                              ; preds = %135
  %140 = load i32, ptr %22, align 4, !tbaa !11
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %22, align 4, !tbaa !11
  br label %130, !llvm.loop !24

142:                                              ; preds = %134
  %143 = getelementptr inbounds [121 x i8], ptr %14, i64 0, i64 0
  %144 = load i32, ptr %8, align 4, !tbaa !11
  %145 = load i32, ptr %17, align 4, !tbaa !11
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZNK17double_conversion23DoubleToStringConverter31CreateExponentialRepresentationEPKciiPNS_13StringBuilderE(ptr noundef nonnull align 8 dereferenceable(48) %25, ptr noundef %143, i32 noundef %144, i32 noundef %145, ptr noundef %146)
  br label %157

147:                                              ; preds = %125
  %148 = getelementptr inbounds [121 x i8], ptr %14, i64 0, i64 0
  %149 = load i32, ptr %15, align 4, !tbaa !11
  %150 = load i32, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %151 = load i32, ptr %8, align 4, !tbaa !11
  %152 = load i32, ptr %11, align 4, !tbaa !11
  %153 = sub nsw i32 %151, %152
  store i32 %153, ptr %24, align 4, !tbaa !11
  %154 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %155 = load i32, ptr %154, align 4, !tbaa !11
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZNK17double_conversion23DoubleToStringConverter27CreateDecimalRepresentationEPKciiiPNS_13StringBuilderE(ptr noundef nonnull align 8 dereferenceable(48) %25, ptr noundef %148, i32 noundef %149, i32 noundef %150, i32 noundef %155, ptr noundef %156)
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %157

157:                                              ; preds = %147, %142
  store i1 true, ptr %5, align 1
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 121, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %158

158:                                              ; preds = %157, %38, %28
  %159 = load i1, ptr %5, align 1
  ret i1 %159
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { noreturn 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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"_ZTSN17double_conversion23DoubleToStringConverterE", !12, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!14, !12, i64 36}
!20 = !{!14, !12, i64 40}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}


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

%"class.double_conversion::Double" = type { i64 }

@.str.3 = external hidden unnamed_addr constant [141 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [32 x i8], align 1
@__PRETTY_FUNCTION__._ZNK17double_conversion23DoubleToStringConverter11ToPrecisionEdiPNS_13StringBuilderE = external hidden unnamed_addr constant [97 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: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK17double_conversion23DoubleToStringConverter19HandleSpecialValuesEdPNS_13StringBuilderE(ptr noundef nonnull align 8 dereferenceable(48), double noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17double_conversion6DoubleC2Ed(ptr noundef nonnull align 8 dereferenceable(8), double noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17double_conversion13StringBuilder12AddCharacterEc(ptr noundef nonnull align 8 dereferenceable(20), i8 noundef signext) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK17double_conversion23DoubleToStringConverter31CreateExponentialRepresentationEPKciiPNS_13StringBuilderE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK17double_conversion23DoubleToStringConverter27CreateDecimalRepresentationEPKciiiPNS_13StringBuilderE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17double_conversion23DoubleToStringConverter13DoubleToAsciiEdNS0_8DtoaModeEiPciPbPiS4_(double noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK17double_conversion23DoubleToStringConverter11ToPrecisionEdiPNS_13StringBuilderE(ptr noundef nonnull align 8 dereferenceable(48) %0, double noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #1 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca %"class.double_conversion::Double", align 8
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca [121 x i8], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 %2, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @_ZN17double_conversion6DoubleC2Ed(ptr noundef nonnull align 8 dereferenceable(8) %6, double noundef %1)
  %14 = call noundef zeroext i1 @_ZNK17double_conversion6Double9IsSpecialEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br i1 %14, label %15, label %17

15:                                               ; preds = %4
  %16 = call noundef zeroext i1 @_ZNK17double_conversion23DoubleToStringConverter19HandleSpecialValuesEdPNS_13StringBuilderE(ptr noundef nonnull align 8 dereferenceable(48) %0, double noundef %1, ptr noundef %3)
  br label %81

17:                                               ; preds = %4
  %18 = add i32 %2, -121
  %or.cond = icmp ult i32 %18, -120
  br i1 %or.cond, label %81, label %19

19:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 121, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  call void @_ZN17double_conversion23DoubleToStringConverter13DoubleToAsciiEdNS0_8DtoaModeEiPciPbPiS4_(double noundef %1, i32 noundef 3, i32 noundef %2, ptr noundef nonnull %9, i32 noundef 121, ptr noundef nonnull %8, ptr noundef nonnull %10, ptr noundef nonnull %7)
  %20 = load i32, ptr %10, align 4, !tbaa !5
  %.not = icmp sgt i32 %20, %2
  br i1 %.not, label %21, label %22

21:                                               ; preds = %19
  call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.3, i32 noundef 325, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK17double_conversion23DoubleToStringConverter11ToPrecisionEdiPNS_13StringBuilderE) #7
  unreachable

22:                                               ; preds = %19
  %23 = load i32, ptr %0, align 8, !tbaa !9
  %24 = and i32 %23, 8
  %.not22 = icmp eq i32 %24, 0
  %25 = load i8, ptr %8, align 1, !tbaa !12, !range !14, !noundef !15
  %26 = trunc nuw i8 %25 to i1
  %27 = fcmp une double %1, 0.000000e+00
  %brmerge = select i1 %27, i1 true, i1 %.not22
  %or.cond25 = select i1 %26, i1 %brmerge, i1 false
  br i1 %or.cond25, label %28, label %29

28:                                               ; preds = %22
  call void @_ZN17double_conversion13StringBuilder12AddCharacterEc(ptr noundef nonnull align 8 dereferenceable(20) %3, i8 noundef signext 45)
  br label %29

29:                                               ; preds = %28, %22
  %30 = load i32, ptr %7, align 4, !tbaa !5
  %31 = add nsw i32 %30, -1
  %32 = sub i32 1, %30
  %33 = getelementptr inbounds i8, ptr %0, i64 36
  %34 = load i32, ptr %33, align 4, !tbaa !16
  %35 = icmp sgt i32 %32, %34
  %36 = load i32, ptr %0, align 8, !tbaa !9
  br i1 %35, label %.thread, label %37

37:                                               ; preds = %29
  %38 = lshr i32 %36, 2
  %.lobit = and i32 %38, 1
  %39 = sub i32 %30, %2
  %40 = add nsw i32 %39, %.lobit
  %41 = getelementptr inbounds i8, ptr %0, i64 40
  %42 = load i32, ptr %41, align 8, !tbaa !17
  %43 = icmp sgt i32 %40, %42
  %44 = and i32 %36, 16
  %.not24 = icmp eq i32 %44, 0
  br i1 %.not24, label %64, label %46

.thread:                                          ; preds = %29
  %45 = and i32 %36, 16
  %.not2426 = icmp eq i32 %45, 0
  br i1 %.not2426, label %.thread28, label %.thread27

.thread27:                                        ; preds = %.thread
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  br label %50

46:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  br i1 %43, label %50, label %47

47:                                               ; preds = %46
  store i32 1, ptr %11, align 4, !tbaa !5
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %49 = load i32, ptr %48, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %.thread27, %46, %47
  %51 = phi i1 [ false, %47 ], [ true, %46 ], [ true, %.thread27 ]
  %52 = phi i32 [ %49, %47 ], [ 1, %46 ], [ 1, %.thread27 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  %.promoted = load i32, ptr %10, align 4, !tbaa !5
  %53 = icmp sgt i32 %.promoted, %52
  br i1 %53, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %50
  %54 = sext i32 %.promoted to i64
  %55 = sext i32 %52 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %59
  %indvars.iv = phi i64 [ %54, %.lr.ph.preheader ], [ %indvars.iv.next, %59 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %56 = getelementptr inbounds [121 x i8], ptr %9, i64 0, i64 %indvars.iv.next
  %57 = load i8, ptr %56, align 1, !tbaa !18
  %58 = icmp eq i8 %57, 48
  br i1 %58, label %59, label %.critedge

59:                                               ; preds = %.lr.ph
  %60 = trunc nsw i64 %indvars.iv.next to i32
  store i32 %60, ptr %10, align 4, !tbaa !5
  %61 = icmp sgt i64 %indvars.iv.next, %55
  br i1 %61, label %.lr.ph, label %.critedge, !llvm.loop !19

.critedge:                                        ; preds = %.lr.ph, %59, %50
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %63 = load i32, ptr %62, align 4, !tbaa !5
  store i32 %63, ptr %5, align 4, !tbaa !5
  br i1 %51, label %.thread28, label %.critedge._crit_edge

.critedge._crit_edge:                             ; preds = %.critedge
  %.pre = load i32, ptr %7, align 4, !tbaa !5
  br label %73

64:                                               ; preds = %37
  br i1 %43, label %.thread28, label %73

.thread28:                                        ; preds = %.thread, %.critedge, %64
  %65 = phi i32 [ %2, %.thread ], [ %63, %.critedge ], [ %2, %64 ]
  %66 = load i32, ptr %10, align 4, !tbaa !5
  %67 = icmp slt i32 %66, %65
  br i1 %67, label %.lr.ph31.preheader, label %._crit_edge

.lr.ph31.preheader:                               ; preds = %.thread28
  %68 = sext i32 %66 to i64
  %scevgep = getelementptr i8, ptr %9, i64 %68
  %69 = xor i32 %66, -1
  %70 = add i32 %65, %69
  %71 = zext i32 %70 to i64
  %72 = add nuw nsw i64 %71, 1
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 48, i64 %72, i1 false), !tbaa !18
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph31.preheader, %.thread28
  call void @_ZNK17double_conversion23DoubleToStringConverter31CreateExponentialRepresentationEPKciiPNS_13StringBuilderE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull %9, i32 noundef %65, i32 noundef %31, ptr noundef %3)
  br label %80

73:                                               ; preds = %.critedge._crit_edge, %64
  %74 = phi i32 [ %63, %.critedge._crit_edge ], [ %2, %64 ]
  %75 = phi i32 [ %.pre, %.critedge._crit_edge ], [ %30, %64 ]
  %76 = load i32, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  %77 = sub nsw i32 %74, %75
  store i32 %77, ptr %13, align 4, !tbaa !5
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %79 = load i32, ptr %78, align 4, !tbaa !5
  call void @_ZNK17double_conversion23DoubleToStringConverter27CreateDecimalRepresentationEPKciiiPNS_13StringBuilderE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull %9, i32 noundef %76, i32 noundef %75, i32 noundef %79, ptr noundef %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  br label %80

80:                                               ; preds = %73, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 121, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  br label %81

81:                                               ; preds = %17, %80, %15
  %.019 = phi i1 [ %16, %15 ], [ true, %80 ], [ false, %17 ]
  ret i1 %.019
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint 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 #4 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN17double_conversion23DoubleToStringConverterE", !6, i64 0, !11, i64 8, !11, i64 16, !7, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!10, !6, i64 36}
!17 = !{!10, !6, i64 40}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


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