; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/294 Division 2/Problem D (D)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.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" }

@sum = external dso_local global [100000 x i64], align 16
@total = external dso_local global i64, align 8
@sums = external dso_local global %"class.std::map", align 8
@vals = external dso_local global [26 x i32], align 16
@l = external dso_local global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %8

8:                                                ; preds = %17, %0
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = icmp slt i32 %9, 26
  br i1 %10, label %12, label %11

11:                                               ; preds = %8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %20

12:                                               ; preds = %8
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [26 x i32], ptr @vals, i64 0, i64 %14
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %15)
  br label %17

17:                                               ; preds = %12
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %2, align 4, !tbaa !5
  br label %8, !llvm.loop !9

20:                                               ; preds = %11
  %21 = call 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) @_Z1sB5cxx11)
  %22 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #6
  %23 = trunc i64 %22 to i32
  store i32 %23, ptr @l, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %65, %20
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = load i32, ptr @l, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %68

29:                                               ; preds = %24
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %32, label %49

32:                                               ; preds = %29
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = sub nsw i32 %33, 1
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100000 x i64], ptr @sum, i64 0, i64 %35
  %37 = load i64, ptr %36, align 8, !tbaa !11
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %39)
  %41 = load i8, ptr %40, align 1, !tbaa !13
  %42 = sext i8 %41 to i32
  %43 = sub nsw i32 %42, 97
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [26 x i32], ptr @vals, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = add nsw i64 %37, %47
  br label %60

49:                                               ; preds = %29
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %51)
  %53 = load i8, ptr %52, align 1, !tbaa !13
  %54 = sext i8 %53 to i32
  %55 = sub nsw i32 %54, 97
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [26 x i32], ptr @vals, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  br label %60

60:                                               ; preds = %49, %32
  %61 = phi i64 [ %48, %32 ], [ %59, %49 ]
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100000 x i64], ptr @sum, i64 0, i64 %63
  store i64 %61, ptr %64, align 8, !tbaa !11
  br label %65

65:                                               ; preds = %60
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %3, align 4, !tbaa !5
  br label %24, !llvm.loop !14

68:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %145, %68
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = icmp slt i32 %70, 26
  br i1 %71, label %73, label %72

72:                                               ; preds = %69
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %148

73:                                               ; preds = %69
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @sums) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %91, %73
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = load i32, ptr @l, align 4, !tbaa !5
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %78, label %89

78:                                               ; preds = %74
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %80)
  %82 = load i8, ptr %81, align 1, !tbaa !13
  %83 = sext i8 %82 to i32
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = add nsw i32 %84, 97
  %86 = trunc i32 %85 to i8
  %87 = sext i8 %86 to i32
  %88 = icmp ne i32 %83, %87
  br label %89

89:                                               ; preds = %78, %74
  %90 = phi i1 [ false, %74 ], [ %88, %78 ]
  br i1 %90, label %91, label %94

91:                                               ; preds = %89
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %6, align 4, !tbaa !5
  br label %74, !llvm.loop !15

94:                                               ; preds = %89
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = load i32, ptr @l, align 4, !tbaa !5
  %97 = icmp eq i32 %95, %96
  br i1 %97, label %98, label %99

98:                                               ; preds = %94
  store i32 10, ptr %5, align 4
  br label %142

99:                                               ; preds = %94
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100000 x i64], ptr @sum, i64 0, i64 %101
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @sums, ptr noundef nonnull align 8 dereferenceable(8) %102)
  store i64 1, ptr %103, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %7, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %138, %99
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = load i32, ptr @l, align 4, !tbaa !5
  %109 = icmp slt i32 %107, %108
  br i1 %109, label %111, label %110

110:                                              ; preds = %106
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %141

111:                                              ; preds = %106
  %112 = load i32, ptr %7, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %113)
  %115 = load i8, ptr %114, align 1, !tbaa !13
  %116 = sext i8 %115 to i32
  %117 = load i32, ptr %4, align 4, !tbaa !5
  %118 = add nsw i32 %117, 97
  %119 = trunc i32 %118 to i8
  %120 = sext i8 %119 to i32
  %121 = icmp eq i32 %116, %120
  br i1 %121, label %122, label %137

122:                                              ; preds = %111
  %123 = load i32, ptr %7, align 4, !tbaa !5
  %124 = sub nsw i32 %123, 1
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [100000 x i64], ptr @sum, i64 0, i64 %125
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @sums, ptr noundef nonnull align 8 dereferenceable(8) %126)
  %128 = load i64, ptr %127, align 8, !tbaa !11
  %129 = load i64, ptr @total, align 8, !tbaa !11
  %130 = add nsw i64 %129, %128
  store i64 %130, ptr @total, align 8, !tbaa !11
  %131 = load i32, ptr %7, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [100000 x i64], ptr @sum, i64 0, i64 %132
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @sums, ptr noundef nonnull align 8 dereferenceable(8) %133)
  %135 = load i64, ptr %134, align 8, !tbaa !11
  %136 = add nsw i64 %135, 1
  store i64 %136, ptr %134, align 8, !tbaa !11
  br label %137

137:                                              ; preds = %122, %111
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %7, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %7, align 4, !tbaa !5
  br label %106, !llvm.loop !16

141:                                              ; preds = %110
  store i32 0, ptr %5, align 4
  br label %142

142:                                              ; preds = %141, %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %143 = load i32, ptr %5, align 4
  switch i32 %143, label %152 [
    i32 0, label %144
    i32 10, label %145
  ]

144:                                              ; preds = %142
  br label %145

145:                                              ; preds = %144, %142
  %146 = load i32, ptr %4, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %4, align 4, !tbaa !5
  br label %69, !llvm.loop !17

148:                                              ; preds = %72
  %149 = load i64, ptr @total, align 8, !tbaa !11
  %150 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %149)
  %151 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %150, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

152:                                              ; preds = %142
  unreachable
}

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

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

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)) #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 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) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #4 align 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)) #5

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 = { 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 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 = { 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 #6 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.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" }

@sum = external dso_local global [100000 x i64], align 16
@total = external dso_local local_unnamed_addr global i64, align 8
@sums = external dso_local global %"class.std::map", align 8
@vals = external dso_local global [26 x i32], align 16
@l = external dso_local local_unnamed_addr global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @vals)
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 4))
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 8))
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 12))
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 16))
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 20))
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 24))
  %8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 28))
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 32))
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 36))
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 40))
  %12 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 44))
  %13 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 48))
  %14 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 52))
  %15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 56))
  %16 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 60))
  %17 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 64))
  %18 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 68))
  %19 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 72))
  %20 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 76))
  %21 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 80))
  %22 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 84))
  %23 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 88))
  %24 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 92))
  %25 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 96))
  %26 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @vals, i64 100))
  %27 = tail call 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) @_Z1sB5cxx11)
  %28 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #6
  %29 = trunc i64 %28 to i32
  store i32 %29, ptr @l, align 4, !tbaa !5
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %31, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.lr.ph.peel.next, %31, %0
  br label %.preheader

31:                                               ; preds = %0
  %32 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef 0)
  %33 = load i8, ptr %32, align 1, !tbaa !9
  %34 = sext i8 %33 to i64
  %35 = add nsw i64 %34, -97
  %36 = getelementptr inbounds [26 x i32], ptr @vals, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %.pre = load i32, ptr @l, align 4, !tbaa !5
  store i64 %38, ptr @sum, align 16, !tbaa !10
  %39 = icmp sgt i32 %.pre, 1
  br i1 %39, label %.lr.ph.peel.next, label %.preheader.preheader

.lr.ph.peel.next:                                 ; preds = %31, %.lr.ph.peel.next
  %40 = phi i64 [ %48, %.lr.ph.peel.next ], [ %38, %31 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph.peel.next ], [ 1, %31 ]
  %41 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv)
  %.pre53 = load i32, ptr @l, align 4, !tbaa !5
  %42 = load i8, ptr %41, align 1, !tbaa !9
  %43 = sext i8 %42 to i64
  %44 = add nsw i64 %43, -97
  %45 = getelementptr inbounds [26 x i32], ptr @vals, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = add nsw i64 %40, %47
  %49 = getelementptr inbounds [100000 x i64], ptr @sum, i64 0, i64 %indvars.iv
  store i64 %48, ptr %49, align 8, !tbaa !10
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %50 = sext i32 %.pre53 to i64
  %51 = icmp slt i64 %indvars.iv.next, %50
  br i1 %51, label %.lr.ph.peel.next, label %.preheader.preheader, !llvm.loop !12

52:                                               ; preds = %.loopexit
  %53 = load i64, ptr @total, align 8, !tbaa !10
  %54 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %53)
  %55 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.preheader:                                       ; preds = %.preheader.preheader, %.loopexit
  %.02641 = phi i32 [ %97, %.loopexit ], [ 0, %.preheader.preheader ]
  tail call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @sums) #6
  %56 = load i32, ptr @l, align 4, !tbaa !5
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %.lr.ph34, label %.critedge

.lr.ph34:                                         ; preds = %.preheader
  %58 = add nuw nsw i32 %.02641, 97
  br label %59

59:                                               ; preds = %.lr.ph34, %63
  %indvars.iv46 = phi i64 [ 0, %.lr.ph34 ], [ %indvars.iv.next47, %63 ]
  %60 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv46)
  %61 = load i8, ptr %60, align 1, !tbaa !9
  %62 = sext i8 %61 to i32
  %.not = icmp eq i32 %58, %62
  %.pre54.pre = load i32, ptr @l, align 4, !tbaa !5
  br i1 %.not, label %.critedge.loopexit, label %63

63:                                               ; preds = %59
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %64 = sext i32 %.pre54.pre to i64
  %65 = icmp slt i64 %indvars.iv.next47, %64
  br i1 %65, label %59, label %.critedge.loopexit, !llvm.loop !15

.critedge.loopexit:                               ; preds = %63, %59
  %.025.lcssa.ph.in = phi i64 [ %indvars.iv46, %59 ], [ %indvars.iv.next47, %63 ]
  %.025.lcssa.ph = trunc i64 %.025.lcssa.ph.in to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.preheader
  %66 = phi i32 [ %56, %.preheader ], [ %.pre54.pre, %.critedge.loopexit ]
  %.025.lcssa = phi i32 [ 0, %.preheader ], [ %.025.lcssa.ph, %.critedge.loopexit ]
  %67 = icmp eq i32 %.025.lcssa, %66
  br i1 %67, label %.loopexit, label %68

68:                                               ; preds = %.critedge
  %69 = zext nneg i32 %.025.lcssa to i64
  %70 = getelementptr inbounds [100000 x i64], ptr @sum, i64 0, i64 %69
  %71 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @sums, ptr noundef nonnull align 8 dereferenceable(8) %70)
  store i64 1, ptr %71, align 8, !tbaa !10
  %.037 = add nuw nsw i32 %.025.lcssa, 1
  %72 = load i32, ptr @l, align 4, !tbaa !5
  %73 = icmp slt i32 %.037, %72
  br i1 %73, label %.lr.ph40, label %.loopexit

.lr.ph40:                                         ; preds = %68
  %74 = add nuw nsw i32 %.02641, 97
  %75 = add nuw nsw i64 %69, 1
  br label %76

76:                                               ; preds = %.lr.ph40, %92
  %indvars.iv49 = phi i64 [ %75, %.lr.ph40 ], [ %indvars.iv.next50, %92 ]
  %.0.in38 = phi i32 [ %.025.lcssa, %.lr.ph40 ], [ %96, %92 ]
  %77 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv49)
  %78 = load i8, ptr %77, align 1, !tbaa !9
  %79 = sext i8 %78 to i32
  %80 = icmp eq i32 %74, %79
  br i1 %80, label %81, label %92

81:                                               ; preds = %76
  %82 = zext nneg i32 %.0.in38 to i64
  %83 = getelementptr inbounds [100000 x i64], ptr @sum, i64 0, i64 %82
  %84 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @sums, ptr noundef nonnull align 8 dereferenceable(8) %83)
  %85 = load i64, ptr %84, align 8, !tbaa !10
  %86 = load i64, ptr @total, align 8, !tbaa !10
  %87 = add nsw i64 %86, %85
  store i64 %87, ptr @total, align 8, !tbaa !10
  %88 = getelementptr inbounds [100000 x i64], ptr @sum, i64 0, i64 %indvars.iv49
  %89 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @sums, ptr noundef nonnull align 8 dereferenceable(8) %88)
  %90 = load i64, ptr %89, align 8, !tbaa !10
  %91 = add nsw i64 %90, 1
  store i64 %91, ptr %89, align 8, !tbaa !10
  br label %92

92:                                               ; preds = %76, %81
  %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
  %93 = load i32, ptr @l, align 4, !tbaa !5
  %94 = trunc nuw i64 %indvars.iv.next50 to i32
  %95 = icmp sgt i32 %93, %94
  %96 = trunc nuw i64 %indvars.iv49 to i32
  br i1 %95, label %76, label %.loopexit, !llvm.loop !16

.loopexit:                                        ; preds = %92, %68, %.critedge
  %97 = add nuw nsw i32 %.02641, 1
  %exitcond.not = icmp eq i32 %97, 26
  br i1 %exitcond.not, label %52, label %.preheader, !llvm.loop !17
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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 #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 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 #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #4 align 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)) #5

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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 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 = { 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 #6 = { 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 = !{!11, !11, i64 0}
!11 = !{!"long long", !7, i64 0}
!12 = distinct !{!12, !13, !14}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!"llvm.loop.peeled.count", i32 1}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}


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