; LLVM IR from fritzsedlazeck/SURVIVOR :: src/simulator (Pac_Simulator)

; 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 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%"class.std::__cxx11::basic_stringstream" = type { %"class.std::basic_iostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_iostream.base" = type { %"class.std::basic_istream.base", %"class.std::basic_ostream.base" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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 }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef signext i8 @_Z3insv() #0

; Function Attrs: nounwind
declare i32 @rand() #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z9print_samRP8_IO_FILENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiS7_S7_b(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i32 noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #0

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8rev_compRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) #3

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z14simulate_readsNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_RP8_IO_FILES7_S7_(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #3 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca i8, align 1
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.std::__cxx11::basic_string", align 8
  %20 = alloca %"class.std::allocator", align 1
  %21 = alloca i32, align 4
  %22 = alloca %"class.std::__cxx11::basic_stringstream", align 8
  %23 = alloca i8, align 1
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca %"class.std::__cxx11::basic_string", align 8
  %28 = alloca %"class.std::__cxx11::basic_string", align 8
  %29 = alloca %"class.std::__cxx11::basic_string", align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store i64 0, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %30 = call i32 @rand() #7
  %31 = srem i32 %30, 1000
  %32 = add nsw i32 20000, %31
  store i32 %32, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %33 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %34 = trunc i64 %33 to i32
  store i32 %34, ptr %14, align 4, !tbaa !11
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %36 = load i32, ptr %35, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  store i32 %36, ptr %12, align 4, !tbaa !11
  br label %37

37:                                               ; preds = %303, %5
  %38 = load i64, ptr %11, align 8, !tbaa !9
  %39 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %40 = icmp ult i64 %38, %39
  br i1 %40, label %41, label %306

41:                                               ; preds = %37
  %42 = load i64, ptr %11, align 8, !tbaa !9
  %43 = load i32, ptr %12, align 4, !tbaa !11
  %44 = sext i32 %43 to i64
  %45 = add i64 %42, %44
  %46 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %47 = icmp ule i64 %45, %46
  br i1 %47, label %48, label %303

48:                                               ; preds = %41
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef @.str.1, i32 noundef 64) #7
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = load ptr, ptr %52, align 8, !tbaa !5
  %54 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #7
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef @.str, ptr noundef %54) #7
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = load ptr, ptr %56, align 8, !tbaa !5
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef @.str.1, i32 noundef 95) #7
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = load i64, ptr %11, align 8, !tbaa !9
  %62 = trunc i64 %61 to i32
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef @.str.2, i32 noundef %62) #7
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef @.str.1, i32 noundef 10) #7
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  %68 = load ptr, ptr %67, align 8, !tbaa !5
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef @.str.1, i32 noundef 62) #7
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = load ptr, ptr %70, align 8, !tbaa !5
  %72 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #7
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef @.str, ptr noundef %72) #7
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = load ptr, ptr %74, align 8, !tbaa !5
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef @.str.1, i32 noundef 95) #7
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = load ptr, ptr %77, align 8, !tbaa !5
  %79 = load i64, ptr %11, align 8, !tbaa !9
  %80 = trunc i64 %79 to i32
  %81 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef @.str.2, i32 noundef %80) #7
  %82 = load ptr, ptr %10, align 8, !tbaa !5
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef @.str.1, i32 noundef 10) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #7
  %85 = load i64, ptr %11, align 8, !tbaa !9
  %86 = load i32, ptr %12, align 4, !tbaa !11
  %87 = mul nsw i32 %86, 2
  %88 = sext i32 %87 to i64
  call void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %15, ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %85, i64 noundef %88)
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #7
  store i8 1, ptr %16, align 1, !tbaa !13
  %89 = call i32 @rand() #7
  %90 = srem i32 %89, 100
  %91 = icmp slt i32 %90, 50
  br i1 %91, label %92, label %98

92:                                               ; preds = %48
  store i8 0, ptr %16, align 1, !tbaa !13
  invoke void @_Z8rev_compRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %15)
          to label %93 unwind label %94

93:                                               ; preds = %92
  br label %98

94:                                               ; preds = %92
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %17, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %18, align 4
  br label %302

98:                                               ; preds = %93, %48
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef @.str.8, ptr noundef nonnull align 1 dereferenceable(1) %20)
          to label %99 unwind label %145

99:                                               ; preds = %98
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 1, ptr %21, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 392, ptr %22) #7
  invoke void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %22)
          to label %100 unwind label %149

100:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #7
  store i8 32, ptr %23, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  store i64 0, ptr %24, align 8, !tbaa !9
  br label %101

101:                                              ; preds = %214, %100
  %102 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  %103 = trunc i64 %102 to i32
  %104 = load i32, ptr %12, align 4, !tbaa !11
  %105 = icmp slt i32 %103, %104
  br i1 %105, label %106, label %110

106:                                              ; preds = %101
  %107 = load i64, ptr %24, align 8, !tbaa !9
  %108 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %15) #7
  %109 = icmp ult i64 %107, %108
  br label %110

110:                                              ; preds = %106, %101
  %111 = phi i1 [ false, %101 ], [ %109, %106 ]
  br i1 %111, label %112, label %215

112:                                              ; preds = %110
  %113 = call i32 @rand() #7
  %114 = srem i32 %113, 100
  %115 = icmp slt i32 %114, 15
  br i1 %115, label %116, label %186

116:                                              ; preds = %112
  %117 = load i64, ptr %24, align 8, !tbaa !9
  %118 = icmp ugt i64 %117, 0
  br i1 %118, label %119, label %186

119:                                              ; preds = %116
  %120 = load i64, ptr %24, align 8, !tbaa !9
  %121 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %15) #7
  %122 = sub i64 %121, 1
  %123 = icmp ult i64 %120, %122
  br i1 %123, label %124, label %186

124:                                              ; preds = %119
  %125 = call i32 @rand() #7
  %126 = srem i32 %125, 100
  %127 = icmp slt i32 %126, 40
  br i1 %127, label %128, label %162

128:                                              ; preds = %124
  %129 = load i8, ptr %23, align 1, !tbaa !15
  %130 = sext i8 %129 to i32
  %131 = icmp ne i32 %130, 68
  br i1 %131, label %132, label %157

132:                                              ; preds = %128
  %133 = load i8, ptr %23, align 1, !tbaa !15
  %134 = sext i8 %133 to i32
  %135 = icmp ne i32 %134, 32
  br i1 %135, label %136, label %157

136:                                              ; preds = %132
  %137 = getelementptr inbounds i8, ptr %22, i64 16
  %138 = load i32, ptr %21, align 4, !tbaa !11
  %139 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %137, i32 noundef %138)
          to label %140 unwind label %153

140:                                              ; preds = %136
  %141 = getelementptr inbounds i8, ptr %22, i64 16
  %142 = load i8, ptr %23, align 1, !tbaa !15
  %143 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %141, i8 noundef signext %142)
          to label %144 unwind label %153

144:                                              ; preds = %140
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %157

145:                                              ; preds = %98
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %17, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %18, align 4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #7
  br label %301

149:                                              ; preds = %99
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %17, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %18, align 4
  br label %300

153:                                              ; preds = %278, %224, %219, %208, %203, %198, %194, %179, %174, %170, %140, %136
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %17, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %18, align 4
  br label %299

157:                                              ; preds = %144, %132, %128
  %158 = load i32, ptr %21, align 4, !tbaa !11
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %21, align 4, !tbaa !11
  store i8 68, ptr %23, align 1, !tbaa !15
  %160 = load i64, ptr %24, align 8, !tbaa !9
  %161 = add i64 %160, 1
  store i64 %161, ptr %24, align 8, !tbaa !9
  br label %185

162:                                              ; preds = %124
  %163 = load i8, ptr %23, align 1, !tbaa !15
  %164 = sext i8 %163 to i32
  %165 = icmp ne i32 %164, 73
  br i1 %165, label %166, label %179

166:                                              ; preds = %162
  %167 = load i8, ptr %23, align 1, !tbaa !15
  %168 = sext i8 %167 to i32
  %169 = icmp ne i32 %168, 32
  br i1 %169, label %170, label %179

170:                                              ; preds = %166
  %171 = getelementptr inbounds i8, ptr %22, i64 16
  %172 = load i32, ptr %21, align 4, !tbaa !11
  %173 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %171, i32 noundef %172)
          to label %174 unwind label %153

174:                                              ; preds = %170
  %175 = getelementptr inbounds i8, ptr %22, i64 16
  %176 = load i8, ptr %23, align 1, !tbaa !15
  %177 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %175, i8 noundef signext %176)
          to label %178 unwind label %153

178:                                              ; preds = %174
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %179

179:                                              ; preds = %178, %166, %162
  %180 = load i32, ptr %21, align 4, !tbaa !11
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %21, align 4, !tbaa !11
  %182 = call noundef signext i8 @_Z3insv()
  %183 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %19, i8 noundef signext %182)
          to label %184 unwind label %153

184:                                              ; preds = %179
  store i8 73, ptr %23, align 1, !tbaa !15
  br label %185

185:                                              ; preds = %184, %157
  br label %214

186:                                              ; preds = %119, %116, %112
  %187 = load i8, ptr %23, align 1, !tbaa !15
  %188 = sext i8 %187 to i32
  %189 = icmp ne i32 %188, 77
  br i1 %189, label %190, label %203

190:                                              ; preds = %186
  %191 = load i8, ptr %23, align 1, !tbaa !15
  %192 = sext i8 %191 to i32
  %193 = icmp ne i32 %192, 32
  br i1 %193, label %194, label %203

194:                                              ; preds = %190
  %195 = getelementptr inbounds i8, ptr %22, i64 16
  %196 = load i32, ptr %21, align 4, !tbaa !11
  %197 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %195, i32 noundef %196)
          to label %198 unwind label %153

198:                                              ; preds = %194
  %199 = getelementptr inbounds i8, ptr %22, i64 16
  %200 = load i8, ptr %23, align 1, !tbaa !15
  %201 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %199, i8 noundef signext %200)
          to label %202 unwind label %153

202:                                              ; preds = %198
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %203

203:                                              ; preds = %202, %190, %186
  store i8 77, ptr %23, align 1, !tbaa !15
  %204 = load i32, ptr %21, align 4, !tbaa !11
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %21, align 4, !tbaa !11
  %206 = load i64, ptr %24, align 8, !tbaa !9
  %207 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %15, i64 noundef %206)
          to label %208 unwind label %153

208:                                              ; preds = %203
  %209 = load i8, ptr %207, align 1, !tbaa !15
  %210 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %19, i8 noundef signext %209)
          to label %211 unwind label %153

211:                                              ; preds = %208
  %212 = load i64, ptr %24, align 8, !tbaa !9
  %213 = add i64 %212, 1
  store i64 %213, ptr %24, align 8, !tbaa !9
  br label %214

214:                                              ; preds = %211, %185
  br label %101, !llvm.loop !16

215:                                              ; preds = %110
  %216 = load i32, ptr %21, align 4, !tbaa !11
  %217 = sub nsw i32 %216, 1
  %218 = icmp sgt i32 %217, 0
  br i1 %218, label %219, label %229

219:                                              ; preds = %215
  %220 = getelementptr inbounds i8, ptr %22, i64 16
  %221 = load i32, ptr %21, align 4, !tbaa !11
  %222 = sub nsw i32 %221, 1
  %223 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %220, i32 noundef %222)
          to label %224 unwind label %153

224:                                              ; preds = %219
  %225 = getelementptr inbounds i8, ptr %22, i64 16
  %226 = load i8, ptr %23, align 1, !tbaa !15
  %227 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %225, i8 noundef signext %226)
          to label %228 unwind label %153

228:                                              ; preds = %224
  br label %229

229:                                              ; preds = %228, %215
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  store i64 0, ptr %25, align 8, !tbaa !9
  br label %230

230:                                              ; preds = %252, %229
  %231 = load i64, ptr %25, align 8, !tbaa !9
  %232 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  %233 = icmp ult i64 %231, %232
  br i1 %233, label %235, label %234

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

235:                                              ; preds = %230
  %236 = load ptr, ptr %8, align 8, !tbaa !5
  %237 = load ptr, ptr %236, align 8, !tbaa !5
  %238 = load i64, ptr %25, align 8, !tbaa !9
  %239 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %19, i64 noundef %238)
          to label %240 unwind label %255

240:                                              ; preds = %235
  %241 = load i8, ptr %239, align 1, !tbaa !15
  %242 = sext i8 %241 to i32
  %243 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %237, ptr noundef @.str.1, i32 noundef %242) #7
  %244 = load ptr, ptr %10, align 8, !tbaa !5
  %245 = load ptr, ptr %244, align 8, !tbaa !5
  %246 = load i64, ptr %25, align 8, !tbaa !9
  %247 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %19, i64 noundef %246)
          to label %248 unwind label %255

248:                                              ; preds = %240
  %249 = load i8, ptr %247, align 1, !tbaa !15
  %250 = sext i8 %249 to i32
  %251 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %245, ptr noundef @.str.1, i32 noundef %250) #7
  br label %252

252:                                              ; preds = %248
  %253 = load i64, ptr %25, align 8, !tbaa !9
  %254 = add i64 %253, 1
  store i64 %254, ptr %25, align 8, !tbaa !9
  br label %230, !llvm.loop !18

255:                                              ; preds = %240, %235
  %256 = landingpad { ptr, i32 }
          cleanup
  %257 = extractvalue { ptr, i32 } %256, 0
  store ptr %257, ptr %17, align 8
  %258 = extractvalue { ptr, i32 } %256, 1
  store i32 %258, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %299

259:                                              ; preds = %234
  %260 = load ptr, ptr %8, align 8, !tbaa !5
  %261 = load ptr, ptr %260, align 8, !tbaa !5
  %262 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %261, ptr noundef @.str, ptr noundef @.str.9) #7
  %263 = load ptr, ptr %10, align 8, !tbaa !5
  %264 = load ptr, ptr %263, align 8, !tbaa !5
  %265 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %264, ptr noundef @.str, ptr noundef @.str.10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  store i64 0, ptr %26, align 8, !tbaa !9
  br label %266

266:                                              ; preds = %275, %259
  %267 = load i64, ptr %26, align 8, !tbaa !9
  %268 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  %269 = icmp ult i64 %267, %268
  br i1 %269, label %271, label %270

270:                                              ; preds = %266
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  br label %278

271:                                              ; preds = %266
  %272 = load ptr, ptr %8, align 8, !tbaa !5
  %273 = load ptr, ptr %272, align 8, !tbaa !5
  %274 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %273, ptr noundef @.str.1, i32 noundef 72) #7
  br label %275

275:                                              ; preds = %271
  %276 = load i64, ptr %26, align 8, !tbaa !9
  %277 = add i64 %276, 1
  store i64 %277, ptr %26, align 8, !tbaa !9
  br label %266, !llvm.loop !19

278:                                              ; preds = %270
  %279 = load ptr, ptr %8, align 8, !tbaa !5
  %280 = load ptr, ptr %279, align 8, !tbaa !5
  %281 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %280, ptr noundef @.str.1, i32 noundef 10) #7
  %282 = load ptr, ptr %9, align 8, !tbaa !5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %27, ptr noundef nonnull align 8 dereferenceable(32) %0)
          to label %283 unwind label %153

283:                                              ; preds = %278
  %284 = load i64, ptr %11, align 8, !tbaa !9
  %285 = trunc i64 %284 to i32
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %28, ptr noundef nonnull align 8 dereferenceable(32) %19)
          to label %286 unwind label %290

286:                                              ; preds = %283
  invoke void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %29, ptr noundef nonnull align 8 dereferenceable(128) %22)
          to label %287 unwind label %294

287:                                              ; preds = %286
  %288 = load i8, ptr %16, align 1, !tbaa !13, !range !20, !noundef !21
  %289 = trunc i8 %288 to i1
  call void @_Z9print_samRP8_IO_FILENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiS7_S7_b(ptr noundef nonnull align 8 dereferenceable(8) %282, ptr noundef %27, i32 noundef %285, ptr noundef %28, ptr noundef %29, i1 noundef zeroext %289)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %29) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #7
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %22) #7
  call void @llvm.lifetime.end.p0(i64 392, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #7
  br label %303

290:                                              ; preds = %283
  %291 = landingpad { ptr, i32 }
          cleanup
  %292 = extractvalue { ptr, i32 } %291, 0
  store ptr %292, ptr %17, align 8
  %293 = extractvalue { ptr, i32 } %291, 1
  store i32 %293, ptr %18, align 4
  br label %298

294:                                              ; preds = %286
  %295 = landingpad { ptr, i32 }
          cleanup
  %296 = extractvalue { ptr, i32 } %295, 0
  store ptr %296, ptr %17, align 8
  %297 = extractvalue { ptr, i32 } %295, 1
  store i32 %297, ptr %18, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #7
  br label %298

298:                                              ; preds = %294, %290
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %27) #7
  br label %299

299:                                              ; preds = %298, %255, %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #7
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %22) #7
  br label %300

300:                                              ; preds = %299, %149
  call void @llvm.lifetime.end.p0(i64 392, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  br label %301

301:                                              ; preds = %300, %145
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #7
  br label %302

302:                                              ; preds = %301, %94
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %307

303:                                              ; preds = %287, %41
  %304 = load i64, ptr %11, align 8, !tbaa !9
  %305 = add i64 %304, 1000
  store i64 %305, ptr %11, align 8, !tbaa !9
  br label %37, !llvm.loop !22

306:                                              ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  ret void

307:                                              ; preds = %302
  %308 = load ptr, ptr %17, align 8
  %309 = load i32, ptr %18, align 4
  %310 = insertvalue { ptr, i32 } poison, ptr %308, 0
  %311 = insertvalue { ptr, i32 } %310, i32 %309, 1
  resume { ptr, i32 } %311
}

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

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i64 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(128)) #3 align 2

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

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

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

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

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


; 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 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%"class.std::__cxx11::basic_stringstream" = type { %"class.std::basic_iostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_iostream.base" = type { %"class.std::basic_istream.base", %"class.std::basic_ostream.base" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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 }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef signext i8 @_Z3insv() local_unnamed_addr #0

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z9print_samRP8_IO_FILENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiS7_S7_b(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i32 noundef, ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #0

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8rev_compRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z14simulate_readsNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_RP8_IO_FILES7_S7_(ptr noundef %0, ptr noundef %1, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %4) local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator", align 1
  %11 = alloca %"class.std::__cxx11::basic_stringstream", align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  %15 = tail call i32 @rand() #8
  %16 = srem i32 %15, 1000
  %17 = add nsw i32 %16, 20000
  store i32 %17, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  %18 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  %19 = trunc i64 %18 to i32
  store i32 %19, ptr %7, align 4, !tbaa !5
  %20 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %21 = load i32, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  %22 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  %.not113 = icmp eq i64 %22, 0
  br i1 %.not113, label %._crit_edge112, label %.lr.ph111

.lr.ph111:                                        ; preds = %5
  %23 = sext i32 %21 to i64
  %24 = shl nsw i32 %21, 1
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds i8, ptr %11, i64 16
  br label %27

27:                                               ; preds = %.lr.ph111, %158
  %.086109 = phi i64 [ 0, %.lr.ph111 ], [ %159, %158 ]
  %28 = add i64 %.086109, %23
  %29 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  %.not = icmp ugt i64 %28, %29
  br i1 %.not, label %158, label %30

30:                                               ; preds = %27
  %31 = load ptr, ptr %2, align 8, !tbaa !9
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.1, i32 noundef 64) #8
  %33 = load ptr, ptr %2, align 8, !tbaa !9
  %34 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #8
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef nonnull @.str, ptr noundef %34) #8
  %36 = load ptr, ptr %2, align 8, !tbaa !9
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef nonnull @.str.1, i32 noundef 95) #8
  %38 = load ptr, ptr %2, align 8, !tbaa !9
  %39 = trunc i64 %.086109 to i32
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef nonnull @.str.2, i32 noundef %39) #8
  %41 = load ptr, ptr %2, align 8, !tbaa !9
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef nonnull @.str.1, i32 noundef 10) #8
  %43 = load ptr, ptr %4, align 8, !tbaa !9
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef nonnull @.str.1, i32 noundef 62) #8
  %45 = load ptr, ptr %4, align 8, !tbaa !9
  %46 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #8
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str, ptr noundef %46) #8
  %48 = load ptr, ptr %4, align 8, !tbaa !9
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.1, i32 noundef 95) #8
  %50 = load ptr, ptr %4, align 8, !tbaa !9
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.2, i32 noundef %39) #8
  %52 = load ptr, ptr %4, align 8, !tbaa !9
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str.1, i32 noundef 10) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #8
  call void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %8, ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.086109, i64 noundef %25)
  %54 = call i32 @rand() #8
  %55 = srem i32 %54, 100
  %56 = icmp sgt i32 %55, 49
  br i1 %56, label %60, label %57

57:                                               ; preds = %30
  invoke void @_Z8rev_compRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %60 unwind label %58

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

60:                                               ; preds = %57, %30
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull @.str.8, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %61 unwind label %85

61:                                               ; preds = %60
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 392, ptr nonnull %11) #8
  invoke void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %11)
          to label %.preheader unwind label %87

.preheader:                                       ; preds = %61
  %62 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  %63 = trunc i64 %62 to i32
  %64 = icmp sgt i32 %21, %63
  br i1 %64, label %.lr.ph, label %.critedge.thread

.lr.ph:                                           ; preds = %.preheader, %110
  %.07098 = phi i64 [ %.1, %110 ], [ 0, %.preheader ]
  %.07197 = phi i8 [ %.172, %110 ], [ 32, %.preheader ]
  %.07396 = phi i32 [ %.4, %110 ], [ 1, %.preheader ]
  %65 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %8) #8
  %66 = icmp ult i64 %.07098, %65
  br i1 %66, label %67, label %.critedge

67:                                               ; preds = %.lr.ph
  %68 = call i32 @rand() #8
  %69 = srem i32 %68, 100
  %70 = icmp slt i32 %69, 15
  %71 = icmp ne i64 %.07098, 0
  %or.cond = select i1 %70, i1 %71, i1 false
  br i1 %or.cond, label %72, label %99

72:                                               ; preds = %67
  %73 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %8) #8
  %74 = add i64 %73, -1
  %75 = icmp ult i64 %.07098, %74
  br i1 %75, label %76, label %99

76:                                               ; preds = %72
  %77 = call i32 @rand() #8
  %78 = srem i32 %77, 100
  %79 = icmp slt i32 %78, 40
  br i1 %79, label %80, label %91

80:                                               ; preds = %76
  switch i8 %.07197, label %81 [
    i8 68, label %89
    i8 32, label %89
  ]

81:                                               ; preds = %80
  %82 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %26, i32 noundef %.07396)
          to label %83 unwind label %.loopexit

83:                                               ; preds = %81
  %84 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %26, i8 noundef signext %.07197)
          to label %89 unwind label %.loopexit

85:                                               ; preds = %60
  %86 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #8
  br label %156

87:                                               ; preds = %61
  %88 = landingpad { ptr, i32 }
          cleanup
  br label %155

.loopexit:                                        ; preds = %81, %83, %92, %94, %96, %100, %102, %104
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %154

.loopexit.split-lp:                               ; preds = %115, %118, %._crit_edge108
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %154

89:                                               ; preds = %83, %80, %80
  %.174 = phi i32 [ %.07396, %80 ], [ %.07396, %80 ], [ 0, %83 ]
  %90 = add nuw i64 %.07098, 1
  br label %110

91:                                               ; preds = %76
  switch i8 %.07197, label %92 [
    i8 73, label %96
    i8 32, label %96
  ]

92:                                               ; preds = %91
  %93 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %26, i32 noundef %.07396)
          to label %94 unwind label %.loopexit

94:                                               ; preds = %92
  %95 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %26, i8 noundef signext %.07197)
          to label %96 unwind label %.loopexit

96:                                               ; preds = %94, %91, %91
  %.2 = phi i32 [ %.07396, %91 ], [ %.07396, %91 ], [ 0, %94 ]
  %97 = call noundef signext i8 @_Z3insv()
  %98 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %9, i8 noundef signext %97)
          to label %110 unwind label %.loopexit

99:                                               ; preds = %72, %67
  switch i8 %.07197, label %100 [
    i8 77, label %104
    i8 32, label %104
  ]

100:                                              ; preds = %99
  %101 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %26, i32 noundef %.07396)
          to label %102 unwind label %.loopexit

102:                                              ; preds = %100
  %103 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %26, i8 noundef signext %.07197)
          to label %104 unwind label %.loopexit

104:                                              ; preds = %102, %99, %99
  %.3 = phi i32 [ %.07396, %99 ], [ %.07396, %99 ], [ 0, %102 ]
  %105 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %8, i64 noundef %.07098)
  %106 = load i8, ptr %105, align 1, !tbaa !11
  %107 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %9, i8 noundef signext %106)
          to label %108 unwind label %.loopexit

108:                                              ; preds = %104
  %109 = add nuw i64 %.07098, 1
  br label %110

110:                                              ; preds = %96, %89, %108
  %.4.in = phi i32 [ %.174, %89 ], [ %.3, %108 ], [ %.2, %96 ]
  %.172 = phi i8 [ 68, %89 ], [ 77, %108 ], [ 73, %96 ]
  %.1 = phi i64 [ %90, %89 ], [ %109, %108 ], [ %.07098, %96 ]
  %.4 = add nsw i32 %.4.in, 1
  %111 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  %112 = trunc i64 %111 to i32
  %113 = icmp sgt i32 %21, %112
  br i1 %113, label %.lr.ph, label %.critedge, !llvm.loop !12

.critedge:                                        ; preds = %.lr.ph, %110
  %.073.lcssa = phi i32 [ %.07396, %.lr.ph ], [ %.4, %110 ]
  %.071.lcssa = phi i8 [ %.07197, %.lr.ph ], [ %.172, %110 ]
  %114 = icmp sgt i32 %.073.lcssa, 1
  br i1 %114, label %115, label %.critedge.thread

115:                                              ; preds = %.critedge
  %116 = add nsw i32 %.073.lcssa, -1
  %117 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %26, i32 noundef %116)
          to label %118 unwind label %.loopexit.split-lp

118:                                              ; preds = %115
  %119 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %26, i8 noundef signext %.071.lcssa)
          to label %.critedge.thread unwind label %.loopexit.split-lp

.critedge.thread:                                 ; preds = %.preheader, %118, %.critedge
  %120 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  %.not114 = icmp eq i64 %120, 0
  br i1 %.not114, label %._crit_edge, label %.lr.ph104

._crit_edge:                                      ; preds = %.lr.ph104, %.critedge.thread
  %121 = load ptr, ptr %2, align 8, !tbaa !9
  %122 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %121, ptr noundef nonnull @.str, ptr noundef nonnull @.str.9) #8
  %123 = load ptr, ptr %4, align 8, !tbaa !9
  %124 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %123, ptr noundef nonnull @.str, ptr noundef nonnull @.str.10) #8
  %125 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  %.not115 = icmp eq i64 %125, 0
  br i1 %.not115, label %._crit_edge108, label %.lr.ph107

.lr.ph104:                                        ; preds = %.critedge.thread, %.lr.ph104
  %.069103 = phi i64 [ %136, %.lr.ph104 ], [ 0, %.critedge.thread ]
  %126 = load ptr, ptr %2, align 8, !tbaa !9
  %127 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %9, i64 noundef %.069103)
  %128 = load i8, ptr %127, align 1, !tbaa !11
  %129 = sext i8 %128 to i32
  %130 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %126, ptr noundef nonnull @.str.1, i32 noundef %129) #8
  %131 = load ptr, ptr %4, align 8, !tbaa !9
  %132 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %9, i64 noundef %.069103)
  %133 = load i8, ptr %132, align 1, !tbaa !11
  %134 = sext i8 %133 to i32
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %131, ptr noundef nonnull @.str.1, i32 noundef %134) #8
  %136 = add nuw i64 %.069103, 1
  %137 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  %138 = icmp ult i64 %136, %137
  br i1 %138, label %.lr.ph104, label %._crit_edge, !llvm.loop !14

._crit_edge108:                                   ; preds = %.lr.ph107, %._crit_edge
  %139 = load ptr, ptr %2, align 8, !tbaa !9
  %140 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %139, ptr noundef nonnull @.str.1, i32 noundef 10) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(32) %0)
          to label %146 unwind label %.loopexit.split-lp

.lr.ph107:                                        ; preds = %._crit_edge, %.lr.ph107
  %.0105 = phi i64 [ %143, %.lr.ph107 ], [ 0, %._crit_edge ]
  %141 = load ptr, ptr %2, align 8, !tbaa !9
  %142 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %141, ptr noundef nonnull @.str.1, i32 noundef 72) #8
  %143 = add nuw i64 %.0105, 1
  %144 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  %145 = icmp ult i64 %143, %144
  br i1 %145, label %.lr.ph107, label %._crit_edge108, !llvm.loop !15

146:                                              ; preds = %._crit_edge108
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %147 unwind label %149

147:                                              ; preds = %146
  invoke void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %14, ptr noundef nonnull align 8 dereferenceable(128) %11)
          to label %148 unwind label %151

148:                                              ; preds = %147
  call void @_Z9print_samRP8_IO_FILENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiS7_S7_b(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull %12, i32 noundef %39, ptr noundef nonnull %13, ptr noundef nonnull %14, i1 noundef zeroext %56)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #8
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %11) #8
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %11) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #8
  br label %158

149:                                              ; preds = %146
  %150 = landingpad { ptr, i32 }
          cleanup
  br label %153

151:                                              ; preds = %147
  %152 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #8
  br label %153

153:                                              ; preds = %151, %149
  %.pn = phi { ptr, i32 } [ %152, %151 ], [ %150, %149 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #8
  br label %154

154:                                              ; preds = %.loopexit, %.loopexit.split-lp, %153
  %.pn89 = phi { ptr, i32 } [ %.pn, %153 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %11) #8
  br label %155

155:                                              ; preds = %154, %87
  %.pn89.pn = phi { ptr, i32 } [ %.pn89, %154 ], [ %88, %87 ]
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %11) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  br label %156

156:                                              ; preds = %155, %85
  %.pn89.pn.pn = phi { ptr, i32 } [ %.pn89.pn, %155 ], [ %86, %85 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #8
  br label %157

157:                                              ; preds = %156, %58
  %.pn89.pn.pn.pn = phi { ptr, i32 } [ %.pn89.pn.pn, %156 ], [ %59, %58 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #8
  resume { ptr, i32 } %.pn89.pn.pn.pn

158:                                              ; preds = %148, %27
  %159 = add i64 %.086109, 1000
  %160 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  %161 = icmp ult i64 %159, %160
  br i1 %161, label %27, label %._crit_edge112, !llvm.loop !16

._crit_edge112:                                   ; preds = %158, %5
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 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 #4 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #4 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #4 align 2

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

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

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

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass