; LLVM IR from DionysiosB/CodeForces :: 0300-0399 (375A-DivisibleBySeven)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [1 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@__const.main.permDigits = external hidden unnamed_addr constant [4 x i32], align 16
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i8, align 1
  %3 = alloca i8, align 1
  %4 = alloca i8, align 1
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::allocator", align 1
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %14 = alloca [4 x i32], align 16
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr %2) #7
  store i8 0, ptr %2, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #7
  store i8 0, ptr %3, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #7
  store i8 0, ptr %4, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #7
  store i8 0, ptr %5, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef @.str, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %16 unwind label %25

16:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #7
  %17 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %18 unwind label %29

18:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %145, %18
  %20 = load i32, ptr %12, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  %23 = icmp ult i64 %21, %22
  br i1 %23, label %33, label %24

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

25:                                               ; preds = %0
  %26 = landingpad { ptr, i32 }
          cleanup
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %10, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %11, align 4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #7
  br label %219

29:                                               ; preds = %16
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %10, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %11, align 4
  br label %218

33:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #7
  %34 = load i32, ptr %12, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %8, i64 noundef %35)
          to label %37 unwind label %45

37:                                               ; preds = %33
  %38 = load i8, ptr %36, align 1, !tbaa !11
  store i8 %38, ptr %13, align 1, !tbaa !11
  %39 = load i8, ptr %13, align 1, !tbaa !11
  %40 = sext i8 %39 to i32
  %41 = icmp eq i32 %40, 48
  br i1 %41, label %42, label %49

42:                                               ; preds = %37
  %43 = load i32, ptr %7, align 4, !tbaa !9
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %7, align 4, !tbaa !9
  br label %144

45:                                               ; preds = %129, %116, %96, %76, %56, %33
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %10, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %218

49:                                               ; preds = %37
  %50 = load i8, ptr %13, align 1, !tbaa !11
  %51 = sext i8 %50 to i32
  %52 = icmp eq i32 %51, 49
  br i1 %52, label %53, label %69

53:                                               ; preds = %49
  %54 = load i8, ptr %2, align 1, !tbaa !5, !range !12, !noundef !13
  %55 = trunc i8 %54 to i1
  br i1 %55, label %56, label %67

56:                                               ; preds = %53
  %57 = load i8, ptr %13, align 1, !tbaa !11
  %58 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %57)
          to label %59 unwind label %45

59:                                               ; preds = %56
  %60 = load i32, ptr %6, align 4, !tbaa !9
  %61 = mul nsw i32 10, %60
  %62 = load i8, ptr %13, align 1, !tbaa !11
  %63 = sext i8 %62 to i32
  %64 = sub nsw i32 %63, 48
  %65 = add nsw i32 %61, %64
  %66 = srem i32 %65, 7
  store i32 %66, ptr %6, align 4, !tbaa !9
  br label %68

67:                                               ; preds = %53
  store i8 1, ptr %2, align 1, !tbaa !5
  br label %68

68:                                               ; preds = %67, %59
  br label %143

69:                                               ; preds = %49
  %70 = load i8, ptr %13, align 1, !tbaa !11
  %71 = sext i8 %70 to i32
  %72 = icmp eq i32 %71, 54
  br i1 %72, label %73, label %89

73:                                               ; preds = %69
  %74 = load i8, ptr %3, align 1, !tbaa !5, !range !12, !noundef !13
  %75 = trunc i8 %74 to i1
  br i1 %75, label %76, label %87

76:                                               ; preds = %73
  %77 = load i8, ptr %13, align 1, !tbaa !11
  %78 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %77)
          to label %79 unwind label %45

79:                                               ; preds = %76
  %80 = load i32, ptr %6, align 4, !tbaa !9
  %81 = mul nsw i32 10, %80
  %82 = load i8, ptr %13, align 1, !tbaa !11
  %83 = sext i8 %82 to i32
  %84 = sub nsw i32 %83, 48
  %85 = add nsw i32 %81, %84
  %86 = srem i32 %85, 7
  store i32 %86, ptr %6, align 4, !tbaa !9
  br label %88

87:                                               ; preds = %73
  store i8 1, ptr %3, align 1, !tbaa !5
  br label %88

88:                                               ; preds = %87, %79
  br label %142

89:                                               ; preds = %69
  %90 = load i8, ptr %13, align 1, !tbaa !11
  %91 = sext i8 %90 to i32
  %92 = icmp eq i32 %91, 56
  br i1 %92, label %93, label %109

93:                                               ; preds = %89
  %94 = load i8, ptr %4, align 1, !tbaa !5, !range !12, !noundef !13
  %95 = trunc i8 %94 to i1
  br i1 %95, label %96, label %107

96:                                               ; preds = %93
  %97 = load i8, ptr %13, align 1, !tbaa !11
  %98 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %97)
          to label %99 unwind label %45

99:                                               ; preds = %96
  %100 = load i32, ptr %6, align 4, !tbaa !9
  %101 = mul nsw i32 10, %100
  %102 = load i8, ptr %13, align 1, !tbaa !11
  %103 = sext i8 %102 to i32
  %104 = sub nsw i32 %103, 48
  %105 = add nsw i32 %101, %104
  %106 = srem i32 %105, 7
  store i32 %106, ptr %6, align 4, !tbaa !9
  br label %108

107:                                              ; preds = %93
  store i8 1, ptr %4, align 1, !tbaa !5
  br label %108

108:                                              ; preds = %107, %99
  br label %141

109:                                              ; preds = %89
  %110 = load i8, ptr %13, align 1, !tbaa !11
  %111 = sext i8 %110 to i32
  %112 = icmp eq i32 %111, 57
  br i1 %112, label %113, label %129

113:                                              ; preds = %109
  %114 = load i8, ptr %5, align 1, !tbaa !5, !range !12, !noundef !13
  %115 = trunc i8 %114 to i1
  br i1 %115, label %116, label %127

116:                                              ; preds = %113
  %117 = load i8, ptr %13, align 1, !tbaa !11
  %118 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %117)
          to label %119 unwind label %45

119:                                              ; preds = %116
  %120 = load i32, ptr %6, align 4, !tbaa !9
  %121 = mul nsw i32 10, %120
  %122 = load i8, ptr %13, align 1, !tbaa !11
  %123 = sext i8 %122 to i32
  %124 = sub nsw i32 %123, 48
  %125 = add nsw i32 %121, %124
  %126 = srem i32 %125, 7
  store i32 %126, ptr %6, align 4, !tbaa !9
  br label %128

127:                                              ; preds = %113
  store i8 1, ptr %5, align 1, !tbaa !5
  br label %128

128:                                              ; preds = %127, %119
  br label %140

129:                                              ; preds = %109
  %130 = load i8, ptr %13, align 1, !tbaa !11
  %131 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %130)
          to label %132 unwind label %45

132:                                              ; preds = %129
  %133 = load i32, ptr %6, align 4, !tbaa !9
  %134 = mul nsw i32 10, %133
  %135 = load i8, ptr %13, align 1, !tbaa !11
  %136 = sext i8 %135 to i32
  %137 = sub nsw i32 %136, 48
  %138 = add nsw i32 %134, %137
  %139 = srem i32 %138, 7
  store i32 %139, ptr %6, align 4, !tbaa !9
  br label %140

140:                                              ; preds = %132, %128
  br label %141

141:                                              ; preds = %140, %108
  br label %142

142:                                              ; preds = %141, %88
  br label %143

143:                                              ; preds = %142, %68
  br label %144

144:                                              ; preds = %143, %42
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #7
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %12, align 4, !tbaa !9
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %12, align 4, !tbaa !9
  br label %19, !llvm.loop !14

148:                                              ; preds = %24
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %14, ptr align 16 @__const.main.permDigits, i64 16, i1 false)
  br label %149

149:                                              ; preds = %196, %148
  %150 = load i32, ptr %6, align 4, !tbaa !9
  %151 = mul nsw i32 10000, %150
  %152 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 0
  %153 = load i32, ptr %152, align 16, !tbaa !9
  %154 = mul nsw i32 1000, %153
  %155 = add nsw i32 %151, %154
  %156 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 1
  %157 = load i32, ptr %156, align 4, !tbaa !9
  %158 = mul nsw i32 100, %157
  %159 = add nsw i32 %155, %158
  %160 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 2
  %161 = load i32, ptr %160, align 8, !tbaa !9
  %162 = mul nsw i32 10, %161
  %163 = add nsw i32 %159, %162
  %164 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 3
  %165 = load i32, ptr %164, align 4, !tbaa !9
  %166 = add nsw i32 %163, %165
  %167 = srem i32 %166, 7
  %168 = icmp eq i32 %167, 0
  br i1 %168, label %169, label %190

169:                                              ; preds = %149
  %170 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 0
  %171 = load i32, ptr %170, align 16, !tbaa !9
  %172 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %171)
          to label %173 unwind label %186

173:                                              ; preds = %169
  %174 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 1
  %175 = load i32, ptr %174, align 4, !tbaa !9
  %176 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %172, i32 noundef %175)
          to label %177 unwind label %186

177:                                              ; preds = %173
  %178 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 2
  %179 = load i32, ptr %178, align 8, !tbaa !9
  %180 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %176, i32 noundef %179)
          to label %181 unwind label %186

181:                                              ; preds = %177
  %182 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 3
  %183 = load i32, ptr %182, align 4, !tbaa !9
  %184 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %180, i32 noundef %183)
          to label %185 unwind label %186

185:                                              ; preds = %181
  br label %197

186:                                              ; preds = %213, %191, %181, %177, %173, %169
  %187 = landingpad { ptr, i32 }
          cleanup
  %188 = extractvalue { ptr, i32 } %187, 0
  store ptr %188, ptr %10, align 8
  %189 = extractvalue { ptr, i32 } %187, 1
  store i32 %189, ptr %11, align 4
  br label %217

190:                                              ; preds = %149
  br label %191

191:                                              ; preds = %190
  %192 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 0
  %193 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 0
  %194 = getelementptr inbounds i32, ptr %193, i64 4
  %195 = invoke noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef %192, ptr noundef %194)
          to label %196 unwind label %186

196:                                              ; preds = %191
  br i1 %195, label %149, label %197, !llvm.loop !16

197:                                              ; preds = %196, %185
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %198

198:                                              ; preds = %206, %197
  %199 = load i32, ptr %15, align 4, !tbaa !9
  %200 = load i32, ptr %7, align 4, !tbaa !9
  %201 = icmp slt i32 %199, %200
  br i1 %201, label %203, label %202

202:                                              ; preds = %198
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %213

203:                                              ; preds = %198
  %204 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1)
          to label %205 unwind label %209

205:                                              ; preds = %203
  br label %206

206:                                              ; preds = %205
  %207 = load i32, ptr %15, align 4, !tbaa !9
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %15, align 4, !tbaa !9
  br label %198, !llvm.loop !17

209:                                              ; preds = %203
  %210 = landingpad { ptr, i32 }
          cleanup
  %211 = extractvalue { ptr, i32 } %210, 0
  store ptr %211, ptr %10, align 8
  %212 = extractvalue { ptr, i32 } %210, 1
  store i32 %212, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %217

213:                                              ; preds = %202
  %214 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %215 unwind label %186

215:                                              ; preds = %213
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %2) #7
  %216 = load i32, ptr %1, align 4
  ret i32 %216

217:                                              ; preds = %209, %186
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  br label %218

218:                                              ; preds = %217, %45, %29
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  br label %219

219:                                              ; preds = %218, %25
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %2) #7
  br label %220

220:                                              ; preds = %219
  %221 = load ptr, ptr %10, align 8
  %222 = load i32, ptr %11, align 4
  %223 = insertvalue { ptr, i32 } poison, ptr %221, 0
  %224 = insertvalue { ptr, i32 } %223, i32 %222, 1
  resume { ptr, i32 } %224
}

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #4

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #4

; 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) #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef, ptr noundef) #4

declare i32 @printf(ptr noundef, ...) #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

; 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 nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

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

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


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [1 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@__const.main.permDigits = external hidden unnamed_addr constant [4 x i32], align 16
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::allocator", align 1
  %3 = alloca [4 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull @.str, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %4 unwind label %12

4:                                                ; preds = %0
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #8
  %5 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %.preheader unwind label %14

.preheader:                                       ; preds = %4
  %6 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  %.not = icmp eq i64 %6, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %58
  %7 = mul nsw i32 %.141, 10000
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %.040.lcssa = phi i32 [ 0, %.preheader ], [ %7, %._crit_edge.loopexit ]
  %.038.lcssa = phi i32 [ 0, %.preheader ], [ %.139, %._crit_edge.loopexit ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %3, ptr noundef nonnull align 16 dereferenceable(16) @__const.main.permDigits, i64 16, i1 false)
  %8 = getelementptr inbounds i8, ptr %3, i64 4
  %9 = getelementptr inbounds i8, ptr %3, i64 8
  %10 = getelementptr inbounds i8, ptr %3, i64 12
  %11 = getelementptr inbounds i8, ptr %3, i64 16
  br label %61

12:                                               ; preds = %0
  %13 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #8
  br label %96

14:                                               ; preds = %4
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %95

.lr.ph:                                           ; preds = %.preheader, %58
  %indvars.iv = phi i64 [ %indvars.iv.next, %58 ], [ 0, %.preheader ]
  %.03873 = phi i32 [ %.139, %58 ], [ 0, %.preheader ]
  %.04072 = phi i32 [ %.141, %58 ], [ 0, %.preheader ]
  %.04271 = phi i1 [ %.143, %58 ], [ false, %.preheader ]
  %.04470 = phi i1 [ %.145, %58 ], [ false, %.preheader ]
  %.04669 = phi i1 [ %.147, %58 ], [ false, %.preheader ]
  %.04868 = phi i1 [ %.149, %58 ], [ false, %.preheader ]
  %16 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  %17 = load i8, ptr %16, align 1, !tbaa !5
  %18 = sext i8 %17 to i32
  switch i8 %17, label %51 [
    i8 48, label %19
    i8 49, label %23
    i8 54, label %30
    i8 56, label %37
    i8 57, label %44
  ]

19:                                               ; preds = %.lr.ph
  %20 = add nsw i32 %.03873, 1
  br label %58

21:                                               ; preds = %51, %45, %38, %31, %24
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %95

23:                                               ; preds = %.lr.ph
  br i1 %.04868, label %24, label %58

24:                                               ; preds = %23
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 49)
          to label %26 unwind label %21

26:                                               ; preds = %24
  %27 = mul nsw i32 %.04072, 10
  %28 = or disjoint i32 %27, 1
  %29 = srem i32 %28, 7
  br label %58

30:                                               ; preds = %.lr.ph
  br i1 %.04669, label %31, label %58

31:                                               ; preds = %30
  %32 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 54)
          to label %33 unwind label %21

33:                                               ; preds = %31
  %34 = mul nsw i32 %.04072, 10
  %35 = add nsw i32 %34, 6
  %36 = srem i32 %35, 7
  br label %58

37:                                               ; preds = %.lr.ph
  br i1 %.04470, label %38, label %58

38:                                               ; preds = %37
  %39 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 56)
          to label %40 unwind label %21

40:                                               ; preds = %38
  %41 = mul nsw i32 %.04072, 10
  %42 = add nsw i32 %41, 8
  %43 = srem i32 %42, 7
  br label %58

44:                                               ; preds = %.lr.ph
  br i1 %.04271, label %45, label %58

45:                                               ; preds = %44
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 57)
          to label %47 unwind label %21

47:                                               ; preds = %45
  %48 = mul nsw i32 %.04072, 10
  %49 = add nsw i32 %48, 9
  %50 = srem i32 %49, 7
  br label %58

51:                                               ; preds = %.lr.ph
  %52 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %17)
          to label %53 unwind label %21

53:                                               ; preds = %51
  %54 = mul nsw i32 %.04072, 10
  %55 = add nsw i32 %54, -48
  %56 = add nsw i32 %55, %18
  %57 = srem i32 %56, 7
  br label %58

58:                                               ; preds = %44, %37, %30, %23, %26, %40, %47, %53, %33, %19
  %.149 = phi i1 [ %.04868, %19 ], [ true, %26 ], [ %.04868, %33 ], [ %.04868, %40 ], [ %.04868, %47 ], [ %.04868, %53 ], [ true, %23 ], [ %.04868, %30 ], [ %.04868, %37 ], [ %.04868, %44 ]
  %.147 = phi i1 [ %.04669, %19 ], [ %.04669, %26 ], [ true, %33 ], [ %.04669, %40 ], [ %.04669, %47 ], [ %.04669, %53 ], [ %.04669, %23 ], [ true, %30 ], [ %.04669, %37 ], [ %.04669, %44 ]
  %.145 = phi i1 [ %.04470, %19 ], [ %.04470, %26 ], [ %.04470, %33 ], [ true, %40 ], [ %.04470, %47 ], [ %.04470, %53 ], [ %.04470, %23 ], [ %.04470, %30 ], [ true, %37 ], [ %.04470, %44 ]
  %.143 = phi i1 [ %.04271, %19 ], [ %.04271, %26 ], [ %.04271, %33 ], [ %.04271, %40 ], [ true, %47 ], [ %.04271, %53 ], [ %.04271, %23 ], [ %.04271, %30 ], [ %.04271, %37 ], [ true, %44 ]
  %.141 = phi i32 [ %.04072, %19 ], [ %29, %26 ], [ %36, %33 ], [ %43, %40 ], [ %50, %47 ], [ %57, %53 ], [ %.04072, %23 ], [ %.04072, %30 ], [ %.04072, %37 ], [ %.04072, %44 ]
  %.139 = phi i32 [ %20, %19 ], [ %.03873, %26 ], [ %.03873, %33 ], [ %.03873, %40 ], [ %.03873, %47 ], [ %.03873, %53 ], [ %.03873, %23 ], [ %.03873, %30 ], [ %.03873, %37 ], [ %.03873, %44 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %59 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  %60 = icmp ugt i64 %59, %indvars.iv.next
  br i1 %60, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !8

61:                                               ; preds = %89, %._crit_edge
  %62 = load i32, ptr %3, align 16, !tbaa !10
  %63 = mul nsw i32 %62, 1000
  %64 = add nsw i32 %63, %.040.lcssa
  %65 = load i32, ptr %8, align 4, !tbaa !10
  %66 = mul nsw i32 %65, 100
  %67 = add nsw i32 %64, %66
  %68 = load i32, ptr %9, align 8, !tbaa !10
  %69 = mul nsw i32 %68, 10
  %70 = add nsw i32 %67, %69
  %71 = load i32, ptr %10, align 4, !tbaa !10
  %72 = add nsw i32 %70, %71
  %73 = srem i32 %72, 7
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %75, label %87

75:                                               ; preds = %61
  %76 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %62)
          to label %77 unwind label %.loopexit.split-lp

77:                                               ; preds = %75
  %78 = load i32, ptr %8, align 4, !tbaa !10
  %79 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %76, i32 noundef %78)
          to label %80 unwind label %.loopexit.split-lp

80:                                               ; preds = %77
  %81 = load i32, ptr %9, align 8, !tbaa !10
  %82 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %79, i32 noundef %81)
          to label %83 unwind label %.loopexit.split-lp

83:                                               ; preds = %80
  %84 = load i32, ptr %10, align 4, !tbaa !10
  %85 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %82, i32 noundef %84)
          to label %.loopexit54 unwind label %.loopexit.split-lp

.loopexit:                                        ; preds = %87
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %86

.loopexit.split-lp:                               ; preds = %75, %77, %80, %83, %._crit_edge79
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %86

86:                                               ; preds = %.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #8
  br label %95

87:                                               ; preds = %61
  %88 = invoke noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef nonnull %3, ptr noundef nonnull %11)
          to label %89 unwind label %.loopexit

89:                                               ; preds = %87
  br i1 %88, label %61, label %.loopexit54, !llvm.loop !12

.loopexit54:                                      ; preds = %89, %83
  %90 = icmp sgt i32 %.038.lcssa, 0
  br i1 %90, label %.lr.ph78, label %._crit_edge79

._crit_edge79:                                    ; preds = %.lr.ph78, %.loopexit54
  %91 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %94 unwind label %.loopexit.split-lp

.lr.ph78:                                         ; preds = %.loopexit54, %.lr.ph78
  %.076 = phi i32 [ %93, %.lr.ph78 ], [ 0, %.loopexit54 ]
  %92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %93 = add nuw nsw i32 %.076, 1
  %exitcond.not = icmp eq i32 %93, %.038.lcssa
  br i1 %exitcond.not, label %._crit_edge79, label %.lr.ph78, !llvm.loop !13

94:                                               ; preds = %._crit_edge79
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #8
  ret i32 0

95:                                               ; preds = %86, %21, %14
  %.pn = phi { ptr, i32 } [ %22, %21 ], [ %lpad.phi, %86 ], [ %15, %14 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  br label %96

96:                                               ; preds = %95, %12
  %.pn.pn = phi { ptr, i32 } [ %.pn, %95 ], [ %13, %12 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn.pn
}

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #4

; Function Attrs: mustprogress 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) #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

; 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 nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

attributes #0 = { 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 #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 = { 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 = { 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { "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 = { nofree nounwind "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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = distinct !{!12, !9}
!13 = distinct !{!13, !9}


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