; LLVM IR from Izaron/ACM-ICPC :: Timus Online Judge/Volume 5/1413. Mars Jumper (main)

; 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.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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] }
%"struct.std::_Setprecision" = type { i32 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca x86_fp80, align 16
  %3 = alloca x86_fp80, align 16
  %4 = alloca x86_fp80, align 16
  %5 = alloca x86_fp80, align 16
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::_Setprecision", align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr %2) #7
  store x86_fp80 0xK00000000000000000000, ptr %2, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #7
  store x86_fp80 0xK00000000000000000000, ptr %3, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #7
  store x86_fp80 0xK00000000000000000000, ptr %4, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #7
  store x86_fp80 0xK00000000000000000000, ptr %5, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  %13 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %14 unwind label %21

14:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %100, %14
  %16 = load i32, ptr %9, align 4, !tbaa !9
  %17 = sext i32 %16 to i64
  %18 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  %19 = icmp ult i64 %17, %18
  br i1 %19, label %25, label %20

20:                                               ; preds = %15
  store i32 2, ptr %10, align 4
  br label %103

21:                                               ; preds = %129, %125, %123, %117, %113, %108, %106, %104, %0
  %22 = landingpad { ptr, i32 }
          cleanup
  %23 = extractvalue { ptr, i32 } %22, 0
  store ptr %23, ptr %7, align 8
  %24 = extractvalue { ptr, i32 } %22, 1
  store i32 %24, ptr %8, align 4
  br label %137

25:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %26 = load i32, ptr %9, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %6, i64 noundef %27)
          to label %29 unwind label %36

29:                                               ; preds = %25
  %30 = load i8, ptr %28, align 1, !tbaa !11
  %31 = sext i8 %30 to i32
  %32 = sub nsw i32 %31, 48
  store i32 %32, ptr %11, align 4, !tbaa !9
  %33 = load i32, ptr %11, align 4, !tbaa !9
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %35, label %40

35:                                               ; preds = %29
  store i32 2, ptr %10, align 4
  br label %97

36:                                               ; preds = %25
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %7, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %137

40:                                               ; preds = %29
  %41 = load i32, ptr %11, align 4, !tbaa !9
  %42 = icmp eq i32 %41, 1
  br i1 %42, label %43, label %48

43:                                               ; preds = %40
  %44 = load x86_fp80, ptr %4, align 16, !tbaa !5
  %45 = fsub x86_fp80 %44, 0xK3FFF8000000000000000
  store x86_fp80 %45, ptr %4, align 16, !tbaa !5
  %46 = load x86_fp80, ptr %5, align 16, !tbaa !5
  %47 = fsub x86_fp80 %46, 0xK3FFF8000000000000000
  store x86_fp80 %47, ptr %5, align 16, !tbaa !5
  br label %48

48:                                               ; preds = %43, %40
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = icmp eq i32 %49, 2
  br i1 %50, label %51, label %54

51:                                               ; preds = %48
  %52 = load x86_fp80, ptr %3, align 16, !tbaa !5
  %53 = fsub x86_fp80 %52, 0xK3FFF8000000000000000
  store x86_fp80 %53, ptr %3, align 16, !tbaa !5
  br label %54

54:                                               ; preds = %51, %48
  %55 = load i32, ptr %11, align 4, !tbaa !9
  %56 = icmp eq i32 %55, 3
  br i1 %56, label %57, label %62

57:                                               ; preds = %54
  %58 = load x86_fp80, ptr %4, align 16, !tbaa !5
  %59 = fadd x86_fp80 %58, 0xK3FFF8000000000000000
  store x86_fp80 %59, ptr %4, align 16, !tbaa !5
  %60 = load x86_fp80, ptr %5, align 16, !tbaa !5
  %61 = fsub x86_fp80 %60, 0xK3FFF8000000000000000
  store x86_fp80 %61, ptr %5, align 16, !tbaa !5
  br label %62

62:                                               ; preds = %57, %54
  %63 = load i32, ptr %11, align 4, !tbaa !9
  %64 = icmp eq i32 %63, 4
  br i1 %64, label %65, label %68

65:                                               ; preds = %62
  %66 = load x86_fp80, ptr %2, align 16, !tbaa !5
  %67 = fsub x86_fp80 %66, 0xK3FFF8000000000000000
  store x86_fp80 %67, ptr %2, align 16, !tbaa !5
  br label %68

68:                                               ; preds = %65, %62
  %69 = load i32, ptr %11, align 4, !tbaa !9
  %70 = icmp eq i32 %69, 7
  br i1 %70, label %71, label %76

71:                                               ; preds = %68
  %72 = load x86_fp80, ptr %4, align 16, !tbaa !5
  %73 = fsub x86_fp80 %72, 0xK3FFF8000000000000000
  store x86_fp80 %73, ptr %4, align 16, !tbaa !5
  %74 = load x86_fp80, ptr %5, align 16, !tbaa !5
  %75 = fadd x86_fp80 %74, 0xK3FFF8000000000000000
  store x86_fp80 %75, ptr %5, align 16, !tbaa !5
  br label %76

76:                                               ; preds = %71, %68
  %77 = load i32, ptr %11, align 4, !tbaa !9
  %78 = icmp eq i32 %77, 6
  br i1 %78, label %79, label %82

79:                                               ; preds = %76
  %80 = load x86_fp80, ptr %2, align 16, !tbaa !5
  %81 = fadd x86_fp80 %80, 0xK3FFF8000000000000000
  store x86_fp80 %81, ptr %2, align 16, !tbaa !5
  br label %82

82:                                               ; preds = %79, %76
  %83 = load i32, ptr %11, align 4, !tbaa !9
  %84 = icmp eq i32 %83, 9
  br i1 %84, label %85, label %90

85:                                               ; preds = %82
  %86 = load x86_fp80, ptr %4, align 16, !tbaa !5
  %87 = fadd x86_fp80 %86, 0xK3FFF8000000000000000
  store x86_fp80 %87, ptr %4, align 16, !tbaa !5
  %88 = load x86_fp80, ptr %5, align 16, !tbaa !5
  %89 = fadd x86_fp80 %88, 0xK3FFF8000000000000000
  store x86_fp80 %89, ptr %5, align 16, !tbaa !5
  br label %90

90:                                               ; preds = %85, %82
  %91 = load i32, ptr %11, align 4, !tbaa !9
  %92 = icmp eq i32 %91, 8
  br i1 %92, label %93, label %96

93:                                               ; preds = %90
  %94 = load x86_fp80, ptr %3, align 16, !tbaa !5
  %95 = fadd x86_fp80 %94, 0xK3FFF8000000000000000
  store x86_fp80 %95, ptr %3, align 16, !tbaa !5
  br label %96

96:                                               ; preds = %93, %90
  store i32 0, ptr %10, align 4
  br label %97

97:                                               ; preds = %96, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  %98 = load i32, ptr %10, align 4
  switch i32 %98, label %103 [
    i32 0, label %99
  ]

99:                                               ; preds = %97
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %9, align 4, !tbaa !9
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %9, align 4, !tbaa !9
  br label %15, !llvm.loop !12

103:                                              ; preds = %97, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %104

104:                                              ; preds = %103
  %105 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt5fixedRSt8ios_base)
          to label %106 unwind label %21

106:                                              ; preds = %104
  %107 = invoke i32 @_ZSt12setprecisioni(i32 noundef 10)
          to label %108 unwind label %21

108:                                              ; preds = %106
  %109 = getelementptr inbounds %"struct.std::_Setprecision", ptr %12, i32 0, i32 0
  store i32 %107, ptr %109, align 4
  %110 = getelementptr inbounds %"struct.std::_Setprecision", ptr %12, i32 0, i32 0
  %111 = load i32, ptr %110, align 4
  %112 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %105, i32 %111)
          to label %113 unwind label %21

113:                                              ; preds = %108
  %114 = load x86_fp80, ptr %2, align 16, !tbaa !5
  %115 = load x86_fp80, ptr %4, align 16, !tbaa !5
  %116 = invoke noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef 2)
          to label %117 unwind label %21

117:                                              ; preds = %113
  %118 = fpext double %116 to x86_fp80
  %119 = fmul x86_fp80 %115, %118
  %120 = fdiv x86_fp80 %119, 0xK40008000000000000000
  %121 = fadd x86_fp80 %114, %120
  %122 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEe(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, x86_fp80 noundef %121)
          to label %123 unwind label %21

123:                                              ; preds = %117
  %124 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %122, ptr noundef @.str)
          to label %125 unwind label %21

125:                                              ; preds = %123
  %126 = load x86_fp80, ptr %3, align 16, !tbaa !5
  %127 = load x86_fp80, ptr %5, align 16, !tbaa !5
  %128 = invoke noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef 2)
          to label %129 unwind label %21

129:                                              ; preds = %125
  %130 = fpext double %128 to x86_fp80
  %131 = fmul x86_fp80 %127, %130
  %132 = fdiv x86_fp80 %131, 0xK40008000000000000000
  %133 = fadd x86_fp80 %126, %132
  %134 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEe(ptr noundef nonnull align 8 dereferenceable(8) %124, x86_fp80 noundef %133)
          to label %135 unwind label %21

135:                                              ; preds = %129
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %2) #7
  %136 = load i32, ptr %1, align 4
  ret i32 %136

137:                                              ; preds = %36, %21
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %2) #7
  br label %138

138:                                              ; preds = %137
  %139 = load ptr, ptr %7, align 8
  %140 = load i32, ptr %8, align 4
  %141 = insertvalue { ptr, i32 } poison, ptr %139, 0
  %142 = insertvalue { ptr, i32 } %141, i32 %140, 1
  resume { ptr, i32 } %142
}

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #3

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8), i32) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt5fixedRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZSt12setprecisioni(i32 noundef) #6

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEe(ptr noundef nonnull align 8 dereferenceable(8), x86_fp80 noundef) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) #6

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress norecurse 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 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 = { inlinehint 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 = { 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 #6 = { 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 #7 = { 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 = !{!"long double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


; 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.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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] }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %2 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %.preheader unwind label %4

.preheader:                                       ; preds = %0
  %3 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %.not71 = icmp eq i64 %3, 0
  br i1 %.not71, label %.thread, label %.lr.ph

4:                                                ; preds = %46, %44, %37, %34, %.thread, %0
  %5 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  resume { ptr, i32 } %5

.lr.ph:                                           ; preds = %.preheader, %10
  %indvars.iv = phi i64 [ %indvars.iv.next, %10 ], [ 0, %.preheader ]
  %.062 = phi x86_fp80 [ %.2, %10 ], [ 0xK00000000000000000000, %.preheader ]
  %.03361 = phi x86_fp80 [ %.235, %10 ], [ 0xK00000000000000000000, %.preheader ]
  %.04059 = phi x86_fp80 [ %.444, %10 ], [ 0xK00000000000000000000, %.preheader ]
  %.04558 = phi x86_fp80 [ %.449, %10 ], [ 0xK00000000000000000000, %.preheader ]
  %6 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  %7 = load i8, ptr %6, align 1, !tbaa !5
  %8 = sext i8 %7 to i32
  %9 = add nsw i32 %8, -48
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %.thread, label %10

10:                                               ; preds = %.lr.ph
  %11 = icmp eq i32 %9, 1
  %12 = fadd x86_fp80 %.04059, 0xKBFFF8000000000000000
  %13 = fadd x86_fp80 %.04558, 0xKBFFF8000000000000000
  %.146 = select i1 %11, x86_fp80 %13, x86_fp80 %.04558
  %.141 = select i1 %11, x86_fp80 %12, x86_fp80 %.04059
  %14 = icmp eq i32 %9, 2
  %15 = fadd x86_fp80 %.03361, 0xKBFFF8000000000000000
  %.134 = select i1 %14, x86_fp80 %15, x86_fp80 %.03361
  %16 = icmp eq i32 %9, 3
  %17 = fadd x86_fp80 %.141, 0xK3FFF8000000000000000
  %18 = fadd x86_fp80 %.146, 0xKBFFF8000000000000000
  %.247 = select i1 %16, x86_fp80 %18, x86_fp80 %.146
  %.242 = select i1 %16, x86_fp80 %17, x86_fp80 %.141
  %19 = icmp eq i32 %9, 4
  %20 = fadd x86_fp80 %.062, 0xKBFFF8000000000000000
  %.1 = select i1 %19, x86_fp80 %20, x86_fp80 %.062
  %21 = icmp eq i32 %9, 7
  %22 = fadd x86_fp80 %.242, 0xKBFFF8000000000000000
  %23 = fadd x86_fp80 %.247, 0xK3FFF8000000000000000
  %.348 = select i1 %21, x86_fp80 %23, x86_fp80 %.247
  %.343 = select i1 %21, x86_fp80 %22, x86_fp80 %.242
  %24 = icmp eq i32 %9, 6
  %25 = fadd x86_fp80 %.1, 0xK3FFF8000000000000000
  %.2 = select i1 %24, x86_fp80 %25, x86_fp80 %.1
  %26 = icmp eq i32 %9, 9
  %27 = fadd x86_fp80 %.343, 0xK3FFF8000000000000000
  %28 = fadd x86_fp80 %.348, 0xK3FFF8000000000000000
  %.449 = select i1 %26, x86_fp80 %28, x86_fp80 %.348
  %.444 = select i1 %26, x86_fp80 %27, x86_fp80 %.343
  %29 = icmp eq i32 %9, 8
  %30 = fadd x86_fp80 %.134, 0xK3FFF8000000000000000
  %.235 = select i1 %29, x86_fp80 %30, x86_fp80 %.134
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %32 = icmp ugt i64 %31, %indvars.iv.next
  br i1 %32, label %.lr.ph, label %.thread, !llvm.loop !8

.thread:                                          ; preds = %10, %.lr.ph, %.preheader
  %.045.lcssa = phi x86_fp80 [ 0xK00000000000000000000, %.preheader ], [ %.04558, %.lr.ph ], [ %.449, %10 ]
  %.040.lcssa = phi x86_fp80 [ 0xK00000000000000000000, %.preheader ], [ %.04059, %.lr.ph ], [ %.444, %10 ]
  %.033.lcssa = phi x86_fp80 [ 0xK00000000000000000000, %.preheader ], [ %.03361, %.lr.ph ], [ %.235, %10 ]
  %.0.lcssa = phi x86_fp80 [ 0xK00000000000000000000, %.preheader ], [ %.062, %.lr.ph ], [ %.2, %10 ]
  %33 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt5fixedRSt8ios_base)
          to label %34 unwind label %4

34:                                               ; preds = %.thread
  %35 = call i32 @_ZSt12setprecisioni(i32 noundef 10)
  %36 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %33, i32 %35)
          to label %37 unwind label %4

37:                                               ; preds = %34
  %38 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef 2)
  %39 = fpext double %38 to x86_fp80
  %40 = fmul x86_fp80 %.040.lcssa, %39
  %41 = fmul x86_fp80 %40, 0xK3FFE8000000000000000
  %42 = fadd x86_fp80 %.0.lcssa, %41
  %43 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEe(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, x86_fp80 noundef %42)
          to label %44 unwind label %4

44:                                               ; preds = %37
  %45 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef nonnull @.str)
          to label %46 unwind label %4

46:                                               ; preds = %44
  %47 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef 2)
  %48 = fpext double %47 to x86_fp80
  %49 = fmul x86_fp80 %.045.lcssa, %48
  %50 = fmul x86_fp80 %49, 0xK3FFE8000000000000000
  %51 = fadd x86_fp80 %.033.lcssa, %50
  %52 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEe(ptr noundef nonnull align 8 dereferenceable(8) %45, x86_fp80 noundef %51)
          to label %53 unwind label %4

53:                                               ; preds = %46
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  ret i32 0
}

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8), i32) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt5fixedRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZSt12setprecisioni(i32 noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEe(ptr noundef nonnull align 8 dereferenceable(8), x86_fp80 noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress norecurse 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 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 = { inlinehint 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 = { 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 #6 = { 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 #7 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}


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