; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Codeagon 2016/Problem E (E)

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i64, align 8
@k = external dso_local global %struct.bigint, align 8
@a = external dso_local global [131072 x %struct.bigint], align 16
@MOD = external dso_local global i64, align 8
@dp = external dso_local global [131072 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5buildxxx(i64 noundef, i64 noundef, i64 noundef) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5queryxxxxx(ptr dead_on_unwind noalias writable sret(%struct.bigint) align 8, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) #0

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6bigintrmERKS_(ptr dead_on_unwind noalias writable sret(%struct.bigint) align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %struct.bigint, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %struct.bigint, align 8
  %7 = alloca %struct.bigint, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca %struct.bigint, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca %struct.bigint, align 8
  store i32 0, ptr %1, align 4
  %16 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %17 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %19
  %21 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %20, ptr noundef null)
  %22 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %23 = getelementptr i8, ptr %22, i64 -24
  %24 = load i64, ptr %23, align 8
  %25 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %24
  %26 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %25, ptr noundef null)
  %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) @n)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZrsRSiR6bigint(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(32) @k)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %29

29:                                               ; preds = %43, %0
  %30 = load i64, ptr %2, align 8, !tbaa !8
  %31 = load i64, ptr @n, align 8, !tbaa !8
  %32 = icmp slt i64 %30, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %29
  %35 = load i64, ptr %2, align 8, !tbaa !8
  %36 = getelementptr inbounds [131072 x %struct.bigint], ptr @a, i64 0, i64 %35
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZrsRSiR6bigint(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %36)
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #7
  %38 = load i64, ptr %2, align 8, !tbaa !8
  %39 = getelementptr inbounds [131072 x %struct.bigint], ptr @a, i64 0, i64 %38
  call void @_ZNK6bigintrmERKS_(ptr dead_on_unwind writable sret(%struct.bigint) align 8 %3, ptr noundef nonnull align 8 dereferenceable(32) %39, ptr noundef nonnull align 8 dereferenceable(32) @k)
  %40 = load i64, ptr %2, align 8, !tbaa !8
  %41 = getelementptr inbounds [131072 x %struct.bigint], ptr @a, i64 0, i64 %40
  invoke void @_ZN6bigintaSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %41, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %42 unwind label %46

42:                                               ; preds = %34
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #7
  br label %43

43:                                               ; preds = %42
  %44 = load i64, ptr %2, align 8, !tbaa !8
  %45 = add nsw i64 %44, 1
  store i64 %45, ptr %2, align 8, !tbaa !8
  br label %29, !llvm.loop !11

46:                                               ; preds = %34
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %4, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %5, align 4
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %232

50:                                               ; preds = %33
  %51 = load i64, ptr @n, align 8, !tbaa !8
  call void @_Z5buildxxx(i64 noundef 1, i64 noundef 0, i64 noundef %51)
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #7
  call void @_ZN6bigintC2Ex(ptr noundef nonnull align 8 dereferenceable(32) %6, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #7
  invoke void @_ZNK6bigintrmERKS_(ptr dead_on_unwind writable sret(%struct.bigint) align 8 %7, ptr noundef nonnull align 8 dereferenceable(32) @a, ptr noundef nonnull align 8 dereferenceable(32) @k)
          to label %52 unwind label %56

52:                                               ; preds = %50
  %53 = invoke noundef zeroext i1 @_ZNK6biginteqERKS_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %54 unwind label %60

54:                                               ; preds = %52
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #7
  br i1 %53, label %55, label %65

55:                                               ; preds = %54
  store i64 1, ptr getelementptr inbounds ([131072 x i64], ptr @dp, i64 0, i64 1), align 8, !tbaa !8
  br label %66

56:                                               ; preds = %50
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %4, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %5, align 4
  br label %64

60:                                               ; preds = %52
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %4, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %5, align 4
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  br label %64

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

65:                                               ; preds = %54
  store i64 0, ptr getelementptr inbounds ([131072 x i64], ptr @dp, i64 0, i64 1), align 8, !tbaa !8
  br label %66

66:                                               ; preds = %65, %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 1, ptr %9, align 8, !tbaa !8
  br label %67

67:                                               ; preds = %201, %66
  %68 = load i64, ptr %9, align 8, !tbaa !8
  %69 = load i64, ptr @n, align 8, !tbaa !8
  %70 = icmp slt i64 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %208

72:                                               ; preds = %67
  %73 = load i64, ptr %9, align 8, !tbaa !8
  %74 = getelementptr inbounds [131072 x %struct.bigint], ptr @a, i64 0, i64 %73
  %75 = invoke noundef zeroext i1 @_ZNK6biginteqERKS_(ptr noundef nonnull align 8 dereferenceable(32) %74, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %76 unwind label %93

76:                                               ; preds = %72
  br i1 %75, label %77, label %103

77:                                               ; preds = %76
  %78 = load i64, ptr %9, align 8, !tbaa !8
  %79 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !8
  %81 = icmp sgt i64 %80, 0
  br i1 %81, label %82, label %97

82:                                               ; preds = %77
  %83 = load i64, ptr %9, align 8, !tbaa !8
  %84 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %83
  %85 = load i64, ptr %84, align 8, !tbaa !8
  %86 = mul nsw i64 %85, 2
  %87 = add nsw i64 %86, 1
  %88 = load i64, ptr @MOD, align 8, !tbaa !8
  %89 = srem i64 %87, %88
  %90 = load i64, ptr %9, align 8, !tbaa !8
  %91 = add nsw i64 %90, 1
  %92 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %91
  store i64 %89, ptr %92, align 8, !tbaa !8
  br label %101

93:                                               ; preds = %72
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %4, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %5, align 4
  br label %207

97:                                               ; preds = %77
  %98 = load i64, ptr %9, align 8, !tbaa !8
  %99 = add nsw i64 %98, 1
  %100 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %99
  store i64 1, ptr %100, align 8, !tbaa !8
  br label %101

101:                                              ; preds = %97, %82
  %102 = load i64, ptr %9, align 8, !tbaa !8
  store i64 %102, ptr %8, align 8, !tbaa !8
  br label %201

103:                                              ; preds = %76
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #7
  %104 = load i64, ptr %9, align 8, !tbaa !8
  %105 = add nsw i64 %104, 1
  %106 = load i64, ptr @n, align 8, !tbaa !8
  invoke void @_Z5queryxxxxx(ptr dead_on_unwind writable sret(%struct.bigint) align 8 %11, i64 noundef 0, i64 noundef %105, i64 noundef 1, i64 noundef 0, i64 noundef %106)
          to label %107 unwind label %117

107:                                              ; preds = %103
  %108 = invoke noundef zeroext i1 @_ZNK6bigintneERKS_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %109 unwind label %121

109:                                              ; preds = %107
  br i1 %108, label %110, label %125

110:                                              ; preds = %109
  %111 = load i64, ptr %9, align 8, !tbaa !8
  %112 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !8
  %114 = load i64, ptr %9, align 8, !tbaa !8
  %115 = add nsw i64 %114, 1
  %116 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %115
  store i64 %113, ptr %116, align 8, !tbaa !8
  store i32 7, ptr %10, align 4
  br label %198

117:                                              ; preds = %103
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %4, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %5, align 4
  br label %206

121:                                              ; preds = %107
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %4, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %5, align 4
  br label %205

125:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %126 = load i64, ptr %8, align 8, !tbaa !8
  store i64 %126, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %127 = load i64, ptr %9, align 8, !tbaa !8
  store i64 %127, ptr %13, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  br label %128

128:                                              ; preds = %164, %125
  %129 = load i64, ptr %12, align 8, !tbaa !8
  %130 = load i64, ptr %13, align 8, !tbaa !8
  %131 = icmp sle i64 %129, %130
  br i1 %131, label %132, label %165

132:                                              ; preds = %128
  %133 = load i64, ptr %12, align 8, !tbaa !8
  %134 = load i64, ptr %13, align 8, !tbaa !8
  %135 = add nsw i64 %133, %134
  %136 = sdiv i64 %135, 2
  store i64 %136, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #7
  %137 = load i64, ptr %12, align 8, !tbaa !8
  %138 = load i64, ptr %13, align 8, !tbaa !8
  %139 = add nsw i64 %138, 1
  %140 = load i64, ptr @n, align 8, !tbaa !8
  invoke void @_Z5queryxxxxx(ptr dead_on_unwind writable sret(%struct.bigint) align 8 %15, i64 noundef %137, i64 noundef %139, i64 noundef 1, i64 noundef 0, i64 noundef %140)
          to label %141 unwind label %148

141:                                              ; preds = %132
  invoke void @_ZN6bigintaSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(32) %15)
          to label %142 unwind label %152

142:                                              ; preds = %141
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #7
  %143 = invoke noundef zeroext i1 @_ZNK6biginteqERKS_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %144 unwind label %157

144:                                              ; preds = %142
  br i1 %143, label %145, label %161

145:                                              ; preds = %144
  %146 = load i64, ptr %14, align 8, !tbaa !8
  %147 = add nsw i64 %146, 1
  store i64 %147, ptr %12, align 8, !tbaa !8
  br label %164

148:                                              ; preds = %132
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %4, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %5, align 4
  br label %156

152:                                              ; preds = %141
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %4, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %5, align 4
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #7
  br label %156

156:                                              ; preds = %152, %148
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #7
  br label %204

157:                                              ; preds = %194, %142
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %4, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %5, align 4
  br label %204

161:                                              ; preds = %144
  %162 = load i64, ptr %14, align 8, !tbaa !8
  %163 = sub nsw i64 %162, 1
  store i64 %163, ptr %13, align 8, !tbaa !8
  br label %164

164:                                              ; preds = %161, %145
  br label %128, !llvm.loop !13

165:                                              ; preds = %128
  %166 = load i64, ptr %12, align 8, !tbaa !8
  %167 = sub nsw i64 %166, 1
  store i64 %167, ptr %12, align 8, !tbaa !8
  %168 = load i64, ptr %12, align 8, !tbaa !8
  %169 = icmp sle i64 %168, 0
  br i1 %169, label %170, label %180

170:                                              ; preds = %165
  %171 = load i64, ptr %9, align 8, !tbaa !8
  %172 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %171
  %173 = load i64, ptr %172, align 8, !tbaa !8
  %174 = add nsw i64 %173, 1
  %175 = load i64, ptr @MOD, align 8, !tbaa !8
  %176 = srem i64 %174, %175
  %177 = load i64, ptr %9, align 8, !tbaa !8
  %178 = add nsw i64 %177, 1
  %179 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %178
  store i64 %176, ptr %179, align 8, !tbaa !8
  br label %194

180:                                              ; preds = %165
  %181 = load i64, ptr %12, align 8, !tbaa !8
  %182 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %181
  %183 = load i64, ptr %182, align 8, !tbaa !8
  %184 = add nsw i64 %183, 1
  %185 = load i64, ptr %9, align 8, !tbaa !8
  %186 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %185
  %187 = load i64, ptr %186, align 8, !tbaa !8
  %188 = add nsw i64 %184, %187
  %189 = load i64, ptr @MOD, align 8, !tbaa !8
  %190 = srem i64 %188, %189
  %191 = load i64, ptr %9, align 8, !tbaa !8
  %192 = add nsw i64 %191, 1
  %193 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %192
  store i64 %190, ptr %193, align 8, !tbaa !8
  br label %194

194:                                              ; preds = %180, %170
  %195 = invoke 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) %12)
          to label %196 unwind label %157

196:                                              ; preds = %194
  %197 = load i64, ptr %195, align 8, !tbaa !8
  store i64 %197, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  store i32 0, ptr %10, align 4
  br label %198

198:                                              ; preds = %196, %110
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #7
  %199 = load i32, ptr %10, align 4
  switch i32 %199, label %237 [
    i32 0, label %200
    i32 7, label %201
  ]

200:                                              ; preds = %198
  br label %201

201:                                              ; preds = %200, %198, %101
  %202 = load i64, ptr %9, align 8, !tbaa !8
  %203 = add nsw i64 %202, 1
  store i64 %203, ptr %9, align 8, !tbaa !8
  br label %67, !llvm.loop !14

204:                                              ; preds = %157, %156
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %205

205:                                              ; preds = %204, %121
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  br label %206

206:                                              ; preds = %205, %117
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #7
  br label %207

207:                                              ; preds = %206, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %230

208:                                              ; preds = %71
  %209 = load i64, ptr @n, align 8, !tbaa !8
  %210 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %209
  %211 = load i64, ptr %210, align 8, !tbaa !8
  %212 = load i64, ptr @n, align 8, !tbaa !8
  %213 = sub nsw i64 %212, 1
  %214 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %213
  %215 = load i64, ptr %214, align 8, !tbaa !8
  %216 = sub nsw i64 %211, %215
  %217 = load i64, ptr @MOD, align 8, !tbaa !8
  %218 = add nsw i64 %216, %217
  %219 = load i64, ptr @MOD, align 8, !tbaa !8
  %220 = srem i64 %218, %219
  %221 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %220)
          to label %222 unwind label %226

222:                                              ; preds = %208
  %223 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %221, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %224 unwind label %226

224:                                              ; preds = %222
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #7
  %225 = load i32, ptr %1, align 4
  ret i32 %225

226:                                              ; preds = %222, %208
  %227 = landingpad { ptr, i32 }
          cleanup
  %228 = extractvalue { ptr, i32 } %227, 0
  store ptr %228, ptr %4, align 8
  %229 = extractvalue { ptr, i32 } %227, 1
  store i32 %229, ptr %5, align 4
  br label %230

230:                                              ; preds = %226, %207
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %231

231:                                              ; preds = %230, %64
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #7
  br label %232

232:                                              ; preds = %231, %46
  %233 = load ptr, ptr %4, align 8
  %234 = load i32, ptr %5, align 4
  %235 = insertvalue { ptr, i32 } poison, ptr %233, 0
  %236 = insertvalue { ptr, i32 } %235, i32 %234, 1
  resume { ptr, i32 } %236

237:                                              ; preds = %198
  unreachable
}

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

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

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

; 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 void @_ZN6bigintaSERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6biginteqERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6bigintneERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #6 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)) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 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 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { "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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !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_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 }
%struct.bigint = type { %"class.std::vector", i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i64, align 8
@k = external dso_local global %struct.bigint, align 8
@a = external dso_local global [131072 x %struct.bigint], align 16
@MOD = external dso_local local_unnamed_addr global i64, align 8
@dp = external dso_local local_unnamed_addr global [131072 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5buildxxx(i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5queryxxxxx(ptr dead_on_unwind noalias writable sret(%struct.bigint) align 8, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6bigintrmERKS_(ptr dead_on_unwind noalias writable sret(%struct.bigint) align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca %struct.bigint, align 8
  %2 = alloca %struct.bigint, align 8
  %3 = alloca %struct.bigint, align 8
  %4 = alloca i64, align 8
  %5 = alloca %struct.bigint, align 8
  %6 = alloca i64, align 8
  %7 = alloca %struct.bigint, align 8
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %11
  %13 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  %14 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %15 = getelementptr i8, ptr %14, i64 -24
  %16 = load i64, ptr %15, align 8
  %17 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %16
  %18 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %17, ptr noundef null)
  %19 = 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)
  %20 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZrsRSiR6bigint(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(32) @k)
  %21 = load i64, ptr @n, align 8, !tbaa !8
  %22 = icmp sgt i64 %21, 0
  br i1 %22, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %25, %0
  %.lcssa55 = phi i64 [ %21, %0 ], [ %27, %25 ]
  call void @_Z5buildxxx(i64 noundef 1, i64 noundef 0, i64 noundef %.lcssa55)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #7
  call void @_ZN6bigintC2Ex(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  invoke void @_ZNK6bigintrmERKS_(ptr dead_on_unwind nonnull writable sret(%struct.bigint) align 8 %3, ptr noundef nonnull align 8 dereferenceable(32) @a, ptr noundef nonnull align 8 dereferenceable(32) @k)
          to label %31 unwind label %35

.lr.ph:                                           ; preds = %0, %25
  %.03657 = phi i64 [ %26, %25 ], [ 0, %0 ]
  %23 = getelementptr inbounds [131072 x %struct.bigint], ptr @a, i64 0, i64 %.03657
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZrsRSiR6bigint(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %23)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #7
  call void @_ZNK6bigintrmERKS_(ptr dead_on_unwind nonnull writable sret(%struct.bigint) align 8 %1, ptr noundef nonnull align 8 dereferenceable(32) %23, ptr noundef nonnull align 8 dereferenceable(32) @k)
  invoke void @_ZN6bigintaSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %23, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %25 unwind label %29

25:                                               ; preds = %.lr.ph
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  %26 = add nuw nsw i64 %.03657, 1
  %27 = load i64, ptr @n, align 8, !tbaa !8
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %.lr.ph, label %._crit_edge, !llvm.loop !11

29:                                               ; preds = %.lr.ph
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  br label %123

31:                                               ; preds = %._crit_edge
  %32 = call noundef zeroext i1 @_ZNK6biginteqERKS_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) %2)
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  %. = zext i1 %32 to i64
  store i64 %., ptr getelementptr inbounds (i8, ptr @dp, i64 8), align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store i64 0, ptr %4, align 8, !tbaa !8
  %33 = load i64, ptr @n, align 8, !tbaa !8
  %34 = icmp sgt i64 %33, 1
  br i1 %34, label %.lr.ph68, label %._crit_edge69

35:                                               ; preds = %._crit_edge
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  br label %122

._crit_edge69:                                    ; preds = %112, %31
  %.lcssa51 = phi i64 [ %33, %31 ], [ %113, %112 ]
  %37 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %.lcssa51
  %38 = load i64, ptr %37, align 8, !tbaa !8
  %39 = add nsw i64 %.lcssa51, -1
  %40 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !8
  %42 = sub i64 %38, %41
  %43 = load i64, ptr @MOD, align 8, !tbaa !8
  %44 = add nsw i64 %42, %43
  %45 = srem i64 %44, %43
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %45)
          to label %116 unwind label %119

.lr.ph68:                                         ; preds = %31, %112
  %.02864 = phi i64 [ %.pre-phi, %112 ], [ 1, %31 ]
  %47 = getelementptr inbounds [131072 x %struct.bigint], ptr @a, i64 0, i64 %.02864
  %48 = call noundef zeroext i1 @_ZNK6biginteqERKS_(ptr noundef nonnull align 8 dereferenceable(32) %47, ptr noundef nonnull align 8 dereferenceable(32) %2)
  br i1 %48, label %49, label %61

49:                                               ; preds = %.lr.ph68
  %50 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %.02864
  %51 = load i64, ptr %50, align 8, !tbaa !8
  %52 = icmp sgt i64 %51, 0
  br i1 %52, label %53, label %58

53:                                               ; preds = %49
  %54 = shl nuw nsw i64 %51, 1
  %55 = or disjoint i64 %54, 1
  %56 = load i64, ptr @MOD, align 8, !tbaa !8
  %57 = srem i64 %55, %56
  br label %58

58:                                               ; preds = %49, %53
  %.sink76 = phi i64 [ %57, %53 ], [ 1, %49 ]
  %59 = add nuw nsw i64 %.02864, 1
  %60 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %59
  store i64 %.sink76, ptr %60, align 8, !tbaa !8
  store i64 %.02864, ptr %4, align 8, !tbaa !8
  br label %112

61:                                               ; preds = %.lr.ph68
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #7
  %62 = add nuw nsw i64 %.02864, 1
  %63 = load i64, ptr @n, align 8, !tbaa !8
  invoke void @_Z5queryxxxxx(ptr dead_on_unwind nonnull writable sret(%struct.bigint) align 8 %5, i64 noundef 0, i64 noundef %62, i64 noundef 1, i64 noundef 0, i64 noundef %63)
          to label %64 unwind label %70

64:                                               ; preds = %61
  %65 = call noundef zeroext i1 @_ZNK6bigintneERKS_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %2)
  br i1 %65, label %66, label %72

66:                                               ; preds = %64
  %67 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %.02864
  %68 = load i64, ptr %67, align 8, !tbaa !8
  %69 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %62
  store i64 %68, ptr %69, align 8, !tbaa !8
  br label %111

70:                                               ; preds = %61
  %71 = landingpad { ptr, i32 }
          cleanup
  br label %115

72:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %73 = load i64, ptr %4, align 8, !tbaa !8
  store i64 %73, ptr %6, align 8, !tbaa !8
  %.not58 = icmp sgt i64 %73, %.02864
  br i1 %.not58, label %._crit_edge62, label %.lr.ph61

.lr.ph61:                                         ; preds = %72, %91
  %.059 = phi i64 [ %.1, %91 ], [ %.02864, %72 ]
  %74 = phi i64 [ %.pr, %91 ], [ %73, %72 ]
  %75 = add nsw i64 %.059, %74
  %76 = sdiv i64 %75, 2
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #7
  %77 = add nsw i64 %.059, 1
  %78 = load i64, ptr @n, align 8, !tbaa !8
  invoke void @_Z5queryxxxxx(ptr dead_on_unwind nonnull writable sret(%struct.bigint) align 8 %7, i64 noundef %74, i64 noundef %77, i64 noundef 1, i64 noundef 0, i64 noundef %78)
          to label %79 unwind label %84

79:                                               ; preds = %.lr.ph61
  invoke void @_ZN6bigintaSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %80 unwind label %86

80:                                               ; preds = %79
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  %81 = call noundef zeroext i1 @_ZNK6biginteqERKS_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %2)
  br i1 %81, label %82, label %89

82:                                               ; preds = %80
  %83 = add nsw i64 %76, 1
  store i64 %83, ptr %6, align 8, !tbaa !8
  br label %91

84:                                               ; preds = %.lr.ph61
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %88

86:                                               ; preds = %79
  %87 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  br label %88

88:                                               ; preds = %86, %84
  %.pn = phi { ptr, i32 } [ %87, %86 ], [ %85, %84 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  br label %115

89:                                               ; preds = %80
  %90 = add nsw i64 %76, -1
  %.pr.pre = load i64, ptr %6, align 8, !tbaa !8
  br label %91

91:                                               ; preds = %89, %82
  %.pr = phi i64 [ %83, %82 ], [ %.pr.pre, %89 ]
  %.1 = phi i64 [ %.059, %82 ], [ %90, %89 ]
  %.not = icmp sgt i64 %.pr, %.1
  br i1 %.not, label %._crit_edge62, label %.lr.ph61, !llvm.loop !13

._crit_edge62:                                    ; preds = %91, %72
  %.lcssa = phi i64 [ %73, %72 ], [ %.pr, %91 ]
  %92 = add nsw i64 %.lcssa, -1
  store i64 %92, ptr %6, align 8, !tbaa !8
  %93 = icmp slt i64 %.lcssa, 2
  br i1 %93, label %94, label %98

94:                                               ; preds = %._crit_edge62
  %95 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %.02864
  %96 = load i64, ptr %95, align 8, !tbaa !8
  %97 = add nsw i64 %96, 1
  br label %105

98:                                               ; preds = %._crit_edge62
  %99 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %92
  %100 = load i64, ptr %99, align 8, !tbaa !8
  %101 = add nsw i64 %100, 1
  %102 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %.02864
  %103 = load i64, ptr %102, align 8, !tbaa !8
  %104 = add nsw i64 %101, %103
  br label %105

105:                                              ; preds = %98, %94
  %.sink79 = phi i64 [ %104, %98 ], [ %97, %94 ]
  %106 = load i64, ptr @MOD, align 8, !tbaa !8
  %107 = srem i64 %.sink79, %106
  %108 = getelementptr inbounds [131072 x i64], ptr @dp, i64 0, i64 %62
  store i64 %107, ptr %108, align 8
  %109 = 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) %6)
  %110 = load i64, ptr %109, align 8, !tbaa !8
  store i64 %110, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %111

111:                                              ; preds = %105, %66
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  br label %112

112:                                              ; preds = %111, %58
  %.pre-phi = phi i64 [ %62, %111 ], [ %59, %58 ]
  %113 = load i64, ptr @n, align 8, !tbaa !8
  %114 = icmp slt i64 %.pre-phi, %113
  br i1 %114, label %.lr.ph68, label %._crit_edge69, !llvm.loop !14

115:                                              ; preds = %88, %70
  %.pn.pn = phi { ptr, i32 } [ %.pn, %88 ], [ %71, %70 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  br label %121

116:                                              ; preds = %._crit_edge69
  %117 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %118 unwind label %119

118:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #7
  ret i32 0

119:                                              ; preds = %116, %._crit_edge69
  %120 = landingpad { ptr, i32 }
          cleanup
  br label %121

121:                                              ; preds = %119, %115
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %115 ], [ %120, %119 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %122

122:                                              ; preds = %121, %35
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %121 ], [ %36, %35 ]
  call void @_ZN6bigintD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #7
  br label %123

123:                                              ; preds = %122, %29
  %.pn47 = phi { ptr, i32 } [ %30, %29 ], [ %.pn.pn.pn.pn, %122 ]
  resume { ptr, i32 } %.pn47
}

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

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

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

; 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 void @_ZN6bigintaSERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6biginteqERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6bigintneERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #6 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 #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0 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 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { "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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


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