; LLVM IR from kazunetakahashi/atcoder :: 2019/0721_AGC036 (C)

; 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_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%class.combination = type { %"class.std::vector", %"class.std::vector", %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<mint, std::allocator<mint>>::_Vector_impl" }
%"struct.std::_Vector_base<mint, std::allocator<mint>>::_Vector_impl" = type { %"struct.std::_Vector_base<mint, std::allocator<mint>>::_Vector_impl_data" }
%"struct.std::_Vector_base<mint, std::allocator<mint>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.mint = type { i64 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; 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)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZlsRSoRK4mint(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #0

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 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)) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %class.combination, align 8
  %3 = alloca %class.mint, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca %class.mint, align 8
  %8 = alloca %class.mint, align 8
  %9 = alloca %class.mint, align 8
  %10 = alloca i64, align 8
  %11 = alloca %class.mint, align 8
  %12 = alloca %class.mint, align 8
  %13 = alloca %class.mint, align 8
  store i32 0, ptr %1, align 4
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) @M)
  call void @llvm.lifetime.start.p0(i64 72, ptr %2) #6
  call void @_ZN11combinationC2Ev(ptr noundef nonnull align 8 dereferenceable(72) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %16 = load i64, ptr @M, align 8, !tbaa !5
  %17 = mul nsw i64 3, %16
  %18 = load i64, ptr @N, align 8, !tbaa !5
  %19 = add nsw i64 %17, %18
  %20 = sub nsw i64 %19, 1
  %21 = trunc i64 %20 to i32
  %22 = load i64, ptr @N, align 8, !tbaa !5
  %23 = sub nsw i64 %22, 1
  %24 = trunc i64 %23 to i32
  %25 = invoke i64 @_ZN11combinationclEii(ptr noundef nonnull align 8 dereferenceable(72) %2, i32 noundef %21, i32 noundef %24)
          to label %26 unwind label %37

26:                                               ; preds = %0
  %27 = getelementptr inbounds %class.mint, ptr %3, i32 0, i32 0
  store i64 %25, ptr %27, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %28 = load i64, ptr @M, align 8, !tbaa !5
  %29 = mul nsw i64 3, %28
  store i64 %29, ptr %6, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %63, %26
  %31 = load i64, ptr %6, align 8, !tbaa !5
  %32 = load i64, ptr @M, align 8, !tbaa !5
  %33 = mul nsw i64 2, %32
  %34 = add nsw i64 %33, 1
  %35 = icmp sge i64 %31, %34
  br i1 %35, label %41, label %36

36:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %75

37:                                               ; preds = %123, %121, %0
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %4, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %5, align 4
  br label %127

41:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %42 = load i64, ptr @M, align 8, !tbaa !5
  %43 = mul nsw i64 3, %42
  %44 = load i64, ptr %6, align 8, !tbaa !5
  %45 = sub nsw i64 %43, %44
  %46 = load i64, ptr @N, align 8, !tbaa !5
  %47 = add nsw i64 %45, %46
  %48 = sub nsw i64 %47, 2
  %49 = trunc i64 %48 to i32
  %50 = load i64, ptr @N, align 8, !tbaa !5
  %51 = sub nsw i64 %50, 2
  %52 = trunc i64 %51 to i32
  %53 = invoke i64 @_ZN11combinationclEii(ptr noundef nonnull align 8 dereferenceable(72) %2, i32 noundef %49, i32 noundef %52)
          to label %54 unwind label %66

54:                                               ; preds = %41
  %55 = getelementptr inbounds %class.mint, ptr %8, i32 0, i32 0
  store i64 %53, ptr %55, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %56 = load i64, ptr @N, align 8, !tbaa !5
  invoke void @_ZN4mintC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %9, i64 noundef %56)
          to label %57 unwind label %70

57:                                               ; preds = %54
  %58 = invoke i64 @_ZNK4mintmlERKS_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %59 unwind label %70

59:                                               ; preds = %57
  %60 = getelementptr inbounds %class.mint, ptr %7, i32 0, i32 0
  store i64 %58, ptr %60, align 8
  %61 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN4mintmIERKS_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %62 unwind label %70

62:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %63

63:                                               ; preds = %62
  %64 = load i64, ptr %6, align 8, !tbaa !5
  %65 = add nsw i64 %64, -1
  store i64 %65, ptr %6, align 8, !tbaa !5
  br label %30, !llvm.loop !9

66:                                               ; preds = %41
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %4, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %5, align 4
  br label %74

70:                                               ; preds = %59, %57, %54
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %4, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %74

74:                                               ; preds = %70, %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %127

75:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !5
  br label %76

76:                                               ; preds = %109, %75
  %77 = load i64, ptr %10, align 8, !tbaa !5
  %78 = load i64, ptr @M, align 8, !tbaa !5
  %79 = icmp slt i64 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %121

81:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %82 = load i64, ptr @N, align 8, !tbaa !5
  %83 = trunc i64 %82 to i32
  %84 = load i64, ptr @M, align 8, !tbaa !5
  %85 = mul nsw i64 3, %84
  %86 = load i64, ptr %10, align 8, !tbaa !5
  %87 = mul nsw i64 2, %86
  %88 = sub nsw i64 %85, %87
  %89 = trunc i64 %88 to i32
  %90 = invoke i64 @_ZN11combinationclEii(ptr noundef nonnull align 8 dereferenceable(72) %2, i32 noundef %83, i32 noundef %89)
          to label %91 unwind label %112

91:                                               ; preds = %81
  %92 = getelementptr inbounds %class.mint, ptr %12, i32 0, i32 0
  store i64 %90, ptr %92, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %93 = load i64, ptr %10, align 8, !tbaa !5
  %94 = load i64, ptr @N, align 8, !tbaa !5
  %95 = add nsw i64 %93, %94
  %96 = sub nsw i64 %95, 1
  %97 = trunc i64 %96 to i32
  %98 = load i64, ptr @N, align 8, !tbaa !5
  %99 = sub nsw i64 %98, 1
  %100 = trunc i64 %99 to i32
  %101 = invoke i64 @_ZN11combinationclEii(ptr noundef nonnull align 8 dereferenceable(72) %2, i32 noundef %97, i32 noundef %100)
          to label %102 unwind label %116

102:                                              ; preds = %91
  %103 = getelementptr inbounds %class.mint, ptr %13, i32 0, i32 0
  store i64 %101, ptr %103, align 8
  %104 = invoke i64 @_ZNK4mintmlERKS_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %105 unwind label %116

105:                                              ; preds = %102
  %106 = getelementptr inbounds %class.mint, ptr %11, i32 0, i32 0
  store i64 %104, ptr %106, align 8
  %107 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN4mintmIERKS_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %108 unwind label %116

108:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %109

109:                                              ; preds = %108
  %110 = load i64, ptr %10, align 8, !tbaa !5
  %111 = add nsw i64 %110, 1
  store i64 %111, ptr %10, align 8, !tbaa !5
  br label %76, !llvm.loop !11

112:                                              ; preds = %81
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %4, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %5, align 4
  br label %120

116:                                              ; preds = %105, %102, %91
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %4, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %120

120:                                              ; preds = %116, %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %127

121:                                              ; preds = %80
  %122 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZlsRSoRK4mint(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %123 unwind label %37

123:                                              ; preds = %121
  %124 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %122, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %125 unwind label %37

125:                                              ; preds = %123
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @_ZN11combinationD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %2) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %2) #6
  %126 = load i32, ptr %1, align 4
  ret i32 %126

127:                                              ; preds = %120, %74, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @_ZN11combinationD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %2) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %2) #6
  br label %128

128:                                              ; preds = %127
  %129 = load ptr, ptr %4, align 8
  %130 = load i32, ptr %5, align 4
  %131 = insertvalue { ptr, i32 } poison, ptr %129, 0
  %132 = insertvalue { ptr, i32 } %131, i32 %130, 1
  resume { ptr, i32 } %132
}

; 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 dso_local void @_ZN11combinationC2Ev(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN11combinationclEii(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef, i32 noundef) #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNK4mintmlERKS_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4mintC2Ex(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #4 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN11combinationD2Ev(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #5 align 2

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !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::basic_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%class.combination = type { %"class.std::vector", %"class.std::vector", %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<mint, std::allocator<mint>>::_Vector_impl" }
%"struct.std::_Vector_base<mint, std::allocator<mint>>::_Vector_impl" = type { %"struct.std::_Vector_base<mint, std::allocator<mint>>::_Vector_impl_data" }
%"struct.std::_Vector_base<mint, std::allocator<mint>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.mint = type { i64 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; 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 #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZlsRSoRK4mint(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0

; 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 #0 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)) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %class.combination, align 8
  %2 = alloca %class.mint, align 8
  %3 = alloca %class.mint, align 8
  %4 = alloca %class.mint, align 8
  %5 = alloca %class.mint, align 8
  %6 = alloca %class.mint, align 8
  %7 = alloca %class.mint, align 8
  %8 = alloca %class.mint, align 8
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) @M)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %1) #6
  call void @_ZN11combinationC2Ev(ptr noundef nonnull align 8 dereferenceable(72) %1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %11 = load i64, ptr @M, align 8, !tbaa !5
  %12 = mul nsw i64 %11, 3
  %13 = load i64, ptr @N, align 8, !tbaa !5
  %14 = add nsw i64 %12, %13
  %15 = trunc i64 %14 to i32
  %16 = add i32 %15, -1
  %17 = trunc i64 %13 to i32
  %18 = add i32 %17, -1
  %19 = invoke i64 @_ZN11combinationclEii(ptr noundef nonnull align 8 dereferenceable(72) %1, i32 noundef %16, i32 noundef %18)
          to label %20 unwind label %26

20:                                               ; preds = %0
  store i64 %19, ptr %2, align 8
  %21 = load i64, ptr @M, align 8, !tbaa !5
  %22 = mul nsw i64 %21, 3
  %23 = shl nsw i64 %21, 1
  %.not.not18 = icmp sgt i64 %22, %23
  br i1 %.not.not18, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %43, %20
  %24 = phi i64 [ %21, %20 ], [ %45, %43 ]
  %25 = icmp sgt i64 %24, 0
  br i1 %25, label %.lr.ph21, label %._crit_edge

26:                                               ; preds = %82, %._crit_edge, %0
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %85

.lr.ph:                                           ; preds = %20, %43
  %28 = phi i64 [ %45, %43 ], [ %21, %20 ]
  %.0919 = phi i64 [ %44, %43 ], [ %22, %20 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %29 = mul nsw i64 %28, 3
  %30 = sub i64 %29, %.0919
  %31 = load i64, ptr @N, align 8, !tbaa !5
  %32 = add nsw i64 %30, %31
  %33 = trunc i64 %32 to i32
  %34 = add i32 %33, -2
  %35 = trunc i64 %31 to i32
  %36 = add i32 %35, -2
  %37 = invoke i64 @_ZN11combinationclEii(ptr noundef nonnull align 8 dereferenceable(72) %1, i32 noundef %34, i32 noundef %36)
          to label %38 unwind label %47

38:                                               ; preds = %.lr.ph
  store i64 %37, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %39 = load i64, ptr @N, align 8, !tbaa !5
  call void @_ZN4mintC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %39)
  %40 = invoke i64 @_ZNK4mintmlERKS_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %41 unwind label %49

41:                                               ; preds = %38
  store i64 %40, ptr %3, align 8
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN4mintmIERKS_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %43 unwind label %49

43:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %44 = add nsw i64 %.0919, -1
  %45 = load i64, ptr @M, align 8, !tbaa !5
  %46 = shl nsw i64 %45, 1
  %.not.not = icmp sgt i64 %44, %46
  br i1 %.not.not, label %.lr.ph, label %.preheader, !llvm.loop !9

47:                                               ; preds = %.lr.ph
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %51

49:                                               ; preds = %41, %38
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %51

51:                                               ; preds = %49, %47
  %.pn15 = phi { ptr, i32 } [ %50, %49 ], [ %48, %47 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %85

._crit_edge:                                      ; preds = %73, %.preheader
  %52 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZlsRSoRK4mint(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %82 unwind label %26

.lr.ph21:                                         ; preds = %.preheader, %73
  %53 = phi i64 [ %75, %73 ], [ %24, %.preheader ]
  %.020 = phi i64 [ %74, %73 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %54 = load i64, ptr @N, align 8, !tbaa !5
  %55 = trunc i64 %54 to i32
  %56 = mul nsw i64 %53, 3
  %57 = shl nuw nsw i64 %.020, 1
  %58 = sub nsw i64 %56, %57
  %59 = trunc i64 %58 to i32
  %60 = invoke i64 @_ZN11combinationclEii(ptr noundef nonnull align 8 dereferenceable(72) %1, i32 noundef %55, i32 noundef %59)
          to label %61 unwind label %77

61:                                               ; preds = %.lr.ph21
  store i64 %60, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %62 = load i64, ptr @N, align 8, !tbaa !5
  %63 = add nsw i64 %62, %.020
  %64 = trunc i64 %63 to i32
  %65 = add i32 %64, -1
  %66 = trunc i64 %62 to i32
  %67 = add i32 %66, -1
  %68 = invoke i64 @_ZN11combinationclEii(ptr noundef nonnull align 8 dereferenceable(72) %1, i32 noundef %65, i32 noundef %67)
          to label %69 unwind label %79

69:                                               ; preds = %61
  store i64 %68, ptr %8, align 8
  %70 = invoke i64 @_ZNK4mintmlERKS_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %71 unwind label %79

71:                                               ; preds = %69
  store i64 %70, ptr %6, align 8
  %72 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN4mintmIERKS_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %73 unwind label %79

73:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %74 = add nuw nsw i64 %.020, 1
  %75 = load i64, ptr @M, align 8, !tbaa !5
  %76 = icmp slt i64 %74, %75
  br i1 %76, label %.lr.ph21, label %._crit_edge, !llvm.loop !11

77:                                               ; preds = %.lr.ph21
  %78 = landingpad { ptr, i32 }
          cleanup
  br label %81

79:                                               ; preds = %71, %69, %61
  %80 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %81

81:                                               ; preds = %79, %77
  %.pn = phi { ptr, i32 } [ %80, %79 ], [ %78, %77 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %85

82:                                               ; preds = %._crit_edge
  %83 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %84 unwind label %26

84:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @_ZN11combinationD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %1) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %1) #6
  ret i32 0

85:                                               ; preds = %81, %51, %26
  %.pn15.pn = phi { ptr, i32 } [ %.pn15, %51 ], [ %.pn, %81 ], [ %27, %26 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @_ZN11combinationD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %1) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn15.pn
}

; 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 dso_local void @_ZN11combinationC2Ev(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN11combinationclEii(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNK4mintmlERKS_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4mintC2Ex(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #4 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN11combinationD2Ev(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #5 align 2

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


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