; LLVM IR from AnneLivia/Competitive-Programming :: Online Judges/Neps Academy (MonopolioOBI2006)

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

@_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 norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #5
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %13 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %13, ptr %6, align 4, !tbaa !5
  store i32 %13, ptr %5, align 4, !tbaa !5
  store i32 %13, ptr %4, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %140, %0
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = add nsw i32 %15, -1
  store i32 %16, ptr %3, align 4, !tbaa !5
  %17 = icmp ne i32 %15, 0
  br i1 %17, label %18, label %141

18:                                               ; preds = %14
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %8)
  %20 = load i8, ptr %8, align 1, !tbaa !9
  %21 = sext i8 %20 to i32
  %22 = icmp eq i32 %21, 65
  br i1 %22, label %23, label %84

23:                                               ; preds = %18
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %9)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 1 dereferenceable(1) %10)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %27 = load i8, ptr %9, align 1, !tbaa !9
  %28 = sext i8 %27 to i32
  %29 = icmp eq i32 %28, 68
  br i1 %29, label %30, label %46

30:                                               ; preds = %23
  %31 = load i32, ptr %7, align 4, !tbaa !5
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = add nsw i32 %32, %31
  store i32 %33, ptr %4, align 4, !tbaa !5
  %34 = load i8, ptr %10, align 1, !tbaa !9
  %35 = sext i8 %34 to i32
  %36 = icmp eq i32 %35, 69
  br i1 %36, label %37, label %41

37:                                               ; preds = %30
  %38 = load i32, ptr %7, align 4, !tbaa !5
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = sub nsw i32 %39, %38
  store i32 %40, ptr %5, align 4, !tbaa !5
  br label %45

41:                                               ; preds = %30
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = sub nsw i32 %43, %42
  store i32 %44, ptr %6, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %41, %37
  br label %83

46:                                               ; preds = %23
  %47 = load i8, ptr %9, align 1, !tbaa !9
  %48 = sext i8 %47 to i32
  %49 = icmp eq i32 %48, 69
  br i1 %49, label %50, label %66

50:                                               ; preds = %46
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = add nsw i32 %52, %51
  store i32 %53, ptr %5, align 4, !tbaa !5
  %54 = load i8, ptr %10, align 1, !tbaa !9
  %55 = sext i8 %54 to i32
  %56 = icmp eq i32 %55, 68
  br i1 %56, label %57, label %61

57:                                               ; preds = %50
  %58 = load i32, ptr %7, align 4, !tbaa !5
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = sub nsw i32 %59, %58
  store i32 %60, ptr %4, align 4, !tbaa !5
  br label %65

61:                                               ; preds = %50
  %62 = load i32, ptr %7, align 4, !tbaa !5
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = sub nsw i32 %63, %62
  store i32 %64, ptr %6, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %61, %57
  br label %82

66:                                               ; preds = %46
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = add nsw i32 %68, %67
  store i32 %69, ptr %6, align 4, !tbaa !5
  %70 = load i8, ptr %10, align 1, !tbaa !9
  %71 = sext i8 %70 to i32
  %72 = icmp eq i32 %71, 68
  br i1 %72, label %73, label %77

73:                                               ; preds = %66
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = sub nsw i32 %75, %74
  store i32 %76, ptr %4, align 4, !tbaa !5
  br label %81

77:                                               ; preds = %66
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = sub nsw i32 %79, %78
  store i32 %80, ptr %5, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %77, %73
  br label %82

82:                                               ; preds = %81, %65
  br label %83

83:                                               ; preds = %82, %45
  br label %140

84:                                               ; preds = %18
  %85 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %9)
  %86 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %85, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %87 = load i8, ptr %8, align 1, !tbaa !9
  %88 = sext i8 %87 to i32
  %89 = icmp eq i32 %88, 67
  br i1 %89, label %90, label %112

90:                                               ; preds = %84
  %91 = load i8, ptr %9, align 1, !tbaa !9
  %92 = sext i8 %91 to i32
  %93 = icmp eq i32 %92, 68
  br i1 %93, label %94, label %98

94:                                               ; preds = %90
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = sub nsw i32 %96, %95
  store i32 %97, ptr %4, align 4, !tbaa !5
  br label %111

98:                                               ; preds = %90
  %99 = load i8, ptr %9, align 1, !tbaa !9
  %100 = sext i8 %99 to i32
  %101 = icmp eq i32 %100, 69
  br i1 %101, label %102, label %106

102:                                              ; preds = %98
  %103 = load i32, ptr %7, align 4, !tbaa !5
  %104 = load i32, ptr %5, align 4, !tbaa !5
  %105 = sub nsw i32 %104, %103
  store i32 %105, ptr %5, align 4, !tbaa !5
  br label %110

106:                                              ; preds = %98
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = sub nsw i32 %108, %107
  store i32 %109, ptr %6, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %106, %102
  br label %111

111:                                              ; preds = %110, %94
  br label %139

112:                                              ; preds = %84
  %113 = load i8, ptr %8, align 1, !tbaa !9
  %114 = sext i8 %113 to i32
  %115 = icmp eq i32 %114, 86
  br i1 %115, label %116, label %138

116:                                              ; preds = %112
  %117 = load i8, ptr %9, align 1, !tbaa !9
  %118 = sext i8 %117 to i32
  %119 = icmp eq i32 %118, 68
  br i1 %119, label %120, label %124

120:                                              ; preds = %116
  %121 = load i32, ptr %7, align 4, !tbaa !5
  %122 = load i32, ptr %4, align 4, !tbaa !5
  %123 = add nsw i32 %122, %121
  store i32 %123, ptr %4, align 4, !tbaa !5
  br label %137

124:                                              ; preds = %116
  %125 = load i8, ptr %9, align 1, !tbaa !9
  %126 = sext i8 %125 to i32
  %127 = icmp eq i32 %126, 69
  br i1 %127, label %128, label %132

128:                                              ; preds = %124
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = load i32, ptr %5, align 4, !tbaa !5
  %131 = add nsw i32 %130, %129
  store i32 %131, ptr %5, align 4, !tbaa !5
  br label %136

132:                                              ; preds = %124
  %133 = load i32, ptr %7, align 4, !tbaa !5
  %134 = load i32, ptr %6, align 4, !tbaa !5
  %135 = add nsw i32 %134, %133
  store i32 %135, ptr %6, align 4, !tbaa !5
  br label %136

136:                                              ; preds = %132, %128
  br label %137

137:                                              ; preds = %136, %120
  br label %138

138:                                              ; preds = %137, %112
  br label %139

139:                                              ; preds = %138, %111
  br label %140

140:                                              ; preds = %139, %83
  br label %14, !llvm.loop !10

141:                                              ; preds = %14
  %142 = load i32, ptr %4, align 4, !tbaa !5
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %142)
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %143, ptr noundef @.str)
  %145 = load i32, ptr %5, align 4, !tbaa !5
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %144, i32 noundef %145)
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %146, ptr noundef @.str)
  %148 = load i32, ptr %6, align 4, !tbaa !5
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %147, i32 noundef %148)
  %150 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %149, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  ret i32 0
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #2

; 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) #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 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 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"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" }

@_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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i8, align 1
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #5
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = add nsw i32 %10, -1
  store i32 %11, ptr %2, align 4, !tbaa !5
  %.not26 = icmp eq i32 %10, 0
  br i1 %.not26, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %64
  %.029 = phi i32 [ %.1, %64 ], [ %9, %0 ]
  %.01828 = phi i32 [ %.119, %64 ], [ %9, %0 ]
  %.02027 = phi i32 [ %.121, %64 ], [ %9, %0 ]
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %4)
  %13 = load i8, ptr %4, align 1, !tbaa !9
  %14 = icmp eq i8 %13, 65
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %5)
  br i1 %14, label %16, label %43

16:                                               ; preds = %.lr.ph
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 1 dereferenceable(1) %6)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %19 = load i8, ptr %5, align 1, !tbaa !9
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = load i8, ptr %6, align 1, !tbaa !9
  switch i8 %19, label %36 [
    i8 68, label %22
    i8 69, label %29
  ]

22:                                               ; preds = %16
  %23 = add nsw i32 %20, %.02027
  %24 = icmp eq i8 %21, 69
  br i1 %24, label %25, label %27

25:                                               ; preds = %22
  %26 = sub nsw i32 %.01828, %20
  br label %64

27:                                               ; preds = %22
  %28 = sub nsw i32 %.029, %20
  br label %64

29:                                               ; preds = %16
  %30 = add nsw i32 %20, %.01828
  %31 = icmp eq i8 %21, 68
  br i1 %31, label %32, label %34

32:                                               ; preds = %29
  %33 = sub nsw i32 %.02027, %20
  br label %64

34:                                               ; preds = %29
  %35 = sub nsw i32 %.029, %20
  br label %64

36:                                               ; preds = %16
  %37 = add nsw i32 %20, %.029
  %38 = icmp eq i8 %21, 68
  br i1 %38, label %39, label %41

39:                                               ; preds = %36
  %40 = sub nsw i32 %.02027, %20
  br label %64

41:                                               ; preds = %36
  %42 = sub nsw i32 %.01828, %20
  br label %64

43:                                               ; preds = %.lr.ph
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %45 = load i8, ptr %4, align 1, !tbaa !9
  switch i8 %45, label %64 [
    i8 67, label %46
    i8 86, label %55
  ]

46:                                               ; preds = %43
  %47 = load i8, ptr %5, align 1, !tbaa !9
  %48 = load i32, ptr %3, align 4, !tbaa !5
  switch i8 %47, label %53 [
    i8 68, label %49
    i8 69, label %51
  ]

49:                                               ; preds = %46
  %50 = sub nsw i32 %.02027, %48
  br label %64

51:                                               ; preds = %46
  %52 = sub nsw i32 %.01828, %48
  br label %64

53:                                               ; preds = %46
  %54 = sub nsw i32 %.029, %48
  br label %64

55:                                               ; preds = %43
  %56 = load i8, ptr %5, align 1, !tbaa !9
  %57 = load i32, ptr %3, align 4, !tbaa !5
  switch i8 %56, label %62 [
    i8 68, label %58
    i8 69, label %60
  ]

58:                                               ; preds = %55
  %59 = add nsw i32 %57, %.02027
  br label %64

60:                                               ; preds = %55
  %61 = add nsw i32 %57, %.01828
  br label %64

62:                                               ; preds = %55
  %63 = add nsw i32 %57, %.029
  br label %64

64:                                               ; preds = %43, %51, %53, %49, %58, %62, %60, %27, %25, %39, %41, %32, %34
  %.121 = phi i32 [ %23, %25 ], [ %23, %27 ], [ %33, %32 ], [ %.02027, %34 ], [ %40, %39 ], [ %.02027, %41 ], [ %50, %49 ], [ %.02027, %51 ], [ %.02027, %53 ], [ %59, %58 ], [ %.02027, %60 ], [ %.02027, %62 ], [ %.02027, %43 ]
  %.119 = phi i32 [ %26, %25 ], [ %.01828, %27 ], [ %30, %32 ], [ %30, %34 ], [ %.01828, %39 ], [ %42, %41 ], [ %.01828, %49 ], [ %52, %51 ], [ %.01828, %53 ], [ %.01828, %58 ], [ %61, %60 ], [ %.01828, %62 ], [ %.01828, %43 ]
  %.1 = phi i32 [ %.029, %25 ], [ %28, %27 ], [ %.029, %32 ], [ %35, %34 ], [ %37, %39 ], [ %37, %41 ], [ %.029, %49 ], [ %.029, %51 ], [ %54, %53 ], [ %.029, %58 ], [ %.029, %60 ], [ %63, %62 ], [ %.029, %43 ]
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = add nsw i32 %65, -1
  store i32 %66, ptr %2, align 4, !tbaa !5
  %.not = icmp eq i32 %65, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !10

._crit_edge:                                      ; preds = %64, %0
  %.020.lcssa = phi i32 [ %9, %0 ], [ %.121, %64 ]
  %.018.lcssa = phi i32 [ %9, %0 ], [ %.119, %64 ]
  %.0.lcssa = phi i32 [ %9, %0 ], [ %.1, %64 ]
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.020.lcssa)
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef nonnull @.str)
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %68, i32 noundef %.018.lcssa)
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %69, ptr noundef nonnull @.str)
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %70, i32 noundef %.0.lcssa)
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2

; 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 #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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


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