; LLVM IR from abeaumont/competitive-programming :: cses (1078)

; 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::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i64 }
%"struct.std::_Head_base.1" = type { i64 }
%class.anon = type { i8 }
%"class.std::tuple.2" = type { %"struct.std::_Tuple_impl.3" }
%"struct.std::_Tuple_impl.3" = type { %"struct.std::_Tuple_impl.4", %"struct.std::_Head_base.6" }
%"struct.std::_Tuple_impl.4" = type { %"struct.std::_Head_base.5" }
%"struct.std::_Head_base.5" = type { ptr }
%"struct.std::_Head_base.6" = type { ptr }

@M = external dso_local global i64, align 8
@f = external dso_local global [2000000 x i64], align 16
@inv = external dso_local global [2000000 x i64], align 16
@invf = external dso_local global [2000000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z8binomialxxx(i64 noundef, i64 noundef, i64 noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::tuple", align 8
  %14 = alloca %class.anon, align 1
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"class.std::tuple.2", align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca %"class.std::tuple.2", align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  %29 = alloca i64, align 8
  %30 = alloca i64, align 8
  %31 = alloca i64, align 8
  %32 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  store i64 1, ptr getelementptr inbounds ([2000000 x i64], ptr @f, i64 0, i64 1), align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 2, ptr %2, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %52, %0
  %34 = load i32, ptr %2, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %35, 2000000
  br i1 %36, label %38, label %37

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

38:                                               ; preds = %33
  %39 = load i32, ptr %2, align 4, !tbaa !9
  %40 = sub nsw i32 %39, 1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [2000000 x i64], ptr @f, i64 0, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !5
  %44 = load i32, ptr %2, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = mul nsw i64 %43, %45
  %47 = load i64, ptr @M, align 8, !tbaa !5
  %48 = srem i64 %46, %47
  %49 = load i32, ptr %2, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [2000000 x i64], ptr @f, i64 0, i64 %50
  store i64 %48, ptr %51, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %38
  %53 = load i32, ptr %2, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %2, align 4, !tbaa !9
  br label %33, !llvm.loop !11

55:                                               ; preds = %37
  store i64 1, ptr getelementptr inbounds ([2000000 x i64], ptr @inv, i64 0, i64 1), align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 2, ptr %3, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %80, %55
  %57 = load i32, ptr %3, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = icmp slt i64 %58, 2000000
  br i1 %59, label %61, label %60

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

61:                                               ; preds = %56
  %62 = load i64, ptr @M, align 8, !tbaa !5
  %63 = load i64, ptr @M, align 8, !tbaa !5
  %64 = load i32, ptr %3, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = sdiv i64 %63, %65
  %67 = load i64, ptr @M, align 8, !tbaa !5
  %68 = load i32, ptr %3, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = srem i64 %67, %69
  %71 = getelementptr inbounds [2000000 x i64], ptr @inv, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !5
  %73 = mul nsw i64 %66, %72
  %74 = load i64, ptr @M, align 8, !tbaa !5
  %75 = srem i64 %73, %74
  %76 = sub nsw i64 %62, %75
  %77 = load i32, ptr %3, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [2000000 x i64], ptr @inv, i64 0, i64 %78
  store i64 %76, ptr %79, align 8, !tbaa !5
  br label %80

80:                                               ; preds = %61
  %81 = load i32, ptr %3, align 4, !tbaa !9
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %3, align 4, !tbaa !9
  br label %56, !llvm.loop !13

83:                                               ; preds = %60
  store i64 1, ptr @invf, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 1, ptr %4, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %105, %83
  %85 = load i32, ptr %4, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = icmp slt i64 %86, 2000000
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %108

89:                                               ; preds = %84
  %90 = load i32, ptr %4, align 4, !tbaa !9
  %91 = sub nsw i32 %90, 1
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [2000000 x i64], ptr @invf, i64 0, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !5
  %95 = load i32, ptr %4, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [2000000 x i64], ptr @inv, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !5
  %99 = mul nsw i64 %94, %98
  %100 = load i64, ptr @M, align 8, !tbaa !5
  %101 = srem i64 %99, %100
  %102 = load i32, ptr %4, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [2000000 x i64], ptr @invf, i64 0, i64 %103
  store i64 %101, ptr %104, align 8, !tbaa !5
  br label %105

105:                                              ; preds = %89
  %106 = load i32, ptr %4, align 4, !tbaa !9
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %4, align 4, !tbaa !9
  br label %84, !llvm.loop !14

108:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %109 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %110 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %109, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %111 = load i64, ptr %6, align 8, !tbaa !5
  %112 = call ptr @llvm.stacksave.p0()
  store ptr %112, ptr %9, align 8
  %113 = alloca %"class.std::tuple", i64 %111, align 16
  store i64 %111, ptr %10, align 8
  %114 = icmp eq i64 %111, 0
  br i1 %114, label %121, label %115

115:                                              ; preds = %108
  %116 = getelementptr inbounds %"class.std::tuple", ptr %113, i64 %111
  br label %117

117:                                              ; preds = %117, %115
  %118 = phi ptr [ %113, %115 ], [ %119, %117 ]
  call void @_ZNSt5tupleIJxxEEC2ILb1ETnNSt9enable_ifIXclsr17_TupleConstraintsIXT_ExxEE37__is_implicitly_default_constructibleEEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %118) #7
  %119 = getelementptr inbounds %"class.std::tuple", ptr %118, i64 1
  %120 = icmp eq ptr %119, %116
  br i1 %120, label %121, label %117

121:                                              ; preds = %117, %108
  %122 = load i64, ptr %6, align 8, !tbaa !5
  %123 = alloca i64, i64 %122, align 16
  store i64 %122, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %137, %121
  %125 = load i32, ptr %12, align 4, !tbaa !9
  %126 = sext i32 %125 to i64
  %127 = load i64, ptr %6, align 8, !tbaa !5
  %128 = icmp slt i64 %126, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %140

130:                                              ; preds = %124
  %131 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %132 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %131, ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #7
  call void @_ZNSt5tupleIJxxEEC2IRxS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %133 = load i32, ptr %12, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds %"class.std::tuple", ptr %113, i64 %134
  %136 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJxxEEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %135, ptr noundef nonnull align 8 dereferenceable(16) %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #7
  br label %137

137:                                              ; preds = %130
  %138 = load i32, ptr %12, align 4, !tbaa !9
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %12, align 4, !tbaa !9
  br label %124, !llvm.loop !15

140:                                              ; preds = %129
  %141 = load i64, ptr %6, align 8, !tbaa !5
  %142 = getelementptr inbounds %"class.std::tuple", ptr %113, i64 %141
  call void @"_ZSt4sortIPSt5tupleIJxxEEZ4mainE3$_0EvT_S4_T0_"(ptr noundef %113, ptr noundef %142)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %143 = load i64, ptr %5, align 8, !tbaa !5
  %144 = sub nsw i64 %143, 1
  %145 = mul nsw i64 %144, 2
  %146 = load i64, ptr %5, align 8, !tbaa !5
  %147 = sub nsw i64 %146, 1
  %148 = load i64, ptr @M, align 8, !tbaa !5
  %149 = call noundef i64 @_Z8binomialxxx(i64 noundef %145, i64 noundef %147, i64 noundef %148)
  store i64 %149, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %150

150:                                              ; preds = %271, %140
  %151 = load i32, ptr %16, align 4, !tbaa !9
  %152 = sext i32 %151 to i64
  %153 = load i64, ptr %6, align 8, !tbaa !5
  %154 = icmp slt i64 %152, %153
  br i1 %154, label %156, label %155

155:                                              ; preds = %150
  store i32 14, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %274

156:                                              ; preds = %150
  %157 = load i32, ptr %16, align 4, !tbaa !9
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds %"class.std::tuple", ptr %113, i64 %158
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #7
  call void @_ZSt3tieIJxxEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple.2") align 8 %18, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %160 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRxS0_EEaSIxxEENSt9enable_ifIXcl12__assignableIRKT_RKT0_EEERS1_E4typeERKS_IJS4_S7_EE(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(16) %159) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %161 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %162 = load i64, ptr %161, align 8, !tbaa !5
  store i64 %162, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %164 = load i64, ptr %163, align 8, !tbaa !5
  store i64 %164, ptr %20, align 8, !tbaa !5
  %165 = load i64, ptr %19, align 8, !tbaa !5
  %166 = load i64, ptr %20, align 8, !tbaa !5
  %167 = add nsw i64 %165, %166
  %168 = sub nsw i64 %167, 2
  %169 = load i64, ptr %20, align 8, !tbaa !5
  %170 = sub nsw i64 %169, 1
  %171 = load i64, ptr @M, align 8, !tbaa !5
  %172 = call noundef i64 @_Z8binomialxxx(i64 noundef %168, i64 noundef %170, i64 noundef %171)
  %173 = load i32, ptr %16, align 4, !tbaa !9
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds i64, ptr %123, i64 %174
  store i64 %172, ptr %175, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %176

176:                                              ; preds = %237, %156
  %177 = load i32, ptr %21, align 4, !tbaa !9
  %178 = load i32, ptr %16, align 4, !tbaa !9
  %179 = icmp slt i32 %177, %178
  br i1 %179, label %181, label %180

180:                                              ; preds = %176
  store i32 17, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %240

181:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %182 = load i32, ptr %21, align 4, !tbaa !9
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds %"class.std::tuple", ptr %113, i64 %183
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #7
  call void @_ZSt3tieIJxxEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple.2") align 8 %24, ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #7
  %185 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRxS0_EEaSIxxEENSt9enable_ifIXcl12__assignableIRKT_RKT0_EEERS1_E4typeERKS_IJS4_S7_EE(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(16) %184) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  %186 = load i64, ptr %22, align 8, !tbaa !5
  %187 = load i64, ptr %7, align 8, !tbaa !5
  %188 = icmp sgt i64 %186, %187
  br i1 %188, label %193, label %189

189:                                              ; preds = %181
  %190 = load i64, ptr %23, align 8, !tbaa !5
  %191 = load i64, ptr %8, align 8, !tbaa !5
  %192 = icmp sgt i64 %190, %191
  br i1 %192, label %193, label %194

193:                                              ; preds = %189, %181
  store i32 19, ptr %17, align 4
  br label %234

194:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %195 = load i64, ptr %7, align 8, !tbaa !5
  %196 = load i64, ptr %22, align 8, !tbaa !5
  %197 = sub nsw i64 %195, %196
  store i64 %197, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %198 = load i64, ptr %8, align 8, !tbaa !5
  %199 = load i64, ptr %23, align 8, !tbaa !5
  %200 = sub nsw i64 %198, %199
  store i64 %200, ptr %27, align 8, !tbaa !5
  %201 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %27)
  %202 = load i64, ptr %201, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  store i64 %202, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %203 = load i64, ptr %7, align 8, !tbaa !5
  %204 = load i64, ptr %22, align 8, !tbaa !5
  %205 = sub nsw i64 %203, %204
  store i64 %205, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %206 = load i64, ptr %8, align 8, !tbaa !5
  %207 = load i64, ptr %23, align 8, !tbaa !5
  %208 = sub nsw i64 %206, %207
  store i64 %208, ptr %30, align 8, !tbaa !5
  %209 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %30)
  %210 = load i64, ptr %209, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  store i64 %210, ptr %28, align 8, !tbaa !5
  %211 = load i32, ptr %16, align 4, !tbaa !9
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds i64, ptr %123, i64 %212
  %214 = load i64, ptr %213, align 8, !tbaa !5
  %215 = load i32, ptr %21, align 4, !tbaa !9
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds i64, ptr %123, i64 %216
  %218 = load i64, ptr %217, align 8, !tbaa !5
  %219 = load i64, ptr %25, align 8, !tbaa !5
  %220 = load i64, ptr %28, align 8, !tbaa !5
  %221 = add nsw i64 %219, %220
  %222 = load i64, ptr %28, align 8, !tbaa !5
  %223 = load i64, ptr @M, align 8, !tbaa !5
  %224 = call noundef i64 @_Z8binomialxxx(i64 noundef %221, i64 noundef %222, i64 noundef %223)
  %225 = mul nsw i64 %218, %224
  %226 = load i64, ptr @M, align 8, !tbaa !5
  %227 = srem i64 %225, %226
  %228 = sub nsw i64 %214, %227
  %229 = load i64, ptr @M, align 8, !tbaa !5
  %230 = srem i64 %228, %229
  %231 = load i32, ptr %16, align 4, !tbaa !9
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds i64, ptr %123, i64 %232
  store i64 %230, ptr %233, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  store i32 0, ptr %17, align 4
  br label %234

234:                                              ; preds = %194, %193
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  %235 = load i32, ptr %17, align 4
  switch i32 %235, label %280 [
    i32 0, label %236
    i32 19, label %237
  ]

236:                                              ; preds = %234
  br label %237

237:                                              ; preds = %236, %234
  %238 = load i32, ptr %21, align 4, !tbaa !9
  %239 = add nsw i32 %238, 1
  store i32 %239, ptr %21, align 4, !tbaa !9
  br label %176, !llvm.loop !16

240:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  %241 = load i64, ptr %5, align 8, !tbaa !5
  %242 = load i64, ptr %20, align 8, !tbaa !5
  %243 = sub nsw i64 %241, %242
  store i64 %243, ptr %31, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  %244 = load i64, ptr %5, align 8, !tbaa !5
  %245 = load i64, ptr %19, align 8, !tbaa !5
  %246 = sub nsw i64 %244, %245
  store i64 %246, ptr %32, align 8, !tbaa !5
  %247 = load i64, ptr %15, align 8, !tbaa !5
  %248 = load i32, ptr %16, align 4, !tbaa !9
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds i64, ptr %123, i64 %249
  %251 = load i64, ptr %250, align 8, !tbaa !5
  %252 = load i64, ptr %31, align 8, !tbaa !5
  %253 = load i64, ptr %32, align 8, !tbaa !5
  %254 = add nsw i64 %252, %253
  %255 = load i64, ptr %32, align 8, !tbaa !5
  %256 = load i64, ptr @M, align 8, !tbaa !5
  %257 = call noundef i64 @_Z8binomialxxx(i64 noundef %254, i64 noundef %255, i64 noundef %256)
  %258 = mul nsw i64 %251, %257
  %259 = load i64, ptr @M, align 8, !tbaa !5
  %260 = srem i64 %258, %259
  %261 = sub nsw i64 %247, %260
  %262 = load i64, ptr @M, align 8, !tbaa !5
  %263 = srem i64 %261, %262
  store i64 %263, ptr %15, align 8, !tbaa !5
  %264 = load i64, ptr %15, align 8, !tbaa !5
  %265 = icmp slt i64 %264, 0
  br i1 %265, label %266, label %270

266:                                              ; preds = %240
  %267 = load i64, ptr @M, align 8, !tbaa !5
  %268 = load i64, ptr %15, align 8, !tbaa !5
  %269 = add nsw i64 %268, %267
  store i64 %269, ptr %15, align 8, !tbaa !5
  br label %270

270:                                              ; preds = %266, %240
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %271

271:                                              ; preds = %270
  %272 = load i32, ptr %16, align 4, !tbaa !9
  %273 = add nsw i32 %272, 1
  store i32 %273, ptr %16, align 4, !tbaa !9
  br label %150, !llvm.loop !17

274:                                              ; preds = %155
  %275 = load i64, ptr %15, align 8, !tbaa !5
  %276 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %275)
  %277 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %276, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  %278 = load ptr, ptr %9, align 8
  call void @llvm.stackrestore.p0(ptr %278)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  %279 = load i32, ptr %1, align 4
  ret i32 %279

280:                                              ; preds = %234
  unreachable
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5tupleIJxxEEC2ILb1ETnNSt9enable_ifIXclsr17_TupleConstraintsIXT_ExxEE37__is_implicitly_default_constructibleEEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5tupleIJxxEEC2IRxS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJxxEEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPSt5tupleIJxxEEZ4mainE3$_0EvT_S4_T0_"(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt3tieIJxxEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple.2") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRxS0_EEaSIxxEENSt9enable_ifIXcl12__assignableIRKT_RKT0_EEERS1_E4typeERKS_IJS4_S7_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 = { nocallback nofree nosync nounwind willreturn }
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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


; 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::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i64 }
%"struct.std::_Head_base.1" = type { i64 }
%"class.std::tuple.2" = type { %"struct.std::_Tuple_impl.3" }
%"struct.std::_Tuple_impl.3" = type { %"struct.std::_Tuple_impl.4", %"struct.std::_Head_base.6" }
%"struct.std::_Tuple_impl.4" = type { %"struct.std::_Head_base.5" }
%"struct.std::_Head_base.5" = type { ptr }
%"struct.std::_Head_base.6" = type { ptr }

@M = external dso_local local_unnamed_addr global i64, align 8
@f = external dso_local local_unnamed_addr global [2000000 x i64], align 16
@inv = external dso_local local_unnamed_addr global [2000000 x i64], align 16
@invf = external dso_local local_unnamed_addr global [2000000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z8binomialxxx(i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::tuple", align 8
  %6 = alloca %"class.std::tuple.2", align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca %"class.std::tuple.2", align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  store i64 1, ptr getelementptr inbounds (i8, ptr @f, i64 8), align 8, !tbaa !5
  %14 = load i64, ptr @M, align 8, !tbaa !5
  br label %16

15:                                               ; preds = %16
  store i64 1, ptr getelementptr inbounds (i8, ptr @inv, i64 8), align 8, !tbaa !5
  br label %28

16:                                               ; preds = %16, %0
  %17 = phi i64 [ 1, %0 ], [ %25, %16 ]
  %indvars.iv = phi i64 [ 2, %0 ], [ %indvars.iv.next.2, %16 ]
  %18 = mul nsw i64 %17, %indvars.iv
  %19 = srem i64 %18, %14
  %20 = getelementptr inbounds [2000000 x i64], ptr @f, i64 0, i64 %indvars.iv
  store i64 %19, ptr %20, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = mul nsw i64 %19, %indvars.iv.next
  %22 = srem i64 %21, %14
  %23 = getelementptr inbounds [2000000 x i64], ptr @f, i64 0, i64 %indvars.iv.next
  store i64 %22, ptr %23, align 8, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %24 = mul nsw i64 %22, %indvars.iv.next.1
  %25 = srem i64 %24, %14
  %26 = getelementptr inbounds [2000000 x i64], ptr @f, i64 0, i64 %indvars.iv.next.1
  store i64 %25, ptr %26, align 8, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 2000000
  br i1 %exitcond.not.2, label %15, label %16, !llvm.loop !9

27:                                               ; preds = %28
  store i64 1, ptr @invf, align 16, !tbaa !5
  br label %44

28:                                               ; preds = %15, %28
  %indvars.iv77 = phi i64 [ 2, %15 ], [ %indvars.iv.next78, %28 ]
  %29 = sdiv i64 %14, %indvars.iv77
  %30 = srem i64 %14, %indvars.iv77
  %31 = getelementptr inbounds [2000000 x i64], ptr @inv, i64 0, i64 %30
  %32 = load i64, ptr %31, align 8, !tbaa !5
  %33 = mul nsw i64 %32, %29
  %34 = srem i64 %33, %14
  %35 = sub nsw i64 %14, %34
  %36 = getelementptr inbounds [2000000 x i64], ptr @inv, i64 0, i64 %indvars.iv77
  store i64 %35, ptr %36, align 8, !tbaa !5
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %exitcond80.not = icmp eq i64 %indvars.iv.next78, 2000000
  br i1 %exitcond80.not, label %27, label %28, !llvm.loop !11

37:                                               ; preds = %44
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %38 = 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)
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %40 = load i64, ptr %2, align 8, !tbaa !5
  %41 = call ptr @llvm.stacksave.p0()
  %42 = alloca %"class.std::tuple", i64 %40, align 16
  %43 = icmp eq i64 %40, 0
  br i1 %43, label %.loopexit, label %57

44:                                               ; preds = %51, %27
  %45 = phi i64 [ 1, %27 ], [ %55, %51 ]
  %indvars.iv81 = phi i64 [ 1, %27 ], [ %indvars.iv.next82.1, %51 ]
  %46 = getelementptr inbounds [2000000 x i64], ptr @inv, i64 0, i64 %indvars.iv81
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = mul nsw i64 %47, %45
  %49 = srem i64 %48, %14
  %50 = getelementptr inbounds [2000000 x i64], ptr @invf, i64 0, i64 %indvars.iv81
  store i64 %49, ptr %50, align 8, !tbaa !5
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %exitcond84.not = icmp eq i64 %indvars.iv.next82, 2000000
  br i1 %exitcond84.not, label %37, label %51, !llvm.loop !12

51:                                               ; preds = %44
  %52 = getelementptr inbounds [2000000 x i64], ptr @inv, i64 0, i64 %indvars.iv.next82
  %53 = load i64, ptr %52, align 8, !tbaa !5
  %54 = mul nsw i64 %53, %49
  %55 = srem i64 %54, %14
  %56 = getelementptr inbounds [2000000 x i64], ptr @invf, i64 0, i64 %indvars.iv.next82
  store i64 %55, ptr %56, align 8, !tbaa !5
  %indvars.iv.next82.1 = add nuw nsw i64 %indvars.iv81, 2
  br label %44

57:                                               ; preds = %37
  %58 = getelementptr inbounds %"class.std::tuple", ptr %42, i64 %40
  br label %59

59:                                               ; preds = %59, %57
  %60 = phi ptr [ %42, %57 ], [ %61, %59 ]
  call void @_ZNSt5tupleIJxxEEC2ILb1ETnNSt9enable_ifIXclsr17_TupleConstraintsIXT_ExxEE37__is_implicitly_default_constructibleEEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %60) #7
  %61 = getelementptr inbounds i8, ptr %60, i64 16
  %62 = icmp eq ptr %61, %58
  br i1 %62, label %.loopexit, label %59

.loopexit:                                        ; preds = %59, %37
  %63 = load i64, ptr %2, align 8, !tbaa !5
  %64 = alloca i64, i64 %63, align 16
  %65 = icmp sgt i64 %63, 0
  br i1 %65, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.loopexit
  %.lcssa = phi i64 [ %63, %.loopexit ], [ %78, %.lr.ph ]
  %66 = getelementptr inbounds %"class.std::tuple", ptr %42, i64 %.lcssa
  call void @"_ZSt4sortIPSt5tupleIJxxEEZ4mainE3$_0EvT_S4_T0_"(ptr noundef nonnull %42, ptr noundef nonnull %66)
  %67 = load i64, ptr %1, align 8, !tbaa !5
  %68 = add nsw i64 %67, -1
  %69 = shl nsw i64 %68, 1
  %70 = load i64, ptr @M, align 8, !tbaa !5
  %71 = call noundef i64 @_Z8binomialxxx(i64 noundef %69, i64 noundef %68, i64 noundef %70)
  %72 = load i64, ptr %2, align 8, !tbaa !5
  %73 = icmp sgt i64 %72, 0
  br i1 %73, label %.lr.ph72, label %._crit_edge73

.lr.ph:                                           ; preds = %.loopexit, %.lr.ph
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %.lr.ph ], [ 0, %.loopexit ]
  %74 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %75 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %74, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  call void @_ZNSt5tupleIJxxEEC2IRxS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  %76 = getelementptr inbounds %"class.std::tuple", ptr %42, i64 %indvars.iv85
  %77 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJxxEEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %76, ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %78 = load i64, ptr %2, align 8, !tbaa !5
  %79 = icmp sgt i64 %78, %indvars.iv.next86
  br i1 %79, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge73:                                    ; preds = %._crit_edge68, %._crit_edge
  %.050.lcssa = phi i64 [ %71, %._crit_edge ], [ %spec.select, %._crit_edge68 ]
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.050.lcssa)
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %80, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %41)
  call void @llvm.lifetime.end.p0(i64 8, 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
  ret i32 0

.lr.ph72:                                         ; preds = %._crit_edge, %._crit_edge68
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %._crit_edge68 ], [ 0, %._crit_edge ]
  %.05070 = phi i64 [ %spec.select, %._crit_edge68 ], [ %71, %._crit_edge ]
  %82 = getelementptr inbounds %"class.std::tuple", ptr %42, i64 %indvars.iv92
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  call void @_ZSt3tieIJxxEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple.2") align 8 %6, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  %83 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRxS0_EEaSIxxEENSt9enable_ifIXcl12__assignableIRKT_RKT0_EEERS1_E4typeERKS_IJS4_S7_EE(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %82) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %85 = load i64, ptr %84, align 8, !tbaa !5
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %87 = load i64, ptr %86, align 8, !tbaa !5
  %88 = add i64 %85, -2
  %89 = add i64 %88, %87
  %90 = add nsw i64 %87, -1
  %91 = load i64, ptr @M, align 8, !tbaa !5
  %92 = call noundef i64 @_Z8binomialxxx(i64 noundef %89, i64 noundef %90, i64 noundef %91)
  %93 = getelementptr inbounds i64, ptr %64, i64 %indvars.iv92
  store i64 %92, ptr %93, align 8, !tbaa !5
  %.not = icmp eq i64 %indvars.iv92, 0
  br i1 %.not, label %._crit_edge68, label %.lr.ph67

._crit_edge68:                                    ; preds = %143, %.lr.ph72
  %94 = phi i64 [ %92, %.lr.ph72 ], [ %144, %143 ]
  %95 = load i64, ptr %1, align 8, !tbaa !5
  %96 = sub i64 %95, %87
  %97 = sub nsw i64 %95, %85
  %98 = add nsw i64 %96, %97
  %99 = load i64, ptr @M, align 8, !tbaa !5
  %100 = call noundef i64 @_Z8binomialxxx(i64 noundef %98, i64 noundef %97, i64 noundef %99)
  %101 = mul nsw i64 %100, %94
  %102 = load i64, ptr @M, align 8, !tbaa !5
  %103 = srem i64 %101, %102
  %104 = sub nsw i64 %.05070, %103
  %105 = srem i64 %104, %102
  %106 = icmp slt i64 %105, 0
  %107 = select i1 %106, i64 %102, i64 0
  %spec.select = add nsw i64 %107, %105
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %108 = load i64, ptr %2, align 8, !tbaa !5
  %109 = icmp sgt i64 %108, %indvars.iv.next93
  br i1 %109, label %.lr.ph72, label %._crit_edge73, !llvm.loop !14

.lr.ph67:                                         ; preds = %.lr.ph72, %143
  %110 = phi i64 [ %144, %143 ], [ %92, %.lr.ph72 ]
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %143 ], [ 0, %.lr.ph72 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %111 = getelementptr inbounds %"class.std::tuple", ptr %42, i64 %indvars.iv88
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #7
  call void @_ZSt3tieIJxxEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple.2") align 8 %9, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %112 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRxS0_EEaSIxxEENSt9enable_ifIXcl12__assignableIRKT_RKT0_EEERS1_E4typeERKS_IJS4_S7_EE(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %111) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  %113 = load i64, ptr %7, align 8, !tbaa !5
  %114 = load i64, ptr %3, align 8, !tbaa !5
  %115 = icmp sgt i64 %113, %114
  br i1 %115, label %143, label %116

116:                                              ; preds = %.lr.ph67
  %117 = load i64, ptr %8, align 8, !tbaa !5
  %118 = load i64, ptr %4, align 8, !tbaa !5
  %119 = icmp sgt i64 %117, %118
  br i1 %119, label %143, label %120

120:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %121 = sub nsw i64 %114, %113
  store i64 %121, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %122 = sub nsw i64 %118, %117
  store i64 %122, ptr %11, align 8, !tbaa !5
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %124 = load i64, ptr %123, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %125 = load i64, ptr %3, align 8, !tbaa !5
  %126 = load i64, ptr %7, align 8, !tbaa !5
  %127 = sub nsw i64 %125, %126
  store i64 %127, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  %128 = load i64, ptr %4, align 8, !tbaa !5
  %129 = load i64, ptr %8, align 8, !tbaa !5
  %130 = sub nsw i64 %128, %129
  store i64 %130, ptr %13, align 8, !tbaa !5
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %132 = load i64, ptr %131, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  %133 = getelementptr inbounds i64, ptr %64, i64 %indvars.iv88
  %134 = load i64, ptr %133, align 8, !tbaa !5
  %135 = add nsw i64 %132, %124
  %136 = load i64, ptr @M, align 8, !tbaa !5
  %137 = call noundef i64 @_Z8binomialxxx(i64 noundef %135, i64 noundef %132, i64 noundef %136)
  %138 = mul nsw i64 %137, %134
  %139 = load i64, ptr @M, align 8, !tbaa !5
  %140 = srem i64 %138, %139
  %141 = sub nsw i64 %110, %140
  %142 = srem i64 %141, %139
  store i64 %142, ptr %93, align 8, !tbaa !5
  br label %143

143:                                              ; preds = %.lr.ph67, %116, %120
  %144 = phi i64 [ %110, %.lr.ph67 ], [ %110, %116 ], [ %142, %120 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond91.not = icmp eq i64 %indvars.iv.next89, %indvars.iv92
  br i1 %exitcond91.not, label %._crit_edge68, label %.lr.ph67, !llvm.loop !15
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5tupleIJxxEEC2ILb1ETnNSt9enable_ifIXclsr17_TupleConstraintsIXT_ExxEE37__is_implicitly_default_constructibleEEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5tupleIJxxEEC2IRxS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJxxEEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPSt5tupleIJxxEEZ4mainE3$_0EvT_S4_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt3tieIJxxEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple.2") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRxS0_EEaSIxxEENSt9enable_ifIXcl12__assignableIRKT_RKT0_EEERS1_E4typeERKS_IJS4_S7_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 nocallback nofree nosync nounwind willreturn }
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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long 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}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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