; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/31 Beta Division 2/Problem B (B)

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

@l = external dso_local global i32, align 4
@flag = external dso_local global i32, align 4
@len = external dso_local global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z3resB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_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) @_Z1sB5cxx11)
  %5 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef 0)
  %6 = load i8, ptr %5, align 1, !tbaa !5
  %7 = sext i8 %6 to i32
  %8 = icmp eq i32 %7, 64
  br i1 %8, label %9, label %12

9:                                                ; preds = %0
  %10 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %11 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  br label %153

12:                                               ; preds = %0
  %13 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #6
  %14 = trunc i64 %13 to i32
  store i32 %14, ptr @l, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %15

15:                                               ; preds = %134, %12
  %16 = load i32, ptr %2, align 4, !tbaa !8
  %17 = load i32, ptr @l, align 4, !tbaa !8
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  store i32 2, ptr %3, align 4
  br label %137

20:                                               ; preds = %15
  br label %21

21:                                               ; preds = %34, %20
  %22 = load i32, ptr %2, align 4, !tbaa !8
  %23 = load i32, ptr @l, align 4, !tbaa !8
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %25, label %32

25:                                               ; preds = %21
  %26 = load i32, ptr %2, align 4, !tbaa !8
  %27 = sext i32 %26 to i64
  %28 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %27)
  %29 = load i8, ptr %28, align 1, !tbaa !5
  %30 = sext i8 %29 to i32
  %31 = icmp ne i32 %30, 64
  br label %32

32:                                               ; preds = %25, %21
  %33 = phi i1 [ false, %21 ], [ %31, %25 ]
  br i1 %33, label %34, label %44

34:                                               ; preds = %32
  %35 = load i32, ptr %2, align 4, !tbaa !8
  %36 = sext i32 %35 to i64
  %37 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %36)
  %38 = load i8, ptr %37, align 1, !tbaa !5
  %39 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i8 noundef signext %38)
  %40 = load i32, ptr @len, align 4, !tbaa !8
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr @len, align 4, !tbaa !8
  %42 = load i32, ptr %2, align 4, !tbaa !8
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %2, align 4, !tbaa !8
  br label %21, !llvm.loop !10

44:                                               ; preds = %32
  %45 = load i32, ptr %2, align 4, !tbaa !8
  %46 = load i32, ptr @l, align 4, !tbaa !8
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %48, label %63

48:                                               ; preds = %44
  %49 = load i32, ptr %2, align 4, !tbaa !8
  %50 = sext i32 %49 to i64
  %51 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %50)
  %52 = load i8, ptr %51, align 1, !tbaa !5
  %53 = sext i8 %52 to i32
  %54 = icmp eq i32 %53, 64
  br i1 %54, label %55, label %63

55:                                               ; preds = %48
  %56 = load i32, ptr %2, align 4, !tbaa !8
  %57 = sext i32 %56 to i64
  %58 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %57)
  %59 = load i8, ptr %58, align 1, !tbaa !5
  %60 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i8 noundef signext %59)
  %61 = load i32, ptr @len, align 4, !tbaa !8
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr @len, align 4, !tbaa !8
  store i32 1, ptr @flag, align 4, !tbaa !8
  br label %63

63:                                               ; preds = %55, %48, %44
  %64 = load i32, ptr @flag, align 4, !tbaa !8
  %65 = icmp eq i32 %64, 0
  br i1 %65, label %66, label %69

66:                                               ; preds = %63
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %137

69:                                               ; preds = %63
  %70 = load i32, ptr %2, align 4, !tbaa !8
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %2, align 4, !tbaa !8
  br label %72

72:                                               ; preds = %130, %69
  %73 = load i32, ptr %2, align 4, !tbaa !8
  %74 = load i32, ptr @l, align 4, !tbaa !8
  %75 = icmp slt i32 %73, %74
  br i1 %75, label %76, label %133

76:                                               ; preds = %72
  %77 = load i32, ptr %2, align 4, !tbaa !8
  %78 = sext i32 %77 to i64
  %79 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %78)
  %80 = load i8, ptr %79, align 1, !tbaa !5
  %81 = sext i8 %80 to i32
  %82 = icmp ne i32 %81, 64
  br i1 %82, label %83, label %91

83:                                               ; preds = %76
  %84 = load i32, ptr %2, align 4, !tbaa !8
  %85 = sext i32 %84 to i64
  %86 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %85)
  %87 = load i8, ptr %86, align 1, !tbaa !5
  %88 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i8 noundef signext %87)
  %89 = load i32, ptr @len, align 4, !tbaa !8
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr @len, align 4, !tbaa !8
  br label %129

91:                                               ; preds = %76
  %92 = load i32, ptr %2, align 4, !tbaa !8
  %93 = sub nsw i32 %92, 1
  %94 = sext i32 %93 to i64
  %95 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %94)
  %96 = load i8, ptr %95, align 1, !tbaa !5
  %97 = sext i8 %96 to i32
  %98 = icmp ne i32 %97, 64
  br i1 %98, label %99, label %125

99:                                               ; preds = %91
  %100 = load i32, ptr %2, align 4, !tbaa !8
  %101 = sub nsw i32 %100, 2
  %102 = sext i32 %101 to i64
  %103 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %102)
  %104 = load i8, ptr %103, align 1, !tbaa !5
  %105 = sext i8 %104 to i32
  %106 = icmp ne i32 %105, 64
  br i1 %106, label %107, label %125

107:                                              ; preds = %99
  %108 = load i32, ptr @len, align 4, !tbaa !8
  %109 = sub nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef %110)
  store i8 44, ptr %111, align 1, !tbaa !5
  %112 = load i32, ptr %2, align 4, !tbaa !8
  %113 = sub nsw i32 %112, 1
  %114 = sext i32 %113 to i64
  %115 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %114)
  %116 = load i8, ptr %115, align 1, !tbaa !5
  %117 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i8 noundef signext %116)
  %118 = load i32, ptr %2, align 4, !tbaa !8
  %119 = sext i32 %118 to i64
  %120 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %119)
  %121 = load i8, ptr %120, align 1, !tbaa !5
  %122 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i8 noundef signext %121)
  %123 = load i32, ptr @len, align 4, !tbaa !8
  %124 = add nsw i32 %123, 2
  store i32 %124, ptr @len, align 4, !tbaa !8
  br label %128

125:                                              ; preds = %99, %91
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %126, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %137

128:                                              ; preds = %107
  br label %129

129:                                              ; preds = %128, %83
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %2, align 4, !tbaa !8
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %2, align 4, !tbaa !8
  br label %72, !llvm.loop !12

133:                                              ; preds = %72
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %2, align 4, !tbaa !8
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %2, align 4, !tbaa !8
  br label %15, !llvm.loop !13

137:                                              ; preds = %125, %66, %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %138 = load i32, ptr %3, align 4
  switch i32 %138, label %155 [
    i32 2, label %139
    i32 1, label %153
  ]

139:                                              ; preds = %137
  %140 = load i32, ptr @len, align 4, !tbaa !8
  %141 = sub nsw i32 %140, 1
  %142 = sext i32 %141 to i64
  %143 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %142)
  %144 = load i8, ptr %143, align 1, !tbaa !5
  %145 = sext i8 %144 to i32
  %146 = icmp eq i32 %145, 64
  br i1 %146, label %147, label %150

147:                                              ; preds = %139
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %148, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  br label %153

150:                                              ; preds = %139
  %151 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11)
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %151, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  br label %153

153:                                              ; preds = %150, %147, %137, %9
  %154 = load i32, ptr %1, align 4
  ret i32 %154

155:                                              ; preds = %137
  unreachable
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #1

; 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_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 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)) #3

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

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

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

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

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

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

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

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


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

@l = external dso_local local_unnamed_addr global i32, align 4
@flag = external dso_local local_unnamed_addr global i32, align 4
@len = external dso_local local_unnamed_addr global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z3resB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_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) @_Z1sB5cxx11)
  %2 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef 0)
  %3 = load i8, ptr %2, align 1, !tbaa !5
  %4 = icmp eq i8 %3, 64
  br i1 %4, label %5, label %7

5:                                                ; preds = %0
  %6 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  br label %.thread

7:                                                ; preds = %0
  %8 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %9 = trunc i64 %8 to i32
  store i32 %9, ptr @l, align 4, !tbaa !8
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.preheader29, label %._crit_edge40

.preheader29:                                     ; preds = %7, %._crit_edge
  %11 = phi i32 [ %75, %._crit_edge ], [ %9, %7 ]
  %.02039 = phi i32 [ %76, %._crit_edge ], [ 0, %7 ]
  %12 = icmp slt i32 %.02039, %11
  br i1 %12, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %.preheader29
  %13 = sext i32 %.02039 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %16
  %indvars.iv = phi i64 [ %13, %.lr.ph.preheader ], [ %indvars.iv.next, %16 ]
  %14 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv)
  %15 = load i8, ptr %14, align 1, !tbaa !5
  %.not = icmp eq i8 %15, 64
  br i1 %.not, label %.lr.ph..critedge.loopexit_crit_edge, label %16

.lr.ph..critedge.loopexit_crit_edge:              ; preds = %.lr.ph
  %.pre.pre = load i32, ptr @l, align 4, !tbaa !8
  br label %.critedge.loopexit

16:                                               ; preds = %.lr.ph
  %17 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv)
  %18 = load i8, ptr %17, align 1, !tbaa !5
  %19 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i8 noundef signext %18)
  %20 = load i32, ptr @len, align 4, !tbaa !8
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr @len, align 4, !tbaa !8
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %22 = load i32, ptr @l, align 4, !tbaa !8
  %23 = sext i32 %22 to i64
  %24 = icmp slt i64 %indvars.iv.next, %23
  br i1 %24, label %.lr.ph, label %.critedge.loopexit, !llvm.loop !10

.critedge.loopexit:                               ; preds = %16, %.lr.ph..critedge.loopexit_crit_edge
  %.pre = phi i32 [ %.pre.pre, %.lr.ph..critedge.loopexit_crit_edge ], [ %22, %16 ]
  %.1.lcssa.ph.in = phi i64 [ %indvars.iv, %.lr.ph..critedge.loopexit_crit_edge ], [ %indvars.iv.next, %16 ]
  %.1.lcssa.ph = trunc i64 %.1.lcssa.ph.in to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.preheader29
  %25 = phi i32 [ %11, %.preheader29 ], [ %.pre, %.critedge.loopexit ]
  %.1.lcssa = phi i32 [ %.02039, %.preheader29 ], [ %.1.lcssa.ph, %.critedge.loopexit ]
  %26 = icmp slt i32 %.1.lcssa, %25
  br i1 %26, label %27, label %37

27:                                               ; preds = %.critedge
  %28 = sext i32 %.1.lcssa to i64
  %29 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %28)
  %30 = load i8, ptr %29, align 1, !tbaa !5
  %31 = icmp eq i8 %30, 64
  br i1 %31, label %.thread48, label %37

.thread48:                                        ; preds = %27
  %32 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %28)
  %33 = load i8, ptr %32, align 1, !tbaa !5
  %34 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i8 noundef signext %33)
  %35 = load i32, ptr @len, align 4, !tbaa !8
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr @len, align 4, !tbaa !8
  store i32 1, ptr @flag, align 4, !tbaa !8
  br label %.preheader

37:                                               ; preds = %27, %.critedge
  %.pr = load i32, ptr @flag, align 4, !tbaa !8
  %38 = icmp eq i32 %.pr, 0
  br i1 %38, label %42, label %.preheader

.preheader:                                       ; preds = %.thread48, %37
  %.234 = add nsw i32 %.1.lcssa, 1
  %39 = load i32, ptr @l, align 4, !tbaa !8
  %40 = icmp slt i32 %.234, %39
  br i1 %40, label %.lr.ph37.preheader, label %._crit_edge

.lr.ph37.preheader:                               ; preds = %.preheader
  %41 = sext i32 %.234 to i64
  br label %.lr.ph37

42:                                               ; preds = %37
  %43 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  br label %.thread

.lr.ph37:                                         ; preds = %.lr.ph37.preheader, %65
  %indvars.iv43 = phi i64 [ %41, %.lr.ph37.preheader ], [ %indvars.iv.next44, %65 ]
  %.2.in35 = phi i32 [ %.1.lcssa, %.lr.ph37.preheader ], [ %74, %65 ]
  %44 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv43)
  %45 = load i8, ptr %44, align 1, !tbaa !5
  %.not23 = icmp eq i8 %45, 64
  br i1 %.not23, label %46, label %65

46:                                               ; preds = %.lr.ph37
  %47 = sext i32 %.2.in35 to i64
  %48 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %47)
  %49 = load i8, ptr %48, align 1, !tbaa !5
  %.not24 = icmp eq i8 %49, 64
  br i1 %.not24, label %63, label %50

50:                                               ; preds = %46
  %51 = add nsw i32 %.2.in35, -1
  %52 = sext i32 %51 to i64
  %53 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %52)
  %54 = load i8, ptr %53, align 1, !tbaa !5
  %.not25 = icmp eq i8 %54, 64
  br i1 %.not25, label %63, label %55

55:                                               ; preds = %50
  %56 = load i32, ptr @len, align 4, !tbaa !8
  %57 = add nsw i32 %56, -1
  %58 = sext i32 %57 to i64
  %59 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef %58)
  store i8 44, ptr %59, align 1, !tbaa !5
  %60 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %47)
  %61 = load i8, ptr %60, align 1, !tbaa !5
  %62 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i8 noundef signext %61)
  br label %65

63:                                               ; preds = %50, %46
  %64 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  br label %.thread

65:                                               ; preds = %.lr.ph37, %55
  %.sink52 = phi i32 [ 2, %55 ], [ 1, %.lr.ph37 ]
  %66 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv43)
  %67 = load i8, ptr %66, align 1, !tbaa !5
  %68 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i8 noundef signext %67)
  %69 = load i32, ptr @len, align 4, !tbaa !8
  %70 = add nsw i32 %69, %.sink52
  store i32 %70, ptr @len, align 4, !tbaa !8
  %indvars.iv.next44 = add nsw i64 %indvars.iv43, 1
  %71 = load i32, ptr @l, align 4, !tbaa !8
  %72 = sext i32 %71 to i64
  %73 = icmp slt i64 %indvars.iv.next44, %72
  %74 = trunc nsw i64 %indvars.iv43 to i32
  br i1 %73, label %.lr.ph37, label %._crit_edge, !llvm.loop !12

._crit_edge:                                      ; preds = %65, %.preheader
  %75 = phi i32 [ %39, %.preheader ], [ %71, %65 ]
  %.2.in.lcssa = phi i32 [ %.1.lcssa, %.preheader ], [ %74, %65 ]
  %76 = add nsw i32 %.2.in.lcssa, 2
  %77 = icmp slt i32 %76, %75
  br i1 %77, label %.preheader29, label %._crit_edge40, !llvm.loop !13

._crit_edge40:                                    ; preds = %._crit_edge, %7
  %78 = load i32, ptr @len, align 4, !tbaa !8
  %79 = add nsw i32 %78, -1
  %80 = sext i32 %79 to i64
  %81 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %80)
  %82 = load i8, ptr %81, align 1, !tbaa !5
  %83 = icmp eq i8 %82, 64
  br i1 %83, label %84, label %86

84:                                               ; preds = %._crit_edge40
  %85 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  br label %.thread

86:                                               ; preds = %._crit_edge40
  %87 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11)
  br label %.thread

.thread:                                          ; preds = %63, %42, %86, %84, %5
  %.sink = phi ptr [ %64, %63 ], [ %43, %42 ], [ %87, %86 ], [ %85, %84 ], [ %6, %5 ]
  %88 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %.sink, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_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 #1

; 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_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

; 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 #4 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)) #3

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

; 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = { 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 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}


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