; LLVM IR from eyangch/competitive-programming :: USACOtraining/3.2 (kimbits)

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %17 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %18 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %19 = getelementptr i8, ptr %18, i64 -24
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %20
  %22 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %21, ptr noundef null)
  %23 = load ptr, ptr @stdin, align 8, !tbaa !8
  %24 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %23)
  %25 = load ptr, ptr @stdout, align 8, !tbaa !8
  %26 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %25)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %30 = load i64, ptr %2, align 8, !tbaa !11
  %31 = add nsw i64 %30, 1
  %32 = load i64, ptr %3, align 8, !tbaa !11
  %33 = add nsw i64 %32, 1
  %34 = call ptr @llvm.stacksave.p0()
  store ptr %34, ptr %5, align 8
  %35 = mul nuw i64 %31, %33
  %36 = alloca i64, i64 %35, align 16
  store i64 %31, ptr %6, align 8
  store i64 %33, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !13
  br label %37

37:                                               ; preds = %49, %0
  %38 = load i32, ptr %8, align 4, !tbaa !13
  %39 = sext i32 %38 to i64
  %40 = load i64, ptr %3, align 8, !tbaa !11
  %41 = icmp sle i64 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %52

43:                                               ; preds = %37
  %44 = mul nsw i64 0, %33
  %45 = getelementptr inbounds i64, ptr %36, i64 %44
  %46 = load i32, ptr %8, align 4, !tbaa !13
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i64, ptr %45, i64 %47
  store i64 1, ptr %48, align 8, !tbaa !11
  br label %49

49:                                               ; preds = %43
  %50 = load i32, ptr %8, align 4, !tbaa !13
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %8, align 4, !tbaa !13
  br label %37, !llvm.loop !15

52:                                               ; preds = %42
  %53 = mul nsw i64 1, %33
  %54 = getelementptr inbounds i64, ptr %36, i64 %53
  %55 = getelementptr inbounds i64, ptr %54, i64 0
  store i64 1, ptr %55, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 1, ptr %9, align 4, !tbaa !13
  br label %56

56:                                               ; preds = %68, %52
  %57 = load i32, ptr %9, align 4, !tbaa !13
  %58 = sext i32 %57 to i64
  %59 = load i64, ptr %3, align 8, !tbaa !11
  %60 = icmp sle i64 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %71

62:                                               ; preds = %56
  %63 = mul nsw i64 1, %33
  %64 = getelementptr inbounds i64, ptr %36, i64 %63
  %65 = load i32, ptr %9, align 4, !tbaa !13
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i64, ptr %64, i64 %66
  store i64 2, ptr %67, align 8, !tbaa !11
  br label %68

68:                                               ; preds = %62
  %69 = load i32, ptr %9, align 4, !tbaa !13
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %9, align 4, !tbaa !13
  br label %56, !llvm.loop !17

71:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 2, ptr %10, align 4, !tbaa !13
  br label %72

72:                                               ; preds = %122, %71
  %73 = load i32, ptr %10, align 4, !tbaa !13
  %74 = sext i32 %73 to i64
  %75 = load i64, ptr %2, align 8, !tbaa !11
  %76 = icmp sle i64 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %72
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %125

78:                                               ; preds = %72
  %79 = load i32, ptr %10, align 4, !tbaa !13
  %80 = sext i32 %79 to i64
  %81 = mul nsw i64 %80, %33
  %82 = getelementptr inbounds i64, ptr %36, i64 %81
  %83 = getelementptr inbounds i64, ptr %82, i64 0
  store i64 1, ptr %83, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 1, ptr %12, align 4, !tbaa !13
  br label %84

84:                                               ; preds = %118, %78
  %85 = load i32, ptr %12, align 4, !tbaa !13
  %86 = sext i32 %85 to i64
  %87 = load i64, ptr %3, align 8, !tbaa !11
  %88 = icmp sle i64 %86, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %84
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %121

90:                                               ; preds = %84
  %91 = load i32, ptr %10, align 4, !tbaa !13
  %92 = sub nsw i32 %91, 1
  %93 = sext i32 %92 to i64
  %94 = mul nsw i64 %93, %33
  %95 = getelementptr inbounds i64, ptr %36, i64 %94
  %96 = load i32, ptr %12, align 4, !tbaa !13
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i64, ptr %95, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !11
  %100 = load i32, ptr %10, align 4, !tbaa !13
  %101 = sub nsw i32 %100, 1
  %102 = sext i32 %101 to i64
  %103 = mul nsw i64 %102, %33
  %104 = getelementptr inbounds i64, ptr %36, i64 %103
  %105 = load i32, ptr %12, align 4, !tbaa !13
  %106 = sub nsw i32 %105, 1
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i64, ptr %104, i64 %107
  %109 = load i64, ptr %108, align 8, !tbaa !11
  %110 = add nsw i64 %99, %109
  %111 = load i32, ptr %10, align 4, !tbaa !13
  %112 = sext i32 %111 to i64
  %113 = mul nsw i64 %112, %33
  %114 = getelementptr inbounds i64, ptr %36, i64 %113
  %115 = load i32, ptr %12, align 4, !tbaa !13
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds i64, ptr %114, i64 %116
  store i64 %110, ptr %117, align 8, !tbaa !11
  br label %118

118:                                              ; preds = %90
  %119 = load i32, ptr %12, align 4, !tbaa !13
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %12, align 4, !tbaa !13
  br label %84, !llvm.loop !18

121:                                              ; preds = %89
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %10, align 4, !tbaa !13
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %10, align 4, !tbaa !13
  br label %72, !llvm.loop !19

125:                                              ; preds = %77
  %126 = load i64, ptr %4, align 8, !tbaa !11
  %127 = add nsw i64 %126, -1
  store i64 %127, ptr %4, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %128 = load i64, ptr %2, align 8, !tbaa !11
  %129 = sub nsw i64 %128, 1
  %130 = trunc i64 %129 to i32
  store i32 %130, ptr %14, align 4, !tbaa !13
  br label %131

131:                                              ; preds = %167, %125
  %132 = load i32, ptr %14, align 4, !tbaa !13
  %133 = icmp sge i32 %132, 0
  br i1 %133, label %135, label %134

134:                                              ; preds = %131
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %170

135:                                              ; preds = %131
  %136 = load i64, ptr %4, align 8, !tbaa !11
  %137 = load i32, ptr %14, align 4, !tbaa !13
  %138 = sext i32 %137 to i64
  %139 = mul nsw i64 %138, %33
  %140 = getelementptr inbounds i64, ptr %36, i64 %139
  %141 = load i64, ptr %3, align 8, !tbaa !11
  %142 = getelementptr inbounds i64, ptr %140, i64 %141
  %143 = load i64, ptr %142, align 8, !tbaa !11
  %144 = icmp sge i64 %136, %143
  br i1 %144, label %145, label %163

145:                                              ; preds = %135
  %146 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %13, i8 noundef signext 49)
          to label %147 unwind label %159

147:                                              ; preds = %145
  %148 = load i32, ptr %14, align 4, !tbaa !13
  %149 = sext i32 %148 to i64
  %150 = mul nsw i64 %149, %33
  %151 = getelementptr inbounds i64, ptr %36, i64 %150
  %152 = load i64, ptr %3, align 8, !tbaa !11
  %153 = getelementptr inbounds i64, ptr %151, i64 %152
  %154 = load i64, ptr %153, align 8, !tbaa !11
  %155 = load i64, ptr %4, align 8, !tbaa !11
  %156 = srem i64 %155, %154
  store i64 %156, ptr %4, align 8, !tbaa !11
  %157 = load i64, ptr %3, align 8, !tbaa !11
  %158 = add nsw i64 %157, -1
  store i64 %158, ptr %3, align 8, !tbaa !11
  br label %166

159:                                              ; preds = %163, %145
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %15, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %181

163:                                              ; preds = %135
  %164 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %13, i8 noundef signext 48)
          to label %165 unwind label %159

165:                                              ; preds = %163
  br label %166

166:                                              ; preds = %165, %147
  br label %167

167:                                              ; preds = %166
  %168 = load i32, ptr %14, align 4, !tbaa !13
  %169 = add nsw i32 %168, -1
  store i32 %169, ptr %14, align 4, !tbaa !13
  br label %131, !llvm.loop !20

170:                                              ; preds = %134
  %171 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %172 unwind label %177

172:                                              ; preds = %170
  %173 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %171, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %174 unwind label %177

174:                                              ; preds = %172
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  %175 = load ptr, ptr %5, align 8
  call void @llvm.stackrestore.p0(ptr %175)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %176 = load i32, ptr %1, align 4
  ret i32 %176

177:                                              ; preds = %172, %170
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %15, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %16, align 4
  br label %181

181:                                              ; preds = %177, %159
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %182

182:                                              ; preds = %181
  %183 = load ptr, ptr %15, align 8
  %184 = load i32, ptr %16, align 4
  %185 = insertvalue { ptr, i32 } poison, ptr %183, 0
  %186 = insertvalue { ptr, i32 } %185, i32 %184, 1
  resume { ptr, i32 } %186
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) #6

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !10, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !10, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}


; 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
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, 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 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  %11 = load ptr, ptr @stdin, align 8, !tbaa !8
  %12 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %11)
  %13 = load ptr, ptr @stdout, align 8, !tbaa !8
  %14 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %13)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %18 = load i64, ptr %1, align 8, !tbaa !11
  %19 = add nsw i64 %18, 1
  %20 = load i64, ptr %2, align 8, !tbaa !11
  %21 = add nsw i64 %20, 1
  %22 = call ptr @llvm.stacksave.p0()
  %23 = mul nuw i64 %21, %19
  %24 = alloca i64, i64 %23, align 16
  %25 = load i64, ptr %2, align 8, !tbaa !11
  %.not39 = icmp slt i64 %25, 0
  br i1 %.not39, label %.preheader.thread, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %26 = add nuw i64 %25, 1
  %min.iters.check = icmp ult i64 %25, 3
  br i1 %min.iters.check, label %.lr.ph.preheader118, label %vector.ph

.lr.ph.preheader118:                              ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %26, -4
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %27 = getelementptr inbounds i64, ptr %24, i64 %index
  %28 = getelementptr inbounds i8, ptr %27, i64 16
  store <2 x i64> <i64 1, i64 1>, ptr %27, align 16, !tbaa !11
  store <2 x i64> <i64 1, i64 1>, ptr %28, align 16, !tbaa !11
  %index.next = add nuw i64 %index, 4
  %29 = icmp eq i64 %index.next, %n.vec
  br i1 %29, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %26, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader118

._crit_edge:                                      ; preds = %.lr.ph, %middle.block
  %30 = getelementptr inbounds i64, ptr %24, i64 %21
  store i64 1, ptr %30, align 8, !tbaa !11
  %.not3441 = icmp eq i64 %25, 0
  br i1 %.not3441, label %.preheader, label %.lr.ph44.preheader

.lr.ph44.preheader:                               ; preds = %._crit_edge
  %min.iters.check90 = icmp ult i64 %25, 4
  br i1 %min.iters.check90, label %.lr.ph44.preheader117, label %vector.ph91

.lr.ph44.preheader117:                            ; preds = %middle.block88, %.lr.ph44.preheader
  %indvars.iv61.ph = phi i64 [ 1, %.lr.ph44.preheader ], [ %ind.end, %middle.block88 ]
  br label %.lr.ph44

vector.ph91:                                      ; preds = %.lr.ph44.preheader
  %n.vec93 = and i64 %25, 9223372036854775804
  %ind.end = or disjoint i64 %n.vec93, 1
  br label %vector.body95

vector.body95:                                    ; preds = %vector.body95, %vector.ph91
  %index96 = phi i64 [ 0, %vector.ph91 ], [ %index.next97, %vector.body95 ]
  %offset.idx = or disjoint i64 %index96, 1
  %31 = getelementptr inbounds i64, ptr %30, i64 %offset.idx
  %32 = getelementptr inbounds i8, ptr %31, i64 16
  store <2 x i64> <i64 2, i64 2>, ptr %31, align 8, !tbaa !11
  store <2 x i64> <i64 2, i64 2>, ptr %32, align 8, !tbaa !11
  %index.next97 = add nuw i64 %index96, 4
  %33 = icmp eq i64 %index.next97, %n.vec93
  br i1 %33, label %middle.block88, label %vector.body95, !llvm.loop !17

middle.block88:                                   ; preds = %vector.body95
  %cmp.n98 = icmp eq i64 %25, %n.vec93
  br i1 %cmp.n98, label %.preheader, label %.lr.ph44.preheader117

.lr.ph:                                           ; preds = %.lr.ph.preheader118, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader118 ]
  %34 = getelementptr inbounds i64, ptr %24, i64 %indvars.iv
  store i64 1, ptr %34, align 8, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond = icmp eq i64 %indvars.iv, %25
  br i1 %exitcond, label %._crit_edge, label %.lr.ph, !llvm.loop !18

.preheader:                                       ; preds = %.lr.ph44, %middle.block88, %._crit_edge
  %35 = load i64, ptr %1, align 8, !tbaa !11
  %.not3550 = icmp slt i64 %35, 2
  br i1 %.not3550, label %._crit_edge53, label %.lr.ph52

.preheader.thread:                                ; preds = %0
  %36 = getelementptr inbounds i64, ptr %24, i64 %21
  store i64 1, ptr %36, align 8, !tbaa !11
  %37 = load i64, ptr %1, align 8, !tbaa !11
  %.not355083 = icmp slt i64 %37, 2
  br i1 %.not355083, label %._crit_edge53, label %.lr.ph52.split.us.preheader

.lr.ph52:                                         ; preds = %.preheader
  br i1 %.not3441, label %.lr.ph52.split.us.preheader, label %.lr.ph48.preheader

.lr.ph48.preheader:                               ; preds = %.lr.ph52
  %38 = shl i64 %20, 3
  %39 = add nuw i64 %25, 1
  %min.iters.check102 = icmp ult i64 %25, 4
  %40 = add i64 %38, 16
  %conflict.rdx = icmp ult i64 %40, 40
  %or.cond = select i1 %min.iters.check102, i1 true, i1 %conflict.rdx
  %n.vec105 = and i64 %25, 9223372036854775804
  %ind.end106 = or disjoint i64 %n.vec105, 1
  %cmp.n115 = icmp eq i64 %25, %n.vec105
  br label %.lr.ph48

.lr.ph52.split.us.preheader:                      ; preds = %.preheader.thread, %.lr.ph52
  %41 = phi i64 [ %35, %.lr.ph52 ], [ %37, %.preheader.thread ]
  %42 = add nsw i64 %41, -1
  %43 = add nsw i64 %41, -2
  %xtraiter119 = and i64 %42, 3
  %44 = icmp ult i64 %43, 3
  br i1 %44, label %._crit_edge53.loopexit.unr-lcssa, label %.lr.ph52.split.us.preheader.new

.lr.ph52.split.us.preheader.new:                  ; preds = %.lr.ph52.split.us.preheader
  %unroll_iter = and i64 %42, -4
  br label %.lr.ph52.split.us

.lr.ph52.split.us:                                ; preds = %.lr.ph52.split.us, %.lr.ph52.split.us.preheader.new
  %indvars.iv73 = phi i64 [ 2, %.lr.ph52.split.us.preheader.new ], [ %indvars.iv.next74.3, %.lr.ph52.split.us ]
  %niter = phi i64 [ 0, %.lr.ph52.split.us.preheader.new ], [ %niter.next.3, %.lr.ph52.split.us ]
  %45 = mul nsw i64 %indvars.iv73, %21
  %46 = getelementptr inbounds i64, ptr %24, i64 %45
  store i64 1, ptr %46, align 16, !tbaa !11
  %indvars.iv.next74 = or disjoint i64 %indvars.iv73, 1
  %47 = mul nsw i64 %indvars.iv.next74, %21
  %48 = getelementptr inbounds i64, ptr %24, i64 %47
  store i64 1, ptr %48, align 8, !tbaa !11
  %indvars.iv.next74.1 = add nuw nsw i64 %indvars.iv73, 2
  %49 = mul nsw i64 %indvars.iv.next74.1, %21
  %50 = getelementptr inbounds i64, ptr %24, i64 %49
  store i64 1, ptr %50, align 16, !tbaa !11
  %indvars.iv.next74.2 = add nuw nsw i64 %indvars.iv73, 3
  %51 = mul nsw i64 %indvars.iv.next74.2, %21
  %52 = getelementptr inbounds i64, ptr %24, i64 %51
  store i64 1, ptr %52, align 8, !tbaa !11
  %indvars.iv.next74.3 = add nuw nsw i64 %indvars.iv73, 4
  %niter.next.3 = add nuw i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge53.loopexit.unr-lcssa, label %.lr.ph52.split.us, !llvm.loop !19

.lr.ph44:                                         ; preds = %.lr.ph44.preheader117, %.lr.ph44
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %.lr.ph44 ], [ %indvars.iv61.ph, %.lr.ph44.preheader117 ]
  %53 = getelementptr inbounds i64, ptr %30, i64 %indvars.iv61
  store i64 2, ptr %53, align 8, !tbaa !11
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %exitcond64 = icmp eq i64 %indvars.iv61, %25
  br i1 %exitcond64, label %.preheader, label %.lr.ph44, !llvm.loop !20

._crit_edge53.loopexit.unr-lcssa:                 ; preds = %.lr.ph52.split.us, %.lr.ph52.split.us.preheader
  %indvars.iv73.unr = phi i64 [ 2, %.lr.ph52.split.us.preheader ], [ %indvars.iv.next74.3, %.lr.ph52.split.us ]
  %lcmp.mod120.not = icmp eq i64 %xtraiter119, 0
  br i1 %lcmp.mod120.not, label %._crit_edge53, label %.lr.ph52.split.us.epil

.lr.ph52.split.us.epil:                           ; preds = %._crit_edge53.loopexit.unr-lcssa, %.lr.ph52.split.us.epil
  %indvars.iv73.epil = phi i64 [ %indvars.iv.next74.epil, %.lr.ph52.split.us.epil ], [ %indvars.iv73.unr, %._crit_edge53.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph52.split.us.epil ], [ 0, %._crit_edge53.loopexit.unr-lcssa ]
  %54 = mul nsw i64 %indvars.iv73.epil, %21
  %55 = getelementptr inbounds i64, ptr %24, i64 %54
  store i64 1, ptr %55, align 8, !tbaa !11
  %indvars.iv.next74.epil = add nuw nsw i64 %indvars.iv73.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter119
  br i1 %epil.iter.cmp.not, label %._crit_edge53, label %.lr.ph52.split.us.epil, !llvm.loop !21

._crit_edge53:                                    ; preds = %._crit_edge49, %._crit_edge53.loopexit.unr-lcssa, %.lr.ph52.split.us.epil, %.preheader.thread, %.preheader
  %56 = load i64, ptr %3, align 8, !tbaa !11
  %57 = add nsw i64 %56, -1
  store i64 %57, ptr %3, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  %58 = load i64, ptr %1, align 8, !tbaa !11
  %59 = trunc i64 %58 to i32
  %.02554 = add i32 %59, -1
  %60 = icmp sgt i32 %.02554, -1
  br i1 %60, label %.lr.ph57.preheader, label %._crit_edge58

.lr.ph57.preheader:                               ; preds = %._crit_edge53
  %61 = zext nneg i32 %.02554 to i64
  br label %.lr.ph57

.lr.ph48:                                         ; preds = %.lr.ph48.preheader, %._crit_edge49
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %._crit_edge49 ], [ 2, %.lr.ph48.preheader ]
  %62 = mul nsw i64 %indvars.iv69, %21
  %63 = getelementptr inbounds i64, ptr %24, i64 %62
  store i64 1, ptr %63, align 8, !tbaa !11
  %64 = add nsw i64 %indvars.iv69, -1
  %65 = mul nsw i64 %21, %64
  %66 = getelementptr inbounds i64, ptr %24, i64 %65
  br i1 %or.cond, label %scalar.ph101.preheader, label %vector.body108

scalar.ph101.preheader:                           ; preds = %middle.block100, %.lr.ph48
  %indvars.iv65.ph = phi i64 [ 1, %.lr.ph48 ], [ %ind.end106, %middle.block100 ]
  %67 = sub i64 %39, %indvars.iv65.ph
  %68 = sub i64 %25, %indvars.iv65.ph
  %xtraiter = and i64 %67, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph101.prol.loopexit, label %scalar.ph101.prol

scalar.ph101.prol:                                ; preds = %scalar.ph101.preheader, %scalar.ph101.prol
  %indvars.iv65.prol = phi i64 [ %indvars.iv.next66.prol, %scalar.ph101.prol ], [ %indvars.iv65.ph, %scalar.ph101.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph101.prol ], [ 0, %scalar.ph101.preheader ]
  %69 = getelementptr inbounds i64, ptr %66, i64 %indvars.iv65.prol
  %70 = load i64, ptr %69, align 8, !tbaa !11
  %71 = getelementptr i8, ptr %69, i64 -8
  %72 = load i64, ptr %71, align 8, !tbaa !11
  %73 = add nsw i64 %72, %70
  %74 = getelementptr inbounds i64, ptr %63, i64 %indvars.iv65.prol
  store i64 %73, ptr %74, align 8, !tbaa !11
  %indvars.iv.next66.prol = add nuw nsw i64 %indvars.iv65.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph101.prol.loopexit, label %scalar.ph101.prol, !llvm.loop !23

scalar.ph101.prol.loopexit:                       ; preds = %scalar.ph101.prol, %scalar.ph101.preheader
  %indvars.iv65.unr = phi i64 [ %indvars.iv65.ph, %scalar.ph101.preheader ], [ %indvars.iv.next66.prol, %scalar.ph101.prol ]
  %75 = icmp ult i64 %68, 3
  br i1 %75, label %._crit_edge49, label %scalar.ph101

vector.body108:                                   ; preds = %.lr.ph48, %vector.body108
  %index109 = phi i64 [ %index.next114, %vector.body108 ], [ 0, %.lr.ph48 ]
  %offset.idx110 = or disjoint i64 %index109, 1
  %76 = getelementptr inbounds i64, ptr %66, i64 %offset.idx110
  %77 = getelementptr inbounds i8, ptr %76, i64 16
  %wide.load = load <2 x i64>, ptr %76, align 8, !tbaa !11
  %wide.load111 = load <2 x i64>, ptr %77, align 8, !tbaa !11
  %78 = getelementptr i8, ptr %76, i64 -8
  %79 = getelementptr i8, ptr %76, i64 8
  %wide.load112 = load <2 x i64>, ptr %78, align 8, !tbaa !11
  %wide.load113 = load <2 x i64>, ptr %79, align 8, !tbaa !11
  %80 = add nsw <2 x i64> %wide.load112, %wide.load
  %81 = add nsw <2 x i64> %wide.load113, %wide.load111
  %82 = getelementptr inbounds i64, ptr %63, i64 %offset.idx110
  %83 = getelementptr inbounds i8, ptr %82, i64 16
  store <2 x i64> %80, ptr %82, align 8, !tbaa !11
  store <2 x i64> %81, ptr %83, align 8, !tbaa !11
  %index.next114 = add nuw i64 %index109, 4
  %84 = icmp eq i64 %index.next114, %n.vec105
  br i1 %84, label %middle.block100, label %vector.body108, !llvm.loop !24

middle.block100:                                  ; preds = %vector.body108
  br i1 %cmp.n115, label %._crit_edge49, label %scalar.ph101.preheader

._crit_edge49:                                    ; preds = %scalar.ph101.prol.loopexit, %scalar.ph101, %middle.block100
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %exitcond72 = icmp eq i64 %indvars.iv69, %35
  br i1 %exitcond72, label %._crit_edge53, label %.lr.ph48, !llvm.loop !19

scalar.ph101:                                     ; preds = %scalar.ph101.prol.loopexit, %scalar.ph101
  %indvars.iv65 = phi i64 [ %indvars.iv.next66.3, %scalar.ph101 ], [ %indvars.iv65.unr, %scalar.ph101.prol.loopexit ]
  %85 = getelementptr inbounds i64, ptr %66, i64 %indvars.iv65
  %86 = load i64, ptr %85, align 8, !tbaa !11
  %87 = getelementptr i8, ptr %85, i64 -8
  %88 = load i64, ptr %87, align 8, !tbaa !11
  %89 = add nsw i64 %88, %86
  %90 = getelementptr inbounds i64, ptr %63, i64 %indvars.iv65
  store i64 %89, ptr %90, align 8, !tbaa !11
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %91 = getelementptr inbounds i64, ptr %66, i64 %indvars.iv.next66
  %92 = load i64, ptr %91, align 8, !tbaa !11
  %93 = getelementptr i8, ptr %91, i64 -8
  %94 = load i64, ptr %93, align 8, !tbaa !11
  %95 = add nsw i64 %94, %92
  %96 = getelementptr inbounds i64, ptr %63, i64 %indvars.iv.next66
  store i64 %95, ptr %96, align 8, !tbaa !11
  %indvars.iv.next66.1 = add nuw nsw i64 %indvars.iv65, 2
  %97 = getelementptr inbounds i64, ptr %66, i64 %indvars.iv.next66.1
  %98 = load i64, ptr %97, align 8, !tbaa !11
  %99 = getelementptr i8, ptr %97, i64 -8
  %100 = load i64, ptr %99, align 8, !tbaa !11
  %101 = add nsw i64 %100, %98
  %102 = getelementptr inbounds i64, ptr %63, i64 %indvars.iv.next66.1
  store i64 %101, ptr %102, align 8, !tbaa !11
  %indvars.iv.next66.2 = add nuw nsw i64 %indvars.iv65, 3
  %103 = getelementptr inbounds i64, ptr %66, i64 %indvars.iv.next66.2
  %104 = load i64, ptr %103, align 8, !tbaa !11
  %105 = getelementptr i8, ptr %103, i64 -8
  %106 = load i64, ptr %105, align 8, !tbaa !11
  %107 = add nsw i64 %106, %104
  %108 = getelementptr inbounds i64, ptr %63, i64 %indvars.iv.next66.2
  store i64 %107, ptr %108, align 8, !tbaa !11
  %indvars.iv.next66.3 = add nuw nsw i64 %indvars.iv65, 4
  %exitcond68.3 = icmp eq i64 %indvars.iv.next66.2, %25
  br i1 %exitcond68.3, label %._crit_edge49, label %scalar.ph101, !llvm.loop !25

._crit_edge58:                                    ; preds = %129, %._crit_edge53
  %109 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %131 unwind label %134

.lr.ph57:                                         ; preds = %.lr.ph57.preheader, %129
  %indvars.iv77 = phi i64 [ %61, %.lr.ph57.preheader ], [ %indvars.iv.next78, %129 ]
  %110 = load i64, ptr %3, align 8, !tbaa !11
  %111 = mul nsw i64 %21, %indvars.iv77
  %112 = getelementptr inbounds i64, ptr %24, i64 %111
  %113 = load i64, ptr %2, align 8, !tbaa !11
  %114 = getelementptr inbounds i64, ptr %112, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !11
  %.not36 = icmp slt i64 %110, %115
  br i1 %.not36, label %127, label %116

116:                                              ; preds = %.lr.ph57
  %117 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %4, i8 noundef signext 49)
          to label %118 unwind label %125

118:                                              ; preds = %116
  %119 = load i64, ptr %2, align 8, !tbaa !11
  %120 = getelementptr inbounds i64, ptr %112, i64 %119
  %121 = load i64, ptr %120, align 8, !tbaa !11
  %122 = load i64, ptr %3, align 8, !tbaa !11
  %123 = srem i64 %122, %121
  store i64 %123, ptr %3, align 8, !tbaa !11
  %124 = add nsw i64 %119, -1
  store i64 %124, ptr %2, align 8, !tbaa !11
  br label %129

125:                                              ; preds = %127, %116
  %126 = landingpad { ptr, i32 }
          cleanup
  br label %136

127:                                              ; preds = %.lr.ph57
  %128 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %4, i8 noundef signext 48)
          to label %129 unwind label %125

129:                                              ; preds = %118, %127
  %indvars.iv.next78 = add nsw i64 %indvars.iv77, -1
  %130 = icmp sgt i64 %indvars.iv77, 0
  br i1 %130, label %.lr.ph57, label %._crit_edge58, !llvm.loop !26

131:                                              ; preds = %._crit_edge58
  %132 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %109, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %133 unwind label %134

133:                                              ; preds = %131
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  call void @llvm.stackrestore.p0(ptr %22)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0

134:                                              ; preds = %131, %._crit_edge58
  %135 = landingpad { ptr, i32 }
          cleanup
  br label %136

136:                                              ; preds = %134, %125
  %.pn = phi { ptr, i32 } [ %126, %125 ], [ %135, %134 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 = { "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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !10, i64 0}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !14, !15, !16}
!18 = distinct !{!18, !14, !16, !15}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14, !16, !15}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.unroll.disable"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !14, !15, !16}
!25 = distinct !{!25, !14, !15}
!26 = distinct !{!26, !14}


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