; LLVM IR from eyangch/competitive-programming :: USACOcontests/gold/2021.03 (permutations)

; 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"

%"struct.std::pair" = type { i64, i64 }
%"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::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<tri, std::allocator<tri>>::_Vector_impl" }
%"struct.std::_Vector_base<tri, std::allocator<tri>>::_Vector_impl" = type { %"struct.std::_Vector_base<tri, std::allocator<tri>>::_Vector_impl_data" }
%"struct.std::_Vector_base<tri, std::allocator<tri>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.tri = type { i64, i64, i64, i64 }

@N = external dso_local global i64, align 8
@perm = external dso_local global [40 x i64], align 16
@dp = external dso_local global [40 x [40 x [40 x i64]]], align 16
@ct = external dso_local global [40 x [40 x [40 x i64]]], align 16
@pt = external dso_local global [40 x %"struct.std::pair"], align 16
@MOD = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z6in_triSt4pairIxxES0_S0_S0_(i64, i64, i64, i64, i64, i64, ptr noundef byval(%"struct.std::pair") align 8) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z5v_trixxxx(i64 noundef, i64 noundef, i64 noundef, i64 noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::priority_queue", align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca %"struct.std::pair", align 8
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %struct.tri, align 8
  %18 = alloca %struct.tri, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca %"struct.std::pair", align 8
  %29 = alloca %"struct.std::pair", align 8
  %30 = alloca %"struct.std::pair", align 8
  %31 = alloca %"struct.std::pair", align 8
  %32 = alloca i64, align 8
  %33 = alloca i64, align 8
  %34 = alloca i64, align 8
  %35 = alloca i64, align 8
  %36 = alloca i64, align 8
  %37 = alloca i64, align 8
  %38 = alloca i64, align 8
  %39 = alloca i64, align 8
  %40 = alloca i64, align 8
  %41 = alloca i64, align 8
  %42 = alloca i64, align 8
  %43 = alloca i8, align 1
  %44 = alloca i64, align 8
  %45 = alloca i64, align 8
  %46 = alloca i64, align 8
  %47 = alloca i8, align 1
  %48 = alloca i64, align 8
  %49 = alloca %"struct.std::pair", align 8
  %50 = alloca %"struct.std::pair", align 8
  %51 = alloca %"struct.std::pair", align 8
  %52 = alloca %"struct.std::pair", align 8
  store i32 0, ptr %1, align 4
  %53 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %54 = getelementptr i8, ptr %53, i64 -24
  %55 = load i64, ptr %54, align 8
  %56 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %55
  %57 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %56, ptr noundef null)
  %58 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %59 = 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)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #8
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %60

60:                                               ; preds = %74, %0
  %61 = load i64, ptr %2, align 8, !tbaa !8
  %62 = load i64, ptr @N, align 8, !tbaa !8
  %63 = icmp slt i64 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  br label %77

65:                                               ; preds = %60
  %66 = load i64, ptr %2, align 8, !tbaa !8
  %67 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %66
  %68 = getelementptr inbounds %"struct.std::pair", ptr %67, i32 0, i32 0
  %69 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %68)
  %70 = load i64, ptr %2, align 8, !tbaa !8
  %71 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %70
  %72 = getelementptr inbounds %"struct.std::pair", ptr %71, i32 0, i32 1
  %73 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %69, ptr noundef nonnull align 8 dereferenceable(8) %72)
  br label %74

74:                                               ; preds = %65
  %75 = load i64, ptr %2, align 8, !tbaa !8
  %76 = add nsw i64 %75, 1
  store i64 %76, ptr %2, align 8, !tbaa !8
  br label %60, !llvm.loop !11

77:                                               ; preds = %64
  %78 = load i64, ptr @N, align 8, !tbaa !8
  %79 = getelementptr inbounds i64, ptr @perm, i64 %78
  call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef @perm, ptr noundef %79, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  store i64 0, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #8
  call void @_ZNSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  store i64 0, ptr %5, align 8, !tbaa !8
  br label %80

80:                                               ; preds = %184, %77
  %81 = load i64, ptr %5, align 8, !tbaa !8
  %82 = load i64, ptr @N, align 8, !tbaa !8
  %83 = icmp slt i64 %81, %82
  br i1 %83, label %85, label %84

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

85:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %86 = load i64, ptr %5, align 8, !tbaa !8
  %87 = add nsw i64 %86, 1
  store i64 %87, ptr %7, align 8, !tbaa !8
  br label %88

88:                                               ; preds = %180, %85
  %89 = load i64, ptr %7, align 8, !tbaa !8
  %90 = load i64, ptr @N, align 8, !tbaa !8
  %91 = icmp slt i64 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %183

93:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %94 = load i64, ptr %7, align 8, !tbaa !8
  %95 = add nsw i64 %94, 1
  store i64 %95, ptr %8, align 8, !tbaa !8
  br label %96

96:                                               ; preds = %171, %93
  %97 = load i64, ptr %8, align 8, !tbaa !8
  %98 = load i64, ptr @N, align 8, !tbaa !8
  %99 = icmp slt i64 %97, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %96
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %179

101:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  store i64 0, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  store i64 0, ptr %10, align 8, !tbaa !8
  br label %102

102:                                              ; preds = %151, %101
  %103 = load i64, ptr %10, align 8, !tbaa !8
  %104 = load i64, ptr @N, align 8, !tbaa !8
  %105 = icmp slt i64 %103, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %102
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %154

107:                                              ; preds = %102
  %108 = load i64, ptr %10, align 8, !tbaa !8
  %109 = load i64, ptr %5, align 8, !tbaa !8
  %110 = icmp eq i64 %108, %109
  br i1 %110, label %119, label %111

111:                                              ; preds = %107
  %112 = load i64, ptr %10, align 8, !tbaa !8
  %113 = load i64, ptr %7, align 8, !tbaa !8
  %114 = icmp eq i64 %112, %113
  br i1 %114, label %119, label %115

115:                                              ; preds = %111
  %116 = load i64, ptr %10, align 8, !tbaa !8
  %117 = load i64, ptr %8, align 8, !tbaa !8
  %118 = icmp eq i64 %116, %117
  br i1 %118, label %119, label %120

119:                                              ; preds = %115, %111, %107
  br label %151

120:                                              ; preds = %115
  %121 = load i64, ptr %10, align 8, !tbaa !8
  %122 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %121
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 16 %122, i64 16, i1 false)
  %123 = load i64, ptr %5, align 8, !tbaa !8
  %124 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %123
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 16 %124, i64 16, i1 false)
  %125 = load i64, ptr %7, align 8, !tbaa !8
  %126 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %125
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 16 %126, i64 16, i1 false)
  %127 = load i64, ptr %8, align 8, !tbaa !8
  %128 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %127
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 16 %128, i64 16, i1 false)
  %129 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 0
  %130 = load i64, ptr %129, align 8
  %131 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 1
  %132 = load i64, ptr %131, align 8
  %133 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 0
  %134 = load i64, ptr %133, align 8
  %135 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 1
  %136 = load i64, ptr %135, align 8
  %137 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 0
  %138 = load i64, ptr %137, align 8
  %139 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 1
  %140 = load i64, ptr %139, align 8
  %141 = invoke noundef zeroext i1 @_Z6in_triSt4pairIxxES0_S0_S0_(i64 %130, i64 %132, i64 %134, i64 %136, i64 %138, i64 %140, ptr noundef byval(%"struct.std::pair") align 8 %14)
          to label %142 unwind label %146

142:                                              ; preds = %120
  br i1 %141, label %143, label %150

143:                                              ; preds = %142
  %144 = load i64, ptr %9, align 8, !tbaa !8
  %145 = add nsw i64 %144, 1
  store i64 %145, ptr %9, align 8, !tbaa !8
  br label %150

146:                                              ; preds = %120
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %15, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %178

150:                                              ; preds = %143, %142
  br label %151

151:                                              ; preds = %150, %119
  %152 = load i64, ptr %10, align 8, !tbaa !8
  %153 = add nsw i64 %152, 1
  store i64 %153, ptr %10, align 8, !tbaa !8
  br label %102, !llvm.loop !13

154:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #8
  %155 = getelementptr inbounds %struct.tri, ptr %17, i32 0, i32 0
  %156 = load i64, ptr %9, align 8, !tbaa !8
  store i64 %156, ptr %155, align 8, !tbaa !14
  %157 = getelementptr inbounds %struct.tri, ptr %17, i32 0, i32 1
  %158 = load i64, ptr %5, align 8, !tbaa !8
  store i64 %158, ptr %157, align 8, !tbaa !16
  %159 = getelementptr inbounds %struct.tri, ptr %17, i32 0, i32 2
  %160 = load i64, ptr %7, align 8, !tbaa !8
  store i64 %160, ptr %159, align 8, !tbaa !17
  %161 = getelementptr inbounds %struct.tri, ptr %17, i32 0, i32 3
  %162 = load i64, ptr %8, align 8, !tbaa !8
  store i64 %162, ptr %161, align 8, !tbaa !18
  invoke void @_ZNSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25) %4, ptr noundef nonnull align 8 dereferenceable(32) %17)
          to label %163 unwind label %174

163:                                              ; preds = %154
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #8
  %164 = load i64, ptr %9, align 8, !tbaa !8
  %165 = load i64, ptr %5, align 8, !tbaa !8
  %166 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @ct, i64 0, i64 %165
  %167 = load i64, ptr %7, align 8, !tbaa !8
  %168 = getelementptr inbounds [40 x [40 x i64]], ptr %166, i64 0, i64 %167
  %169 = load i64, ptr %8, align 8, !tbaa !8
  %170 = getelementptr inbounds [40 x i64], ptr %168, i64 0, i64 %169
  store i64 %164, ptr %170, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %171

171:                                              ; preds = %163
  %172 = load i64, ptr %8, align 8, !tbaa !8
  %173 = add nsw i64 %172, 1
  store i64 %173, ptr %8, align 8, !tbaa !8
  br label %96, !llvm.loop !19

174:                                              ; preds = %154
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %15, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #8
  br label %178

178:                                              ; preds = %174, %146
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %563

179:                                              ; preds = %100
  br label %180

180:                                              ; preds = %179
  %181 = load i64, ptr %7, align 8, !tbaa !8
  %182 = add nsw i64 %181, 1
  store i64 %182, ptr %7, align 8, !tbaa !8
  br label %88, !llvm.loop !20

183:                                              ; preds = %92
  br label %184

184:                                              ; preds = %183
  %185 = load i64, ptr %5, align 8, !tbaa !8
  %186 = add nsw i64 %185, 1
  store i64 %186, ptr %5, align 8, !tbaa !8
  br label %80, !llvm.loop !21

187:                                              ; preds = %84
  br label %188

188:                                              ; preds = %436, %187
  %189 = invoke noundef zeroext i1 @_ZNKSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
          to label %190 unwind label %227

190:                                              ; preds = %188
  %191 = xor i1 %189, true
  br i1 %191, label %192, label %438

192:                                              ; preds = %190
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #8
  %193 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
          to label %194 unwind label %231

194:                                              ; preds = %192
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %193, i64 32, i1 false), !tbaa.struct !22
  invoke void @_ZNSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
          to label %195 unwind label %231

195:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %196 = getelementptr inbounds %struct.tri, ptr %18, i32 0, i32 0
  %197 = load i64, ptr %196, align 8, !tbaa !14
  store i64 %197, ptr %19, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %198 = getelementptr inbounds %struct.tri, ptr %18, i32 0, i32 1
  %199 = load i64, ptr %198, align 8, !tbaa !16
  store i64 %199, ptr %20, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %200 = getelementptr inbounds %struct.tri, ptr %18, i32 0, i32 2
  %201 = load i64, ptr %200, align 8, !tbaa !17
  store i64 %201, ptr %21, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %202 = getelementptr inbounds %struct.tri, ptr %18, i32 0, i32 3
  %203 = load i64, ptr %202, align 8, !tbaa !18
  store i64 %203, ptr %22, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %204 = load i64, ptr %20, align 8, !tbaa !8
  %205 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @ct, i64 0, i64 %204
  %206 = load i64, ptr %21, align 8, !tbaa !8
  %207 = getelementptr inbounds [40 x [40 x i64]], ptr %205, i64 0, i64 %206
  %208 = load i64, ptr %22, align 8, !tbaa !8
  %209 = getelementptr inbounds [40 x i64], ptr %207, i64 0, i64 %208
  %210 = load i64, ptr %209, align 8, !tbaa !8
  store i64 %210, ptr %23, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %211 = load i64, ptr @N, align 8, !tbaa !8
  %212 = load i64, ptr %20, align 8, !tbaa !8
  %213 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @ct, i64 0, i64 %212
  %214 = load i64, ptr %21, align 8, !tbaa !8
  %215 = getelementptr inbounds [40 x [40 x i64]], ptr %213, i64 0, i64 %214
  %216 = load i64, ptr %22, align 8, !tbaa !8
  %217 = getelementptr inbounds [40 x i64], ptr %215, i64 0, i64 %216
  %218 = load i64, ptr %217, align 8, !tbaa !8
  %219 = sub nsw i64 %211, %218
  %220 = sub nsw i64 %219, 3
  %221 = add nsw i64 %220, 1
  store i64 %221, ptr %24, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  store i64 1, ptr %25, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  store i64 0, ptr %26, align 8, !tbaa !8
  br label %222

222:                                              ; preds = %243, %195
  %223 = load i64, ptr %26, align 8, !tbaa !8
  %224 = load i64, ptr %23, align 8, !tbaa !8
  %225 = icmp slt i64 %223, %224
  br i1 %225, label %235, label %226

226:                                              ; preds = %222
  store i32 19, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %246

227:                                              ; preds = %188
  %228 = landingpad { ptr, i32 }
          cleanup
  %229 = extractvalue { ptr, i32 } %228, 0
  store ptr %229, ptr %15, align 8
  %230 = extractvalue { ptr, i32 } %228, 1
  store i32 %230, ptr %16, align 4
  br label %563

231:                                              ; preds = %194, %192
  %232 = landingpad { ptr, i32 }
          cleanup
  %233 = extractvalue { ptr, i32 } %232, 0
  store ptr %233, ptr %15, align 8
  %234 = extractvalue { ptr, i32 } %232, 1
  store i32 %234, ptr %16, align 4
  br label %437

235:                                              ; preds = %222
  %236 = load i64, ptr %25, align 8, !tbaa !8
  %237 = load i64, ptr %24, align 8, !tbaa !8
  %238 = load i64, ptr %26, align 8, !tbaa !8
  %239 = add nsw i64 %237, %238
  %240 = mul nsw i64 %236, %239
  %241 = load i64, ptr @MOD, align 8, !tbaa !8
  %242 = srem i64 %240, %241
  store i64 %242, ptr %25, align 8, !tbaa !8
  br label %243

243:                                              ; preds = %235
  %244 = load i64, ptr %26, align 8, !tbaa !8
  %245 = add nsw i64 %244, 1
  store i64 %245, ptr %26, align 8, !tbaa !8
  br label %222, !llvm.loop !23

246:                                              ; preds = %226
  %247 = load i64, ptr %25, align 8, !tbaa !8
  %248 = mul nsw i64 6, %247
  %249 = load i64, ptr %20, align 8, !tbaa !8
  %250 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @dp, i64 0, i64 %249
  %251 = load i64, ptr %21, align 8, !tbaa !8
  %252 = getelementptr inbounds [40 x [40 x i64]], ptr %250, i64 0, i64 %251
  %253 = load i64, ptr %22, align 8, !tbaa !8
  %254 = getelementptr inbounds [40 x i64], ptr %252, i64 0, i64 %253
  %255 = load i64, ptr %254, align 8, !tbaa !8
  %256 = add nsw i64 %255, %248
  store i64 %256, ptr %254, align 8, !tbaa !8
  %257 = load i64, ptr @MOD, align 8, !tbaa !8
  %258 = load i64, ptr %20, align 8, !tbaa !8
  %259 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @dp, i64 0, i64 %258
  %260 = load i64, ptr %21, align 8, !tbaa !8
  %261 = getelementptr inbounds [40 x [40 x i64]], ptr %259, i64 0, i64 %260
  %262 = load i64, ptr %22, align 8, !tbaa !8
  %263 = getelementptr inbounds [40 x i64], ptr %261, i64 0, i64 %262
  %264 = load i64, ptr %263, align 8, !tbaa !8
  %265 = srem i64 %264, %257
  store i64 %265, ptr %263, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  store i64 0, ptr %27, align 8, !tbaa !8
  br label %266

266:                                              ; preds = %432, %246
  %267 = load i64, ptr %27, align 8, !tbaa !8
  %268 = load i64, ptr @N, align 8, !tbaa !8
  %269 = icmp slt i64 %267, %268
  br i1 %269, label %271, label %270

270:                                              ; preds = %266
  store i32 22, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  br label %436

271:                                              ; preds = %266
  %272 = load i64, ptr %27, align 8, !tbaa !8
  %273 = load i64, ptr %20, align 8, !tbaa !8
  %274 = icmp eq i64 %272, %273
  br i1 %274, label %283, label %275

275:                                              ; preds = %271
  %276 = load i64, ptr %27, align 8, !tbaa !8
  %277 = load i64, ptr %21, align 8, !tbaa !8
  %278 = icmp eq i64 %276, %277
  br i1 %278, label %283, label %279

279:                                              ; preds = %275
  %280 = load i64, ptr %27, align 8, !tbaa !8
  %281 = load i64, ptr %22, align 8, !tbaa !8
  %282 = icmp eq i64 %280, %281
  br i1 %282, label %283, label %284

283:                                              ; preds = %279, %275, %271
  br label %432

284:                                              ; preds = %279
  %285 = load i64, ptr %27, align 8, !tbaa !8
  %286 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %285
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %28, ptr align 16 %286, i64 16, i1 false)
  %287 = load i64, ptr %20, align 8, !tbaa !8
  %288 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %287
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 16 %288, i64 16, i1 false)
  %289 = load i64, ptr %21, align 8, !tbaa !8
  %290 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %289
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %30, ptr align 16 %290, i64 16, i1 false)
  %291 = load i64, ptr %22, align 8, !tbaa !8
  %292 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %291
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %31, ptr align 16 %292, i64 16, i1 false)
  %293 = getelementptr inbounds { i64, i64 }, ptr %28, i32 0, i32 0
  %294 = load i64, ptr %293, align 8
  %295 = getelementptr inbounds { i64, i64 }, ptr %28, i32 0, i32 1
  %296 = load i64, ptr %295, align 8
  %297 = getelementptr inbounds { i64, i64 }, ptr %29, i32 0, i32 0
  %298 = load i64, ptr %297, align 8
  %299 = getelementptr inbounds { i64, i64 }, ptr %29, i32 0, i32 1
  %300 = load i64, ptr %299, align 8
  %301 = getelementptr inbounds { i64, i64 }, ptr %30, i32 0, i32 0
  %302 = load i64, ptr %301, align 8
  %303 = getelementptr inbounds { i64, i64 }, ptr %30, i32 0, i32 1
  %304 = load i64, ptr %303, align 8
  %305 = invoke noundef zeroext i1 @_Z6in_triSt4pairIxxES0_S0_S0_(i64 %294, i64 %296, i64 %298, i64 %300, i64 %302, i64 %304, ptr noundef byval(%"struct.std::pair") align 8 %31)
          to label %306 unwind label %308

306:                                              ; preds = %284
  br i1 %305, label %307, label %312

307:                                              ; preds = %306
  br label %432

308:                                              ; preds = %284
  %309 = landingpad { ptr, i32 }
          cleanup
  %310 = extractvalue { ptr, i32 } %309, 0
  store ptr %310, ptr %15, align 8
  %311 = extractvalue { ptr, i32 } %309, 1
  store i32 %311, ptr %16, align 4
  br label %435

312:                                              ; preds = %306
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %313 = load i64, ptr %27, align 8, !tbaa !8
  %314 = load i64, ptr %20, align 8, !tbaa !8
  %315 = load i64, ptr %21, align 8, !tbaa !8
  %316 = load i64, ptr %22, align 8, !tbaa !8
  %317 = invoke noundef i64 @_Z5v_trixxxx(i64 noundef %313, i64 noundef %314, i64 noundef %315, i64 noundef %316)
          to label %318 unwind label %326

318:                                              ; preds = %312
  store i64 %317, ptr %32, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #8
  %319 = load i64, ptr %20, align 8, !tbaa !8
  store i64 %319, ptr %33, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #8
  %320 = load i64, ptr %21, align 8, !tbaa !8
  store i64 %320, ptr %34, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #8
  %321 = load i64, ptr %22, align 8, !tbaa !8
  store i64 %321, ptr %35, align 8, !tbaa !8
  %322 = load i64, ptr %32, align 8, !tbaa !8
  %323 = icmp eq i64 %322, 0
  br i1 %323, label %324, label %330

324:                                              ; preds = %318
  %325 = load i64, ptr %27, align 8, !tbaa !8
  store i64 %325, ptr %33, align 8, !tbaa !8
  br label %343

326:                                              ; preds = %312
  %327 = landingpad { ptr, i32 }
          cleanup
  %328 = extractvalue { ptr, i32 } %327, 0
  store ptr %328, ptr %15, align 8
  %329 = extractvalue { ptr, i32 } %327, 1
  store i32 %329, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  br label %435

330:                                              ; preds = %318
  %331 = load i64, ptr %32, align 8, !tbaa !8
  %332 = icmp eq i64 %331, 1
  br i1 %332, label %333, label %335

333:                                              ; preds = %330
  %334 = load i64, ptr %27, align 8, !tbaa !8
  store i64 %334, ptr %34, align 8, !tbaa !8
  br label %342

335:                                              ; preds = %330
  %336 = load i64, ptr %32, align 8, !tbaa !8
  %337 = icmp eq i64 %336, 2
  br i1 %337, label %338, label %340

338:                                              ; preds = %335
  %339 = load i64, ptr %27, align 8, !tbaa !8
  store i64 %339, ptr %35, align 8, !tbaa !8
  br label %341

340:                                              ; preds = %335
  store i32 24, ptr %6, align 4
  br label %429

341:                                              ; preds = %338
  br label %342

342:                                              ; preds = %341, %333
  br label %343

343:                                              ; preds = %342, %324
  %344 = load i64, ptr %33, align 8, !tbaa !8
  %345 = load i64, ptr %34, align 8, !tbaa !8
  %346 = icmp sgt i64 %344, %345
  br i1 %346, label %347, label %348

347:                                              ; preds = %343
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull align 8 dereferenceable(8) %34) #8
  br label %348

348:                                              ; preds = %347, %343
  %349 = load i64, ptr %33, align 8, !tbaa !8
  %350 = load i64, ptr %35, align 8, !tbaa !8
  %351 = icmp sgt i64 %349, %350
  br i1 %351, label %352, label %353

352:                                              ; preds = %348
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull align 8 dereferenceable(8) %35) #8
  br label %353

353:                                              ; preds = %352, %348
  %354 = load i64, ptr %34, align 8, !tbaa !8
  %355 = load i64, ptr %35, align 8, !tbaa !8
  %356 = icmp sgt i64 %354, %355
  br i1 %356, label %357, label %358

357:                                              ; preds = %353
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull align 8 dereferenceable(8) %35) #8
  br label %358

358:                                              ; preds = %357, %353
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #8
  %359 = load i64, ptr %33, align 8, !tbaa !8
  %360 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @ct, i64 0, i64 %359
  %361 = load i64, ptr %34, align 8, !tbaa !8
  %362 = getelementptr inbounds [40 x [40 x i64]], ptr %360, i64 0, i64 %361
  %363 = load i64, ptr %35, align 8, !tbaa !8
  %364 = getelementptr inbounds [40 x i64], ptr %362, i64 0, i64 %363
  %365 = load i64, ptr %364, align 8, !tbaa !8
  %366 = load i64, ptr %20, align 8, !tbaa !8
  %367 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @ct, i64 0, i64 %366
  %368 = load i64, ptr %21, align 8, !tbaa !8
  %369 = getelementptr inbounds [40 x [40 x i64]], ptr %367, i64 0, i64 %368
  %370 = load i64, ptr %22, align 8, !tbaa !8
  %371 = getelementptr inbounds [40 x i64], ptr %369, i64 0, i64 %370
  %372 = load i64, ptr %371, align 8, !tbaa !8
  %373 = sub nsw i64 %365, %372
  %374 = sub nsw i64 %373, 1
  store i64 %374, ptr %36, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #8
  %375 = load i64, ptr @N, align 8, !tbaa !8
  %376 = load i64, ptr %33, align 8, !tbaa !8
  %377 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @ct, i64 0, i64 %376
  %378 = load i64, ptr %34, align 8, !tbaa !8
  %379 = getelementptr inbounds [40 x [40 x i64]], ptr %377, i64 0, i64 %378
  %380 = load i64, ptr %35, align 8, !tbaa !8
  %381 = getelementptr inbounds [40 x i64], ptr %379, i64 0, i64 %380
  %382 = load i64, ptr %381, align 8, !tbaa !8
  %383 = sub nsw i64 %375, %382
  %384 = sub nsw i64 %383, 3
  %385 = add nsw i64 %384, 1
  store i64 %385, ptr %37, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #8
  store i64 1, ptr %38, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #8
  store i64 0, ptr %39, align 8, !tbaa !8
  br label %386

386:                                              ; preds = %399, %358
  %387 = load i64, ptr %39, align 8, !tbaa !8
  %388 = load i64, ptr %36, align 8, !tbaa !8
  %389 = icmp slt i64 %387, %388
  br i1 %389, label %391, label %390

390:                                              ; preds = %386
  store i32 25, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  br label %402

391:                                              ; preds = %386
  %392 = load i64, ptr %38, align 8, !tbaa !8
  %393 = load i64, ptr %37, align 8, !tbaa !8
  %394 = load i64, ptr %39, align 8, !tbaa !8
  %395 = add nsw i64 %393, %394
  %396 = mul nsw i64 %392, %395
  %397 = load i64, ptr @MOD, align 8, !tbaa !8
  %398 = srem i64 %396, %397
  store i64 %398, ptr %38, align 8, !tbaa !8
  br label %399

399:                                              ; preds = %391
  %400 = load i64, ptr %39, align 8, !tbaa !8
  %401 = add nsw i64 %400, 1
  store i64 %401, ptr %39, align 8, !tbaa !8
  br label %386, !llvm.loop !24

402:                                              ; preds = %390
  %403 = load i64, ptr %20, align 8, !tbaa !8
  %404 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @dp, i64 0, i64 %403
  %405 = load i64, ptr %21, align 8, !tbaa !8
  %406 = getelementptr inbounds [40 x [40 x i64]], ptr %404, i64 0, i64 %405
  %407 = load i64, ptr %22, align 8, !tbaa !8
  %408 = getelementptr inbounds [40 x i64], ptr %406, i64 0, i64 %407
  %409 = load i64, ptr %408, align 8, !tbaa !8
  %410 = load i64, ptr %38, align 8, !tbaa !8
  %411 = mul nsw i64 %409, %410
  %412 = load i64, ptr %33, align 8, !tbaa !8
  %413 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @dp, i64 0, i64 %412
  %414 = load i64, ptr %34, align 8, !tbaa !8
  %415 = getelementptr inbounds [40 x [40 x i64]], ptr %413, i64 0, i64 %414
  %416 = load i64, ptr %35, align 8, !tbaa !8
  %417 = getelementptr inbounds [40 x i64], ptr %415, i64 0, i64 %416
  %418 = load i64, ptr %417, align 8, !tbaa !8
  %419 = add nsw i64 %418, %411
  store i64 %419, ptr %417, align 8, !tbaa !8
  %420 = load i64, ptr @MOD, align 8, !tbaa !8
  %421 = load i64, ptr %33, align 8, !tbaa !8
  %422 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @dp, i64 0, i64 %421
  %423 = load i64, ptr %34, align 8, !tbaa !8
  %424 = getelementptr inbounds [40 x [40 x i64]], ptr %422, i64 0, i64 %423
  %425 = load i64, ptr %35, align 8, !tbaa !8
  %426 = getelementptr inbounds [40 x i64], ptr %424, i64 0, i64 %425
  %427 = load i64, ptr %426, align 8, !tbaa !8
  %428 = srem i64 %427, %420
  store i64 %428, ptr %426, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #8
  store i32 0, ptr %6, align 4
  br label %429

429:                                              ; preds = %402, %340
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  %430 = load i32, ptr %6, align 4
  switch i32 %430, label %569 [
    i32 0, label %431
    i32 24, label %432
  ]

431:                                              ; preds = %429
  br label %432

432:                                              ; preds = %431, %429, %307, %283
  %433 = load i64, ptr %27, align 8, !tbaa !8
  %434 = add nsw i64 %433, 1
  store i64 %434, ptr %27, align 8, !tbaa !8
  br label %266, !llvm.loop !25

435:                                              ; preds = %326, %308
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %437

436:                                              ; preds = %270
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #8
  br label %188, !llvm.loop !26

437:                                              ; preds = %435, %231
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #8
  br label %563

438:                                              ; preds = %190
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %43) #8
  store i8 1, ptr %43, align 1, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #8
  store i64 0, ptr %44, align 8, !tbaa !8
  br label %439

439:                                              ; preds = %536, %438
  %440 = load i64, ptr %44, align 8, !tbaa !8
  %441 = load i64, ptr @N, align 8, !tbaa !8
  %442 = icmp slt i64 %440, %441
  br i1 %442, label %444, label %443

443:                                              ; preds = %439
  store i32 28, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #8
  br label %539

444:                                              ; preds = %439
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #8
  %445 = load i64, ptr %44, align 8, !tbaa !8
  %446 = add nsw i64 %445, 1
  store i64 %446, ptr %45, align 8, !tbaa !8
  br label %447

447:                                              ; preds = %532, %444
  %448 = load i64, ptr %45, align 8, !tbaa !8
  %449 = load i64, ptr @N, align 8, !tbaa !8
  %450 = icmp slt i64 %448, %449
  br i1 %450, label %452, label %451

451:                                              ; preds = %447
  store i32 31, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #8
  br label %535

452:                                              ; preds = %447
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #8
  %453 = load i64, ptr %45, align 8, !tbaa !8
  %454 = add nsw i64 %453, 1
  store i64 %454, ptr %46, align 8, !tbaa !8
  br label %455

455:                                              ; preds = %528, %452
  %456 = load i64, ptr %46, align 8, !tbaa !8
  %457 = load i64, ptr @N, align 8, !tbaa !8
  %458 = icmp slt i64 %456, %457
  br i1 %458, label %460, label %459

459:                                              ; preds = %455
  store i32 34, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #8
  br label %531

460:                                              ; preds = %455
  call void @llvm.lifetime.start.p0(i64 1, ptr %47) #8
  store i8 0, ptr %47, align 1, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #8
  store i64 0, ptr %48, align 8, !tbaa !8
  br label %461

461:                                              ; preds = %508, %460
  %462 = load i64, ptr %48, align 8, !tbaa !8
  %463 = load i64, ptr @N, align 8, !tbaa !8
  %464 = icmp slt i64 %462, %463
  br i1 %464, label %466, label %465

465:                                              ; preds = %461
  store i32 37, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #8
  br label %511

466:                                              ; preds = %461
  %467 = load i64, ptr %48, align 8, !tbaa !8
  %468 = load i64, ptr %44, align 8, !tbaa !8
  %469 = icmp eq i64 %467, %468
  br i1 %469, label %478, label %470

470:                                              ; preds = %466
  %471 = load i64, ptr %48, align 8, !tbaa !8
  %472 = load i64, ptr %45, align 8, !tbaa !8
  %473 = icmp eq i64 %471, %472
  br i1 %473, label %478, label %474

474:                                              ; preds = %470
  %475 = load i64, ptr %48, align 8, !tbaa !8
  %476 = load i64, ptr %46, align 8, !tbaa !8
  %477 = icmp eq i64 %475, %476
  br i1 %477, label %478, label %479

478:                                              ; preds = %474, %470, %466
  br label %508

479:                                              ; preds = %474
  %480 = load i64, ptr %48, align 8, !tbaa !8
  %481 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %480
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %49, ptr align 16 %481, i64 16, i1 false)
  %482 = load i64, ptr %44, align 8, !tbaa !8
  %483 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %482
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %50, ptr align 16 %483, i64 16, i1 false)
  %484 = load i64, ptr %45, align 8, !tbaa !8
  %485 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %484
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %51, ptr align 16 %485, i64 16, i1 false)
  %486 = load i64, ptr %46, align 8, !tbaa !8
  %487 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %486
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %52, ptr align 16 %487, i64 16, i1 false)
  %488 = getelementptr inbounds { i64, i64 }, ptr %49, i32 0, i32 0
  %489 = load i64, ptr %488, align 8
  %490 = getelementptr inbounds { i64, i64 }, ptr %49, i32 0, i32 1
  %491 = load i64, ptr %490, align 8
  %492 = getelementptr inbounds { i64, i64 }, ptr %50, i32 0, i32 0
  %493 = load i64, ptr %492, align 8
  %494 = getelementptr inbounds { i64, i64 }, ptr %50, i32 0, i32 1
  %495 = load i64, ptr %494, align 8
  %496 = getelementptr inbounds { i64, i64 }, ptr %51, i32 0, i32 0
  %497 = load i64, ptr %496, align 8
  %498 = getelementptr inbounds { i64, i64 }, ptr %51, i32 0, i32 1
  %499 = load i64, ptr %498, align 8
  %500 = invoke noundef zeroext i1 @_Z6in_triSt4pairIxxES0_S0_S0_(i64 %489, i64 %491, i64 %493, i64 %495, i64 %497, i64 %499, ptr noundef byval(%"struct.std::pair") align 8 %52)
          to label %501 unwind label %503

501:                                              ; preds = %479
  br i1 %500, label %507, label %502

502:                                              ; preds = %501
  store i8 1, ptr %47, align 1, !tbaa !27
  br label %507

503:                                              ; preds = %479
  %504 = landingpad { ptr, i32 }
          cleanup
  %505 = extractvalue { ptr, i32 } %504, 0
  store ptr %505, ptr %15, align 8
  %506 = extractvalue { ptr, i32 } %504, 1
  store i32 %506, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %47) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #8
  br label %562

507:                                              ; preds = %502, %501
  br label %508

508:                                              ; preds = %507, %478
  %509 = load i64, ptr %48, align 8, !tbaa !8
  %510 = add nsw i64 %509, 1
  store i64 %510, ptr %48, align 8, !tbaa !8
  br label %461, !llvm.loop !29

511:                                              ; preds = %465
  %512 = load i8, ptr %47, align 1, !tbaa !27, !range !30, !noundef !31
  %513 = trunc i8 %512 to i1
  br i1 %513, label %518, label %514

514:                                              ; preds = %511
  %515 = load i64, ptr %44, align 8, !tbaa !8
  store i64 %515, ptr %40, align 8, !tbaa !8
  %516 = load i64, ptr %45, align 8, !tbaa !8
  store i64 %516, ptr %41, align 8, !tbaa !8
  %517 = load i64, ptr %46, align 8, !tbaa !8
  store i64 %517, ptr %42, align 8, !tbaa !8
  br label %518

518:                                              ; preds = %514, %511
  %519 = load i8, ptr %47, align 1, !tbaa !27, !range !30, !noundef !31
  %520 = trunc i8 %519 to i1
  %521 = zext i1 %520 to i32
  %522 = load i8, ptr %43, align 1, !tbaa !27, !range !30, !noundef !31
  %523 = trunc i8 %522 to i1
  %524 = zext i1 %523 to i32
  %525 = and i32 %524, %521
  %526 = icmp ne i32 %525, 0
  %527 = zext i1 %526 to i8
  store i8 %527, ptr %43, align 1, !tbaa !27
  call void @llvm.lifetime.end.p0(i64 1, ptr %47) #8
  br label %528

528:                                              ; preds = %518
  %529 = load i64, ptr %46, align 8, !tbaa !8
  %530 = add nsw i64 %529, 1
  store i64 %530, ptr %46, align 8, !tbaa !8
  br label %455, !llvm.loop !32

531:                                              ; preds = %459
  br label %532

532:                                              ; preds = %531
  %533 = load i64, ptr %45, align 8, !tbaa !8
  %534 = add nsw i64 %533, 1
  store i64 %534, ptr %45, align 8, !tbaa !8
  br label %447, !llvm.loop !33

535:                                              ; preds = %451
  br label %536

536:                                              ; preds = %535
  %537 = load i64, ptr %44, align 8, !tbaa !8
  %538 = add nsw i64 %537, 1
  store i64 %538, ptr %44, align 8, !tbaa !8
  br label %439, !llvm.loop !34

539:                                              ; preds = %443
  %540 = load i8, ptr %43, align 1, !tbaa !27, !range !30, !noundef !31
  %541 = trunc i8 %540 to i1
  br i1 %541, label %542, label %543

542:                                              ; preds = %539
  br label %551

543:                                              ; preds = %539
  %544 = load i64, ptr %40, align 8, !tbaa !8
  %545 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @dp, i64 0, i64 %544
  %546 = load i64, ptr %41, align 8, !tbaa !8
  %547 = getelementptr inbounds [40 x [40 x i64]], ptr %545, i64 0, i64 %546
  %548 = load i64, ptr %42, align 8, !tbaa !8
  %549 = getelementptr inbounds [40 x i64], ptr %547, i64 0, i64 %548
  %550 = load i64, ptr %549, align 8, !tbaa !8
  br label %551

551:                                              ; preds = %543, %542
  %552 = phi i64 [ 0, %542 ], [ %550, %543 ]
  %553 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %552)
          to label %554 unwind label %558

554:                                              ; preds = %551
  %555 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %553, ptr noundef @.str)
          to label %556 unwind label %558

556:                                              ; preds = %554
  call void @llvm.lifetime.end.p0(i64 1, ptr %43) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  call void @_ZNSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  %557 = load i32, ptr %1, align 4
  ret i32 %557

558:                                              ; preds = %554, %551
  %559 = landingpad { ptr, i32 }
          cleanup
  %560 = extractvalue { ptr, i32 } %559, 0
  store ptr %560, ptr %15, align 8
  %561 = extractvalue { ptr, i32 } %559, 1
  store i32 %561, ptr %16, align 4
  br label %562

562:                                              ; preds = %558, %503
  call void @llvm.lifetime.end.p0(i64 1, ptr %43) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  br label %563

563:                                              ; preds = %562, %437, %227, %178
  call void @_ZNSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  br label %564

564:                                              ; preds = %563
  %565 = load ptr, ptr %15, align 8
  %566 = load i32, ptr %16, align 4
  %567 = insertvalue { ptr, i32 } poison, ptr %565, 0
  %568 = insertvalue { ptr, i32 } %567, i32 %566, 1
  resume { ptr, i32 } %568

569:                                              ; preds = %429
  unreachable
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) #4

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #7

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #6 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 = { 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 #8 = { 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 = !{!15, !9, i64 0}
!15 = !{!"_ZTS3tri", !9, i64 0, !9, i64 8, !9, i64 16, !9, i64 24}
!16 = !{!15, !9, i64 8}
!17 = !{!15, !9, i64 16}
!18 = !{!15, !9, i64 24}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8, i64 24, i64 8, !8}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = !{!28, !28, i64 0}
!28 = !{!"bool", !10, i64 0}
!29 = distinct !{!29, !12}
!30 = !{i8 0, i8 2}
!31 = !{}
!32 = distinct !{!32, !12}
!33 = distinct !{!33, !12}
!34 = distinct !{!34, !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"

%"struct.std::pair" = type { i64, i64 }
%"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::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<tri, std::allocator<tri>>::_Vector_impl" }
%"struct.std::_Vector_base<tri, std::allocator<tri>>::_Vector_impl" = type { %"struct.std::_Vector_base<tri, std::allocator<tri>>::_Vector_impl_data" }
%"struct.std::_Vector_base<tri, std::allocator<tri>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.tri = type { i64, i64, i64, i64 }

@N = external dso_local global i64, align 8
@perm = external dso_local global [40 x i64], align 16
@dp = external dso_local local_unnamed_addr global [40 x [40 x [40 x i64]]], align 16
@ct = external dso_local local_unnamed_addr global [40 x [40 x [40 x i64]]], align 16
@pt = external dso_local global [40 x %"struct.std::pair"], align 16
@MOD = external dso_local local_unnamed_addr global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; 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 uwtable
declare dso_local noundef zeroext i1 @_Z6in_triSt4pairIxxES0_S0_S0_(i64, i64, i64, i64, i64, i64, ptr noundef byval(%"struct.std::pair") align 8) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z5v_trixxxx(i64 noundef, 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 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::priority_queue", align 8
  %2 = alloca %struct.tri, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  %11 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %12 = 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)
  %13 = load i64, ptr @N, align 8, !tbaa !8
  %14 = icmp sgt i64 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa = phi i64 [ %13, %0 ], [ %26, %.lr.ph ]
  %15 = getelementptr inbounds i64, ptr @perm, i64 %.lcssa
  tail call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef nonnull @perm, ptr noundef nonnull %15, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #8
  call void @_ZNSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  %16 = load i64, ptr @N, align 8, !tbaa !8
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.lr.ph226, label %.preheader196

.lr.ph226:                                        ; preds = %._crit_edge
  %18 = getelementptr inbounds i8, ptr %2, i64 8
  %19 = getelementptr inbounds i8, ptr %2, i64 16
  %20 = getelementptr inbounds i8, ptr %2, i64 24
  br label %31

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.0214 = phi i64 [ %25, %.lr.ph ], [ 0, %0 ]
  %21 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %.0214
  %22 = 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) %21)
  %23 = getelementptr inbounds i8, ptr %21, i64 8
  %24 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(8) %23)
  %25 = add nuw nsw i64 %.0214, 1
  %26 = load i64, ptr @N, align 8, !tbaa !8
  %27 = icmp slt i64 %25, %26
  br i1 %27, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.loopexit199:                                     ; preds = %.loopexit198, %31
  %28 = phi i64 [ %32, %31 ], [ %36, %.loopexit198 ]
  %29 = icmp slt i64 %33, %28
  br i1 %29, label %31, label %.preheader196, !llvm.loop !13

.preheader196:                                    ; preds = %.loopexit199, %._crit_edge
  %30 = call noundef zeroext i1 @_ZNKSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  br i1 %30, label %.preheader194, label %.lr.ph244

31:                                               ; preds = %.lr.ph226, %.loopexit199
  %32 = phi i64 [ %16, %.lr.ph226 ], [ %28, %.loopexit199 ]
  %.0139224 = phi i64 [ 0, %.lr.ph226 ], [ %33, %.loopexit199 ]
  %33 = add nuw nsw i64 %.0139224, 1
  %34 = icmp slt i64 %33, %32
  br i1 %34, label %.lr.ph223, label %.loopexit199

.lr.ph223:                                        ; preds = %31
  %35 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %.0139224
  %.sroa.2102.0..sroa_idx = getelementptr inbounds i8, ptr %35, i64 8
  br label %39

.loopexit198:                                     ; preds = %64, %39
  %36 = phi i64 [ %40, %39 ], [ %67, %64 ]
  %37 = phi i64 [ %41, %39 ], [ %67, %64 ]
  %38 = icmp slt i64 %42, %37
  br i1 %38, label %39, label %.loopexit199, !llvm.loop !14

39:                                               ; preds = %.lr.ph223, %.loopexit198
  %40 = phi i64 [ %32, %.lr.ph223 ], [ %36, %.loopexit198 ]
  %41 = phi i64 [ %32, %.lr.ph223 ], [ %37, %.loopexit198 ]
  %.0140221 = phi i64 [ %33, %.lr.ph223 ], [ %42, %.loopexit198 ]
  %42 = add nuw nsw i64 %.0140221, 1
  %43 = icmp slt i64 %42, %41
  br i1 %43, label %.preheader197.lr.ph, label %.loopexit198

.preheader197.lr.ph:                              ; preds = %39
  %44 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %.0140221
  %.sroa.2100.0..sroa_idx = getelementptr inbounds i8, ptr %44, i64 8
  br label %.preheader197

.preheader197:                                    ; preds = %.preheader197.lr.ph, %64
  %45 = phi i64 [ %41, %.preheader197.lr.ph ], [ %67, %64 ]
  %.0141220 = phi i64 [ %42, %.preheader197.lr.ph ], [ %66, %64 ]
  %46 = icmp sgt i64 %45, 0
  br i1 %46, label %.lr.ph217, label %._crit_edge218

.lr.ph217:                                        ; preds = %.preheader197
  %47 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %.0141220
  br label %48

._crit_edge218:                                   ; preds = %60, %.preheader197
  %.0142.lcssa = phi i64 [ 0, %.preheader197 ], [ %.1, %60 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #8
  store i64 %.0142.lcssa, ptr %2, align 8, !tbaa !15
  store i64 %.0139224, ptr %18, align 8, !tbaa !17
  store i64 %.0140221, ptr %19, align 8, !tbaa !18
  store i64 %.0141220, ptr %20, align 8, !tbaa !19
  invoke void @_ZNSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25) %1, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %64 unwind label %69

48:                                               ; preds = %.lr.ph217, %60
  %49 = phi i64 [ %45, %.lr.ph217 ], [ %61, %60 ]
  %.0142216 = phi i64 [ 0, %.lr.ph217 ], [ %.1, %60 ]
  %.0164215 = phi i64 [ 0, %.lr.ph217 ], [ %62, %60 ]
  %50 = icmp eq i64 %.0164215, %.0139224
  %51 = icmp eq i64 %.0164215, %.0140221
  %or.cond = or i1 %50, %51
  %52 = icmp eq i64 %.0164215, %.0141220
  %or.cond186 = or i1 %52, %or.cond
  br i1 %or.cond186, label %60, label %53

53:                                               ; preds = %48
  %54 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %.0164215
  %.sroa.0103.0.copyload = load i64, ptr %54, align 16
  %.sroa.2104.0..sroa_idx = getelementptr inbounds i8, ptr %54, i64 8
  %.sroa.2104.0.copyload = load i64, ptr %.sroa.2104.0..sroa_idx, align 8
  %.sroa.0101.0.copyload = load i64, ptr %35, align 16
  %.sroa.2102.0.copyload = load i64, ptr %.sroa.2102.0..sroa_idx, align 8
  %.sroa.099.0.copyload = load i64, ptr %44, align 16
  %.sroa.2100.0.copyload = load i64, ptr %.sroa.2100.0..sroa_idx, align 8
  %55 = invoke noundef zeroext i1 @_Z6in_triSt4pairIxxES0_S0_S0_(i64 %.sroa.0103.0.copyload, i64 %.sroa.2104.0.copyload, i64 %.sroa.0101.0.copyload, i64 %.sroa.2102.0.copyload, i64 %.sroa.099.0.copyload, i64 %.sroa.2100.0.copyload, ptr noundef nonnull byval(%"struct.std::pair") align 8 %47)
          to label %56 unwind label %58

56:                                               ; preds = %53
  %57 = zext i1 %55 to i64
  %spec.select = add nsw i64 %.0142216, %57
  %.pre = load i64, ptr @N, align 8, !tbaa !8
  br label %60

58:                                               ; preds = %53
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %236

60:                                               ; preds = %56, %48
  %61 = phi i64 [ %49, %48 ], [ %.pre, %56 ]
  %.1 = phi i64 [ %.0142216, %48 ], [ %spec.select, %56 ]
  %62 = add nuw nsw i64 %.0164215, 1
  %63 = icmp slt i64 %62, %61
  br i1 %63, label %48, label %._crit_edge218, !llvm.loop !20

64:                                               ; preds = %._crit_edge218
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #8
  %65 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @ct, i64 0, i64 %.0139224, i64 %.0140221, i64 %.0141220
  store i64 %.0142.lcssa, ptr %65, align 8, !tbaa !8
  %66 = add nuw nsw i64 %.0141220, 1
  %67 = load i64, ptr @N, align 8, !tbaa !8
  %68 = icmp slt i64 %66, %67
  br i1 %68, label %.preheader197, label %.loopexit198, !llvm.loop !21

69:                                               ; preds = %._crit_edge218
  %70 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #8
  br label %236

.loopexit195:                                     ; preds = %171, %._crit_edge231
  %71 = call noundef zeroext i1 @_ZNKSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  br i1 %71, label %.preheader194, label %.lr.ph244, !llvm.loop !22

.preheader194:                                    ; preds = %.loopexit195, %.preheader196
  %72 = load i64, ptr @N, align 8, !tbaa !8
  %73 = icmp sgt i64 %72, 0
  br i1 %73, label %.lr.ph278, label %._crit_edge279.thread

.lr.ph244:                                        ; preds = %.preheader196, %.loopexit195
  %74 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %74, i64 8
  %.sroa.5.0.copyload = load i64, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !8
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %74, i64 16
  %.sroa.6.0.copyload = load i64, ptr %.sroa.6.0..sroa_idx, align 8, !tbaa !8
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %74, i64 24
  %.sroa.7.0.copyload = load i64, ptr %.sroa.7.0..sroa_idx, align 8, !tbaa !8
  invoke void @_ZNSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
          to label %75 unwind label %93

75:                                               ; preds = %.lr.ph244
  %76 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @ct, i64 0, i64 %.sroa.5.0.copyload, i64 %.sroa.6.0.copyload, i64 %.sroa.7.0.copyload
  %77 = load i64, ptr %76, align 8, !tbaa !8
  %78 = icmp sgt i64 %77, 0
  %.pre293 = load i64, ptr @MOD, align 8, !tbaa !8
  %.pre294 = load i64, ptr @N, align 8, !tbaa !8
  br i1 %78, label %.lr.ph230, label %._crit_edge231

.lr.ph230:                                        ; preds = %75
  %reass.sub = sub i64 %.pre294, %77
  %79 = add i64 %reass.sub, -2
  %xtraiter = and i64 %77, 1
  %80 = icmp eq i64 %77, 1
  br i1 %80, label %._crit_edge231.loopexit.unr-lcssa, label %.lr.ph230.new

.lr.ph230.new:                                    ; preds = %.lr.ph230
  %unroll_iter = and i64 %77, 9223372036854775806
  br label %95

._crit_edge231.loopexit.unr-lcssa:                ; preds = %95, %.lr.ph230
  %.lcssa337.ph = phi i64 [ poison, %.lr.ph230 ], [ %102, %95 ]
  %.0174228.unr = phi i64 [ 1, %.lr.ph230 ], [ %102, %95 ]
  %.0175227.unr = phi i64 [ 0, %.lr.ph230 ], [ %103, %95 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge231, label %._crit_edge231.loopexit.epilog-lcssa

._crit_edge231.loopexit.epilog-lcssa:             ; preds = %._crit_edge231.loopexit.unr-lcssa
  %81 = add nsw i64 %79, %.0175227.unr
  %82 = mul nsw i64 %.0174228.unr, %81
  %83 = srem i64 %82, %.pre293
  br label %._crit_edge231

._crit_edge231:                                   ; preds = %._crit_edge231.loopexit.epilog-lcssa, %._crit_edge231.loopexit.unr-lcssa, %75
  %.0174.lcssa = phi i64 [ 1, %75 ], [ %.lcssa337.ph, %._crit_edge231.loopexit.unr-lcssa ], [ %83, %._crit_edge231.loopexit.epilog-lcssa ]
  %84 = mul nsw i64 %.0174.lcssa, 6
  %85 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @dp, i64 0, i64 %.sroa.5.0.copyload, i64 %.sroa.6.0.copyload, i64 %.sroa.7.0.copyload
  %86 = load i64, ptr %85, align 8, !tbaa !8
  %87 = add nsw i64 %86, %84
  %88 = srem i64 %87, %.pre293
  store i64 %88, ptr %85, align 8, !tbaa !8
  %89 = icmp sgt i64 %.pre294, 0
  br i1 %89, label %.lr.ph243, label %.loopexit195

.lr.ph243:                                        ; preds = %._crit_edge231
  %90 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %.sroa.5.0.copyload
  %.sroa.247.0..sroa_idx = getelementptr inbounds i8, ptr %90, i64 8
  %91 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %.sroa.6.0.copyload
  %.sroa.245.0..sroa_idx = getelementptr inbounds i8, ptr %91, i64 8
  %92 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %.sroa.7.0.copyload
  br label %104

93:                                               ; preds = %.lr.ph244
  %94 = landingpad { ptr, i32 }
          cleanup
  br label %236

95:                                               ; preds = %95, %.lr.ph230.new
  %.0174228 = phi i64 [ 1, %.lr.ph230.new ], [ %102, %95 ]
  %.0175227 = phi i64 [ 0, %.lr.ph230.new ], [ %103, %95 ]
  %niter = phi i64 [ 0, %.lr.ph230.new ], [ %niter.next.1, %95 ]
  %96 = add nsw i64 %79, %.0175227
  %97 = mul nsw i64 %.0174228, %96
  %98 = srem i64 %97, %.pre293
  %99 = or disjoint i64 %.0175227, 1
  %100 = add nsw i64 %79, %99
  %101 = mul nsw i64 %98, %100
  %102 = srem i64 %101, %.pre293
  %103 = add nuw nsw i64 %.0175227, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge231.loopexit.unr-lcssa, label %95, !llvm.loop !23

104:                                              ; preds = %.lr.ph243, %171
  %.0176239 = phi i64 [ 0, %.lr.ph243 ], [ %172, %171 ]
  %105 = icmp eq i64 %.0176239, %.sroa.5.0.copyload
  %106 = icmp eq i64 %.0176239, %.sroa.6.0.copyload
  %or.cond187 = select i1 %105, i1 true, i1 %106
  %107 = icmp eq i64 %.0176239, %.sroa.7.0.copyload
  %or.cond188 = select i1 %or.cond187, i1 true, i1 %107
  br i1 %or.cond188, label %171, label %108

108:                                              ; preds = %104
  %109 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %.0176239
  %.sroa.048.0.copyload = load i64, ptr %109, align 16
  %.sroa.249.0..sroa_idx = getelementptr inbounds i8, ptr %109, i64 8
  %.sroa.249.0.copyload = load i64, ptr %.sroa.249.0..sroa_idx, align 8
  %.sroa.046.0.copyload = load i64, ptr %90, align 16
  %.sroa.247.0.copyload = load i64, ptr %.sroa.247.0..sroa_idx, align 8
  %.sroa.044.0.copyload = load i64, ptr %91, align 16
  %.sroa.245.0.copyload = load i64, ptr %.sroa.245.0..sroa_idx, align 8
  %110 = invoke noundef zeroext i1 @_Z6in_triSt4pairIxxES0_S0_S0_(i64 %.sroa.048.0.copyload, i64 %.sroa.249.0.copyload, i64 %.sroa.046.0.copyload, i64 %.sroa.247.0.copyload, i64 %.sroa.044.0.copyload, i64 %.sroa.245.0.copyload, ptr noundef nonnull byval(%"struct.std::pair") align 8 %92)
          to label %111 unwind label %112

111:                                              ; preds = %108
  br i1 %110, label %171, label %114

112:                                              ; preds = %108
  %113 = landingpad { ptr, i32 }
          cleanup
  br label %236

114:                                              ; preds = %111
  %115 = invoke noundef i64 @_Z5v_trixxxx(i64 noundef %.0176239, i64 noundef %.sroa.5.0.copyload, i64 noundef %.sroa.6.0.copyload, i64 noundef %.sroa.7.0.copyload)
          to label %116 unwind label %118

116:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  store i64 %.sroa.5.0.copyload, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  store i64 %.sroa.6.0.copyload, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  store i64 %.sroa.7.0.copyload, ptr %5, align 8, !tbaa !8
  switch i64 %115, label %170 [
    i64 0, label %117
    i64 1, label %120
    i64 2, label %121
  ]

117:                                              ; preds = %116
  store i64 %.0176239, ptr %3, align 8, !tbaa !8
  br label %122

118:                                              ; preds = %114
  %119 = landingpad { ptr, i32 }
          cleanup
  br label %236

120:                                              ; preds = %116
  store i64 %.0176239, ptr %4, align 8, !tbaa !8
  br label %122

121:                                              ; preds = %116
  store i64 %.0176239, ptr %5, align 8, !tbaa !8
  br label %122

122:                                              ; preds = %120, %121, %117
  %123 = phi i64 [ %.sroa.7.0.copyload, %120 ], [ %.0176239, %121 ], [ %.sroa.7.0.copyload, %117 ]
  %124 = phi i64 [ %.0176239, %120 ], [ %.sroa.6.0.copyload, %121 ], [ %.sroa.6.0.copyload, %117 ]
  %125 = phi i64 [ %.sroa.5.0.copyload, %120 ], [ %.sroa.5.0.copyload, %121 ], [ %.0176239, %117 ]
  %126 = icmp sgt i64 %125, %124
  br i1 %126, label %127, label %128

127:                                              ; preds = %122
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  %.pre295 = load i64, ptr %3, align 8, !tbaa !8
  %.pre296 = load i64, ptr %5, align 8, !tbaa !8
  br label %128

128:                                              ; preds = %127, %122
  %129 = phi i64 [ %.pre296, %127 ], [ %123, %122 ]
  %130 = phi i64 [ %.pre295, %127 ], [ %125, %122 ]
  %131 = icmp sgt i64 %130, %129
  br i1 %131, label %132, label %133

132:                                              ; preds = %128
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %.pre297 = load i64, ptr %5, align 8, !tbaa !8
  br label %133

133:                                              ; preds = %132, %128
  %134 = phi i64 [ %.pre297, %132 ], [ %129, %128 ]
  %135 = load i64, ptr %4, align 8, !tbaa !8
  %136 = icmp sgt i64 %135, %134
  br i1 %136, label %137, label %138

137:                                              ; preds = %133
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %.pre298 = load i64, ptr %4, align 8, !tbaa !8
  %.pre299 = load i64, ptr %5, align 8, !tbaa !8
  br label %138

138:                                              ; preds = %137, %133
  %139 = phi i64 [ %.pre299, %137 ], [ %134, %133 ]
  %140 = phi i64 [ %.pre298, %137 ], [ %135, %133 ]
  %141 = load i64, ptr %3, align 8, !tbaa !8
  %142 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @ct, i64 0, i64 %141, i64 %140, i64 %139
  %143 = load i64, ptr %142, align 8, !tbaa !8
  %144 = load i64, ptr %76, align 8, !tbaa !8
  %145 = xor i64 %144, -1
  %146 = add i64 %143, %145
  %147 = icmp sgt i64 %146, 0
  %.pre300 = load i64, ptr @MOD, align 8, !tbaa !8
  br i1 %147, label %.lr.ph236, label %._crit_edge237

.lr.ph236:                                        ; preds = %138
  %148 = load i64, ptr @N, align 8, !tbaa !8
  %reass.sub284 = sub i64 %148, %143
  %149 = add i64 %reass.sub284, -2
  %150 = add i64 %143, -2
  %xtraiter344 = and i64 %146, 1
  %151 = icmp eq i64 %150, %144
  br i1 %151, label %._crit_edge237.loopexit.unr-lcssa, label %.lr.ph236.new

.lr.ph236.new:                                    ; preds = %.lr.ph236
  %unroll_iter347 = and i64 %146, 9223372036854775806
  br label %161

._crit_edge237.loopexit.unr-lcssa:                ; preds = %161, %.lr.ph236
  %.lcssa338.ph = phi i64 [ poison, %.lr.ph236 ], [ %168, %161 ]
  %.0162234.unr = phi i64 [ 0, %.lr.ph236 ], [ %169, %161 ]
  %.0163233.unr = phi i64 [ 1, %.lr.ph236 ], [ %168, %161 ]
  %lcmp.mod345.not = icmp eq i64 %xtraiter344, 0
  br i1 %lcmp.mod345.not, label %._crit_edge237, label %._crit_edge237.loopexit.epilog-lcssa

._crit_edge237.loopexit.epilog-lcssa:             ; preds = %._crit_edge237.loopexit.unr-lcssa
  %152 = add nsw i64 %149, %.0162234.unr
  %153 = mul nsw i64 %152, %.0163233.unr
  %154 = srem i64 %153, %.pre300
  br label %._crit_edge237

._crit_edge237:                                   ; preds = %._crit_edge237.loopexit.epilog-lcssa, %._crit_edge237.loopexit.unr-lcssa, %138
  %.0163.lcssa = phi i64 [ 1, %138 ], [ %.lcssa338.ph, %._crit_edge237.loopexit.unr-lcssa ], [ %154, %._crit_edge237.loopexit.epilog-lcssa ]
  %155 = load i64, ptr %85, align 8, !tbaa !8
  %156 = mul nsw i64 %155, %.0163.lcssa
  %157 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @dp, i64 0, i64 %141, i64 %140, i64 %139
  %158 = load i64, ptr %157, align 8, !tbaa !8
  %159 = add nsw i64 %158, %156
  %160 = srem i64 %159, %.pre300
  store i64 %160, ptr %157, align 8, !tbaa !8
  br label %170

161:                                              ; preds = %161, %.lr.ph236.new
  %.0162234 = phi i64 [ 0, %.lr.ph236.new ], [ %169, %161 ]
  %.0163233 = phi i64 [ 1, %.lr.ph236.new ], [ %168, %161 ]
  %niter348 = phi i64 [ 0, %.lr.ph236.new ], [ %niter348.next.1, %161 ]
  %162 = add nsw i64 %149, %.0162234
  %163 = mul nsw i64 %162, %.0163233
  %164 = srem i64 %163, %.pre300
  %165 = or disjoint i64 %.0162234, 1
  %166 = add nsw i64 %149, %165
  %167 = mul nsw i64 %166, %164
  %168 = srem i64 %167, %.pre300
  %169 = add nuw nsw i64 %.0162234, 2
  %niter348.next.1 = add i64 %niter348, 2
  %niter348.ncmp.1 = icmp eq i64 %niter348.next.1, %unroll_iter347
  br i1 %niter348.ncmp.1, label %._crit_edge237.loopexit.unr-lcssa, label %161, !llvm.loop !24

170:                                              ; preds = %116, %._crit_edge237
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  br label %171

171:                                              ; preds = %170, %111, %104
  %172 = add nuw nsw i64 %.0176239, 1
  %173 = load i64, ptr @N, align 8, !tbaa !8
  %174 = icmp slt i64 %172, %173
  br i1 %174, label %104, label %.loopexit195, !llvm.loop !25

.loopexit193:                                     ; preds = %.loopexit, %.lr.ph278
  %175 = phi i64 [ %178, %.lr.ph278 ], [ %182, %.loopexit ]
  %.1159.lcssa = phi i64 [ %.0158273, %.lr.ph278 ], [ %.2160.lcssa, %.loopexit ]
  %.1155.lcssa = phi i64 [ %.0154274, %.lr.ph278 ], [ %.2156.lcssa, %.loopexit ]
  %.1152.lcssa = phi i64 [ %.0151275, %.lr.ph278 ], [ %.2153.lcssa, %.loopexit ]
  %.1150.lcssa = phi i8 [ %.0149276, %.lr.ph278 ], [ %.2.lcssa, %.loopexit ]
  %176 = icmp slt i64 %179, %175
  %indvars.iv.next = add nuw i64 %indvars.iv, 1
  br i1 %176, label %.lr.ph278, label %._crit_edge279, !llvm.loop !26

._crit_edge279:                                   ; preds = %.loopexit193
  %177 = trunc i8 %.1150.lcssa to i1
  br i1 %177, label %._crit_edge279.thread, label %226

.lr.ph278:                                        ; preds = %.preheader194, %.loopexit193
  %178 = phi i64 [ %175, %.loopexit193 ], [ %72, %.preheader194 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.loopexit193 ], [ 3, %.preheader194 ]
  %.0148277 = phi i64 [ %179, %.loopexit193 ], [ 0, %.preheader194 ]
  %.0149276 = phi i8 [ %.1150.lcssa, %.loopexit193 ], [ 1, %.preheader194 ]
  %.0151275 = phi i64 [ %.1152.lcssa, %.loopexit193 ], [ undef, %.preheader194 ]
  %.0154274 = phi i64 [ %.1155.lcssa, %.loopexit193 ], [ undef, %.preheader194 ]
  %.0158273 = phi i64 [ %.1159.lcssa, %.loopexit193 ], [ undef, %.preheader194 ]
  %179 = add nuw nsw i64 %.0148277, 1
  %180 = icmp slt i64 %179, %178
  br i1 %180, label %.lr.ph268, label %.loopexit193

.lr.ph268:                                        ; preds = %.lr.ph278
  %181 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %.0148277
  %.sroa.22.0..sroa_idx = getelementptr inbounds i8, ptr %181, i64 8
  br label %185

.loopexit:                                        ; preds = %._crit_edge248, %.preheader.lr.ph.split.us, %185
  %182 = phi i64 [ %186, %185 ], [ %186, %.preheader.lr.ph.split.us ], [ %198, %._crit_edge248 ]
  %183 = phi i64 [ %187, %185 ], [ %187, %.preheader.lr.ph.split.us ], [ %199, %._crit_edge248 ]
  %.2160.lcssa = phi i64 [ %.1159262, %185 ], [ %.0148277, %.preheader.lr.ph.split.us ], [ %.3161, %._crit_edge248 ]
  %.2156.lcssa = phi i64 [ %.1155263, %185 ], [ %.0147266, %.preheader.lr.ph.split.us ], [ %.3157, %._crit_edge248 ]
  %.2153.lcssa = phi i64 [ %.1152264, %185 ], [ %192, %.preheader.lr.ph.split.us ], [ %.3, %._crit_edge248 ]
  %.2.lcssa = phi i8 [ %.1150265, %185 ], [ 0, %.preheader.lr.ph.split.us ], [ %202, %._crit_edge248 ]
  %184 = icmp slt i64 %188, %183
  %indvars.iv.next292 = add i64 %indvars.iv291, 1
  br i1 %184, label %185, label %.loopexit193, !llvm.loop !27

185:                                              ; preds = %.lr.ph268, %.loopexit
  %186 = phi i64 [ %178, %.lr.ph268 ], [ %182, %.loopexit ]
  %187 = phi i64 [ %178, %.lr.ph268 ], [ %183, %.loopexit ]
  %indvars.iv291 = phi i64 [ %indvars.iv, %.lr.ph268 ], [ %indvars.iv.next292, %.loopexit ]
  %.0147266 = phi i64 [ %179, %.lr.ph268 ], [ %188, %.loopexit ]
  %.1150265 = phi i8 [ %.0149276, %.lr.ph268 ], [ %.2.lcssa, %.loopexit ]
  %.1152264 = phi i64 [ %.0151275, %.lr.ph268 ], [ %.2153.lcssa, %.loopexit ]
  %.1155263 = phi i64 [ %.0154274, %.lr.ph268 ], [ %.2156.lcssa, %.loopexit ]
  %.1159262 = phi i64 [ %.0158273, %.lr.ph268 ], [ %.2160.lcssa, %.loopexit ]
  %188 = add nuw nsw i64 %.0147266, 1
  %189 = icmp slt i64 %188, %187
  br i1 %189, label %.preheader.lr.ph, label %.loopexit

.preheader.lr.ph:                                 ; preds = %185
  %190 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %.0147266
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %190, i64 8
  %191 = icmp sgt i64 %187, 0
  br i1 %191, label %.preheader, label %.preheader.lr.ph.split.us

.preheader.lr.ph.split.us:                        ; preds = %.preheader.lr.ph
  %smax = call i64 @llvm.smax.i64(i64 %187, i64 %indvars.iv291)
  %192 = add nsw i64 %smax, -1
  br label %.loopexit

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge248
  %193 = phi i64 [ %198, %._crit_edge248 ], [ %186, %.preheader.lr.ph ]
  %194 = phi i64 [ %199, %._crit_edge248 ], [ %187, %.preheader.lr.ph ]
  %195 = phi i64 [ %200, %._crit_edge248 ], [ %187, %.preheader.lr.ph ]
  %.0146254 = phi i64 [ %203, %._crit_edge248 ], [ %188, %.preheader.lr.ph ]
  %.2253 = phi i8 [ %202, %._crit_edge248 ], [ %.1150265, %.preheader.lr.ph ]
  %.2153252 = phi i64 [ %.3, %._crit_edge248 ], [ %.1152264, %.preheader.lr.ph ]
  %.2156251 = phi i64 [ %.3157, %._crit_edge248 ], [ %.1155263, %.preheader.lr.ph ]
  %.2160250 = phi i64 [ %.3161, %._crit_edge248 ], [ %.1159262, %.preheader.lr.ph ]
  %196 = icmp sgt i64 %195, 0
  br i1 %196, label %.lr.ph247, label %._crit_edge248

.lr.ph247:                                        ; preds = %.preheader
  %197 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %.0146254
  br label %205

._crit_edge248:                                   ; preds = %219, %.preheader
  %198 = phi i64 [ %193, %.preheader ], [ %220, %219 ]
  %199 = phi i64 [ %194, %.preheader ], [ %221, %219 ]
  %200 = phi i64 [ %195, %.preheader ], [ %222, %219 ]
  %.0144.lcssa = phi i8 [ 0, %.preheader ], [ %.1145, %219 ]
  %201 = trunc nuw i8 %.0144.lcssa to i1
  %.3161 = select i1 %201, i64 %.2160250, i64 %.0148277
  %.3157 = select i1 %201, i64 %.2156251, i64 %.0147266
  %.3 = select i1 %201, i64 %.2153252, i64 %.0146254
  %202 = and i8 %.2253, %.0144.lcssa
  %203 = add nuw nsw i64 %.0146254, 1
  %204 = icmp slt i64 %203, %200
  br i1 %204, label %.preheader, label %.loopexit, !llvm.loop !28

205:                                              ; preds = %.lr.ph247, %219
  %206 = phi i64 [ %193, %.lr.ph247 ], [ %220, %219 ]
  %207 = phi i64 [ %194, %.lr.ph247 ], [ %221, %219 ]
  %208 = phi i64 [ %195, %.lr.ph247 ], [ %222, %219 ]
  %209 = phi i64 [ %195, %.lr.ph247 ], [ %223, %219 ]
  %.0143246 = phi i64 [ 0, %.lr.ph247 ], [ %224, %219 ]
  %.0144245 = phi i8 [ 0, %.lr.ph247 ], [ %.1145, %219 ]
  %210 = icmp eq i64 %.0143246, %.0148277
  %211 = icmp eq i64 %.0143246, %.0147266
  %or.cond189 = or i1 %210, %211
  %212 = icmp eq i64 %.0143246, %.0146254
  %or.cond190 = or i1 %212, %or.cond189
  br i1 %or.cond190, label %219, label %213

213:                                              ; preds = %205
  %214 = getelementptr inbounds [40 x %"struct.std::pair"], ptr @pt, i64 0, i64 %.0143246
  %.sroa.03.0.copyload = load i64, ptr %214, align 16
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %214, i64 8
  %.sroa.24.0.copyload = load i64, ptr %.sroa.24.0..sroa_idx, align 8
  %.sroa.01.0.copyload = load i64, ptr %181, align 16
  %.sroa.22.0.copyload = load i64, ptr %.sroa.22.0..sroa_idx, align 8
  %.sroa.0.0.copyload = load i64, ptr %190, align 16
  %.sroa.2.0.copyload = load i64, ptr %.sroa.2.0..sroa_idx, align 8
  %215 = invoke noundef zeroext i1 @_Z6in_triSt4pairIxxES0_S0_S0_(i64 %.sroa.03.0.copyload, i64 %.sroa.24.0.copyload, i64 %.sroa.01.0.copyload, i64 %.sroa.22.0.copyload, i64 %.sroa.0.0.copyload, i64 %.sroa.2.0.copyload, ptr noundef nonnull byval(%"struct.std::pair") align 8 %197)
          to label %216 unwind label %217

216:                                              ; preds = %213
  %spec.select191 = select i1 %215, i8 %.0144245, i8 1
  %.pre301 = load i64, ptr @N, align 8, !tbaa !8
  br label %219

217:                                              ; preds = %213
  %218 = landingpad { ptr, i32 }
          cleanup
  br label %236

219:                                              ; preds = %216, %205
  %220 = phi i64 [ %206, %205 ], [ %.pre301, %216 ]
  %221 = phi i64 [ %207, %205 ], [ %.pre301, %216 ]
  %222 = phi i64 [ %208, %205 ], [ %.pre301, %216 ]
  %223 = phi i64 [ %209, %205 ], [ %.pre301, %216 ]
  %.1145 = phi i8 [ %.0144245, %205 ], [ %spec.select191, %216 ]
  %224 = add nuw nsw i64 %.0143246, 1
  %225 = icmp slt i64 %224, %223
  br i1 %225, label %205, label %._crit_edge248, !llvm.loop !30

226:                                              ; preds = %._crit_edge279
  %227 = getelementptr inbounds [40 x [40 x [40 x i64]]], ptr @dp, i64 0, i64 %.1159.lcssa, i64 %.1155.lcssa, i64 %.1152.lcssa
  %228 = load i64, ptr %227, align 8, !tbaa !8
  br label %._crit_edge279.thread

._crit_edge279.thread:                            ; preds = %.preheader194, %._crit_edge279, %226
  %229 = phi i64 [ %228, %226 ], [ 0, %._crit_edge279 ], [ 0, %.preheader194 ]
  %230 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %229)
          to label %231 unwind label %234

231:                                              ; preds = %._crit_edge279.thread
  %232 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %230, ptr noundef nonnull @.str)
          to label %233 unwind label %234

233:                                              ; preds = %231
  call void @_ZNSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %1) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #8
  ret i32 0

234:                                              ; preds = %231, %._crit_edge279.thread
  %235 = landingpad { ptr, i32 }
          cleanup
  br label %236

236:                                              ; preds = %217, %234, %93, %118, %112, %58, %69
  %.pn183.pn = phi { ptr, i32 } [ %59, %58 ], [ %70, %69 ], [ %94, %93 ], [ %119, %118 ], [ %113, %112 ], [ %218, %217 ], [ %235, %234 ]
  call void @_ZNSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %1) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn183.pn
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueI3triSt6vectorIS0_SaIS0_EE5c_triE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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}
!15 = !{!16, !9, i64 0}
!16 = !{!"_ZTS3tri", !9, i64 0, !9, i64 8, !9, i64 16, !9, i64 24}
!17 = !{!16, !9, i64 8}
!18 = !{!16, !9, i64 16}
!19 = !{!16, !9, i64 24}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12, !29}
!29 = !{!"llvm.loop.unswitch.partial.disable"}
!30 = distinct !{!30, !12}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass