; LLVM IR from t-dillon/tdoku :: src (grid_tools)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon.0 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon.0 = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@.str.12 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10MakeTablesv() #0

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNSt7__cxx114stoiERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef) #3

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5usagev() #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #4 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::allocator", align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca %"class.std::allocator", align 1
  %13 = alloca i64, align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca i1, align 1
  %16 = alloca %"class.std::allocator", align 1
  %17 = alloca i1, align 1
  %18 = alloca i1, align 1
  %19 = alloca i1, align 1
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %"class.std::__cxx11::basic_string", align 8
  %23 = alloca %"class.std::allocator", align 1
  %24 = alloca i32, align 4
  %25 = alloca %"class.std::__cxx11::basic_string", align 8
  %26 = alloca %"class.std::allocator", align 1
  %27 = alloca i64, align 8
  %28 = alloca %"class.std::__cxx11::basic_string", align 8
  %29 = alloca %"class.std::allocator", align 1
  %30 = alloca i64, align 8
  %31 = alloca %"class.std::__cxx11::basic_string", align 8
  %32 = alloca i1, align 1
  %33 = alloca %"class.std::allocator", align 1
  %34 = alloca i1, align 1
  %35 = alloca i1, align 1
  %36 = alloca i1, align 1
  %37 = alloca i64, align 8
  %38 = alloca %"class.std::__cxx11::basic_string", align 8
  %39 = alloca i1, align 1
  %40 = alloca %"class.std::allocator", align 1
  %41 = alloca i1, align 1
  %42 = alloca i1, align 1
  %43 = alloca i1, align 1
  %44 = alloca i64, align 8
  %45 = alloca %"class.std::__cxx11::basic_string", align 8
  %46 = alloca i1, align 1
  %47 = alloca %"class.std::allocator", align 1
  %48 = alloca i1, align 1
  %49 = alloca i1, align 1
  %50 = alloca i1, align 1
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = icmp sgt i32 %51, 1
  br i1 %52, label %53, label %394

53:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #6
  %54 = load ptr, ptr %5, align 8, !tbaa !9
  %55 = getelementptr inbounds ptr, ptr %54, i64 1
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef %56, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %57 unwind label %97

57:                                               ; preds = %53
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  %58 = invoke noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef @.str.12)
          to label %59 unwind label %101

59:                                               ; preds = %57
  br i1 %58, label %60, label %142

60:                                               ; preds = %59
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = icmp sgt i32 %61, 2
  br i1 %62, label %63, label %141

63:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #6
  %64 = load ptr, ptr %5, align 8, !tbaa !9
  %65 = getelementptr inbounds ptr, ptr %64, i64 2
  %66 = load ptr, ptr %65, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef %66, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %67 unwind label %105

67:                                               ; preds = %63
  %68 = invoke noundef i64 @_ZNSt7__cxx116stoullERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef null, i32 noundef 10)
          to label %69 unwind label %109

69:                                               ; preds = %67
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  store i64 %68, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = icmp sgt i32 %70, 3
  store i1 false, ptr %15, align 1
  store i1 false, ptr %17, align 1
  store i1 false, ptr %18, align 1
  store i1 false, ptr %19, align 1
  br i1 %71, label %72, label %79

72:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #6
  store i1 true, ptr %15, align 1
  %73 = load ptr, ptr %5, align 8, !tbaa !9
  %74 = getelementptr inbounds ptr, ptr %73, i64 3
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #6
  store i1 true, ptr %17, align 1
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  store i1 true, ptr %18, align 1
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef %75, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %76 unwind label %114

76:                                               ; preds = %72
  store i1 true, ptr %19, align 1
  %77 = invoke noundef i64 @_ZNSt7__cxx116stoullERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef null, i32 noundef 10)
          to label %78 unwind label %118

78:                                               ; preds = %76
  br label %80

79:                                               ; preds = %69
  br label %80

80:                                               ; preds = %79, %78
  %81 = phi i64 [ %77, %78 ], [ 1, %79 ]
  %82 = load i1, ptr %19, align 1
  br i1 %82, label %83, label %84

83:                                               ; preds = %80
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  br label %84

84:                                               ; preds = %83, %80
  %85 = load i1, ptr %18, align 1
  br i1 %85, label %86, label %87

86:                                               ; preds = %84
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  br label %87

87:                                               ; preds = %86, %84
  %88 = load i1, ptr %17, align 1
  br i1 %88, label %89, label %90

89:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  br label %90

90:                                               ; preds = %89, %87
  %91 = load i1, ptr %15, align 1
  br i1 %91, label %92, label %93

92:                                               ; preds = %90
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  br label %93

93:                                               ; preds = %92, %90
  store i64 %81, ptr %13, align 8, !tbaa !11
  %94 = load i64, ptr %10, align 8, !tbaa !11
  %95 = load i64, ptr %13, align 8, !tbaa !11
  invoke void @_Z12ListPatternsmm(i64 noundef %94, i64 noundef %95)
          to label %96 unwind label %135

96:                                               ; preds = %93
  store i32 0, ptr %3, align 4
  store i32 1, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %389

97:                                               ; preds = %53
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %8, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %9, align 4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  br label %393

101:                                              ; preds = %327, %271, %194, %192, %189, %142, %57
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %8, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %9, align 4
  br label %392

105:                                              ; preds = %63
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %8, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %9, align 4
  br label %113

109:                                              ; preds = %67
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %8, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %9, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  br label %113

113:                                              ; preds = %109, %105
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  br label %140

114:                                              ; preds = %72
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %8, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %9, align 4
  br label %125

118:                                              ; preds = %76
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %8, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %9, align 4
  %122 = load i1, ptr %19, align 1
  br i1 %122, label %123, label %124

123:                                              ; preds = %118
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  br label %124

124:                                              ; preds = %123, %118
  br label %125

125:                                              ; preds = %124, %114
  %126 = load i1, ptr %18, align 1
  br i1 %126, label %127, label %128

127:                                              ; preds = %125
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  br label %128

128:                                              ; preds = %127, %125
  %129 = load i1, ptr %17, align 1
  br i1 %129, label %130, label %131

130:                                              ; preds = %128
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  br label %131

131:                                              ; preds = %130, %128
  %132 = load i1, ptr %15, align 1
  br i1 %132, label %133, label %134

133:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  br label %134

134:                                              ; preds = %133, %131
  br label %139

135:                                              ; preds = %93
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %8, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %9, align 4
  br label %139

139:                                              ; preds = %135, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %140

140:                                              ; preds = %139, %113
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %392

141:                                              ; preds = %60
  br label %388

142:                                              ; preds = %59
  %143 = invoke noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef @.str.13)
          to label %144 unwind label %101

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

145:                                              ; preds = %144
  %146 = load i32, ptr %4, align 4, !tbaa !5
  %147 = icmp eq i32 %146, 4
  br i1 %147, label %148, label %188

148:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #6
  %149 = load ptr, ptr %5, align 8, !tbaa !9
  %150 = getelementptr inbounds ptr, ptr %149, i64 2
  %151 = load ptr, ptr %150, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef %151, ptr noundef nonnull align 1 dereferenceable(1) %23)
          to label %152 unwind label %164

152:                                              ; preds = %148
  %153 = invoke noundef i32 @_ZNSt7__cxx114stoiERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef null, i32 noundef 10)
          to label %154 unwind label %168

154:                                              ; preds = %152
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #6
  store i32 %153, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %25) #6
  %155 = load ptr, ptr %5, align 8, !tbaa !9
  %156 = getelementptr inbounds ptr, ptr %155, i64 3
  %157 = load ptr, ptr %156, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef %157, ptr noundef nonnull align 1 dereferenceable(1) %26)
          to label %158 unwind label %173

158:                                              ; preds = %154
  %159 = invoke noundef i32 @_ZNSt7__cxx114stoiERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef null, i32 noundef 10)
          to label %160 unwind label %177

160:                                              ; preds = %158
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #6
  store i32 %159, ptr %24, align 4, !tbaa !5
  %161 = load i32, ptr %21, align 4, !tbaa !5
  %162 = load i32, ptr %24, align 4, !tbaa !5
  invoke void @_Z10CountGridsii(i32 noundef %161, i32 noundef %162)
          to label %163 unwind label %182

163:                                              ; preds = %160
  store i32 0, ptr %3, align 4
  store i32 1, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %389

164:                                              ; preds = %148
  %165 = landingpad { ptr, i32 }
          cleanup
  %166 = extractvalue { ptr, i32 } %165, 0
  store ptr %166, ptr %8, align 8
  %167 = extractvalue { ptr, i32 } %165, 1
  store i32 %167, ptr %9, align 4
  br label %172

168:                                              ; preds = %152
  %169 = landingpad { ptr, i32 }
          cleanup
  %170 = extractvalue { ptr, i32 } %169, 0
  store ptr %170, ptr %8, align 8
  %171 = extractvalue { ptr, i32 } %169, 1
  store i32 %171, ptr %9, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #6
  br label %172

172:                                              ; preds = %168, %164
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #6
  br label %187

173:                                              ; preds = %154
  %174 = landingpad { ptr, i32 }
          cleanup
  %175 = extractvalue { ptr, i32 } %174, 0
  store ptr %175, ptr %8, align 8
  %176 = extractvalue { ptr, i32 } %174, 1
  store i32 %176, ptr %9, align 4
  br label %181

177:                                              ; preds = %158
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %8, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %9, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #6
  br label %181

181:                                              ; preds = %177, %173
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #6
  br label %186

182:                                              ; preds = %160
  %183 = landingpad { ptr, i32 }
          cleanup
  %184 = extractvalue { ptr, i32 } %183, 0
  store ptr %184, ptr %8, align 8
  %185 = extractvalue { ptr, i32 } %183, 1
  store i32 %185, ptr %9, align 4
  br label %186

186:                                              ; preds = %182, %181
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %187

187:                                              ; preds = %186, %172
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %392

188:                                              ; preds = %145
  br label %387

189:                                              ; preds = %144
  %190 = invoke noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef @.str.14)
          to label %191 unwind label %101

191:                                              ; preds = %189
  br i1 %190, label %192, label %194

192:                                              ; preds = %191
  invoke void @_Z10MakeTablesv()
          to label %193 unwind label %101

193:                                              ; preds = %192
  store i32 0, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %389

194:                                              ; preds = %191
  %195 = invoke noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef @.str.15)
          to label %196 unwind label %101

196:                                              ; preds = %194
  br i1 %195, label %197, label %271

197:                                              ; preds = %196
  %198 = load i32, ptr %4, align 4, !tbaa !5
  %199 = icmp sgt i32 %198, 2
  br i1 %199, label %200, label %270

200:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %28) #6
  %201 = load ptr, ptr %5, align 8, !tbaa !9
  %202 = getelementptr inbounds ptr, ptr %201, i64 2
  %203 = load ptr, ptr %202, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %29) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %28, ptr noundef %203, ptr noundef nonnull align 1 dereferenceable(1) %29)
          to label %204 unwind label %234

204:                                              ; preds = %200
  %205 = invoke noundef i64 @_ZNSt7__cxx116stoullERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %28, ptr noundef null, i32 noundef 10)
          to label %206 unwind label %238

206:                                              ; preds = %204
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %28) #6
  store i64 %205, ptr %27, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %207 = load i32, ptr %4, align 4, !tbaa !5
  %208 = icmp sgt i32 %207, 3
  store i1 false, ptr %32, align 1
  store i1 false, ptr %34, align 1
  store i1 false, ptr %35, align 1
  store i1 false, ptr %36, align 1
  br i1 %208, label %209, label %216

209:                                              ; preds = %206
  call void @llvm.lifetime.start.p0(i64 32, ptr %31) #6
  store i1 true, ptr %32, align 1
  %210 = load ptr, ptr %5, align 8, !tbaa !9
  %211 = getelementptr inbounds ptr, ptr %210, i64 3
  %212 = load ptr, ptr %211, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %33) #6
  store i1 true, ptr %34, align 1
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %33) #6
  store i1 true, ptr %35, align 1
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %31, ptr noundef %212, ptr noundef nonnull align 1 dereferenceable(1) %33)
          to label %213 unwind label %243

213:                                              ; preds = %209
  store i1 true, ptr %36, align 1
  %214 = invoke noundef i64 @_ZNSt7__cxx116stoullERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %31, ptr noundef null, i32 noundef 10)
          to label %215 unwind label %247

215:                                              ; preds = %213
  br label %217

216:                                              ; preds = %206
  br label %217

217:                                              ; preds = %216, %215
  %218 = phi i64 [ %214, %215 ], [ 1, %216 ]
  %219 = load i1, ptr %36, align 1
  br i1 %219, label %220, label %221

220:                                              ; preds = %217
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %31) #6
  br label %221

221:                                              ; preds = %220, %217
  %222 = load i1, ptr %35, align 1
  br i1 %222, label %223, label %224

223:                                              ; preds = %221
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %33) #6
  br label %224

224:                                              ; preds = %223, %221
  %225 = load i1, ptr %34, align 1
  br i1 %225, label %226, label %227

226:                                              ; preds = %224
  call void @llvm.lifetime.end.p0(i64 1, ptr %33) #6
  br label %227

227:                                              ; preds = %226, %224
  %228 = load i1, ptr %32, align 1
  br i1 %228, label %229, label %230

229:                                              ; preds = %227
  call void @llvm.lifetime.end.p0(i64 32, ptr %31) #6
  br label %230

230:                                              ; preds = %229, %227
  store i64 %218, ptr %30, align 8, !tbaa !11
  %231 = load i64, ptr %27, align 8, !tbaa !11
  %232 = load i64, ptr %30, align 8, !tbaa !11
  invoke void @_Z9ListGridsmm(i64 noundef %231, i64 noundef %232)
          to label %233 unwind label %264

233:                                              ; preds = %230
  store i32 0, ptr %3, align 4
  store i32 1, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  br label %389

234:                                              ; preds = %200
  %235 = landingpad { ptr, i32 }
          cleanup
  %236 = extractvalue { ptr, i32 } %235, 0
  store ptr %236, ptr %8, align 8
  %237 = extractvalue { ptr, i32 } %235, 1
  store i32 %237, ptr %9, align 4
  br label %242

238:                                              ; preds = %204
  %239 = landingpad { ptr, i32 }
          cleanup
  %240 = extractvalue { ptr, i32 } %239, 0
  store ptr %240, ptr %8, align 8
  %241 = extractvalue { ptr, i32 } %239, 1
  store i32 %241, ptr %9, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #6
  br label %242

242:                                              ; preds = %238, %234
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %28) #6
  br label %269

243:                                              ; preds = %209
  %244 = landingpad { ptr, i32 }
          cleanup
  %245 = extractvalue { ptr, i32 } %244, 0
  store ptr %245, ptr %8, align 8
  %246 = extractvalue { ptr, i32 } %244, 1
  store i32 %246, ptr %9, align 4
  br label %254

247:                                              ; preds = %213
  %248 = landingpad { ptr, i32 }
          cleanup
  %249 = extractvalue { ptr, i32 } %248, 0
  store ptr %249, ptr %8, align 8
  %250 = extractvalue { ptr, i32 } %248, 1
  store i32 %250, ptr %9, align 4
  %251 = load i1, ptr %36, align 1
  br i1 %251, label %252, label %253

252:                                              ; preds = %247
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %31) #6
  br label %253

253:                                              ; preds = %252, %247
  br label %254

254:                                              ; preds = %253, %243
  %255 = load i1, ptr %35, align 1
  br i1 %255, label %256, label %257

256:                                              ; preds = %254
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %33) #6
  br label %257

257:                                              ; preds = %256, %254
  %258 = load i1, ptr %34, align 1
  br i1 %258, label %259, label %260

259:                                              ; preds = %257
  call void @llvm.lifetime.end.p0(i64 1, ptr %33) #6
  br label %260

260:                                              ; preds = %259, %257
  %261 = load i1, ptr %32, align 1
  br i1 %261, label %262, label %263

262:                                              ; preds = %260
  call void @llvm.lifetime.end.p0(i64 32, ptr %31) #6
  br label %263

263:                                              ; preds = %262, %260
  br label %268

264:                                              ; preds = %230
  %265 = landingpad { ptr, i32 }
          cleanup
  %266 = extractvalue { ptr, i32 } %265, 0
  store ptr %266, ptr %8, align 8
  %267 = extractvalue { ptr, i32 } %265, 1
  store i32 %267, ptr %9, align 4
  br label %268

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

269:                                              ; preds = %268, %242
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  br label %392

270:                                              ; preds = %197
  br label %385

271:                                              ; preds = %196
  %272 = invoke noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef @.str.16)
          to label %273 unwind label %101

273:                                              ; preds = %271
  br i1 %272, label %274, label %327

274:                                              ; preds = %273
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #6
  %275 = load i32, ptr %4, align 4, !tbaa !5
  %276 = icmp sgt i32 %275, 2
  store i1 false, ptr %39, align 1
  store i1 false, ptr %41, align 1
  store i1 false, ptr %42, align 1
  store i1 false, ptr %43, align 1
  br i1 %276, label %277, label %284

277:                                              ; preds = %274
  call void @llvm.lifetime.start.p0(i64 32, ptr %38) #6
  store i1 true, ptr %39, align 1
  %278 = load ptr, ptr %5, align 8, !tbaa !9
  %279 = getelementptr inbounds ptr, ptr %278, i64 2
  %280 = load ptr, ptr %279, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %40) #6
  store i1 true, ptr %41, align 1
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %40) #6
  store i1 true, ptr %42, align 1
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %38, ptr noundef %280, ptr noundef nonnull align 1 dereferenceable(1) %40)
          to label %281 unwind label %301

281:                                              ; preds = %277
  store i1 true, ptr %43, align 1
  %282 = invoke noundef i64 @_ZNSt7__cxx115stollERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %38, ptr noundef null, i32 noundef 10)
          to label %283 unwind label %305

283:                                              ; preds = %281
  br label %285

284:                                              ; preds = %274
  br label %285

285:                                              ; preds = %284, %283
  %286 = phi i64 [ %282, %283 ], [ -1, %284 ]
  %287 = load i1, ptr %43, align 1
  br i1 %287, label %288, label %289

288:                                              ; preds = %285
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %38) #6
  br label %289

289:                                              ; preds = %288, %285
  %290 = load i1, ptr %42, align 1
  br i1 %290, label %291, label %292

291:                                              ; preds = %289
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %40) #6
  br label %292

292:                                              ; preds = %291, %289
  %293 = load i1, ptr %41, align 1
  br i1 %293, label %294, label %295

294:                                              ; preds = %292
  call void @llvm.lifetime.end.p0(i64 1, ptr %40) #6
  br label %295

295:                                              ; preds = %294, %292
  %296 = load i1, ptr %39, align 1
  br i1 %296, label %297, label %298

297:                                              ; preds = %295
  call void @llvm.lifetime.end.p0(i64 32, ptr %38) #6
  br label %298

298:                                              ; preds = %297, %295
  store i64 %286, ptr %37, align 8, !tbaa !11
  %299 = load i64, ptr %37, align 8, !tbaa !11
  invoke void @_Z11SampleGridsl(i64 noundef %299)
          to label %300 unwind label %322

300:                                              ; preds = %298
  store i32 0, ptr %3, align 4
  store i32 1, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #6
  br label %389

301:                                              ; preds = %277
  %302 = landingpad { ptr, i32 }
          cleanup
  %303 = extractvalue { ptr, i32 } %302, 0
  store ptr %303, ptr %8, align 8
  %304 = extractvalue { ptr, i32 } %302, 1
  store i32 %304, ptr %9, align 4
  br label %312

305:                                              ; preds = %281
  %306 = landingpad { ptr, i32 }
          cleanup
  %307 = extractvalue { ptr, i32 } %306, 0
  store ptr %307, ptr %8, align 8
  %308 = extractvalue { ptr, i32 } %306, 1
  store i32 %308, ptr %9, align 4
  %309 = load i1, ptr %43, align 1
  br i1 %309, label %310, label %311

310:                                              ; preds = %305
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %38) #6
  br label %311

311:                                              ; preds = %310, %305
  br label %312

312:                                              ; preds = %311, %301
  %313 = load i1, ptr %42, align 1
  br i1 %313, label %314, label %315

314:                                              ; preds = %312
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %40) #6
  br label %315

315:                                              ; preds = %314, %312
  %316 = load i1, ptr %41, align 1
  br i1 %316, label %317, label %318

317:                                              ; preds = %315
  call void @llvm.lifetime.end.p0(i64 1, ptr %40) #6
  br label %318

318:                                              ; preds = %317, %315
  %319 = load i1, ptr %39, align 1
  br i1 %319, label %320, label %321

320:                                              ; preds = %318
  call void @llvm.lifetime.end.p0(i64 32, ptr %38) #6
  br label %321

321:                                              ; preds = %320, %318
  br label %326

322:                                              ; preds = %298
  %323 = landingpad { ptr, i32 }
          cleanup
  %324 = extractvalue { ptr, i32 } %323, 0
  store ptr %324, ptr %8, align 8
  %325 = extractvalue { ptr, i32 } %323, 1
  store i32 %325, ptr %9, align 4
  br label %326

326:                                              ; preds = %322, %321
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #6
  br label %392

327:                                              ; preds = %273
  %328 = invoke noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef @.str.17)
          to label %329 unwind label %101

329:                                              ; preds = %327
  br i1 %328, label %330, label %383

330:                                              ; preds = %329
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #6
  %331 = load i32, ptr %4, align 4, !tbaa !5
  %332 = icmp sgt i32 %331, 2
  store i1 false, ptr %46, align 1
  store i1 false, ptr %48, align 1
  store i1 false, ptr %49, align 1
  store i1 false, ptr %50, align 1
  br i1 %332, label %333, label %340

333:                                              ; preds = %330
  call void @llvm.lifetime.start.p0(i64 32, ptr %45) #6
  store i1 true, ptr %46, align 1
  %334 = load ptr, ptr %5, align 8, !tbaa !9
  %335 = getelementptr inbounds ptr, ptr %334, i64 2
  %336 = load ptr, ptr %335, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %47) #6
  store i1 true, ptr %48, align 1
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %47) #6
  store i1 true, ptr %49, align 1
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %45, ptr noundef %336, ptr noundef nonnull align 1 dereferenceable(1) %47)
          to label %337 unwind label %357

337:                                              ; preds = %333
  store i1 true, ptr %50, align 1
  %338 = invoke noundef i64 @_ZNSt7__cxx115stollERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %45, ptr noundef null, i32 noundef 10)
          to label %339 unwind label %361

339:                                              ; preds = %337
  br label %341

340:                                              ; preds = %330
  br label %341

341:                                              ; preds = %340, %339
  %342 = phi i64 [ %338, %339 ], [ -1, %340 ]
  %343 = load i1, ptr %50, align 1
  br i1 %343, label %344, label %345

344:                                              ; preds = %341
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %45) #6
  br label %345

345:                                              ; preds = %344, %341
  %346 = load i1, ptr %49, align 1
  br i1 %346, label %347, label %348

347:                                              ; preds = %345
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %47) #6
  br label %348

348:                                              ; preds = %347, %345
  %349 = load i1, ptr %48, align 1
  br i1 %349, label %350, label %351

350:                                              ; preds = %348
  call void @llvm.lifetime.end.p0(i64 1, ptr %47) #6
  br label %351

351:                                              ; preds = %350, %348
  %352 = load i1, ptr %46, align 1
  br i1 %352, label %353, label %354

353:                                              ; preds = %351
  call void @llvm.lifetime.end.p0(i64 32, ptr %45) #6
  br label %354

354:                                              ; preds = %353, %351
  store i64 %342, ptr %44, align 8, !tbaa !11
  %355 = load i64, ptr %44, align 8, !tbaa !11
  invoke void @_Z13SamplePuzzlesl(i64 noundef %355)
          to label %356 unwind label %378

356:                                              ; preds = %354
  store i32 0, ptr %3, align 4
  store i32 1, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #6
  br label %389

357:                                              ; preds = %333
  %358 = landingpad { ptr, i32 }
          cleanup
  %359 = extractvalue { ptr, i32 } %358, 0
  store ptr %359, ptr %8, align 8
  %360 = extractvalue { ptr, i32 } %358, 1
  store i32 %360, ptr %9, align 4
  br label %368

361:                                              ; preds = %337
  %362 = landingpad { ptr, i32 }
          cleanup
  %363 = extractvalue { ptr, i32 } %362, 0
  store ptr %363, ptr %8, align 8
  %364 = extractvalue { ptr, i32 } %362, 1
  store i32 %364, ptr %9, align 4
  %365 = load i1, ptr %50, align 1
  br i1 %365, label %366, label %367

366:                                              ; preds = %361
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %45) #6
  br label %367

367:                                              ; preds = %366, %361
  br label %368

368:                                              ; preds = %367, %357
  %369 = load i1, ptr %49, align 1
  br i1 %369, label %370, label %371

370:                                              ; preds = %368
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %47) #6
  br label %371

371:                                              ; preds = %370, %368
  %372 = load i1, ptr %48, align 1
  br i1 %372, label %373, label %374

373:                                              ; preds = %371
  call void @llvm.lifetime.end.p0(i64 1, ptr %47) #6
  br label %374

374:                                              ; preds = %373, %371
  %375 = load i1, ptr %46, align 1
  br i1 %375, label %376, label %377

376:                                              ; preds = %374
  call void @llvm.lifetime.end.p0(i64 32, ptr %45) #6
  br label %377

377:                                              ; preds = %376, %374
  br label %382

378:                                              ; preds = %354
  %379 = landingpad { ptr, i32 }
          cleanup
  %380 = extractvalue { ptr, i32 } %379, 0
  store ptr %380, ptr %8, align 8
  %381 = extractvalue { ptr, i32 } %379, 1
  store i32 %381, ptr %9, align 4
  br label %382

382:                                              ; preds = %378, %377
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #6
  br label %392

383:                                              ; preds = %329
  br label %384

384:                                              ; preds = %383
  br label %385

385:                                              ; preds = %384, %270
  br label %386

386:                                              ; preds = %385
  br label %387

387:                                              ; preds = %386, %188
  br label %388

388:                                              ; preds = %387, %141
  store i32 0, ptr %20, align 4
  br label %389

389:                                              ; preds = %388, %356, %300, %233, %193, %163, %96
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #6
  %390 = load i32, ptr %20, align 4
  switch i32 %390, label %402 [
    i32 0, label %391
    i32 1, label %395
  ]

391:                                              ; preds = %389
  br label %394

392:                                              ; preds = %382, %326, %269, %187, %140, %101
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  br label %393

393:                                              ; preds = %392, %97
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #6
  br label %397

394:                                              ; preds = %391, %2
  call void @_Z5usagev()
  br label %395

395:                                              ; preds = %394, %389
  %396 = load i32, ptr %3, align 4
  ret i32 %396

397:                                              ; preds = %393
  %398 = load ptr, ptr %8, align 8
  %399 = load i32, ptr %9, align 4
  %400 = insertvalue { ptr, i32 } poison, ptr %398, 0
  %401 = insertvalue { ptr, i32 } %400, i32 %399, 1
  resume { ptr, i32 } %401

402:                                              ; preds = %389
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZNSt7__cxx116stoullERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZNSt7__cxx115stollERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef) #3

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

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon.0 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon.0 = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@.str.12 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10MakeTablesv() local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNSt7__cxx114stoiERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef) local_unnamed_addr #3

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5usagev() local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator", align 1
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca %"class.std::allocator", align 1
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca %"class.std::allocator", align 1
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca %"class.std::allocator", align 1
  %17 = alloca %"class.std::__cxx11::basic_string", align 8
  %18 = alloca %"class.std::allocator", align 1
  %19 = alloca %"class.std::__cxx11::basic_string", align 8
  %20 = alloca %"class.std::allocator", align 1
  %21 = icmp sgt i32 %0, 1
  br i1 %21, label %22, label %150

22:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #6
  %23 = getelementptr inbounds i8, ptr %1, i64 8
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef %24, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %25 unwind label %41

25:                                               ; preds = %22
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  %26 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.12)
  br i1 %26, label %27, label %57

27:                                               ; preds = %25
  %.not121 = icmp eq i32 %0, 2
  br i1 %.not121, label %147, label %28

28:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  %29 = getelementptr inbounds i8, ptr %1, i64 16
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef %30, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %31 unwind label %45

31:                                               ; preds = %28
  %32 = invoke noundef i64 @_ZNSt7__cxx116stoullERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef null, i32 noundef 10)
          to label %33 unwind label %47

33:                                               ; preds = %31
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  %34 = icmp ugt i32 %0, 3
  br i1 %34, label %35, label %.critedge132

35:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #6
  %36 = getelementptr inbounds i8, ptr %1, i64 24
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef %37, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %38 unwind label %50

38:                                               ; preds = %35
  %39 = invoke noundef i64 @_ZNSt7__cxx116stoullERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef null, i32 noundef 10)
          to label %.critedge unwind label %52

.critedge:                                        ; preds = %38
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  br label %.critedge132

.critedge132:                                     ; preds = %33, %.critedge
  %40 = phi i64 [ %39, %.critedge ], [ 1, %33 ]
  invoke void @_Z12ListPatternsmm(i64 noundef %32, i64 noundef %40)
          to label %.thread148 unwind label %55

41:                                               ; preds = %22
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  br label %149

43:                                               ; preds = %86
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %148

45:                                               ; preds = %28
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %49

47:                                               ; preds = %31
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  br label %49

49:                                               ; preds = %47, %45
  %.pn122 = phi { ptr, i32 } [ %48, %47 ], [ %46, %45 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  br label %148

50:                                               ; preds = %35
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %54

52:                                               ; preds = %38
  %53 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  br label %54

54:                                               ; preds = %50, %52
  %.pn124 = phi { ptr, i32 } [ %53, %52 ], [ %51, %50 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  br label %148

55:                                               ; preds = %.critedge132
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %148

57:                                               ; preds = %25
  %58 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.13)
  br i1 %58, label %59, label %84

59:                                               ; preds = %57
  %60 = icmp eq i32 %0, 4
  br i1 %60, label %61, label %147

61:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #6
  %62 = getelementptr inbounds i8, ptr %1, i64 16
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef %63, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %64 unwind label %72

64:                                               ; preds = %61
  %65 = invoke noundef i32 @_ZNSt7__cxx114stoiERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef null, i32 noundef 10)
          to label %66 unwind label %74

66:                                               ; preds = %64
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #6
  %67 = getelementptr inbounds i8, ptr %1, i64 24
  %68 = load ptr, ptr %67, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %12) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef %68, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %69 unwind label %77

69:                                               ; preds = %66
  %70 = invoke noundef i32 @_ZNSt7__cxx114stoiERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef null, i32 noundef 10)
          to label %71 unwind label %79

71:                                               ; preds = %69
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #6
  invoke void @_Z10CountGridsii(i32 noundef %65, i32 noundef %70)
          to label %.thread148 unwind label %82

72:                                               ; preds = %61
  %73 = landingpad { ptr, i32 }
          cleanup
  br label %76

74:                                               ; preds = %64
  %75 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  br label %76

76:                                               ; preds = %74, %72
  %.pn114 = phi { ptr, i32 } [ %75, %74 ], [ %73, %72 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #6
  br label %148

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

79:                                               ; preds = %69
  %80 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  br label %81

81:                                               ; preds = %79, %77
  %.pn116 = phi { ptr, i32 } [ %80, %79 ], [ %78, %77 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #6
  br label %148

82:                                               ; preds = %71
  %83 = landingpad { ptr, i32 }
          cleanup
  br label %148

84:                                               ; preds = %57
  %85 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.14)
  br i1 %85, label %86, label %87

86:                                               ; preds = %84
  invoke void @_Z10MakeTablesv()
          to label %.thread148 unwind label %43

87:                                               ; preds = %84
  %88 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.15)
  br i1 %88, label %89, label %115

89:                                               ; preds = %87
  %.not = icmp eq i32 %0, 2
  br i1 %.not, label %147, label %90

90:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #6
  %91 = getelementptr inbounds i8, ptr %1, i64 16
  %92 = load ptr, ptr %91, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %14) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef %92, ptr noundef nonnull align 1 dereferenceable(1) %14)
          to label %93 unwind label %103

93:                                               ; preds = %90
  %94 = invoke noundef i64 @_ZNSt7__cxx116stoullERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef null, i32 noundef 10)
          to label %95 unwind label %105

95:                                               ; preds = %93
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #6
  %96 = icmp ugt i32 %0, 3
  br i1 %96, label %97, label %.critedge136

97:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %15) #6
  %98 = getelementptr inbounds i8, ptr %1, i64 24
  %99 = load ptr, ptr %98, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %16) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef %99, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %100 unwind label %108

100:                                              ; preds = %97
  %101 = invoke noundef i64 @_ZNSt7__cxx116stoullERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef null, i32 noundef 10)
          to label %.critedge134 unwind label %110

.critedge134:                                     ; preds = %100
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #6
  br label %.critedge136

.critedge136:                                     ; preds = %95, %.critedge134
  %102 = phi i64 [ %101, %.critedge134 ], [ 1, %95 ]
  invoke void @_Z9ListGridsmm(i64 noundef %94, i64 noundef %102)
          to label %.thread148 unwind label %113

103:                                              ; preds = %90
  %104 = landingpad { ptr, i32 }
          cleanup
  br label %107

105:                                              ; preds = %93
  %106 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  br label %107

107:                                              ; preds = %105, %103
  %.pn107 = phi { ptr, i32 } [ %106, %105 ], [ %104, %103 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #6
  br label %148

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

110:                                              ; preds = %100
  %111 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #6
  br label %112

112:                                              ; preds = %108, %110
  %.pn109 = phi { ptr, i32 } [ %111, %110 ], [ %109, %108 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #6
  br label %148

113:                                              ; preds = %.critedge136
  %114 = landingpad { ptr, i32 }
          cleanup
  br label %148

115:                                              ; preds = %87
  %116 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.16)
  br i1 %116, label %117, label %131

117:                                              ; preds = %115
  %.not.not104 = icmp eq i32 %0, 2
  br i1 %.not.not104, label %.critedge140, label %118

118:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %17) #6
  %119 = getelementptr inbounds i8, ptr %1, i64 16
  %120 = load ptr, ptr %119, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %18) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef %120, ptr noundef nonnull align 1 dereferenceable(1) %18)
          to label %121 unwind label %124

121:                                              ; preds = %118
  %122 = invoke noundef i64 @_ZNSt7__cxx115stollERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef null, i32 noundef 10)
          to label %.critedge138 unwind label %126

.critedge138:                                     ; preds = %121
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %18) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %17) #6
  br label %.critedge140

.critedge140:                                     ; preds = %117, %.critedge138
  %123 = phi i64 [ %122, %.critedge138 ], [ -1, %117 ]
  invoke void @_Z11SampleGridsl(i64 noundef %123)
          to label %.thread148 unwind label %129

124:                                              ; preds = %118
  %125 = landingpad { ptr, i32 }
          cleanup
  br label %128

126:                                              ; preds = %121
  %127 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #6
  br label %128

128:                                              ; preds = %124, %126
  %.pn102 = phi { ptr, i32 } [ %127, %126 ], [ %125, %124 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %18) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %17) #6
  br label %148

129:                                              ; preds = %.critedge140
  %130 = landingpad { ptr, i32 }
          cleanup
  br label %148

131:                                              ; preds = %115
  %132 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.17)
  br i1 %132, label %133, label %147

133:                                              ; preds = %131
  %.not.not = icmp eq i32 %0, 2
  br i1 %.not.not, label %.critedge144, label %134

134:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %19) #6
  %135 = getelementptr inbounds i8, ptr %1, i64 16
  %136 = load ptr, ptr %135, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %20) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef %136, ptr noundef nonnull align 1 dereferenceable(1) %20)
          to label %137 unwind label %140

137:                                              ; preds = %134
  %138 = invoke noundef i64 @_ZNSt7__cxx115stollERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef null, i32 noundef 10)
          to label %.critedge142 unwind label %142

.critedge142:                                     ; preds = %137
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %20) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %19) #6
  br label %.critedge144

.critedge144:                                     ; preds = %133, %.critedge142
  %139 = phi i64 [ %138, %.critedge142 ], [ -1, %133 ]
  invoke void @_Z13SamplePuzzlesl(i64 noundef %139)
          to label %.thread148 unwind label %145

140:                                              ; preds = %134
  %141 = landingpad { ptr, i32 }
          cleanup
  br label %144

142:                                              ; preds = %137
  %143 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #6
  br label %144

144:                                              ; preds = %140, %142
  %.pn = phi { ptr, i32 } [ %143, %142 ], [ %141, %140 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %20) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %19) #6
  br label %148

145:                                              ; preds = %.critedge144
  %146 = landingpad { ptr, i32 }
          cleanup
  br label %148

.thread148:                                       ; preds = %.critedge132, %71, %86, %.critedge136, %.critedge140, %.critedge144
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  br label %151

147:                                              ; preds = %27, %131, %89, %59
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  br label %150

148:                                              ; preds = %145, %144, %129, %128, %107, %112, %113, %76, %82, %81, %49, %54, %55, %43
  %.pn126.pn.pn = phi { ptr, i32 } [ %44, %43 ], [ %.pn122, %49 ], [ %56, %55 ], [ %.pn124, %54 ], [ %.pn114, %76 ], [ %83, %82 ], [ %.pn116, %81 ], [ %.pn107, %107 ], [ %114, %113 ], [ %.pn109, %112 ], [ %130, %129 ], [ %.pn102, %128 ], [ %146, %145 ], [ %.pn, %144 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  br label %149

149:                                              ; preds = %148, %41
  %.pn126.pn.pn.pn = phi { ptr, i32 } [ %.pn126.pn.pn, %148 ], [ %42, %41 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn126.pn.pn.pn

150:                                              ; preds = %147, %2
  call void @_Z5usagev()
  br label %151

151:                                              ; preds = %.thread148, %150
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZNSt7__cxx116stoullERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZNSt7__cxx115stollERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef) local_unnamed_addr #3

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass